htmlIsBooleanAttr:
  362|  12.8k|{
  363|  12.8k|    const char *str = NULL;
  364|       |
  365|  12.8k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 12.8k]
  ------------------
  366|      0|        return(0);
  367|       |
  368|       |    /*
  369|       |     * These are the HTML attributes which will be output
  370|       |     * in minimized form, i.e. `<option selected="selected">` will be
  371|       |     * output as `<option selected>`, as per XSLT 1.0 16.2 "HTML Output
  372|       |     * Method":
  373|       |     *
  374|       |     * "checked", "compact", "declare", "defer", "disabled", "ismap",
  375|       |     * "multiple", "nohref", "noresize", "noshade", "nowrap", "readonly",
  376|       |     * "selected"
  377|       |     *
  378|       |     * Additional attributes from HTML5 (not implemented yet):
  379|       |     *
  380|       |     * "allowfullscreen", "alpha", "async", "autofocus", "autoplay",
  381|       |     * "controls", "default", "formnovalidate", "inert", "itemscope",
  382|       |     * "loop", "muted", "nomodule", "novalidate", "open", "playsinline",
  383|       |     * "required", "reversed", "shadowrootdelegatesfocus",
  384|       |     * "shadowrootclonable", "shadowrootserializable",
  385|       |     * "shadowrootcustomelementregistry", "truespeed"
  386|       |     */
  387|       |
  388|  12.8k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 8.47k, False: 4.34k]
  ------------------
  389|  1.82k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 1.82k, False: 11.0k]
  ------------------
  390|  1.82k|            name += 1;
  391|  1.82k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 482, False: 1.34k]
  ------------------
  392|    218|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 218, False: 1.60k]
  ------------------
  393|    264|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 264, False: 1.55k]
  ------------------
  394|  1.82k|            }
  395|  1.82k|            break;
  396|  2.51k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 2.51k, False: 10.3k]
  ------------------
  397|  2.51k|            name += 1;
  398|  2.51k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 534, False: 1.98k]
  ------------------
  399|    409|                case 'e':
  ------------------
  |  Branch (399:17): [True: 409, False: 2.10k]
  ------------------
  400|    409|                    name += 1;
  401|    409|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 161, False: 248]
  ------------------
  402|     79|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 79, False: 330]
  ------------------
  403|     82|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 82, False: 327]
  ------------------
  404|    409|                    }
  405|    409|                    break;
  406|    409|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 125, False: 2.38k]
  ------------------
  407|  2.51k|            }
  408|  2.51k|            break;
  409|  2.51k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 626, False: 12.2k]
  ------------------
  410|    626|            str = "smap";
  411|    626|            break;
  412|    235|        case 'm':
  ------------------
  |  Branch (412:9): [True: 235, False: 12.5k]
  ------------------
  413|    235|            str = "ultiple";
  414|    235|            break;
  415|  2.81k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.81k, False: 10.0k]
  ------------------
  416|  2.81k|            name += 1;
  417|  2.81k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.53k, False: 1.28k]
  ------------------
  418|  1.53k|                break;
  419|  1.28k|            name += 1;
  420|  1.28k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.09k, False: 195]
  ------------------
  421|    198|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 198, False: 1.08k]
  ------------------
  422|    476|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 476, False: 809]
  ------------------
  423|    197|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 197, False: 1.08k]
  ------------------
  424|    219|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 219, False: 1.06k]
  ------------------
  425|  1.28k|            }
  426|  1.28k|            break;
  427|  1.28k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 240, False: 12.5k]
  ------------------
  428|    240|            str = "eadonly";
  429|    240|            break;
  430|    224|        case 's':
  ------------------
  |  Branch (430:9): [True: 224, False: 12.6k]
  ------------------
  431|    224|            str = "elected";
  432|    224|            break;
  433|  12.8k|    }
  434|       |
  435|  12.8k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 9.64k, False: 3.18k]
  ------------------
  436|  9.64k|        return(0);
  437|       |
  438|  3.18k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.18k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  12.8k|}

xmlSAX2InternalSubset:
  242|  21.8k|{
  243|  21.8k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  21.8k|    xmlDtdPtr dtd;
  245|  21.8k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 21.8k]
  ------------------
  246|       |
  247|  21.8k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 21.8k]
  ------------------
  248|      0|	return;
  249|  21.8k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 21.8k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  21.8k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  21.8k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 21.8k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  21.8k|    ctxt->myDoc->intSubset =
  258|  21.8k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  21.8k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 7, False: 21.7k]
  ------------------
  260|      7|        xmlSAX2ErrMemory(ctxt);
  261|  21.8k|}
xmlSAX2ExternalSubset:
  274|  19.3k|{
  275|  19.3k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  19.3k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 19.3k]
  ------------------
  277|  19.3k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 3.82k, False: 15.4k]
  ------------------
  278|  3.82k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 3.54k, False: 280]
  ------------------
  279|  3.54k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|  1.34k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 2.19k, False: 1.34k]
  |  Branch (279:31): [True: 1.12k, False: 225]
  ------------------
  280|  3.32k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 3.25k, False: 65]
  |  Branch (280:24): [True: 3.25k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  3.25k|	xmlParserInputPtr oldinput;
  285|  3.25k|	int oldinputNr;
  286|  3.25k|	int oldinputMax;
  287|  3.25k|	xmlParserInputPtr *oldinputTab;
  288|  3.25k|	xmlParserInputPtr input = NULL;
  289|  3.25k|	xmlChar *oldencoding;
  290|  3.25k|        unsigned long consumed;
  291|  3.25k|        size_t buffered;
  292|  3.25k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  3.25k|        int inputMax = 1;
  294|       |#else
  295|       |        int inputMax = 5;
  296|       |#endif
  297|       |
  298|       |	/*
  299|       |	 * Ask the Entity resolver to load the damn thing
  300|       |	 */
  301|  3.25k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 3.25k, False: 0]
  |  Branch (301:29): [True: 3.25k, False: 0]
  ------------------
  302|  3.25k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  3.25k|	                                     systemId);
  304|  3.25k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 1.10k, False: 2.15k]
  ------------------
  305|  1.10k|	    return;
  306|  1.10k|	}
  307|       |
  308|  2.15k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 2, False: 2.14k]
  ------------------
  309|      2|            xmlSAX2ErrMemory(ctxt);
  310|      2|            xmlFreeInputStream(input);
  311|      2|            return;
  312|      2|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  2.14k|	oldinput = ctxt->input;
  318|  2.14k|	oldinputNr = ctxt->inputNr;
  319|  2.14k|	oldinputMax = ctxt->inputMax;
  320|  2.14k|	oldinputTab = ctxt->inputTab;
  321|  2.14k|	oldencoding = ctxt->encoding;
  322|  2.14k|	ctxt->encoding = NULL;
  323|       |
  324|  2.14k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  2.14k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 1, False: 2.14k]
  ------------------
  326|      1|	    xmlSAX2ErrMemory(ctxt);
  327|      1|            goto error;
  328|      1|	}
  329|  2.14k|	ctxt->inputNr = 0;
  330|  2.14k|	ctxt->inputMax = inputMax;
  331|  2.14k|	ctxt->input = NULL;
  332|  2.14k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 1, False: 2.14k]
  ------------------
  333|      1|            goto error;
  334|       |
  335|  2.14k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 2.14k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  2.14k|	input->line = 1;
  338|  2.14k|	input->col = 1;
  339|  2.14k|	input->base = ctxt->input->cur;
  340|  2.14k|	input->cur = ctxt->input->cur;
  341|  2.14k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  2.14k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  2.21k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 68, False: 2.14k]
  ------------------
  353|     68|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  2.14k|        consumed = ctxt->input->consumed;
  356|  2.14k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  2.14k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 2.14k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  2.14k|        else
  360|  2.14k|            consumed += buffered;
  361|  2.14k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 2.14k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  2.14k|        else
  364|  2.14k|            ctxt->sizeentities += consumed;
  365|       |
  366|  2.14k|error:
  367|  2.14k|	xmlFreeInputStream(input);
  368|  2.14k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  2.14k|	ctxt->input = oldinput;
  374|  2.14k|	ctxt->inputNr = oldinputNr;
  375|  2.14k|	ctxt->inputMax = oldinputMax;
  376|  2.14k|	ctxt->inputTab = oldinputTab;
  377|  2.14k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 69, False: 2.07k]
  ------------------
  378|     69|	    xmlFree(ctxt->encoding);
  379|  2.14k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  2.14k|    }
  382|  19.3k|}
xmlSAX2ResolveEntity:
  396|  3.25k|{
  397|  3.25k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  3.25k|    xmlParserInputPtr ret = NULL;
  399|  3.25k|    xmlChar *URI = NULL;
  400|       |
  401|  3.25k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 3.25k]
  ------------------
  402|       |
  403|  3.25k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 3.25k, False: 0]
  ------------------
  404|  3.25k|        const xmlChar *base = NULL;
  405|  3.25k|        int res;
  406|       |
  407|  3.25k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 3.25k, False: 0]
  ------------------
  408|  3.25k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  3.25k|#define BAD_CAST (xmlChar *)
  ------------------
  409|       |
  410|       |        /*
  411|       |         * We don't really need the 'directory' struct member, but some
  412|       |         * users set it manually to a base URI for memory streams.
  413|       |         */
  414|  3.25k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 2.42k, False: 828]
  ------------------
  415|  2.42k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  2.42k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  3.25k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  3.25k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 1, False: 3.25k]
  ------------------
  418|  3.25k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  3.25k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 3.25k]
  ------------------
  419|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      1|            return(NULL);
  421|      1|        }
  422|  3.25k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  3.25k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 120, False: 3.13k]
  ------------------
  424|    120|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 4, False: 116]
  ------------------
  425|      4|                xmlSAX2ErrMemory(ctxt);
  426|    116|            else
  427|    116|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|    116|                           "Can't resolve URI: %s\n", systemId);
  429|    120|            return(NULL);
  430|    120|        }
  431|  3.13k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  3.13k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 3.13k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  3.13k|    }
  437|       |
  438|  3.13k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  3.13k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  3.13k|    xmlFree(URI);
  442|  3.13k|    return(ret);
  443|  3.25k|}
xmlSAX2GetEntity:
  454|  3.00M|{
  455|  3.00M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  3.00M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  3.00M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 3.00M]
  ------------------
  459|       |
  460|  3.00M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 2.56M, False: 439k]
  ------------------
  461|  2.56M|	ret = xmlGetPredefinedEntity(name);
  462|  2.56M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 734k, False: 1.83M]
  ------------------
  463|   734k|	    return(ret);
  464|  2.56M|    }
  465|  2.27M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 2.27M, False: 194]
  |  Branch (465:34): [True: 1.41k, False: 2.27M]
  ------------------
  466|  1.41k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 219, False: 1.19k]
  ------------------
  467|    219|	    ctxt->myDoc->standalone = 0;
  468|    219|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    219|	    ctxt->myDoc->standalone = 1;
  470|  1.19k|	} else {
  471|  1.19k|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  472|  1.19k|	    if (ret == NULL) {
  ------------------
  |  Branch (472:10): [True: 877, False: 317]
  ------------------
  473|    877|		ctxt->myDoc->standalone = 0;
  474|    877|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    877|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 230, False: 647]
  ------------------
  476|    230|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    230|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    230|				   name, NULL);
  479|    230|		}
  480|    877|		ctxt->myDoc->standalone = 1;
  481|    877|	    }
  482|  1.19k|	}
  483|  2.27M|    } else {
  484|  2.27M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  2.27M|    }
  486|  2.27M|    return(ret);
  487|  3.00M|}
xmlSAX2GetParameterEntity:
  498|   521k|{
  499|   521k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   521k|    xmlEntityPtr ret;
  501|       |
  502|   521k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 521k]
  ------------------
  503|       |
  504|   521k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   521k|    return(ret);
  506|   521k|}
xmlSAX2EntityDecl:
  522|   151k|{
  523|   151k|    xmlEntityPtr ent;
  524|   151k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   151k|    int extSubset;
  526|   151k|    int res;
  527|       |
  528|   151k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 151k]
  |  Branch (528:27): [True: 0, False: 151k]
  ------------------
  529|      0|        return;
  530|       |
  531|   151k|    extSubset = ctxt->inSubset == 2;
  532|   151k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   151k|                       content, &ent);
  534|   151k|    switch (res) {
  535|  23.9k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 23.9k, False: 127k]
  ------------------
  536|  23.9k|            break;
  537|     35|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 35, False: 151k]
  ------------------
  538|     35|            xmlSAX2ErrMemory(ctxt);
  539|     35|            return;
  540|   122k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 122k, False: 28.7k]
  ------------------
  541|   122k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 9.39k, False: 113k]
  ------------------
  542|  9.39k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 892, False: 8.50k]
  ------------------
  543|    892|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    892|                               " external subset\n", name);
  545|  8.50k|                else
  546|  8.50k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  8.50k|                               " internal subset\n", name);
  548|  9.39k|            }
  549|   122k|            return;
  550|  4.70k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 4.70k, False: 146k]
  ------------------
  551|       |            /*
  552|       |             * Technically an error but it's a common mistake to get double
  553|       |             * escaping according to "4.6 Predefined Entities" wrong.
  554|       |             */
  555|  4.70k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  4.70k|                       " entity '%s'", name);
  557|  4.70k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 151k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   151k|    }
  564|       |
  565|  23.9k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 23.9k, False: 0]
  |  Branch (565:31): [True: 7.86k, False: 16.1k]
  ------------------
  566|  7.86k|        xmlChar *URI;
  567|  7.86k|        const char *base = NULL;
  568|  7.86k|        int i;
  569|       |
  570|  15.0k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 7.92k, False: 7.15k]
  ------------------
  571|  7.92k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 702, False: 7.22k]
  ------------------
  572|    702|                base = ctxt->inputTab[i]->filename;
  573|    702|                break;
  574|    702|            }
  575|  7.92k|        }
  576|       |
  577|       |        /*
  578|       |         * We don't really need the 'directory' struct member, but some
  579|       |         * users set it manually to a base URI for memory streams.
  580|       |         */
  581|  7.86k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 7.15k, False: 702]
  ------------------
  582|  7.15k|            base = ctxt->directory;
  583|       |
  584|  7.86k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  7.86k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 103, False: 7.75k]
  ------------------
  587|    103|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 1, False: 102]
  ------------------
  588|      1|                xmlSAX2ErrMemory(ctxt);
  589|    102|            } else {
  590|    102|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|    102|                           "Can't resolve URI: %s\n", systemId);
  592|    102|            }
  593|  7.75k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  7.75k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 3, False: 7.75k]
  ------------------
  594|      3|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      3|            xmlFree(URI);
  596|  7.75k|        } else {
  597|  7.75k|            ent->URI = URI;
  598|  7.75k|        }
  599|  7.86k|    }
  600|  23.9k|}
xmlSAX2AttributeDecl:
  617|  76.8k|{
  618|  76.8k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  76.8k|    xmlAttributePtr attr;
  620|  76.8k|    const xmlChar *name = NULL;
  621|  76.8k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  76.8k|    (void) attr;
  625|       |
  626|  76.8k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 76.8k]
  |  Branch (626:27): [True: 0, False: 76.8k]
  ------------------
  627|      0|        return;
  628|       |
  629|  76.8k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  76.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 814, False: 76.0k]
  ------------------
  630|    814|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 537, False: 277]
  ------------------
  631|    537|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    537|	      "xml:id : attribute type should be ID\n", NULL);
  633|    537|    }
  634|  76.8k|    name = xmlSplitQName4(fullname, &prefix);
  635|  76.8k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 9, False: 76.8k]
  ------------------
  636|      9|        xmlSAX2ErrMemory(ctxt);
  637|  76.8k|    ctxt->vctxt.valid = 1;
  638|  76.8k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 44.0k, False: 32.8k]
  ------------------
  639|  44.0k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  44.0k|	       name, prefix, (xmlAttributeType) type,
  641|  44.0k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  32.8k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 32.8k, False: 0]
  ------------------
  643|  32.8k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  32.8k|	   name, prefix, (xmlAttributeType) type,
  645|  32.8k|	   (xmlAttributeDefault) def, defaultValue, tree);
  646|      0|    else {
  647|      0|        xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  648|      0|	     "SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
  649|      0|	               name, NULL);
  650|      0|	xmlFree(prefix);
  651|      0|	xmlFreeEnumeration(tree);
  652|      0|	return;
  653|      0|    }
  654|  76.8k|#ifdef LIBXML_VALID_ENABLED
  655|  76.8k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 10.2k, False: 66.5k]
  ------------------
  656|  10.2k|	ctxt->valid = 0;
  657|  76.8k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 31.3k, False: 45.4k]
  |  Branch (657:27): [True: 24.0k, False: 7.30k]
  |  Branch (657:47): [True: 19.8k, False: 4.26k]
  ------------------
  658|  19.8k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 19.8k, False: 0]
  ------------------
  659|  19.8k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  19.8k|	                                        attr);
  661|  76.8k|#endif /* LIBXML_VALID_ENABLED */
  662|  76.8k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 6.05k, False: 70.7k]
  ------------------
  663|  6.05k|	xmlFree(prefix);
  664|  76.8k|}
xmlSAX2ElementDecl:
  677|  17.6k|{
  678|  17.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  17.6k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  17.6k|    (void) elem;
  683|       |
  684|  17.6k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 17.6k]
  |  Branch (684:27): [True: 0, False: 17.6k]
  ------------------
  685|      0|        return;
  686|       |
  687|  17.6k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 11.4k, False: 6.16k]
  ------------------
  688|  11.4k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  11.4k|                                 name, (xmlElementTypeVal) type, content);
  690|  6.16k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 6.16k, False: 0]
  ------------------
  691|  6.16k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  6.16k|                                 name, (xmlElementTypeVal) type, content);
  693|      0|    else {
  694|      0|        xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  695|      0|	     "SAX.xmlSAX2ElementDecl(%s) called while not in subset\n",
  696|      0|	               name, NULL);
  697|      0|        return;
  698|      0|    }
  699|  17.6k|#ifdef LIBXML_VALID_ENABLED
  700|  17.6k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 5.46k, False: 12.1k]
  ------------------
  701|  5.46k|        ctxt->valid = 0;
  702|  17.6k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 13.3k, False: 4.29k]
  |  Branch (702:27): [True: 10.0k, False: 3.27k]
  ------------------
  703|  10.0k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 10.0k, False: 0]
  |  Branch (703:24): [True: 10.0k, False: 0]
  ------------------
  704|  10.0k|        ctxt->valid &=
  705|  10.0k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  17.6k|#endif /* LIBXML_VALID_ENABLED */
  707|  17.6k|}
xmlSAX2NotationDecl:
  720|  2.41k|{
  721|  2.41k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  2.41k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  2.41k|    (void) nota;
  726|       |
  727|  2.41k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 2.41k]
  |  Branch (727:27): [True: 0, False: 2.41k]
  ------------------
  728|      0|        return;
  729|       |
  730|  2.41k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 869, False: 1.54k]
  |  Branch (730:31): [True: 88, False: 781]
  ------------------
  731|     88|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|     88|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|     88|	               name, NULL);
  734|     88|	return;
  735|  2.32k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 1.79k, False: 532]
  ------------------
  736|  1.79k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  1.79k|                              publicId, systemId);
  738|    532|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 532, False: 0]
  ------------------
  739|    532|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    532|                              publicId, systemId);
  741|      0|    else {
  742|      0|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  743|      0|	     "SAX.xmlSAX2NotationDecl(%s) called while not in subset\n",
  744|      0|	               name, NULL);
  745|      0|	return;
  746|      0|    }
  747|  2.32k|#ifdef LIBXML_VALID_ENABLED
  748|  2.32k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 2.05k, False: 269]
  ------------------
  749|  2.32k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.59k, False: 724]
  |  Branch (749:29): [True: 336, False: 1.26k]
  ------------------
  750|    336|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 336, False: 0]
  ------------------
  751|    336|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    336|	                                       nota);
  753|  2.32k|#endif /* LIBXML_VALID_ENABLED */
  754|  2.32k|}
xmlSAX2UnparsedEntityDecl:
  769|    558|{
  770|    558|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    558|                      publicId, systemId, (xmlChar *) notationName);
  772|    558|}
xmlSAX2SetDocumentLocator:
  783|  52.2k|{
  784|  52.2k|}
xmlSAX2StartDocument:
  793|  51.8k|{
  794|  51.8k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  51.8k|    xmlDocPtr doc;
  796|       |
  797|  51.8k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 51.8k]
  ------------------
  798|       |
  799|  51.8k|#ifdef LIBXML_HTML_ENABLED
  800|  51.8k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 51.8k]
  ------------------
  801|      0|	if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (801:6): [True: 0, False: 0]
  ------------------
  802|      0|	    ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
  803|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (803:6): [True: 0, False: 0]
  ------------------
  804|      0|	    xmlSAX2ErrMemory(ctxt);
  805|      0|	    return;
  806|      0|	}
  807|      0|	ctxt->myDoc->properties = XML_DOC_HTML;
  808|      0|	ctxt->myDoc->parseFlags = ctxt->options;
  809|      0|    } else
  810|  51.8k|#endif
  811|  51.8k|    {
  812|  51.8k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  51.8k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 51.7k, False: 24]
  ------------------
  814|  51.7k|	    doc->properties = 0;
  815|  51.7k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 19.5k, False: 32.2k]
  ------------------
  816|  19.5k|	        doc->properties |= XML_DOC_OLD10;
  817|  51.7k|	    doc->parseFlags = ctxt->options;
  818|  51.7k|	    doc->standalone = ctxt->standalone;
  819|  51.7k|	} else {
  820|     24|	    xmlSAX2ErrMemory(ctxt);
  821|     24|	    return;
  822|     24|	}
  823|  51.7k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 30.3k, False: 21.4k]
  |  Branch (823:27): [True: 30.3k, False: 0]
  ------------------
  824|  30.3k|	    doc->dict = ctxt->dict;
  825|  30.3k|	    xmlDictReference(doc->dict);
  826|  30.3k|	}
  827|  51.7k|    }
  828|  51.7k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 51.7k, False: 0]
  |  Branch (828:34): [True: 51.7k, False: 0]
  ------------------
  829|  51.7k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 51.7k, False: 0]
  |  Branch (829:27): [True: 9.74k, False: 42.0k]
  ------------------
  830|  9.74k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  9.74k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 8, False: 9.73k]
  ------------------
  832|      8|	    xmlSAX2ErrMemory(ctxt);
  833|  9.74k|    }
  834|  51.7k|}
xmlSAX2EndDocument:
  843|  28.7k|{
  844|  28.7k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  28.7k|    xmlDocPtr doc;
  846|       |
  847|  28.7k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 28.7k]
  ------------------
  848|  28.7k|#ifdef LIBXML_VALID_ENABLED
  849|  28.7k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 5.07k, False: 23.6k]
  |  Branch (849:27): [True: 666, False: 4.40k]
  ------------------
  850|    666|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 666, False: 0]
  |  Branch (850:24): [True: 666, False: 0]
  ------------------
  851|    666|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  28.7k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  28.7k|    doc = ctxt->myDoc;
  855|  28.7k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 81, False: 28.6k]
  ------------------
  856|     81|        return;
  857|       |
  858|  28.6k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 28.6k, False: 0]
  ------------------
  859|  28.6k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  28.6k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 279, False: 28.3k]
  ------------------
  862|    279|            doc->encoding = xmlStrdup(encoding);
  863|    279|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 3, False: 276]
  ------------------
  864|      3|                xmlSAX2ErrMemory(ctxt);
  865|    279|        }
  866|  28.6k|    }
  867|       |
  868|  28.6k|#ifdef LIBXML_HTML_ENABLED
  869|  28.6k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 28.6k]
  ------------------
  870|      0|        if (((ctxt->options & HTML_PARSE_NODEFDTD) == 0) &&
  ------------------
  |  Branch (870:13): [True: 0, False: 0]
  ------------------
  871|      0|            (doc->intSubset == NULL)) {
  ------------------
  |  Branch (871:13): [True: 0, False: 0]
  ------------------
  872|      0|            doc->intSubset = xmlCreateIntSubset(doc, BAD_CAST "html",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  873|      0|                    BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  874|      0|                    BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  875|      0|            if (doc->intSubset == NULL)
  ------------------
  |  Branch (875:17): [True: 0, False: 0]
  ------------------
  876|      0|                xmlSAX2ErrMemory(ctxt);
  877|      0|        }
  878|      0|    } else
  879|  28.6k|#endif /* LIBXML_HTML_ENABLED */
  880|  28.6k|    {
  881|  28.6k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 13.9k, False: 14.6k]
  ------------------
  882|  13.9k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  13.9k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 7.53k, False: 6.43k]
  ------------------
  884|  7.53k|                doc->properties |= XML_DOC_DTDVALID;
  885|  13.9k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 11.2k, False: 2.67k]
  ------------------
  886|  11.2k|                doc->properties |= XML_DOC_NSVALID;
  887|  13.9k|        }
  888|       |
  889|  28.6k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 11.3k, False: 17.2k]
  ------------------
  890|  11.3k|            doc->properties |= XML_DOC_OLD10;
  891|  28.6k|    }
  892|  28.6k|}
xmlSAX2StartElement:
 1713|   303k|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|   303k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|   303k|    (void) atts;
 1717|       |
 1718|   303k|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 303k]
  |  Branch (1718:27): [True: 0, False: 303k]
  |  Branch (1718:49): [True: 0, False: 303k]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|   303k|#ifdef LIBXML_SAX1_ENABLED
 1722|   303k|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 303k, False: 0]
  ------------------
 1723|   303k|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|   303k|        return;
 1725|   303k|    }
 1726|      0|#endif
 1727|       |
 1728|      0|#ifdef LIBXML_HTML_ENABLED
 1729|      0|    if (ctxt->html) {
  ------------------
  |  Branch (1729:9): [True: 0, False: 0]
  ------------------
 1730|      0|        xmlSAX2StartHtmlElement(ctxt, fullname, atts);
 1731|      0|        return;
 1732|      0|    }
 1733|      0|#endif
 1734|      0|}
xmlSAX2EndElement:
 1748|   193k|{
 1749|   193k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   193k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 193k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   193k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   193k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 193k, False: 0]
  |  Branch (1755:24): [True: 57.6k, False: 135k]
  |  Branch (1755:42): [True: 46.7k, False: 10.9k]
  ------------------
 1756|  46.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 46.7k, False: 0]
  |  Branch (1756:24): [True: 46.7k, False: 0]
  ------------------
 1757|  46.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  46.7k|					     ctxt->node);
 1759|   193k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   193k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   193k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   193k|    nodePop(ctxt);
 1768|   193k|#endif
 1769|   193k|}
xmlSAX2StartElementNs:
 2155|   670k|{
 2156|   670k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   670k|    xmlNodePtr ret;
 2158|   670k|    xmlNsPtr last = NULL, ns;
 2159|   670k|    const xmlChar *uri, *pref;
 2160|   670k|    xmlChar *lname = NULL;
 2161|   670k|    int i, j;
 2162|       |
 2163|   670k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 670k]
  ------------------
 2164|       |
 2165|   670k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   670k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 148k, False: 521k]
  ------------------
 2170|   148k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 148k]
  ------------------
 2171|   148k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 144k, False: 4.27k]
  ------------------
 2172|   144k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 5.71k, False: 138k]
  ------------------
 2173|   138k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 138k, False: 868]
  ------------------
 2174|   138k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 13.1k, False: 124k]
  ------------------
 2175|  13.1k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 13.1k, False: 0]
  ------------------
 2176|  13.1k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 935, False: 12.2k]
  ------------------
 2177|  6.64k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  6.64k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  6.64k|	ctxt->validate = 0;
 2180|  6.64k|    }
 2181|   670k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   670k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 99.2k, False: 570k]
  |  Branch (2186:29): [True: 28.2k, False: 71.0k]
  ------------------
 2187|  28.2k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 12.4k, False: 15.7k]
  ------------------
 2188|  12.4k|	    const xmlChar *fullname;
 2189|       |
 2190|  12.4k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  12.4k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 2, False: 12.4k]
  ------------------
 2192|      2|                xmlSAX2ErrMemory(ctxt);
 2193|      2|                return;
 2194|      2|            }
 2195|  12.4k|	    localname = fullname;
 2196|  15.7k|	} else {
 2197|  15.7k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  15.7k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 1, False: 15.7k]
  ------------------
 2199|      1|                xmlSAX2ErrMemory(ctxt);
 2200|      1|                return;
 2201|      1|            }
 2202|  15.7k|	}
 2203|  28.2k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   670k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.32k, False: 667k]
  ------------------
 2208|  2.32k|        ret = ctxt->freeElems;
 2209|  2.32k|	ctxt->freeElems = ret->next;
 2210|  2.32k|	ctxt->freeElemsNr--;
 2211|  2.32k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.32k|        ret->doc = ctxt->myDoc;
 2213|  2.32k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.32k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 1.05k, False: 1.27k]
  ------------------
 2216|  1.05k|	    ret->name = localname;
 2217|  1.27k|	else {
 2218|  1.27k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 1.02k, False: 245]
  ------------------
 2219|  1.02k|		ret->name = xmlStrdup(localname);
 2220|    245|	    else
 2221|    245|	        ret->name = lname;
 2222|  1.27k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 1, False: 1.26k]
  ------------------
 2223|      1|	        xmlSAX2ErrMemory(ctxt);
 2224|      1|                xmlFree(ret);
 2225|      1|		return;
 2226|      1|	    }
 2227|  1.27k|	}
 2228|  2.31k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.31k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   667k|    } else {
 2231|   667k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 409k, False: 257k]
  ------------------
 2232|   409k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   409k|	                               (xmlChar *) localname, NULL);
 2234|   257k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 242k, False: 15.4k]
  ------------------
 2235|   242k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  15.4k|	else
 2237|  15.4k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   667k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 61, False: 667k]
  ------------------
 2239|     61|	    xmlSAX2ErrMemory(ctxt);
 2240|     61|	    return;
 2241|     61|	}
 2242|   667k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   913k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 243k, False: 669k]
  ------------------
 2248|   243k|        pref = namespaces[i++];
 2249|   243k|	uri = namespaces[i++];
 2250|   243k|	ns = xmlNewNs(NULL, uri, pref);
 2251|   243k|	if (ns != NULL) {
  ------------------
  |  Branch (2251:6): [True: 243k, False: 72]
  ------------------
 2252|   243k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 118k, False: 124k]
  ------------------
 2253|   118k|	        ret->nsDef = last = ns;
 2254|   124k|	    } else {
 2255|   124k|	        last->next = ns;
 2256|   124k|		last = ns;
 2257|   124k|	    }
 2258|   243k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 194k, False: 49.1k]
  |  Branch (2258:27): [True: 85.1k, False: 109k]
  ------------------
 2259|  85.1k|		ret->ns = ns;
 2260|   243k|	} else {
 2261|     72|            xmlSAX2ErrMemory(ctxt);
 2262|     72|	    continue;
 2263|     72|	}
 2264|       |
 2265|   243k|        xmlParserNsUpdateSax(ctxt, pref, ns);
 2266|       |
 2267|   243k|#ifdef LIBXML_VALID_ENABLED
 2268|   243k|	if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2268:6): [True: 243k, False: 0]
  |  Branch (2268:23): [True: 99.2k, False: 144k]
  |  Branch (2268:41): [True: 9.02k, False: 90.2k]
  ------------------
 2269|  9.02k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 9.02k, False: 0]
  |  Branch (2269:21): [True: 9.02k, False: 0]
  ------------------
 2270|  9.02k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  9.02k|	                                           ret, prefix, ns, uri);
 2272|  9.02k|	}
 2273|   243k|#endif /* LIBXML_VALID_ENABLED */
 2274|   243k|    }
 2275|   669k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   669k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   669k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 37, False: 669k]
  ------------------
 2286|     37|        xmlUnlinkNode(ret);
 2287|     37|        xmlFreeNode(ret);
 2288|     37|        return;
 2289|     37|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   669k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 67.1k, False: 602k]
  ------------------
 2295|  67.1k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  67.1k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 17.1k, False: 50.0k]
  ------------------
 2296|  17.1k|	nb_attributes -= nb_defaulted;
 2297|       |
 2298|       |    /*
 2299|       |     * Search the namespace if it wasn't already found
 2300|       |     * Note that, if prefix is NULL, this searches for the default Ns
 2301|       |     */
 2302|   669k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 113k, False: 556k]
  |  Branch (2302:26): [True: 28.5k, False: 85.1k]
  ------------------
 2303|  28.5k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  28.5k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    463|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 463, False: 28.0k]
  |  Branch (2304:27): [True: 447, False: 16]
  ------------------
 2305|    447|            int res;
 2306|       |
 2307|    447|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    447|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 7, False: 440]
  ------------------
 2309|      7|                xmlSAX2ErrMemory(ctxt);
 2310|    447|	}
 2311|  28.5k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 23, False: 28.5k]
  ------------------
 2312|     23|	    ns = xmlNewNs(ret, NULL, prefix);
 2313|     23|	    if (ns == NULL) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 23]
  ------------------
 2314|       |
 2315|      0|	        xmlSAX2ErrMemory(ctxt);
 2316|      0|		return;
 2317|      0|	    }
 2318|     23|            if (prefix != NULL)
  ------------------
  |  Branch (2318:17): [True: 11, False: 12]
  ------------------
 2319|     11|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|     11|                             "Namespace prefix %s was not found\n",
 2321|     11|                             prefix, NULL);
 2322|     12|            else
 2323|     12|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     12|                             "Namespace default prefix was not found\n",
 2325|     12|                             NULL, NULL);
 2326|     23|	}
 2327|  28.5k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   669k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 86.0k, False: 583k]
  ------------------
 2333|  86.0k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   351k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 265k, False: 86.0k]
  ------------------
 2336|   265k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   265k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 119k, False: 145k]
  |  Branch (2341:39): [True: 57.5k, False: 62.2k]
  ------------------
 2342|  57.5k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 16.4k, False: 41.1k]
  ------------------
 2343|  16.4k|		    const xmlChar *fullname;
 2344|       |
 2345|  16.4k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  16.4k|		                              attributes[j]);
 2347|  16.4k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 1, False: 16.4k]
  ------------------
 2348|      1|                        xmlSAX2ErrMemory(ctxt);
 2349|      1|                        return;
 2350|      1|                    }
 2351|  16.4k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  16.4k|                                              attributes[j+3],
 2353|  16.4k|                                              attributes[j+4]);
 2354|  16.4k|                    goto have_attr;
 2355|  41.1k|		} else {
 2356|  41.1k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  41.1k|		                          NULL, 0);
 2358|  41.1k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 3, False: 41.1k]
  ------------------
 2359|      3|                        xmlSAX2ErrMemory(ctxt);
 2360|      3|                        return;
 2361|      3|                    }
 2362|  41.1k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  41.1k|                                              attributes[j+3],
 2364|  41.1k|                                              attributes[j+4]);
 2365|  41.1k|                    xmlFree(lname);
 2366|  41.1k|                    goto have_attr;
 2367|  41.1k|		}
 2368|  57.5k|	    }
 2369|   207k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   207k|                                      attributes[j+3], attributes[j+4]);
 2371|   265k|have_attr:
 2372|   265k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 16, False: 265k]
  ------------------
 2373|     16|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   265k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 86.0k, False: 179k]
  ------------------
 2377|  86.0k|                ctxt->node->properties = attr;
 2378|   179k|            } else {
 2379|   179k|                prev->next = attr;
 2380|   179k|                attr->prev = prev;
 2381|   179k|            }
 2382|       |
 2383|   265k|            prev = attr;
 2384|   265k|	}
 2385|  86.0k|    }
 2386|       |
 2387|   669k|#ifdef LIBXML_VALID_ENABLED
 2388|       |    /*
 2389|       |     * If it's the Document root, finish the DTD validation and
 2390|       |     * check the document root element for validity
 2391|       |     */
 2392|   669k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 142k, False: 527k]
  ------------------
 2393|   142k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   142k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 4.37k, False: 137k]
  ------------------
 2394|  4.37k|	int chk;
 2395|       |
 2396|  4.37k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  4.37k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 48, False: 4.32k]
  ------------------
 2398|     48|	    ctxt->valid = 0;
 2399|  4.37k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 4.37k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  4.37k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  4.37k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  4.37k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  4.37k|    }
 2404|   669k|#endif /* LIBXML_VALID_ENABLED */
 2405|   669k|}
xmlSAX2EndElementNs:
 2421|   481k|{
 2422|   481k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   481k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 481k]
  ------------------
 2425|   481k|    ctxt->nodemem = -1;
 2426|       |
 2427|   481k|#ifdef LIBXML_VALID_ENABLED
 2428|   481k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 78.3k, False: 403k]
  |  Branch (2428:27): [True: 64.7k, False: 13.6k]
  ------------------
 2429|  64.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 64.7k, False: 0]
  |  Branch (2429:24): [True: 64.7k, False: 0]
  ------------------
 2430|  64.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  64.7k|                                             ctxt->node);
 2432|   481k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   481k|    nodePop(ctxt);
 2438|   481k|}
xmlSAX2Reference:
 2448|  31.8k|{
 2449|  31.8k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  31.8k|    xmlNodePtr ret;
 2451|       |
 2452|  31.8k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 31.8k]
  ------------------
 2453|  31.8k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  31.8k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 10, False: 31.8k]
  ------------------
 2455|     10|        xmlSAX2ErrMemory(ctxt);
 2456|     10|        return;
 2457|     10|    }
 2458|       |
 2459|  31.8k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  31.8k|}
xmlSAX2Characters:
 2606|   800k|{
 2607|   800k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   800k|}
xmlSAX2ProcessingInstruction:
 2633|   163k|{
 2634|   163k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|   163k|    xmlNodePtr ret;
 2636|       |
 2637|   163k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 163k]
  ------------------
 2638|       |
 2639|   163k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|   163k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 8, False: 163k]
  ------------------
 2641|      8|        xmlSAX2ErrMemory(ctxt);
 2642|      8|        return;
 2643|      8|    }
 2644|       |
 2645|   163k|    xmlSAX2AppendChild(ctxt, ret);
 2646|   163k|}
xmlSAX2Comment:
 2656|   215k|{
 2657|   215k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   215k|    xmlNodePtr ret;
 2659|       |
 2660|   215k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 215k]
  ------------------
 2661|       |
 2662|   215k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   215k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 9, False: 215k]
  ------------------
 2664|      9|        xmlSAX2ErrMemory(ctxt);
 2665|      9|        return;
 2666|      9|    }
 2667|       |
 2668|   215k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   215k|}
xmlSAX2CDataBlock:
 2680|  72.9k|{
 2681|  72.9k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  72.9k|}
xmlSAXVersion:
 2711|  97.4k|{
 2712|  97.4k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 97.4k]
  ------------------
 2713|  97.4k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 97.4k, False: 0]
  ------------------
 2714|  97.4k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  97.4k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  97.4k|	hdlr->serror = NULL;
 2717|  97.4k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  97.4k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  97.4k|#ifdef LIBXML_SAX1_ENABLED
 2719|  97.4k|    } else if (version == 1) {
  ------------------
  |  Branch (2719:16): [True: 0, False: 0]
  ------------------
 2720|      0|	hdlr->initialized = 1;
 2721|      0|#endif /* LIBXML_SAX1_ENABLED */
 2722|      0|    } else
 2723|      0|        return(-1);
 2724|  97.4k|#ifdef LIBXML_SAX1_ENABLED
 2725|  97.4k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  97.4k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  97.4k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  97.4k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  97.4k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  97.4k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  97.4k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  97.4k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  97.4k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  97.4k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  97.4k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  97.4k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  97.4k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  97.4k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  97.4k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  97.4k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  97.4k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  97.4k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  97.4k|    hdlr->reference = xmlSAX2Reference;
 2748|  97.4k|    hdlr->characters = xmlSAX2Characters;
 2749|  97.4k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  97.4k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  97.4k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  97.4k|    hdlr->comment = xmlSAX2Comment;
 2753|  97.4k|    hdlr->warning = xmlParserWarning;
 2754|  97.4k|    hdlr->error = xmlParserError;
 2755|  97.4k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  97.4k|    return(0);
 2758|  97.4k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    828|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    828|    xmlCtxtErrMemory(ctxt);
   44|    828|}
SAX2.c:xmlWarnMsg:
  111|  14.3k|{
  112|  14.3k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  14.3k|               str1, NULL, NULL, 0, msg, str1);
  114|  14.3k|}
SAX2.c:xmlFatalErrMsg:
   79|    318|{
   80|    318|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    318|}
SAX2.c:xmlErrId:
   95|  3.46k|{
   96|  3.46k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  3.46k|               str1, NULL, NULL, 0, msg, str1);
   98|  3.46k|}
SAX2.c:xmlSAX1StartElement:
 1422|   303k|{
 1423|   303k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1424|   303k|    xmlNodePtr ret;
 1425|   303k|    xmlNodePtr parent;
 1426|   303k|    xmlNsPtr ns;
 1427|   303k|    const xmlChar *name;
 1428|   303k|    xmlChar *prefix;
 1429|   303k|    const xmlChar *att;
 1430|   303k|    const xmlChar *value;
 1431|   303k|    int i, res;
 1432|       |
 1433|   303k|    if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
  ------------------
  |  Branch (1433:9): [True: 0, False: 303k]
  |  Branch (1433:26): [True: 0, False: 303k]
  |  Branch (1433:48): [True: 0, False: 303k]
  ------------------
 1434|       |
 1435|   303k|#ifdef LIBXML_VALID_ENABLED
 1436|       |    /*
 1437|       |     * First check on validity:
 1438|       |     */
 1439|   303k|    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (1439:9): [True: 114k, False: 189k]
  |  Branch (1439:27): [True: 106k, False: 7.81k]
  ------------------
 1440|   106k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 5.02k, False: 101k]
  ------------------
 1441|   101k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 100k, False: 842]
  ------------------
 1442|   100k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 7.98k, False: 92.3k]
  ------------------
 1443|  7.98k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 7.98k, False: 0]
  ------------------
 1444|  7.98k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 1.11k, False: 6.86k]
  ------------------
 1445|  6.14k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  6.14k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  6.14k|	ctxt->validate = 0;
 1448|  6.14k|    }
 1449|   303k|#endif
 1450|       |
 1451|       |    /*
 1452|       |     * Split the full name into a namespace prefix and the tag name
 1453|       |     */
 1454|   303k|    name = xmlSplitQName4(fullname, &prefix);
 1455|   303k|    if (name == NULL) {
  ------------------
  |  Branch (1455:9): [True: 1, False: 303k]
  ------------------
 1456|      1|        xmlSAX2ErrMemory(ctxt);
 1457|      1|        return;
 1458|      1|    }
 1459|       |
 1460|       |    /*
 1461|       |     * Note : the namespace resolution is deferred until the end of the
 1462|       |     *        attributes parsing, since local namespace can be defined as
 1463|       |     *        an attribute at this level.
 1464|       |     */
 1465|   303k|    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
 1466|   303k|    if (ret == NULL) {
  ------------------
  |  Branch (1466:9): [True: 52, False: 303k]
  ------------------
 1467|     52|	xmlFree(prefix);
 1468|     52|	xmlSAX2ErrMemory(ctxt);
 1469|     52|        return;
 1470|     52|    }
 1471|   303k|    ctxt->nodemem = -1;
 1472|       |
 1473|       |    /* Initialize parent before pushing node */
 1474|   303k|    parent = ctxt->node;
 1475|   303k|    if (parent == NULL)
  ------------------
  |  Branch (1475:9): [True: 18.0k, False: 285k]
  ------------------
 1476|  18.0k|        parent = (xmlNodePtr) ctxt->myDoc;
 1477|       |
 1478|       |    /*
 1479|       |     * Link the child element
 1480|       |     */
 1481|   303k|    xmlSAX2AppendChild(ctxt, ret);
 1482|       |
 1483|       |    /*
 1484|       |     * We are parsing a new node.
 1485|       |     */
 1486|   303k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1486:9): [True: 34, False: 303k]
  ------------------
 1487|     34|        xmlUnlinkNode(ret);
 1488|     34|        xmlFreeNode(ret);
 1489|     34|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 4, False: 30]
  ------------------
 1490|      4|            xmlFree(prefix);
 1491|     34|        return;
 1492|     34|    }
 1493|       |
 1494|       |    /*
 1495|       |     * Insert all the defaulted attributes from the DTD especially
 1496|       |     * namespaces
 1497|       |     */
 1498|   303k|    if ((ctxt->myDoc->intSubset != NULL) ||
  ------------------
  |  Branch (1498:9): [True: 157k, False: 145k]
  ------------------
 1499|   157k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 145k]
  ------------------
 1500|   157k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   157k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   303k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 57.0k, False: 246k]
  ------------------
 1507|  57.0k|        i = 0;
 1508|  57.0k|        att = atts[i++];
 1509|  57.0k|        value = atts[i++];
 1510|   132k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 75.8k, False: 57.0k]
  |  Branch (1510:33): [True: 75.8k, False: 0]
  ------------------
 1511|  75.8k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 53.1k, False: 22.6k]
  |  Branch (1511:36): [True: 44.7k, False: 8.40k]
  |  Branch (1511:55): [True: 43.7k, False: 1.02k]
  ------------------
 1512|  43.7k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 35.0k, False: 8.76k]
  |  Branch (1512:36): [True: 34.7k, False: 262]
  ------------------
 1513|  34.7k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|  75.8k|            att = atts[i++];
 1516|  75.8k|            value = atts[i++];
 1517|  75.8k|        }
 1518|  57.0k|    }
 1519|       |
 1520|       |    /*
 1521|       |     * Search the namespace, note that since the attributes have been
 1522|       |     * processed, the local namespaces are available.
 1523|       |     */
 1524|   303k|    res = xmlSearchNsSafe(ret, prefix, &ns);
 1525|   303k|    if (res < 0)
  ------------------
  |  Branch (1525:9): [True: 5, False: 303k]
  ------------------
 1526|      5|        xmlSAX2ErrMemory(ctxt);
 1527|   303k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 235k, False: 67.5k]
  |  Branch (1527:25): [True: 235k, False: 0]
  ------------------
 1528|   235k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   235k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 235k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   235k|    }
 1532|   303k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 58.0k, False: 245k]
  |  Branch (1532:29): [True: 8.34k, False: 49.7k]
  ------------------
 1533|  8.34k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  8.34k|                     "Namespace prefix %s is not defined\n",
 1535|  8.34k|                     prefix, NULL);
 1536|  8.34k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  8.34k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 4, False: 8.34k]
  ------------------
 1538|      4|            xmlSAX2ErrMemory(ctxt);
 1539|  8.34k|    }
 1540|       |
 1541|       |    /*
 1542|       |     * set the namespace node, making sure that if the default namespace
 1543|       |     * is unbound on a parent we simply keep it NULL
 1544|       |     */
 1545|   303k|    if ((ns != NULL) && (ns->href != NULL) &&
  ------------------
  |  Branch (1545:9): [True: 75.9k, False: 227k]
  |  Branch (1545:25): [True: 67.5k, False: 8.34k]
  ------------------
 1546|  67.5k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 61.8k, False: 5.68k]
  |  Branch (1546:32): [True: 273, False: 5.41k]
  ------------------
 1547|  62.1k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   303k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 57.0k, False: 246k]
  ------------------
 1553|  57.0k|        i = 0;
 1554|  57.0k|	att = atts[i++];
 1555|  57.0k|	value = atts[i++];
 1556|   132k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 75.8k, False: 57.0k]
  |  Branch (1556:33): [True: 75.8k, False: 0]
  ------------------
 1557|  75.8k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 22.6k, False: 53.1k]
  |  Branch (1557:36): [True: 8.40k, False: 44.7k]
  |  Branch (1557:55): [True: 1.02k, False: 43.7k]
  ------------------
 1558|  43.7k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 8.76k, False: 35.0k]
  |  Branch (1558:36): [True: 262, False: 34.7k]
  ------------------
 1559|  41.0k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|  75.8k|            att = atts[i++];
 1565|  75.8k|            value = atts[i++];
 1566|  75.8k|        }
 1567|  57.0k|    }
 1568|       |
 1569|   303k|#ifdef LIBXML_VALID_ENABLED
 1570|       |    /*
 1571|       |     * If it's the Document root, finish the DTD validation and
 1572|       |     * check the document root element for validity
 1573|       |     */
 1574|   303k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (1574:9): [True: 107k, False: 195k]
  ------------------
 1575|   107k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   107k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.80k, False: 105k]
  ------------------
 1576|  2.80k|	int chk;
 1577|       |
 1578|  2.80k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.80k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 43, False: 2.76k]
  ------------------
 1580|     43|	    ctxt->valid = 0;
 1581|  2.80k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.80k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.80k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.80k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.80k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.80k|    }
 1586|   303k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   303k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 58.0k, False: 245k]
  ------------------
 1589|  58.0k|	xmlFree(prefix);
 1590|       |
 1591|   303k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   157k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   157k|    xmlElementPtr elemDecl;
 1259|   157k|    const xmlChar *att;
 1260|   157k|    int internal = 1;
 1261|   157k|    int i;
 1262|       |
 1263|   157k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   157k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 89.6k, False: 67.8k]
  ------------------
 1265|  89.6k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  89.6k|	internal = 0;
 1267|  89.6k|    }
 1268|       |
 1269|   225k|process_external_subset:
 1270|       |
 1271|   225k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 72.0k, False: 153k]
  ------------------
 1272|  72.0k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  72.0k|#ifdef LIBXML_VALID_ENABLED
 1275|       |        /*
 1276|       |         * Check against defaulted attributes from the external subset
 1277|       |         * if the document is stamped as standalone.
 1278|       |         *
 1279|       |         * This should be moved to valid.c, but we don't keep track
 1280|       |         * whether an attribute was defaulted.
 1281|       |         */
 1282|  72.0k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 2.98k, False: 69.0k]
  ------------------
 1283|  2.98k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 2.73k, False: 251]
  ------------------
 1284|  2.73k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 2.53k, False: 199]
  ------------------
 1285|  5.10k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 2.57k, False: 2.53k]
  ------------------
 1286|  2.57k|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 1.08k, False: 1.49k]
  ------------------
 1287|  1.08k|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 871, False: 210]
  ------------------
 1288|  1.08k|					attr->elem, attr->name,
 1289|  1.08k|					attr->prefix) == attr) &&
 1290|    871|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 871, False: 0]
  ------------------
 1291|    871|					attr->elem, attr->name,
 1292|    871|					attr->prefix) == NULL)) {
 1293|    871|		    xmlChar *fulln;
 1294|       |
 1295|    871|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 73, False: 798]
  ------------------
 1296|     73|			fulln = xmlStrdup(attr->prefix);
 1297|     73|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 72, False: 1]
  ------------------
 1298|     72|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     72|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     73|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 72, False: 1]
  ------------------
 1300|     72|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    798|		    } else {
 1302|    798|			fulln = xmlStrdup(attr->name);
 1303|    798|		    }
 1304|    871|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 2, False: 869]
  ------------------
 1305|      2|                        xmlSAX2ErrMemory(ctxt);
 1306|      2|                        break;
 1307|      2|                    }
 1308|       |
 1309|       |		    /*
 1310|       |		     * Check that the attribute is not declared in the
 1311|       |		     * serialization
 1312|       |		     */
 1313|    869|		    att = NULL;
 1314|    869|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 406, False: 463]
  ------------------
 1315|    406|			i = 0;
 1316|    406|			att = atts[i];
 1317|    780|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 440, False: 340]
  ------------------
 1318|    440|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 66, False: 374]
  ------------------
 1319|     66|				break;
 1320|    374|			    i += 2;
 1321|    374|			    att = atts[i];
 1322|    374|			}
 1323|    406|		    }
 1324|    869|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 803, False: 66]
  ------------------
 1325|    803|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    803|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    803|				    fulln,
 1328|    803|				    attr->elem);
 1329|    803|		    }
 1330|    869|                    xmlFree(fulln);
 1331|    869|		}
 1332|  2.56k|		attr = attr->nexth;
 1333|  2.56k|	    }
 1334|  2.53k|	}
 1335|  72.0k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  72.0k|	attr = elemDecl->attributes;
 1341|   171k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 99.8k, False: 72.0k]
  ------------------
 1342|       |	    /*
 1343|       |	     * Make sure that attributes redefinition occurring in the
 1344|       |	     * internal subset are not overridden by definitions in the
 1345|       |	     * external subset.
 1346|       |	     */
 1347|  99.8k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 73.9k, False: 25.9k]
  ------------------
 1348|       |		/*
 1349|       |		 * the element should be instantiated in the tree if:
 1350|       |		 *  - this is a namespace prefix
 1351|       |		 *  - the user required for completion in the tree
 1352|       |		 *    like XSLT
 1353|       |		 *  - there isn't already an attribute definition
 1354|       |		 *    in the internal subset overriding it.
 1355|       |		 */
 1356|  73.9k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 19.7k, False: 54.1k]
  ------------------
 1357|  19.7k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  19.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 7.36k, False: 12.4k]
  ------------------
 1358|  66.6k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 54.1k, False: 12.4k]
  ------------------
 1359|  54.1k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  54.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 3.09k, False: 51.0k]
  ------------------
 1360|  63.5k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  63.5k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 32.0k, False: 31.4k]
  ------------------
 1361|  42.5k|		    xmlAttributePtr tst;
 1362|       |
 1363|  42.5k|		    tst = xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
 1364|  42.5k|					     attr->elem, attr->name,
 1365|  42.5k|					     attr->prefix);
 1366|  42.5k|		    if ((tst == attr) || (tst == NULL)) {
  ------------------
  |  Branch (1366:11): [True: 40.5k, False: 1.93k]
  |  Branch (1366:28): [True: 1.93k, False: 0]
  ------------------
 1367|  42.5k|		        xmlChar fn[50];
 1368|  42.5k|			xmlChar *fulln;
 1369|       |
 1370|  42.5k|                        fulln = xmlBuildQName(attr->name, attr->prefix, fn, 50);
 1371|  42.5k|			if (fulln == NULL) {
  ------------------
  |  Branch (1371:8): [True: 6, False: 42.5k]
  ------------------
 1372|      6|			    xmlSAX2ErrMemory(ctxt);
 1373|      6|			    return;
 1374|      6|			}
 1375|       |
 1376|       |			/*
 1377|       |			 * Check that the attribute is not declared in the
 1378|       |			 * serialization
 1379|       |			 */
 1380|  42.5k|			att = NULL;
 1381|  42.5k|			if (atts != NULL) {
  ------------------
  |  Branch (1381:8): [True: 1.77k, False: 40.7k]
  ------------------
 1382|  1.77k|			    i = 0;
 1383|  1.77k|			    att = atts[i];
 1384|  3.45k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 2.15k, False: 1.30k]
  ------------------
 1385|  2.15k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 476, False: 1.67k]
  ------------------
 1386|    476|				    break;
 1387|  1.67k|				i += 2;
 1388|  1.67k|				att = atts[i];
 1389|  1.67k|			    }
 1390|  1.77k|			}
 1391|  42.5k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 42.0k, False: 476]
  ------------------
 1392|  42.0k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  42.0k|					     attr->defaultValue, prefix);
 1394|  42.0k|			}
 1395|  42.5k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 39.6k, False: 2.86k]
  |  Branch (1395:25): [True: 11.4k, False: 28.1k]
  ------------------
 1396|  11.4k|			    xmlFree(fulln);
 1397|  42.5k|		    }
 1398|  42.5k|		}
 1399|  73.9k|	    }
 1400|  99.8k|	    attr = attr->nexth;
 1401|  99.8k|	}
 1402|  72.0k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 67.8k, False: 4.17k]
  ------------------
 1403|  67.8k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  67.8k|		                             name, prefix);
 1405|  67.8k|	    internal = 0;
 1406|  67.8k|	    goto process_external_subset;
 1407|  67.8k|	}
 1408|  72.0k|    }
 1409|   225k|}
SAX2.c:xmlSAX1Attribute:
  960|   117k|{
  961|   117k|    xmlAttrPtr ret;
  962|   117k|    const xmlChar *name;
  963|   117k|    xmlChar *ns;
  964|   117k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   117k|    name = xmlSplitQName4(fullname, &ns);
  970|   117k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 6, False: 117k]
  ------------------
  971|      6|        xmlSAX2ErrMemory(ctxt);
  972|      6|        return;
  973|      6|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   117k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 59.7k, False: 58.1k]
  ------------------
  979|  59.7k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 20.4k, False: 39.2k]
  |  Branch (979:29): [True: 11.2k, False: 9.21k]
  |  Branch (979:49): [True: 9.93k, False: 1.31k]
  ------------------
  980|  9.93k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 9.01k, False: 918]
  |  Branch (980:29): [True: 8.56k, False: 454]
  |  Branch (980:49): [True: 8.28k, False: 278]
  ------------------
  981|  8.28k|	xmlNsPtr nsret;
  982|  8.28k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  8.28k|        (void) nsret;
  986|       |
  987|  8.28k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 4.52k, False: 3.76k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  4.52k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  4.52k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 7, False: 4.51k]
  ------------------
  991|      7|	        xmlSAX2ErrMemory(ctxt);
  992|      7|		return;
  993|      7|	    }
  994|  4.52k|	} else {
  995|  3.76k|	    val = (xmlChar *) value;
  996|  3.76k|	}
  997|       |
  998|  8.27k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 5.18k, False: 3.08k]
  ------------------
  999|  5.18k|	    xmlURIPtr uri;
 1000|       |
 1001|  5.18k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 18, False: 5.17k]
  ------------------
 1002|     18|                xmlSAX2ErrMemory(ctxt);
 1003|  5.18k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 2.07k, False: 3.11k]
  ------------------
 1004|  2.07k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  2.07k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  3.11k|	    } else {
 1007|  3.11k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 2.60k, False: 509]
  ------------------
 1008|  2.60k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  2.60k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  2.60k|                                 name, value);
 1011|  2.60k|		}
 1012|  3.11k|		xmlFreeURI(uri);
 1013|  3.11k|	    }
 1014|  5.18k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  8.27k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  8.27k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 12, False: 8.26k]
  ------------------
 1019|     12|            xmlSAX2ErrMemory(ctxt);
 1020|     12|        }
 1021|  8.26k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  8.26k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 1.98k, False: 6.28k]
  |  Branch (1026:36): [True: 1.03k, False: 951]
  ------------------
 1027|  1.03k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 1.03k, False: 0]
  |  Branch (1027:33): [True: 1.03k, False: 0]
  ------------------
 1028|  1.03k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  1.03k|					   ctxt->node, prefix, nsret, val);
 1030|  1.03k|        }
 1031|  8.27k|#endif /* LIBXML_VALID_ENABLED */
 1032|  8.27k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 4.51k, False: 3.76k]
  ------------------
 1033|  4.51k|	    xmlFree(val);
 1034|  8.27k|	return;
 1035|  8.28k|    }
 1036|   109k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 58.1k, False: 51.4k]
  |  Branch (1036:25): [True: 51.3k, False: 6.80k]
  |  Branch (1036:43): [True: 50.0k, False: 1.23k]
  |  Branch (1036:61): [True: 48.9k, False: 1.16k]
  ------------------
 1037|  48.9k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 38.1k, False: 10.7k]
  |  Branch (1037:27): [True: 37.8k, False: 289]
  |  Branch (1037:45): [True: 36.7k, False: 1.09k]
  ------------------
 1038|  36.7k|	xmlNsPtr nsret;
 1039|  36.7k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  36.7k|        (void) nsret;
 1043|       |
 1044|  36.7k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 14.2k, False: 22.4k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  14.2k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  14.2k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 2, False: 14.2k]
  ------------------
 1048|      2|	        xmlSAX2ErrMemory(ctxt);
 1049|      2|	        xmlFree(ns);
 1050|      2|		return;
 1051|      2|	    }
 1052|  22.4k|	} else {
 1053|  22.4k|	    val = (xmlChar *) value;
 1054|  22.4k|	}
 1055|       |
 1056|  36.7k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 414, False: 36.3k]
  ------------------
 1057|    414|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    414|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    414|	}
 1060|  36.7k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 17.7k, False: 19.0k]
  |  Branch (1060:31): [True: 17.4k, False: 257]
  ------------------
 1061|  17.4k|	    xmlURIPtr uri;
 1062|       |
 1063|  17.4k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 10, False: 17.4k]
  ------------------
 1064|     10|                xmlSAX2ErrMemory(ctxt);
 1065|  17.4k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 1.25k, False: 16.2k]
  ------------------
 1066|  1.25k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  1.25k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  16.2k|	    } else {
 1069|  16.2k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 14.1k, False: 2.10k]
  ------------------
 1070|  14.1k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  14.1k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  14.1k|		}
 1073|  16.2k|		xmlFreeURI(uri);
 1074|  16.2k|	    }
 1075|  17.4k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  36.7k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  36.7k|	xmlFree(ns);
 1080|       |
 1081|  36.7k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 7, False: 36.7k]
  ------------------
 1082|      7|            xmlSAX2ErrMemory(ctxt);
 1083|      7|        }
 1084|  36.7k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  36.7k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 5.07k, False: 31.6k]
  |  Branch (1089:36): [True: 3.33k, False: 1.74k]
  ------------------
 1090|  3.33k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 3.33k, False: 0]
  |  Branch (1090:26): [True: 3.33k, False: 0]
  ------------------
 1091|  3.33k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  3.33k|					   ctxt->node, prefix, nsret, value);
 1093|  3.33k|        }
 1094|  36.7k|#endif /* LIBXML_VALID_ENABLED */
 1095|  36.7k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 14.2k, False: 22.4k]
  ------------------
 1096|  14.2k|	    xmlFree(val);
 1097|  36.7k|	return;
 1098|  36.7k|    }
 1099|       |
 1100|  72.8k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 21.3k, False: 51.4k]
  ------------------
 1101|  21.3k|        int res;
 1102|       |
 1103|  21.3k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  21.3k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 10, False: 21.3k]
  ------------------
 1105|     10|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  21.3k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 7.95k, False: 13.4k]
  ------------------
 1108|  7.95k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  7.95k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  7.95k|		             ns, name);
 1111|  13.4k|	} else {
 1112|  13.4k|            xmlAttrPtr prop;
 1113|       |
 1114|  13.4k|            prop = ctxt->node->properties;
 1115|  45.9k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 32.7k, False: 13.2k]
  ------------------
 1116|  32.7k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 12.6k, False: 20.0k]
  ------------------
 1117|  12.6k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 413, False: 12.2k]
  ------------------
 1118|    413|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 413]
  ------------------
 1119|    413|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 208, False: 205]
  ------------------
 1120|    208|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    208|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    208|                                   name, NULL, NULL, 0,
 1123|    208|                                   "Attribute %s in %s redefined\n",
 1124|    208|                                   name, namespace->href);
 1125|    208|                        goto error;
 1126|    208|                    }
 1127|  12.6k|                }
 1128|  32.5k|                prop = prop->next;
 1129|  32.5k|            }
 1130|  13.4k|        }
 1131|  51.4k|    } else {
 1132|  51.4k|	namespace = NULL;
 1133|  51.4k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  72.5k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  72.5k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 28, False: 72.5k]
  ------------------
 1138|     28|        xmlSAX2ErrMemory(ctxt);
 1139|     28|        goto error;
 1140|     28|    }
 1141|       |
 1142|  72.5k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 37.4k, False: 35.1k]
  ------------------
 1143|  37.4k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 46, False: 37.3k]
  ------------------
 1144|     46|            xmlSAX2ErrMemory(ctxt);
 1145|  37.4k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 35.1k, False: 0]
  ------------------
 1146|  35.1k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  35.1k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 26, False: 35.1k]
  ------------------
 1148|     26|            xmlSAX2ErrMemory(ctxt);
 1149|  35.1k|        } else {
 1150|  35.1k|            ret->last = ret->children;
 1151|  35.1k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  35.1k|        }
 1153|  35.1k|    }
 1154|       |
 1155|  72.5k|#ifdef LIBXML_VALID_ENABLED
 1156|  72.5k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 26.0k, False: 46.4k]
  |  Branch (1156:27): [True: 8.65k, False: 17.4k]
  ------------------
 1157|  8.65k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 8.65k, False: 0]
  |  Branch (1157:24): [True: 8.65k, False: 0]
  ------------------
 1158|       |
 1159|       |	/*
 1160|       |	 * If we don't substitute entities, the validation should be
 1161|       |	 * done on a value with replaced entities anyway.
 1162|       |	 */
 1163|  8.65k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 4.38k, False: 4.27k]
  ------------------
 1164|  4.38k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  4.38k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  4.38k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 2, False: 4.38k]
  ------------------
 1170|      2|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      2|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  4.38k|	    else {
 1173|  4.38k|		xmlChar *nvalnorm;
 1174|       |
 1175|       |		/*
 1176|       |		 * Do the last stage of the attribute normalization
 1177|       |		 * It need to be done twice ... it's an extra burden related
 1178|       |		 * to the ability to keep xmlSAX2References in attributes
 1179|       |		 */
 1180|  4.38k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  4.38k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  4.38k|                                 ctxt->node, fullname, val);
 1183|  4.38k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 2.58k, False: 1.79k]
  ------------------
 1184|  2.58k|		    xmlFree(val);
 1185|  2.58k|		    val = nvalnorm;
 1186|  2.58k|		}
 1187|       |
 1188|  4.38k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  4.38k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  4.38k|                xmlFree(val);
 1191|  4.38k|	    }
 1192|  4.38k|	} else {
 1193|       |            /*
 1194|       |             * When replacing entities, make sure that IDs in
 1195|       |             * entities aren't registered. This also shouldn't be
 1196|       |             * done when entities aren't replaced, but this would
 1197|       |             * require to rework IDREF checks.
 1198|       |             */
 1199|  4.27k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 453, False: 3.82k]
  ------------------
 1200|    453|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    453|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  4.27k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  4.27k|					       ctxt->node, ret, value);
 1204|       |
 1205|  4.27k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  4.27k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  4.27k|	}
 1207|  8.65k|    } else
 1208|  63.9k|#endif /* LIBXML_VALID_ENABLED */
 1209|  63.9k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  63.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 42.5k, False: 21.3k]
  ------------------
 1210|  42.5k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 38.9k, False: 3.65k]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  38.9k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 36.8k, False: 2.03k]
  ------------------
 1213|  36.8k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 36.5k, False: 312]
  ------------------
 1214|  36.5k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 36.3k, False: 261]
  ------------------
 1215|  36.3k|        xmlChar *content = ret->children->content;
 1216|       |        /*
 1217|       |	 * when validating, the ID registration is done at the attribute
 1218|       |	 * validation level. Otherwise we have to do specific handling here.
 1219|       |	 */
 1220|  36.3k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  36.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.57k, False: 34.7k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.57k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 1.01k, False: 556]
  ------------------
 1227|  1.01k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 1228|  1.01k|		         "xml:id : attribute value %s is not an NCName\n",
 1229|  1.01k|		         content);
 1230|  1.01k|	    }
 1231|  1.57k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  34.7k|	} else {
 1233|  34.7k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  34.7k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 34.7k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  34.7k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 2.88k, False: 31.8k]
  ------------------
 1238|  2.88k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  31.8k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 11.9k, False: 19.9k]
  ------------------
 1240|  11.9k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  34.7k|        }
 1242|  36.3k|    }
 1243|       |
 1244|  72.8k|error:
 1245|  72.8k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 21.3k, False: 51.4k]
  ------------------
 1246|  21.3k|	xmlFree(ns);
 1247|  72.8k|}
SAX2.c:xmlNsErrMsg:
  942|  8.37k|{
  943|  8.37k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  8.37k|}
SAX2.c:xmlErrValid:
   59|  13.5k|{
   60|  13.5k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  13.5k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  13.5k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 13.5k, False: 0]
  ------------------
   63|  13.5k|	ctxt->valid = 0;
   64|  13.5k|}
SAX2.c:xmlSAX2AppendChild:
  895|  1.92M|xmlSAX2AppendChild(xmlParserCtxtPtr ctxt, xmlNodePtr node) {
  896|  1.92M|    xmlNodePtr parent;
  897|  1.92M|    xmlNodePtr last;
  898|       |
  899|  1.92M|    if (ctxt->inSubset == 1) {
  ------------------
  |  Branch (899:9): [True: 6.34k, False: 1.91M]
  ------------------
  900|  6.34k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.91M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 107k, False: 1.81M]
  ------------------
  902|   107k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.81M|    } else {
  904|  1.81M|        parent = ctxt->node;
  905|  1.81M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 134k, False: 1.67M]
  ------------------
  906|   134k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.81M|    }
  908|       |
  909|  1.92M|    last = parent->last;
  910|  1.92M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 290k, False: 1.63M]
  ------------------
  911|   290k|        parent->children = node;
  912|  1.63M|    } else {
  913|  1.63M|        last->next = node;
  914|  1.63M|        node->prev = last;
  915|  1.63M|    }
  916|       |
  917|  1.92M|    parent->last = node;
  918|  1.92M|    node->parent = parent;
  919|       |
  920|  1.92M|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (920:9): [True: 1.45M, False: 469k]
  ------------------
  921|  1.45M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.45M, False: 0]
  ------------------
  922|  1.45M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.39M, False: 57.2k]
  ------------------
  923|  1.39M|            node->line = ctxt->input->line;
  924|  57.2k|        else
  925|  57.2k|            node->line = USHRT_MAX;
  926|  1.45M|    }
  927|  1.92M|}
SAX2.c:xmlNsWarnMsg:
  128|  28.4k|{
  129|  28.4k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  28.4k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   265k|{
 1909|   265k|    xmlAttrPtr ret;
 1910|   265k|    xmlNsPtr namespace = NULL;
 1911|   265k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   265k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 62.2k, False: 202k]
  ------------------
 1917|  62.2k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|  62.2k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|  49.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 49.7k, False: 12.5k]
  |  Branch (1918:29): [True: 49.6k, False: 75]
  ------------------
 1919|  49.6k|            int res;
 1920|       |
 1921|  49.6k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|  49.6k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 11, False: 49.6k]
  ------------------
 1923|     11|                xmlSAX2ErrMemory(ctxt);
 1924|  49.6k|	}
 1925|  62.2k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   265k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.16k, False: 263k]
  ------------------
 1931|  1.16k|        ret = ctxt->freeAttrs;
 1932|  1.16k|	ctxt->freeAttrs = ret->next;
 1933|  1.16k|	ctxt->freeAttrsNr--;
 1934|   263k|    } else {
 1935|   263k|        ret = xmlMalloc(sizeof(*ret));
 1936|   263k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 16, False: 263k]
  ------------------
 1937|     16|            xmlSAX2ErrMemory(ctxt);
 1938|     16|            return(NULL);
 1939|     16|        }
 1940|   263k|    }
 1941|       |
 1942|   265k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   265k|    ret->type = XML_ATTRIBUTE_NODE;
 1944|       |
 1945|       |    /*
 1946|       |     * xmlParseBalancedChunkMemoryRecover had a bug that could result in
 1947|       |     * a mismatch between ctxt->node->doc and ctxt->myDoc. We use
 1948|       |     * ctxt->node->doc here, but we should somehow make sure that the
 1949|       |     * document pointers match.
 1950|       |     */
 1951|       |
 1952|       |    /* assert(ctxt->node->doc == ctxt->myDoc); */
 1953|       |
 1954|   265k|    ret->parent = ctxt->node;
 1955|   265k|    ret->doc = ctxt->node->doc;
 1956|   265k|    ret->ns = namespace;
 1957|       |
 1958|   265k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 125k, False: 139k]
  ------------------
 1959|   125k|        ret->name = localname;
 1960|   139k|    } else {
 1961|   139k|        ret->name = xmlStrdup(localname);
 1962|   139k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 74, False: 139k]
  ------------------
 1963|     74|            xmlSAX2ErrMemory(ctxt);
 1964|   139k|    }
 1965|       |
 1966|   265k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 265k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   265k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 79.9k, False: 185k]
  |  Branch (1969:41): [True: 79.9k, False: 0]
  ------------------
 1970|  79.9k|	xmlNodePtr tmp;
 1971|       |
 1972|       |	/*
 1973|       |	 * We know that if there is an entity reference, then
 1974|       |	 * the string has been dup'ed and terminates with 0
 1975|       |	 * otherwise with ' or "
 1976|       |	 */
 1977|  79.9k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 28.5k, False: 51.4k]
  ------------------
 1978|  28.5k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  28.5k|	    ret->children = tmp;
 1980|  28.5k|	    ret->last = tmp;
 1981|  28.5k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 28.5k, False: 13]
  ------------------
 1982|  28.5k|		tmp->parent = (xmlNodePtr) ret;
 1983|  28.5k|	    }
 1984|  51.4k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 50.3k, False: 1.07k]
  ------------------
 1985|  50.3k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 46, False: 50.3k]
  ------------------
 1986|  50.3k|                                     NULL) < 0)
 1987|     46|                xmlSAX2ErrMemory(ctxt);
 1988|  50.3k|	}
 1989|   185k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 185k, False: 0]
  ------------------
 1990|   185k|	xmlNodePtr tmp;
 1991|       |
 1992|   185k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   185k|	ret->children = tmp;
 1994|   185k|	ret->last = tmp;
 1995|   185k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 185k, False: 29]
  ------------------
 1996|   185k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   185k|	}
 1998|   185k|    }
 1999|       |
 2000|   265k|#ifdef LIBXML_VALID_ENABLED
 2001|   265k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 265k, False: 0]
  |  Branch (2001:26): [True: 168k, False: 96.6k]
  |  Branch (2001:44): [True: 93.4k, False: 75.0k]
  ------------------
 2002|  93.4k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 93.4k, False: 0]
  |  Branch (2002:24): [True: 93.4k, False: 0]
  ------------------
 2003|       |	/*
 2004|       |	 * If we don't substitute entities, the validation should be
 2005|       |	 * done on a value with replaced entities anyway.
 2006|       |	 */
 2007|  93.4k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 11.9k, False: 81.5k]
  ------------------
 2008|  11.9k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  11.9k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 9.34k, False: 2.56k]
  ------------------
 2010|  9.34k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 6.24k, False: 3.09k]
  ------------------
 2011|  6.24k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  6.24k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  6.24k|		} else {
 2014|       |		    /*
 2015|       |		     * That should already be normalized.
 2016|       |		     * cheaper to finally allocate here than duplicate
 2017|       |		     * entry points in the full validation code
 2018|       |		     */
 2019|  3.09k|		    dup = xmlStrndup(value, valueend - value);
 2020|  3.09k|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 1, False: 3.09k]
  ------------------
 2021|      1|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|  3.09k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|  3.09k|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|  3.09k|		}
 2026|  9.34k|	    } else {
 2027|       |	        /*
 2028|       |		 * dup now contains a string of the flattened attribute
 2029|       |		 * content with entities substituted. Check if we need to
 2030|       |		 * apply an extra layer of normalization.
 2031|       |		 * It need to be done twice ... it's an extra burden related
 2032|       |		 * to the ability to keep references in attributes
 2033|       |		 */
 2034|  2.56k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 2.12k, False: 439]
  ------------------
 2035|  2.12k|		    xmlChar *nvalnorm;
 2036|  2.12k|		    xmlChar fn[50];
 2037|  2.12k|		    xmlChar *fullname;
 2038|       |
 2039|  2.12k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  2.12k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 2.12k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  2.12k|                    } else {
 2043|  2.12k|			ctxt->vctxt.valid = 1;
 2044|  2.12k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  2.12k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  2.12k|					 ctxt->node, fullname, dup);
 2047|  2.12k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 18, False: 2.11k]
  ------------------
 2048|     18|			    ctxt->valid = 0;
 2049|       |
 2050|  2.12k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.92k, False: 203]
  |  Branch (2050:28): [True: 573, False: 1.35k]
  ------------------
 2051|    573|			    xmlFree(fullname);
 2052|  2.12k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.91k, False: 210]
  ------------------
 2053|  1.91k|			    xmlFree(dup);
 2054|  1.91k|			    dup = nvalnorm;
 2055|  1.91k|			}
 2056|  2.12k|		    }
 2057|  2.12k|		}
 2058|       |
 2059|  2.56k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.56k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.56k|	    }
 2062|  81.5k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  81.5k|	    dup = xmlStrndup(value, valueend - value);
 2068|  81.5k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 11, False: 81.4k]
  ------------------
 2069|     11|                xmlSAX2ErrMemory(ctxt);
 2070|       |
 2071|       |            /*
 2072|       |             * When replacing entities, make sure that IDs in
 2073|       |             * entities aren't registered. This also shouldn't be
 2074|       |             * done when entities aren't replaced, but this would
 2075|       |             * require to rework IDREF checks.
 2076|       |             */
 2077|  81.5k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 1.14k, False: 80.3k]
  ------------------
 2078|  1.14k|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  1.14k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  81.5k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  81.5k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  81.5k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  81.5k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  81.5k|	}
 2085|  93.4k|    } else
 2086|   171k|#endif /* LIBXML_VALID_ENABLED */
 2087|   171k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   171k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 95.3k, False: 76.3k]
  ------------------
 2088|  95.3k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 89.5k, False: 5.79k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|  89.5k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 89.1k, False: 439]
  ------------------
 2091|  89.1k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 88.5k, False: 566]
  ------------------
 2092|  88.5k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 87.9k, False: 574]
  ------------------
 2093|  87.9k|        xmlChar *content = ret->children->content;
 2094|       |        /*
 2095|       |	 * when validating, the ID registration is done at the attribute
 2096|       |	 * validation level. Otherwise we have to do specific handling here.
 2097|       |	 */
 2098|  87.9k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 21.3k, False: 66.6k]
  ------------------
 2099|  21.3k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 4.65k, False: 16.6k]
  |  Branch (2099:38): [True: 4.28k, False: 379]
  ------------------
 2100|  4.28k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 2.51k, False: 1.76k]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  2.51k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 1.91k, False: 602]
  ------------------
 2107|  1.91k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|  1.91k|                         "xml:id : attribute value %s is not an NCName\n",
 2109|  1.91k|                         content);
 2110|  1.91k|	    }
 2111|  2.51k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|  85.4k|	} else {
 2113|  85.4k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|  85.4k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 1, False: 85.4k]
  ------------------
 2116|      1|                xmlCtxtErrMemory(ctxt);
 2117|  85.4k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 3.86k, False: 81.6k]
  ------------------
 2118|  3.86k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|  81.6k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 10.6k, False: 70.9k]
  ------------------
 2120|  10.6k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|  85.4k|	}
 2122|  87.9k|    }
 2123|   265k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 87.1k, False: 177k]
  ------------------
 2124|  87.1k|	xmlFree(dup);
 2125|       |
 2126|   265k|    return(ret);
 2127|   265k|}
SAX2.c:xmlSAX2TextNode:
 1783|   798k|                int len) {
 1784|   798k|    xmlNodePtr ret;
 1785|   798k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   798k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 2.59k, False: 796k]
  ------------------
 1791|  2.59k|	ret = ctxt->freeElems;
 1792|  2.59k|	ctxt->freeElems = ret->next;
 1793|  2.59k|	ctxt->freeElemsNr--;
 1794|   796k|    } else {
 1795|   796k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   796k|    }
 1797|   798k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 94, False: 798k]
  ------------------
 1798|     94|        xmlCtxtErrMemory(ctxt);
 1799|     94|	return(NULL);
 1800|     94|    }
 1801|   798k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   798k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 798k, False: 0]
  |  Branch (1806:26): [True: 444k, False: 353k]
  ------------------
 1807|   444k|        xmlChar cur = str[len];
 1808|       |
 1809|   444k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 319k, False: 125k]
  ------------------
 1810|   319k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 319k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   319k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   319k|	    memcpy(tmp, str, len);
 1814|   319k|	    tmp[len] = 0;
 1815|   319k|	    intern = tmp;
 1816|   319k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 125k]
  |  Branch (1816:28): [True: 0, False: 0]
  |  Branch (1816:44): [True: 0, False: 0]
  ------------------
 1817|      0|	    ((cur == '<') && (str[len + 1] != '!')))) {
  ------------------
  |  Branch (1817:7): [True: 0, False: 0]
  |  Branch (1817:23): [True: 0, False: 0]
  ------------------
 1818|      0|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1819|      0|            if (intern == NULL) {
  ------------------
  |  Branch (1819:17): [True: 0, False: 0]
  ------------------
 1820|      0|                xmlSAX2ErrMemory(ctxt);
 1821|      0|                xmlFree(ret);
 1822|      0|                return(NULL);
 1823|      0|            }
 1824|   125k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|   125k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   250k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.04k, False: 122k]
  |  |  |  |  ------------------
  |  |  |  |   91|   125k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 122k, False: 206]
  |  |  |  |  |  Branch (91:23): [True: 3.35k, False: 118k]
  |  |  |  |  ------------------
  |  |  |  |   92|   250k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 210, False: 118k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 5.30k, False: 1.30k]
  |  Branch (1824:48): [True: 4.19k, False: 1.11k]
  ------------------
 1825|  4.19k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 3.65k, False: 538]
  ------------------
 1826|  3.65k|	    int i;
 1827|       |
 1828|  37.4k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 36.1k, False: 1.31k]
  ------------------
 1829|  36.1k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  36.1k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  36.1k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 26.4k, False: 9.66k]
  |  |  |  |  ------------------
  |  |  |  |   91|  36.1k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 9.66k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 7.32k, False: 2.34k]
  |  |  |  |  ------------------
  |  |  |  |   92|  36.1k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  36.1k|	    }
 1831|  1.31k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  1.31k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 1.30k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  1.31k|	}
 1838|   444k|    }
 1839|   798k|skip:
 1840|   798k|    ret->type = XML_TEXT_NODE;
 1841|   798k|    ret->doc = doc;
 1842|       |
 1843|   798k|    ret->name = xmlStringText;
 1844|   798k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 478k, False: 320k]
  ------------------
 1845|   478k|	ret->content = xmlStrndup(str, len);
 1846|   478k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 37, False: 478k]
  ------------------
 1847|     37|	    xmlSAX2ErrMemory(ctxt);
 1848|     37|	    xmlFree(ret);
 1849|     37|	    return(NULL);
 1850|     37|	}
 1851|   478k|    } else
 1852|   320k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   798k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 798k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   798k|    return(ret);
 1857|   798k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  11.9k|                          const xmlChar *end) {
 1872|  11.9k|    const xmlChar *in;
 1873|       |
 1874|  11.9k|    in = str;
 1875|   112k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 103k, False: 9.34k]
  ------------------
 1876|   103k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.56k, False: 100k]
  ------------------
 1877|  2.56k|	    goto decode;
 1878|  9.34k|    return(NULL);
 1879|  2.56k|decode:
 1880|       |    /*
 1881|       |     * If the value contains '&', we can be sure it was allocated and is
 1882|       |     * zero-terminated.
 1883|       |     */
 1884|       |    /* TODO: normalize if needed */
 1885|  2.56k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  11.9k|}
SAX2.c:xmlSAX2Text:
 2473|   873k|{
 2474|   873k|    xmlNodePtr lastChild;
 2475|   873k|    xmlNodePtr parent;
 2476|       |
 2477|   873k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 873k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   873k|    parent = ctxt->node;
 2481|   873k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 873k]
  ------------------
 2482|      0|        return;
 2483|   873k|    lastChild = parent->last;
 2484|       |
 2485|       |    /*
 2486|       |     * Try to merge with previous text node using size and capacity
 2487|       |     * stored in the parser context to avoid naive concatenation.
 2488|       |     *
 2489|       |     * Don't merge CDATA sections. In HTML mode, CDATA is used for
 2490|       |     * raw text which should be merged.
 2491|       |     */
 2492|   873k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 116k, False: 756k]
  ------------------
 2493|   756k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 540k, False: 216k]
  ------------------
 2494|   657k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 216k, False: 0]
  |  Branch (2494:27): [True: 984, False: 215k]
  ------------------
 2495|   657k|        xmlNode *node;
 2496|       |
 2497|   657k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 584k, False: 72.9k]
  ------------------
 2498|   584k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  72.9k|        else
 2500|  72.9k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   657k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 94, False: 657k]
  ------------------
 2502|     94|	    xmlSAX2ErrMemory(ctxt);
 2503|     94|	    return;
 2504|     94|	}
 2505|       |
 2506|   657k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 116k, False: 541k]
  ------------------
 2507|   116k|            parent->children = node;
 2508|   116k|            parent->last = node;
 2509|   116k|            node->parent = parent;
 2510|   541k|        } else {
 2511|   541k|            xmlSAX2AppendChild(ctxt, node);
 2512|   541k|        }
 2513|       |
 2514|   657k|        ctxt->nodelen = len;
 2515|   657k|        ctxt->nodemem = len + 1;
 2516|   657k|        lastChild = node;
 2517|   657k|    } else {
 2518|   215k|        xmlChar *content;
 2519|   215k|        int oldSize, newSize, capacity;
 2520|   215k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 87.2k, False: 128k]
  ------------------
 2521|  87.2k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  87.2k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   215k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   128k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   215k|        content = lastChild->content;
 2525|   215k|        oldSize = ctxt->nodelen;
 2526|   215k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   215k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 215k]
  |  Branch (2529:34): [True: 0, False: 215k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   215k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 215k]
  |  Branch (2535:32): [True: 0, False: 215k]
  ------------------
 2536|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 2537|      0|                        "Text node too long, try XML_PARSE_HUGE");
 2538|      0|            return;
 2539|      0|        }
 2540|       |
 2541|   215k|        newSize = oldSize + len;
 2542|       |
 2543|   215k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 58.4k, False: 156k]
  ------------------
 2544|  58.4k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 29.0k, False: 29.4k]
  ------------------
 2545|  29.0k|                capacity = 40;
 2546|  29.4k|            else
 2547|  29.4k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 29.4k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  58.4k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 20.2k, False: 38.2k]
  ------------------
 2554|  38.2k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 26.1k, False: 12.0k]
  ------------------
 2555|  26.1k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 224, False: 25.9k]
  ------------------
 2556|  20.4k|                xmlChar *newContent;
 2557|       |
 2558|  20.4k|                newContent = xmlMalloc(capacity);
 2559|  20.4k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 11, False: 20.4k]
  ------------------
 2560|     11|                    xmlSAX2ErrMemory(ctxt);
 2561|     11|                    return;
 2562|     11|                }
 2563|       |
 2564|  20.4k|                memcpy(newContent, content, oldSize);
 2565|  20.4k|                lastChild->properties = NULL;
 2566|  20.4k|                content = newContent;
 2567|  38.0k|            } else {
 2568|  38.0k|                content = xmlRealloc(content, capacity);
 2569|  38.0k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 14, False: 38.0k]
  ------------------
 2570|     14|                    xmlSAX2ErrMemory(ctxt);
 2571|     14|                    return;
 2572|     14|                }
 2573|  38.0k|            }
 2574|       |
 2575|  58.4k|            ctxt->nodemem = capacity;
 2576|  58.4k|            lastChild->content = content;
 2577|  58.4k|        }
 2578|       |
 2579|   215k|        memcpy(&content[oldSize], ch, len);
 2580|   215k|        content[newSize] = 0;
 2581|   215k|        ctxt->nodelen = newSize;
 2582|   215k|    }
 2583|       |
 2584|   873k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 873k, False: 0]
  ------------------
 2585|   873k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 800k, False: 72.9k]
  ------------------
 2586|   800k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 800k, False: 0]
  ------------------
 2587|   800k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 765k, False: 34.1k]
  ------------------
 2588|   765k|            lastChild->line = ctxt->input->line;
 2589|  34.1k|        else {
 2590|  34.1k|            lastChild->line = USHRT_MAX;
 2591|  34.1k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 15.2k, False: 18.8k]
  ------------------
 2592|  15.2k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  15.2k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  34.1k|        }
 2594|   800k|    }
 2595|   873k|}

xmlBufCreate:
   85|   384k|xmlBufCreate(size_t size) {
   86|   384k|    xmlBufPtr ret;
   87|       |
   88|   384k|    if (size == SIZE_MAX)
  ------------------
  |  Branch (88:9): [True: 0, False: 384k]
  ------------------
   89|      0|        return(NULL);
   90|       |
   91|   384k|    ret = xmlMalloc(sizeof(*ret));
   92|   384k|    if (ret == NULL)
  ------------------
  |  Branch (92:9): [True: 130, False: 384k]
  ------------------
   93|    130|        return(NULL);
   94|       |
   95|   384k|    ret->use = 0;
   96|   384k|    ret->flags = 0;
   97|   384k|    ret->size = size;
   98|   384k|    ret->maxSize = SIZE_MAX - 1;
   99|       |
  100|   384k|    ret->mem = xmlMalloc(ret->size + 1);
  101|   384k|    if (ret->mem == NULL) {
  ------------------
  |  Branch (101:9): [True: 123, False: 384k]
  ------------------
  102|    123|        xmlFree(ret);
  103|    123|        return(NULL);
  104|    123|    }
  105|   384k|    ret->content = ret->mem;
  106|   384k|    ret->content[0] = 0;
  107|       |
  108|   384k|    return(ret);
  109|   384k|}
xmlBufCreateMem:
  125|   381k|xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) {
  126|   381k|    xmlBufPtr ret;
  127|       |
  128|   381k|    if (mem == NULL)
  ------------------
  |  Branch (128:9): [True: 0, False: 381k]
  ------------------
  129|      0|        return(NULL);
  130|       |
  131|   381k|    if (size == SIZE_MAX)
  ------------------
  |  Branch (131:9): [True: 0, False: 381k]
  ------------------
  132|      0|        return(NULL);
  133|       |
  134|   381k|    ret = xmlMalloc(sizeof(*ret));
  135|   381k|    if (ret == NULL)
  ------------------
  |  Branch (135:9): [True: 18, False: 381k]
  ------------------
  136|     18|        return(NULL);
  137|       |
  138|   381k|    if (isStatic) {
  ------------------
  |  Branch (138:9): [True: 337k, False: 43.2k]
  ------------------
  139|       |        /* Check that memory is zero-terminated */
  140|   337k|        if (mem[size] != 0) {
  ------------------
  |  Branch (140:13): [True: 0, False: 337k]
  ------------------
  141|      0|            xmlFree(ret);
  142|      0|            return(NULL);
  143|      0|        }
  144|   337k|        ret->flags = BUF_FLAG_STATIC;
  ------------------
  |  |   32|   337k|#define BUF_FLAG_STATIC     (1u << 2)
  ------------------
  145|   337k|        ret->mem = (xmlChar *) mem;
  146|   337k|    } else {
  147|  43.2k|        ret->flags = 0;
  148|  43.2k|        ret->mem = xmlMalloc(size + 1);
  149|  43.2k|        if (ret->mem == NULL) {
  ------------------
  |  Branch (149:13): [True: 3, False: 43.2k]
  ------------------
  150|      3|            xmlFree(ret);
  151|      3|            return(NULL);
  152|      3|        }
  153|  43.2k|        memcpy(ret->mem, mem, size);
  154|  43.2k|        ret->mem[size] = 0;
  155|  43.2k|    }
  156|       |
  157|   381k|    ret->use = size;
  158|   381k|    ret->size = size;
  159|   381k|    ret->maxSize = SIZE_MAX - 1;
  160|   381k|    ret->content = ret->mem;
  161|       |
  162|   381k|    return(ret);
  163|   381k|}
xmlBufDetach:
  177|   299k|xmlBufDetach(xmlBuf *buf) {
  178|   299k|    xmlChar *ret;
  179|       |
  180|   299k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|   299k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   299k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   299k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|   299k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   299k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (180:9): [True: 0, False: 299k]
  |  Branch (180:26): [True: 41, False: 299k]
  |  Branch (180:46): [True: 0, False: 299k]
  ------------------
  181|     41|        return(NULL);
  182|       |
  183|   299k|    if (buf->content != buf->mem) {
  ------------------
  |  Branch (183:9): [True: 0, False: 299k]
  ------------------
  184|      0|        ret = xmlStrndup(buf->content, buf->use);
  185|      0|        xmlFree(buf->mem);
  186|   299k|    } else {
  187|   299k|        ret = buf->mem;
  188|   299k|    }
  189|       |
  190|   299k|    buf->content = NULL;
  191|   299k|    buf->mem = NULL;
  192|   299k|    buf->size = 0;
  193|   299k|    buf->use = 0;
  194|       |
  195|   299k|    return ret;
  196|   299k|}
xmlBufFree:
  204|   765k|xmlBufFree(xmlBuf *buf) {
  205|   765k|    if (buf == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 765k]
  ------------------
  206|      0|	return;
  207|       |
  208|   765k|    if (!BUF_STATIC(buf))
  ------------------
  |  |   35|   765k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   765k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (208:9): [True: 427k, False: 337k]
  ------------------
  209|   427k|        xmlFree(buf->mem);
  210|   765k|    xmlFree(buf);
  211|   765k|}
xmlBufEmpty:
  219|    890|xmlBufEmpty(xmlBuf *buf) {
  220|    890|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|    890|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|    890|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|    890|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|    890|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|    890|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (220:9): [True: 0, False: 890]
  |  Branch (220:26): [True: 0, False: 890]
  |  Branch (220:46): [True: 0, False: 890]
  ------------------
  221|      0|        return;
  222|    890|    if (buf->mem == NULL)
  ------------------
  |  Branch (222:9): [True: 0, False: 890]
  ------------------
  223|      0|        return;
  224|       |
  225|    890|    buf->use = 0;
  226|    890|    buf->size += buf->content - buf->mem;
  227|    890|    buf->content = buf->mem;
  228|    890|    buf->content[0] = 0;
  229|    890|}
xmlBufShrink:
  245|  8.92M|xmlBufShrink(xmlBuf *buf, size_t len) {
  246|  8.92M|    if ((buf == NULL) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|  8.92M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  8.92M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  8.92M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (246:9): [True: 0, False: 8.92M]
  |  Branch (246:26): [True: 277, False: 8.92M]
  ------------------
  247|    277|        return(0);
  248|  8.92M|    if (len == 0)
  ------------------
  |  Branch (248:9): [True: 66.1k, False: 8.86M]
  ------------------
  249|  66.1k|        return(0);
  250|       |
  251|  8.86M|    if (len > buf->use)
  ------------------
  |  Branch (251:9): [True: 0, False: 8.86M]
  ------------------
  252|      0|        return(0);
  253|       |
  254|  8.86M|    buf->use -= len;
  255|  8.86M|    buf->content += len;
  256|  8.86M|    buf->size -= len;
  257|       |
  258|  8.86M|    return(len);
  259|  8.86M|}
xmlBufGrow:
  342|  4.40k|xmlBufGrow(xmlBuf *buf, size_t len) {
  343|  4.40k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|  4.40k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  4.40k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  4.40k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|  4.40k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|  4.40k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (343:9): [True: 0, False: 4.40k]
  |  Branch (343:26): [True: 0, False: 4.40k]
  |  Branch (343:46): [True: 0, False: 4.40k]
  ------------------
  344|      0|        return(-1);
  345|       |
  346|  4.40k|    if (len <= buf->size - buf->use)
  ------------------
  |  Branch (346:9): [True: 0, False: 4.40k]
  ------------------
  347|      0|        return(0);
  348|       |
  349|  4.40k|    if (xmlBufGrowInternal(buf, len) < 0)
  ------------------
  |  Branch (349:9): [True: 10, False: 4.39k]
  ------------------
  350|     10|        return(-1);
  351|       |
  352|  4.39k|    return(0);
  353|  4.40k|}
xmlBufContent:
  363|   805k|{
  364|   805k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   805k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   805k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   805k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (364:9): [True: 0, False: 805k]
  |  Branch (364:19): [True: 1, False: 805k]
  ------------------
  365|      1|        return NULL;
  366|       |
  367|   805k|    return(buf->content);
  368|   805k|}
xmlBufEnd:
  378|   136k|{
  379|   136k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   136k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   136k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   136k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (379:9): [True: 0, False: 136k]
  |  Branch (379:19): [True: 0, False: 136k]
  ------------------
  380|      0|        return NULL;
  381|       |
  382|   136k|    return(&buf->content[buf->use]);
  383|   136k|}
xmlBufAddLen:
  396|   136k|xmlBufAddLen(xmlBuf *buf, size_t len) {
  397|   136k|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|   136k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   136k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   136k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|   136k|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|   136k|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (397:9): [True: 0, False: 136k]
  |  Branch (397:26): [True: 0, False: 136k]
  |  Branch (397:46): [True: 0, False: 136k]
  ------------------
  398|      0|        return(-1);
  399|   136k|    if (len > buf->size - buf->use)
  ------------------
  |  Branch (399:9): [True: 0, False: 136k]
  ------------------
  400|      0|        return(-1);
  401|   136k|    buf->use += len;
  402|   136k|    buf->content[buf->use] = 0;
  403|   136k|    return(0);
  404|   136k|}
xmlBufUse:
  414|  1.71M|{
  415|  1.71M|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|  1.71M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  1.71M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  1.71M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (415:9): [True: 17, False: 1.71M]
  |  Branch (415:19): [True: 0, False: 1.71M]
  ------------------
  416|     17|        return 0;
  417|       |
  418|  1.71M|    return(buf->use);
  419|  1.71M|}
xmlBufAvail:
  429|   136k|{
  430|   136k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   136k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   136k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   136k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (430:9): [True: 0, False: 136k]
  |  Branch (430:19): [True: 0, False: 136k]
  ------------------
  431|      0|        return 0;
  432|       |
  433|   136k|    return(buf->size - buf->use);
  434|   136k|}
xmlBufIsEmpty:
  444|   110k|{
  445|   110k|    if ((!buf) || (BUF_ERROR(buf)))
  ------------------
  |  |   34|   110k|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|   110k|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|   110k|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (445:9): [True: 0, False: 110k]
  |  Branch (445:19): [True: 0, False: 110k]
  ------------------
  446|      0|        return(-1);
  447|       |
  448|   110k|    return(buf->use == 0);
  449|   110k|}
xmlBufAdd:
  462|  16.2M|xmlBufAdd(xmlBuf *buf, const xmlChar *str, size_t len) {
  463|  16.2M|    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   34|  16.2M|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|  16.2M|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|  16.2M|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
                  if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
  ------------------
  |  |   35|  16.2M|#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
  |  |  ------------------
  |  |  |  |   32|  16.2M|#define BUF_FLAG_STATIC     (1u << 2)
  |  |  ------------------
  ------------------
  |  Branch (463:9): [True: 0, False: 16.2M]
  |  Branch (463:26): [True: 213, False: 16.2M]
  |  Branch (463:46): [True: 0, False: 16.2M]
  ------------------
  464|    213|        return(-1);
  465|  16.2M|    if (len == 0)
  ------------------
  |  Branch (465:9): [True: 33.0k, False: 16.2M]
  ------------------
  466|  33.0k|        return(0);
  467|  16.2M|    if (str == NULL)
  ------------------
  |  Branch (467:9): [True: 0, False: 16.2M]
  ------------------
  468|      0|	return(-1);
  469|       |
  470|  16.2M|    if (len > buf->size - buf->use) {
  ------------------
  |  Branch (470:9): [True: 104k, False: 16.1M]
  ------------------
  471|   104k|        if (xmlBufGrowInternal(buf, len) < 0)
  ------------------
  |  Branch (471:13): [True: 51, False: 104k]
  ------------------
  472|     51|            return(-1);
  473|   104k|    }
  474|       |
  475|  16.2M|    memmove(&buf->content[buf->use], str, len);
  476|  16.2M|    buf->use += len;
  477|  16.2M|    buf->content[buf->use] = 0;
  478|       |
  479|  16.2M|    return(0);
  480|  16.2M|}
xmlBufCat:
  490|  4.84M|xmlBufCat(xmlBuf *buf, const xmlChar *str) {
  491|  4.84M|    if (str == NULL)
  ------------------
  |  Branch (491:9): [True: 419, False: 4.84M]
  ------------------
  492|    419|        return(0);
  493|  4.84M|    return(xmlBufAdd(buf, str, strlen((const char *) str)));
  494|  4.84M|}
xmlBufResetInput:
  591|   807k|xmlBufResetInput(xmlBuf *buf, xmlParserInput *input) {
  592|   807k|    return(xmlBufUpdateInput(buf, input, 0));
  593|   807k|}
xmlBufUpdateInput:
  608|  10.1M|xmlBufUpdateInput(xmlBuf *buf, xmlParserInput *input, size_t pos) {
  609|  10.1M|    if ((buf == NULL) || (input == NULL))
  ------------------
  |  Branch (609:9): [True: 0, False: 10.1M]
  |  Branch (609:26): [True: 0, False: 10.1M]
  ------------------
  610|      0|        return(-1);
  611|  10.1M|    input->base = buf->content;
  612|  10.1M|    input->cur = input->base + pos;
  613|  10.1M|    input->end = &buf->content[buf->use];
  614|  10.1M|    return(0);
  615|  10.1M|}
buf.c:xmlBufGrowInternal:
  274|   108k|xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
  275|   108k|    size_t size;
  276|   108k|    size_t start;
  277|   108k|    xmlChar *newbuf;
  278|       |
  279|       |    /*
  280|       |     * If there's enough space at the start of the buffer,
  281|       |     * move the contents.
  282|       |     */
  283|   108k|    start = buf->content - buf->mem;
  284|   108k|    if (len <= start + buf->size - buf->use) {
  ------------------
  |  Branch (284:9): [True: 5.96k, False: 102k]
  ------------------
  285|  5.96k|        memmove(buf->mem, buf->content, buf->use + 1);
  286|  5.96k|        buf->size += start;
  287|  5.96k|        buf->content = buf->mem;
  288|  5.96k|        return(0);
  289|  5.96k|    }
  290|       |
  291|   102k|    if (len > buf->maxSize - buf->use) {
  ------------------
  |  Branch (291:9): [True: 0, False: 102k]
  ------------------
  292|      0|        xmlBufOverflowError(buf);
  293|      0|        return(-1);
  294|      0|    }
  295|       |
  296|   102k|    if (buf->size > (size_t) len) {
  ------------------
  |  Branch (296:9): [True: 70.8k, False: 31.6k]
  ------------------
  297|  70.8k|        if (buf->size <= buf->maxSize / 2)
  ------------------
  |  Branch (297:13): [True: 70.8k, False: 0]
  ------------------
  298|  70.8k|            size = buf->size * 2;
  299|      0|        else
  300|      0|            size = buf->maxSize;
  301|  70.8k|    } else {
  302|  31.6k|        size = buf->use + len;
  303|  31.6k|        if (size <= buf->maxSize - 100)
  ------------------
  |  Branch (303:13): [True: 31.6k, False: 0]
  ------------------
  304|  31.6k|            size += 100;
  305|  31.6k|    }
  306|       |
  307|   102k|    if (buf->content == buf->mem) {
  ------------------
  |  Branch (307:9): [True: 101k, False: 1.10k]
  ------------------
  308|   101k|        newbuf = xmlRealloc(buf->mem, size + 1);
  309|   101k|        if (newbuf == NULL) {
  ------------------
  |  Branch (309:13): [True: 54, False: 101k]
  ------------------
  310|     54|            xmlBufMemoryError(buf);
  311|     54|            return(-1);
  312|     54|        }
  313|   101k|    } else {
  314|  1.10k|        newbuf = xmlMalloc(size + 1);
  315|  1.10k|        if (newbuf == NULL) {
  ------------------
  |  Branch (315:13): [True: 7, False: 1.09k]
  ------------------
  316|      7|            xmlBufMemoryError(buf);
  317|      7|            return(-1);
  318|      7|        }
  319|  1.09k|        if (buf->content != NULL)
  ------------------
  |  Branch (319:13): [True: 1.09k, False: 0]
  ------------------
  320|  1.09k|            memcpy(newbuf, buf->content, buf->use + 1);
  321|  1.09k|        xmlFree(buf->mem);
  322|  1.09k|    }
  323|       |
  324|   102k|    buf->mem = newbuf;
  325|   102k|    buf->content = newbuf;
  326|   102k|    buf->size = size;
  327|       |
  328|   102k|    return(0);
  329|   102k|}
buf.c:xmlBufMemoryError:
   60|     61|{
   61|     61|    if (!BUF_ERROR(buf))
  ------------------
  |  |   34|     61|#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   30|     61|#define BUF_FLAG_OOM        (1u << 0)
  |  |  ------------------
  |  |               #define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
  |  |  ------------------
  |  |  |  |   31|     61|#define BUF_FLAG_OVERFLOW   (1u << 1)
  |  |  ------------------
  ------------------
  |  Branch (61:9): [True: 61, False: 0]
  ------------------
   62|     61|        buf->flags |= BUF_FLAG_OOM;
  ------------------
  |  |   30|     61|#define BUF_FLAG_OOM        (1u << 0)
  ------------------
   63|     61|}

xmlInitCatalogInternal:
 3211|      2|xmlInitCatalogInternal(void) {
 3212|      2|    if (getenv("XML_DEBUG_CATALOG"))
  ------------------
  |  Branch (3212:9): [True: 0, False: 2]
  ------------------
 3213|      0|	xmlDebugCatalogs = 1;
 3214|      2|    xmlInitRMutex(&xmlCatalogMutex);
 3215|      2|}
xmlInitializeCatalog:
 3221|      2|xmlInitializeCatalog(void) {
 3222|      2|    if (xmlCatalogInitialized != 0)
  ------------------
  |  Branch (3222:9): [True: 0, False: 2]
  ------------------
 3223|      0|	return;
 3224|       |
 3225|      2|    xmlInitParser();
 3226|       |
 3227|      2|    xmlRMutexLock(&xmlCatalogMutex);
 3228|       |
 3229|      2|    if (xmlDefaultCatalog == NULL) {
  ------------------
  |  Branch (3229:9): [True: 2, False: 0]
  ------------------
 3230|      2|	const char *catalogs;
 3231|      2|	char *path;
 3232|      2|	const char *cur, *paths;
 3233|      2|	xmlCatalogPtr catal;
 3234|      2|	xmlCatalogEntryPtr *nextent;
 3235|       |
 3236|      2|	catalogs = (const char *) getenv("XML_CATALOG_FILES");
 3237|      2|	if (catalogs == NULL)
  ------------------
  |  Branch (3237:6): [True: 2, False: 0]
  ------------------
 3238|      2|	    catalogs = XML_XML_DEFAULT_CATALOG;
  ------------------
  |  |   58|      2|#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog"
  ------------------
 3239|       |
 3240|      2|	catal = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
 3241|      2|		xmlCatalogDefaultPrefer);
 3242|      2|	if (catal != NULL) {
  ------------------
  |  Branch (3242:6): [True: 2, False: 0]
  ------------------
 3243|       |	    /* the XML_CATALOG_FILES envvar is allowed to contain a
 3244|       |	       space-separated list of entries. */
 3245|      2|	    cur = catalogs;
 3246|      2|	    nextent = &catal->xml;
 3247|      4|	    while (*cur != '\0') {
  ------------------
  |  Branch (3247:13): [True: 2, False: 2]
  ------------------
 3248|      2|		while (xmlIsBlank_ch(*cur))
  ------------------
  |  |   90|      2|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (90:27): [True: 0, False: 2]
  |  |  ------------------
  |  |   91|      2|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 2, False: 0]
  |  |  |  Branch (91:23): [True: 0, False: 2]
  |  |  ------------------
  |  |   92|      2|				 ((c) == 0xd))
  |  |  ------------------
  |  |  |  Branch (92:6): [True: 0, False: 2]
  |  |  ------------------
  ------------------
 3249|      0|		    cur++;
 3250|      2|		if (*cur != 0) {
  ------------------
  |  Branch (3250:7): [True: 2, False: 0]
  ------------------
 3251|      2|		    paths = cur;
 3252|     68|		    while ((*cur != 0) && (!xmlIsBlank_ch(*cur)))
  ------------------
  |  |   90|     66|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  ------------------
  |  |  |  Branch (90:27): [True: 0, False: 66]
  |  |  ------------------
  |  |   91|     66|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  ------------------
  |  |  |  Branch (91:7): [True: 66, False: 0]
  |  |  |  Branch (91:23): [True: 0, False: 66]
  |  |  ------------------
  |  |   92|     66|				 ((c) == 0xd))
  |  |  ------------------
  |  |  |  Branch (92:6): [True: 0, False: 66]
  |  |  ------------------
  ------------------
  |  Branch (3252:14): [True: 66, False: 2]
  ------------------
 3253|     66|			cur++;
 3254|      2|		    path = (char *) xmlStrndup((const xmlChar *)paths, cur - paths);
 3255|      2|		    if (path != NULL) {
  ------------------
  |  Branch (3255:11): [True: 2, False: 0]
  ------------------
 3256|      2|			*nextent = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
 3257|      2|				NULL, BAD_CAST path, xmlCatalogDefaultPrefer, NULL);
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 3258|      2|			if (*nextent != NULL)
  ------------------
  |  Branch (3258:8): [True: 2, False: 0]
  ------------------
 3259|      2|			    nextent = &((*nextent)->next);
 3260|      2|			xmlFree(path);
 3261|      2|		    }
 3262|      2|		}
 3263|      2|	    }
 3264|      2|	    xmlDefaultCatalog = catal;
 3265|      2|	}
 3266|      2|    }
 3267|       |
 3268|      2|    xmlRMutexUnlock(&xmlCatalogMutex);
 3269|       |
 3270|      2|    xmlCatalogInitialized = 1;
 3271|      2|}
xmlCatalogGetDefaults:
 3586|   330k|xmlCatalogGetDefaults(void) {
 3587|   330k|    return(xmlCatalogDefaultAllow);
 3588|   330k|}
xmlCatalogSetDefaults:
 3600|      2|xmlCatalogSetDefaults(xmlCatalogAllow allow) {
 3601|      2|    if (xmlDebugCatalogs) {
  ------------------
  |  Branch (3601:9): [True: 0, False: 2]
  ------------------
 3602|      0|	switch (allow) {
  ------------------
  |  Branch (3602:10): [True: 0, False: 0]
  ------------------
 3603|      0|	    case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (3603:6): [True: 0, False: 0]
  ------------------
 3604|      0|		xmlCatalogPrintDebug(
 3605|      0|			"Disabling catalog usage\n");
 3606|      0|		break;
 3607|      0|	    case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (3607:6): [True: 0, False: 0]
  ------------------
 3608|      0|		xmlCatalogPrintDebug(
 3609|      0|			"Allowing only global catalogs\n");
 3610|      0|		break;
 3611|      0|	    case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (3611:6): [True: 0, False: 0]
  ------------------
 3612|      0|		xmlCatalogPrintDebug(
 3613|      0|			"Allowing only catalogs from the document\n");
 3614|      0|		break;
 3615|      0|	    case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (3615:6): [True: 0, False: 0]
  ------------------
 3616|      0|		xmlCatalogPrintDebug(
 3617|      0|			"Allowing all catalogs\n");
 3618|      0|		break;
 3619|      0|	}
 3620|      0|    }
 3621|      2|    xmlCatalogDefaultAllow = allow;
 3622|      2|}
catalog.c:xmlCreateNewCatalog:
  458|      2|xmlCreateNewCatalog(xmlCatalogType type, xmlCatalogPrefer prefer) {
  459|      2|    xmlCatalogPtr ret;
  460|       |
  461|      2|    ret = (xmlCatalogPtr) xmlMalloc(sizeof(xmlCatalog));
  462|      2|    if (ret == NULL) {
  ------------------
  |  Branch (462:9): [True: 0, False: 2]
  ------------------
  463|      0|        xmlCatalogErrMemory();
  464|      0|	return(NULL);
  465|      0|    }
  466|      2|    memset(ret, 0, sizeof(xmlCatalog));
  467|      2|    ret->type = type;
  468|      2|    ret->prefer = prefer;
  469|      2|#ifdef LIBXML_SGML_CATALOG_ENABLED
  470|      2|    ret->catalNr = 0;
  471|      2|    ret->catalMax = XML_MAX_SGML_CATA_DEPTH;
  ------------------
  |  |  133|      2|#define XML_MAX_SGML_CATA_DEPTH 10
  ------------------
  472|      2|    if (ret->type == XML_SGML_CATALOG_TYPE)
  ------------------
  |  Branch (472:9): [True: 0, False: 2]
  ------------------
  473|      0|	ret->sgml = xmlHashCreate(10);
  474|      2|#endif
  475|      2|    return(ret);
  476|      2|}
catalog.c:xmlNewCatalogEntry:
  322|      2|	   xmlCatalogEntryPtr group) {
  323|      2|    xmlCatalogEntryPtr ret;
  324|      2|    xmlChar *normid = NULL;
  325|       |
  326|      2|    ret = (xmlCatalogEntryPtr) xmlMalloc(sizeof(xmlCatalogEntry));
  327|      2|    if (ret == NULL) {
  ------------------
  |  Branch (327:9): [True: 0, False: 2]
  ------------------
  328|      0|        xmlCatalogErrMemory();
  329|      0|	return(NULL);
  330|      0|    }
  331|      2|    ret->next = NULL;
  332|      2|    ret->parent = NULL;
  333|      2|    ret->children = NULL;
  334|      2|    ret->type = type;
  335|      2|    if (type == XML_CATA_PUBLIC || type == XML_CATA_DELEGATE_PUBLIC) {
  ------------------
  |  Branch (335:9): [True: 0, False: 2]
  |  Branch (335:36): [True: 0, False: 2]
  ------------------
  336|      0|        normid = xmlCatalogNormalizePublic(name);
  337|      0|        if (normid != NULL)
  ------------------
  |  Branch (337:13): [True: 0, False: 0]
  ------------------
  338|      0|            name = (*normid != 0 ? normid : NULL);
  ------------------
  |  Branch (338:21): [True: 0, False: 0]
  ------------------
  339|      0|    }
  340|      2|    if (name != NULL)
  ------------------
  |  Branch (340:9): [True: 0, False: 2]
  ------------------
  341|      0|	ret->name = xmlStrdup(name);
  342|      2|    else
  343|      2|	ret->name = NULL;
  344|      2|    if (normid != NULL)
  ------------------
  |  Branch (344:9): [True: 0, False: 2]
  ------------------
  345|      0|        xmlFree(normid);
  346|      2|    if (value != NULL)
  ------------------
  |  Branch (346:9): [True: 0, False: 2]
  ------------------
  347|      0|	ret->value = xmlStrdup(value);
  348|      2|    else
  349|      2|	ret->value = NULL;
  350|      2|    if (URL == NULL)
  ------------------
  |  Branch (350:9): [True: 0, False: 2]
  ------------------
  351|      0|	URL = value;
  352|      2|    if (URL != NULL)
  ------------------
  |  Branch (352:9): [True: 2, False: 0]
  ------------------
  353|      2|	ret->URL = xmlStrdup(URL);
  354|      0|    else
  355|      0|	ret->URL = NULL;
  356|      2|    ret->prefer = prefer;
  357|      2|    ret->dealloc = 0;
  358|      2|    ret->depth = 0;
  359|      2|    ret->group = group;
  360|      2|    return(ret);
  361|      2|}

xmlCharInRange:
   32|  6.00M|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|  6.00M|    int low, high, mid;
   34|  6.00M|    const xmlChSRange *sptr;
   35|  6.00M|    const xmlChLRange *lptr;
   36|       |
   37|  6.00M|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 6.00M]
  ------------------
   38|  6.00M|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 5.95M, False: 44.1k]
  ------------------
   39|  5.95M|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 5.95M]
  ------------------
   40|      0|	    return 0;
   41|  5.95M|	low = 0;
   42|  5.95M|	high = rptr->nbShortRange - 1;
   43|  5.95M|	sptr = rptr->shortRange;
   44|  47.6M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 47.6M, False: 15.4k]
  ------------------
   45|  47.6M|	    mid = (low + high) / 2;
   46|  47.6M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 23.7M, False: 23.8M]
  ------------------
   47|  23.7M|		high = mid - 1;
   48|  23.8M|	    } else {
   49|  23.8M|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 17.8M, False: 5.94M]
  ------------------
   50|  17.8M|		    low = mid + 1;
   51|  17.8M|		} else {
   52|  5.94M|		    return 1;
   53|  5.94M|		}
   54|  23.8M|	    }
   55|  47.6M|	}
   56|  5.95M|    } else {
   57|  44.1k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 44.1k, False: 0]
  ------------------
   58|  44.1k|	    return 0;
   59|  44.1k|	}
   60|      0|	low = 0;
   61|      0|	high = rptr->nbLongRange - 1;
   62|      0|	lptr = rptr->longRange;
   63|      0|	while (low <= high) {
  ------------------
  |  Branch (63:9): [True: 0, False: 0]
  ------------------
   64|      0|	    mid = (low + high) / 2;
   65|      0|	    if (val < lptr[mid].low) {
  ------------------
  |  Branch (65:10): [True: 0, False: 0]
  ------------------
   66|      0|		high = mid - 1;
   67|      0|	    } else {
   68|      0|		if (val > lptr[mid].high) {
  ------------------
  |  Branch (68:7): [True: 0, False: 0]
  ------------------
   69|      0|		    low = mid + 1;
   70|      0|		} else {
   71|      0|		    return 1;
   72|      0|		}
   73|      0|	    }
   74|      0|	}
   75|      0|    }
   76|  15.4k|    return 0;
   77|  6.00M|}

xmlInitDictInternal:
   98|      2|xmlInitDictInternal(void) {
   99|      2|    xmlInitMutex(&xmlDictMutex);
  100|      2|}
xmlDictCreate:
  264|  54.2k|xmlDictCreate(void) {
  265|  54.2k|    xmlDictPtr dict;
  266|       |
  267|  54.2k|    xmlInitParser();
  268|       |
  269|  54.2k|    dict = xmlMalloc(sizeof(xmlDict));
  270|  54.2k|    if (dict == NULL)
  ------------------
  |  Branch (270:9): [True: 5, False: 54.2k]
  ------------------
  271|      5|        return(NULL);
  272|  54.2k|    dict->ref_counter = 1;
  273|  54.2k|    dict->limit = 0;
  274|       |
  275|  54.2k|    dict->size = 0;
  276|  54.2k|    dict->nbElems = 0;
  277|  54.2k|    dict->table = NULL;
  278|  54.2k|    dict->strings = NULL;
  279|       |    dict->subdict = NULL;
  280|  54.2k|    dict->seed = xmlRandom();
  281|  54.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  282|  54.2k|    dict->seed = 0;
  283|  54.2k|#endif
  284|  54.2k|    return(dict);
  285|  54.2k|}
xmlDictReference:
  315|  67.2k|xmlDictReference(xmlDict *dict) {
  316|  67.2k|    if (dict == NULL) return -1;
  ------------------
  |  Branch (316:9): [True: 9.90k, False: 57.3k]
  ------------------
  317|  57.3k|    xmlMutexLock(&xmlDictMutex);
  318|  57.3k|    dict->ref_counter++;
  319|  57.3k|    xmlMutexUnlock(&xmlDictMutex);
  320|  57.3k|    return(0);
  321|  67.2k|}
xmlDictFree:
  330|   111k|xmlDictFree(xmlDict *dict) {
  331|   111k|    xmlDictStringsPtr pool, nextp;
  332|       |
  333|   111k|    if (dict == NULL)
  ------------------
  |  Branch (333:9): [True: 0, False: 111k]
  ------------------
  334|      0|	return;
  335|       |
  336|       |    /* decrement the counter, it may be shared by a parser and docs */
  337|   111k|    xmlMutexLock(&xmlDictMutex);
  338|   111k|    dict->ref_counter--;
  339|   111k|    if (dict->ref_counter > 0) {
  ------------------
  |  Branch (339:9): [True: 57.3k, False: 54.2k]
  ------------------
  340|  57.3k|        xmlMutexUnlock(&xmlDictMutex);
  341|  57.3k|        return;
  342|  57.3k|    }
  343|       |
  344|  54.2k|    xmlMutexUnlock(&xmlDictMutex);
  345|       |
  346|  54.2k|    if (dict->subdict != NULL) {
  ------------------
  |  Branch (346:9): [True: 0, False: 54.2k]
  ------------------
  347|      0|        xmlDictFree(dict->subdict);
  348|      0|    }
  349|       |
  350|  54.2k|    if (dict->table) {
  ------------------
  |  Branch (350:9): [True: 47.0k, False: 7.22k]
  ------------------
  351|  47.0k|	xmlFree(dict->table);
  352|  47.0k|    }
  353|  54.2k|    pool = dict->strings;
  354|   102k|    while (pool != NULL) {
  ------------------
  |  Branch (354:12): [True: 47.9k, False: 54.2k]
  ------------------
  355|  47.9k|        nextp = pool->next;
  356|  47.9k|	xmlFree(pool);
  357|  47.9k|	pool = nextp;
  358|  47.9k|    }
  359|  54.2k|    xmlFree(dict);
  360|  54.2k|}
xmlDictOwns:
  371|  22.2M|xmlDictOwns(xmlDict *dict, const xmlChar *str) {
  372|  22.2M|    xmlDictStringsPtr pool;
  373|       |
  374|  22.2M|    if ((dict == NULL) || (str == NULL))
  ------------------
  |  Branch (374:9): [True: 0, False: 22.2M]
  |  Branch (374:27): [True: 0, False: 22.2M]
  ------------------
  375|      0|	return(-1);
  376|  22.2M|    pool = dict->strings;
  377|  29.6M|    while (pool != NULL) {
  ------------------
  |  Branch (377:12): [True: 22.3M, False: 7.28M]
  ------------------
  378|  22.3M|        if ((str >= &pool->array[0]) && (str <= pool->free))
  ------------------
  |  Branch (378:13): [True: 21.7M, False: 612k]
  |  Branch (378:41): [True: 14.9M, False: 6.85M]
  ------------------
  379|  14.9M|	    return(1);
  380|  7.47M|	pool = pool->next;
  381|  7.47M|    }
  382|  7.28M|    if (dict->subdict)
  ------------------
  |  Branch (382:9): [True: 0, False: 7.28M]
  ------------------
  383|      0|        return(xmlDictOwns(dict->subdict, str));
  384|  7.28M|    return(0);
  385|  7.28M|}
xmlDictSetLimit:
  412|  55.3k|xmlDictSetLimit(xmlDict *dict, size_t limit) {
  413|  55.3k|    size_t ret;
  414|       |
  415|  55.3k|    if (dict == NULL)
  ------------------
  |  Branch (415:9): [True: 0, False: 55.3k]
  ------------------
  416|      0|	return(0);
  417|  55.3k|    ret = dict->limit;
  418|  55.3k|    dict->limit = limit;
  419|  55.3k|    return(ret);
  420|  55.3k|}
xmlDictComputeHash:
  508|   241k|xmlDictComputeHash(const xmlDict *dict, const xmlChar *string) {
  509|   241k|    size_t len;
  510|       |    return(xmlDictHashName(dict->seed, string, SIZE_MAX, &len));
  511|   241k|}
xmlDictCombineHash:
  524|   401k|xmlDictCombineHash(unsigned v1, unsigned v2) {
  525|       |    /*
  526|       |     * The upper bit of hash values is always set, so we have to operate on
  527|       |     * 31-bit hashes here.
  528|       |     */
  529|   401k|    v1 ^= v2;
  530|   401k|    v1 += HASH_ROL31(v2, 5);
  ------------------
  |  |  513|   401k|#define HASH_ROL31(x,n) ((x) << (n) | ((x) & 0x7FFFFFFF) >> (31 - (n)))
  ------------------
  531|       |
  532|   401k|    return((v1 & 0xFFFFFFFF) | 0x80000000);
  533|   401k|}
xmlDictLookup:
  825|  17.2M|xmlDictLookup(xmlDict *dict, const xmlChar *name, int len) {
  826|  17.2M|    const xmlDictEntry *entry;
  827|       |
  828|  17.2M|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  829|  17.2M|    if (entry == NULL)
  ------------------
  |  Branch (829:9): [True: 40, False: 17.2M]
  ------------------
  830|     40|        return(NULL);
  831|  17.2M|    return(entry->name);
  832|  17.2M|}
xmlDictLookupHashed:
  844|  1.59M|xmlDictLookupHashed(xmlDict *dict, const xmlChar *name, int len) {
  845|  1.59M|    const xmlDictEntry *entry;
  846|  1.59M|    xmlHashedString ret;
  847|       |
  848|  1.59M|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  849|       |
  850|  1.59M|    if (entry == NULL) {
  ------------------
  |  Branch (850:9): [True: 17, False: 1.59M]
  ------------------
  851|     17|        ret.name = NULL;
  852|     17|        ret.hashValue = 0;
  853|  1.59M|    } else {
  854|  1.59M|        ret = *entry;
  855|  1.59M|    }
  856|       |
  857|  1.59M|    return(ret);
  858|  1.59M|}
xmlDictQLookup:
  889|  31.8k|xmlDictQLookup(xmlDict *dict, const xmlChar *prefix, const xmlChar *name) {
  890|  31.8k|    const xmlDictEntry *entry;
  891|       |
  892|  31.8k|    entry = xmlDictLookupInternal(dict, prefix, name, -1, 1);
  893|  31.8k|    if (entry == NULL)
  ------------------
  |  Branch (893:9): [True: 8, False: 31.8k]
  ------------------
  894|      8|        return(NULL);
  895|  31.8k|    return(entry->name);
  896|  31.8k|}
xmlInitRandom:
  926|      2|xmlInitRandom(void) {
  927|      2|    xmlInitMutex(&xmlRngMutex);
  928|       |
  929|      2|    {
  930|       |#ifdef _WIN32
  931|       |        NTSTATUS status;
  932|       |
  933|       |        /*
  934|       |         * You can find many (recent as of 2025) discussions how
  935|       |         * to get a pseudo-random seed on Windows in projects like
  936|       |         * Golang, Rust, Chromium and Firefox.
  937|       |         *
  938|       |         * TODO: Support ProcessPrng available since Windows 10.
  939|       |         */
  940|       |        status = BCryptGenRandom(NULL, (unsigned char *) globalRngState,
  941|       |                                 sizeof(globalRngState),
  942|       |                                 BCRYPT_USE_SYSTEM_PREFERRED_RNG);
  943|       |        if (!BCRYPT_SUCCESS(status))
  944|       |            xmlAbort("libxml2: BCryptGenRandom failed with error code %lu\n",
  945|       |                     GetLastError());
  946|       |#else
  947|      2|        int var;
  948|       |
  949|      2|#if HAVE_DECL_GETENTROPY
  950|      2|        while (1) {
  ------------------
  |  Branch (950:16): [True: 2, Folded]
  ------------------
  951|      2|            if (getentropy(globalRngState, sizeof(globalRngState)) == 0)
  ------------------
  |  Branch (951:17): [True: 2, False: 0]
  ------------------
  952|      2|                return;
  953|       |
  954|       |            /*
  955|       |             * This most likely means that libxml2 was compiled on
  956|       |             * a system supporting certain system calls and is running
  957|       |             * on a system that doesn't support these calls, as can
  958|       |             * be the case on Linux.
  959|       |             */
  960|      0|            if (errno == ENOSYS)
  ------------------
  |  Branch (960:17): [True: 0, False: 0]
  ------------------
  961|      0|                break;
  962|       |
  963|       |            /*
  964|       |             * We really don't want to fallback to the unsafe PRNG
  965|       |             * for possibly accidental reasons, so we abort on any
  966|       |             * unknown error.
  967|       |             */
  968|      0|            if (errno != EINTR)
  ------------------
  |  Branch (968:17): [True: 0, False: 0]
  ------------------
  969|      0|                xmlAbort("libxml2: getentropy failed with error code %d\n",
  970|      0|                         errno);
  971|      0|        }
  972|      0|#endif
  973|       |
  974|       |        /*
  975|       |         * TODO: Fallback to /dev/urandom for older POSIX systems.
  976|       |         */
  977|      0|        globalRngState[0] =
  978|      0|                (unsigned) time(NULL) ^
  979|      0|                HASH_ROL((unsigned) ((size_t) &xmlInitRandom & 0xFFFFFFFF), 8);
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  980|      0|        globalRngState[1] =
  981|      0|                HASH_ROL((unsigned) ((size_t) &xmlRngMutex & 0xFFFFFFFF), 16) ^
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  982|      0|                HASH_ROL((unsigned) ((size_t) &var & 0xFFFFFFFF), 24);
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  983|      0|#endif
  984|      0|    }
  985|      0|}
xmlGlobalRandom:
 1017|      2|xmlGlobalRandom(void) {
 1018|      2|    unsigned ret;
 1019|       |
 1020|      2|    xmlMutexLock(&xmlRngMutex);
 1021|      2|    ret = xoroshiro64ss(globalRngState);
 1022|      2|    xmlMutexUnlock(&xmlRngMutex);
 1023|       |
 1024|      2|    return(ret);
 1025|      2|}
xmlRandom:
 1034|   144k|xmlRandom(void) {
 1035|   144k|    return(xoroshiro64ss(xmlGetLocalRngState()));
 1036|   144k|}
dict.c:xmlDictHashName:
  454|  19.0M|                size_t *plen) {
  455|  19.0M|    unsigned h1, h2;
  456|  19.0M|    size_t i;
  457|       |
  458|  19.0M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  19.0M|    do { \
  |  |   24|  19.0M|        h1 = seed ^ 0x3b00; \
  |  |   25|  19.0M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  19.0M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  19.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 19.0M]
  |  |  ------------------
  ------------------
  459|       |
  460|   237M|    for (i = 0; i < maxLen && data[i]; i++) {
  ------------------
  |  Branch (460:17): [True: 232M, False: 4.46M]
  |  Branch (460:31): [True: 218M, False: 14.5M]
  ------------------
  461|   218M|        HASH_UPDATE(h1, h2, data[i]);
  ------------------
  |  |   29|   218M|    do { \
  |  |   30|   218M|        h1 += ch; \
  |  |   31|   218M|        h1 += h1 << 3; \
  |  |   32|   218M|        h2 += h1; \
  |  |   33|   218M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   218M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   218M|        h2 += h2 << 2; \
  |  |   35|   218M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 218M]
  |  |  ------------------
  ------------------
  462|   218M|    }
  463|       |
  464|  19.0M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  19.0M|    do { \
  |  |   40|  19.0M|        h1 ^= h2; \
  |  |   41|  19.0M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  19.0M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  19.0M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  19.0M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  19.0M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  19.0M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  19.0M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  19.0M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  19.0M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  19.0M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 19.0M]
  |  |  ------------------
  ------------------
  465|       |
  466|  19.0M|    *plen = i;
  467|  19.0M|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  19.0M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  468|  19.0M|}
dict.c:xmlDictLookupInternal:
  678|  18.8M|                      const xmlChar *name, int maybeLen, int update) {
  679|  18.8M|    xmlDictEntry *entry = NULL;
  680|  18.8M|    const xmlChar *ret;
  681|  18.8M|    unsigned hashValue, newSize;
  682|  18.8M|    size_t maxLen, len, plen, klen;
  683|  18.8M|    int found = 0;
  684|       |
  685|  18.8M|    if ((dict == NULL) || (name == NULL))
  ------------------
  |  Branch (685:9): [True: 0, False: 18.8M]
  |  Branch (685:27): [True: 0, False: 18.8M]
  ------------------
  686|      0|	return(NULL);
  687|       |
  688|  18.8M|    maxLen = (maybeLen < 0) ? SIZE_MAX : (size_t) maybeLen;
  ------------------
  |  Branch (688:14): [True: 14.3M, False: 4.46M]
  ------------------
  689|       |
  690|  18.8M|    if (prefix == NULL) {
  ------------------
  |  Branch (690:9): [True: 18.8M, False: 31.8k]
  ------------------
  691|  18.8M|        hashValue = xmlDictHashName(dict->seed, name, maxLen, &len);
  692|  18.8M|        if (len > INT_MAX / 2)
  ------------------
  |  Branch (692:13): [True: 0, False: 18.8M]
  ------------------
  693|      0|            return(NULL);
  694|  18.8M|        klen = len;
  695|  18.8M|    } else {
  696|  31.8k|        hashValue = xmlDictHashQName(dict->seed, prefix, name, &plen, &len);
  697|  31.8k|        if ((len > INT_MAX / 2) || (plen >= INT_MAX / 2 - len))
  ------------------
  |  Branch (697:13): [True: 0, False: 31.8k]
  |  Branch (697:36): [True: 0, False: 31.8k]
  ------------------
  698|      0|            return(NULL);
  699|  31.8k|        klen = plen + 1 + len;
  700|  31.8k|    }
  701|       |
  702|  18.8M|    if ((dict->limit > 0) && (klen >= dict->limit))
  ------------------
  |  Branch (702:9): [True: 13.3M, False: 5.53M]
  |  Branch (702:30): [True: 0, False: 13.3M]
  ------------------
  703|      0|        return(NULL);
  704|       |
  705|       |    /*
  706|       |     * Check for an existing entry
  707|       |     */
  708|  18.8M|    if (dict->size == 0) {
  ------------------
  |  Branch (708:9): [True: 47.0k, False: 18.7M]
  ------------------
  709|  47.0k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   43|  47.0k|#define MIN_HASH_SIZE 8
  ------------------
  710|  18.7M|    } else {
  711|  18.7M|        entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found);
  712|  18.7M|        if (found)
  ------------------
  |  Branch (712:13): [True: 18.4M, False: 390k]
  ------------------
  713|  18.4M|            return(entry);
  714|       |
  715|   390k|        if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   42|   390k|#define MAX_FILL_DENOM 8
  ------------------
                      if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   41|   390k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (715:13): [True: 28.9k, False: 361k]
  ------------------
  716|  28.9k|            if (dict->size >= MAX_HASH_SIZE)
  ------------------
  |  |   44|  28.9k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (716:17): [True: 0, False: 28.9k]
  ------------------
  717|      0|                return(NULL);
  718|  28.9k|            newSize = dict->size * 2;
  719|   361k|        } else {
  720|   361k|            newSize = 0;
  721|   361k|        }
  722|   390k|    }
  723|       |
  724|   437k|    if ((dict->subdict != NULL) && (dict->subdict->size > 0)) {
  ------------------
  |  Branch (724:9): [True: 0, False: 437k]
  |  Branch (724:36): [True: 0, False: 0]
  ------------------
  725|      0|        xmlDictEntry *subEntry;
  726|      0|        unsigned subHashValue;
  727|       |
  728|      0|        if (prefix == NULL)
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|            subHashValue = xmlDictHashName(dict->subdict->seed, name, len,
  730|      0|                                           &len);
  731|      0|        else
  732|      0|            subHashValue = xmlDictHashQName(dict->subdict->seed, prefix, name,
  733|      0|                                            &plen, &len);
  734|      0|        subEntry = xmlDictFindEntry(dict->subdict, prefix, name, klen,
  735|      0|                                    subHashValue, &found);
  736|      0|        if (found)
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|            return(subEntry);
  738|      0|    }
  739|       |
  740|   437k|    if (!update)
  ------------------
  |  Branch (740:9): [True: 0, False: 437k]
  ------------------
  741|      0|        return(NULL);
  742|       |
  743|       |    /*
  744|       |     * Grow the hash table if needed
  745|       |     */
  746|   437k|    if (newSize > 0) {
  ------------------
  |  Branch (746:9): [True: 76.0k, False: 361k]
  ------------------
  747|  76.0k|        unsigned mask, displ, pos;
  748|       |
  749|  76.0k|        if (xmlDictGrow(dict, newSize) != 0)
  ------------------
  |  Branch (749:13): [True: 56, False: 75.9k]
  ------------------
  750|     56|            return(NULL);
  751|       |
  752|       |        /*
  753|       |         * Find new entry
  754|       |         */
  755|  75.9k|        mask = dict->size - 1;
  756|  75.9k|        displ = 0;
  757|  75.9k|        pos = hashValue & mask;
  758|  75.9k|        entry = &dict->table[pos];
  759|       |
  760|  89.5k|        while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (760:16): [True: 17.9k, False: 71.6k]
  ------------------
  761|  17.9k|               ((pos - entry->hashValue) & mask) >= displ) {
  ------------------
  |  Branch (761:16): [True: 13.6k, False: 4.30k]
  ------------------
  762|  13.6k|            displ++;
  763|  13.6k|            pos++;
  764|  13.6k|            entry++;
  765|  13.6k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (765:17): [True: 1.34k, False: 12.2k]
  ------------------
  766|  1.34k|                entry = dict->table;
  767|  13.6k|        }
  768|  75.9k|    }
  769|       |
  770|   437k|    if (prefix == NULL)
  ------------------
  |  Branch (770:9): [True: 431k, False: 5.72k]
  ------------------
  771|   431k|        ret = xmlDictAddString(dict, name, len);
  772|  5.72k|    else
  773|  5.72k|        ret = xmlDictAddQString(dict, prefix, plen, name, len);
  774|   437k|    if (ret == NULL)
  ------------------
  |  Branch (774:9): [True: 9, False: 437k]
  ------------------
  775|      9|        return(NULL);
  776|       |
  777|       |    /*
  778|       |     * Shift the remainder of the probe sequence to the right
  779|       |     */
  780|   437k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (780:9): [True: 78.7k, False: 358k]
  ------------------
  781|  78.7k|        const xmlDictEntry *end = &dict->table[dict->size];
  782|  78.7k|        const xmlDictEntry *cur = entry;
  783|       |
  784|   264k|        do {
  785|   264k|            cur++;
  786|   264k|            if (cur >= end)
  ------------------
  |  Branch (786:17): [True: 23.8k, False: 240k]
  ------------------
  787|  23.8k|                cur = dict->table;
  788|   264k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (788:18): [True: 186k, False: 78.7k]
  ------------------
  789|       |
  790|  78.7k|        if (cur < entry) {
  ------------------
  |  Branch (790:13): [True: 23.8k, False: 54.8k]
  ------------------
  791|       |            /*
  792|       |             * If we traversed the end of the buffer, handle the part
  793|       |             * at the start of the buffer.
  794|       |             */
  795|  23.8k|            memmove(&dict->table[1], dict->table,
  796|  23.8k|                    (char *) cur - (char *) dict->table);
  797|  23.8k|            cur = end - 1;
  798|  23.8k|            dict->table[0] = *cur;
  799|  23.8k|        }
  800|       |
  801|  78.7k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  802|  78.7k|    }
  803|       |
  804|       |    /*
  805|       |     * Populate entry
  806|       |     */
  807|   437k|    entry->hashValue = hashValue;
  808|   437k|    entry->name = ret;
  809|       |
  810|   437k|    dict->nbElems++;
  811|       |
  812|   437k|    return(entry);
  813|   437k|}
dict.c:xmlDictHashQName:
  473|  31.8k|                 size_t *pplen, size_t *plen) {
  474|  31.8k|    unsigned h1, h2;
  475|  31.8k|    size_t i;
  476|       |
  477|  31.8k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  31.8k|    do { \
  |  |   24|  31.8k|        h1 = seed ^ 0x3b00; \
  |  |   25|  31.8k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  31.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  31.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 31.8k]
  |  |  ------------------
  ------------------
  478|       |
  479|   469k|    for (i = 0; prefix[i] != 0; i++) {
  ------------------
  |  Branch (479:17): [True: 438k, False: 31.8k]
  ------------------
  480|   438k|        HASH_UPDATE(h1, h2, prefix[i]);
  ------------------
  |  |   29|   438k|    do { \
  |  |   30|   438k|        h1 += ch; \
  |  |   31|   438k|        h1 += h1 << 3; \
  |  |   32|   438k|        h2 += h1; \
  |  |   33|   438k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   438k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   438k|        h2 += h2 << 2; \
  |  |   35|   438k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 438k]
  |  |  ------------------
  ------------------
  481|   438k|    }
  482|  31.8k|    *pplen = i;
  483|       |
  484|  31.8k|    HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  31.8k|    do { \
  |  |   30|  31.8k|        h1 += ch; \
  |  |   31|  31.8k|        h1 += h1 << 3; \
  |  |   32|  31.8k|        h2 += h1; \
  |  |   33|  31.8k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  31.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  31.8k|        h2 += h2 << 2; \
  |  |   35|  31.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 31.8k]
  |  |  ------------------
  ------------------
  485|       |
  486|  6.40M|    for (i = 0; name[i] != 0; i++) {
  ------------------
  |  Branch (486:17): [True: 6.37M, False: 31.8k]
  ------------------
  487|  6.37M|        HASH_UPDATE(h1, h2, name[i]);
  ------------------
  |  |   29|  6.37M|    do { \
  |  |   30|  6.37M|        h1 += ch; \
  |  |   31|  6.37M|        h1 += h1 << 3; \
  |  |   32|  6.37M|        h2 += h1; \
  |  |   33|  6.37M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.37M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.37M|        h2 += h2 << 2; \
  |  |   35|  6.37M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.37M]
  |  |  ------------------
  ------------------
  488|  6.37M|    }
  489|  31.8k|    *plen = i;
  490|       |
  491|  31.8k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  31.8k|    do { \
  |  |   40|  31.8k|        h1 ^= h2; \
  |  |   41|  31.8k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  31.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  31.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  31.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  31.8k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  31.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  31.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  31.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  31.8k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  31.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 31.8k]
  |  |  ------------------
  ------------------
  492|       |
  493|       |    /*
  494|       |     * Always set the upper bit of hash values since 0 means an unoccupied
  495|       |     * bucket.
  496|       |     */
  497|  31.8k|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  31.8k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  498|  31.8k|}
dict.c:xmlDictFindEntry:
  551|  18.7M|                 int *pfound) {
  552|  18.7M|    xmlDictEntry *entry;
  553|  18.7M|    unsigned mask, pos, displ;
  554|  18.7M|    int found = 0;
  555|       |
  556|  18.7M|    mask = dict->size - 1;
  557|  18.7M|    pos = hashValue & mask;
  558|  18.7M|    entry = &dict->table[pos];
  559|       |
  560|  18.7M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (560:9): [True: 18.5M, False: 227k]
  ------------------
  561|       |        /*
  562|       |         * Robin hood hashing: abort if the displacement of the entry
  563|       |         * is smaller than the displacement of the key we look for.
  564|       |         * This also stops at the correct position when inserting.
  565|       |         */
  566|  18.5M|        displ = 0;
  567|       |
  568|  23.0M|        do {
  569|  23.0M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (569:17): [True: 18.4M, False: 4.66M]
  ------------------
  570|  18.4M|                if (prefix == NULL) {
  ------------------
  |  Branch (570:21): [True: 18.3M, False: 26.1k]
  ------------------
  571|       |                    /*
  572|       |                     * name is not necessarily null-terminated.
  573|       |                     */
  574|  18.3M|                    if ((strncmp((const char *) entry->name,
  ------------------
  |  Branch (574:25): [True: 18.3M, False: 194]
  ------------------
  575|  18.3M|                                 (const char *) name, len) == 0) &&
  576|  18.3M|                        (entry->name[len] == 0)) {
  ------------------
  |  Branch (576:25): [True: 18.3M, False: 0]
  ------------------
  577|  18.3M|                        found = 1;
  578|  18.3M|                        break;
  579|  18.3M|                    }
  580|  18.3M|                } else {
  581|  26.1k|                    if (xmlStrQEqual(prefix, name, entry->name)) {
  ------------------
  |  Branch (581:25): [True: 26.1k, False: 0]
  ------------------
  582|  26.1k|                        found = 1;
  583|  26.1k|                        break;
  584|  26.1k|                    }
  585|  26.1k|                }
  586|  18.4M|            }
  587|       |
  588|  4.66M|            displ++;
  589|  4.66M|            pos++;
  590|  4.66M|            entry++;
  591|  4.66M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (591:17): [True: 283k, False: 4.38M]
  ------------------
  592|   283k|                entry = dict->table;
  593|  4.66M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (593:18): [True: 4.59M, False: 71.4k]
  ------------------
  594|  4.59M|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (594:18): [True: 4.50M, False: 91.3k]
  ------------------
  595|  18.5M|    }
  596|       |
  597|  18.7M|    *pfound = found;
  598|  18.7M|    return(entry);
  599|  18.7M|}
dict.c:xmlDictGrow:
  609|  76.0k|xmlDictGrow(xmlDictPtr dict, unsigned size) {
  610|  76.0k|    const xmlDictEntry *oldentry, *oldend, *end;
  611|  76.0k|    xmlDictEntry *table;
  612|  76.0k|    unsigned oldsize, i;
  613|       |
  614|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  615|  76.0k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (615:9): [True: 0, False: 76.0k]
  ------------------
  616|      0|        return(-1);
  617|  76.0k|    table = xmlMalloc(size * sizeof(table[0]));
  618|  76.0k|    if (table == NULL)
  ------------------
  |  Branch (618:9): [True: 56, False: 75.9k]
  ------------------
  619|     56|        return(-1);
  620|  75.9k|    memset(table, 0, size * sizeof(table[0]));
  621|       |
  622|  75.9k|    oldsize = dict->size;
  623|  75.9k|    if (oldsize == 0)
  ------------------
  |  Branch (623:9): [True: 47.0k, False: 28.9k]
  ------------------
  624|  47.0k|        goto done;
  625|       |
  626|  28.9k|    oldend = &dict->table[oldsize];
  627|  28.9k|    end = &table[size];
  628|       |
  629|       |    /*
  630|       |     * Robin Hood sorting order is maintained if we
  631|       |     *
  632|       |     * - compute dict indices with modulo
  633|       |     * - resize by an integer factor
  634|       |     * - start to copy from the beginning of a probe sequence
  635|       |     */
  636|  28.9k|    oldentry = dict->table;
  637|   161k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (637:12): [True: 132k, False: 28.9k]
  ------------------
  638|   132k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (638:13): [True: 0, False: 132k]
  ------------------
  639|      0|            oldentry = dict->table;
  640|   132k|    }
  641|       |
  642|   360k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (642:17): [True: 331k, False: 28.9k]
  ------------------
  643|   331k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (643:13): [True: 290k, False: 41.4k]
  ------------------
  644|   290k|            xmlDictEntry *entry = &table[oldentry->hashValue & (size - 1)];
  645|       |
  646|   373k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (646:20): [True: 83.7k, False: 290k]
  ------------------
  647|  83.7k|                if (++entry >= end)
  ------------------
  |  Branch (647:21): [True: 13.7k, False: 70.0k]
  ------------------
  648|  13.7k|                    entry = table;
  649|  83.7k|            }
  650|   290k|            *entry = *oldentry;
  651|   290k|        }
  652|       |
  653|   331k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (653:13): [True: 28.9k, False: 302k]
  ------------------
  654|  28.9k|            oldentry = dict->table;
  655|   331k|    }
  656|       |
  657|  28.9k|    xmlFree(dict->table);
  658|       |
  659|  75.9k|done:
  660|  75.9k|    dict->table = table;
  661|  75.9k|    dict->size = size;
  662|       |
  663|  75.9k|    return(0);
  664|  28.9k|}
dict.c:xmlDictAddString:
  130|   431k|xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
  131|   431k|    xmlDictStringsPtr pool;
  132|   431k|    const xmlChar *ret;
  133|   431k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  134|   431k|    size_t limit = 0;
  135|       |
  136|   431k|    pool = dict->strings;
  137|   433k|    while (pool != NULL) {
  ------------------
  |  Branch (137:12): [True: 385k, False: 47.8k]
  ------------------
  138|   385k|	if ((size_t)(pool->end - pool->free) > namelen)
  ------------------
  |  Branch (138:6): [True: 383k, False: 2.16k]
  ------------------
  139|   383k|	    goto found_pool;
  140|  2.16k|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (140:6): [True: 1.63k, False: 534]
  ------------------
  141|  2.16k|        limit += pool->size;
  142|  2.16k|	pool = pool->next;
  143|  2.16k|    }
  144|       |    /*
  145|       |     * Not found, need to allocate
  146|       |     */
  147|  47.8k|    if (pool == NULL) {
  ------------------
  |  Branch (147:9): [True: 47.8k, False: 0]
  ------------------
  148|  47.8k|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (148:13): [True: 528, False: 47.3k]
  |  Branch (148:34): [True: 0, False: 528]
  ------------------
  149|      0|            return(NULL);
  150|      0|        }
  151|       |
  152|  47.8k|        if (size == 0) {
  ------------------
  |  Branch (152:13): [True: 47.0k, False: 840]
  ------------------
  153|  47.0k|            size = 1000;
  154|  47.0k|        } else {
  155|    840|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (155:17): [True: 840, False: 0]
  ------------------
  156|    840|                size *= 4; /* exponential growth */
  157|      0|            else
  158|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  159|    840|        }
  160|  47.8k|        if (size / 4 < namelen) {
  ------------------
  |  Branch (160:13): [True: 600, False: 47.2k]
  ------------------
  161|    600|            if ((size_t) namelen + 0 < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (161:17): [True: 600, False: 0]
  ------------------
  162|    600|                size = 4 * (size_t) namelen; /* just in case ! */
  163|      0|            else
  164|      0|                return(NULL);
  165|    600|        }
  166|  47.8k|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  167|  47.8k|	if (pool == NULL)
  ------------------
  |  Branch (167:6): [True: 6, False: 47.8k]
  ------------------
  168|      6|	    return(NULL);
  169|  47.8k|	pool->size = size;
  170|  47.8k|	pool->nbStrings = 0;
  171|  47.8k|	pool->free = &pool->array[0];
  172|  47.8k|	pool->end = &pool->array[size];
  173|  47.8k|	pool->next = dict->strings;
  174|  47.8k|	dict->strings = pool;
  175|  47.8k|    }
  176|   431k|found_pool:
  177|   431k|    ret = pool->free;
  178|   431k|    memcpy(pool->free, name, namelen);
  179|   431k|    pool->free += namelen;
  180|   431k|    *(pool->free++) = 0;
  181|   431k|    pool->nbStrings++;
  182|   431k|    return(ret);
  183|  47.8k|}
dict.c:xmlDictAddQString:
  199|  5.72k|{
  200|  5.72k|    xmlDictStringsPtr pool;
  201|  5.72k|    const xmlChar *ret;
  202|  5.72k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  203|  5.72k|    size_t limit = 0;
  204|       |
  205|  5.72k|    pool = dict->strings;
  206|  6.44k|    while (pool != NULL) {
  ------------------
  |  Branch (206:12): [True: 6.36k, False: 73]
  ------------------
  207|  6.36k|	if ((size_t)(pool->end - pool->free) > namelen + plen + 1)
  ------------------
  |  Branch (207:6): [True: 5.65k, False: 717]
  ------------------
  208|  5.65k|	    goto found_pool;
  209|    717|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (209:6): [True: 440, False: 277]
  ------------------
  210|    717|        limit += pool->size;
  211|    717|	pool = pool->next;
  212|    717|    }
  213|       |    /*
  214|       |     * Not found, need to allocate
  215|       |     */
  216|     73|    if (pool == NULL) {
  ------------------
  |  Branch (216:9): [True: 73, False: 0]
  ------------------
  217|     73|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (217:13): [True: 41, False: 32]
  |  Branch (217:34): [True: 0, False: 41]
  ------------------
  218|      0|            return(NULL);
  219|      0|        }
  220|       |
  221|     73|        if (size == 0) {
  ------------------
  |  Branch (221:13): [True: 0, False: 73]
  ------------------
  222|      0|            size = 1000;
  223|     73|        } else {
  224|     73|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (224:17): [True: 73, False: 0]
  ------------------
  225|     73|                size *= 4; /* exponential growth */
  226|      0|            else
  227|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  228|     73|        }
  229|     73|        if (size / 4 < namelen + plen + 1) {
  ------------------
  |  Branch (229:13): [True: 0, False: 73]
  ------------------
  230|      0|            if ((size_t) namelen + plen + 1 <
  ------------------
  |  Branch (230:17): [True: 0, False: 0]
  ------------------
  231|      0|                    (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  232|      0|                size = 4 * ((size_t) namelen + plen + 1); /* just in case ! */
  233|      0|            else
  234|      0|                return(NULL);
  235|      0|        }
  236|     73|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  237|     73|	if (pool == NULL)
  ------------------
  |  Branch (237:6): [True: 3, False: 70]
  ------------------
  238|      3|	    return(NULL);
  239|     70|	pool->size = size;
  240|     70|	pool->nbStrings = 0;
  241|     70|	pool->free = &pool->array[0];
  242|     70|	pool->end = &pool->array[size];
  243|     70|	pool->next = dict->strings;
  244|     70|	dict->strings = pool;
  245|     70|    }
  246|  5.72k|found_pool:
  247|  5.72k|    ret = pool->free;
  248|  5.72k|    memcpy(pool->free, prefix, plen);
  249|  5.72k|    pool->free += plen;
  250|  5.72k|    *(pool->free++) = ':';
  251|  5.72k|    memcpy(pool->free, name, namelen);
  252|  5.72k|    pool->free += namelen;
  253|  5.72k|    *(pool->free++) = 0;
  254|  5.72k|    pool->nbStrings++;
  255|  5.72k|    return(ret);
  256|     73|}
dict.c:xoroshiro64ss:
  998|   144k|xoroshiro64ss(unsigned *s) {
  999|   144k|    unsigned s0 = s[0];
 1000|   144k|    unsigned s1 = s[1];
 1001|   144k|    unsigned result = HASH_ROL(s0 * 0x9E3779BB, 5) * 5;
  ------------------
  |  |   12|   144k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1002|       |
 1003|   144k|    s1 ^= s0;
 1004|   144k|    s[0] = HASH_ROL(s0, 26) ^ s1 ^ (s1 << 9);
  ------------------
  |  |   12|   144k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1005|   144k|    s[1] = HASH_ROL(s1, 13);
  ------------------
  |  |   12|   144k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1006|       |
 1007|   144k|    return(result & 0xFFFFFFFF);
 1008|   144k|}

xmlGetEncodingAlias:
  473|  14.5k|xmlGetEncodingAlias(const char *alias) {
  474|  14.5k|    int i;
  475|  14.5k|    char upper[100];
  476|       |
  477|  14.5k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 14.5k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  14.5k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 14.5k, False: 0]
  ------------------
  481|  14.5k|	return(NULL);
  482|       |
  483|      0|    for (i = 0;i < 99;i++) {
  ------------------
  |  Branch (483:16): [True: 0, False: 0]
  ------------------
  484|      0|        upper[i] = (char) toupper((unsigned char) alias[i]);
  ------------------
  |  Branch (484:27): [True: 0, False: 0]
  |  Branch (484:27): [True: 0, False: 0]
  |  Branch (484:27): [Folded, False: 0]
  ------------------
  485|      0|	if (upper[i] == 0) break;
  ------------------
  |  Branch (485:6): [True: 0, False: 0]
  ------------------
  486|      0|    }
  487|      0|    upper[i] = 0;
  488|       |
  489|       |    /*
  490|       |     * Walk down the list looking for a definition of the alias
  491|       |     */
  492|      0|    for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
  ------------------
  |  Branch (492:16): [True: 0, False: 0]
  ------------------
  493|      0|	if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) {
  ------------------
  |  Branch (493:6): [True: 0, False: 0]
  ------------------
  494|      0|	    return(xmlCharEncodingAliases[i].name);
  495|      0|	}
  496|      0|    }
  497|      0|    return(NULL);
  498|      0|}
xmlCharEncNewCustomHandler:
  770|  11.2k|                           xmlCharEncodingHandler **out) {
  771|  11.2k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  11.2k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 11.2k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  11.2k|    handler = xmlMalloc(sizeof(*handler));
  777|  11.2k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 7, False: 11.2k]
  ------------------
  778|      7|        goto error;
  779|  11.2k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  11.2k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 11.2k, False: 0]
  ------------------
  782|  11.2k|        handler->name = xmlMemStrdup(name);
  783|  11.2k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 6, False: 11.1k]
  ------------------
  784|      6|            goto error;
  785|  11.2k|    }
  786|       |
  787|  11.1k|    handler->input.func = input;
  788|  11.1k|    handler->output.func = output;
  789|  11.1k|    handler->ctxtDtor = ctxtDtor;
  790|  11.1k|    handler->inputCtxt = inputCtxt;
  791|  11.1k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  11.1k|    *out = handler;
  794|  11.1k|    return(XML_ERR_OK);
  795|       |
  796|     13|error:
  797|     13|    xmlFree(handler);
  798|       |
  799|     13|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 13, False: 0]
  ------------------
  800|     13|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 13, False: 0]
  ------------------
  801|     13|            ctxtDtor(inputCtxt);
  802|     13|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 2, False: 11]
  ------------------
  803|      2|            ctxtDtor(outputCtxt);
  804|     13|    }
  805|       |
  806|     13|    return(XML_ERR_NO_MEMORY);
  807|  11.2k|}
xmlInitEncodingInternal:
  821|      2|xmlInitEncodingInternal(void) {
  822|      2|    unsigned short int tst = 0x1234;
  823|      2|    unsigned char *ptr = (unsigned char *) &tst;
  824|       |
  825|      2|    if (*ptr == 0x12) xmlLittleEndian = 0;
  ------------------
  |  Branch (825:9): [True: 0, False: 2]
  ------------------
  826|      2|    else xmlLittleEndian = 1;
  827|      2|}
xmlLookupCharEncodingHandler:
  986|  6.54k|                             xmlCharEncodingHandler **out) {
  987|  6.54k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  6.54k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 6.54k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  6.54k|    *out = NULL;
  992|       |
  993|  6.54k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  6.54k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 6.54k]
  |  Branch (993:23): [True: 0, False: 6.54k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  6.54k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 7, False: 6.53k]
  ------------------
  998|  6.53k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 6.53k]
  ------------------
  999|      7|        return(XML_ERR_OK);
 1000|       |
 1001|  6.53k|    handler = &defaultHandlers[enc];
 1002|  6.53k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 5.28k, False: 1.25k]
  |  Branch (1002:42): [True: 0, False: 1.25k]
  ------------------
 1003|  5.28k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  5.28k|        return(XML_ERR_OK);
 1005|  5.28k|    }
 1006|       |
 1007|  1.25k|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 1.25k, False: 0]
  ------------------
 1008|  1.25k|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|  1.25k|#ifdef LIBXML_OUTPUT_ENABLED
 1011|  1.25k|        flags |= XML_ENC_OUTPUT;
 1012|  1.25k|#endif
 1013|  1.25k|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|  1.25k|                                   NULL, NULL, out));
 1015|  1.25k|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|  1.25k|}
xmlCreateCharEncodingHandler:
 1066|  14.5k|                             xmlCharEncodingHandler **out) {
 1067|  14.5k|    const xmlCharEncodingHandler *handler;
 1068|  14.5k|    const char *norig, *nalias;
 1069|  14.5k|    xmlCharEncoding enc;
 1070|       |
 1071|  14.5k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 14.5k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  14.5k|    *out = NULL;
 1074|       |
 1075|  14.5k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 14.5k]
  |  Branch (1075:27): [True: 0, False: 14.5k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  14.5k|    norig = name;
 1079|  14.5k|    nalias = xmlGetEncodingAlias(name);
 1080|  14.5k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 14.5k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  14.5k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  14.5k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 463, False: 14.0k]
  ------------------
 1087|    463|        return(XML_ERR_OK);
 1088|       |
 1089|  14.0k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  3.72k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 3.72k, False: 10.3k]
  |  Branch (1089:22): [True: 3.72k, False: 0]
  ------------------
 1090|  3.72k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 3.72k]
  ------------------
 1091|       |            /*
 1092|       |             * TODO: HTML5 only allows a fixed set of charset
 1093|       |             * labels. We should add an option to enable or
 1094|       |             * disable this restriction.
 1095|       |             *
 1096|       |             * TODO: Map ISO-8859-9 to windows-1254.
 1097|       |             */
 1098|      0|            switch (enc) {
 1099|      0|                case XML_CHAR_ENCODING_ASCII:
  ------------------
  |  Branch (1099:17): [True: 0, False: 0]
  ------------------
 1100|      0|                case XML_CHAR_ENCODING_8859_1:
  ------------------
  |  Branch (1100:17): [True: 0, False: 0]
  ------------------
 1101|      0|                    enc = XML_CHAR_ENCODING_WINDOWS_1252;
 1102|      0|                    break;
 1103|      0|                case XML_CHAR_ENCODING_UCS2:
  ------------------
  |  Branch (1103:17): [True: 0, False: 0]
  ------------------
 1104|      0|                case XML_CHAR_ENCODING_UTF16:
  ------------------
  |  Branch (1104:17): [True: 0, False: 0]
  ------------------
 1105|      0|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1106|      0|                    break;
 1107|      0|                default:
  ------------------
  |  Branch (1107:17): [True: 0, False: 0]
  ------------------
 1108|      0|                    break;
 1109|      0|            }
 1110|      0|        }
 1111|       |
 1112|  3.72k|        handler = &defaultHandlers[enc];
 1113|  3.72k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 3.72k]
  |  Branch (1113:48): [True: 3.08k, False: 642]
  ------------------
 1114|  3.08k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 3.08k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  3.08k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  3.08k|            ret = xmlMalloc(sizeof(*ret));
 1122|  3.08k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 4, False: 3.07k]
  ------------------
 1123|      4|                return(XML_ERR_NO_MEMORY);
 1124|  3.07k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  3.07k|            ret->name = xmlMemStrdup(norig);
 1127|  3.07k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 2, False: 3.07k]
  ------------------
 1128|      2|                xmlFree(ret);
 1129|      2|                return(XML_ERR_NO_MEMORY);
 1130|      2|            }
 1131|  3.07k|            ret->input = handler->input;
 1132|  3.07k|            ret->output = handler->output;
 1133|  3.07k|            ret->inputCtxt = handler->inputCtxt;
 1134|  3.07k|            ret->outputCtxt = handler->outputCtxt;
 1135|  3.07k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  3.07k|            *out = ret;
 1138|  3.07k|            return(XML_ERR_OK);
 1139|  3.07k|        }
 1140|  3.72k|    }
 1141|       |
 1142|  10.9k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  14.0k|}
xmlOpenCharEncodingHandler:
 1169|     40|                           xmlCharEncodingHandler **out) {
 1170|     40|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 40]
  ------------------
 1171|       |
 1172|     40|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     40|}
xmlEncInputChunk:
 1685|   140k|                 int flush) {
 1686|   140k|    xmlCharEncError ret;
 1687|       |
 1688|   140k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   140k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 140k]
  ------------------
 1689|      0|        xmlCharEncodingInputFunc func = handler->input.legacyFunc;
 1690|       |
 1691|      0|        if (func == NULL) {
  ------------------
  |  Branch (1691:13): [True: 0, False: 0]
  ------------------
 1692|      0|            *outlen = 0;
 1693|      0|            *inlen = 0;
 1694|      0|            return(XML_ENC_ERR_INTERNAL);
 1695|      0|        }
 1696|       |
 1697|      0|        ret = func(out, outlen, in, inlen);
 1698|   140k|    } else {
 1699|   140k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   140k|        int oldInlen;
 1701|       |
 1702|   140k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 140k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   140k|        oldInlen = *inlen;
 1709|   140k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   140k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 15, False: 140k]
  |  Branch (1714:24): [True: 15, False: 0]
  |  Branch (1714:56): [True: 1, False: 14]
  ------------------
 1715|      1|            ret = XML_ENC_ERR_INPUT;
 1716|   140k|    }
 1717|       |
 1718|   140k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 24.2k, False: 116k]
  ------------------
 1719|  24.2k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   140k|    return(ret);
 1722|   140k|}
xmlCharEncInput:
 1795|   401k|{
 1796|   401k|    xmlBufPtr out, in;
 1797|   401k|    const xmlChar *dataIn;
 1798|   401k|    size_t availIn;
 1799|   401k|    size_t maxOut;
 1800|   401k|    size_t totalIn, totalOut;
 1801|   401k|    xmlCharEncError ret;
 1802|       |
 1803|   401k|    out = input->buffer;
 1804|   401k|    in = input->raw;
 1805|       |
 1806|   401k|    maxOut = *sizeOut;
 1807|   401k|    totalOut = 0;
 1808|       |
 1809|   401k|    *sizeOut = 0;
 1810|       |
 1811|   401k|    availIn = xmlBufUse(in);
 1812|   401k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 269k, False: 131k]
  |  Branch (1812:27): [True: 269k, False: 14]
  ------------------
 1813|   269k|        return(0);
 1814|   131k|    dataIn = xmlBufContent(in);
 1815|   131k|    totalIn = 0;
 1816|       |
 1817|   136k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 136k, Folded]
  ------------------
 1818|   136k|        size_t availOut;
 1819|   136k|        int completeOut, completeIn;
 1820|   136k|        int c_out, c_in;
 1821|       |
 1822|   136k|        availOut = xmlBufAvail(out);
 1823|   136k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 136k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   136k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 75.8k, False: 60.2k]
  ------------------
 1827|  75.8k|            c_out = availOut;
 1828|  75.8k|            completeOut = 0;
 1829|  75.8k|        } else {
 1830|  60.2k|            c_out = maxOut;
 1831|  60.2k|            completeOut = 1;
 1832|  60.2k|        }
 1833|       |
 1834|   136k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 136k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   136k|        } else {
 1838|   136k|            c_in = availIn;
 1839|   136k|            completeIn = 1;
 1840|   136k|        }
 1841|       |
 1842|   136k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   136k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 15, False: 136k]
  |  Branch (1843:56): [True: 15, False: 0]
  ------------------
 1844|       |
 1845|   136k|        totalIn += c_in;
 1846|   136k|        dataIn += c_in;
 1847|   136k|        availIn -= c_in;
 1848|       |
 1849|   136k|        totalOut += c_out;
 1850|   136k|        maxOut -= c_out;
 1851|   136k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   136k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 42.5k, False: 93.5k]
  |  Branch (1853:45): [True: 3.18k, False: 39.3k]
  ------------------
 1854|  3.18k|            input->error = xmlEncConvertError(ret);
 1855|  3.18k|            return(ret);
 1856|  3.18k|        }
 1857|       |
 1858|   132k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 57.7k, False: 75.1k]
  |  Branch (1858:30): [True: 57.7k, False: 0]
  ------------------
 1859|  57.7k|            break;
 1860|  75.1k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 75.1k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|  75.1k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 75.1k, False: 0]
  |  Branch (1862:29): [True: 70.7k, False: 4.40k]
  ------------------
 1863|  70.7k|            break;
 1864|       |
 1865|  4.40k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 4.40k, False: 0]
  ------------------
 1866|  4.40k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 10, False: 4.39k]
  ------------------
 1867|     10|                input->error = XML_ERR_NO_MEMORY;
 1868|     10|                return(XML_ENC_ERR_MEMORY);
 1869|     10|            }
 1870|  4.40k|        }
 1871|  4.40k|    }
 1872|       |
 1873|   128k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   128k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 128k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   128k|    else
 1878|   128k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   128k|    *sizeOut = totalOut;
 1881|   128k|    return(XML_ENC_ERR_SUCCESS);
 1882|   131k|}
xmlCharEncCloseFunc:
 2192|  19.8k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  19.8k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 268, False: 19.5k]
  ------------------
 2194|    268|        return(0);
 2195|       |
 2196|  19.5k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  19.5k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 5.28k, False: 14.2k]
  ------------------
 2197|  5.28k|        return(0);
 2198|       |
 2199|  14.2k|    xmlFree(handler->name);
 2200|  14.2k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 11.1k, False: 3.07k]
  ------------------
 2201|  11.1k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  11.1k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  11.1k|    }
 2204|  14.2k|    xmlFree(handler);
 2205|  14.2k|    return(0);
 2206|  19.5k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  14.5k|{
  619|  14.5k|    const xmlEncTableEntry *entry;
  620|       |
  621|  14.5k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 14.5k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  14.5k|    entry = bsearch(name, xmlEncTable,
  625|  14.5k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  14.5k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  14.5k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 4.18k, False: 10.3k]
  ------------------
  628|  4.18k|        return(entry->enc);
  629|       |
  630|  10.3k|    return(XML_CHAR_ENCODING_ERROR);
  631|  14.5k|}
encoding.c:xmlCompareEncTableEntries:
  609|  89.4k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  89.4k|    const char *key = vkey;
  611|  89.4k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  89.4k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  89.4k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  89.4k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  89.4k|}
encoding.c:UTF16LEToUTF8:
 2492|  37.5k|              int flush ATTRIBUTE_UNUSED) {
 2493|  37.5k|    const unsigned char *instart = in;
 2494|  37.5k|    const unsigned char *inend = in + (*inlen & ~1);
 2495|  37.5k|    unsigned char *outstart = out;
 2496|  37.5k|    unsigned char *outend = out + *outlen;
 2497|  37.5k|    unsigned c, d;
 2498|  37.5k|    int ret = XML_ENC_ERR_SPACE;
 2499|       |
 2500|  2.59M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 2.55M, False: 34.1k]
  ------------------
 2501|  2.55M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  2.55M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 8.47k, False: 2.54M]
  ------------------
 2504|  8.47k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 219, False: 8.25k]
  ------------------
 2505|    219|                goto done;
 2506|  8.25k|            out[0] = c;
 2507|  8.25k|            in += 2;
 2508|  8.25k|            out += 1;
 2509|  2.54M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 5.07k, False: 2.54M]
  ------------------
 2510|  5.07k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 233, False: 4.84k]
  ------------------
 2511|    233|                goto done;
 2512|  4.84k|            out[0] = (c >> 6)   | 0xC0;
 2513|  4.84k|            out[1] = (c & 0x3F) | 0x80;
 2514|  4.84k|            in += 2;
 2515|  4.84k|            out += 2;
 2516|  2.54M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 2.54M, False: 2.51k]
  ------------------
 2517|  2.54M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 1.18k, False: 2.53M]
  ------------------
 2518|  1.18k|                goto done;
 2519|  2.53M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  2.53M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  2.53M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  2.53M|            in += 2;
 2523|  2.53M|            out += 3;
 2524|  2.53M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  2.51k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 232, False: 2.28k]
  ------------------
 2527|    232|                ret = XML_ENC_ERR_INPUT;
 2528|    232|                goto done;
 2529|    232|            }
 2530|  2.28k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 502, False: 1.78k]
  ------------------
 2531|    502|		break;
 2532|  1.78k|            d = in[2] | (in[3] << 8);
 2533|  1.78k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 792, False: 989]
  ------------------
 2534|    792|                ret = XML_ENC_ERR_INPUT;
 2535|    792|                goto done;
 2536|    792|            }
 2537|    989|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 235, False: 754]
  ------------------
 2538|    235|		goto done;
 2539|    754|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|    754|            out[0] =  (c >> 18)         | 0xF0;
 2541|    754|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|    754|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|    754|            out[3] =  (c        & 0x3F) | 0x80;
 2544|    754|            in += 4;
 2545|    754|            out += 4;
 2546|    754|        }
 2547|  2.55M|    }
 2548|       |
 2549|  34.6k|    ret = out - outstart;
 2550|       |
 2551|  37.5k|done:
 2552|  37.5k|    *outlen = out - outstart;
 2553|  37.5k|    *inlen = in - instart;
 2554|  37.5k|    return(ret);
 2555|  34.6k|}
encoding.c:UTF16BEToUTF8:
 2689|  33.7k|              int flush ATTRIBUTE_UNUSED) {
 2690|  33.7k|    const unsigned char *instart = in;
 2691|  33.7k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  33.7k|    unsigned char *outstart = out;
 2693|  33.7k|    unsigned char *outend = out + *outlen;
 2694|  33.7k|    unsigned c, d;
 2695|  33.7k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  20.7M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 20.7M, False: 16.8k]
  ------------------
 2698|  20.7M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  20.7M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 17.8k, False: 20.7M]
  ------------------
 2701|  17.8k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 225, False: 17.6k]
  ------------------
 2702|    225|                goto done;
 2703|  17.6k|            out[0] = c;
 2704|  17.6k|            in += 2;
 2705|  17.6k|            out += 1;
 2706|  20.7M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 11.8k, False: 20.7M]
  ------------------
 2707|  11.8k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 271, False: 11.5k]
  ------------------
 2708|    271|                goto done;
 2709|  11.5k|            out[0] = (c >> 6)   | 0xC0;
 2710|  11.5k|            out[1] = (c & 0x3F) | 0x80;
 2711|  11.5k|            in += 2;
 2712|  11.5k|            out += 2;
 2713|  20.7M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 20.7M, False: 1.70k]
  ------------------
 2714|  20.7M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 15.0k, False: 20.7M]
  ------------------
 2715|  15.0k|                goto done;
 2716|  20.7M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  20.7M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  20.7M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  20.7M|            in += 2;
 2720|  20.7M|            out += 3;
 2721|  20.7M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  1.70k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 735, False: 974]
  ------------------
 2724|    735|                ret = XML_ENC_ERR_INPUT;
 2725|    735|                goto done;
 2726|    735|            }
 2727|    974|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 229, False: 745]
  ------------------
 2728|    229|		break;
 2729|    745|            d = (in[2] << 8) | in[3];
 2730|    745|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 232, False: 513]
  ------------------
 2731|    232|                ret = XML_ENC_ERR_INPUT;
 2732|    232|                goto done;
 2733|    232|            }
 2734|    513|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 130, False: 383]
  ------------------
 2735|    130|		goto done;
 2736|    383|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    383|            out[0] =  (c >> 18)         | 0xF0;
 2738|    383|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    383|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    383|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    383|            in += 4;
 2742|    383|            out += 4;
 2743|    383|        }
 2744|  20.7M|    }
 2745|       |
 2746|  17.0k|    ret = out - outstart;
 2747|       |
 2748|  33.7k|done:
 2749|  33.7k|    *outlen = out - outstart;
 2750|  33.7k|    *inlen = in - instart;
 2751|  33.7k|    return(ret);
 2752|  17.0k|}
encoding.c:asciiToAscii:
 2278|    810|             int flush ATTRIBUTE_UNUSED) {
 2279|    810|    const unsigned char *inend;
 2280|    810|    const unsigned char *instart = in;
 2281|    810|    int inlen, outlen, ret;
 2282|       |
 2283|    810|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 810]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|    810|    inlen = *pinlen;
 2290|    810|    outlen = *poutlen;
 2291|       |
 2292|    810|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 219, False: 591]
  ------------------
 2293|    219|        inlen = outlen;
 2294|    219|        ret = XML_ENC_ERR_SPACE;
 2295|    591|    } else {
 2296|    591|        ret = inlen;
 2297|    591|    }
 2298|       |
 2299|    810|    inend = in + inlen;
 2300|    810|    *poutlen = inlen;
 2301|    810|    *pinlen = inlen;
 2302|       |
 2303|  22.8k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 22.5k, False: 224]
  ------------------
 2304|  22.5k|	unsigned c = *in;
 2305|       |
 2306|  22.5k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 586, False: 22.0k]
  ------------------
 2307|    586|	    *poutlen = in - instart;
 2308|    586|	    *pinlen = in - instart;
 2309|    586|	    return(XML_ENC_ERR_INPUT);
 2310|    586|	}
 2311|       |
 2312|  22.0k|        in++;
 2313|  22.0k|	*out++ = c;
 2314|  22.0k|    }
 2315|       |
 2316|    224|    return(ret);
 2317|    810|}
encoding.c:xmlFindExtraHandler:
  908|  12.2k|                    xmlCharEncodingHandler **out) {
  909|       |    /*
  910|       |     * Try custom implementation before deprecated global handlers.
  911|       |     *
  912|       |     * Note that we pass the original name without deprecated
  913|       |     * alias resolution.
  914|       |     */
  915|  12.2k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 12.2k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  12.2k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 12.2k]
  ------------------
  922|      0|        int i;
  923|       |
  924|      0|        for (i = 0; i < nbCharEncodingHandler; i++) {
  ------------------
  |  Branch (924:21): [True: 0, False: 0]
  ------------------
  925|      0|            xmlCharEncodingHandler *h = globalHandlers[i];
  926|       |
  927|      0|            if (!xmlStrcasecmp((const xmlChar *) name,
  ------------------
  |  Branch (927:17): [True: 0, False: 0]
  ------------------
  928|      0|                               (const xmlChar *) h->name)) {
  929|      0|                if ((((flags & XML_ENC_INPUT) == 0) || (h->input.func)) &&
  ------------------
  |  Branch (929:22): [True: 0, False: 0]
  |  Branch (929:56): [True: 0, False: 0]
  ------------------
  930|      0|                    (((flags & XML_ENC_OUTPUT) == 0) || (h->output.func))) {
  ------------------
  |  Branch (930:22): [True: 0, False: 0]
  |  Branch (930:57): [True: 0, False: 0]
  ------------------
  931|      0|                    *out = h;
  932|      0|                    return(XML_ERR_OK);
  933|      0|                }
  934|      0|            }
  935|      0|        }
  936|      0|    }
  937|       |
  938|  12.2k|#ifdef LIBXML_ICONV_ENABLED
  939|  12.2k|    {
  940|  12.2k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  12.2k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 11.1k, False: 1.04k]
  ------------------
  943|  11.1k|            return(XML_ERR_OK);
  944|  1.04k|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 23, False: 1.02k]
  ------------------
  945|     23|            return(ret);
  946|  1.04k|    }
  947|  1.02k|#endif /* LIBXML_ICONV_ENABLED */
  948|       |
  949|       |#ifdef LIBXML_ICU_ENABLED
  950|       |    {
  951|       |        int ret = xmlCharEncUconv(name, flags, out);
  952|       |
  953|       |        if (ret == XML_ERR_OK)
  954|       |            return(XML_ERR_OK);
  955|       |        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  956|       |            return(ret);
  957|       |    }
  958|       |#endif /* LIBXML_ICU_ENABLED */
  959|       |
  960|  1.02k|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|  1.04k|}
encoding.c:xmlCharEncIconv:
 1319|  12.2k|                xmlCharEncodingHandler **out) {
 1320|  12.2k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  12.2k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  12.2k|    iconv_t icv_in;
 1323|  12.2k|    iconv_t icv_out;
 1324|  12.2k|    xmlParserErrors ret;
 1325|       |
 1326|       |    /*
 1327|       |     * POSIX allows "indicator suffixes" like "//IGNORE" to be
 1328|       |     * passed to iconv_open. This can change the behavior in
 1329|       |     * unexpected ways.
 1330|       |     *
 1331|       |     * Many iconv implementations also support non-standard
 1332|       |     * codesets like "wchar_t", "char" or the empty string "".
 1333|       |     * It would make sense to disallow them, but codeset names
 1334|       |     * are matched fuzzily, so a string like "w-C.hA_rt" could
 1335|       |     * be interpreted as "wchar_t".
 1336|       |     *
 1337|       |     * When escaping characters that aren't supported in the
 1338|       |     * target encoding, we also rely on GNU libiconv behavior to
 1339|       |     * stop conversion without trying any kind of fallback.
 1340|       |     * This violates the POSIX spec which says:
 1341|       |     *
 1342|       |     * > If iconv() encounters a character in the input buffer
 1343|       |     * > that is valid, but for which an identical character does
 1344|       |     * > not exist in the output codeset [...] iconv() shall
 1345|       |     * > perform an implementation-defined conversion on the
 1346|       |     * > character.
 1347|       |     *
 1348|       |     * See: https://sourceware.org/bugzilla/show_bug.cgi?id=29913
 1349|       |     *
 1350|       |     * Unfortunately, strict POSIX compliance makes it impossible
 1351|       |     * to detect untranslatable characters.
 1352|       |     */
 1353|  12.2k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 12.2k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  12.2k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  12.2k|    defined(__GLIBC__)
 1360|       |    /*
 1361|       |     * This glibc bug can lead to unpredictable results with the
 1362|       |     * push parser.
 1363|       |     *
 1364|       |     * https://sourceware.org/bugzilla/show_bug.cgi?id=32633
 1365|       |     */
 1366|  12.2k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 344, False: 11.8k]
  ------------------
 1367|  11.8k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 11.8k]
  ------------------
 1368|    344|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    344|        goto error;
 1370|    344|    }
 1371|  11.8k|#endif
 1372|       |
 1373|  11.8k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 11.8k, False: 0]
  ------------------
 1374|  11.8k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  11.8k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 9, False: 11.8k]
  ------------------
 1376|      9|            ret = XML_ERR_NO_MEMORY;
 1377|      9|            goto error;
 1378|      9|        }
 1379|  11.8k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  11.8k|        icv_in = iconv_open("UTF-8", name);
 1382|  11.8k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 670, False: 11.2k]
  ------------------
 1383|    670|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 670, False: 0]
  ------------------
 1384|    670|                ret = XML_ERR_UNSUPPORTED_ENCODING;
 1385|      0|            else if (errno == ENOMEM)
  ------------------
  |  Branch (1385:22): [True: 0, False: 0]
  ------------------
 1386|      0|                ret = XML_ERR_NO_MEMORY;
 1387|      0|            else
 1388|      0|                ret = XML_ERR_SYSTEM;
 1389|    670|            goto error;
 1390|    670|        }
 1391|  11.2k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  11.2k|        inFunc = xmlIconvConvert;
 1394|  11.2k|    }
 1395|       |
 1396|  11.2k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 1.25k, False: 9.95k]
  ------------------
 1397|  1.25k|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|  1.25k|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 1, False: 1.25k]
  ------------------
 1399|      1|            ret = XML_ERR_NO_MEMORY;
 1400|      1|            goto error;
 1401|      1|        }
 1402|  1.25k|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|  1.25k|        icv_out = iconv_open(name, "UTF-8");
 1405|  1.25k|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 1.25k]
  ------------------
 1406|      0|            if (errno == EINVAL)
  ------------------
  |  Branch (1406:17): [True: 0, False: 0]
  ------------------
 1407|      0|                ret = XML_ERR_UNSUPPORTED_ENCODING;
 1408|      0|            else if (errno == ENOMEM)
  ------------------
  |  Branch (1408:22): [True: 0, False: 0]
  ------------------
 1409|      0|                ret = XML_ERR_NO_MEMORY;
 1410|      0|            else
 1411|      0|                ret = XML_ERR_SYSTEM;
 1412|      0|            goto error;
 1413|      0|        }
 1414|  1.25k|        outputCtxt->cd = icv_out;
 1415|       |
 1416|  1.25k|        outFunc = xmlIconvConvert;
 1417|  1.25k|    }
 1418|       |
 1419|  11.2k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  11.2k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|  1.03k|error:
 1423|  1.03k|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 671, False: 359]
  ------------------
 1424|    671|        xmlIconvFree(inputCtxt);
 1425|  1.03k|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 1.03k]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|  1.03k|    return(ret);
 1428|  11.2k|}
encoding.c:xmlEncodingMatch:
 1295|  24.1k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  26.1k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 26.1k, Folded]
  ------------------
 1300|  27.7k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  27.1k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 26.2k, False: 917]
  |  |  ------------------
  |  |  223|  27.1k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 25.5k, False: 694]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 27.1k, False: 636]
  ------------------
 1301|  1.61k|            name1 += 1;
 1302|  26.1k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  25.8k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 25.8k, False: 4]
  |  |  ------------------
  |  |  223|  25.8k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 25.8k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 25.8k, False: 344]
  ------------------
 1303|      4|            name2 += 1;
 1304|  26.1k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 636, False: 25.5k]
  |  Branch (1304:30): [True: 207, False: 25.3k]
  ------------------
 1305|    843|            break;
 1306|  25.3k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 23.2k, False: 2.04k]
  ------------------
 1307|  23.2k|            return(0);
 1308|  2.04k|        name1 += 1;
 1309|  2.04k|        name2 += 1;
 1310|  2.04k|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|    843|    return(*name2 == 0);
 1314|  24.1k|}
encoding.c:xmlIconvConvert:
 1234|  44.7k|                int flush ATTRIBUTE_UNUSED) {
 1235|  44.7k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  44.7k|    size_t icv_inlen, icv_outlen;
 1237|  44.7k|    const char *icv_in = (const char *) in;
 1238|  44.7k|    char *icv_out = (char *) out;
 1239|  44.7k|    size_t ret;
 1240|       |
 1241|  44.7k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 44.7k]
  |  Branch (1241:26): [True: 0, False: 44.7k]
  |  Branch (1241:46): [True: 0, False: 44.7k]
  |  Branch (1241:65): [True: 0, False: 44.7k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  44.7k|    icv_inlen = *inlen;
 1246|  44.7k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  44.7k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  44.7k|    *inlen -= icv_inlen;
 1252|  44.7k|    *outlen -= icv_outlen;
 1253|  44.7k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 22.0k, False: 22.7k]
  ------------------
 1254|  22.0k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 606, False: 21.3k]
  ------------------
 1255|    606|            return(XML_ENC_ERR_INPUT);
 1256|  21.3k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 18.4k, False: 2.96k]
  ------------------
 1257|  18.4k|            return(XML_ENC_ERR_SPACE);
 1258|       |        /*
 1259|       |         * EINVAL means a truncated multi-byte sequence at the end
 1260|       |         * of the input buffer. We treat this as success.
 1261|       |         */
 1262|  2.96k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 2.96k, False: 0]
  ------------------
 1263|  2.96k|            return(XML_ENC_ERR_SUCCESS);
 1264|       |#ifdef __APPLE__
 1265|       |        /*
 1266|       |         * Apple's new libiconv can return EOPNOTSUPP under
 1267|       |         * unknown circumstances (detected when fuzzing).
 1268|       |         */
 1269|       |        if (errno == EOPNOTSUPP)
 1270|       |            return(XML_ENC_ERR_INPUT);
 1271|       |#endif
 1272|      0|        return(XML_ENC_ERR_INTERNAL);
 1273|  2.96k|    }
 1274|  22.7k|    return(XML_ENC_ERR_SUCCESS);
 1275|  44.7k|}
encoding.c:xmlIconvFree:
 1278|  23.0k|xmlIconvFree(void *vctxt) {
 1279|  23.0k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  23.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 9.94k, False: 13.1k]
  ------------------
 1282|  9.94k|        return;
 1283|       |
 1284|  13.1k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 12.4k, False: 670]
  ------------------
 1285|  12.4k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  13.1k|    xmlFree(ctxt);
 1288|  13.1k|}
encoding.c:xmlEncConvertError:
 1649|  3.18k|xmlEncConvertError(xmlCharEncError code) {
 1650|  3.18k|    xmlParserErrors ret;
 1651|       |
 1652|  3.18k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.18k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  3.18k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 3.18k, False: 0]
  ------------------
 1657|  3.18k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  3.18k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 3.18k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.18k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  3.18k|    }
 1666|       |
 1667|  3.18k|    return(ret);
 1668|  3.18k|}
encoding.c:latin1ToUTF8:
 2323|  23.9k|             int flush ATTRIBUTE_UNUSED) {
 2324|  23.9k|    unsigned char* outstart = out;
 2325|  23.9k|    const unsigned char* instart = in;
 2326|  23.9k|    unsigned char* outend;
 2327|  23.9k|    const unsigned char* inend;
 2328|  23.9k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  23.9k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 23.9k]
  |  Branch (2330:26): [True: 0, False: 23.9k]
  |  Branch (2330:42): [True: 0, False: 23.9k]
  |  Branch (2330:62): [True: 0, False: 23.9k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  23.9k|    outend = out + *outlen;
 2334|  23.9k|    inend = in + *inlen;
 2335|       |
 2336|  18.3M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 18.3M, False: 19.7k]
  ------------------
 2337|  18.3M|        unsigned c = *in;
 2338|       |
 2339|  18.3M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 6.09M, False: 12.2M]
  ------------------
 2340|  6.09M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 2.38k, False: 6.09M]
  ------------------
 2341|  2.38k|                goto done;
 2342|  6.09M|            *out++ = c;
 2343|  12.2M|	} else {
 2344|  12.2M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 1.85k, False: 12.2M]
  ------------------
 2345|  1.85k|                goto done;
 2346|  12.2M|	    *out++ = (c >> 6) | 0xC0;
 2347|  12.2M|            *out++ = (c & 0x3F) | 0x80;
 2348|  12.2M|        }
 2349|       |
 2350|  18.3M|        in++;
 2351|  18.3M|    }
 2352|       |
 2353|  19.7k|    ret = out - outstart;
 2354|       |
 2355|  23.9k|done:
 2356|  23.9k|    *outlen = out - outstart;
 2357|  23.9k|    *inlen = in - instart;
 2358|  23.9k|    return(ret);
 2359|  19.7k|}

xmlFreeEntity:
   85|   150k|{
   86|   150k|    xmlDictPtr dict = NULL;
   87|       |
   88|   150k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 150k]
  ------------------
   89|      0|        return;
   90|       |
   91|   150k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 146k, False: 4.21k]
  ------------------
   92|   146k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   150k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 4.50k, False: 146k]
  ------------------
   96|  4.50k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 4.50k, False: 0]
  ------------------
   97|  4.50k|        xmlFreeNodeList(entity->children);
   98|   150k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 150k, False: 10]
  ------------------
   99|   150k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 108k, False: 42.2k]
  |  Branch (99:28): [True: 0, False: 42.2k]
  ------------------
  100|   108k|        xmlFree((char *) entity->name);
  101|   150k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 3.33k, False: 147k]
  ------------------
  102|  3.33k|        xmlFree((char *) entity->ExternalID);
  103|   150k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 13.9k, False: 137k]
  ------------------
  104|  13.9k|        xmlFree((char *) entity->SystemID);
  105|   150k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 10.2k, False: 140k]
  ------------------
  106|  10.2k|        xmlFree((char *) entity->URI);
  107|   150k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 134k, False: 16.4k]
  ------------------
  108|   134k|        xmlFree((char *) entity->content);
  109|   150k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 17.5k, False: 133k]
  ------------------
  110|  17.5k|        xmlFree((char *) entity->orig);
  111|   150k|    xmlFree(entity);
  112|   150k|}
xmlAddEntity:
  188|   151k|	  const xmlChar *content, xmlEntity **out) {
  189|   151k|    xmlDtdPtr dtd;
  190|   151k|    xmlDictPtr dict = NULL;
  191|   151k|    xmlEntitiesTablePtr table = NULL;
  192|   151k|    xmlEntityPtr ret, predef;
  193|   151k|    int res;
  194|       |
  195|   151k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 151k, False: 0]
  ------------------
  196|   151k|        *out = NULL;
  197|   151k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 151k]
  |  Branch (197:26): [True: 0, False: 151k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   151k|    dict = doc->dict;
  200|       |
  201|   151k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 5.15k, False: 146k]
  ------------------
  202|  5.15k|        dtd = doc->extSubset;
  203|   146k|    else
  204|   146k|        dtd = doc->intSubset;
  205|   151k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 151k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   151k|    switch (type) {
  209|  68.6k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 68.6k, False: 82.7k]
  ------------------
  210|  77.0k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 8.38k, False: 143k]
  ------------------
  211|  77.6k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 558, False: 150k]
  ------------------
  212|  77.6k|            predef = xmlGetPredefinedEntity(name);
  213|  77.6k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 5.26k, False: 72.3k]
  ------------------
  214|  5.26k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  5.26k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 4.73k, False: 535]
  ------------------
  218|  4.73k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 3.06k, False: 1.67k]
  ------------------
  219|  3.06k|                    int c = predef->content[0];
  220|       |
  221|  3.06k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 1.62k, False: 1.43k]
  |  Branch (221:47): [True: 532, False: 1.09k]
  ------------------
  222|    532|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 144, False: 388]
  |  Branch (222:40): [True: 100, False: 288]
  |  Branch (222:55): [True: 85, False: 203]
  ------------------
  223|    329|                        valid = 1;
  224|  2.73k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.13k, False: 1.60k]
  |  Branch (224:55): [True: 739, False: 394]
  ------------------
  225|    739|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 208, False: 531]
  ------------------
  226|    208|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|    208|#define BAD_CAST (xmlChar *)
  ------------------
  227|    208|                            xmlChar ref[] = "00;";
  228|       |
  229|    208|                            ref[0] = hex[c / 16 % 16];
  230|    208|                            ref[1] = hex[c % 16];
  231|    208|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 10, False: 198]
  ------------------
  232|     10|                                valid = 1;
  233|    531|                        } else {
  234|    531|                            xmlChar ref[] = "00;";
  235|       |
  236|    531|                            ref[0] = '0' + c / 10 % 10;
  237|    531|                            ref[1] = '0' + c % 10;
  238|    531|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 220, False: 311]
  ------------------
  239|    220|                                valid = 1;
  240|    531|                        }
  241|    739|                    }
  242|  3.06k|                }
  243|  5.26k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 4.70k, False: 559]
  ------------------
  244|  4.70k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  5.26k|            }
  246|  72.9k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 5.73k, False: 67.1k]
  ------------------
  247|  5.73k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  5.73k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 8, False: 5.72k]
  ------------------
  249|      8|                    return(XML_ERR_NO_MEMORY);
  250|  5.73k|            }
  251|  72.9k|	    table = dtd->entities;
  252|  72.9k|	    break;
  253|  67.8k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 67.8k, False: 83.5k]
  ------------------
  254|  73.8k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 5.94k, False: 145k]
  ------------------
  255|  73.8k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.64k, False: 70.1k]
  ------------------
  256|  3.64k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.64k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.64k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.64k|            }
  260|  73.8k|	    table = dtd->pentities;
  261|  73.8k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 151k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   151k|    }
  265|   146k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   146k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 22, False: 146k]
  ------------------
  267|     22|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   146k|    res = xmlHashAdd(table, name, ret);
  270|   146k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 10, False: 146k]
  ------------------
  271|     10|        xmlFreeEntity(ret);
  272|     10|        return(XML_ERR_NO_MEMORY);
  273|   146k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 122k, False: 24.1k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|   122k|        xmlFreeEntity(ret);
  278|   122k|	return(XML_WAR_ENTITY_REDEFINED);
  279|   122k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  24.1k|    ret->parent = dtd;
  285|  24.1k|    ret->doc = dtd->doc;
  286|  24.1k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 6.66k, False: 17.4k]
  ------------------
  287|  6.66k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  17.4k|    } else {
  289|  17.4k|	dtd->last->next = (xmlNodePtr) ret;
  290|  17.4k|	ret->prev = dtd->last;
  291|  17.4k|	dtd->last = (xmlNodePtr) ret;
  292|  17.4k|    }
  293|       |
  294|  24.1k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 24.1k, False: 0]
  ------------------
  295|  24.1k|        *out = ret;
  296|  24.1k|    return(0);
  297|   146k|}
xmlGetPredefinedEntity:
  306|  4.65M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  4.65M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 4, False: 4.65M]
  ------------------
  308|  4.65M|    switch (name[0]) {
  309|   457k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 457k, False: 4.20M]
  ------------------
  310|   457k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   457k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 42.8k, False: 414k]
  ------------------
  311|  42.8k|	        return(&xmlEntityLt);
  312|   414k|	    break;
  313|  1.35M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.35M, False: 3.30M]
  ------------------
  314|  1.35M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.35M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.32M, False: 26.1k]
  ------------------
  315|  1.32M|	        return(&xmlEntityGt);
  316|  26.1k|	    break;
  317|  74.8k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 74.8k, False: 4.58M]
  ------------------
  318|  74.8k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  74.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 11.6k, False: 63.1k]
  ------------------
  319|  11.6k|	        return(&xmlEntityAmp);
  320|  63.1k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  63.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 7.93k, False: 55.2k]
  ------------------
  321|  7.93k|	        return(&xmlEntityApos);
  322|  55.2k|	    break;
  323|  55.2k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 29.8k, False: 4.62M]
  ------------------
  324|  29.8k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  29.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 28.8k, False: 1.02k]
  ------------------
  325|  28.8k|	        return(&xmlEntityQuot);
  326|  1.02k|	    break;
  327|  2.74M|	default:
  ------------------
  |  Branch (327:2): [True: 2.74M, False: 1.91M]
  ------------------
  328|  2.74M|	    break;
  329|  4.65M|    }
  330|  3.24M|    return(NULL);
  331|  4.65M|}
xmlAddDocEntity:
  372|    181|	        const xmlChar *content) {
  373|    181|    xmlEntityPtr ret;
  374|       |
  375|    181|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    181|    return(ret);
  377|    181|}
xmlGetParameterEntity:
  428|   521k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   521k|    xmlEntitiesTablePtr table;
  430|   521k|    xmlEntityPtr ret;
  431|       |
  432|   521k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 74, False: 521k]
  ------------------
  433|     74|	return(NULL);
  434|   521k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 521k, False: 69]
  |  Branch (434:37): [True: 503k, False: 17.7k]
  ------------------
  435|   503k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   503k|	ret = xmlGetEntityFromTable(table, name);
  437|   503k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 384k, False: 119k]
  ------------------
  438|   384k|	    return(ret);
  439|   503k|    }
  440|   137k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 18.4k, False: 118k]
  |  Branch (440:37): [True: 18.1k, False: 272]
  ------------------
  441|  18.1k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  18.1k|	return(xmlGetEntityFromTable(table, name));
  443|  18.1k|    }
  444|   119k|    return(NULL);
  445|   137k|}
xmlGetDocEntity:
  476|  2.34M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.34M|    xmlEntityPtr cur;
  478|  2.34M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.34M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.34M, False: 1.10k]
  ------------------
  481|  2.34M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.32M, False: 18.9k]
  |  Branch (481:34): [True: 2.25M, False: 72.5k]
  ------------------
  482|  2.25M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  2.25M|	    cur = xmlGetEntityFromTable(table, name);
  484|  2.25M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 1.88M, False: 362k]
  ------------------
  485|  1.88M|		return(cur);
  486|  2.25M|	}
  487|   454k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 453k, False: 931]
  ------------------
  488|   453k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 6.45k, False: 446k]
  ------------------
  489|  6.45k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 5.07k, False: 1.38k]
  ------------------
  490|  5.07k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  5.07k|		cur = xmlGetEntityFromTable(table, name);
  492|  5.07k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 3.68k, False: 1.38k]
  ------------------
  493|  3.68k|		    return(cur);
  494|  5.07k|	    }
  495|   453k|	}
  496|   454k|    }
  497|   451k|    return(xmlGetPredefinedEntity(name));
  498|  2.34M|}
xmlFreeEntitiesTable:
  588|  12.0k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  12.0k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  12.0k|}
xmlCopyEntitiesTable:
  665|  2.74k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  2.74k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  2.74k|}
entities.c:xmlCreateEntity:
  120|   146k|	        const xmlChar *content) {
  121|   146k|    xmlEntityPtr ret;
  122|       |
  123|   146k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   146k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 7, False: 146k]
  ------------------
  125|      7|	return(NULL);
  126|   146k|    memset(ret, 0, sizeof(xmlEntity));
  127|   146k|    ret->doc = doc;
  128|   146k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   146k|    ret->etype = (xmlEntityType) type;
  134|   146k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 146k]
  |  Branch (134:26): [True: 104k, False: 42.2k]
  ------------------
  135|   104k|	ret->name = xmlStrdup(name);
  136|  42.2k|    else
  137|  42.2k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   146k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 5, False: 146k]
  ------------------
  139|      5|        goto error;
  140|   146k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 2.46k, False: 144k]
  ------------------
  141|  2.46k|        ret->ExternalID = xmlStrdup(publicId);
  142|  2.46k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 1, False: 2.46k]
  ------------------
  143|      1|            goto error;
  144|  2.46k|    }
  145|   146k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 11.5k, False: 135k]
  ------------------
  146|  11.5k|        ret->SystemID = xmlStrdup(systemId);
  147|  11.5k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 3, False: 11.5k]
  ------------------
  148|      3|            goto error;
  149|  11.5k|    }
  150|   146k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 131k, False: 14.7k]
  ------------------
  151|   131k|        ret->length = xmlStrlen(content);
  152|   131k|	ret->content = xmlStrndup(content, ret->length);
  153|   131k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 6, False: 131k]
  ------------------
  154|      6|            goto error;
  155|   131k|     } else {
  156|  14.7k|        ret->length = 0;
  157|  14.7k|        ret->content = NULL;
  158|  14.7k|    }
  159|   146k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   146k|    ret->orig = NULL;
  162|       |
  163|   146k|    return(ret);
  164|       |
  165|     15|error:
  166|     15|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   146k|}
entities.c:xmlGetEntityFromTable:
  415|  2.77M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  2.77M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  2.77M|}
entities.c:xmlFreeEntityWrapper:
  575|  28.3k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  28.3k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 28.3k, False: 0]
  ------------------
  577|  28.3k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  28.3k|}
entities.c:xmlCopyEntity:
  600|  4.22k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  4.22k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  4.22k|    xmlEntityPtr cur;
  603|       |
  604|  4.22k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  4.22k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 15, False: 4.21k]
  ------------------
  606|     15|	return(NULL);
  607|  4.21k|    memset(cur, 0, sizeof(xmlEntity));
  608|  4.21k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  4.21k|    cur->etype = ent->etype;
  611|  4.21k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 4.21k, False: 0]
  ------------------
  612|  4.21k|	cur->name = xmlStrdup(ent->name);
  613|  4.21k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 5, False: 4.20k]
  ------------------
  614|      5|            goto error;
  615|  4.21k|    }
  616|  4.20k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 872, False: 3.33k]
  ------------------
  617|    872|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|    872|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 2, False: 870]
  ------------------
  619|      2|            goto error;
  620|    872|    }
  621|  4.20k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 2.36k, False: 1.84k]
  ------------------
  622|  2.36k|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|  2.36k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 6, False: 2.35k]
  ------------------
  624|      6|            goto error;
  625|  2.36k|    }
  626|  4.20k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 2.43k, False: 1.77k]
  ------------------
  627|  2.43k|	cur->content = xmlStrdup(ent->content);
  628|  2.43k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 6, False: 2.42k]
  ------------------
  629|      6|            goto error;
  630|  2.43k|    }
  631|  4.19k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 1.95k, False: 2.24k]
  ------------------
  632|  1.95k|	cur->orig = xmlStrdup(ent->orig);
  633|  1.95k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 7, False: 1.94k]
  ------------------
  634|      7|            goto error;
  635|  1.95k|    }
  636|  4.18k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 2.35k, False: 1.83k]
  ------------------
  637|  2.35k|	cur->URI = xmlStrdup(ent->URI);
  638|  2.35k|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 3, False: 2.35k]
  ------------------
  639|      3|            goto error;
  640|  2.35k|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  4.18k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 797, False: 3.38k]
  ------------------
  643|    797|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    797|        cur->last = cur->children;
  646|  5.26k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 5.25k, False: 4]
  |  Branch (646:29): [True: 4.46k, False: 793]
  ------------------
  647|    797|    }
  648|       |
  649|  4.18k|    return(cur);
  650|       |
  651|     29|error:
  652|     29|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  4.18k|}

xmlIsCatastrophicError:
   38|  87.8M|xmlIsCatastrophicError(int level, int code) {
   39|  87.8M|    int fatal = 0;
   40|       |
   41|  87.8M|    if (level != XML_ERR_FATAL)
  ------------------
  |  Branch (41:9): [True: 3.08M, False: 84.7M]
  ------------------
   42|  3.08M|        return(0);
   43|       |
   44|  84.7M|    switch (code) {
   45|  3.93k|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (45:9): [True: 3.93k, False: 84.7M]
  ------------------
   46|       |        /* case XML_ERR_RESOURCE_LIMIT: */
   47|  3.93k|        case XML_ERR_SYSTEM:
  ------------------
  |  Branch (47:9): [True: 0, False: 84.7M]
  ------------------
   48|  3.93k|        case XML_ERR_ARGUMENT:
  ------------------
  |  Branch (48:9): [True: 0, False: 84.7M]
  ------------------
   49|  3.93k|        case XML_ERR_INTERNAL_ERROR:
  ------------------
  |  Branch (49:9): [True: 0, False: 84.7M]
  ------------------
   50|  3.93k|            fatal = 1;
   51|  3.93k|            break;
   52|  84.7M|        default:
  ------------------
  |  Branch (52:9): [True: 84.7M, False: 3.93k]
  ------------------
   53|  84.7M|            if ((code >= 1500) && (code <= 1599))
  ------------------
  |  Branch (53:17): [True: 31.2k, False: 84.7M]
  |  Branch (53:35): [True: 20, False: 31.1k]
  ------------------
   54|     20|                fatal = 1;
   55|  84.7M|            break;
   56|  84.7M|    }
   57|       |
   58|  84.7M|    return(fatal);
   59|  84.7M|}
xmlRaiseMemoryError:
  639|  22.4k|{
  640|  22.4k|    xmlError *lastError = xmlGetLastErrorInternal();
  641|       |
  642|  22.4k|    xmlResetLastError();
  643|  22.4k|    lastError->domain = domain;
  644|  22.4k|    lastError->code = XML_ERR_NO_MEMORY;
  645|  22.4k|    lastError->level = XML_ERR_FATAL;
  646|       |
  647|  22.4k|    if (error != NULL) {
  ------------------
  |  Branch (647:9): [True: 18.5k, False: 3.90k]
  ------------------
  648|  18.5k|        xmlResetError(error);
  649|  18.5k|        error->domain = domain;
  650|  18.5k|        error->code = XML_ERR_NO_MEMORY;
  651|  18.5k|        error->level = XML_ERR_FATAL;
  652|  18.5k|    }
  653|       |
  654|  22.4k|    if (schannel != NULL) {
  ------------------
  |  Branch (654:9): [True: 21.9k, False: 497]
  ------------------
  655|  21.9k|        schannel(data, lastError);
  656|  21.9k|    } else if (xmlStructuredError != NULL) {
  ------------------
  |  |  990|    497|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
  |  Branch (656:16): [True: 0, False: 497]
  ------------------
  657|      0|        xmlStructuredError(xmlStructuredErrorContext, lastError);
  ------------------
  |  |  990|      0|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
                      xmlStructuredError(xmlStructuredErrorContext, lastError);
  ------------------
  |  |  997|      0|  #define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
  ------------------
  658|    497|    } else if (channel != NULL) {
  ------------------
  |  Branch (658:16): [True: 0, False: 497]
  ------------------
  659|      0|        channel(data, "libxml2: out of memory\n");
  660|      0|    }
  661|  22.4k|}
xmlVRaiseError:
  694|   716k|{
  695|   716k|    xmlParserCtxtPtr ctxt = NULL;
  696|       |    /* xmlLastError is a macro retrieving the per-thread global. */
  697|   716k|    xmlErrorPtr lastError = xmlGetLastErrorInternal();
  698|   716k|    xmlErrorPtr to = lastError;
  699|       |
  700|   716k|    if (code == XML_ERR_OK)
  ------------------
  |  Branch (700:9): [True: 0, False: 716k]
  ------------------
  701|      0|        return(0);
  702|   716k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  703|   716k|    if (code == XML_ERR_INTERNAL_ERROR)
  ------------------
  |  Branch (703:9): [True: 0, False: 716k]
  ------------------
  704|      0|        xmlAbort("Unexpected internal error: %s\n", msg);
  705|   716k|#endif
  706|   716k|    if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
  ------------------
  |  | 1309|   716k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (706:9): [True: 0, False: 716k]
  |  Branch (706:46): [True: 0, False: 0]
  ------------------
  707|      0|        return(0);
  708|       |
  709|   716k|    if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
  ------------------
  |  Branch (709:9): [True: 482k, False: 233k]
  |  Branch (709:40): [True: 0, False: 233k]
  ------------------
  710|   233k|        (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
  ------------------
  |  Branch (710:9): [True: 25.4k, False: 207k]
  |  Branch (710:37): [True: 57.3k, False: 150k]
  ------------------
  711|   689k|	(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
  ------------------
  |  Branch (711:2): [True: 30.4k, False: 120k]
  |  Branch (711:29): [True: 93.0k, False: 27.0k]
  ------------------
  712|   689k|	ctxt = (xmlParserCtxtPtr) ctx;
  713|       |
  714|   689k|        if (ctxt != NULL)
  ------------------
  |  Branch (714:13): [True: 689k, False: 0]
  ------------------
  715|   689k|            to = &ctxt->lastError;
  716|   689k|    }
  717|       |
  718|   716k|    if (xmlVUpdateError(to, ctxt, node, domain, code, level, file, line,
  ------------------
  |  Branch (718:9): [True: 1.53k, False: 714k]
  ------------------
  719|   716k|                        str1, str2, str3, int1, col, msg, ap))
  720|  1.53k|        return(-1);
  721|       |
  722|   714k|    if (to != lastError) {
  ------------------
  |  Branch (722:9): [True: 687k, False: 26.8k]
  ------------------
  723|   687k|        if (xmlCopyError(to, lastError) < 0)
  ------------------
  |  Branch (723:13): [True: 1.34k, False: 686k]
  ------------------
  724|  1.34k|            return(-1);
  725|   687k|    }
  726|       |
  727|   713k|    if (schannel != NULL) {
  ------------------
  |  Branch (727:9): [True: 277k, False: 436k]
  ------------------
  728|   277k|	schannel(data, to);
  729|   436k|    } else if (xmlStructuredError != NULL) {
  ------------------
  |  |  990|   436k|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
  |  Branch (729:16): [True: 0, False: 436k]
  ------------------
  730|      0|        xmlStructuredError(xmlStructuredErrorContext, to);
  ------------------
  |  |  990|      0|  #define xmlStructuredError (*__xmlStructuredError())
  ------------------
                      xmlStructuredError(xmlStructuredErrorContext, to);
  ------------------
  |  |  997|      0|  #define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
  ------------------
  731|   436k|    } else if (channel != NULL) {
  ------------------
  |  Branch (731:16): [True: 0, False: 436k]
  ------------------
  732|       |        /* Don't invoke legacy error handlers */
  733|      0|        if ((channel == xmlGenericErrorDefaultFunc) ||
  ------------------
  |  Branch (733:13): [True: 0, False: 0]
  ------------------
  734|      0|            (channel == xmlParserError) ||
  ------------------
  |  Branch (734:13): [True: 0, False: 0]
  ------------------
  735|      0|            (channel == xmlParserWarning) ||
  ------------------
  |  Branch (735:13): [True: 0, False: 0]
  ------------------
  736|      0|            (channel == xmlParserValidityError) ||
  ------------------
  |  Branch (736:13): [True: 0, False: 0]
  ------------------
  737|      0|            (channel == xmlParserValidityWarning))
  ------------------
  |  Branch (737:13): [True: 0, False: 0]
  ------------------
  738|      0|            xmlFormatError(to, xmlGenericError, xmlGenericErrorContext);
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
                          xmlFormatError(to, xmlGenericError, xmlGenericErrorContext);
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  739|      0|        else
  740|      0|	    channel(data, "%s", to->message);
  741|      0|    }
  742|       |
  743|   713k|    return(0);
  744|   714k|}
xmlRaiseError:
  777|  21.3k|{
  778|  21.3k|    va_list ap;
  779|  21.3k|    int res;
  780|       |
  781|  21.3k|    va_start(ap, msg);
  782|  21.3k|    res = xmlVRaiseError(schannel, channel, data, ctx, node, domain, code,
  783|  21.3k|                         level, file, line, str1, str2, str3, int1, col, msg,
  784|  21.3k|                         ap);
  785|  21.3k|    va_end(ap);
  786|       |
  787|  21.3k|    return(res);
  788|  21.3k|}
xmlResetError:
  951|  1.50M|{
  952|  1.50M|    if (err == NULL)
  ------------------
  |  Branch (952:9): [True: 0, False: 1.50M]
  ------------------
  953|      0|        return;
  954|  1.50M|    if (err->code == XML_ERR_OK)
  ------------------
  |  Branch (954:9): [True: 107k, False: 1.40M]
  ------------------
  955|   107k|        return;
  956|  1.40M|    if (err->message != NULL)
  ------------------
  |  Branch (956:9): [True: 1.36M, False: 37.0k]
  ------------------
  957|  1.36M|        xmlFree(err->message);
  958|  1.40M|    if (err->file != NULL)
  ------------------
  |  Branch (958:9): [True: 610k, False: 789k]
  ------------------
  959|   610k|        xmlFree(err->file);
  960|  1.40M|    if (err->str1 != NULL)
  ------------------
  |  Branch (960:9): [True: 649k, False: 750k]
  ------------------
  961|   649k|        xmlFree(err->str1);
  962|  1.40M|    if (err->str2 != NULL)
  ------------------
  |  Branch (962:9): [True: 211k, False: 1.18M]
  ------------------
  963|   211k|        xmlFree(err->str2);
  964|  1.40M|    if (err->str3 != NULL)
  ------------------
  |  Branch (964:9): [True: 58.0k, False: 1.34M]
  ------------------
  965|  58.0k|        xmlFree(err->str3);
  966|  1.40M|    memset(err, 0, sizeof(xmlError));
  967|  1.40M|    err->code = XML_ERR_OK;
  968|  1.40M|}
xmlResetLastError:
  975|  65.8k|{
  976|  65.8k|    xmlError *error = xmlGetLastErrorInternal();
  977|       |
  978|  65.8k|    if (error->code != XML_ERR_OK)
  ------------------
  |  Branch (978:9): [True: 61.1k, False: 4.73k]
  ------------------
  979|  61.1k|        xmlResetError(error);
  980|  65.8k|}
xmlCopyError:
  990|   687k|xmlCopyError(const xmlError *from, xmlError *to) {
  991|   687k|    const char *fmt = NULL;
  992|       |
  993|   687k|    if ((from == NULL) || (to == NULL))
  ------------------
  |  Branch (993:9): [True: 0, False: 687k]
  |  Branch (993:27): [True: 0, False: 687k]
  ------------------
  994|      0|        return(-1);
  995|       |
  996|   687k|    if (from->message != NULL)
  ------------------
  |  Branch (996:9): [True: 687k, False: 0]
  ------------------
  997|   687k|        fmt = "%s";
  998|       |
  999|   687k|    return(xmlSetError(to, from->ctxt, from->node,
 1000|   687k|                       from->domain, from->code, from->level,
 1001|   687k|                       from->file, from->line,
 1002|   687k|                       from->str1, from->str2, from->str3,
 1003|   687k|                       from->int1, from->int2,
 1004|   687k|                       fmt, from->message));
 1005|   687k|}
xmlErrString:
 1012|  9.41M|xmlErrString(xmlParserErrors code) {
 1013|  9.41M|    const char *errmsg;
 1014|       |
 1015|  9.41M|    switch (code) {
 1016|  4.12k|        case XML_ERR_INVALID_HEX_CHARREF:
  ------------------
  |  Branch (1016:9): [True: 4.12k, False: 9.40M]
  ------------------
 1017|  4.12k|            errmsg = "CharRef: invalid hexadecimal value";
 1018|  4.12k|            break;
 1019|  7.32k|        case XML_ERR_INVALID_DEC_CHARREF:
  ------------------
  |  Branch (1019:9): [True: 7.32k, False: 9.40M]
  ------------------
 1020|  7.32k|            errmsg = "CharRef: invalid decimal value";
 1021|  7.32k|            break;
 1022|      0|        case XML_ERR_INVALID_CHARREF:
  ------------------
  |  Branch (1022:9): [True: 0, False: 9.41M]
  ------------------
 1023|      0|            errmsg = "CharRef: invalid value";
 1024|      0|            break;
 1025|      0|        case XML_ERR_INTERNAL_ERROR:
  ------------------
  |  Branch (1025:9): [True: 0, False: 9.41M]
  ------------------
 1026|      0|            errmsg = "internal error";
 1027|      0|            break;
 1028|      0|        case XML_ERR_PEREF_AT_EOF:
  ------------------
  |  Branch (1028:9): [True: 0, False: 9.41M]
  ------------------
 1029|      0|            errmsg = "PEReference at end of document";
 1030|      0|            break;
 1031|      0|        case XML_ERR_PEREF_IN_PROLOG:
  ------------------
  |  Branch (1031:9): [True: 0, False: 9.41M]
  ------------------
 1032|      0|            errmsg = "PEReference in prolog";
 1033|      0|            break;
 1034|      0|        case XML_ERR_PEREF_IN_EPILOG:
  ------------------
  |  Branch (1034:9): [True: 0, False: 9.41M]
  ------------------
 1035|      0|            errmsg = "PEReference in epilog";
 1036|      0|            break;
 1037|      0|        case XML_ERR_PEREF_NO_NAME:
  ------------------
  |  Branch (1037:9): [True: 0, False: 9.41M]
  ------------------
 1038|      0|            errmsg = "PEReference: no name";
 1039|      0|            break;
 1040|  16.6k|        case XML_ERR_PEREF_SEMICOL_MISSING:
  ------------------
  |  Branch (1040:9): [True: 16.6k, False: 9.39M]
  ------------------
 1041|  16.6k|            errmsg = "PEReference: expecting ';'";
 1042|  16.6k|            break;
 1043|    110|        case XML_ERR_ENTITY_LOOP:
  ------------------
  |  Branch (1043:9): [True: 110, False: 9.41M]
  ------------------
 1044|    110|            errmsg = "Detected an entity reference loop";
 1045|    110|            break;
 1046|      0|        case XML_ERR_ENTITY_NOT_STARTED:
  ------------------
  |  Branch (1046:9): [True: 0, False: 9.41M]
  ------------------
 1047|      0|            errmsg = "EntityValue: \" or ' expected";
 1048|      0|            break;
 1049|    196|        case XML_ERR_ENTITY_PE_INTERNAL:
  ------------------
  |  Branch (1049:9): [True: 196, False: 9.41M]
  ------------------
 1050|    196|            errmsg = "PEReferences forbidden in internal subset";
 1051|    196|            break;
 1052|      0|        case XML_ERR_ENTITY_NOT_FINISHED:
  ------------------
  |  Branch (1052:9): [True: 0, False: 9.41M]
  ------------------
 1053|      0|            errmsg = "EntityValue: \" or ' expected";
 1054|      0|            break;
 1055|  5.31k|        case XML_ERR_ATTRIBUTE_NOT_STARTED:
  ------------------
  |  Branch (1055:9): [True: 5.31k, False: 9.40M]
  ------------------
 1056|  5.31k|            errmsg = "AttValue: \" or ' expected";
 1057|  5.31k|            break;
 1058|   760k|        case XML_ERR_LT_IN_ATTRIBUTE:
  ------------------
  |  Branch (1058:9): [True: 760k, False: 8.65M]
  ------------------
 1059|   760k|            errmsg = "Unescaped '<' not allowed in attributes values";
 1060|   760k|            break;
 1061|  2.47k|        case XML_ERR_LITERAL_NOT_STARTED:
  ------------------
  |  Branch (1061:9): [True: 2.47k, False: 9.40M]
  ------------------
 1062|  2.47k|            errmsg = "SystemLiteral \" or ' expected";
 1063|  2.47k|            break;
 1064|  2.86k|        case XML_ERR_LITERAL_NOT_FINISHED:
  ------------------
  |  Branch (1064:9): [True: 2.86k, False: 9.40M]
  ------------------
 1065|  2.86k|            errmsg = "Unfinished System or Public ID \" or ' expected";
 1066|  2.86k|            break;
 1067|  2.56k|        case XML_ERR_MISPLACED_CDATA_END:
  ------------------
  |  Branch (1067:9): [True: 2.56k, False: 9.40M]
  ------------------
 1068|  2.56k|            errmsg = "Sequence ']]>' not allowed in content";
 1069|  2.56k|            break;
 1070|  2.04k|        case XML_ERR_URI_REQUIRED:
  ------------------
  |  Branch (1070:9): [True: 2.04k, False: 9.40M]
  ------------------
 1071|  2.04k|            errmsg = "SYSTEM or PUBLIC, the URI is missing";
 1072|  2.04k|            break;
 1073|    522|        case XML_ERR_PUBID_REQUIRED:
  ------------------
  |  Branch (1073:9): [True: 522, False: 9.41M]
  ------------------
 1074|    522|            errmsg = "PUBLIC, the Public Identifier is missing";
 1075|    522|            break;
 1076|   407k|        case XML_ERR_HYPHEN_IN_COMMENT:
  ------------------
  |  Branch (1076:9): [True: 407k, False: 9.00M]
  ------------------
 1077|   407k|            errmsg = "Comment must not contain '--' (double-hyphen)";
 1078|   407k|            break;
 1079|  4.48k|        case XML_ERR_PI_NOT_STARTED:
  ------------------
  |  Branch (1079:9): [True: 4.48k, False: 9.40M]
  ------------------
 1080|  4.48k|            errmsg = "xmlParsePI : no target name";
 1081|  4.48k|            break;
 1082|    591|        case XML_ERR_RESERVED_XML_NAME:
  ------------------
  |  Branch (1082:9): [True: 591, False: 9.41M]
  ------------------
 1083|    591|            errmsg = "Invalid PI name";
 1084|    591|            break;
 1085|  1.05k|        case XML_ERR_NOTATION_NOT_STARTED:
  ------------------
  |  Branch (1085:9): [True: 1.05k, False: 9.41M]
  ------------------
 1086|  1.05k|            errmsg = "NOTATION: Name expected here";
 1087|  1.05k|            break;
 1088|  1.80k|        case XML_ERR_NOTATION_NOT_FINISHED:
  ------------------
  |  Branch (1088:9): [True: 1.80k, False: 9.40M]
  ------------------
 1089|  1.80k|            errmsg = "'>' required to close NOTATION declaration";
 1090|  1.80k|            break;
 1091|  4.97k|        case XML_ERR_VALUE_REQUIRED:
  ------------------
  |  Branch (1091:9): [True: 4.97k, False: 9.40M]
  ------------------
 1092|  4.97k|            errmsg = "Entity value required";
 1093|  4.97k|            break;
 1094|    663|        case XML_ERR_URI_FRAGMENT:
  ------------------
  |  Branch (1094:9): [True: 663, False: 9.41M]
  ------------------
 1095|    663|            errmsg = "Fragment not allowed";
 1096|    663|            break;
 1097|  2.34k|        case XML_ERR_ATTLIST_NOT_STARTED:
  ------------------
  |  Branch (1097:9): [True: 2.34k, False: 9.40M]
  ------------------
 1098|  2.34k|            errmsg = "'(' required to start ATTLIST enumeration";
 1099|  2.34k|            break;
 1100|    423|        case XML_ERR_NMTOKEN_REQUIRED:
  ------------------
  |  Branch (1100:9): [True: 423, False: 9.41M]
  ------------------
 1101|    423|            errmsg = "NmToken expected in ATTLIST enumeration";
 1102|    423|            break;
 1103|  1.31k|        case XML_ERR_ATTLIST_NOT_FINISHED:
  ------------------
  |  Branch (1103:9): [True: 1.31k, False: 9.41M]
  ------------------
 1104|  1.31k|            errmsg = "')' required to finish ATTLIST enumeration";
 1105|  1.31k|            break;
 1106|  1.19k|        case XML_ERR_MIXED_NOT_STARTED:
  ------------------
  |  Branch (1106:9): [True: 1.19k, False: 9.41M]
  ------------------
 1107|  1.19k|            errmsg = "MixedContentDecl : '|' or ')*' expected";
 1108|  1.19k|            break;
 1109|      0|        case XML_ERR_PCDATA_REQUIRED:
  ------------------
  |  Branch (1109:9): [True: 0, False: 9.41M]
  ------------------
 1110|      0|            errmsg = "MixedContentDecl : '#PCDATA' expected";
 1111|      0|            break;
 1112|    774|        case XML_ERR_ELEMCONTENT_NOT_STARTED:
  ------------------
  |  Branch (1112:9): [True: 774, False: 9.41M]
  ------------------
 1113|    774|            errmsg = "ContentDecl : Name or '(' expected";
 1114|    774|            break;
 1115|  2.34k|        case XML_ERR_ELEMCONTENT_NOT_FINISHED:
  ------------------
  |  Branch (1115:9): [True: 2.34k, False: 9.40M]
  ------------------
 1116|  2.34k|            errmsg = "ContentDecl : ',' '|' or ')' expected";
 1117|  2.34k|            break;
 1118|      0|        case XML_ERR_PEREF_IN_INT_SUBSET:
  ------------------
  |  Branch (1118:9): [True: 0, False: 9.41M]
  ------------------
 1119|      0|            errmsg =
 1120|      0|                "PEReference: forbidden within markup decl in internal subset";
 1121|      0|            break;
 1122|  37.7k|        case XML_ERR_GT_REQUIRED:
  ------------------
  |  Branch (1122:9): [True: 37.7k, False: 9.37M]
  ------------------
 1123|  37.7k|            errmsg = "expected '>'";
 1124|  37.7k|            break;
 1125|    705|        case XML_ERR_CONDSEC_INVALID:
  ------------------
  |  Branch (1125:9): [True: 705, False: 9.41M]
  ------------------
 1126|    705|            errmsg = "XML conditional section '[' expected";
 1127|    705|            break;
 1128|  12.8k|        case XML_ERR_INT_SUBSET_NOT_FINISHED:
  ------------------
  |  Branch (1128:9): [True: 12.8k, False: 9.39M]
  ------------------
 1129|  12.8k|            errmsg = "Content error in the internal subset";
 1130|  12.8k|            break;
 1131|  3.15k|        case XML_ERR_EXT_SUBSET_NOT_FINISHED:
  ------------------
  |  Branch (1131:9): [True: 3.15k, False: 9.40M]
  ------------------
 1132|  3.15k|            errmsg = "Content error in the external subset";
 1133|  3.15k|            break;
 1134|  1.04k|        case XML_ERR_CONDSEC_INVALID_KEYWORD:
  ------------------
  |  Branch (1134:9): [True: 1.04k, False: 9.41M]
  ------------------
 1135|  1.04k|            errmsg =
 1136|  1.04k|                "conditional section INCLUDE or IGNORE keyword expected";
 1137|  1.04k|            break;
 1138|  1.14k|        case XML_ERR_CONDSEC_NOT_FINISHED:
  ------------------
  |  Branch (1138:9): [True: 1.14k, False: 9.41M]
  ------------------
 1139|  1.14k|            errmsg = "XML conditional section not closed";
 1140|  1.14k|            break;
 1141|     22|        case XML_ERR_XMLDECL_NOT_STARTED:
  ------------------
  |  Branch (1141:9): [True: 22, False: 9.41M]
  ------------------
 1142|     22|            errmsg = "Text declaration '<?xml' required";
 1143|     22|            break;
 1144|   231k|        case XML_ERR_XMLDECL_NOT_FINISHED:
  ------------------
  |  Branch (1144:9): [True: 231k, False: 9.18M]
  ------------------
 1145|   231k|            errmsg = "parsing XML declaration: '?>' expected";
 1146|   231k|            break;
 1147|      0|        case XML_ERR_EXT_ENTITY_STANDALONE:
  ------------------
  |  Branch (1147:9): [True: 0, False: 9.41M]
  ------------------
 1148|      0|            errmsg = "external parsed entities cannot be standalone";
 1149|      0|            break;
 1150|   139k|        case XML_ERR_ENTITYREF_SEMICOL_MISSING:
  ------------------
  |  Branch (1150:9): [True: 139k, False: 9.27M]
  ------------------
 1151|   139k|            errmsg = "EntityRef: expecting ';'";
 1152|   139k|            break;
 1153|    422|        case XML_ERR_DOCTYPE_NOT_FINISHED:
  ------------------
  |  Branch (1153:9): [True: 422, False: 9.41M]
  ------------------
 1154|    422|            errmsg = "DOCTYPE improperly terminated";
 1155|    422|            break;
 1156|     57|        case XML_ERR_LTSLASH_REQUIRED:
  ------------------
  |  Branch (1156:9): [True: 57, False: 9.41M]
  ------------------
 1157|     57|            errmsg = "EndTag: '</' not found";
 1158|     57|            break;
 1159|  1.43k|        case XML_ERR_EQUAL_REQUIRED:
  ------------------
  |  Branch (1159:9): [True: 1.43k, False: 9.41M]
  ------------------
 1160|  1.43k|            errmsg = "expected '='";
 1161|  1.43k|            break;
 1162|  4.78k|        case XML_ERR_STRING_NOT_CLOSED:
  ------------------
  |  Branch (1162:9): [True: 4.78k, False: 9.40M]
  ------------------
 1163|  4.78k|            errmsg = "String not closed expecting \" or '";
 1164|  4.78k|            break;
 1165|  1.13k|        case XML_ERR_STRING_NOT_STARTED:
  ------------------
  |  Branch (1165:9): [True: 1.13k, False: 9.41M]
  ------------------
 1166|  1.13k|            errmsg = "String not started expecting ' or \"";
 1167|  1.13k|            break;
 1168|    431|        case XML_ERR_ENCODING_NAME:
  ------------------
  |  Branch (1168:9): [True: 431, False: 9.41M]
  ------------------
 1169|    431|            errmsg = "Invalid XML encoding name";
 1170|    431|            break;
 1171|     10|        case XML_ERR_STANDALONE_VALUE:
  ------------------
  |  Branch (1171:9): [True: 10, False: 9.41M]
  ------------------
 1172|     10|            errmsg = "standalone accepts only 'yes' or 'no'";
 1173|     10|            break;
 1174|     32|        case XML_ERR_DOCUMENT_EMPTY:
  ------------------
  |  Branch (1174:9): [True: 32, False: 9.41M]
  ------------------
 1175|     32|            errmsg = "Document is empty";
 1176|     32|            break;
 1177|     35|        case XML_ERR_DOCUMENT_END:
  ------------------
  |  Branch (1177:9): [True: 35, False: 9.41M]
  ------------------
 1178|     35|            errmsg = "Extra content at the end of the document";
 1179|     35|            break;
 1180|    388|        case XML_ERR_NOT_WELL_BALANCED:
  ------------------
  |  Branch (1180:9): [True: 388, False: 9.41M]
  ------------------
 1181|    388|            errmsg = "chunk is not well balanced";
 1182|    388|            break;
 1183|      0|        case XML_ERR_EXTRA_CONTENT:
  ------------------
  |  Branch (1183:9): [True: 0, False: 9.41M]
  ------------------
 1184|      0|            errmsg = "extra content at the end of well balanced chunk";
 1185|      0|            break;
 1186|    878|        case XML_ERR_VERSION_MISSING:
  ------------------
  |  Branch (1186:9): [True: 878, False: 9.41M]
  ------------------
 1187|    878|            errmsg = "Malformed declaration expecting version";
 1188|    878|            break;
 1189|    432|        case XML_ERR_NAME_TOO_LONG:
  ------------------
  |  Branch (1189:9): [True: 432, False: 9.41M]
  ------------------
 1190|    432|            errmsg = "Name too long";
 1191|    432|            break;
 1192|   266k|        case XML_ERR_INVALID_ENCODING:
  ------------------
  |  Branch (1192:9): [True: 266k, False: 9.14M]
  ------------------
 1193|   266k|            errmsg = "Invalid bytes in character encoding";
 1194|   266k|            break;
 1195|      4|        case XML_ERR_RESOURCE_LIMIT:
  ------------------
  |  Branch (1195:9): [True: 4, False: 9.41M]
  ------------------
 1196|      4|            errmsg = "Resource limit exceeded";
 1197|      4|            break;
 1198|      0|        case XML_ERR_ARGUMENT:
  ------------------
  |  Branch (1198:9): [True: 0, False: 9.41M]
  ------------------
 1199|      0|            errmsg = "Invalid argument";
 1200|      0|            break;
 1201|      0|        case XML_ERR_SYSTEM:
  ------------------
  |  Branch (1201:9): [True: 0, False: 9.41M]
  ------------------
 1202|      0|            errmsg = "Out of system resources";
 1203|      0|            break;
 1204|      0|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (1204:9): [True: 0, False: 9.41M]
  ------------------
 1205|      0|            errmsg = "Invalid redeclaration of predefined entity";
 1206|      0|            break;
 1207|  1.00k|        case XML_ERR_UNSUPPORTED_ENCODING:
  ------------------
  |  Branch (1207:9): [True: 1.00k, False: 9.41M]
  ------------------
 1208|  1.00k|            errmsg = "Unsupported encoding";
 1209|  1.00k|            break;
 1210|  7.46M|        case XML_ERR_INVALID_CHAR:
  ------------------
  |  Branch (1210:9): [True: 7.46M, False: 1.95M]
  ------------------
 1211|  7.46M|            errmsg = "Invalid character";
 1212|  7.46M|            break;
 1213|       |
 1214|      0|        case XML_IO_UNKNOWN:
  ------------------
  |  Branch (1214:9): [True: 0, False: 9.41M]
  ------------------
 1215|      0|            errmsg = "Unknown IO error"; break;
 1216|      0|        case XML_IO_EACCES:
  ------------------
  |  Branch (1216:9): [True: 0, False: 9.41M]
  ------------------
 1217|      0|            errmsg = "Permission denied"; break;
 1218|      0|        case XML_IO_EAGAIN:
  ------------------
  |  Branch (1218:9): [True: 0, False: 9.41M]
  ------------------
 1219|      0|            errmsg = "Resource temporarily unavailable"; break;
 1220|      0|        case XML_IO_EBADF:
  ------------------
  |  Branch (1220:9): [True: 0, False: 9.41M]
  ------------------
 1221|      0|            errmsg = "Bad file descriptor"; break;
 1222|      0|        case XML_IO_EBADMSG:
  ------------------
  |  Branch (1222:9): [True: 0, False: 9.41M]
  ------------------
 1223|      0|            errmsg = "Bad message"; break;
 1224|      0|        case XML_IO_EBUSY:
  ------------------
  |  Branch (1224:9): [True: 0, False: 9.41M]
  ------------------
 1225|      0|            errmsg = "Resource busy"; break;
 1226|      0|        case XML_IO_ECANCELED:
  ------------------
  |  Branch (1226:9): [True: 0, False: 9.41M]
  ------------------
 1227|      0|            errmsg = "Operation canceled"; break;
 1228|      0|        case XML_IO_ECHILD:
  ------------------
  |  Branch (1228:9): [True: 0, False: 9.41M]
  ------------------
 1229|      0|            errmsg = "No child processes"; break;
 1230|      0|        case XML_IO_EDEADLK:
  ------------------
  |  Branch (1230:9): [True: 0, False: 9.41M]
  ------------------
 1231|      0|            errmsg = "Resource deadlock avoided"; break;
 1232|      0|        case XML_IO_EDOM:
  ------------------
  |  Branch (1232:9): [True: 0, False: 9.41M]
  ------------------
 1233|      0|            errmsg = "Domain error"; break;
 1234|      0|        case XML_IO_EEXIST:
  ------------------
  |  Branch (1234:9): [True: 0, False: 9.41M]
  ------------------
 1235|      0|            errmsg = "File exists"; break;
 1236|      0|        case XML_IO_EFAULT:
  ------------------
  |  Branch (1236:9): [True: 0, False: 9.41M]
  ------------------
 1237|      0|            errmsg = "Bad address"; break;
 1238|      0|        case XML_IO_EFBIG:
  ------------------
  |  Branch (1238:9): [True: 0, False: 9.41M]
  ------------------
 1239|      0|            errmsg = "File too large"; break;
 1240|      0|        case XML_IO_EINPROGRESS:
  ------------------
  |  Branch (1240:9): [True: 0, False: 9.41M]
  ------------------
 1241|      0|            errmsg = "Operation in progress"; break;
 1242|      0|        case XML_IO_EINTR:
  ------------------
  |  Branch (1242:9): [True: 0, False: 9.41M]
  ------------------
 1243|      0|            errmsg = "Interrupted function call"; break;
 1244|      0|        case XML_IO_EINVAL:
  ------------------
  |  Branch (1244:9): [True: 0, False: 9.41M]
  ------------------
 1245|      0|            errmsg = "Invalid argument"; break;
 1246|     12|        case XML_IO_EIO:
  ------------------
  |  Branch (1246:9): [True: 12, False: 9.41M]
  ------------------
 1247|     12|            errmsg = "Input/output error"; break;
 1248|      0|        case XML_IO_EISDIR:
  ------------------
  |  Branch (1248:9): [True: 0, False: 9.41M]
  ------------------
 1249|      0|            errmsg = "Is a directory"; break;
 1250|      0|        case XML_IO_EMFILE:
  ------------------
  |  Branch (1250:9): [True: 0, False: 9.41M]
  ------------------
 1251|      0|            errmsg = "Too many open files"; break;
 1252|      0|        case XML_IO_EMLINK:
  ------------------
  |  Branch (1252:9): [True: 0, False: 9.41M]
  ------------------
 1253|      0|            errmsg = "Too many links"; break;
 1254|      0|        case XML_IO_EMSGSIZE:
  ------------------
  |  Branch (1254:9): [True: 0, False: 9.41M]
  ------------------
 1255|      0|            errmsg = "Inappropriate message buffer length"; break;
 1256|      0|        case XML_IO_ENAMETOOLONG:
  ------------------
  |  Branch (1256:9): [True: 0, False: 9.41M]
  ------------------
 1257|      0|            errmsg = "Filename too long"; break;
 1258|      0|        case XML_IO_ENFILE:
  ------------------
  |  Branch (1258:9): [True: 0, False: 9.41M]
  ------------------
 1259|      0|            errmsg = "Too many open files in system"; break;
 1260|      0|        case XML_IO_ENODEV:
  ------------------
  |  Branch (1260:9): [True: 0, False: 9.41M]
  ------------------
 1261|      0|            errmsg = "No such device"; break;
 1262|  6.35k|        case XML_IO_ENOENT:
  ------------------
  |  Branch (1262:9): [True: 6.35k, False: 9.40M]
  ------------------
 1263|  6.35k|            errmsg = "No such file or directory"; break;
 1264|      0|        case XML_IO_ENOEXEC:
  ------------------
  |  Branch (1264:9): [True: 0, False: 9.41M]
  ------------------
 1265|      0|            errmsg = "Exec format error"; break;
 1266|      0|        case XML_IO_ENOLCK:
  ------------------
  |  Branch (1266:9): [True: 0, False: 9.41M]
  ------------------
 1267|      0|            errmsg = "No locks available"; break;
 1268|      0|        case XML_IO_ENOMEM:
  ------------------
  |  Branch (1268:9): [True: 0, False: 9.41M]
  ------------------
 1269|      0|            errmsg = "Not enough space"; break;
 1270|      0|        case XML_IO_ENOSPC:
  ------------------
  |  Branch (1270:9): [True: 0, False: 9.41M]
  ------------------
 1271|      0|            errmsg = "No space left on device"; break;
 1272|      0|        case XML_IO_ENOSYS:
  ------------------
  |  Branch (1272:9): [True: 0, False: 9.41M]
  ------------------
 1273|      0|            errmsg = "Function not implemented"; break;
 1274|      0|        case XML_IO_ENOTDIR:
  ------------------
  |  Branch (1274:9): [True: 0, False: 9.41M]
  ------------------
 1275|      0|            errmsg = "Not a directory"; break;
 1276|      0|        case XML_IO_ENOTEMPTY:
  ------------------
  |  Branch (1276:9): [True: 0, False: 9.41M]
  ------------------
 1277|      0|            errmsg = "Directory not empty"; break;
 1278|      0|        case XML_IO_ENOTSUP:
  ------------------
  |  Branch (1278:9): [True: 0, False: 9.41M]
  ------------------
 1279|      0|            errmsg = "Not supported"; break;
 1280|      0|        case XML_IO_ENOTTY:
  ------------------
  |  Branch (1280:9): [True: 0, False: 9.41M]
  ------------------
 1281|      0|            errmsg = "Inappropriate I/O control operation"; break;
 1282|      0|        case XML_IO_ENXIO:
  ------------------
  |  Branch (1282:9): [True: 0, False: 9.41M]
  ------------------
 1283|      0|            errmsg = "No such device or address"; break;
 1284|      0|        case XML_IO_EPERM:
  ------------------
  |  Branch (1284:9): [True: 0, False: 9.41M]
  ------------------
 1285|      0|            errmsg = "Operation not permitted"; break;
 1286|      0|        case XML_IO_EPIPE:
  ------------------
  |  Branch (1286:9): [True: 0, False: 9.41M]
  ------------------
 1287|      0|            errmsg = "Broken pipe"; break;
 1288|      0|        case XML_IO_ERANGE:
  ------------------
  |  Branch (1288:9): [True: 0, False: 9.41M]
  ------------------
 1289|      0|            errmsg = "Result too large"; break;
 1290|      0|        case XML_IO_EROFS:
  ------------------
  |  Branch (1290:9): [True: 0, False: 9.41M]
  ------------------
 1291|      0|            errmsg = "Read-only file system"; break;
 1292|      0|        case XML_IO_ESPIPE:
  ------------------
  |  Branch (1292:9): [True: 0, False: 9.41M]
  ------------------
 1293|      0|            errmsg = "Invalid seek"; break;
 1294|      0|        case XML_IO_ESRCH:
  ------------------
  |  Branch (1294:9): [True: 0, False: 9.41M]
  ------------------
 1295|      0|            errmsg = "No such process"; break;
 1296|      0|        case XML_IO_ETIMEDOUT:
  ------------------
  |  Branch (1296:9): [True: 0, False: 9.41M]
  ------------------
 1297|      0|            errmsg = "Operation timed out"; break;
 1298|      0|        case XML_IO_EXDEV:
  ------------------
  |  Branch (1298:9): [True: 0, False: 9.41M]
  ------------------
 1299|      0|            errmsg = "Improper link"; break;
 1300|      0|        case XML_IO_NETWORK_ATTEMPT:
  ------------------
  |  Branch (1300:9): [True: 0, False: 9.41M]
  ------------------
 1301|      0|            errmsg = "Attempt to load network entity"; break;
 1302|      0|        case XML_IO_ENCODER:
  ------------------
  |  Branch (1302:9): [True: 0, False: 9.41M]
  ------------------
 1303|      0|            errmsg = "encoder error"; break;
 1304|      0|        case XML_IO_FLUSH:
  ------------------
  |  Branch (1304:9): [True: 0, False: 9.41M]
  ------------------
 1305|      0|            errmsg = "flush error"; break;
 1306|      0|        case XML_IO_WRITE:
  ------------------
  |  Branch (1306:9): [True: 0, False: 9.41M]
  ------------------
 1307|      0|            errmsg = "write error"; break;
 1308|      0|        case XML_IO_NO_INPUT:
  ------------------
  |  Branch (1308:9): [True: 0, False: 9.41M]
  ------------------
 1309|      0|            errmsg = "no input"; break;
 1310|      0|        case XML_IO_BUFFER_FULL:
  ------------------
  |  Branch (1310:9): [True: 0, False: 9.41M]
  ------------------
 1311|      0|            errmsg = "buffer full"; break;
 1312|      0|        case XML_IO_LOAD_ERROR:
  ------------------
  |  Branch (1312:9): [True: 0, False: 9.41M]
  ------------------
 1313|      0|            errmsg = "loading error"; break;
 1314|      0|        case XML_IO_ENOTSOCK:
  ------------------
  |  Branch (1314:9): [True: 0, False: 9.41M]
  ------------------
 1315|      0|            errmsg = "not a socket"; break;
 1316|      0|        case XML_IO_EISCONN:
  ------------------
  |  Branch (1316:9): [True: 0, False: 9.41M]
  ------------------
 1317|      0|            errmsg = "already connected"; break;
 1318|      0|        case XML_IO_ECONNREFUSED:
  ------------------
  |  Branch (1318:9): [True: 0, False: 9.41M]
  ------------------
 1319|      0|            errmsg = "connection refused"; break;
 1320|      0|        case XML_IO_ENETUNREACH:
  ------------------
  |  Branch (1320:9): [True: 0, False: 9.41M]
  ------------------
 1321|      0|            errmsg = "unreachable network"; break;
 1322|      0|        case XML_IO_EADDRINUSE:
  ------------------
  |  Branch (1322:9): [True: 0, False: 9.41M]
  ------------------
 1323|      0|            errmsg = "address in use"; break;
 1324|      0|        case XML_IO_EALREADY:
  ------------------
  |  Branch (1324:9): [True: 0, False: 9.41M]
  ------------------
 1325|      0|            errmsg = "already in use"; break;
 1326|      0|        case XML_IO_EAFNOSUPPORT:
  ------------------
  |  Branch (1326:9): [True: 0, False: 9.41M]
  ------------------
 1327|      0|            errmsg = "unknown address family"; break;
 1328|      0|        case XML_IO_UNSUPPORTED_PROTOCOL:
  ------------------
  |  Branch (1328:9): [True: 0, False: 9.41M]
  ------------------
 1329|      0|            errmsg = "unsupported protocol"; break;
 1330|       |
 1331|  5.38k|        default:
  ------------------
  |  Branch (1331:9): [True: 5.38k, False: 9.40M]
  ------------------
 1332|  5.38k|            errmsg = "Unregistered error message";
 1333|  9.41M|    }
 1334|       |
 1335|  9.41M|    return(errmsg);
 1336|  9.41M|}
error.c:xmlVUpdateError:
  180|   716k|{
  181|   716k|    int res;
  182|       |
  183|       |    /*
  184|       |     * Find first element parent.
  185|       |     */
  186|   716k|    if (node != NULL) {
  ------------------
  |  Branch (186:9): [True: 111k, False: 604k]
  ------------------
  187|   111k|        int i;
  188|       |
  189|   133k|        for (i = 0; i < 10; i++) {
  ------------------
  |  Branch (189:21): [True: 133k, False: 0]
  ------------------
  190|   133k|            if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (190:17): [True: 82.4k, False: 50.7k]
  ------------------
  191|  50.7k|                (node->parent == NULL))
  ------------------
  |  Branch (191:17): [True: 29.4k, False: 21.3k]
  ------------------
  192|   111k|                break;
  193|  21.3k|            node = node->parent;
  194|  21.3k|        }
  195|   111k|    }
  196|       |
  197|       |    /*
  198|       |     * Get file and line from node.
  199|       |     */
  200|   716k|    if (node != NULL) {
  ------------------
  |  Branch (200:9): [True: 111k, False: 604k]
  ------------------
  201|   111k|        if ((file == NULL) && (node->doc != NULL))
  ------------------
  |  Branch (201:13): [True: 89.8k, False: 22.1k]
  |  Branch (201:31): [True: 89.8k, False: 0]
  ------------------
  202|  89.8k|            file = (const char *) node->doc->URL;
  203|       |
  204|   111k|        if (line == 0) {
  ------------------
  |  Branch (204:13): [True: 21.6k, False: 90.3k]
  ------------------
  205|  21.6k|            if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (205:17): [True: 21.6k, False: 0]
  ------------------
  206|  21.6k|                line = node->line;
  207|  21.6k|            if ((line == 0) || (line == 65535))
  ------------------
  |  Branch (207:17): [True: 0, False: 21.6k]
  |  Branch (207:32): [True: 54, False: 21.6k]
  ------------------
  208|     54|                line = xmlGetLineNo(node);
  209|  21.6k|        }
  210|   111k|    }
  211|       |
  212|   716k|    res = xmlVSetError(err, ctxt, node, domain, code, level, file, line,
  213|   716k|                       str1, str2, str3, int1, col, fmt, ap);
  214|       |
  215|   716k|    return(res);
  216|   716k|}
error.c:xmlVSetError:
   75|  1.40M|{
   76|  1.40M|    char *message = NULL;
   77|  1.40M|    char *fileCopy = NULL;
   78|  1.40M|    char *str1Copy = NULL;
   79|  1.40M|    char *str2Copy = NULL;
   80|  1.40M|    char *str3Copy = NULL;
   81|       |
   82|  1.40M|    if (code == XML_ERR_OK) {
  ------------------
  |  Branch (82:9): [True: 0, False: 1.40M]
  ------------------
   83|      0|        xmlResetError(err);
   84|      0|        return(0);
   85|      0|    }
   86|       |
   87|       |    /*
   88|       |     * Formatting the message
   89|       |     */
   90|  1.40M|    if (fmt == NULL) {
  ------------------
  |  Branch (90:9): [True: 0, False: 1.40M]
  ------------------
   91|      0|        message = xmlMemStrdup("No error message provided");
   92|  1.40M|    } else {
   93|  1.40M|        xmlChar *tmp;
   94|  1.40M|        int res;
   95|       |
   96|  1.40M|        res = xmlStrVASPrintf(&tmp, MAX_ERR_MSG_SIZE, fmt, ap);
  ------------------
  |  |    9|  1.40M|#define MAX_ERR_MSG_SIZE 64000
  ------------------
   97|  1.40M|        if (res < 0)
  ------------------
  |  Branch (97:13): [True: 1.57k, False: 1.40M]
  ------------------
   98|  1.57k|            goto err_memory;
   99|  1.40M|        message = (char *) tmp;
  100|  1.40M|    }
  101|  1.40M|    if (message == NULL)
  ------------------
  |  Branch (101:9): [True: 0, False: 1.40M]
  ------------------
  102|      0|        goto err_memory;
  103|       |
  104|  1.40M|    if (file != NULL) {
  ------------------
  |  Branch (104:9): [True: 620k, False: 781k]
  ------------------
  105|   620k|        fileCopy = (char *) xmlStrdup((const xmlChar *) file);
  106|   620k|        if (fileCopy == NULL)
  ------------------
  |  Branch (106:13): [True: 200, False: 620k]
  ------------------
  107|    200|            goto err_memory;
  108|   620k|    }
  109|  1.40M|    if (str1 != NULL) {
  ------------------
  |  Branch (109:9): [True: 665k, False: 736k]
  ------------------
  110|   665k|        str1Copy = (char *) xmlStrdup((const xmlChar *) str1);
  111|   665k|        if (str1Copy == NULL)
  ------------------
  |  Branch (111:13): [True: 909, False: 664k]
  ------------------
  112|    909|            goto err_memory;
  113|   665k|    }
  114|  1.40M|    if (str2 != NULL) {
  ------------------
  |  Branch (114:9): [True: 218k, False: 1.18M]
  ------------------
  115|   218k|        str2Copy = (char *) xmlStrdup((const xmlChar *) str2);
  116|   218k|        if (str2Copy == NULL)
  ------------------
  |  Branch (116:13): [True: 165, False: 218k]
  ------------------
  117|    165|            goto err_memory;
  118|   218k|    }
  119|  1.40M|    if (str3 != NULL) {
  ------------------
  |  Branch (119:9): [True: 58.6k, False: 1.34M]
  ------------------
  120|  58.6k|        str3Copy = (char *) xmlStrdup((const xmlChar *) str3);
  121|  58.6k|        if (str3Copy == NULL)
  ------------------
  |  Branch (121:13): [True: 31, False: 58.6k]
  ------------------
  122|     31|            goto err_memory;
  123|  58.6k|    }
  124|       |
  125|  1.40M|    xmlResetError(err);
  126|       |
  127|  1.40M|    err->domain = domain;
  128|  1.40M|    err->code = code;
  129|  1.40M|    err->message = message;
  130|  1.40M|    err->level = level;
  131|  1.40M|    err->file = fileCopy;
  132|  1.40M|    err->line = line;
  133|  1.40M|    err->str1 = str1Copy;
  134|  1.40M|    err->str2 = str2Copy;
  135|  1.40M|    err->str3 = str3Copy;
  136|  1.40M|    err->int1 = int1;
  137|  1.40M|    err->int2 = col;
  138|  1.40M|    err->node = node;
  139|  1.40M|    err->ctxt = ctxt;
  140|       |
  141|  1.40M|    return(0);
  142|       |
  143|  2.88k|err_memory:
  144|  2.88k|    xmlFree(message);
  145|  2.88k|    xmlFree(fileCopy);
  146|  2.88k|    xmlFree(str1Copy);
  147|  2.88k|    xmlFree(str2Copy);
  148|  2.88k|    xmlFree(str3Copy);
  149|  2.88k|    return(-1);
  150|  1.40M|}
error.c:xmlSetError:
  160|   687k|{
  161|   687k|    va_list ap;
  162|   687k|    int res;
  163|       |
  164|   687k|    va_start(ap, fmt);
  165|   687k|    res = xmlVSetError(err, ctxt, node, domain, code, level, file, line,
  166|   687k|                       str1, str2, str3, int1, col, fmt, ap);
  167|   687k|    va_end(ap);
  168|       |
  169|   687k|    return(res);
  170|   687k|}

xmlFuzzSErrorFunc:
   69|   299k|                  const xmlError *error ATTRIBUTE_UNUSED) {
   70|   299k|}
xmlFuzzInjectFailure:
   83|  86.6k|xmlFuzzInjectFailure(size_t failurePos) {
   84|  86.6k|    fuzzNumAttempts = 0;
   85|  86.6k|    fuzzFailurePos = failurePos;
   86|  86.6k|    fuzzAllocFailed = 0;
   87|  86.6k|    fuzzIoFailed = 0;
   88|  86.6k|}
xmlFuzzMemSetup:
  151|      2|xmlFuzzMemSetup(void) {
  152|      2|    xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
  153|      2|}
xmlFuzzCheckFailureReport:
  167|  43.1k|xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport) {
  168|  43.1k|    if (oomReport >= 0 && fuzzAllocFailed != oomReport) {
  ------------------
  |  Branch (168:9): [True: 39.3k, False: 3.86k]
  |  Branch (168:27): [True: 0, False: 39.3k]
  ------------------
  169|      0|        fprintf(stderr, "%s: malloc failure %s reported\n",
  170|      0|                func, fuzzAllocFailed ? "not" : "erroneously");
  ------------------
  |  Branch (170:23): [True: 0, False: 0]
  ------------------
  171|      0|        abort();
  172|      0|    }
  173|  43.1k|    if (ioReport >= 0 && fuzzIoFailed != ioReport) {
  ------------------
  |  Branch (173:9): [True: 43.1k, False: 0]
  |  Branch (173:26): [True: 0, False: 43.1k]
  ------------------
  174|      0|        fprintf(stderr, "%s: IO failure %s reported\n",
  175|      0|                func, fuzzIoFailed ? "not" : "erroneously");
  ------------------
  |  Branch (175:23): [True: 0, False: 0]
  ------------------
  176|      0|        abort();
  177|      0|    }
  178|  43.1k|    fuzzAllocFailed = 0;
  179|  43.1k|    fuzzIoFailed = 0;
  180|  43.1k|}
xmlFuzzDataInit:
  188|  43.3k|xmlFuzzDataInit(const char *data, size_t size) {
  189|  43.3k|    fuzzData.data = data;
  190|  43.3k|    fuzzData.size = size;
  191|  43.3k|    fuzzData.ptr = data;
  192|  43.3k|    fuzzData.remaining = size;
  193|       |
  194|  43.3k|    fuzzData.outBuf = xmlMalloc(size + 1);
  195|  43.3k|    fuzzData.outPtr = fuzzData.outBuf;
  196|       |
  197|  43.3k|    fuzzData.entities = xmlHashCreate(8);
  198|  43.3k|    fuzzData.mainUrl = NULL;
  199|  43.3k|    fuzzData.mainEntity = NULL;
  200|  43.3k|    fuzzData.secondaryUrl = NULL;
  201|       |    fuzzData.secondaryEntity = NULL;
  202|  43.3k|}
xmlFuzzDataCleanup:
  210|  43.3k|xmlFuzzDataCleanup(void) {
  211|  43.3k|    xmlFree(fuzzData.outBuf);
  212|  43.3k|    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
  213|  43.3k|}
xmlFuzzReadInt:
  246|  86.7k|xmlFuzzReadInt(int size) {
  247|  86.7k|    size_t ret = 0;
  248|       |
  249|   433k|    while ((size > 0) && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (249:12): [True: 347k, False: 86.7k]
  |  Branch (249:26): [True: 346k, False: 10]
  ------------------
  250|   346k|        unsigned char c = (unsigned char) *fuzzData.ptr++;
  251|   346k|        fuzzData.remaining--;
  252|   346k|        ret = (ret << 8) | c;
  253|   346k|        size--;
  254|   346k|    }
  255|       |
  256|  86.7k|    return ret;
  257|  86.7k|}
xmlFuzzReadString:
  320|   210k|xmlFuzzReadString(size_t *size) {
  321|   210k|    const char *out = fuzzData.outPtr;
  322|       |
  323|   294M|    while (fuzzData.remaining > 0) {
  ------------------
  |  Branch (323:12): [True: 294M, False: 85.7k]
  ------------------
  324|   294M|        int c = *fuzzData.ptr++;
  325|   294M|        fuzzData.remaining--;
  326|       |
  327|   294M|        if ((c == '\\') && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (327:13): [True: 137k, False: 294M]
  |  Branch (327:28): [True: 136k, False: 683]
  ------------------
  328|   136k|            int c2 = *fuzzData.ptr;
  329|       |
  330|   136k|            if (c2 == '\n') {
  ------------------
  |  Branch (330:17): [True: 124k, False: 12.4k]
  ------------------
  331|   124k|                fuzzData.ptr++;
  332|   124k|                fuzzData.remaining--;
  333|   124k|                if (size != NULL)
  ------------------
  |  Branch (333:21): [True: 124k, False: 0]
  ------------------
  334|   124k|                    *size = fuzzData.outPtr - out;
  335|   124k|                *fuzzData.outPtr++ = '\0';
  336|   124k|                return(out);
  337|   124k|            }
  338|  12.4k|            if (c2 == '\\') {
  ------------------
  |  Branch (338:17): [True: 1.44k, False: 11.0k]
  ------------------
  339|  1.44k|                fuzzData.ptr++;
  340|  1.44k|                fuzzData.remaining--;
  341|  1.44k|            }
  342|  12.4k|        }
  343|       |
  344|   294M|        *fuzzData.outPtr++ = c;
  345|   294M|    }
  346|       |
  347|  85.7k|    if (fuzzData.outPtr > out) {
  ------------------
  |  Branch (347:9): [True: 42.3k, False: 43.3k]
  ------------------
  348|  42.3k|        if (size != NULL)
  ------------------
  |  Branch (348:13): [True: 42.3k, False: 0]
  ------------------
  349|  42.3k|            *size = fuzzData.outPtr - out;
  350|  42.3k|        *fuzzData.outPtr++ = '\0';
  351|  42.3k|        return(out);
  352|  42.3k|    }
  353|       |
  354|  43.3k|    if (size != NULL)
  ------------------
  |  Branch (354:9): [True: 43.3k, False: 0]
  ------------------
  355|  43.3k|        *size = 0;
  356|       |    return(NULL);
  357|  85.7k|}
xmlFuzzReadEntities:
  366|  43.3k|xmlFuzzReadEntities(void) {
  367|  43.3k|    size_t num = 0;
  368|       |
  369|   103k|    while (1) {
  ------------------
  |  Branch (369:12): [True: 103k, Folded]
  ------------------
  370|   103k|        const char *url, *entity;
  371|   103k|        size_t urlSize, entitySize;
  372|   103k|        xmlFuzzEntityInfo *entityInfo;
  373|       |
  374|   103k|        url = xmlFuzzReadString(&urlSize);
  375|   103k|        if (url == NULL) break;
  ------------------
  |  Branch (375:13): [True: 40.7k, False: 63.0k]
  ------------------
  376|       |
  377|  63.0k|        entity = xmlFuzzReadString(&entitySize);
  378|  63.0k|        if (entity == NULL) break;
  ------------------
  |  Branch (378:13): [True: 2.64k, False: 60.3k]
  ------------------
  379|       |
  380|       |        /*
  381|       |         * Cap URL size to avoid quadratic behavior when generating
  382|       |         * error messages or looking up entities.
  383|       |         */
  384|  60.3k|        if (urlSize < 50 &&
  ------------------
  |  Branch (384:13): [True: 59.7k, False: 606]
  ------------------
  385|  59.7k|            xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
  ------------------
  |  Branch (385:13): [True: 58.5k, False: 1.23k]
  ------------------
  386|  58.5k|            entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
  387|  58.5k|            if (entityInfo == NULL)
  ------------------
  |  Branch (387:17): [True: 0, False: 58.5k]
  ------------------
  388|      0|                break;
  389|  58.5k|            entityInfo->data = entity;
  390|  58.5k|            entityInfo->size = entitySize;
  391|       |
  392|  58.5k|            xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
  393|       |
  394|  58.5k|            if (num == 0) {
  ------------------
  |  Branch (394:17): [True: 43.2k, False: 15.2k]
  ------------------
  395|  43.2k|                fuzzData.mainUrl = url;
  396|  43.2k|                fuzzData.mainEntity = entityInfo;
  397|  43.2k|            } else if (num == 1) {
  ------------------
  |  Branch (397:24): [True: 10.1k, False: 5.15k]
  ------------------
  398|  10.1k|                fuzzData.secondaryUrl = url;
  399|  10.1k|                fuzzData.secondaryEntity = entityInfo;
  400|  10.1k|            }
  401|       |
  402|  58.5k|            num++;
  403|  58.5k|        }
  404|  60.3k|    }
  405|  43.3k|}
xmlFuzzMainEntity:
  424|  43.3k|xmlFuzzMainEntity(size_t *size) {
  425|  43.3k|    if (fuzzData.mainEntity == NULL)
  ------------------
  |  Branch (425:9): [True: 119, False: 43.2k]
  ------------------
  426|    119|        return(NULL);
  427|  43.2k|    *size = fuzzData.mainEntity->size;
  428|  43.2k|    return(fuzzData.mainEntity->data);
  429|  43.3k|}
xmlFuzzResourceLoader:
  465|   329k|                      xmlParserInputPtr *out) {
  466|   329k|    xmlParserInputPtr input;
  467|   329k|    xmlFuzzEntityInfo *entity;
  468|       |
  469|   329k|    entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
  470|   329k|    if (entity == NULL)
  ------------------
  |  Branch (470:9): [True: 6.35k, False: 323k]
  ------------------
  471|  6.35k|        return(XML_IO_ENOENT);
  472|       |
  473|       |    /* IO failure injection */
  474|   323k|    if (xmlFuzzTryIo() < 0)
  ------------------
  |  Branch (474:9): [True: 10, False: 323k]
  ------------------
  475|     10|        return(XML_IO_EIO);
  476|       |
  477|   323k|    input = xmlNewInputFromMemory(URL, entity->data, entity->size,
  478|   323k|                                  XML_INPUT_BUF_STATIC |
  479|   323k|                                  XML_INPUT_BUF_ZERO_TERMINATED);
  480|   323k|    if (input == NULL)
  ------------------
  |  Branch (480:9): [True: 45, False: 323k]
  ------------------
  481|     45|        return(XML_ERR_NO_MEMORY);
  482|       |
  483|   323k|    *out = input;
  484|   323k|    return(XML_ERR_OK);
  485|   323k|}
fuzz.c:xmlFuzzMalloc:
  123|  77.5M|xmlFuzzMalloc(size_t size) {
  124|  77.5M|    void *ret;
  125|       |
  126|  77.5M|    if (xmlFuzzTryMalloc() < 0)
  ------------------
  |  Branch (126:9): [True: 8.89k, False: 77.5M]
  ------------------
  127|  8.89k|        return NULL;
  128|       |
  129|  77.5M|    ret = malloc(size);
  130|  77.5M|    if (ret == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 77.5M]
  ------------------
  131|      0|        fuzzAllocFailed = 1;
  132|       |
  133|  77.5M|    return ret;
  134|  77.5M|}
fuzz.c:xmlFuzzTryMalloc:
   91|  84.6M|xmlFuzzTryMalloc(void) {
   92|  84.6M|    if (fuzzFailurePos > 0) {
  ------------------
  |  Branch (92:9): [True: 23.9M, False: 60.7M]
  ------------------
   93|  23.9M|        fuzzNumAttempts += 1;
   94|  23.9M|        if (fuzzNumAttempts == fuzzFailurePos) {
  ------------------
  |  Branch (94:13): [True: 10.1k, False: 23.9M]
  ------------------
   95|       |#if XML_FUZZ_FAILURE_ABORT
   96|       |            abort();
   97|       |#endif
   98|  10.1k|            fuzzAllocFailed = 1;
   99|  10.1k|            return -1;
  100|  10.1k|        }
  101|  23.9M|    }
  102|       |
  103|  84.6M|    return 0;
  104|  84.6M|}
fuzz.c:xmlFuzzRealloc:
  137|  7.18M|xmlFuzzRealloc(void *ptr, size_t size) {
  138|  7.18M|    void *ret;
  139|       |
  140|  7.18M|    if (xmlFuzzTryMalloc() < 0)
  ------------------
  |  Branch (140:9): [True: 1.27k, False: 7.17M]
  ------------------
  141|  1.27k|        return NULL;
  142|       |
  143|  7.17M|    ret = realloc(ptr, size);
  144|  7.17M|    if (ret == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 7.17M]
  ------------------
  145|      0|        fuzzAllocFailed = 1;
  146|       |
  147|  7.17M|    return ret;
  148|  7.18M|}
fuzz.c:xmlFuzzTryIo:
  107|   323k|xmlFuzzTryIo(void) {
  108|   323k|    if (fuzzFailurePos > 0) {
  ------------------
  |  Branch (108:9): [True: 27.2k, False: 296k]
  ------------------
  109|  27.2k|        fuzzNumAttempts += 1;
  110|  27.2k|        if (fuzzNumAttempts == fuzzFailurePos) {
  ------------------
  |  Branch (110:13): [True: 10, False: 27.2k]
  ------------------
  111|       |#if XML_FUZZ_FAILURE_ABORT
  112|       |            abort();
  113|       |#endif
  114|     10|            fuzzIoFailed = 1;
  115|     10|            return -1;
  116|     10|        }
  117|  27.2k|    }
  118|       |
  119|   323k|    return 0;
  120|   323k|}

LLVMFuzzerInitialize:
   92|      2|                     char ***argv ATTRIBUTE_UNUSED) {
   93|      2|    xmlFuzzMemSetup();
   94|      2|    xmlInitParser();
   95|      2|#ifdef LIBXML_CATALOG_ENABLED
   96|      2|    xmlInitializeCatalog();
   97|      2|    xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
   98|      2|#endif
   99|       |
  100|      2|    return 0;
  101|      2|}
LLVMFuzzerTestOneInput:
  104|  43.3k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  43.3k|    xmlTextReaderPtr reader;
  106|  43.3k|    xmlDocPtr doc = NULL;
  107|  43.3k|    const xmlError *error;
  108|  43.3k|    const char *docBuffer;
  109|  43.3k|    const unsigned char *program;
  110|  43.3k|    size_t failurePos, docSize, programSize, i;
  111|  43.3k|    size_t totalStringSize = 0;
  112|  43.3k|    int opts;
  113|  43.3k|    int oomReport = 0;
  114|       |
  115|  43.3k|    xmlFuzzDataInit(data, size);
  116|  43.3k|    opts = (int) xmlFuzzReadInt(4);
  117|  43.3k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  43.3k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  43.3k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 22, False: 43.3k]
  ------------------
  121|     22|        programSize = 1000;
  122|       |
  123|  43.3k|    xmlFuzzReadEntities();
  124|  43.3k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  43.3k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 119, False: 43.2k]
  ------------------
  126|    119|        goto exit;
  127|       |
  128|       |#ifdef DEBUG
  129|       |    fprintf(stderr, "Input document (%d bytes):\n", (int) docSize);
  130|       |    for (i = 0; (size_t) i < docSize; i++) {
  131|       |        int c = (unsigned char) docBuffer[i];
  132|       |
  133|       |        if ((c == '\n' || (c >= 0x20 && c <= 0x7E)))
  134|       |            putc(c, stderr);
  135|       |        else
  136|       |            fprintf(stderr, "\\x%02X", c);
  137|       |    }
  138|       |    fprintf(stderr, "\nEOF\n");
  139|       |#endif
  140|       |
  141|  43.2k|    xmlFuzzInjectFailure(failurePos);
  142|  43.2k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  43.2k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 71, False: 43.1k]
  ------------------
  144|     71|        goto exit;
  145|       |
  146|  43.1k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  43.1k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  43.1k|    i = 0;
  150|   779k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 737k, False: 41.7k]
  ------------------
  151|   737k|        int op = program[i++];
  152|       |
  153|   737k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   737k|#define FREE_STRING(str) \
  155|   737k|    do { \
  156|   737k|        if (str != NULL) { \
  157|   737k|            totalStringSize += strlen((char *) str); \
  158|   737k|            xmlFree(str); \
  159|   737k|        } \
  160|   737k|    } while (0)
  161|       |
  162|   737k|        switch (op & 0x3F) {
  163|  51.1k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 51.1k, False: 686k]
  ------------------
  164|   247k|            default:
  ------------------
  |  Branch (164:13): [True: 196k, False: 540k]
  ------------------
  165|   247k|                startOp("Read");
  166|   247k|                xmlTextReaderRead(reader);
  167|   247k|                break;
  168|       |
  169|  13.4k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 13.4k, False: 724k]
  ------------------
  170|  13.4k|                xmlChar *result;
  171|       |
  172|  13.4k|                startOp("ReadInnerXml");
  173|  13.4k|                result = xmlTextReaderReadInnerXml(reader);
  174|  13.4k|                FREE_STRING(result);
  ------------------
  |  |  155|  13.4k|    do { \
  |  |  156|  13.4k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 8.96k, False: 4.43k]
  |  |  ------------------
  |  |  157|  8.96k|            totalStringSize += strlen((char *) str); \
  |  |  158|  8.96k|            xmlFree(str); \
  |  |  159|  8.96k|        } \
  |  |  160|  13.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
  175|  13.4k|                break;
  176|  51.1k|            }
  177|       |
  178|  37.5k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 37.5k, False: 700k]
  ------------------
  179|  37.5k|                xmlChar *result;
  180|       |
  181|  37.5k|                startOp("ReadOuterXml");
  182|  37.5k|                result = xmlTextReaderReadOuterXml(reader);
  183|  37.5k|                FREE_STRING(result);
  ------------------
  |  |  155|  37.5k|    do { \
  |  |  156|  37.5k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 29.5k, False: 7.96k]
  |  |  ------------------
  |  |  157|  29.5k|            totalStringSize += strlen((char *) str); \
  |  |  158|  29.5k|            xmlFree(str); \
  |  |  159|  29.5k|        } \
  |  |  160|  37.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 37.5k]
  |  |  ------------------
  ------------------
  184|  37.5k|                break;
  185|  51.1k|            }
  186|       |
  187|  9.81k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 9.81k, False: 727k]
  ------------------
  188|  9.81k|                xmlChar *result;
  189|       |
  190|  9.81k|                startOp("ReadString");
  191|  9.81k|                result = xmlTextReaderReadString(reader);
  192|  9.81k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.81k|    do { \
  |  |  156|  9.81k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.58k, False: 7.22k]
  |  |  ------------------
  |  |  157|  2.58k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.58k|            xmlFree(str); \
  |  |  159|  2.58k|        } \
  |  |  160|  9.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.81k]
  |  |  ------------------
  ------------------
  193|  9.81k|                break;
  194|  51.1k|            }
  195|       |
  196|  10.4k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 10.4k, False: 727k]
  ------------------
  197|  10.4k|                startOp("ReadAttributeValue");
  198|  10.4k|                xmlTextReaderReadAttributeValue(reader);
  199|  10.4k|                break;
  200|       |
  201|  8.01k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 8.01k, False: 729k]
  ------------------
  202|  8.01k|                startOp("AttributeCount");
  203|  8.01k|                xmlTextReaderAttributeCount(reader);
  204|  8.01k|                break;
  205|       |
  206|  3.30k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.30k, False: 734k]
  ------------------
  207|  3.30k|                startOp("Depth");
  208|  3.30k|                xmlTextReaderDepth(reader);
  209|  3.30k|                break;
  210|       |
  211|  2.93k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 2.93k, False: 734k]
  ------------------
  212|  2.93k|                startOp("HasAttributes");
  213|  2.93k|                xmlTextReaderHasAttributes(reader);
  214|  2.93k|                break;
  215|       |
  216|  10.9k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 10.9k, False: 726k]
  ------------------
  217|  10.9k|                startOp("HasValue");
  218|  10.9k|                xmlTextReaderHasValue(reader);
  219|  10.9k|                break;
  220|       |
  221|  7.70k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 7.70k, False: 729k]
  ------------------
  222|  7.70k|                startOp("IsDefault");
  223|  7.70k|                xmlTextReaderIsDefault(reader);
  224|  7.70k|                break;
  225|       |
  226|  9.20k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 9.20k, False: 728k]
  ------------------
  227|  9.20k|                startOp("IsEmptyElement");
  228|  9.20k|                xmlTextReaderIsEmptyElement(reader);
  229|  9.20k|                break;
  230|       |
  231|  11.0k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 11.0k, False: 726k]
  ------------------
  232|  11.0k|                startOp("NodeType");
  233|  11.0k|                xmlTextReaderNodeType(reader);
  234|  11.0k|                break;
  235|       |
  236|  3.12k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 3.12k, False: 734k]
  ------------------
  237|  3.12k|                startOp("QuoteChar");
  238|  3.12k|                xmlTextReaderQuoteChar(reader);
  239|  3.12k|                break;
  240|       |
  241|  4.67k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 4.67k, False: 732k]
  ------------------
  242|  4.67k|                startOp("ReadState");
  243|  4.67k|                xmlTextReaderReadState(reader);
  244|  4.67k|                break;
  245|       |
  246|  4.54k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 4.54k, False: 733k]
  ------------------
  247|  4.54k|                startOp("IsNamespaceDecl");
  248|  4.54k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  4.54k|                break;
  250|       |
  251|  42.6k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 42.6k, False: 694k]
  ------------------
  252|  42.6k|                startOp("ConstBaseUri");
  253|  42.6k|                xmlTextReaderConstBaseUri(reader);
  254|  42.6k|                break;
  255|       |
  256|  1.94k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 1.94k, False: 735k]
  ------------------
  257|  1.94k|                startOp("ConstLocalName");
  258|  1.94k|                xmlTextReaderConstLocalName(reader);
  259|  1.94k|                break;
  260|       |
  261|  2.96k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 2.96k, False: 734k]
  ------------------
  262|  2.96k|                startOp("ConstName");
  263|  2.96k|                xmlTextReaderConstName(reader);
  264|  2.96k|                break;
  265|       |
  266|  5.42k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.42k, False: 732k]
  ------------------
  267|  5.42k|                startOp("ConstNamespaceUri");
  268|  5.42k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.42k|                break;
  270|       |
  271|  12.2k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 12.2k, False: 725k]
  ------------------
  272|  12.2k|                startOp("ConstPrefix");
  273|  12.2k|                xmlTextReaderConstPrefix(reader);
  274|  12.2k|                break;
  275|       |
  276|  6.43k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 6.43k, False: 731k]
  ------------------
  277|  6.43k|                startOp("ConstXmlLang");
  278|  6.43k|                xmlTextReaderConstXmlLang(reader);
  279|  6.43k|                oomReport = -1;
  280|  6.43k|                break;
  281|       |
  282|  6.33k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 6.33k, False: 731k]
  ------------------
  283|  6.33k|                startOp("ConstValue");
  284|  6.33k|                xmlTextReaderConstValue(reader);
  285|  6.33k|                break;
  286|       |
  287|  7.22k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 7.22k, False: 730k]
  ------------------
  288|  7.22k|                xmlChar *result;
  289|       |
  290|  7.22k|                startOp("BaseUri");
  291|  7.22k|                result = xmlTextReaderBaseUri(reader);
  292|  7.22k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.22k|    do { \
  |  |  156|  7.22k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.48k, False: 4.74k]
  |  |  ------------------
  |  |  157|  2.48k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.48k|            xmlFree(str); \
  |  |  159|  2.48k|        } \
  |  |  160|  7.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.22k]
  |  |  ------------------
  ------------------
  293|  7.22k|                break;
  294|  51.1k|            }
  295|       |
  296|  5.41k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.41k, False: 732k]
  ------------------
  297|  5.41k|                xmlChar *result;
  298|       |
  299|  5.41k|                startOp("LocalName");
  300|  5.41k|                result = xmlTextReaderLocalName(reader);
  301|  5.41k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.41k|    do { \
  |  |  156|  5.41k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.43k, False: 1.98k]
  |  |  ------------------
  |  |  157|  3.43k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.43k|            xmlFree(str); \
  |  |  159|  3.43k|        } \
  |  |  160|  5.41k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.41k]
  |  |  ------------------
  ------------------
  302|  5.41k|                break;
  303|  51.1k|            }
  304|       |
  305|  5.98k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.98k, False: 731k]
  ------------------
  306|  5.98k|                xmlChar *result;
  307|       |
  308|  5.98k|                startOp("Name");
  309|  5.98k|                result = xmlTextReaderName(reader);
  310|  5.98k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.98k|    do { \
  |  |  156|  5.98k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.91k, False: 2.07k]
  |  |  ------------------
  |  |  157|  3.91k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.91k|            xmlFree(str); \
  |  |  159|  3.91k|        } \
  |  |  160|  5.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.98k]
  |  |  ------------------
  ------------------
  311|  5.98k|                break;
  312|  51.1k|            }
  313|       |
  314|  3.89k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.89k, False: 733k]
  ------------------
  315|  3.89k|                xmlChar *result;
  316|       |
  317|  3.89k|                startOp("NamespaceUri");
  318|  3.89k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.89k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.89k|    do { \
  |  |  156|  3.89k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 577, False: 3.31k]
  |  |  ------------------
  |  |  157|    577|            totalStringSize += strlen((char *) str); \
  |  |  158|    577|            xmlFree(str); \
  |  |  159|    577|        } \
  |  |  160|  3.89k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.89k]
  |  |  ------------------
  ------------------
  320|  3.89k|                break;
  321|  51.1k|            }
  322|       |
  323|  4.59k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.59k, False: 733k]
  ------------------
  324|  4.59k|                xmlChar *result;
  325|       |
  326|  4.59k|                startOp("Prefix");
  327|  4.59k|                result = xmlTextReaderPrefix(reader);
  328|  4.59k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.59k|    do { \
  |  |  156|  4.59k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 769, False: 3.83k]
  |  |  ------------------
  |  |  157|    769|            totalStringSize += strlen((char *) str); \
  |  |  158|    769|            xmlFree(str); \
  |  |  159|    769|        } \
  |  |  160|  4.59k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.59k]
  |  |  ------------------
  ------------------
  329|  4.59k|                break;
  330|  51.1k|            }
  331|       |
  332|  3.31k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.31k, False: 734k]
  ------------------
  333|  3.31k|                xmlChar *result;
  334|       |
  335|  3.31k|                startOp("XmlLang");
  336|  3.31k|                result = xmlTextReaderXmlLang(reader);
  337|  3.31k|                oomReport = -1;
  338|  3.31k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.31k|    do { \
  |  |  156|  3.31k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 231, False: 3.08k]
  |  |  ------------------
  |  |  157|    231|            totalStringSize += strlen((char *) str); \
  |  |  158|    231|            xmlFree(str); \
  |  |  159|    231|        } \
  |  |  160|  3.31k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.31k]
  |  |  ------------------
  ------------------
  339|  3.31k|                break;
  340|  51.1k|            }
  341|       |
  342|  9.26k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.26k, False: 728k]
  ------------------
  343|  9.26k|                xmlChar *result;
  344|       |
  345|  9.26k|                startOp("Value");
  346|  9.26k|                result = xmlTextReaderValue(reader);
  347|  9.26k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.26k|    do { \
  |  |  156|  9.26k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.69k, False: 6.57k]
  |  |  ------------------
  |  |  157|  2.69k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.69k|            xmlFree(str); \
  |  |  159|  2.69k|        } \
  |  |  160|  9.26k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.26k]
  |  |  ------------------
  ------------------
  348|  9.26k|                break;
  349|  51.1k|            }
  350|       |
  351|  1.55k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.55k, False: 736k]
  ------------------
  352|  1.55k|                startOp("Close");
  353|  1.55k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 577, False: 981]
  ------------------
  354|    577|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.55k|                xmlTextReaderClose(reader);
  356|  1.55k|                break;
  357|       |
  358|  7.60k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 7.60k, False: 730k]
  ------------------
  359|  7.60k|                xmlChar *result;
  360|  7.60k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.60k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.51k, False: 88]
  |  |  ------------------
  ------------------
  361|       |
  362|  7.60k|                startOp("GetAttributeNo");
  363|  7.60k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  7.60k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.60k|    do { \
  |  |  156|  7.60k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 592, False: 7.01k]
  |  |  ------------------
  |  |  157|    592|            totalStringSize += strlen((char *) str); \
  |  |  158|    592|            xmlFree(str); \
  |  |  159|    592|        } \
  |  |  160|  7.60k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.60k]
  |  |  ------------------
  ------------------
  365|  7.60k|                break;
  366|  51.1k|            }
  367|       |
  368|  27.9k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 27.9k, False: 709k]
  ------------------
  369|  27.9k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  27.9k|                xmlChar *result;
  371|       |
  372|  27.9k|                startOp("GetAttribute");
  373|  27.9k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  27.9k|                FREE_STRING(result);
  ------------------
  |  |  155|  27.9k|    do { \
  |  |  156|  27.9k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 884, False: 27.0k]
  |  |  ------------------
  |  |  157|    884|            totalStringSize += strlen((char *) str); \
  |  |  158|    884|            xmlFree(str); \
  |  |  159|    884|        } \
  |  |  160|  27.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  375|  27.9k|                break;
  376|  51.1k|            }
  377|       |
  378|  22.6k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 22.6k, False: 714k]
  ------------------
  379|  22.6k|                const xmlChar *localName, *namespaceUri;
  380|  22.6k|                xmlChar *result;
  381|       |
  382|  22.6k|                startOp("GetAttributeNs");
  383|  22.6k|                localName = xmlTextReaderConstLocalName(reader);
  384|  22.6k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  22.6k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  22.6k|                                                     namespaceUri);
  387|  22.6k|                FREE_STRING(result);
  ------------------
  |  |  155|  22.6k|    do { \
  |  |  156|  22.6k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 1.02k, False: 21.6k]
  |  |  ------------------
  |  |  157|  1.02k|            totalStringSize += strlen((char *) str); \
  |  |  158|  1.02k|            xmlFree(str); \
  |  |  159|  1.02k|        } \
  |  |  160|  22.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 22.6k]
  |  |  ------------------
  ------------------
  388|  22.6k|                break;
  389|  51.1k|            }
  390|       |
  391|  3.45k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 3.45k, False: 734k]
  ------------------
  392|  3.45k|                startOp("GetRemainder");
  393|  3.45k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 2.00k, False: 1.44k]
  ------------------
  394|  2.00k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  3.45k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  3.45k|                break;
  397|       |
  398|  7.71k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 7.71k, False: 729k]
  ------------------
  399|  7.71k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  7.71k|                xmlChar *result;
  401|       |
  402|  7.71k|                startOp("LookupNamespace");
  403|  7.71k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  7.71k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.71k|    do { \
  |  |  156|  7.71k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 681, False: 7.03k]
  |  |  ------------------
  |  |  157|    681|            totalStringSize += strlen((char *) str); \
  |  |  158|    681|            xmlFree(str); \
  |  |  159|    681|        } \
  |  |  160|  7.71k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.71k]
  |  |  ------------------
  ------------------
  405|  7.71k|                break;
  406|  51.1k|            }
  407|       |
  408|  7.78k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.78k, False: 729k]
  ------------------
  409|  7.78k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.78k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.68k, False: 98]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.78k|                startOp("MoveToAttributeNo");
  412|  7.78k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.78k|                break;
  414|  51.1k|            }
  415|       |
  416|  12.7k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.7k, False: 724k]
  ------------------
  417|  12.7k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  12.7k|                startOp("MoveToAttribute");
  420|  12.7k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  12.7k|                break;
  422|  51.1k|            }
  423|       |
  424|  10.0k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 10.0k, False: 727k]
  ------------------
  425|  10.0k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  10.0k|                startOp("MoveToAttributeNs");
  428|  10.0k|                localName = xmlTextReaderConstLocalName(reader);
  429|  10.0k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  10.0k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  10.0k|                                               namespaceUri);
  432|  10.0k|                break;
  433|  51.1k|            }
  434|       |
  435|  13.8k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 13.8k, False: 723k]
  ------------------
  436|  13.8k|                startOp("MoveToFirstAttribute");
  437|  13.8k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  13.8k|                break;
  439|       |
  440|  6.73k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 6.73k, False: 730k]
  ------------------
  441|  6.73k|                startOp("MoveToNextAttribute");
  442|  6.73k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  6.73k|                break;
  444|       |
  445|  5.03k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 5.03k, False: 732k]
  ------------------
  446|  5.03k|                startOp("MoveToElement");
  447|  5.03k|                xmlTextReaderMoveToElement(reader);
  448|  5.03k|                break;
  449|       |
  450|  2.02k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.02k, False: 735k]
  ------------------
  451|  2.02k|                startOp("Normalization");
  452|  2.02k|                xmlTextReaderNormalization(reader);
  453|  2.02k|                break;
  454|       |
  455|  3.41k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.41k, False: 734k]
  ------------------
  456|  3.41k|                startOp("ConstEncoding");
  457|  3.41k|                xmlTextReaderConstEncoding(reader);
  458|  3.41k|                break;
  459|       |
  460|  7.82k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.82k, False: 729k]
  ------------------
  461|  7.82k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.82k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.64k, False: 181]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.82k|                startOp("GetParserProp");
  464|  7.82k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.82k|                break;
  466|  51.1k|            }
  467|       |
  468|  13.3k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 13.3k, False: 724k]
  ------------------
  469|  13.3k|                startOp("CurrentNode");
  470|  13.3k|                xmlTextReaderCurrentNode(reader);
  471|  13.3k|                break;
  472|       |
  473|  5.59k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.59k, False: 732k]
  ------------------
  474|  5.59k|                startOp("GetParserLineNumber");
  475|  5.59k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.59k|                break;
  477|       |
  478|  9.05k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 9.05k, False: 728k]
  ------------------
  479|  9.05k|                startOp("GetParserColumnNumber");
  480|  9.05k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  9.05k|                break;
  482|       |
  483|  8.60k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 8.60k, False: 729k]
  ------------------
  484|  8.60k|                startOp("Preserve");
  485|  8.60k|                xmlTextReaderPreserve(reader);
  486|  8.60k|                break;
  487|       |
  488|  6.79k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 6.79k, False: 730k]
  ------------------
  489|  6.79k|                xmlDocPtr result;
  490|       |
  491|  6.79k|                startOp("CurrentDoc");
  492|  6.79k|                result = xmlTextReaderCurrentDoc(reader);
  493|  6.79k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.86k, False: 3.92k]
  ------------------
  494|  2.86k|                    doc = result;
  495|  6.79k|                break;
  496|  51.1k|            }
  497|       |
  498|  7.85k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 7.85k, False: 729k]
  ------------------
  499|  7.85k|                startOp("Expand");
  500|  7.85k|                xmlTextReaderExpand(reader);
  501|  7.85k|                break;
  502|       |
  503|  18.6k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 18.6k, False: 719k]
  ------------------
  504|  18.6k|                startOp("Next");
  505|  18.6k|                xmlTextReaderNext(reader);
  506|  18.6k|                break;
  507|       |
  508|  7.48k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.48k, False: 730k]
  ------------------
  509|  7.48k|                startOp("NextSibling");
  510|  7.48k|                xmlTextReaderNextSibling(reader);
  511|  7.48k|                break;
  512|       |
  513|  3.43k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.43k, False: 734k]
  ------------------
  514|  3.43k|                startOp("IsValid");
  515|  3.43k|                xmlTextReaderIsValid(reader);
  516|  3.43k|                break;
  517|       |
  518|  3.96k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 3.96k, False: 733k]
  ------------------
  519|  3.96k|                startOp("ConstXmlVersion");
  520|  3.96k|                xmlTextReaderConstXmlVersion(reader);
  521|  3.96k|                break;
  522|       |
  523|  3.98k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 3.98k, False: 733k]
  ------------------
  524|  3.98k|                startOp("Standalone");
  525|  3.98k|                xmlTextReaderStandalone(reader);
  526|  3.98k|                break;
  527|       |
  528|  6.17k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 6.17k, False: 731k]
  ------------------
  529|  6.17k|                startOp("ByteConsumed");
  530|  6.17k|                xmlTextReaderByteConsumed(reader);
  531|  6.17k|                oomReport = -1;
  532|  6.17k|                break;
  533|   737k|        }
  534|       |
  535|   737k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.45k, False: 736k]
  ------------------
  536|  1.45k|            break;
  537|   737k|    }
  538|       |
  539|  43.1k|    error = xmlTextReaderGetLastError(reader);
  540|  43.1k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 10.0k, False: 33.1k]
  ------------------
  541|  10.0k|        oomReport = 1;
  542|  43.1k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  43.1k|    xmlFreeTextReader(reader);
  545|       |
  546|  43.1k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.68k, False: 39.5k]
  ------------------
  547|  3.68k|        xmlFreeDoc(doc);
  548|       |
  549|  43.3k|exit:
  550|  43.3k|    xmlFuzzInjectFailure(0);
  551|  43.3k|    xmlFuzzDataCleanup();
  552|  43.3k|    xmlResetLastError();
  553|  43.3k|    return(0);
  554|  43.1k|}
reader.c:startOp:
   83|   737k|startOp(const char *name) {
   84|   737k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   737k|}

xmlInitGlobalsInternal:
  357|      2|void xmlInitGlobalsInternal(void) {
  358|      2|    xmlInitMutex(&xmlThrDefMutex);
  359|       |
  360|      2|#ifdef HAVE_POSIX_THREADS
  361|      2|    pthread_key_create(&globalkey, xmlFreeGlobalState);
  362|       |#elif defined(HAVE_WIN32_THREADS)
  363|       |#ifndef USE_TLS
  364|       |    if (globalkey == TLS_OUT_OF_INDEXES)
  365|       |        globalkey = TlsAlloc();
  366|       |#endif
  367|       |#else /* no thread support */
  368|       |    xmlInitGlobalState(&globalState);
  369|       |#endif
  370|      2|}
__xmlDoValidityCheckingDefaultValue:
  633|  54.2k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  54.2k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  54.2k|}
__xmlGetWarningsDefaultValue:
  638|   770k|__xmlGetWarningsDefaultValue(void) {
  639|   770k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   770k|}
__xmlKeepBlanksDefaultValue:
  643|  54.2k|__xmlKeepBlanksDefaultValue(void) {
  644|  54.2k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  54.2k|}
__xmlLoadExtDtdDefaultValue:
  653|  54.2k|__xmlLoadExtDtdDefaultValue(void) {
  654|  54.2k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  54.2k|}
__xmlPedanticParserDefaultValue:
  658|  54.2k|__xmlPedanticParserDefaultValue(void) {
  659|  54.2k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  54.2k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  54.2k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  54.2k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  54.2k|}
__xmlTreeIndentString:
  674|  43.2k|__xmlTreeIndentString(void) {
  675|  43.2k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  43.2k|}
__xmlSaveNoEmptyTags:
  679|  43.2k|__xmlSaveNoEmptyTags(void) {
  680|  43.2k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  43.2k|}
__xmlStructuredError:
  695|   436k|__xmlStructuredError(void) {
  696|   436k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   436k|}
xmlGetLocalRngState:
  755|   144k|xmlGetLocalRngState(void) {
  756|   144k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   144k|}
xmlGetLastErrorInternal:
  785|   804k|xmlGetLastErrorInternal(void) {
  786|   804k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   804k|}
globals.c:xmlPosixStrdup:
  200|   667k|xmlPosixStrdup(const char *cur) {
  201|   667k|    return((char*) xmlCharStrdup(cur));
  202|   667k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.51M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.51M|    xmlGlobalState *gs;
  527|       |
  528|  2.51M|    (void) allowFailure;
  529|       |
  530|  2.51M|    xmlInitParser();
  531|       |
  532|       |#ifdef USE_TLS
  533|       |    gs = &globalState;
  534|       |    if (gs->initialized == 0)
  535|       |        xmlInitGlobalState(gs);
  536|       |#elif defined(HAVE_POSIX_THREADS)
  537|       |    gs = (xmlGlobalState *) pthread_getspecific(globalkey);
  538|  2.51M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.51M]
  ------------------
  539|      1|        gs = xmlNewGlobalState(allowFailure);
  540|       |#elif defined(HAVE_WIN32_THREADS)
  541|       |    gs = (xmlGlobalState *) TlsGetValue(globalkey);
  542|       |    if (gs == NULL)
  543|       |        gs = xmlNewGlobalState(allowFailure);
  544|       |#else
  545|       |    gs = NULL;
  546|       |#endif
  547|       |
  548|  2.51M|    return(gs);
  549|  2.51M|}
globals.c:xmlNewGlobalState:
  497|      1|{
  498|      1|    xmlGlobalState *gs;
  499|       |
  500|       |    /*
  501|       |     * We use malloc/free to allow accessing globals before setting
  502|       |     * custom memory allocators.
  503|       |     */
  504|      1|    gs = malloc(sizeof(xmlGlobalState));
  505|      1|    if (gs == NULL) {
  ------------------
  |  Branch (505:9): [True: 0, False: 1]
  ------------------
  506|      0|        if (allowFailure)
  ------------------
  |  Branch (506:13): [True: 0, False: 0]
  ------------------
  507|      0|            return(NULL);
  508|       |
  509|       |        /*
  510|       |         * If an application didn't call xmlCheckThreadLocalStorage to make
  511|       |         * sure that global state could be allocated, it's too late to
  512|       |         * handle the error.
  513|       |         */
  514|      0|        xmlAbort("libxml2: Failed to allocate globals for thread\n"
  515|      0|                 "libxml2: See xmlCheckThreadLocalStorage\n");
  516|      0|    }
  517|       |
  518|      1|    memset(gs, 0, sizeof(xmlGlobalState));
  519|      1|    xmlInitGlobalState(gs);
  520|      1|    return (gs);
  521|      1|}
globals.c:xmlInitGlobalState:
  561|      1|xmlInitGlobalState(xmlGlobalStatePtr gs) {
  562|      1|    gs->localRngState[0] = xmlGlobalRandom();
  563|      1|    gs->localRngState[1] = xmlGlobalRandom();
  564|       |
  565|      1|    memset(&gs->lastError, 0, sizeof(xmlError));
  566|       |
  567|       |#ifdef LIBXML_THREAD_ALLOC_ENABLED
  568|       |    /* XML_GLOBALS_ALLOC */
  569|       |    gs->free = free;
  570|       |    gs->malloc = malloc;
  571|       |    gs->mallocAtomic = malloc;
  572|       |    gs->realloc = realloc;
  573|       |    gs->memStrdup = xmlPosixStrdup;
  574|       |#endif
  575|       |
  576|      1|    xmlMutexLock(&xmlThrDefMutex);
  577|       |
  578|       |    /* XML_GLOBALS_PARSER */
  579|      1|    gs->doValidityCheckingDefaultValue =
  580|      1|         xmlDoValidityCheckingDefaultValueThrDef;
  581|      1|    gs->getWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
  582|      1|    gs->keepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
  583|      1|    gs->loadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
  584|      1|    gs->pedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
  585|      1|    gs->substituteEntitiesDefaultValue =
  586|      1|        xmlSubstituteEntitiesDefaultValueThrDef;
  587|      1|#ifdef LIBXML_OUTPUT_ENABLED
  588|      1|    gs->indentTreeOutput = xmlIndentTreeOutputThrDef;
  589|      1|    gs->treeIndentString = xmlTreeIndentStringThrDef;
  590|      1|    gs->saveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
  591|      1|#endif
  592|       |
  593|       |    /* XML_GLOBALS_ERROR */
  594|      1|    gs->genericError = xmlGenericErrorThrDef;
  595|      1|    gs->structuredError = xmlStructuredErrorThrDef;
  596|      1|    gs->genericErrorContext = xmlGenericErrorContextThrDef;
  597|      1|    gs->structuredErrorContext = xmlStructuredErrorContextThrDef;
  598|       |
  599|       |    /* XML_GLOBALS_TREE */
  600|      1|    gs->registerNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
  601|      1|    gs->deregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
  602|       |
  603|       |    /* XML_GLOBALS_IO */
  604|      1|    gs->parserInputBufferCreateFilenameValue =
  605|      1|        xmlParserInputBufferCreateFilenameValueThrDef;
  606|      1|    gs->outputBufferCreateFilenameValue =
  607|      1|        xmlOutputBufferCreateFilenameValueThrDef;
  608|       |
  609|      1|    xmlMutexUnlock(&xmlThrDefMutex);
  610|       |
  611|       |#ifdef USE_TLS
  612|       |    gs->initialized = 1;
  613|       |#endif
  614|       |
  615|      1|#ifdef HAVE_POSIX_THREADS
  616|      1|    pthread_setspecific(globalkey, gs);
  617|       |#elif defined HAVE_WIN32_THREADS
  618|       |#ifndef USE_TLS
  619|       |    TlsSetValue(globalkey, gs);
  620|       |#endif
  621|       |#ifdef USE_WAIT_DTOR
  622|       |    xmlRegisterGlobalStateDtor(gs);
  623|       |#endif
  624|       |#endif
  625|      1|}

xmlHashCreate:
  158|  90.0k|xmlHashCreate(int size) {
  159|  90.0k|    xmlHashTablePtr hash;
  160|       |
  161|  90.0k|    xmlInitParser();
  162|       |
  163|  90.0k|    hash = xmlMalloc(sizeof(*hash));
  164|  90.0k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 49, False: 89.9k]
  ------------------
  165|     49|        return(NULL);
  166|  89.9k|    hash->dict = NULL;
  167|  89.9k|    hash->size = 0;
  168|  89.9k|    hash->table = NULL;
  169|  89.9k|    hash->nbElems = 0;
  170|  89.9k|    hash->randomSeed = xmlRandom();
  171|  89.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  89.9k|    hash->randomSeed = 0;
  173|  89.9k|#endif
  174|       |
  175|       |    /*
  176|       |     * Unless a larger size is passed, the backing table is created
  177|       |     * lazily with MIN_HASH_SIZE capacity. In practice, there are many
  178|       |     * hash tables which are never filled.
  179|       |     */
  180|  89.9k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  89.9k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 7.36k, False: 82.6k]
  ------------------
  181|  7.36k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  7.36k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  7.48k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|    126|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 126, False: 7.36k]
  |  Branch (183:47): [True: 126, False: 0]
  ------------------
  184|    126|            newSize *= 2;
  185|       |
  186|  7.36k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 1, False: 7.36k]
  ------------------
  187|      1|            xmlFree(hash);
  188|      1|            return(NULL);
  189|      1|        }
  190|  7.36k|    }
  191|       |
  192|  89.9k|    return(hash);
  193|  89.9k|}
xmlHashCreateDict:
  205|  30.9k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  30.9k|    xmlHashTablePtr hash;
  207|       |
  208|  30.9k|    hash = xmlHashCreate(size);
  209|  30.9k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 30.9k, False: 24]
  ------------------
  210|  30.9k|        hash->dict = dict;
  211|  30.9k|        xmlDictReference(dict);
  212|  30.9k|    }
  213|  30.9k|    return(hash);
  214|  30.9k|}
xmlHashFree:
  224|   113k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|   113k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 23.1k, False: 89.9k]
  ------------------
  226|  23.1k|        return;
  227|       |
  228|  89.9k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 89.5k, False: 403]
  ------------------
  229|  89.5k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  89.5k|        const xmlHashEntry *entry;
  231|       |
  232|   958k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 868k, False: 89.5k]
  ------------------
  233|   868k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 683k, False: 185k]
  ------------------
  234|   683k|                continue;
  235|   185k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 161k, False: 23.8k]
  |  Branch (235:38): [True: 161k, False: 0]
  ------------------
  236|   161k|                dealloc(entry->payload, entry->key);
  237|   185k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 110k, False: 75.3k]
  ------------------
  238|   110k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 110k, False: 0]
  ------------------
  239|   110k|                    xmlFree(entry->key);
  240|   110k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 6.96k, False: 103k]
  ------------------
  241|  6.96k|                    xmlFree(entry->key2);
  242|   110k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 19.3k, False: 91.0k]
  ------------------
  243|  19.3k|                    xmlFree(entry->key3);
  244|   110k|            }
  245|   185k|        }
  246|       |
  247|  89.5k|        xmlFree(hash->table);
  248|  89.5k|    }
  249|       |
  250|  89.9k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 21.0k, False: 68.9k]
  ------------------
  251|  21.0k|        xmlDictFree(hash->dict);
  252|       |
  253|  89.9k|    xmlFree(hash);
  254|  89.9k|}
xmlHashDefaultDeallocator:
  592|  62.8k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  62.8k|    xmlFree(entry);
  594|  62.8k|}
xmlHashAdd:
  610|   149k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   149k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   149k|}
xmlHashAdd2:
  629|  79.8k|                 const xmlChar *key2, void *payload) {
  630|  79.8k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  79.8k|}
xmlHashAdd3:
  650|  97.4k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  97.4k|}
xmlHashAddEntry:
  669|  62.7k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  62.7k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  62.7k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 62.7k]
  ------------------
  673|      0|        res = -1;
  674|  62.7k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 62.7k, False: 12]
  ------------------
  675|  62.7k|        res = 0;
  676|       |
  677|  62.7k|    return(res);
  678|  62.7k|}
xmlHashUpdateEntry:
  742|    568|                   void *payload, xmlHashDeallocator dealloc) {
  743|    568|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    568|                                    dealloc, 1);
  745|       |
  746|    568|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 63, False: 505]
  ------------------
  747|     63|        res = 0;
  748|       |
  749|    568|    return(res);
  750|    568|}
xmlHashUpdateEntry2:
  767|  4.49k|                   xmlHashDeallocator dealloc) {
  768|  4.49k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  4.49k|                                    dealloc, 1);
  770|       |
  771|  4.49k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 3.74k, False: 752]
  ------------------
  772|  3.74k|        res = 0;
  773|       |
  774|  4.49k|    return(res);
  775|  4.49k|}
xmlHashLookup:
  811|  3.22M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  3.22M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  3.22M|}
xmlHashLookup2:
  825|  1.14M|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|  1.14M|}
xmlHashQLookup2:
  856|  35.0k|                const xmlChar *name2) {
  857|  35.0k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  35.0k|}
xmlHashLookup3:
  871|  5.07M|               const xmlChar *key2, const xmlChar *key3) {
  872|  5.07M|    const xmlHashEntry *entry;
  873|  5.07M|    unsigned hashValue;
  874|  5.07M|    int found;
  875|       |
  876|  5.07M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 12.2k, False: 5.06M]
  |  Branch (876:27): [True: 56.4k, False: 5.00M]
  |  Branch (876:48): [True: 9, False: 5.00M]
  ------------------
  877|  68.7k|        return(NULL);
  878|  5.00M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  5.00M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  5.00M|    if (found)
  ------------------
  |  Branch (880:9): [True: 3.88M, False: 1.12M]
  ------------------
  881|  3.88M|        return(entry->payload);
  882|  1.12M|    return(NULL);
  883|  5.00M|}
xmlHashQLookup3:
  902|  35.0k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  35.0k|    const xmlHashEntry *entry;
  904|  35.0k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  35.0k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 35.0k]
  |  Branch (906:27): [True: 0, False: 35.0k]
  |  Branch (906:48): [True: 0, False: 35.0k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  35.0k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  35.0k|                                  name2, prefix3, name3);
  911|  35.0k|    mask = hash->size - 1;
  912|  35.0k|    pos = hashValue & mask;
  913|  35.0k|    entry = &hash->table[pos];
  914|       |
  915|  35.0k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 9.17k, False: 25.8k]
  ------------------
  916|  9.17k|        displ = 0;
  917|  9.17k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  9.17k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  9.97k|        do {
  920|  9.97k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 6.07k, False: 3.89k]
  ------------------
  921|  6.07k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 6.07k, False: 0]
  ------------------
  922|  6.07k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 6.07k, False: 0]
  ------------------
  923|  6.07k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 6.07k, False: 0]
  ------------------
  924|  6.07k|                return(entry->payload);
  925|       |
  926|  3.89k|            displ++;
  927|  3.89k|            pos++;
  928|  3.89k|            entry++;
  929|  3.89k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 265, False: 3.63k]
  ------------------
  930|    265|                entry = hash->table;
  931|  3.89k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 1.48k, False: 2.41k]
  ------------------
  932|  1.48k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 796, False: 691]
  ------------------
  933|  9.17k|    }
  934|       |
  935|  28.9k|    return(NULL);
  936|  35.0k|}
xmlHashScan:
  959|  8.45k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  8.45k|    stubData sdata;
  961|  8.45k|    sdata.data = data;
  962|  8.45k|    sdata.scan = scan;
  963|  8.45k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  8.45k|}
xmlHashScanFull:
  974|  12.2k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  12.2k|    const xmlHashEntry *entry, *end;
  976|  12.2k|    xmlHashEntry old;
  977|  12.2k|    unsigned i;
  978|       |
  979|  12.2k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 476, False: 11.7k]
  |  Branch (979:27): [True: 0, False: 11.7k]
  |  Branch (979:48): [True: 0, False: 11.7k]
  ------------------
  980|    476|        return;
  981|       |
  982|       |    /*
  983|       |     * We must handle the case that a scanned entry is removed when executing
  984|       |     * the callback (xmlCleanSpecialAttr and possibly other places).
  985|       |     *
  986|       |     * Find the start of a probe sequence to avoid scanning entries twice if
  987|       |     * a deletion happens.
  988|       |     */
  989|  11.7k|    entry = hash->table;
  990|  11.7k|    end = &hash->table[hash->size];
  991|  15.5k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.77k, False: 11.7k]
  ------------------
  992|  3.77k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.77k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.77k|    }
  995|       |
  996|   181k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 169k, False: 11.7k]
  ------------------
  997|   169k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 45.1k, False: 124k]
  |  Branch (997:40): [True: 45.1k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  45.8k|            do {
 1002|  45.8k|                old = *entry;
 1003|  45.8k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  45.8k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 44.6k, False: 1.15k]
  ------------------
 1005|  44.6k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 44.6k, False: 0]
  ------------------
 1006|  44.6k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 586, False: 44.0k]
  ------------------
 1007|  44.0k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 58, False: 44.0k]
  ------------------
 1008|  44.0k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 44.0k]
  ------------------
 1009|  45.1k|        }
 1010|   169k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 11.7k, False: 157k]
  ------------------
 1011|  11.7k|            entry = hash->table;
 1012|   169k|    }
 1013|  11.7k|}
xmlHashScan3:
 1030|  1.23k|             xmlHashScanner scan, void *data) {
 1031|  1.23k|    stubData sdata;
 1032|  1.23k|    sdata.data = data;
 1033|  1.23k|    sdata.scan = scan;
 1034|  1.23k|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|  1.23k|}
xmlHashScanFull3:
 1052|  1.23k|                 xmlHashScannerFull scan, void *data) {
 1053|  1.23k|    const xmlHashEntry *entry, *end;
 1054|  1.23k|    xmlHashEntry old;
 1055|  1.23k|    unsigned i;
 1056|       |
 1057|  1.23k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 565, False: 670]
  |  Branch (1057:27): [True: 0, False: 670]
  |  Branch (1057:48): [True: 0, False: 670]
  ------------------
 1058|    565|        return;
 1059|       |
 1060|       |    /*
 1061|       |     * We must handle the case that a scanned entry is removed when executing
 1062|       |     * the callback (xmlCleanSpecialAttr and possibly other places).
 1063|       |     *
 1064|       |     * Find the start of a probe sequence to avoid scanning entries twice if
 1065|       |     * a deletion happens.
 1066|       |     */
 1067|    670|    entry = hash->table;
 1068|    670|    end = &hash->table[hash->size];
 1069|  1.29k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 628, False: 670]
  ------------------
 1070|    628|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 628]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    628|    }
 1073|       |
 1074|   279k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 278k, False: 670]
  ------------------
 1075|   278k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 145k, False: 133k]
  |  Branch (1075:40): [True: 145k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   145k|            do {
 1080|   145k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 145k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   145k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 145k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   145k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 145k, False: 0]
  |  Branch (1083:40): [True: 144k, False: 106]
  ------------------
 1084|   144k|                    break;
 1085|    106|                old = *entry;
 1086|    106|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|    106|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 106, False: 0]
  ------------------
 1088|    106|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 106, False: 0]
  ------------------
 1089|    106|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 106]
  ------------------
 1090|    106|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 106]
  ------------------
 1091|    106|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 106]
  ------------------
 1092|   145k|        }
 1093|   278k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 670, False: 278k]
  ------------------
 1094|    670|            entry = hash->table;
 1095|   278k|    }
 1096|    670|}
xmlHashCopySafe:
 1111|  14.2k|                xmlHashDeallocator deallocFunc) {
 1112|  14.2k|    const xmlHashEntry *entry, *end;
 1113|  14.2k|    xmlHashTablePtr ret;
 1114|       |
 1115|  14.2k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 14.2k]
  |  Branch (1115:27): [True: 0, False: 14.2k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  14.2k|    ret = xmlHashCreate(hash->size);
 1119|  14.2k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 20, False: 14.2k]
  ------------------
 1120|     20|        return(NULL);
 1121|       |
 1122|  14.2k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 14.2k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  14.2k|    end = &hash->table[hash->size];
 1126|       |
 1127|   131k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 117k, False: 13.9k]
  ------------------
 1128|   117k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 24.4k, False: 93.5k]
  ------------------
 1129|  24.4k|            void *copy;
 1130|       |
 1131|  24.4k|            copy = copyFunc(entry->payload, entry->key);
 1132|  24.4k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 233, False: 24.1k]
  ------------------
 1133|    233|                goto error;
 1134|  24.1k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 95, False: 24.0k]
  ------------------
 1135|  24.1k|                            copy) <= 0) {
 1136|     95|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 95, False: 0]
  ------------------
 1137|     95|                    deallocFunc(copy, entry->key);
 1138|     95|                goto error;
 1139|     95|            }
 1140|  24.1k|        }
 1141|   117k|    }
 1142|       |
 1143|  13.9k|    return(ret);
 1144|       |
 1145|    328|error:
 1146|    328|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  14.2k|}
xmlHashSize:
 1173|  3.78k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.78k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.78k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.78k|    return(hash->nbElems);
 1177|  3.78k|}
xmlHashRemoveEntry:
 1189|  2.89k|                       xmlHashDeallocator dealloc) {
 1190|  2.89k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  2.89k|}
xmlHashRemoveEntry2:
 1206|  1.98k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  1.98k|}
xmlHashRemoveEntry3:
 1226|  4.87k|                    xmlHashDeallocator dealloc) {
 1227|  4.87k|    xmlHashEntry *entry, *cur, *next;
 1228|  4.87k|    unsigned hashValue, mask, pos, nextpos;
 1229|  4.87k|    int found;
 1230|       |
 1231|  4.87k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 4.87k]
  |  Branch (1231:27): [True: 0, False: 4.87k]
  |  Branch (1231:48): [True: 0, False: 4.87k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  4.87k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  4.87k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  4.87k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 4.87k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  4.87k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 2.89k, False: 1.98k]
  |  Branch (1239:30): [True: 2.89k, False: 0]
  ------------------
 1240|  2.89k|        dealloc(entry->payload, entry->key);
 1241|  4.87k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 2.97k, False: 1.90k]
  ------------------
 1242|  2.97k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 2.97k, False: 0]
  ------------------
 1243|  2.97k|            xmlFree(entry->key);
 1244|  2.97k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 4, False: 2.97k]
  ------------------
 1245|      4|            xmlFree(entry->key2);
 1246|  2.97k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 2.97k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  2.97k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  4.87k|    mask = hash->size - 1;
 1255|  4.87k|    pos = entry - hash->table;
 1256|  4.87k|    cur = entry;
 1257|       |
 1258|  9.64k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 9.64k, Folded]
  ------------------
 1259|  9.64k|        nextpos = pos + 1;
 1260|  9.64k|        next = cur + 1;
 1261|  9.64k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 971, False: 8.66k]
  ------------------
 1262|    971|            next = hash->table;
 1263|       |
 1264|  9.64k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 3.49k, False: 6.14k]
  ------------------
 1265|  6.14k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.38k, False: 4.76k]
  ------------------
 1266|  4.87k|            break;
 1267|       |
 1268|  4.76k|        cur = next;
 1269|  4.76k|        pos = nextpos;
 1270|  4.76k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  4.87k|    next = entry + 1;
 1276|       |
 1277|  4.87k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 451, False: 4.42k]
  ------------------
 1278|    451|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    451|        memmove(entry, next, (char *) end - (char *) next);
 1281|    451|        entry = hash->table;
 1282|    451|        end[-1] = *entry;
 1283|    451|        next = entry + 1;
 1284|    451|    }
 1285|       |
 1286|  4.87k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  4.87k|    cur->hashValue = 0;
 1292|       |
 1293|  4.87k|    hash->nbElems--;
 1294|       |
 1295|  4.87k|    return(0);
 1296|  4.87k|}
hash.c:xmlHashGrow:
  345|  92.2k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  92.2k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  92.2k|    xmlHashEntry *table;
  348|  92.2k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  92.2k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 92.2k]
  ------------------
  352|      0|        return(-1);
  353|  92.2k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  92.2k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 47, False: 92.2k]
  ------------------
  355|     47|        return(-1);
  356|  92.2k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  92.2k|    oldsize = hash->size;
  359|  92.2k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 89.5k, False: 2.63k]
  ------------------
  360|  89.5k|        goto done;
  361|       |
  362|  2.63k|    oldend = &hash->table[oldsize];
  363|  2.63k|    end = &table[size];
  364|       |
  365|       |    /*
  366|       |     * Robin Hood sorting order is maintained if we
  367|       |     *
  368|       |     * - compute hash indices with modulo
  369|       |     * - resize by an integer factor
  370|       |     * - start to copy from the beginning of a probe sequence
  371|       |     */
  372|  2.63k|    oldentry = hash->table;
  373|  16.6k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 14.0k, False: 2.63k]
  ------------------
  374|  14.0k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 14.0k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  14.0k|    }
  377|       |
  378|  93.9k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 91.3k, False: 2.63k]
  ------------------
  379|  91.3k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 79.9k, False: 11.4k]
  ------------------
  380|  79.9k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|   107k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 27.7k, False: 79.9k]
  ------------------
  383|  27.7k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 426, False: 27.3k]
  ------------------
  384|    426|                    entry = table;
  385|  27.7k|            }
  386|  79.9k|            *entry = *oldentry;
  387|  79.9k|        }
  388|       |
  389|  91.3k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.63k, False: 88.6k]
  ------------------
  390|  2.63k|            oldentry = hash->table;
  391|  91.3k|    }
  392|       |
  393|  2.63k|    xmlFree(hash->table);
  394|       |
  395|  92.2k|done:
  396|  92.2k|    hash->table = table;
  397|  92.2k|    hash->size = size;
  398|       |
  399|  92.2k|    return(0);
  400|  2.63k|}
hash.c:xmlHashUpdateInternal:
  417|   394k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   394k|    xmlChar *copy, *copy2, *copy3;
  419|   394k|    xmlHashEntry *entry = NULL;
  420|   394k|    size_t lengths[3] = {0, 0, 0};
  421|   394k|    unsigned hashValue, newSize;
  422|       |
  423|   394k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 394k]
  |  Branch (423:27): [True: 0, False: 394k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   394k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   394k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 82.2k, False: 312k]
  ------------------
  432|  82.2k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  82.2k|#define MIN_HASH_SIZE 8
  ------------------
  433|   312k|    } else {
  434|   312k|        int found = 0;
  435|       |
  436|   312k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   312k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 204k, False: 108k]
  ------------------
  439|   204k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.25k, False: 202k]
  ------------------
  440|  1.25k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 503, False: 751]
  ------------------
  441|    503|                    dealloc(entry->payload, entry->key);
  442|  1.25k|                entry->payload = payload;
  443|  1.25k|            }
  444|       |
  445|   204k|            return(0);
  446|   204k|        }
  447|       |
  448|   108k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|   108k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|   108k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.63k, False: 105k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.63k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.63k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.63k]
  ------------------
  451|      0|                return(-1);
  452|  2.63k|            newSize = hash->size * 2;
  453|   105k|        } else {
  454|   105k|            newSize = 0;
  455|   105k|        }
  456|   108k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   190k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 84.9k, False: 105k]
  ------------------
  462|  84.9k|        unsigned mask, displ, pos;
  463|       |
  464|  84.9k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 46, False: 84.8k]
  ------------------
  465|     46|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  84.8k|        mask = hash->size - 1;
  471|  84.8k|        displ = 0;
  472|  84.8k|        pos = hashValue & mask;
  473|  84.8k|        entry = &hash->table[pos];
  474|       |
  475|  84.8k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 1.12k, False: 83.7k]
  ------------------
  476|  1.59k|            do {
  477|  1.59k|                displ++;
  478|  1.59k|                pos++;
  479|  1.59k|                entry++;
  480|  1.59k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 99, False: 1.49k]
  ------------------
  481|     99|                    entry = hash->table;
  482|  1.59k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 920, False: 671]
  ------------------
  483|    920|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 467, False: 453]
  ------------------
  484|  1.12k|        }
  485|  84.8k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   190k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 77.2k, False: 113k]
  ------------------
  491|  77.2k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 77.2k, False: 0]
  ------------------
  492|  77.2k|            copy = (xmlChar *) key;
  493|  77.2k|        } else {
  494|      0|            copy = (xmlChar *) xmlDictLookup(hash->dict, key, -1);
  495|      0|            if (copy == NULL)
  ------------------
  |  Branch (495:17): [True: 0, False: 0]
  ------------------
  496|      0|                return(-1);
  497|      0|        }
  498|       |
  499|  77.2k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 47.9k, False: 29.2k]
  |  Branch (499:31): [True: 28.5k, False: 725]
  ------------------
  500|  76.5k|            copy2 = (xmlChar *) key2;
  501|  76.5k|        } else {
  502|    725|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    725|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 724]
  ------------------
  504|      1|                return(-1);
  505|    725|        }
  506|  77.2k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 56.2k, False: 20.9k]
  |  Branch (506:31): [True: 20.9k, False: 0]
  ------------------
  507|  77.2k|            copy3 = (xmlChar *) key3;
  508|  77.2k|        } else {
  509|      0|            copy3 = (xmlChar *) xmlDictLookup(hash->dict, key3, -1);
  510|      0|            if (copy3 == NULL)
  ------------------
  |  Branch (510:17): [True: 0, False: 0]
  ------------------
  511|      0|                return(-1);
  512|      0|        }
  513|   113k|    } else {
  514|   113k|        copy = xmlMalloc(lengths[0] + 1);
  515|   113k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 74, False: 113k]
  ------------------
  516|     74|            return(-1);
  517|   113k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|   113k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 6.97k, False: 106k]
  ------------------
  520|  6.97k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  6.97k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 6, False: 6.97k]
  ------------------
  522|      6|                xmlFree(copy);
  523|      6|                return(-1);
  524|      6|            }
  525|  6.97k|            memcpy(copy2, key2, lengths[1] + 1);
  526|   106k|        } else {
  527|   106k|            copy2 = NULL;
  528|   106k|        }
  529|       |
  530|   113k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 19.3k, False: 94.0k]
  ------------------
  531|  19.3k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  19.3k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 15, False: 19.3k]
  ------------------
  533|     15|                xmlFree(copy);
  534|     15|                xmlFree(copy2);
  535|     15|                return(-1);
  536|     15|            }
  537|  19.3k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  94.0k|        } else {
  539|  94.0k|            copy3 = NULL;
  540|  94.0k|        }
  541|   113k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   190k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 23.1k, False: 167k]
  ------------------
  547|  23.1k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  23.1k|        const xmlHashEntry *cur = entry;
  549|       |
  550|   115k|        do {
  551|   115k|            cur++;
  552|   115k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.81k, False: 112k]
  ------------------
  553|  2.81k|                cur = hash->table;
  554|   115k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 92.6k, False: 23.1k]
  ------------------
  555|       |
  556|  23.1k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.81k, False: 20.3k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.81k|            memmove(&hash->table[1], hash->table,
  562|  2.81k|                    (char *) cur - (char *) hash->table);
  563|  2.81k|            cur = end - 1;
  564|  2.81k|            hash->table[0] = *cur;
  565|  2.81k|        }
  566|       |
  567|  23.1k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  23.1k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   190k|    entry->key = copy;
  574|   190k|    entry->key2 = copy2;
  575|   190k|    entry->key3 = copy3;
  576|   190k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   190k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   190k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   190k|    hash->nbElems++;
  581|       |
  582|   190k|    return(1);
  583|   190k|}
hash.c:xmlHashValue:
   62|  5.40M|             const xmlChar *key3, size_t *lengths) {
   63|  5.40M|    unsigned h1, h2;
   64|  5.40M|    size_t i;
   65|       |
   66|  5.40M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  5.40M|    do { \
  |  |   24|  5.40M|        h1 = seed ^ 0x3b00; \
  |  |   25|  5.40M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  5.40M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  5.40M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 5.40M]
  |  |  ------------------
  ------------------
   67|       |
   68|  53.7M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 48.2M, False: 5.40M]
  ------------------
   69|  48.2M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  48.2M|    do { \
  |  |   30|  48.2M|        h1 += ch; \
  |  |   31|  48.2M|        h1 += h1 << 3; \
  |  |   32|  48.2M|        h2 += h1; \
  |  |   33|  48.2M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  48.2M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  48.2M|        h2 += h2 << 2; \
  |  |   35|  48.2M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 48.2M]
  |  |  ------------------
  ------------------
   70|  48.2M|    }
   71|  5.40M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 394k, False: 5.01M]
  ------------------
   72|   394k|        lengths[0] = i;
   73|       |
   74|  5.40M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  5.40M|    do { \
  |  |   30|  5.40M|        h1 += ch; \
  |  |   31|  5.40M|        h1 += h1 << 3; \
  |  |   32|  5.40M|        h2 += h1; \
  |  |   33|  5.40M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  5.40M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  5.40M|        h2 += h2 << 2; \
  |  |   35|  5.40M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 5.40M]
  |  |  ------------------
  ------------------
   75|       |
   76|  5.40M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 253k, False: 5.15M]
  ------------------
   77|  1.30M|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 1.04M, False: 253k]
  ------------------
   78|  1.04M|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|  1.04M|    do { \
  |  |   30|  1.04M|        h1 += ch; \
  |  |   31|  1.04M|        h1 += h1 << 3; \
  |  |   32|  1.04M|        h2 += h1; \
  |  |   33|  1.04M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.04M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.04M|        h2 += h2 << 2; \
  |  |   35|  1.04M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.04M]
  |  |  ------------------
  ------------------
   79|  1.04M|        }
   80|   253k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 74.2k, False: 178k]
  ------------------
   81|  74.2k|            lengths[1] = i;
   82|   253k|    }
   83|       |
   84|  5.40M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  5.40M|    do { \
  |  |   30|  5.40M|        h1 += ch; \
  |  |   31|  5.40M|        h1 += h1 << 3; \
  |  |   32|  5.40M|        h2 += h1; \
  |  |   33|  5.40M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  5.40M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  5.40M|        h2 += h2 << 2; \
  |  |   35|  5.40M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 5.40M]
  |  |  ------------------
  ------------------
   85|       |
   86|  5.40M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 780k, False: 4.62M]
  ------------------
   87|  2.07M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 1.29M, False: 780k]
  ------------------
   88|  1.29M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  1.29M|    do { \
  |  |   30|  1.29M|        h1 += ch; \
  |  |   31|  1.29M|        h1 += h1 << 3; \
  |  |   32|  1.29M|        h2 += h1; \
  |  |   33|  1.29M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.29M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.29M|        h2 += h2 << 2; \
  |  |   35|  1.29M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.29M]
  |  |  ------------------
  ------------------
   89|  1.29M|        }
   90|   780k|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 82.2k, False: 697k]
  ------------------
   91|  82.2k|            lengths[2] = i;
   92|   780k|    }
   93|       |
   94|  5.40M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  5.40M|    do { \
  |  |   40|  5.40M|        h1 ^= h2; \
  |  |   41|  5.40M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  5.40M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  5.40M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  5.40M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  5.40M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  5.40M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  5.40M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  5.40M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  5.40M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  5.40M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 5.40M]
  |  |  ------------------
  ------------------
   95|       |
   96|  5.40M|    return(h2);
   97|  5.40M|}
hash.c:xmlHashFindEntry:
  287|  5.32M|                 unsigned hashValue, int *pfound) {
  288|  5.32M|    xmlHashEntry *entry;
  289|  5.32M|    unsigned mask, pos, displ;
  290|  5.32M|    int found = 0;
  291|       |
  292|  5.32M|    mask = hash->size - 1;
  293|  5.32M|    pos = hashValue & mask;
  294|  5.32M|    entry = &hash->table[pos];
  295|       |
  296|  5.32M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 4.50M, False: 826k]
  ------------------
  297|       |        /*
  298|       |         * Robin hood hashing: abort if the displacement of the entry
  299|       |         * is smaller than the displacement of the key we look for.
  300|       |         * This also stops at the correct position when inserting.
  301|       |         */
  302|  4.50M|        displ = 0;
  303|  4.50M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  4.50M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  5.20M|        do {
  306|  5.20M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 4.09M, False: 1.11M]
  ------------------
  307|  4.09M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 2.15M, False: 1.94M]
  ------------------
  308|  2.15M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 1.27M, False: 872k]
  ------------------
  309|  1.27M|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 1.26M, False: 12.9k]
  ------------------
  310|  1.26M|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 1.26M, False: 829]
  ------------------
  311|  1.26M|                        found = 1;
  312|  1.26M|                        break;
  313|  1.26M|                    }
  314|  2.15M|                }
  315|  2.82M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 2.82M, False: 202]
  ------------------
  316|  2.82M|                            (const char *) key) == 0) &&
  317|  2.82M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 2.82M, False: 0]
  ------------------
  318|  2.82M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 2.82M, False: 0]
  ------------------
  319|  2.82M|                    found = 1;
  320|  2.82M|                    break;
  321|  2.82M|                }
  322|  2.82M|            }
  323|       |
  324|  1.11M|            displ++;
  325|  1.11M|            pos++;
  326|  1.11M|            entry++;
  327|  1.11M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 96.6k, False: 1.01M]
  ------------------
  328|  96.6k|                entry = hash->table;
  329|  1.11M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 847k, False: 264k]
  ------------------
  330|   847k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 705k, False: 141k]
  ------------------
  331|  4.50M|    }
  332|       |
  333|  5.32M|    *pfound = found;
  334|  5.32M|    return(entry);
  335|  5.32M|}
hash.c:xmlHashQNameValue:
  104|  35.0k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  35.0k|    unsigned h1, h2, ch;
  106|       |
  107|  35.0k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  35.0k|    do { \
  |  |   24|  35.0k|        h1 = seed ^ 0x3b00; \
  |  |   25|  35.0k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  35.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  35.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 35.0k]
  |  |  ------------------
  ------------------
  108|       |
  109|  35.0k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 7.99k, False: 27.0k]
  ------------------
  110|  25.4k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 17.4k, False: 7.99k]
  ------------------
  111|  17.4k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  17.4k|    do { \
  |  |   30|  17.4k|        h1 += ch; \
  |  |   31|  17.4k|        h1 += h1 << 3; \
  |  |   32|  17.4k|        h2 += h1; \
  |  |   33|  17.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  17.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  17.4k|        h2 += h2 << 2; \
  |  |   35|  17.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 17.4k]
  |  |  ------------------
  ------------------
  112|  17.4k|        }
  113|  7.99k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  7.99k|    do { \
  |  |   30|  7.99k|        h1 += ch; \
  |  |   31|  7.99k|        h1 += h1 << 3; \
  |  |   32|  7.99k|        h2 += h1; \
  |  |   33|  7.99k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  7.99k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  7.99k|        h2 += h2 << 2; \
  |  |   35|  7.99k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 7.99k]
  |  |  ------------------
  ------------------
  114|  7.99k|    }
  115|  35.0k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 35.0k, False: 0]
  ------------------
  116|  4.26M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 4.23M, False: 35.0k]
  ------------------
  117|  4.23M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  4.23M|    do { \
  |  |   30|  4.23M|        h1 += ch; \
  |  |   31|  4.23M|        h1 += h1 << 3; \
  |  |   32|  4.23M|        h2 += h1; \
  |  |   33|  4.23M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.23M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.23M|        h2 += h2 << 2; \
  |  |   35|  4.23M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.23M]
  |  |  ------------------
  ------------------
  118|  4.23M|        }
  119|  35.0k|    }
  120|  35.0k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  35.0k|    do { \
  |  |   30|  35.0k|        h1 += ch; \
  |  |   31|  35.0k|        h1 += h1 << 3; \
  |  |   32|  35.0k|        h2 += h1; \
  |  |   33|  35.0k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  35.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  35.0k|        h2 += h2 << 2; \
  |  |   35|  35.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 35.0k]
  |  |  ------------------
  ------------------
  121|  35.0k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 11.1k, False: 23.8k]
  ------------------
  122|  52.6k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 41.4k, False: 11.1k]
  ------------------
  123|  41.4k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  41.4k|    do { \
  |  |   30|  41.4k|        h1 += ch; \
  |  |   31|  41.4k|        h1 += h1 << 3; \
  |  |   32|  41.4k|        h2 += h1; \
  |  |   33|  41.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  41.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  41.4k|        h2 += h2 << 2; \
  |  |   35|  41.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 41.4k]
  |  |  ------------------
  ------------------
  124|  41.4k|        }
  125|  11.1k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  11.1k|    do { \
  |  |   30|  11.1k|        h1 += ch; \
  |  |   31|  11.1k|        h1 += h1 << 3; \
  |  |   32|  11.1k|        h2 += h1; \
  |  |   33|  11.1k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  11.1k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  11.1k|        h2 += h2 << 2; \
  |  |   35|  11.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 11.1k]
  |  |  ------------------
  ------------------
  126|  11.1k|    }
  127|  35.0k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 35.0k, False: 0]
  ------------------
  128|  1.86M|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 1.82M, False: 35.0k]
  ------------------
  129|  1.82M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  1.82M|    do { \
  |  |   30|  1.82M|        h1 += ch; \
  |  |   31|  1.82M|        h1 += h1 << 3; \
  |  |   32|  1.82M|        h2 += h1; \
  |  |   33|  1.82M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.82M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.82M|        h2 += h2 << 2; \
  |  |   35|  1.82M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.82M]
  |  |  ------------------
  ------------------
  130|  1.82M|        }
  131|  35.0k|    }
  132|  35.0k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  35.0k|    do { \
  |  |   30|  35.0k|        h1 += ch; \
  |  |   31|  35.0k|        h1 += h1 << 3; \
  |  |   32|  35.0k|        h2 += h1; \
  |  |   33|  35.0k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  35.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  35.0k|        h2 += h2 << 2; \
  |  |   35|  35.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 35.0k]
  |  |  ------------------
  ------------------
  133|  35.0k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 35.0k]
  ------------------
  134|      0|        while ((ch = *prefix3++) != 0) {
  ------------------
  |  Branch (134:16): [True: 0, False: 0]
  ------------------
  135|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|        }
  137|      0|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  138|      0|    }
  139|  35.0k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 35.0k]
  ------------------
  140|      0|        while ((ch = *name3++) != 0) {
  ------------------
  |  Branch (140:16): [True: 0, False: 0]
  ------------------
  141|      0|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|      0|    do { \
  |  |   30|      0|        h1 += ch; \
  |  |   31|      0|        h1 += h1 << 3; \
  |  |   32|      0|        h2 += h1; \
  |  |   33|      0|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|      0|        h2 += h2 << 2; \
  |  |   35|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|        }
  143|      0|    }
  144|       |
  145|  35.0k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  35.0k|    do { \
  |  |   40|  35.0k|        h1 ^= h2; \
  |  |   41|  35.0k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  35.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  35.0k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  35.0k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  35.0k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  35.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  35.0k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  35.0k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  35.0k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  35.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 35.0k]
  |  |  ------------------
  ------------------
  146|       |
  147|  35.0k|    return(h2);
  148|  35.0k|}
hash.c:stubHashScannerFull:
  946|  20.2k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  20.2k|    stubData *sdata = (stubData *) data;
  948|  20.2k|    sdata->scan(payload, sdata->data, key);
  949|  20.2k|}
hash.c:xmlFastStrEqual:
  263|  5.80M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  5.80M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 5.21M, False: 587k]
  ------------------
  265|  5.21M|        return(s2 == NULL);
  266|   587k|    else
  267|   587k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 587k, False: 0]
  ------------------
  268|   587k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 442k, False: 144k]
  ------------------
  269|  5.80M|}

tree.c:xmlGrowCapacity:
   32|  74.8k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  74.8k|    int extra;
   34|       |
   35|  74.8k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 74.4k, False: 395]
  ------------------
   36|  74.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  74.4k|        (void) min;
   38|  74.4k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  74.4k|    }
   43|       |
   44|    395|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 395]
  ------------------
   45|    395|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 395]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    395|    extra = (capacity + 1) / 2;
   50|       |
   51|    395|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 395]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    395|    return(capacity + extra);
   55|    395|}
uri.c:xmlGrowCapacity:
   32|  28.2k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  28.2k|    int extra;
   34|       |
   35|  28.2k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 28.2k]
  ------------------
   36|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|      0|        (void) min;
   38|      0|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|      0|    }
   43|       |
   44|  28.2k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 29, False: 28.1k]
  ------------------
   45|  28.1k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 28.1k]
  ------------------
   46|     29|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  28.1k|    extra = (capacity + 1) / 2;
   50|       |
   51|  28.1k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 51, False: 28.1k]
  ------------------
   52|     51|        return(max);
   53|       |
   54|  28.1k|    return(capacity + extra);
   55|  28.1k|}
valid.c:xmlGrowCapacity:
   32|  9.36k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  9.36k|    int extra;
   34|       |
   35|  9.36k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.62k, False: 5.74k]
  ------------------
   36|  3.62k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.62k|        (void) min;
   38|  3.62k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.62k|    }
   43|       |
   44|  5.74k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.74k]
  ------------------
   45|  5.74k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.74k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.74k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.74k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.74k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.74k|    return(capacity + extra);
   55|  5.74k|}
xmlreader.c:xmlGrowCapacity:
   32|    497|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    497|    int extra;
   34|       |
   35|    497|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 234, False: 263]
  ------------------
   36|    234|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    234|        (void) min;
   38|    234|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    234|    }
   43|       |
   44|    263|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 263]
  ------------------
   45|    263|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 263]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    263|    extra = (capacity + 1) / 2;
   50|       |
   51|    263|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 263]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    263|    return(capacity + extra);
   55|    263|}
xmlregexp.c:xmlGrowCapacity:
   32|  3.06M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  3.06M|    int extra;
   34|       |
   35|  3.06M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 1.43M, False: 1.63M]
  ------------------
   36|  1.43M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  1.43M|        (void) min;
   38|  1.43M|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  1.43M|    }
   43|       |
   44|  1.63M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.63M]
  ------------------
   45|  1.63M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.63M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.63M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.63M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.63M]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.63M|    return(capacity + extra);
   55|  1.63M|}
xinclude.c:xmlGrowCapacity:
   32|  25.9k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  25.9k|    int extra;
   34|       |
   35|  25.9k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 22.7k, False: 3.15k]
  ------------------
   36|  22.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  22.7k|        (void) min;
   38|  22.7k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  22.7k|    }
   43|       |
   44|  3.15k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 3.15k]
  ------------------
   45|  3.15k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 3.15k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  3.15k|    extra = (capacity + 1) / 2;
   50|       |
   51|  3.15k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 3.15k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  3.15k|    return(capacity + extra);
   55|  3.15k|}
xpath.c:xmlGrowCapacity:
   32|  1.56M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.56M|    int extra;
   34|       |
   35|  1.56M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 497k, False: 1.06M]
  ------------------
   36|   497k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   497k|        (void) min;
   38|   497k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   497k|    }
   43|       |
   44|  1.06M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.06M]
  ------------------
   45|  1.06M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.06M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.06M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.06M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 2, False: 1.06M]
  ------------------
   52|      2|        return(max);
   53|       |
   54|  1.06M|    return(capacity + extra);
   55|  1.06M|}
parser.c:xmlGrowCapacity:
   32|   389k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   389k|    int extra;
   34|       |
   35|   389k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 38.7k, False: 350k]
  ------------------
   36|  38.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  38.7k|        (void) min;
   38|  38.7k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  38.7k|    }
   43|       |
   44|   350k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 215, False: 350k]
  ------------------
   45|   350k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 350k]
  ------------------
   46|    215|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   350k|    extra = (capacity + 1) / 2;
   50|       |
   51|   350k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 393, False: 349k]
  ------------------
   52|    393|        return(max);
   53|       |
   54|   349k|    return(capacity + extra);
   55|   350k|}

parserInternals.c:xmlSaturatedAddSizeT:
  175|  8.57M|xmlSaturatedAddSizeT(unsigned long *dst, size_t val) {
  176|  8.57M|    if (val > ULONG_MAX - *dst)
  ------------------
  |  Branch (176:9): [True: 0, False: 8.57M]
  ------------------
  177|      0|        *dst = ULONG_MAX;
  178|  8.57M|    else
  179|  8.57M|        *dst += val;
  180|  8.57M|}
parser.c:xmlSaturatedAdd:
  167|  7.48M|xmlSaturatedAdd(unsigned long *dst, unsigned long val) {
  168|  7.48M|    if (val > ULONG_MAX - *dst)
  ------------------
  |  Branch (168:9): [True: 0, False: 7.48M]
  ------------------
  169|      0|        *dst = ULONG_MAX;
  170|  7.48M|    else
  171|  7.48M|        *dst += val;
  172|  7.48M|}
parser.c:xmlSaturatedAddSizeT:
  175|  2.43M|xmlSaturatedAddSizeT(unsigned long *dst, size_t val) {
  176|  2.43M|    if (val > ULONG_MAX - *dst)
  ------------------
  |  Branch (176:9): [True: 0, False: 2.43M]
  ------------------
  177|      0|        *dst = ULONG_MAX;
  178|  2.43M|    else
  179|  2.43M|        *dst += val;
  180|  2.43M|}

xmlListCreate:
  176|    737|{
  177|    737|    xmlListPtr l;
  178|    737|    l = (xmlListPtr)xmlMalloc(sizeof(xmlList));
  179|    737|    if (l == NULL)
  ------------------
  |  Branch (179:9): [True: 1, False: 736]
  ------------------
  180|      1|        return (NULL);
  181|       |    /* Initialize the list to NULL */
  182|    736|    memset(l, 0, sizeof(xmlList));
  183|       |
  184|       |    /* Add the sentinel */
  185|    736|    l->sentinel = (xmlLinkPtr)xmlMalloc(sizeof(xmlLink));
  186|    736|    if (l->sentinel == NULL) {
  ------------------
  |  Branch (186:9): [True: 1, False: 735]
  ------------------
  187|      1|	xmlFree(l);
  188|      1|        return (NULL);
  189|      1|    }
  190|    735|    l->sentinel->next = l->sentinel;
  191|    735|    l->sentinel->prev = l->sentinel;
  192|    735|    l->sentinel->data = NULL;
  193|       |
  194|       |    /* If there is a link deallocator, use it */
  195|    735|    if (deallocator != NULL)
  ------------------
  |  Branch (195:9): [True: 735, False: 0]
  ------------------
  196|    735|        l->linkDeallocator = deallocator;
  197|       |    /* If there is a link comparator, use it */
  198|    735|    if (compare != NULL)
  ------------------
  |  Branch (198:9): [True: 735, False: 0]
  ------------------
  199|    735|        l->linkCompare = compare;
  200|      0|    else /* Use our own */
  201|      0|        l->linkCompare = xmlLinkCompare;
  202|    735|    return l;
  203|    736|}
xmlListAppend:
  279|  28.1k|{
  280|  28.1k|    xmlLinkPtr lkPlace, lkNew;
  281|       |
  282|  28.1k|    if (l == NULL)
  ------------------
  |  Branch (282:9): [True: 0, False: 28.1k]
  ------------------
  283|      0|        return(1);
  284|  28.1k|    lkPlace = xmlListHigherSearch(l, data);
  285|       |    /* Add the new link */
  286|  28.1k|    lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
  287|  28.1k|    if (lkNew == NULL)
  ------------------
  |  Branch (287:9): [True: 1, False: 28.1k]
  ------------------
  288|      1|        return (1);
  289|  28.1k|    lkNew->data = data;
  290|  28.1k|    lkNew->next = lkPlace->next;
  291|  28.1k|    (lkPlace->next)->prev = lkNew;
  292|  28.1k|    lkPlace->next = lkNew;
  293|  28.1k|    lkNew->prev = lkPlace;
  294|  28.1k|    return 0;
  295|  28.1k|}
xmlListDelete:
  303|    735|{
  304|    735|    if (l == NULL)
  ------------------
  |  Branch (304:9): [True: 0, False: 735]
  ------------------
  305|      0|        return;
  306|       |
  307|    735|    xmlListClear(l);
  308|    735|    xmlFree(l->sentinel);
  309|    735|    xmlFree(l);
  310|    735|}
xmlListClear:
  385|    735|{
  386|    735|    xmlLinkPtr  lk;
  387|       |
  388|    735|    if (l == NULL)
  ------------------
  |  Branch (388:9): [True: 0, False: 735]
  ------------------
  389|      0|        return;
  390|    735|    lk = l->sentinel->next;
  391|  28.8k|    while(lk != l->sentinel) {
  ------------------
  |  Branch (391:11): [True: 28.1k, False: 735]
  ------------------
  392|  28.1k|        xmlLinkPtr next = lk->next;
  393|       |
  394|  28.1k|        xmlLinkDeallocator(l, lk);
  395|  28.1k|        lk = next;
  396|  28.1k|    }
  397|    735|}
xmlLinkGetData:
  546|  28.1k|{
  547|  28.1k|    if (lk == NULL)
  ------------------
  |  Branch (547:9): [True: 0, False: 28.1k]
  ------------------
  548|      0|        return(NULL);
  549|  28.1k|    return lk->data;
  550|  28.1k|}
xmlListWalk:
  614|    254|xmlListWalk(xmlList *l, xmlListWalker walker, void *user) {
  615|    254|    xmlLinkPtr lk;
  616|       |
  617|    254|    if ((l == NULL) || (walker == NULL))
  ------------------
  |  Branch (617:9): [True: 0, False: 254]
  |  Branch (617:24): [True: 0, False: 254]
  ------------------
  618|      0|        return;
  619|  4.28k|    for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
  ------------------
  |  Branch (619:33): [True: 4.03k, False: 254]
  ------------------
  620|  4.03k|        if((walker(lk->data, user)) == 0)
  ------------------
  |  Branch (620:12): [True: 0, False: 4.03k]
  ------------------
  621|      0|                break;
  622|  4.03k|    }
  623|    254|}
list.c:xmlListHigherSearch:
  112|  28.1k|{
  113|  28.1k|    xmlLinkPtr lk;
  114|       |
  115|  28.1k|    if (l == NULL)
  ------------------
  |  Branch (115:9): [True: 0, False: 28.1k]
  ------------------
  116|      0|        return(NULL);
  117|  28.1k|    for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev);
  ------------------
  |  Branch (117:32): [True: 27.4k, False: 732]
  |  Branch (117:53): [True: 0, False: 27.4k]
  ------------------
  118|  28.1k|    return lk;
  119|  28.1k|}
list.c:xmlLinkDeallocator:
   59|  28.1k|{
   60|  28.1k|    (lk->prev)->next = lk->next;
   61|  28.1k|    (lk->next)->prev = lk->prev;
   62|  28.1k|    if(l->linkDeallocator)
  ------------------
  |  Branch (62:8): [True: 28.1k, False: 0]
  ------------------
   63|  28.1k|        l->linkDeallocator(lk);
   64|  28.1k|    xmlFree(lk);
   65|  28.1k|}

xmlWarningMsg:
  276|  19.5k|{
  277|  19.5k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  19.5k|}
xmlAttrNormalizeSpace:
  989|  31.3k|{
  990|  31.3k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (990:9): [True: 0, False: 31.3k]
  |  Branch (990:26): [True: 0, False: 31.3k]
  ------------------
  991|      0|        return(NULL);
  992|       |
  993|  39.0k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (993:12): [True: 7.70k, False: 31.3k]
  ------------------
  994|  2.27M|    while (*src != 0) {
  ------------------
  |  Branch (994:12): [True: 2.23M, False: 31.3k]
  ------------------
  995|  2.23M|	if (*src == 0x20) {
  ------------------
  |  Branch (995:6): [True: 24.5k, False: 2.21M]
  ------------------
  996|   268k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (996:13): [True: 243k, False: 24.5k]
  ------------------
  997|  24.5k|	    if (*src != 0)
  ------------------
  |  Branch (997:10): [True: 24.0k, False: 569]
  ------------------
  998|  24.0k|		*dst++ = 0x20;
  999|  2.21M|	} else {
 1000|  2.21M|	    *dst++ = *src++;
 1001|  2.21M|	}
 1002|  2.23M|    }
 1003|  31.3k|    *dst = 0;
 1004|  31.3k|    if (dst == src)
  ------------------
  |  Branch (1004:9): [True: 26.2k, False: 5.08k]
  ------------------
 1005|  26.2k|       return(NULL);
 1006|  5.08k|    return(dst);
 1007|  31.3k|}
xmlAttrNormalize:
 1024|  2.10k|{
 1025|  2.10k|    xmlChar *out = NULL;
 1026|  2.10k|    xmlChar *dst = NULL;
 1027|       |
 1028|  2.10k|    if (src == NULL)
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.10k]
  ------------------
 1029|      0|        return(NULL);
 1030|       |
 1031|  2.10k|    out = src;
 1032|  2.10k|    dst = out;
 1033|  35.5k|    while (*src != 0) {
  ------------------
  |  Branch (1033:12): [True: 33.4k, False: 2.10k]
  ------------------
 1034|  33.4k|        if (*src < 0x20) {
  ------------------
  |  Branch (1034:13): [True: 256, False: 33.2k]
  ------------------
 1035|    256|            src++;
 1036|    256|            *dst++ = 0x20;
 1037|  33.2k|        } else {
 1038|  33.2k|            *dst++ = *src++;
 1039|  33.2k|        }
 1040|  33.4k|    }
 1041|  2.10k|    *dst = 0;
 1042|  2.10k|    return(out);
 1043|  2.10k|}
xmlCheckLanguageID:
 1304|  20.2k|{
 1305|  20.2k|    const xmlChar *cur = lang, *nxt;
 1306|       |
 1307|  20.2k|    if (cur == NULL)
  ------------------
  |  Branch (1307:9): [True: 283, False: 19.9k]
  ------------------
 1308|    283|        return (0);
 1309|  19.9k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1309:10): [True: 467, False: 19.5k]
  |  Branch (1309:29): [True: 201, False: 266]
  ------------------
 1310|  19.7k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1310:10): [True: 11.0k, False: 8.77k]
  |  Branch (1310:29): [True: 420, False: 10.5k]
  ------------------
 1311|  19.3k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1311:10): [True: 703, False: 18.6k]
  |  Branch (1311:29): [True: 342, False: 361]
  ------------------
 1312|  19.0k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1312:10): [True: 357, False: 18.6k]
  |  Branch (1312:29): [True: 223, False: 134]
  ------------------
 1313|       |        /*
 1314|       |         * Still allow IANA code and user code which were coming
 1315|       |         * from the previous version of the XML-1.0 specification
 1316|       |         * it's deprecated but we should not fail
 1317|       |         */
 1318|  1.18k|        cur += 2;
 1319|  5.23k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1319:17): [True: 4.26k, False: 977]
  |  Branch (1319:36): [True: 1.38k, False: 2.88k]
  ------------------
 1320|  3.85k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1320:17): [True: 2.87k, False: 986]
  |  Branch (1320:36): [True: 2.67k, False: 200]
  ------------------
 1321|  4.05k|            cur++;
 1322|  1.18k|        return(cur[0] == 0);
 1323|  1.18k|    }
 1324|  18.8k|    nxt = cur;
 1325|  75.6k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1325:13): [True: 58.0k, False: 17.5k]
  |  Branch (1325:32): [True: 49.4k, False: 8.56k]
  ------------------
 1326|  26.1k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1326:13): [True: 8.52k, False: 17.6k]
  |  Branch (1326:32): [True: 7.34k, False: 1.17k]
  ------------------
 1327|  56.8k|           nxt++;
 1328|  18.8k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1328:9): [True: 1.13k, False: 17.6k]
  ------------------
 1329|       |        /*
 1330|       |         * Reserved
 1331|       |         */
 1332|  1.13k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1332:13): [True: 311, False: 827]
  |  Branch (1332:32): [True: 381, False: 446]
  ------------------
 1333|    692|            return(0);
 1334|    446|        return(1);
 1335|  1.13k|    }
 1336|  17.6k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1336:9): [True: 1.40k, False: 16.2k]
  ------------------
 1337|  1.40k|        return(0);
 1338|       |    /* we got an ISO 639 code */
 1339|  16.2k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1339:9): [True: 659, False: 15.6k]
  ------------------
 1340|    659|        return(1);
 1341|  15.6k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1341:9): [True: 818, False: 14.7k]
  ------------------
 1342|    818|        return(0);
 1343|       |
 1344|  14.7k|    nxt++;
 1345|  14.7k|    cur = nxt;
 1346|       |    /* now we can have extlang or script or region or variant */
 1347|  14.7k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1347:9): [True: 14.0k, False: 750]
  |  Branch (1347:28): [True: 2.50k, False: 11.5k]
  ------------------
 1348|  2.50k|        goto region_m49;
 1349|       |
 1350|  50.2k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1350:13): [True: 38.3k, False: 11.8k]
  |  Branch (1350:32): [True: 34.6k, False: 3.70k]
  ------------------
 1351|  15.5k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1351:13): [True: 3.68k, False: 11.8k]
  |  Branch (1351:32): [True: 3.23k, False: 450]
  ------------------
 1352|  37.9k|           nxt++;
 1353|  12.2k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1353:9): [True: 1.90k, False: 10.3k]
  ------------------
 1354|  1.90k|        goto script;
 1355|  10.3k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1355:9): [True: 1.56k, False: 8.80k]
  ------------------
 1356|  1.56k|        goto region;
 1357|  8.80k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1357:9): [True: 618, False: 8.18k]
  |  Branch (1357:29): [True: 510, False: 108]
  ------------------
 1358|    510|        goto variant;
 1359|  8.29k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1359:9): [True: 1.14k, False: 7.15k]
  ------------------
 1360|  1.14k|        return(0);
 1361|       |    /* we parsed an extlang */
 1362|  7.15k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1362:9): [True: 204, False: 6.94k]
  ------------------
 1363|    204|        return(1);
 1364|  6.94k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1364:9): [True: 2.01k, False: 4.93k]
  ------------------
 1365|  2.01k|        return(0);
 1366|       |
 1367|  4.93k|    nxt++;
 1368|  4.93k|    cur = nxt;
 1369|       |    /* now we can have script or region or variant */
 1370|  4.93k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1370:9): [True: 4.56k, False: 373]
  |  Branch (1370:28): [True: 504, False: 4.06k]
  ------------------
 1371|    504|        goto region_m49;
 1372|       |
 1373|  31.6k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1373:13): [True: 27.7k, False: 3.83k]
  |  Branch (1373:32): [True: 18.9k, False: 8.82k]
  ------------------
 1374|  12.6k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1374:13): [True: 8.81k, False: 3.83k]
  |  Branch (1374:32): [True: 8.21k, False: 602]
  ------------------
 1375|  27.1k|           nxt++;
 1376|  4.43k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1376:9): [True: 1.69k, False: 2.74k]
  ------------------
 1377|  1.69k|        goto region;
 1378|  2.74k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1378:9): [True: 1.04k, False: 1.69k]
  |  Branch (1378:29): [True: 740, False: 309]
  ------------------
 1379|    740|        goto variant;
 1380|  2.00k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1380:9): [True: 785, False: 1.21k]
  ------------------
 1381|    785|        return(0);
 1382|       |    /* we parsed a script */
 1383|  3.12k|script:
 1384|  3.12k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1384:9): [True: 981, False: 2.14k]
  ------------------
 1385|    981|        return(1);
 1386|  2.14k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1386:9): [True: 351, False: 1.79k]
  ------------------
 1387|    351|        return(0);
 1388|       |
 1389|  1.79k|    nxt++;
 1390|  1.79k|    cur = nxt;
 1391|       |    /* now we can have region or variant */
 1392|  1.79k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1392:9): [True: 1.58k, False: 208]
  |  Branch (1392:28): [True: 361, False: 1.22k]
  ------------------
 1393|    361|        goto region_m49;
 1394|       |
 1395|  6.72k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1395:13): [True: 5.65k, False: 1.06k]
  |  Branch (1395:32): [True: 2.68k, False: 2.97k]
  ------------------
 1396|  4.04k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1396:13): [True: 2.96k, False: 1.07k]
  |  Branch (1396:32): [True: 2.60k, False: 361]
  ------------------
 1397|  5.29k|           nxt++;
 1398|       |
 1399|  1.43k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1399:9): [True: 411, False: 1.02k]
  |  Branch (1399:29): [True: 208, False: 203]
  ------------------
 1400|    208|        goto variant;
 1401|  1.22k|    if (nxt - cur != 2)
  ------------------
  |  Branch (1401:9): [True: 530, False: 695]
  ------------------
 1402|    530|        return(0);
 1403|       |    /* we parsed a region */
 1404|  4.20k|region:
 1405|  4.20k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1405:9): [True: 753, False: 3.45k]
  ------------------
 1406|    753|        return(1);
 1407|  3.45k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1407:9): [True: 2.63k, False: 814]
  ------------------
 1408|  2.63k|        return(0);
 1409|       |
 1410|    814|    nxt++;
 1411|    814|    cur = nxt;
 1412|       |    /* now we can just have a variant */
 1413|  6.14k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1413:13): [True: 5.36k, False: 777]
  |  Branch (1413:32): [True: 2.25k, False: 3.10k]
  ------------------
 1414|  3.88k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1414:13): [True: 3.09k, False: 791]
  |  Branch (1414:32): [True: 3.07k, False: 23]
  ------------------
 1415|  5.32k|           nxt++;
 1416|       |
 1417|    814|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1417:9): [True: 299, False: 515]
  |  Branch (1417:28): [True: 300, False: 215]
  ------------------
 1418|    599|        return(0);
 1419|       |
 1420|       |    /* we parsed a variant */
 1421|  1.67k|variant:
 1422|  1.67k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1422:9): [True: 518, False: 1.15k]
  ------------------
 1423|    518|        return(1);
 1424|  1.15k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1424:9): [True: 847, False: 308]
  ------------------
 1425|    847|        return(0);
 1426|       |    /* extensions and private use subtags not checked */
 1427|    308|    return (1);
 1428|       |
 1429|  3.36k|region_m49:
 1430|  3.36k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1430:10): [True: 3.10k, False: 264]
  |  Branch (1430:29): [True: 2.29k, False: 807]
  ------------------
 1431|  2.29k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1431:10): [True: 1.24k, False: 1.05k]
  |  Branch (1431:29): [True: 246, False: 997]
  ------------------
 1432|    246|        nxt += 3;
 1433|    246|        goto region;
 1434|    246|    }
 1435|  3.12k|    return(0);
 1436|  3.36k|}
xmlParserNsCreate:
 1453|  54.2k|xmlParserNsCreate(void) {
 1454|  54.2k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1455|       |
 1456|  54.2k|    if (nsdb == NULL)
  ------------------
  |  Branch (1456:9): [True: 5, False: 54.2k]
  ------------------
 1457|      5|        return(NULL);
 1458|  54.2k|    memset(nsdb, 0, sizeof(*nsdb));
 1459|  54.2k|    nsdb->defaultNsIndex = INT_MAX;
 1460|       |
 1461|  54.2k|    return(nsdb);
 1462|  54.2k|}
xmlParserNsFree:
 1470|  54.2k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1471|  54.2k|    if (nsdb == NULL)
  ------------------
  |  Branch (1471:9): [True: 0, False: 54.2k]
  ------------------
 1472|      0|        return;
 1473|       |
 1474|  54.2k|    xmlFree(nsdb->extra);
 1475|  54.2k|    xmlFree(nsdb->hash);
 1476|  54.2k|    xmlFree(nsdb);
 1477|  54.2k|}
xmlParserNsLookupSax:
 1603|  90.7k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1604|  90.7k|    xmlHashedString hprefix;
 1605|  90.7k|    int nsIndex;
 1606|       |
 1607|  90.7k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1607:9): [True: 50.0k, False: 40.6k]
  ------------------
 1608|  50.0k|        return(NULL);
 1609|       |
 1610|  40.6k|    hprefix.name = prefix;
 1611|  40.6k|    if (prefix != NULL)
  ------------------
  |  Branch (1611:9): [True: 28.6k, False: 11.9k]
  ------------------
 1612|  28.6k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1613|  11.9k|    else
 1614|  11.9k|        hprefix.hashValue = 0;
 1615|  40.6k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1616|  40.6k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1616:9): [True: 0, False: 40.6k]
  |  Branch (1616:33): [True: 0, False: 40.6k]
  ------------------
 1617|      0|        return(NULL);
 1618|       |
 1619|  40.6k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1620|  40.6k|}
xmlParserNsUpdateSax:
 1634|   243k|                     void *saxData) {
 1635|   243k|    xmlHashedString hprefix;
 1636|   243k|    int nsIndex;
 1637|       |
 1638|   243k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1638:9): [True: 0, False: 243k]
  ------------------
 1639|      0|        return(-1);
 1640|       |
 1641|   243k|    hprefix.name = prefix;
 1642|   243k|    if (prefix != NULL)
  ------------------
  |  Branch (1642:9): [True: 209k, False: 34.0k]
  ------------------
 1643|   209k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1644|  34.0k|    else
 1645|  34.0k|        hprefix.hashValue = 0;
 1646|   243k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1647|   243k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1647:9): [True: 0, False: 243k]
  |  Branch (1647:33): [True: 0, False: 243k]
  ------------------
 1648|      0|        return(-1);
 1649|       |
 1650|   243k|    ctxt->nsdb->extra[nsIndex].saxData = saxData;
 1651|   243k|    return(0);
 1652|   243k|}
xmlCtxtPushInput:
 1929|   382k|{
 1930|   382k|    char *directory = NULL;
 1931|   382k|    int maxDepth;
 1932|       |
 1933|   382k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1933:9): [True: 0, False: 382k]
  |  Branch (1933:27): [True: 1.73k, False: 380k]
  ------------------
 1934|  1.73k|        return(-1);
 1935|       |
 1936|   380k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1936:16): [True: 99.3k, False: 281k]
  ------------------
 1937|       |
 1938|   380k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1938:9): [True: 8.36k, False: 372k]
  ------------------
 1939|  8.36k|        xmlParserInputPtr *tmp;
 1940|  8.36k|        int newSize;
 1941|       |
 1942|  8.36k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1943|  8.36k|                                  5, maxDepth);
 1944|  8.36k|        if (newSize < 0) {
  ------------------
  |  Branch (1944:13): [True: 1, False: 8.36k]
  ------------------
 1945|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1946|      1|                           "Maximum entity nesting depth exceeded");
 1947|      1|            return(-1);
 1948|      1|        }
 1949|  8.36k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1950|  8.36k|        if (tmp == NULL) {
  ------------------
  |  Branch (1950:13): [True: 2, False: 8.36k]
  ------------------
 1951|      2|            xmlErrMemory(ctxt);
 1952|      2|            return(-1);
 1953|      2|        }
 1954|  8.36k|        ctxt->inputTab = tmp;
 1955|  8.36k|        ctxt->inputMax = newSize;
 1956|  8.36k|    }
 1957|       |
 1958|   380k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1958:9): [True: 239k, False: 141k]
  |  Branch (1958:33): [True: 196k, False: 43.1k]
  ------------------
 1959|   196k|        directory = xmlParserGetDirectory(value->filename);
 1960|   196k|        if (directory == NULL) {
  ------------------
  |  Branch (1960:13): [True: 8, False: 196k]
  ------------------
 1961|      8|            xmlErrMemory(ctxt);
 1962|      8|            return(-1);
 1963|      8|        }
 1964|   196k|    }
 1965|       |
 1966|   380k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 380k]
  ------------------
 1967|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1968|      0|        return(-1);
 1969|      0|    }
 1970|       |
 1971|   380k|    ctxt->inputTab[ctxt->inputNr] = value;
 1972|   380k|    ctxt->input = value;
 1973|       |
 1974|   380k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1974:9): [True: 239k, False: 141k]
  ------------------
 1975|   239k|        xmlFree(ctxt->directory);
 1976|   239k|        ctxt->directory = directory;
 1977|   239k|    }
 1978|       |
 1979|       |    /*
 1980|       |     * The input ID is unused internally, but there are entity
 1981|       |     * loaders in downstream code that detect the main document
 1982|       |     * by checking for "input_id == 1".
 1983|       |     */
 1984|   380k|    value->id = ctxt->input_id++;
 1985|       |
 1986|   380k|    return(ctxt->inputNr++);
 1987|   380k|}
xmlCtxtPopInput:
 1997|   487k|{
 1998|   487k|    xmlParserInputPtr ret;
 1999|       |
 2000|   487k|    if (ctxt == NULL)
  ------------------
  |  Branch (2000:9): [True: 0, False: 487k]
  ------------------
 2001|      0|        return(NULL);
 2002|   487k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (2002:9): [True: 108k, False: 378k]
  ------------------
 2003|   108k|        return (NULL);
 2004|   378k|    ctxt->inputNr--;
 2005|   378k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (2005:9): [True: 141k, False: 237k]
  ------------------
 2006|   141k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 2007|   237k|    else
 2008|   237k|        ctxt->input = NULL;
 2009|   378k|    ret = ctxt->inputTab[ctxt->inputNr];
 2010|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 2011|   378k|    return (ret);
 2012|   487k|}
nodePush:
 2025|   980k|{
 2026|   980k|    if (ctxt == NULL)
  ------------------
  |  Branch (2026:9): [True: 0, False: 980k]
  ------------------
 2027|      0|        return(0);
 2028|       |
 2029|   980k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (2029:9): [True: 54.0k, False: 925k]
  ------------------
 2030|  54.0k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (2030:24): [True: 27.2k, False: 26.8k]
  ------------------
 2031|  54.0k|        xmlNodePtr *tmp;
 2032|  54.0k|        int newSize;
 2033|       |
 2034|  54.0k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 2035|  54.0k|                                  10, maxDepth);
 2036|  54.0k|        if (newSize < 0) {
  ------------------
  |  Branch (2036:13): [True: 52, False: 54.0k]
  ------------------
 2037|     52|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2038|     52|                    "Excessive depth in document: %d,"
 2039|     52|                    " use XML_PARSE_HUGE option\n",
 2040|     52|                    ctxt->nodeNr);
 2041|     52|            return(-1);
 2042|     52|        }
 2043|       |
 2044|  54.0k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2045|  54.0k|        if (tmp == NULL) {
  ------------------
  |  Branch (2045:13): [True: 20, False: 53.9k]
  ------------------
 2046|     20|            xmlErrMemory(ctxt);
 2047|     20|            return (-1);
 2048|     20|        }
 2049|  53.9k|        ctxt->nodeTab = tmp;
 2050|  53.9k|	ctxt->nodeMax = newSize;
 2051|  53.9k|    }
 2052|       |
 2053|   979k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2054|   979k|    ctxt->node = value;
 2055|   979k|    return (ctxt->nodeNr++);
 2056|   980k|}
nodePop:
 2068|   977k|{
 2069|   977k|    xmlNodePtr ret;
 2070|       |
 2071|   977k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2071:9): [True: 0, False: 977k]
  ------------------
 2072|   977k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2072:9): [True: 156k, False: 821k]
  ------------------
 2073|   156k|        return (NULL);
 2074|   821k|    ctxt->nodeNr--;
 2075|   821k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2075:9): [True: 802k, False: 19.3k]
  ------------------
 2076|   802k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2077|  19.3k|    else
 2078|  19.3k|        ctxt->node = NULL;
 2079|   821k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2080|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2081|   821k|    return (ret);
 2082|   977k|}
xmlSkipBlankChars:
 2355|  5.37M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2356|  5.37M|    const xmlChar *cur;
 2357|  5.37M|    int res = 0;
 2358|       |
 2359|  5.37M|    cur = ctxt->input->cur;
 2360|  5.37M|    while (IS_BLANK_CH(*cur)) {
 2361|  2.41M|        if (*cur == '\n') {
  ------------------
  |  Branch (2361:13): [True: 716k, False: 1.69M]
  ------------------
 2362|   716k|            ctxt->input->line++; ctxt->input->col = 1;
 2363|  1.69M|        } else {
 2364|  1.69M|            ctxt->input->col++;
 2365|  1.69M|        }
 2366|  2.41M|        cur++;
 2367|  2.41M|        if (res < INT_MAX)
  ------------------
  |  Branch (2367:13): [True: 2.41M, False: 0]
  ------------------
 2368|  2.41M|            res++;
 2369|  2.41M|        if (*cur == 0) {
  ------------------
  |  Branch (2369:13): [True: 30.4k, False: 2.38M]
  ------------------
 2370|  30.4k|            ctxt->input->cur = cur;
 2371|  30.4k|            xmlParserGrow(ctxt);
 2372|  30.4k|            cur = ctxt->input->cur;
 2373|  30.4k|        }
 2374|  2.41M|    }
 2375|  5.37M|    ctxt->input->cur = cur;
 2376|       |
 2377|  5.37M|    if (res > 4)
  ------------------
  |  Branch (2377:9): [True: 45.4k, False: 5.33M]
  ------------------
 2378|  45.4k|        GROW;
  ------------------
  |  | 2308|  45.4k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  45.4k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  45.4k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 43.3k, False: 2.05k]
  |  |  ------------------
  |  | 2309|  45.4k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  43.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.00k, False: 40.3k]
  |  |  ------------------
  |  | 2310|  45.4k|	xmlParserGrow(ctxt);
  ------------------
 2379|       |
 2380|  5.37M|    return(res);
 2381|  5.37M|}
xmlParseCharRef:
 2566|  83.7k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2567|  83.7k|    int val = 0;
 2568|  83.7k|    int count = 0;
 2569|       |
 2570|       |    /*
 2571|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2572|       |     */
 2573|  83.7k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2261|  83.7k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2263|  83.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2573:9): [True: 83.7k, False: 0]
  |  Branch (2573:25): [True: 83.7k, False: 0]
  ------------------
 2574|  83.7k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2263|  83.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2574:9): [True: 19.8k, False: 63.8k]
  ------------------
 2575|  19.8k|	SKIP(3);
  ------------------
  |  | 2285|  19.8k|#define SKIP(val) do {							\
  |  | 2286|  19.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  19.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 644, False: 19.2k]
  |  |  ------------------
  |  | 2288|  19.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  19.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 19.8k]
  |  |  ------------------
  ------------------
 2576|  19.8k|	GROW;
  ------------------
  |  | 2308|  19.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  19.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  19.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 16.1k, False: 3.66k]
  |  |  ------------------
  |  | 2309|  19.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  16.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 1.90k, False: 14.2k]
  |  |  ------------------
  |  | 2310|  19.8k|	xmlParserGrow(ctxt);
  ------------------
 2577|  73.4k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  73.4k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  56.9k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2577:9): [True: 56.9k, False: 16.5k]
  |  Branch (2577:25): [True: 56.9k, False: 0]
  ------------------
 2578|  56.9k|	    if (count++ > 20) {
  ------------------
  |  Branch (2578:10): [True: 861, False: 56.0k]
  ------------------
 2579|    861|		count = 0;
 2580|    861|		GROW;
  ------------------
  |  | 2308|    861|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|    861|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|    861|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 528, False: 333]
  |  |  ------------------
  |  | 2309|    861|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|    528|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 317, False: 211]
  |  |  ------------------
  |  | 2310|    861|	xmlParserGrow(ctxt);
  ------------------
 2581|    861|	    }
 2582|  56.9k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  56.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  55.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2582:10): [True: 55.5k, False: 1.35k]
  |  Branch (2582:26): [True: 34.0k, False: 21.5k]
  ------------------
 2583|  34.0k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2262|  34.0k|#define CUR (*ctxt->input->cur)
  ------------------
 2584|  22.9k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  22.9k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  17.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2584:15): [True: 17.2k, False: 5.66k]
  |  Branch (2584:31): [True: 15.9k, False: 1.31k]
  |  Branch (2584:47): [True: 15.7k, False: 222]
  ------------------
 2585|  15.7k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2262|  15.7k|#define CUR (*ctxt->input->cur)
  ------------------
 2586|  7.19k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  7.19k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  5.77k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2586:15): [True: 5.77k, False: 1.41k]
  |  Branch (2586:31): [True: 4.18k, False: 1.59k]
  |  Branch (2586:47): [True: 3.89k, False: 288]
  ------------------
 2587|  3.89k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2262|  3.89k|#define CUR (*ctxt->input->cur)
  ------------------
 2588|  3.30k|	    else {
 2589|  3.30k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2590|  3.30k|		val = 0;
 2591|  3.30k|		break;
 2592|  3.30k|	    }
 2593|  53.6k|	    if (val > 0x110000)
  ------------------
  |  Branch (2593:10): [True: 12.6k, False: 40.9k]
  ------------------
 2594|  12.6k|	        val = 0x110000;
 2595|       |
 2596|  53.6k|	    NEXT;
  ------------------
  |  | 2316|  53.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2597|  53.6k|	    count++;
 2598|  53.6k|	}
 2599|  19.8k|	if (RAW == ';') {
  ------------------
  |  | 2261|  19.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2599:6): [True: 16.5k, False: 3.30k]
  ------------------
 2600|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2601|  16.5k|	    ctxt->input->col++;
 2602|  16.5k|	    ctxt->input->cur++;
 2603|  16.5k|	}
 2604|  63.8k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2261|  63.8k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2263|  63.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2604:17): [True: 63.8k, False: 0]
  |  Branch (2604:33): [True: 63.8k, False: 0]
  ------------------
 2605|  63.8k|	SKIP(2);
  ------------------
  |  | 2285|  63.8k|#define SKIP(val) do {							\
  |  | 2286|  63.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  63.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 489, False: 63.3k]
  |  |  ------------------
  |  | 2288|  63.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  63.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 63.8k]
  |  |  ------------------
  ------------------
 2606|  63.8k|	GROW;
  ------------------
  |  | 2308|  63.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  63.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  63.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 47.9k, False: 15.9k]
  |  |  ------------------
  |  | 2309|  63.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  47.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.2k, False: 37.6k]
  |  |  ------------------
  |  | 2310|  63.8k|	xmlParserGrow(ctxt);
  ------------------
 2607|   201k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2261|   201k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2607:9): [True: 143k, False: 58.1k]
  ------------------
 2608|   143k|	    if (count++ > 20) {
  ------------------
  |  Branch (2608:10): [True: 1.22k, False: 142k]
  ------------------
 2609|  1.22k|		count = 0;
 2610|  1.22k|		GROW;
  ------------------
  |  | 2308|  1.22k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.22k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.22k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 925, False: 296]
  |  |  ------------------
  |  | 2309|  1.22k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|    925|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 579, False: 346]
  |  |  ------------------
  |  | 2310|  1.22k|	xmlParserGrow(ctxt);
  ------------------
 2611|  1.22k|	    }
 2612|   143k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   143k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   140k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2612:10): [True: 140k, False: 2.76k]
  |  Branch (2612:26): [True: 137k, False: 2.96k]
  ------------------
 2613|   137k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2262|   137k|#define CUR (*ctxt->input->cur)
  ------------------
 2614|  5.72k|	    else {
 2615|  5.72k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2616|  5.72k|		val = 0;
 2617|  5.72k|		break;
 2618|  5.72k|	    }
 2619|   137k|	    if (val > 0x110000)
  ------------------
  |  Branch (2619:10): [True: 12.7k, False: 124k]
  ------------------
 2620|  12.7k|	        val = 0x110000;
 2621|       |
 2622|   137k|	    NEXT;
  ------------------
  |  | 2316|   137k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2623|   137k|	    count++;
 2624|   137k|	}
 2625|  63.8k|	if (RAW == ';') {
  ------------------
  |  | 2261|  63.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2625:6): [True: 58.1k, False: 5.72k]
  ------------------
 2626|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2627|  58.1k|	    ctxt->input->col++;
 2628|  58.1k|	    ctxt->input->cur++;
 2629|  58.1k|	}
 2630|  63.8k|    } else {
 2631|      0|        if (RAW == '&')
  ------------------
  |  | 2261|      0|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2631:13): [True: 0, False: 0]
  ------------------
 2632|      0|            SKIP(1);
  ------------------
  |  | 2285|      0|#define SKIP(val) do {							\
  |  | 2286|      0|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      0|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 2288|      0|        xmlParserGrow(ctxt);						\
  |  | 2289|      0|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 0]
  |  |  ------------------
  ------------------
 2633|      0|        xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2634|      0|    }
 2635|       |
 2636|       |    /*
 2637|       |     * [ WFC: Legal Character ]
 2638|       |     * Characters referred to using character references must match the
 2639|       |     * production for Char.
 2640|       |     */
 2641|  83.7k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2641:9): [True: 661, False: 83.0k]
  ------------------
 2642|    661|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2643|    661|                "xmlParseCharRef: character reference out of bounds\n",
 2644|    661|	        val);
 2645|    661|        val = 0xFFFD;
 2646|  83.0k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|  83.0k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  83.0k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 80.7k, False: 2.28k]
  |  |  |  |  ------------------
  |  |  |  |  118|  83.0k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  80.7k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 69.8k, False: 10.9k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 15.6k, False: 54.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  80.7k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 21.1k, False: 43.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  80.7k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 32.4k, False: 11.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  83.0k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.28k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 545, False: 1.73k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.28k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.22k, False: 512]
  |  |  |  |  |  Branch (120:26): [True: 292, False: 933]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.28k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 859, False: 586]
  |  |  |  |  |  Branch (121:27): [True: 859, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2646:16): [True: 12.1k, False: 70.9k]
  ------------------
 2647|  12.1k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2648|  12.1k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2649|  12.1k|	                  val);
 2650|  12.1k|    }
 2651|  83.7k|    return(val);
 2652|  83.7k|}
xmlScanName:
 3088|  3.31M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3089|  3.31M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  3.31M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3089:16): [True: 105k, False: 3.21M]
  ------------------
 3090|  3.31M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  3.31M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3090:17): [True: 1.69M, False: 1.62M]
  ------------------
 3091|       |
 3092|  14.7M|    while (1) {
  ------------------
  |  Branch (3092:12): [True: 14.7M, Folded]
  ------------------
 3093|  14.7M|        int c, len;
 3094|       |
 3095|  14.7M|        c = *ptr;
 3096|  14.7M|        if (c < 0x80) {
  ------------------
  |  Branch (3096:13): [True: 11.4M, False: 3.29M]
  ------------------
 3097|  11.4M|            if (c == stop)
  ------------------
  |  Branch (3097:17): [True: 104k, False: 11.3M]
  ------------------
 3098|   104k|                break;
 3099|  11.3M|            len = 1;
 3100|  11.3M|        } else {
 3101|  3.29M|            len = 4;
 3102|  3.29M|            c = xmlGetUTF8Char(ptr, &len);
 3103|  3.29M|            if (c < 0)
  ------------------
  |  Branch (3103:17): [True: 5.03k, False: 3.29M]
  ------------------
 3104|  5.03k|                break;
 3105|  3.29M|        }
 3106|       |
 3107|  14.6M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  14.6M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3107:13): [True: 11.3M, False: 3.22M]
  |  Branch (3107:13): [True: 3.20M, False: 11.4M]
  ------------------
 3108|  11.3M|                !xmlIsNameChar(c, old10) :
 3109|  14.6M|                !xmlIsNameStartChar(c, old10))
 3110|  3.20M|            break;
 3111|       |
 3112|  11.4M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3112:13): [True: 84, False: 11.4M]
  ------------------
 3113|     84|            return(NULL);
 3114|  11.4M|        ptr += len;
 3115|  11.4M|        maxSize -= len;
 3116|  11.4M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  11.4M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3117|  11.4M|    }
 3118|       |
 3119|  3.31M|    return(ptr);
 3120|  3.31M|}
xmlParseName:
 3187|  2.90M|xmlParseName(xmlParserCtxt *ctxt) {
 3188|  2.90M|    const xmlChar *in;
 3189|  2.90M|    const xmlChar *ret;
 3190|  2.90M|    size_t count = 0;
 3191|  2.90M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3191:24): [True: 1.27M, False: 1.63M]
  ------------------
 3192|  1.27M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.27M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3193|  2.90M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.54M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3194|       |
 3195|  2.90M|    GROW;
  ------------------
  |  | 2308|  2.90M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  2.90M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  2.90M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.64M, False: 1.26M]
  |  |  ------------------
  |  | 2309|  2.90M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.64M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 706k, False: 940k]
  |  |  ------------------
  |  | 2310|  2.90M|	xmlParserGrow(ctxt);
  ------------------
 3196|       |
 3197|       |    /*
 3198|       |     * Accelerator for simple ASCII names
 3199|       |     */
 3200|  2.90M|    in = ctxt->input->cur;
 3201|  2.90M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3201:10): [True: 2.58M, False: 326k]
  |  Branch (3201:27): [True: 2.55M, False: 28.6k]
  ------------------
 3202|   355k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3202:3): [True: 183k, False: 171k]
  |  Branch (3202:20): [True: 151k, False: 31.9k]
  ------------------
 3203|  2.71M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3203:2): [True: 1.19k, False: 202k]
  |  Branch (3203:18): [True: 7.76k, False: 194k]
  ------------------
 3204|  2.71M|	in++;
 3205|  13.9M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3205:10): [True: 3.75M, False: 10.2M]
  |  Branch (3205:27): [True: 3.67M, False: 86.2k]
  ------------------
 3206|  10.3M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3206:10): [True: 4.44M, False: 5.87M]
  |  Branch (3206:27): [True: 4.34M, False: 97.0k]
  ------------------
 3207|  5.96M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3207:10): [True: 4.82M, False: 1.14M]
  |  Branch (3207:27): [True: 2.93M, False: 1.88M]
  ------------------
 3208|  3.03M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3208:9): [True: 3.67k, False: 3.02M]
  |  Branch (3208:25): [True: 143k, False: 2.88M]
  ------------------
 3209|  2.88M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3209:9): [True: 152k, False: 2.73M]
  |  Branch (3209:25): [True: 18.3k, False: 2.71M]
  ------------------
 3210|  11.2M|	    in++;
 3211|  2.71M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3211:6): [True: 2.68M, False: 34.1k]
  |  Branch (3211:19): [True: 2.64M, False: 31.0k]
  ------------------
 3212|  2.64M|	    count = in - ctxt->input->cur;
 3213|  2.64M|            if (count > maxLength) {
  ------------------
  |  Branch (3213:17): [True: 54, False: 2.64M]
  ------------------
 3214|     54|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3215|     54|                return(NULL);
 3216|     54|            }
 3217|  2.64M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3218|  2.64M|	    ctxt->input->cur = in;
 3219|  2.64M|	    ctxt->input->col += count;
 3220|  2.64M|	    if (ret == NULL)
  ------------------
  |  Branch (3220:10): [True: 6, False: 2.64M]
  ------------------
 3221|      6|	        xmlErrMemory(ctxt);
 3222|  2.64M|	    return(ret);
 3223|  2.64M|	}
 3224|  2.71M|    }
 3225|       |    /* accelerator for special cases */
 3226|   260k|    return(xmlParseNameComplex(ctxt));
 3227|  2.90M|}
xmlParseNmtoken:
 3417|  59.9k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3418|  59.9k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3419|  59.9k|    xmlChar *ret;
 3420|  59.9k|    int len = 0, l;
 3421|  59.9k|    int c;
 3422|  59.9k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3422:21): [True: 24.1k, False: 35.7k]
  ------------------
 3423|  24.1k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  24.1k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3424|  59.9k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  35.7k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3425|  59.9k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3425:17): [True: 17.8k, False: 42.0k]
  ------------------
 3426|       |
 3427|  59.9k|    c = xmlCurrentChar(ctxt, &l);
 3428|       |
 3429|   226k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3429:12): [True: 167k, False: 58.9k]
  ------------------
 3430|   167k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2333|   167k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 132k, False: 34.9k]
  |  |  ------------------
  |  | 2334|   167k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|   167k|	NEXTL(l);
  ------------------
  |  | 2325|   167k|#define NEXTL(l) do {							\
  |  | 2326|   167k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 167k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   167k|    } else ctxt->input->col++;						\
  |  | 2329|   167k|    ctxt->input->cur += l;				\
  |  | 2330|   167k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 167k]
  |  |  ------------------
  ------------------
 3432|   167k|	c = xmlCurrentChar(ctxt, &l);
 3433|   167k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   167k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3433:6): [True: 1.04k, False: 166k]
  ------------------
 3434|       |	    /*
 3435|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3436|       |	     * for the processing speed.
 3437|       |	     */
 3438|  1.04k|	    xmlChar *buffer;
 3439|  1.04k|	    int max = len * 2;
 3440|       |
 3441|  1.04k|	    buffer = xmlMalloc(max);
 3442|  1.04k|	    if (buffer == NULL) {
  ------------------
  |  Branch (3442:10): [True: 1, False: 1.03k]
  ------------------
 3443|      1|	        xmlErrMemory(ctxt);
 3444|      1|		return(NULL);
 3445|      1|	    }
 3446|  1.03k|	    memcpy(buffer, buf, len);
 3447|  3.76M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3447:13): [True: 3.76M, False: 960]
  ------------------
 3448|  3.76M|		if (len + 10 > max) {
  ------------------
  |  Branch (3448:7): [True: 2.32k, False: 3.75M]
  ------------------
 3449|  2.32k|		    xmlChar *tmp;
 3450|  2.32k|                    int newSize;
 3451|       |
 3452|  2.32k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3453|  2.32k|                    if (newSize < 0) {
  ------------------
  |  Branch (3453:25): [True: 78, False: 2.25k]
  ------------------
 3454|     78|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3455|     78|                        xmlFree(buffer);
 3456|     78|                        return(NULL);
 3457|     78|                    }
 3458|  2.25k|		    tmp = xmlRealloc(buffer, newSize);
 3459|  2.25k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3459:11): [True: 1, False: 2.25k]
  ------------------
 3460|      1|			xmlErrMemory(ctxt);
 3461|      1|			xmlFree(buffer);
 3462|      1|			return(NULL);
 3463|      1|		    }
 3464|  2.25k|		    buffer = tmp;
 3465|  2.25k|                    max = newSize;
 3466|  2.25k|		}
 3467|  3.76M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2333|  3.76M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 731k, False: 3.03M]
  |  |  ------------------
  |  | 2334|  3.76M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3468|  3.76M|		NEXTL(l);
  ------------------
  |  | 2325|  3.76M|#define NEXTL(l) do {							\
  |  | 2326|  3.76M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 3.76M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.76M|    } else ctxt->input->col++;						\
  |  | 2329|  3.76M|    ctxt->input->cur += l;				\
  |  | 2330|  3.76M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.76M]
  |  |  ------------------
  ------------------
 3469|  3.76M|		c = xmlCurrentChar(ctxt, &l);
 3470|  3.76M|	    }
 3471|    960|	    buffer[len] = 0;
 3472|    960|	    return(buffer);
 3473|  1.03k|	}
 3474|   167k|    }
 3475|  58.9k|    if (len == 0)
  ------------------
  |  Branch (3475:9): [True: 8.87k, False: 50.0k]
  ------------------
 3476|  8.87k|        return(NULL);
 3477|  50.0k|    if (len > maxLength) {
  ------------------
  |  Branch (3477:9): [True: 0, False: 50.0k]
  ------------------
 3478|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3479|      0|        return(NULL);
 3480|      0|    }
 3481|  50.0k|    ret = xmlStrndup(buf, len);
 3482|  50.0k|    if (ret == NULL)
  ------------------
  |  Branch (3482:9): [True: 5, False: 50.0k]
  ------------------
 3483|      5|        xmlErrMemory(ctxt);
 3484|  50.0k|    return(ret);
 3485|  50.0k|}
xmlParseEntityValue:
 3647|   142k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3648|   142k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3648:26): [True: 36.0k, False: 106k]
  ------------------
 3649|  36.0k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  36.0k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3650|   142k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   249k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3651|   142k|    xmlSBuf buf;
 3652|   142k|    const xmlChar *start;
 3653|   142k|    int quote, length;
 3654|       |
 3655|   142k|    xmlSBufInit(&buf, maxLength);
 3656|       |
 3657|   142k|    GROW;
  ------------------
  |  | 2308|   142k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   142k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   142k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 129k, False: 13.2k]
  |  |  ------------------
  |  | 2309|   142k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   129k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 24.1k, False: 105k]
  |  |  ------------------
  |  | 2310|   142k|	xmlParserGrow(ctxt);
  ------------------
 3658|       |
 3659|   142k|    quote = CUR;
  ------------------
  |  | 2262|   142k|#define CUR (*ctxt->input->cur)
  ------------------
 3660|   142k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3660:9): [True: 4.22k, False: 138k]
  |  Branch (3660:27): [True: 0, False: 4.22k]
  ------------------
 3661|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3662|      0|	return(NULL);
 3663|      0|    }
 3664|   142k|    CUR_PTR++;
  ------------------
  |  | 2264|   142k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   142k|    length = 0;
 3667|       |
 3668|       |    /*
 3669|       |     * Copy raw content of the entity into a buffer
 3670|       |     */
 3671|   112M|    while (1) {
  ------------------
  |  Branch (3671:12): [True: 112M, Folded]
  ------------------
 3672|   112M|        int c;
 3673|       |
 3674|   112M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   112M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 3, False: 112M]
  |  |  ------------------
  ------------------
 3675|      3|            goto error;
 3676|       |
 3677|   112M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   112M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3677:13): [True: 3.58k, False: 112M]
  ------------------
 3678|  3.58k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3679|  3.58k|            goto error;
 3680|  3.58k|        }
 3681|       |
 3682|   112M|        c = CUR;
  ------------------
  |  | 2262|   112M|#define CUR (*ctxt->input->cur)
  ------------------
 3683|       |
 3684|   112M|        if (c == 0) {
  ------------------
  |  Branch (3684:13): [True: 388, False: 112M]
  ------------------
 3685|    388|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3686|    388|                    "invalid character in entity value\n");
 3687|    388|            goto error;
 3688|    388|        }
 3689|   112M|        if (c == quote)
  ------------------
  |  Branch (3689:13): [True: 138k, False: 112M]
  ------------------
 3690|   138k|            break;
 3691|   112M|        NEXTL(1);
  ------------------
  |  | 2325|   112M|#define NEXTL(l) do {							\
  |  | 2326|   112M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 4.99M, False: 107M]
  |  |  ------------------
  |  | 2327|  4.99M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   107M|    } else ctxt->input->col++;						\
  |  | 2329|   112M|    ctxt->input->cur += l;				\
  |  | 2330|   112M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 112M]
  |  |  ------------------
  ------------------
 3692|   112M|        length += 1;
 3693|       |
 3694|       |        /*
 3695|       |         * TODO: Check growth threshold
 3696|       |         */
 3697|   112M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   112M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3697:13): [True: 86.8k, False: 112M]
  ------------------
 3698|  86.8k|            GROW;
  ------------------
  |  | 2308|  86.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  86.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  86.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 83.5k, False: 3.29k]
  |  |  ------------------
  |  | 2309|  86.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  83.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 83.5k, False: 0]
  |  |  ------------------
  |  | 2310|  86.8k|	xmlParserGrow(ctxt);
  ------------------
 3699|   112M|    }
 3700|       |
 3701|   138k|    start = CUR_PTR - length;
  ------------------
  |  | 2264|   138k|#define CUR_PTR ctxt->input->cur
  ------------------
 3702|       |
 3703|   138k|    if (orig != NULL) {
  ------------------
  |  Branch (3703:9): [True: 138k, False: 0]
  ------------------
 3704|   138k|        *orig = xmlStrndup(start, length);
 3705|   138k|        if (*orig == NULL)
  ------------------
  |  Branch (3705:13): [True: 1, False: 138k]
  ------------------
 3706|      1|            xmlErrMemory(ctxt);
 3707|   138k|    }
 3708|       |
 3709|   138k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3710|       |
 3711|   138k|    NEXTL(1);
  ------------------
  |  | 2325|   138k|#define NEXTL(l) do {							\
  |  | 2326|   138k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 138k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   138k|    } else ctxt->input->col++;						\
  |  | 2329|   138k|    ctxt->input->cur += l;				\
  |  | 2330|   138k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 138k]
  |  |  ------------------
  ------------------
 3712|       |
 3713|   138k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3714|       |
 3715|  3.97k|error:
 3716|  3.97k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3717|       |    return(NULL);
 3718|   142k|}
xmlExpandEntitiesInAttValue:
 4000|  25.7k|                            int normalize) {
 4001|  25.7k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4001:26): [True: 11.6k, False: 14.0k]
  ------------------
 4002|  11.6k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  11.6k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4003|  25.7k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  39.8k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4004|  25.7k|    xmlSBuf buf;
 4005|  25.7k|    int inSpace = 1;
 4006|       |
 4007|  25.7k|    xmlSBufInit(&buf, maxLength);
 4008|       |
 4009|  25.7k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 4010|  25.7k|                              ctxt->inputNr, /* check */ 0);
 4011|       |
 4012|  25.7k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (4012:9): [True: 0, False: 25.7k]
  |  Branch (4012:24): [True: 0, False: 0]
  |  Branch (4012:37): [True: 0, False: 0]
  ------------------
 4013|      0|        buf.size--;
 4014|       |
 4015|       |    return(xmlSBufFinish(&buf, NULL, ctxt, "AttValue length too long"));
 4016|  25.7k|}
xmlParseAttValue:
 4333|   176k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4334|   176k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4334:9): [True: 0, False: 176k]
  |  Branch (4334:27): [True: 0, False: 176k]
  ------------------
 4335|   176k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4336|   176k|}
xmlParseSystemLiteral:
 4350|  20.2k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4351|  20.2k|    xmlChar *buf = NULL;
 4352|  20.2k|    int len = 0;
 4353|  20.2k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  20.2k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4354|  20.2k|    int cur, l;
 4355|  20.2k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4355:21): [True: 8.08k, False: 12.1k]
  ------------------
 4356|  8.08k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  8.08k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4357|  20.2k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  12.1k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4358|  20.2k|    xmlChar stop;
 4359|       |
 4360|  20.2k|    if (RAW == '"') {
  ------------------
  |  | 2261|  20.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4360:9): [True: 11.0k, False: 9.12k]
  ------------------
 4361|  11.0k|        NEXT;
  ------------------
  |  | 2316|  11.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4362|  11.0k|	stop = '"';
 4363|  11.0k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  9.12k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4363:16): [True: 7.16k, False: 1.96k]
  ------------------
 4364|  7.16k|        NEXT;
  ------------------
  |  | 2316|  7.16k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4365|  7.16k|	stop = '\'';
 4366|  7.16k|    } else {
 4367|  1.96k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4368|  1.96k|	return(NULL);
 4369|  1.96k|    }
 4370|       |
 4371|  18.2k|    buf = xmlMalloc(size);
 4372|  18.2k|    if (buf == NULL) {
  ------------------
  |  Branch (4372:9): [True: 4, False: 18.2k]
  ------------------
 4373|      4|        xmlErrMemory(ctxt);
 4374|      4|	return(NULL);
 4375|      4|    }
 4376|  18.2k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4377|  3.82M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  3.82M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  3.82M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 1.16M, False: 2.65M]
  |  |  |  |  ------------------
  |  |  |  |  118|  3.82M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.16M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.16M, False: 1.83k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.48k, False: 1.15M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.16M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.16M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.16M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.15M, False: 1.84k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  3.82M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 7.55k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.65M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.65M, False: 536]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.65M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 535, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 535, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4377:12): [True: 3.82M, False: 1.84k]
  |  Branch (4377:30): [True: 3.80M, False: 16.3k]
  ------------------
 4378|  3.80M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4378:6): [True: 3.64k, False: 3.80M]
  ------------------
 4379|  3.64k|	    xmlChar *tmp;
 4380|  3.64k|            int newSize;
 4381|       |
 4382|  3.64k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4383|  3.64k|            if (newSize < 0) {
  ------------------
  |  Branch (4383:17): [True: 81, False: 3.56k]
  ------------------
 4384|     81|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4385|     81|                xmlFree(buf);
 4386|     81|                return(NULL);
 4387|     81|            }
 4388|  3.56k|	    tmp = xmlRealloc(buf, newSize);
 4389|  3.56k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4389:10): [True: 1, False: 3.56k]
  ------------------
 4390|      1|	        xmlFree(buf);
 4391|      1|		xmlErrMemory(ctxt);
 4392|      1|		return(NULL);
 4393|      1|	    }
 4394|  3.56k|	    buf = tmp;
 4395|  3.56k|            size = newSize;
 4396|  3.56k|	}
 4397|  3.80M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  3.80M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 187k, False: 3.61M]
  |  |  ------------------
  |  | 2334|  3.80M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4398|  3.80M|	NEXTL(l);
  ------------------
  |  | 2325|  3.80M|#define NEXTL(l) do {							\
  |  | 2326|  3.80M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 1.92k, False: 3.80M]
  |  |  ------------------
  |  | 2327|  1.92k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.80M|    } else ctxt->input->col++;						\
  |  | 2329|  3.80M|    ctxt->input->cur += l;				\
  |  | 2330|  3.80M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.80M]
  |  |  ------------------
  ------------------
 4399|  3.80M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4400|  3.80M|    }
 4401|  18.1k|    buf[len] = 0;
 4402|  18.1k|    if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|  18.1k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  18.1k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 18.1k, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  118|  18.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 16.3k, False: 1.83k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 16.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 16.3k, False: 1.84k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  18.1k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  120|      1|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  |  |  121|      1|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4402:9): [True: 1.84k, False: 16.3k]
  ------------------
 4403|  1.84k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4404|  16.3k|    } else {
 4405|  16.3k|	NEXT;
  ------------------
  |  | 2316|  16.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4406|  16.3k|    }
 4407|  18.1k|    return(buf);
 4408|  18.2k|}
xmlParsePubidLiteral:
 4422|  7.02k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4423|  7.02k|    xmlChar *buf = NULL;
 4424|  7.02k|    int len = 0;
 4425|  7.02k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  7.02k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4426|  7.02k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4426:21): [True: 1.85k, False: 5.17k]
  ------------------
 4427|  1.85k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.85k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4428|  7.02k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  5.17k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4429|  7.02k|    xmlChar cur;
 4430|  7.02k|    xmlChar stop;
 4431|       |
 4432|  7.02k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.02k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4432:9): [True: 1.04k, False: 5.97k]
  ------------------
 4433|  1.04k|        NEXT;
  ------------------
  |  | 2316|  1.04k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|  1.04k|	stop = '"';
 4435|  5.97k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  5.97k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4435:16): [True: 5.46k, False: 517]
  ------------------
 4436|  5.46k|        NEXT;
  ------------------
  |  | 2316|  5.46k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4437|  5.46k|	stop = '\'';
 4438|  5.46k|    } else {
 4439|    517|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4440|    517|	return(NULL);
 4441|    517|    }
 4442|  6.50k|    buf = xmlMalloc(size);
 4443|  6.50k|    if (buf == NULL) {
  ------------------
  |  Branch (4443:9): [True: 2, False: 6.50k]
  ------------------
 4444|      2|	xmlErrMemory(ctxt);
 4445|      2|	return(NULL);
 4446|      2|    }
 4447|  6.50k|    cur = CUR;
  ------------------
  |  | 2262|  6.50k|#define CUR (*ctxt->input->cur)
  ------------------
 4448|   625k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   625k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   625k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4448:12): [True: 623k, False: 1.74k]
  |  Branch (4448:38): [True: 618k, False: 4.75k]
  ------------------
 4449|   618k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   618k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4449:12): [True: 618k, False: 2]
  ------------------
 4450|   618k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4450:6): [True: 419, False: 618k]
  ------------------
 4451|    419|	    xmlChar *tmp;
 4452|    419|            int newSize;
 4453|       |
 4454|    419|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4455|    419|            if (newSize < 0) {
  ------------------
  |  Branch (4455:17): [True: 1, False: 418]
  ------------------
 4456|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4457|      1|                xmlFree(buf);
 4458|      1|                return(NULL);
 4459|      1|            }
 4460|    418|	    tmp = xmlRealloc(buf, newSize);
 4461|    418|	    if (tmp == NULL) {
  ------------------
  |  Branch (4461:10): [True: 2, False: 416]
  ------------------
 4462|      2|		xmlErrMemory(ctxt);
 4463|      2|		xmlFree(buf);
 4464|      2|		return(NULL);
 4465|      2|	    }
 4466|    416|	    buf = tmp;
 4467|    416|            size = newSize;
 4468|    416|	}
 4469|   618k|	buf[len++] = cur;
 4470|   618k|	NEXT;
  ------------------
  |  | 2316|   618k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4471|   618k|	cur = CUR;
  ------------------
  |  | 2262|   618k|#define CUR (*ctxt->input->cur)
  ------------------
 4472|   618k|    }
 4473|  6.49k|    buf[len] = 0;
 4474|  6.49k|    if (cur != stop) {
  ------------------
  |  Branch (4474:9): [True: 1.01k, False: 5.48k]
  ------------------
 4475|  1.01k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4476|  5.48k|    } else {
 4477|  5.48k|	NEXTL(1);
  ------------------
  |  | 2325|  5.48k|#define NEXTL(l) do {							\
  |  | 2326|  5.48k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 5.48k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.48k|    } else ctxt->input->col++;						\
  |  | 2329|  5.48k|    ctxt->input->cur += l;				\
  |  | 2330|  5.48k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.48k]
  |  |  ------------------
  ------------------
 4478|  5.48k|    }
 4479|  6.49k|    return(buf);
 4480|  6.50k|}
xmlParseExternalID:
 4792|  44.4k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4793|  44.4k|    xmlChar *URI = NULL;
 4794|       |
 4795|  44.4k|    *publicId = NULL;
 4796|  44.4k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2273|  44.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  88.9k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  88.9k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 15.3k, False: 29.1k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 15.3k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  44.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 15.3k, False: 6]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 15.3k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 15.3k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 15.3k, False: 5]
  |  |  ------------------
  ------------------
 4797|  15.3k|        SKIP(6);
  ------------------
  |  | 2285|  15.3k|#define SKIP(val) do {							\
  |  | 2286|  15.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  15.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 287, False: 15.0k]
  |  |  ------------------
  |  | 2288|  15.3k|        xmlParserGrow(ctxt);						\
  |  | 2289|  15.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
 4798|  15.3k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  15.3k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4798:6): [True: 881, False: 14.4k]
  ------------------
 4799|    881|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4800|    881|	                   "Space required after 'SYSTEM'\n");
 4801|    881|	}
 4802|  15.3k|	URI = xmlParseSystemLiteral(ctxt);
 4803|  15.3k|	if (URI == NULL) {
  ------------------
  |  Branch (4803:6): [True: 844, False: 14.4k]
  ------------------
 4804|    844|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4805|    844|        }
 4806|  29.1k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2273|  29.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  58.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  58.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.04k, False: 22.1k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.04k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  29.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.03k, False: 8]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.03k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.02k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 7.02k, False: 3]
  |  |  ------------------
  ------------------
 4807|  7.02k|        SKIP(6);
  ------------------
  |  | 2285|  7.02k|#define SKIP(val) do {							\
  |  | 2286|  7.02k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.02k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 256, False: 6.76k]
  |  |  ------------------
  |  | 2288|  7.02k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.02k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.02k]
  |  |  ------------------
  ------------------
 4808|  7.02k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.02k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4808:6): [True: 1.48k, False: 5.53k]
  ------------------
 4809|  1.48k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4810|  1.48k|		    "Space required after 'PUBLIC'\n");
 4811|  1.48k|	}
 4812|  7.02k|	*publicId = xmlParsePubidLiteral(ctxt);
 4813|  7.02k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4813:6): [True: 522, False: 6.49k]
  ------------------
 4814|    522|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4815|    522|	}
 4816|  7.02k|	if (strict) {
  ------------------
  |  Branch (4816:6): [True: 4.83k, False: 2.18k]
  ------------------
 4817|       |	    /*
 4818|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4819|       |	     */
 4820|  4.83k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  4.83k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4820:10): [True: 2.07k, False: 2.76k]
  ------------------
 4821|  2.07k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4822|  2.07k|			"Space required after the Public Identifier\n");
 4823|  2.07k|	    }
 4824|  4.83k|	} else {
 4825|       |	    /*
 4826|       |	     * We handle [83] so we return immediately, if
 4827|       |	     * "S SystemLiteral" is not detected. We skip blanks if no
 4828|       |             * system literal was found, but this is harmless since we must
 4829|       |             * be at the end of a NotationDecl.
 4830|       |	     */
 4831|  2.18k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2312|  2.18k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4831:10): [True: 2.03k, False: 159]
  ------------------
 4832|    159|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|    159|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|     97|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4832:10): [True: 97, False: 62]
  |  Branch (4832:27): [True: 87, False: 10]
  ------------------
 4833|    159|	}
 4834|  4.90k|	URI = xmlParseSystemLiteral(ctxt);
 4835|  4.90k|	if (URI == NULL) {
  ------------------
  |  Branch (4835:6): [True: 1.20k, False: 3.70k]
  ------------------
 4836|  1.20k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4837|  1.20k|        }
 4838|  4.90k|    }
 4839|  42.3k|    return(URI);
 4840|  44.4k|}
xmlParseComment:
 4969|   238k|xmlParseComment(xmlParserCtxt *ctxt) {
 4970|   238k|    xmlChar *buf = NULL;
 4971|   238k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   238k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4972|   238k|    size_t len = 0;
 4973|   238k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4973:24): [True: 86.6k, False: 151k]
  ------------------
 4974|  86.6k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  86.6k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4975|   238k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   389k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4976|   238k|    const xmlChar *in;
 4977|   238k|    size_t nbchar = 0;
 4978|   238k|    int ccol;
 4979|       |
 4980|       |    /*
 4981|       |     * Check that there is a comment right here.
 4982|       |     */
 4983|   238k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2261|   238k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   238k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4983:9): [True: 0, False: 238k]
  |  Branch (4983:25): [True: 0, False: 238k]
  ------------------
 4984|      0|        return;
 4985|   238k|    SKIP(2);
  ------------------
  |  | 2285|   238k|#define SKIP(val) do {							\
  |  | 2286|   238k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   238k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 238k]
  |  |  ------------------
  |  | 2288|   238k|        xmlParserGrow(ctxt);						\
  |  | 2289|   238k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 238k]
  |  |  ------------------
  ------------------
 4986|   238k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2261|   238k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2263|   238k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4986:9): [True: 0, False: 238k]
  |  Branch (4986:25): [True: 22, False: 238k]
  ------------------
 4987|     22|        return;
 4988|   238k|    SKIP(2);
  ------------------
  |  | 2285|   238k|#define SKIP(val) do {							\
  |  | 2286|   238k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   238k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 587, False: 237k]
  |  |  ------------------
  |  | 2288|   238k|        xmlParserGrow(ctxt);						\
  |  | 2289|   238k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 238k]
  |  |  ------------------
  ------------------
 4989|   238k|    GROW;
  ------------------
  |  | 2308|   238k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   238k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   238k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 135k, False: 102k]
  |  |  ------------------
  |  | 2309|   238k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   135k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.2k, False: 123k]
  |  |  ------------------
  |  | 2310|   238k|	xmlParserGrow(ctxt);
  ------------------
 4990|       |
 4991|       |    /*
 4992|       |     * Accelerated common case where input don't need to be
 4993|       |     * modified before passing it to the handler.
 4994|       |     */
 4995|   238k|    in = ctxt->input->cur;
 4996|   238k|    do {
 4997|   238k|	if (*in == 0xA) {
  ------------------
  |  Branch (4997:6): [True: 470, False: 238k]
  ------------------
 4998|  4.72k|	    do {
 4999|  4.72k|		ctxt->input->line++; ctxt->input->col = 1;
 5000|  4.72k|		in++;
 5001|  4.72k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5001:15): [True: 4.25k, False: 470]
  ------------------
 5002|    470|	}
 5003|  1.01M|get_more:
 5004|  1.01M|        ccol = ctxt->input->col;
 5005|  7.24M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (5005:10): [True: 5.09M, False: 2.15M]
  |  Branch (5005:25): [True: 5.00M, False: 84.5k]
  ------------------
 5006|  2.23M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (5006:10): [True: 2.09M, False: 138k]
  |  Branch (5006:27): [True: 1.21M, False: 880k]
  ------------------
 5007|  6.23M|	       (*in == 0x09)) {
  ------------------
  |  Branch (5007:9): [True: 6.71k, False: 1.01M]
  ------------------
 5008|  6.23M|		    in++;
 5009|  6.23M|		    ccol++;
 5010|  6.23M|	}
 5011|  1.01M|	ctxt->input->col = ccol;
 5012|  1.01M|	if (*in == 0xA) {
  ------------------
  |  Branch (5012:6): [True: 49.4k, False: 962k]
  ------------------
 5013|   475k|	    do {
 5014|   475k|		ctxt->input->line++; ctxt->input->col = 1;
 5015|   475k|		in++;
 5016|   475k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5016:15): [True: 426k, False: 49.4k]
  ------------------
 5017|  49.4k|	    goto get_more;
 5018|  49.4k|	}
 5019|   962k|	nbchar = in - ctxt->input->cur;
 5020|       |	/*
 5021|       |	 * save current set of data
 5022|       |	 */
 5023|   962k|	if (nbchar > 0) {
  ------------------
  |  Branch (5023:6): [True: 843k, False: 118k]
  ------------------
 5024|   843k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (5024:17): [True: 0, False: 843k]
  ------------------
 5025|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 5026|      0|                                  "Comment too big found", NULL);
 5027|      0|                xmlFree(buf);
 5028|      0|                return;
 5029|      0|            }
 5030|   843k|            if (buf == NULL) {
  ------------------
  |  Branch (5030:17): [True: 176k, False: 666k]
  ------------------
 5031|   176k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (5031:21): [True: 102k, False: 73.5k]
  |  Branch (5031:37): [True: 52.0k, False: 50.8k]
  ------------------
 5032|  52.0k|                    size = nbchar + 1;
 5033|   124k|                else
 5034|   124k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   124k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5035|   176k|                buf = xmlMalloc(size);
 5036|   176k|                if (buf == NULL) {
  ------------------
  |  Branch (5036:21): [True: 9, False: 176k]
  ------------------
 5037|      9|                    xmlErrMemory(ctxt);
 5038|      9|                    return;
 5039|      9|                }
 5040|   176k|                len = 0;
 5041|   666k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5041:24): [True: 12.1k, False: 654k]
  ------------------
 5042|  12.1k|                xmlChar *new_buf;
 5043|  12.1k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  12.1k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5044|  12.1k|                new_buf = xmlRealloc(buf, size);
 5045|  12.1k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5045:21): [True: 1, False: 12.1k]
  ------------------
 5046|      1|                    xmlErrMemory(ctxt);
 5047|      1|                    xmlFree(buf);
 5048|      1|                    return;
 5049|      1|                }
 5050|  12.1k|                buf = new_buf;
 5051|  12.1k|            }
 5052|   843k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5053|   843k|            len += nbchar;
 5054|   843k|            buf[len] = 0;
 5055|   843k|	}
 5056|   962k|	ctxt->input->cur = in;
 5057|   962k|	if (*in == 0xA) {
  ------------------
  |  Branch (5057:6): [True: 0, False: 962k]
  ------------------
 5058|      0|	    in++;
 5059|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5060|      0|	}
 5061|   962k|	if (*in == 0xD) {
  ------------------
  |  Branch (5061:6): [True: 78.2k, False: 883k]
  ------------------
 5062|  78.2k|	    in++;
 5063|  78.2k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5063:10): [True: 15.0k, False: 63.1k]
  ------------------
 5064|  15.0k|		ctxt->input->cur = in;
 5065|  15.0k|		in++;
 5066|  15.0k|		ctxt->input->line++; ctxt->input->col = 1;
 5067|  15.0k|		goto get_more;
 5068|  15.0k|	    }
 5069|  63.1k|	    in--;
 5070|  63.1k|	}
 5071|   947k|	SHRINK;
  ------------------
  |  | 2304|   947k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   947k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   947k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 832k, False: 114k]
  |  |  ------------------
  |  | 2305|   947k|	xmlParserShrink(ctxt);
  ------------------
 5072|   947k|	GROW;
  ------------------
  |  | 2308|   947k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   947k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   947k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 832k, False: 114k]
  |  |  ------------------
  |  | 2309|   947k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   832k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 21.4k, False: 811k]
  |  |  ------------------
  |  | 2310|   947k|	xmlParserGrow(ctxt);
  ------------------
 5073|   947k|	in = ctxt->input->cur;
 5074|   947k|	if (*in == '-') {
  ------------------
  |  Branch (5074:6): [True: 795k, False: 151k]
  ------------------
 5075|   795k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5075:10): [True: 423k, False: 371k]
  ------------------
 5076|   423k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5076:14): [True: 87.3k, False: 336k]
  ------------------
 5077|  87.3k|		    SKIP(3);
  ------------------
  |  | 2285|  87.3k|#define SKIP(val) do {							\
  |  | 2286|  87.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  87.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 660, False: 86.6k]
  |  |  ------------------
  |  | 2288|  87.3k|        xmlParserGrow(ctxt);						\
  |  | 2289|  87.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 87.3k]
  |  |  ------------------
  ------------------
 5078|  87.3k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5078:11): [True: 87.3k, False: 0]
  |  Branch (5078:34): [True: 87.3k, False: 0]
  ------------------
 5079|  87.3k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5079:11): [True: 82.0k, False: 5.27k]
  ------------------
 5080|  82.0k|			if (buf != NULL)
  ------------------
  |  Branch (5080:8): [True: 46.0k, False: 35.9k]
  ------------------
 5081|  46.0k|			    ctxt->sax->comment(ctxt->userData, buf);
 5082|  35.9k|			else
 5083|  35.9k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|  35.9k|#define BAD_CAST (xmlChar *)
  ------------------
 5084|  82.0k|		    }
 5085|  87.3k|		    if (buf != NULL)
  ------------------
  |  Branch (5085:11): [True: 49.8k, False: 37.4k]
  ------------------
 5086|  49.8k|		        xmlFree(buf);
 5087|  87.3k|		    return;
 5088|  87.3k|		}
 5089|   336k|		if (buf != NULL) {
  ------------------
  |  Branch (5089:7): [True: 285k, False: 50.6k]
  ------------------
 5090|   285k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5091|   285k|		                      "Double hyphen within comment: "
 5092|   285k|                                      "<!--%.50s\n",
 5093|   285k|				      buf);
 5094|   285k|		} else
 5095|  50.6k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5096|  50.6k|		                      "Double hyphen within comment\n", NULL);
 5097|   336k|		in++;
 5098|   336k|		ctxt->input->col++;
 5099|   336k|	    }
 5100|   708k|	    in++;
 5101|   708k|	    ctxt->input->col++;
 5102|   708k|	    goto get_more;
 5103|   795k|	}
 5104|   947k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5104:15): [True: 84.9k, False: 66.5k]
  |  Branch (5104:32): [True: 325, False: 84.5k]
  |  Branch (5104:50): [True: 289, False: 150k]
  |  Branch (5104:67): [True: 0, False: 150k]
  ------------------
 5105|   150k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5106|   150k|}
xmlParsePITarget:
 5121|   180k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5122|   180k|    const xmlChar *name;
 5123|       |
 5124|   180k|    name = xmlParseName(ctxt);
 5125|   180k|    if ((name != NULL) &&
  ------------------
  |  Branch (5125:9): [True: 175k, False: 4.48k]
  ------------------
 5126|   175k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5126:10): [True: 19.8k, False: 155k]
  |  Branch (5126:30): [True: 533, False: 155k]
  ------------------
 5127|  20.4k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5127:10): [True: 17.8k, False: 2.60k]
  |  Branch (5127:30): [True: 375, False: 2.22k]
  ------------------
 5128|  18.2k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5128:10): [True: 8.49k, False: 9.71k]
  |  Branch (5128:30): [True: 360, False: 9.35k]
  ------------------
 5129|  8.85k|	int i;
 5130|  8.85k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5130:6): [True: 8.60k, False: 250]
  |  Branch (5130:26): [True: 8.38k, False: 219]
  ------------------
 5131|  8.38k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5131:6): [True: 8.02k, False: 354]
  |  Branch (5131:26): [True: 6.81k, False: 1.21k]
  ------------------
 5132|  6.81k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5133|  6.81k|		 "XML declaration allowed only at the start of the document\n");
 5134|  6.81k|	    return(name);
 5135|  6.81k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5135:13): [True: 591, False: 1.44k]
  ------------------
 5136|    591|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5137|    591|	    return(name);
 5138|    591|	}
 5139|  3.80k|	for (i = 0;;i++) {
 5140|  3.80k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5140:10): [True: 1.18k, False: 2.62k]
  ------------------
 5141|  2.62k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5141:10): [True: 266, False: 2.36k]
  ------------------
 5142|    266|	        return(name);
 5143|  2.62k|	}
 5144|  1.18k|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5145|  1.18k|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5146|  1.18k|		      NULL, NULL);
 5147|  1.18k|    }
 5148|   172k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5148:9): [True: 168k, False: 4.48k]
  |  Branch (5148:27): [True: 684, False: 167k]
  ------------------
 5149|    684|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5150|    684|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5151|    684|    }
 5152|   172k|    return(name);
 5153|   180k|}
xmlParsePI:
 5235|   180k|xmlParsePI(xmlParserCtxt *ctxt) {
 5236|   180k|    xmlChar *buf = NULL;
 5237|   180k|    size_t len = 0;
 5238|   180k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   180k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5239|   180k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5239:24): [True: 55.9k, False: 124k]
  ------------------
 5240|  55.9k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  55.9k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5241|   180k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   304k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5242|   180k|    int cur, l;
 5243|   180k|    const xmlChar *target;
 5244|       |
 5245|   180k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|   180k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|   180k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5245:9): [True: 180k, False: 0]
  |  Branch (5245:25): [True: 180k, False: 0]
  ------------------
 5246|       |	/*
 5247|       |	 * this is a Processing Instruction.
 5248|       |	 */
 5249|   180k|	SKIP(2);
  ------------------
  |  | 2285|   180k|#define SKIP(val) do {							\
  |  | 2286|   180k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   180k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 336, False: 179k]
  |  |  ------------------
  |  | 2288|   180k|        xmlParserGrow(ctxt);						\
  |  | 2289|   180k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 180k]
  |  |  ------------------
  ------------------
 5250|       |
 5251|       |	/*
 5252|       |	 * Parse the target name and check for special support like
 5253|       |	 * namespace.
 5254|       |	 */
 5255|   180k|        target = xmlParsePITarget(ctxt);
 5256|   180k|	if (target != NULL) {
  ------------------
  |  Branch (5256:6): [True: 175k, False: 4.48k]
  ------------------
 5257|   175k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   175k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   148k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5257:10): [True: 148k, False: 27.2k]
  |  Branch (5257:26): [True: 148k, False: 481]
  ------------------
 5258|   148k|		SKIP(2);
  ------------------
  |  | 2285|   148k|#define SKIP(val) do {							\
  |  | 2286|   148k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   148k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.86k, False: 146k]
  |  |  ------------------
  |  | 2288|   148k|        xmlParserGrow(ctxt);						\
  |  | 2289|   148k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 5259|       |
 5260|       |		/*
 5261|       |		 * SAX: PI detected.
 5262|       |		 */
 5263|   148k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5263:7): [True: 148k, False: 0]
  |  Branch (5263:22): [True: 146k, False: 1.79k]
  ------------------
 5264|   146k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5264:7): [True: 146k, False: 0]
  ------------------
 5265|   146k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5266|   146k|		                                     target, NULL);
 5267|   148k|		return;
 5268|   148k|	    }
 5269|  27.7k|	    buf = xmlMalloc(size);
 5270|  27.7k|	    if (buf == NULL) {
  ------------------
  |  Branch (5270:10): [True: 14, False: 27.7k]
  ------------------
 5271|     14|		xmlErrMemory(ctxt);
 5272|     14|		return;
 5273|     14|	    }
 5274|  27.7k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  27.7k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5274:10): [True: 9.62k, False: 18.1k]
  ------------------
 5275|  9.62k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5276|  9.62k|			  "ParsePI: PI %s space expected\n", target);
 5277|  9.62k|	    }
 5278|  27.7k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5279|  8.75M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  8.75M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  17.5M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 8.74M, False: 9.92k]
  |  |  |  |  |  Branch (117:25): [True: 990k, False: 7.76M]
  |  |  |  |  ------------------
  |  |  |  |  118|  17.5M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   990k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 981k, False: 9.60k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 131k, False: 849k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   990k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 859k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   990k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 849k, False: 9.70k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  17.5M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 7.76M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.72M, False: 5.03M]
  |  |  |  |  ------------------
  |  |  |  |  120|  7.76M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.03M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 5.03M, False: 1.86k]
  |  |  |  |  ------------------
  |  |  |  |  121|  7.76M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.65k, False: 211]
  |  |  |  |  |  Branch (121:27): [True: 1.65k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5280|  8.74M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2263|  20.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5280:7): [True: 8.72M, False: 20.3k]
  |  Branch (5280:23): [True: 2.50k, False: 17.8k]
  ------------------
 5281|  8.73M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5281:7): [True: 16.5k, False: 8.71M]
  ------------------
 5282|  16.5k|		    xmlChar *tmp;
 5283|  16.5k|                    int newSize;
 5284|       |
 5285|  16.5k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5286|  16.5k|                    if (newSize < 0) {
  ------------------
  |  Branch (5286:25): [True: 0, False: 16.5k]
  ------------------
 5287|      0|                        xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5288|      0|                                          "PI %s too big found", target);
 5289|      0|                        xmlFree(buf);
 5290|      0|                        return;
 5291|      0|                    }
 5292|  16.5k|		    tmp = xmlRealloc(buf, newSize);
 5293|  16.5k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5293:11): [True: 6, False: 16.5k]
  ------------------
 5294|      6|			xmlErrMemory(ctxt);
 5295|      6|			xmlFree(buf);
 5296|      6|			return;
 5297|      6|		    }
 5298|  16.5k|		    buf = tmp;
 5299|  16.5k|                    size = newSize;
 5300|  16.5k|		}
 5301|  8.73M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  8.73M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 806k, False: 7.92M]
  |  |  ------------------
  |  | 2334|  8.73M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5302|  8.73M|		NEXTL(l);
  ------------------
  |  | 2325|  8.73M|#define NEXTL(l) do {							\
  |  | 2326|  8.73M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 129k, False: 8.60M]
  |  |  ------------------
  |  | 2327|   129k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  8.60M|    } else ctxt->input->col++;						\
  |  | 2329|  8.73M|    ctxt->input->cur += l;				\
  |  | 2330|  8.73M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 8.73M]
  |  |  ------------------
  ------------------
 5303|  8.73M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5304|  8.73M|	    }
 5305|  27.7k|	    buf[len] = 0;
 5306|  27.7k|	    if (cur != '?') {
  ------------------
  |  Branch (5306:10): [True: 9.92k, False: 17.8k]
  ------------------
 5307|  9.92k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5308|  9.92k|		      "ParsePI: PI %s never end ...\n", target);
 5309|  17.8k|	    } else {
 5310|  17.8k|		SKIP(2);
  ------------------
  |  | 2285|  17.8k|#define SKIP(val) do {							\
  |  | 2286|  17.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  17.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 276, False: 17.5k]
  |  |  ------------------
  |  | 2288|  17.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  17.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 17.8k]
  |  |  ------------------
  ------------------
 5311|       |
 5312|  17.8k|#ifdef LIBXML_CATALOG_ENABLED
 5313|  17.8k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5313:7): [True: 8.09k, False: 9.73k]
  ------------------
 5314|  8.09k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  8.09k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5314:7): [True: 392, False: 7.70k]
  ------------------
 5315|    392|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5316|       |
 5317|    392|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5317:11): [True: 194, False: 198]
  ------------------
 5318|    194|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5318:26): [True: 0, False: 194]
  ------------------
 5319|    194|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5319:5): [True: 0, False: 194]
  ------------------
 5320|      0|			xmlParseCatalogPI(ctxt, buf);
 5321|    392|		}
 5322|  17.8k|#endif
 5323|       |
 5324|       |		/*
 5325|       |		 * SAX: PI detected.
 5326|       |		 */
 5327|  17.8k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5327:7): [True: 17.8k, False: 0]
  |  Branch (5327:22): [True: 17.2k, False: 585]
  ------------------
 5328|  17.2k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5328:7): [True: 17.2k, False: 0]
  ------------------
 5329|  17.2k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5330|  17.2k|		                                     target, buf);
 5331|  17.8k|	    }
 5332|  27.7k|	    xmlFree(buf);
 5333|  27.7k|	} else {
 5334|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5335|  4.48k|	}
 5336|   180k|    }
 5337|   180k|}
xmlParseNotationDecl:
 5359|  4.69k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5360|  4.69k|    const xmlChar *name;
 5361|  4.69k|    xmlChar *Pubid;
 5362|  4.69k|    xmlChar *Systemid;
 5363|       |
 5364|  4.69k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  4.69k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  4.69k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5364:9): [True: 0, False: 4.69k]
  |  Branch (5364:25): [True: 0, False: 4.69k]
  ------------------
 5365|      0|        return;
 5366|  4.69k|    SKIP(2);
  ------------------
  |  | 2285|  4.69k|#define SKIP(val) do {							\
  |  | 2286|  4.69k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.69k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 4.69k]
  |  |  ------------------
  |  | 2288|  4.69k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.69k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.69k]
  |  |  ------------------
  ------------------
 5367|       |
 5368|  4.69k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  4.69k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  9.39k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  9.39k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  9.39k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  9.39k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 4.69k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.68k, False: 9]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  4.69k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.68k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.67k, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.66k, False: 8]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.65k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 4.64k, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 4.63k, False: 7]
  |  |  ------------------
  ------------------
 5369|  4.63k|#ifdef LIBXML_VALID_ENABLED
 5370|  4.63k|	int oldInputNr = ctxt->inputNr;
 5371|  4.63k|#endif
 5372|       |
 5373|  4.63k|	SKIP(8);
  ------------------
  |  | 2285|  4.63k|#define SKIP(val) do {							\
  |  | 2286|  4.63k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.63k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 83, False: 4.55k]
  |  |  ------------------
  |  | 2288|  4.63k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.63k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.63k]
  |  |  ------------------
  ------------------
 5374|  4.63k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  4.63k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5374:6): [True: 381, False: 4.25k]
  ------------------
 5375|    381|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5376|    381|			   "Space required after '<!NOTATION'\n");
 5377|    381|	    return;
 5378|    381|	}
 5379|       |
 5380|  4.25k|        name = xmlParseName(ctxt);
 5381|  4.25k|	if (name == NULL) {
  ------------------
  |  Branch (5381:6): [True: 440, False: 3.81k]
  ------------------
 5382|    440|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5383|    440|	    return;
 5384|    440|	}
 5385|  3.81k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5385:6): [True: 376, False: 3.44k]
  ------------------
 5386|    376|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5387|    376|		     "colons are forbidden from notation names '%s'\n",
 5388|    376|		     name, NULL, NULL);
 5389|    376|	}
 5390|  3.81k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  3.81k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5390:6): [True: 235, False: 3.58k]
  ------------------
 5391|    235|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5392|    235|		     "Space required after the NOTATION name'\n");
 5393|    235|	    return;
 5394|    235|	}
 5395|       |
 5396|       |	/*
 5397|       |	 * Parse the IDs.
 5398|       |	 */
 5399|  3.58k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5400|  3.58k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.58k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5401|       |
 5402|  3.58k|	if (RAW == '>') {
  ------------------
  |  | 2261|  3.58k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5402:6): [True: 2.74k, False: 836]
  ------------------
 5403|  2.74k|#ifdef LIBXML_VALID_ENABLED
 5404|  2.74k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5404:10): [True: 1.75k, False: 989]
  |  Branch (5404:30): [True: 3, False: 1.75k]
  ------------------
 5405|      3|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5406|      3|	                         "Notation declaration doesn't start and stop"
 5407|      3|                                 " in the same entity\n",
 5408|      3|                                 NULL, NULL);
 5409|      3|	    }
 5410|  2.74k|#endif
 5411|  2.74k|	    NEXT;
  ------------------
  |  | 2316|  2.74k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5412|  2.74k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5412:10): [True: 2.74k, False: 0]
  |  Branch (5412:33): [True: 2.41k, False: 335]
  ------------------
 5413|  2.41k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5413:3): [True: 2.41k, False: 0]
  ------------------
 5414|  2.41k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5415|  2.74k|	} else {
 5416|    836|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5417|    836|	}
 5418|  3.58k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5418:6): [True: 1.02k, False: 2.55k]
  ------------------
 5419|  3.58k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5419:6): [True: 2.14k, False: 1.43k]
  ------------------
 5420|  3.58k|    }
 5421|  4.69k|}
xmlParseEntityDecl:
 5447|   203k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5448|   203k|    const xmlChar *name = NULL;
 5449|   203k|    xmlChar *value = NULL;
 5450|   203k|    xmlChar *URI = NULL, *literal = NULL;
 5451|   203k|    const xmlChar *ndata = NULL;
 5452|   203k|    int isParameter = 0;
 5453|   203k|    xmlChar *orig = NULL;
 5454|       |
 5455|   203k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   203k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   203k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5455:9): [True: 0, False: 203k]
  |  Branch (5455:25): [True: 0, False: 203k]
  ------------------
 5456|      0|        return;
 5457|   203k|    SKIP(2);
  ------------------
  |  | 2285|   203k|#define SKIP(val) do {							\
  |  | 2286|   203k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   203k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 203k]
  |  |  ------------------
  |  | 2288|   203k|        xmlParserGrow(ctxt);						\
  |  | 2289|   203k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 203k]
  |  |  ------------------
  ------------------
 5458|       |
 5459|       |    /* GROW; done in the caller */
 5460|   203k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|   203k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   406k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   406k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 203k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 203k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   203k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 203k, False: 19]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 203k, False: 13]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 203k, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 203k, False: 13]
  |  |  ------------------
  ------------------
 5461|   203k|#ifdef LIBXML_VALID_ENABLED
 5462|   203k|	int oldInputNr = ctxt->inputNr;
 5463|   203k|#endif
 5464|       |
 5465|   203k|	SKIP(6);
  ------------------
  |  | 2285|   203k|#define SKIP(val) do {							\
  |  | 2286|   203k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   203k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 227, False: 203k]
  |  |  ------------------
  |  | 2288|   203k|        xmlParserGrow(ctxt);						\
  |  | 2289|   203k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 203k]
  |  |  ------------------
  ------------------
 5466|   203k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   203k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5466:6): [True: 3.02k, False: 200k]
  ------------------
 5467|  3.02k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5468|  3.02k|			   "Space required after '<!ENTITY'\n");
 5469|  3.02k|	}
 5470|       |
 5471|   203k|	if (RAW == '%') {
  ------------------
  |  | 2261|   203k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5471:6): [True: 81.7k, False: 121k]
  ------------------
 5472|  81.7k|	    NEXT;
  ------------------
  |  | 2316|  81.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5473|  81.7k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  81.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5473:10): [True: 437, False: 81.2k]
  ------------------
 5474|    437|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5475|    437|			       "Space required after '%%'\n");
 5476|    437|	    }
 5477|  81.7k|	    isParameter = 1;
 5478|  81.7k|	}
 5479|       |
 5480|   203k|        name = xmlParseName(ctxt);
 5481|   203k|	if (name == NULL) {
  ------------------
  |  Branch (5481:6): [True: 41.8k, False: 161k]
  ------------------
 5482|  41.8k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5483|  41.8k|	                   "xmlParseEntityDecl: no name\n");
 5484|  41.8k|            return;
 5485|  41.8k|	}
 5486|   161k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5486:6): [True: 2.09k, False: 159k]
  ------------------
 5487|  2.09k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5488|  2.09k|		     "colons are forbidden from entities names '%s'\n",
 5489|  2.09k|		     name, NULL, NULL);
 5490|  2.09k|	}
 5491|   161k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   161k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5491:6): [True: 3.82k, False: 157k]
  ------------------
 5492|  3.82k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5493|  3.82k|			   "Space required after the entity name\n");
 5494|  3.82k|	}
 5495|       |
 5496|       |	/*
 5497|       |	 * handle the various case of definitions...
 5498|       |	 */
 5499|   161k|	if (isParameter) {
  ------------------
  |  Branch (5499:6): [True: 80.8k, False: 80.7k]
  ------------------
 5500|  80.8k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  80.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  10.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5500:10): [True: 70.7k, False: 10.0k]
  |  Branch (5500:26): [True: 1.61k, False: 8.46k]
  ------------------
 5501|  72.3k|	        value = xmlParseEntityValue(ctxt, &orig);
 5502|  72.3k|		if (value) {
  ------------------
  |  Branch (5502:7): [True: 71.0k, False: 1.27k]
  ------------------
 5503|  71.0k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5503:11): [True: 71.0k, False: 0]
  ------------------
 5504|  71.0k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5504:4): [True: 67.8k, False: 3.21k]
  |  Branch (5504:27): [True: 67.8k, False: 0]
  ------------------
 5505|  67.8k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5506|  67.8k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5507|  67.8k|				    NULL, NULL, value);
 5508|  71.0k|		}
 5509|  72.3k|	    } else {
 5510|  8.46k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5511|  8.46k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5511:7): [True: 1.53k, False: 6.93k]
  |  Branch (5511:24): [True: 1.17k, False: 358]
  ------------------
 5512|  1.17k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5513|  1.17k|		}
 5514|  8.46k|		if (URI) {
  ------------------
  |  Branch (5514:7): [True: 6.93k, False: 1.53k]
  ------------------
 5515|  6.93k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5515:25): [True: 444, False: 6.48k]
  ------------------
 5516|    444|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5517|  6.48k|                    } else {
 5518|  6.48k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5518:29): [True: 6.48k, False: 0]
  ------------------
 5519|  6.48k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5519:29): [True: 5.94k, False: 543]
  ------------------
 5520|  5.94k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5520:29): [True: 5.94k, False: 0]
  ------------------
 5521|  5.94k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5522|  5.94k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5523|  5.94k|                                        literal, URI, NULL);
 5524|  6.48k|                    }
 5525|  6.93k|		}
 5526|  8.46k|	    }
 5527|  80.8k|	} else {
 5528|  80.7k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  80.7k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  13.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5528:10): [True: 67.6k, False: 13.0k]
  |  Branch (5528:26): [True: 2.61k, False: 10.4k]
  ------------------
 5529|  70.2k|	        value = xmlParseEntityValue(ctxt, &orig);
 5530|  70.2k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5530:7): [True: 70.2k, False: 0]
  ------------------
 5531|  70.2k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5531:7): [True: 68.5k, False: 1.72k]
  |  Branch (5531:30): [True: 68.5k, False: 0]
  ------------------
 5532|  68.5k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5533|  68.5k|				XML_INTERNAL_GENERAL_ENTITY,
 5534|  68.5k|				NULL, NULL, value);
 5535|       |		/*
 5536|       |		 * For expat compatibility in SAX mode.
 5537|       |		 */
 5538|  70.2k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5538:7): [True: 10, False: 70.2k]
  ------------------
 5539|  70.2k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  70.2k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  70.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5539:7): [True: 68, False: 70.2k]
  ------------------
 5540|     78|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5540:11): [True: 10, False: 68]
  ------------------
 5541|     10|			ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|     10|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|     10|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5542|     10|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5542:8): [True: 1, False: 9]
  ------------------
 5543|      1|			    xmlErrMemory(ctxt);
 5544|      1|			    goto done;
 5545|      1|			}
 5546|      9|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5547|      9|		    }
 5548|     77|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5548:11): [True: 9, False: 68]
  ------------------
 5549|      9|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5550|      9|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      9|#define BAD_CAST (xmlChar *)
  ------------------
 5551|      9|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5551:29): [True: 1, False: 8]
  ------------------
 5552|      1|                            xmlErrMemory(ctxt);
 5553|      1|                            goto done;
 5554|      1|                        }
 5555|      9|                    }
 5556|       |
 5557|     76|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5558|     76|			              NULL, NULL, value);
 5559|     76|		}
 5560|  70.2k|	    } else {
 5561|  10.4k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5562|  10.4k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5562:7): [True: 4.14k, False: 6.31k]
  |  Branch (5562:24): [True: 3.80k, False: 345]
  ------------------
 5563|  3.80k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5564|  3.80k|		}
 5565|  10.4k|		if (URI) {
  ------------------
  |  Branch (5565:7): [True: 6.31k, False: 4.14k]
  ------------------
 5566|  6.31k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5566:25): [True: 219, False: 6.09k]
  ------------------
 5567|    219|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5568|    219|                    }
 5569|  6.31k|		}
 5570|  10.4k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2261|  10.4k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2314|  5.96k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5570:7): [True: 5.96k, False: 4.49k]
  |  Branch (5570:23): [True: 4.18k, False: 1.78k]
  ------------------
 5571|  4.18k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5572|  4.18k|				   "Space required before 'NDATA'\n");
 5573|  4.18k|		}
 5574|  10.4k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|  10.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  20.9k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 862, False: 9.59k]
  |  |  |  |  |  Branch (2268:41): [True: 856, False: 6]
  |  |  |  |  ------------------
  |  |  |  | 2269|  10.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 846, False: 10]
  |  |  |  |  |  Branch (2269:41): [True: 841, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 839, False: 2]
  |  |  ------------------
  ------------------
 5575|    839|		    SKIP(5);
  ------------------
  |  | 2285|    839|#define SKIP(val) do {							\
  |  | 2286|    839|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    839|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 89, False: 750]
  |  |  ------------------
  |  | 2288|    839|        xmlParserGrow(ctxt);						\
  |  | 2289|    839|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 839]
  |  |  ------------------
  ------------------
 5576|    839|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|    839|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5576:11): [True: 248, False: 591]
  ------------------
 5577|    248|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5578|    248|				       "Space required after 'NDATA'\n");
 5579|    248|		    }
 5580|    839|		    ndata = xmlParseName(ctxt);
 5581|    839|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5581:11): [True: 839, False: 0]
  |  Branch (5581:34): [True: 558, False: 281]
  ------------------
 5582|    558|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5582:11): [True: 558, False: 0]
  ------------------
 5583|    558|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5584|    558|				    literal, URI, ndata);
 5585|  9.62k|		} else {
 5586|  9.62k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5586:11): [True: 9.62k, False: 0]
  ------------------
 5587|  9.62k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5587:11): [True: 8.03k, False: 1.58k]
  |  Branch (5587:34): [True: 8.03k, False: 0]
  ------------------
 5588|  8.03k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5589|  8.03k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5590|  8.03k|				    literal, URI, NULL);
 5591|       |		    /*
 5592|       |		     * For expat compatibility in SAX mode.
 5593|       |		     * assuming the entity replacement was asked for
 5594|       |		     */
 5595|  9.62k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5595:11): [True: 6.04k, False: 3.58k]
  ------------------
 5596|  6.04k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5596:5): [True: 11, False: 6.03k]
  ------------------
 5597|  6.03k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  6.03k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  6.03k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5597:4): [True: 204, False: 5.82k]
  ------------------
 5598|    215|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5598:8): [True: 11, False: 204]
  ------------------
 5599|     11|			    ctxt->myDoc = xmlNewDoc(SAX_COMPAT_MODE);
  ------------------
  |  |  173|     11|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|     11|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
 5600|     11|			    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5600:12): [True: 1, False: 10]
  ------------------
 5601|      1|			        xmlErrMemory(ctxt);
 5602|      1|				goto done;
 5603|      1|			    }
 5604|     10|			    ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5605|     10|			}
 5606|       |
 5607|    214|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5607:8): [True: 10, False: 204]
  ------------------
 5608|     10|			    ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5609|     10|						BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|     10|#define BAD_CAST (xmlChar *)
  ------------------
 5610|     10|                            if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5610:33): [True: 1, False: 9]
  ------------------
 5611|      1|                                xmlErrMemory(ctxt);
 5612|      1|                                goto done;
 5613|      1|                            }
 5614|     10|                        }
 5615|    213|			xmlSAX2EntityDecl(ctxt, name,
 5616|    213|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5617|    213|				          literal, URI, NULL);
 5618|    213|		    }
 5619|  9.62k|		}
 5620|  10.4k|	    }
 5621|  80.7k|	}
 5622|   161k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   161k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5623|   161k|	if (RAW != '>') {
  ------------------
  |  | 2261|   161k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5623:6): [True: 13.1k, False: 148k]
  ------------------
 5624|  13.1k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5625|  13.1k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5626|   148k|	} else {
 5627|   148k|#ifdef LIBXML_VALID_ENABLED
 5628|   148k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5628:10): [True: 113k, False: 34.9k]
  |  Branch (5628:30): [True: 6, False: 113k]
  ------------------
 5629|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5630|      6|	                         "Entity declaration doesn't start and stop in"
 5631|      6|                                 " the same entity\n",
 5632|      6|                                 NULL, NULL);
 5633|      6|	    }
 5634|   148k|#endif
 5635|   148k|	    NEXT;
  ------------------
  |  | 2316|   148k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5636|   148k|	}
 5637|   161k|	if (orig != NULL) {
  ------------------
  |  Branch (5637:6): [True: 138k, False: 22.8k]
  ------------------
 5638|       |	    /*
 5639|       |	     * Ugly mechanism to save the raw entity value.
 5640|       |	     */
 5641|   138k|	    xmlEntityPtr cur = NULL;
 5642|       |
 5643|   138k|	    if (isParameter) {
  ------------------
  |  Branch (5643:10): [True: 71.0k, False: 67.5k]
  ------------------
 5644|  71.0k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5644:14): [True: 71.0k, False: 0]
  ------------------
 5645|  71.0k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5645:7): [True: 71.0k, False: 0]
  ------------------
 5646|  71.0k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5647|  71.0k|	    } else {
 5648|  67.5k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5648:14): [True: 67.5k, False: 0]
  ------------------
 5649|  67.5k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5649:7): [True: 67.5k, False: 0]
  ------------------
 5650|  67.5k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5651|  67.5k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5651:7): [True: 1.29k, False: 66.2k]
  |  Branch (5651:24): [True: 1.29k, False: 0]
  ------------------
 5652|  1.29k|		    cur = xmlSAX2GetEntity(ctxt, name);
 5653|  1.29k|		}
 5654|  67.5k|	    }
 5655|   138k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5655:17): [True: 134k, False: 4.31k]
  |  Branch (5655:34): [True: 15.6k, False: 118k]
  ------------------
 5656|  15.6k|		cur->orig = orig;
 5657|  15.6k|                orig = NULL;
 5658|  15.6k|	    }
 5659|   138k|	}
 5660|       |
 5661|   161k|done:
 5662|   161k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5662:6): [True: 138k, False: 22.9k]
  ------------------
 5663|   161k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5663:6): [True: 13.2k, False: 148k]
  ------------------
 5664|   161k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5664:6): [True: 3.53k, False: 158k]
  ------------------
 5665|   161k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5665:13): [True: 123k, False: 38.5k]
  ------------------
 5666|   161k|    }
 5667|   203k|}
xmlParseDefaultDecl:
 5699|   127k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5700|   127k|    int val;
 5701|   127k|    xmlChar *ret;
 5702|       |
 5703|   127k|    *value = NULL;
 5704|   127k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2279|   127k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|   255k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|   255k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|   255k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|   255k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|   255k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 59.4k, False: 68.4k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.59k, False: 54.8k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|   127k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.58k, False: 8]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.57k, False: 9]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.56k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.56k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 4.55k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 4.54k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|   127k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 4.54k, False: 3]
  |  |  ------------------
  ------------------
 5705|  4.54k|	SKIP(9);
  ------------------
  |  | 2285|  4.54k|#define SKIP(val) do {							\
  |  | 2286|  4.54k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.54k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 316, False: 4.22k]
  |  |  ------------------
  |  | 2288|  4.54k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.54k]
  |  |  ------------------
  ------------------
 5706|  4.54k|	return(XML_ATTRIBUTE_REQUIRED);
 5707|  4.54k|    }
 5708|   123k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2277|   123k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   246k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   246k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   246k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   246k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 54.8k, False: 68.4k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 40.0k, False: 14.8k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   123k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 40.0k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 40.0k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 40.0k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 40.0k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 40.0k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 40.0k, False: 4]
  |  |  ------------------
  ------------------
 5709|  40.0k|	SKIP(8);
  ------------------
  |  | 2285|  40.0k|#define SKIP(val) do {							\
  |  | 2286|  40.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  40.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.35k, False: 38.6k]
  |  |  ------------------
  |  | 2288|  40.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  40.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 40.0k]
  |  |  ------------------
  ------------------
 5710|  40.0k|	return(XML_ATTRIBUTE_IMPLIED);
 5711|  40.0k|    }
 5712|  83.2k|    val = XML_ATTRIBUTE_NONE;
 5713|  83.2k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2273|  83.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   166k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   166k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 14.8k, False: 68.4k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 14.7k, False: 101]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  83.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 14.7k, False: 6]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 14.7k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 14.7k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 14.7k, False: 6]
  |  |  ------------------
  ------------------
 5714|  14.7k|	SKIP(6);
  ------------------
  |  | 2285|  14.7k|#define SKIP(val) do {							\
  |  | 2286|  14.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  14.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 80, False: 14.6k]
  |  |  ------------------
  |  | 2288|  14.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  14.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 14.7k]
  |  |  ------------------
  ------------------
 5715|  14.7k|	val = XML_ATTRIBUTE_FIXED;
 5716|  14.7k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  14.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5716:6): [True: 691, False: 14.0k]
  ------------------
 5717|    691|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5718|    691|			   "Space required after '#FIXED'\n");
 5719|    691|	}
 5720|  14.7k|    }
 5721|  83.2k|    ret = xmlParseAttValue(ctxt);
 5722|  83.2k|    if (ret == NULL) {
  ------------------
  |  Branch (5722:9): [True: 49.7k, False: 33.5k]
  ------------------
 5723|  49.7k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5724|  49.7k|		       "Attribute default value declaration error\n");
 5725|  49.7k|    } else
 5726|  33.5k|        *value = ret;
 5727|  83.2k|    return(val);
 5728|   123k|}
xmlParseNotationType:
 5748|  5.10k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5749|  5.10k|    const xmlChar *name;
 5750|  5.10k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5751|       |
 5752|  5.10k|    if (RAW != '(') {
  ------------------
  |  | 2261|  5.10k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5752:9): [True: 613, False: 4.49k]
  ------------------
 5753|    613|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5754|    613|	return(NULL);
 5755|    613|    }
 5756|  5.33k|    do {
 5757|  5.33k|        NEXT;
  ------------------
  |  | 2316|  5.33k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5758|  5.33k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  5.33k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5759|  5.33k|        name = xmlParseName(ctxt);
 5760|  5.33k|	if (name == NULL) {
  ------------------
  |  Branch (5760:6): [True: 216, False: 5.12k]
  ------------------
 5761|    216|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5762|    216|			   "Name expected in NOTATION declaration\n");
 5763|    216|            xmlFreeEnumeration(ret);
 5764|    216|	    return(NULL);
 5765|    216|	}
 5766|  5.12k|        tmp = NULL;
 5767|  5.12k|#ifdef LIBXML_VALID_ENABLED
 5768|  5.12k|        if (ctxt->validate) {
  ------------------
  |  Branch (5768:13): [True: 2.78k, False: 2.33k]
  ------------------
 5769|  2.78k|            tmp = ret;
 5770|  3.94k|            while (tmp != NULL) {
  ------------------
  |  Branch (5770:20): [True: 1.37k, False: 2.56k]
  ------------------
 5771|  1.37k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5771:21): [True: 220, False: 1.15k]
  ------------------
 5772|    220|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5773|    220|              "standalone: attribute notation value token %s duplicated\n",
 5774|    220|                                     name, NULL);
 5775|    220|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5775:25): [True: 0, False: 220]
  ------------------
 5776|      0|                        xmlFree((xmlChar *) name);
 5777|    220|                    break;
 5778|    220|                }
 5779|  1.15k|                tmp = tmp->next;
 5780|  1.15k|            }
 5781|  2.78k|        }
 5782|  5.12k|#endif /* LIBXML_VALID_ENABLED */
 5783|  5.12k|	if (tmp == NULL) {
  ------------------
  |  Branch (5783:6): [True: 4.90k, False: 220]
  ------------------
 5784|  4.90k|	    cur = xmlCreateEnumeration(name);
 5785|  4.90k|	    if (cur == NULL) {
  ------------------
  |  Branch (5785:10): [True: 2, False: 4.90k]
  ------------------
 5786|      2|                xmlErrMemory(ctxt);
 5787|      2|                xmlFreeEnumeration(ret);
 5788|      2|                return(NULL);
 5789|      2|            }
 5790|  4.90k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5790:10): [True: 4.27k, False: 625]
  ------------------
 5791|    625|	    else {
 5792|    625|		last->next = cur;
 5793|    625|		last = cur;
 5794|    625|	    }
 5795|  4.90k|	}
 5796|  5.12k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  5.12k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  5.12k|    } while (RAW == '|');
  ------------------
  |  | 2261|  5.12k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5797:14): [True: 848, False: 4.27k]
  ------------------
 5798|  4.27k|    if (RAW != ')') {
  ------------------
  |  | 2261|  4.27k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5798:9): [True: 966, False: 3.30k]
  ------------------
 5799|    966|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5800|    966|        xmlFreeEnumeration(ret);
 5801|    966|	return(NULL);
 5802|    966|    }
 5803|  3.30k|    NEXT;
  ------------------
  |  | 2316|  3.30k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5804|  3.30k|    return(ret);
 5805|  4.27k|}
xmlParseEnumerationType:
 5823|  37.7k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5824|  37.7k|    xmlChar *name;
 5825|  37.7k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5826|       |
 5827|  37.7k|    if (RAW != '(') {
  ------------------
  |  | 2261|  37.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5827:9): [True: 2.34k, False: 35.3k]
  ------------------
 5828|  2.34k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5829|  2.34k|	return(NULL);
 5830|  2.34k|    }
 5831|  43.2k|    do {
 5832|  43.2k|        NEXT;
  ------------------
  |  | 2316|  43.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5833|  43.2k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  43.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5834|  43.2k|        name = xmlParseNmtoken(ctxt);
 5835|  43.2k|	if (name == NULL) {
  ------------------
  |  Branch (5835:6): [True: 423, False: 42.8k]
  ------------------
 5836|    423|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5837|    423|	    return(ret);
 5838|    423|	}
 5839|  42.8k|        tmp = NULL;
 5840|  42.8k|#ifdef LIBXML_VALID_ENABLED
 5841|  42.8k|        if (ctxt->validate) {
  ------------------
  |  Branch (5841:13): [True: 35.3k, False: 7.50k]
  ------------------
 5842|  35.3k|            tmp = ret;
 5843|  51.8k|            while (tmp != NULL) {
  ------------------
  |  Branch (5843:20): [True: 16.8k, False: 35.0k]
  ------------------
 5844|  16.8k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5844:21): [True: 347, False: 16.5k]
  ------------------
 5845|    347|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5846|    347|              "standalone: attribute enumeration value token %s duplicated\n",
 5847|    347|                                     name, NULL);
 5848|    347|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5848:25): [True: 347, False: 0]
  ------------------
 5849|    347|                        xmlFree(name);
 5850|    347|                    break;
 5851|    347|                }
 5852|  16.5k|                tmp = tmp->next;
 5853|  16.5k|            }
 5854|  35.3k|        }
 5855|  42.8k|#endif /* LIBXML_VALID_ENABLED */
 5856|  42.8k|	if (tmp == NULL) {
  ------------------
  |  Branch (5856:6): [True: 42.5k, False: 347]
  ------------------
 5857|  42.5k|	    cur = xmlCreateEnumeration(name);
 5858|  42.5k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5858:10): [True: 42.5k, False: 0]
  ------------------
 5859|  42.5k|		xmlFree(name);
 5860|  42.5k|	    if (cur == NULL) {
  ------------------
  |  Branch (5860:10): [True: 2, False: 42.5k]
  ------------------
 5861|      2|                xmlErrMemory(ctxt);
 5862|      2|                xmlFreeEnumeration(ret);
 5863|      2|                return(NULL);
 5864|      2|            }
 5865|  42.5k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5865:10): [True: 34.9k, False: 7.55k]
  ------------------
 5866|  7.55k|	    else {
 5867|  7.55k|		last->next = cur;
 5868|  7.55k|		last = cur;
 5869|  7.55k|	    }
 5870|  42.5k|	}
 5871|  42.8k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  42.8k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5872|  42.8k|    } while (RAW == '|');
  ------------------
  |  | 2261|  42.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5872:14): [True: 7.90k, False: 34.9k]
  ------------------
 5873|  34.9k|    if (RAW != ')') {
  ------------------
  |  | 2261|  34.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5873:9): [True: 1.31k, False: 33.6k]
  ------------------
 5874|  1.31k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5875|  1.31k|	return(ret);
 5876|  1.31k|    }
 5877|  33.6k|    NEXT;
  ------------------
  |  | 2316|  33.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5878|  33.6k|    return(ret);
 5879|  34.9k|}
xmlParseEnumeratedType:
 5896|  43.1k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5897|  43.1k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  43.1k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  86.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  86.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  86.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  86.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 5.47k, False: 37.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 5.43k, False: 38]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  43.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 5.43k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 5.42k, False: 2]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 5.42k, False: 5]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 5.41k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 5.41k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 5.41k, False: 1]
  |  |  ------------------
  ------------------
 5898|  5.41k|	SKIP(8);
  ------------------
  |  | 2285|  5.41k|#define SKIP(val) do {							\
  |  | 2286|  5.41k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.41k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 231, False: 5.17k]
  |  |  ------------------
  |  | 2288|  5.41k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.41k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.41k]
  |  |  ------------------
  ------------------
 5899|  5.41k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  5.41k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5899:6): [True: 306, False: 5.10k]
  ------------------
 5900|    306|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5901|    306|			   "Space required after 'NOTATION'\n");
 5902|    306|	    return(0);
 5903|    306|	}
 5904|  5.10k|	*tree = xmlParseNotationType(ctxt);
 5905|  5.10k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5905:6): [True: 1.79k, False: 3.30k]
  ------------------
 5906|  3.30k|	return(XML_ATTRIBUTE_NOTATION);
 5907|  5.10k|    }
 5908|  37.7k|    *tree = xmlParseEnumerationType(ctxt);
 5909|  37.7k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5909:9): [True: 2.76k, False: 34.9k]
  ------------------
 5910|  34.9k|    return(XML_ATTRIBUTE_ENUMERATION);
 5911|  37.7k|}
xmlParseAttributeType:
 5959|   135k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5960|   135k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|   135k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   271k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 14.0k, False: 121k]
  |  |  |  |  |  Branch (2268:41): [True: 14.0k, False: 10]
  |  |  |  |  ------------------
  |  |  |  | 2269|   135k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 14.0k, False: 10]
  |  |  |  |  |  Branch (2269:41): [True: 13.9k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 13.9k, False: 6]
  |  |  ------------------
  ------------------
 5961|  13.9k|	SKIP(5);
  ------------------
  |  | 2285|  13.9k|#define SKIP(val) do {							\
  |  | 2286|  13.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 80, False: 13.9k]
  |  |  ------------------
  |  | 2288|  13.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
 5962|  13.9k|	return(XML_ATTRIBUTE_CDATA);
 5963|   121k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2273|   121k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   243k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   243k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 23.9k, False: 97.6k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 23.9k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   121k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 11.2k, False: 12.6k]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 11.2k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 11.2k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 1.77k, False: 9.50k]
  |  |  ------------------
  ------------------
 5964|  1.77k|	SKIP(6);
  ------------------
  |  | 2285|  1.77k|#define SKIP(val) do {							\
  |  | 2286|  1.77k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.77k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 66, False: 1.71k]
  |  |  ------------------
  |  | 2288|  1.77k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.77k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.77k]
  |  |  ------------------
  ------------------
 5965|  1.77k|	return(XML_ATTRIBUTE_IDREFS);
 5966|   119k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2271|   119k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   239k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 22.1k, False: 97.6k]
  |  |  |  |  |  Branch (2268:41): [True: 22.1k, False: 9]
  |  |  |  |  ------------------
  |  |  |  | 2269|   119k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 9.51k, False: 12.6k]
  |  |  |  |  |  Branch (2269:41): [True: 9.51k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 9.50k, False: 6]
  |  |  ------------------
  ------------------
 5967|  9.50k|	SKIP(5);
  ------------------
  |  | 2285|  9.50k|#define SKIP(val) do {							\
  |  | 2286|  9.50k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  9.50k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 240, False: 9.26k]
  |  |  ------------------
  |  | 2288|  9.50k|        xmlParserGrow(ctxt);						\
  |  | 2289|  9.50k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 9.50k]
  |  |  ------------------
  ------------------
 5968|  9.50k|	return(XML_ATTRIBUTE_IDREF);
 5969|   110k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2261|   110k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2263|  12.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5969:17): [True: 12.6k, False: 97.6k]
  |  Branch (5969:33): [True: 12.6k, False: 9]
  ------------------
 5970|  12.6k|        SKIP(2);
  ------------------
  |  | 2285|  12.6k|#define SKIP(val) do {							\
  |  | 2286|  12.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  12.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 209, False: 12.4k]
  |  |  ------------------
  |  | 2288|  12.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  12.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 12.6k]
  |  |  ------------------
  ------------------
 5971|  12.6k|	return(XML_ATTRIBUTE_ID);
 5972|  97.6k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|  97.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   195k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   195k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 6.41k, False: 91.2k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 6.40k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  97.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 6.40k, False: 1]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 6.39k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 6.39k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 4.05k, False: 2.34k]
  |  |  ------------------
  ------------------
 5973|  4.05k|	SKIP(6);
  ------------------
  |  | 2285|  4.05k|#define SKIP(val) do {							\
  |  | 2286|  4.05k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.05k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 68, False: 3.98k]
  |  |  ------------------
  |  | 2288|  4.05k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.05k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.05k]
  |  |  ------------------
  ------------------
 5974|  4.05k|	return(XML_ATTRIBUTE_ENTITY);
 5975|  93.5k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2277|  93.5k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   187k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   187k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   187k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   187k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.35k, False: 91.2k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.34k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  93.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.34k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.34k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.34k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.33k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 2.33k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 2.33k, False: 1]
  |  |  ------------------
  ------------------
 5976|  2.33k|	SKIP(8);
  ------------------
  |  | 2285|  2.33k|#define SKIP(val) do {							\
  |  | 2286|  2.33k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.33k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 219, False: 2.11k]
  |  |  ------------------
  |  | 2288|  2.33k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.33k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.33k]
  |  |  ------------------
  ------------------
 5977|  2.33k|	return(XML_ATTRIBUTE_ENTITIES);
 5978|  91.2k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2277|  91.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   182k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   182k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   182k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   182k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 53.5k, False: 37.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 48.1k, False: 5.43k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  91.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 48.1k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 48.1k, False: 12]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 48.1k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 48.1k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 48.1k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 42.0k, False: 6.08k]
  |  |  ------------------
  ------------------
 5979|  42.0k|	SKIP(8);
  ------------------
  |  | 2285|  42.0k|#define SKIP(val) do {							\
  |  | 2286|  42.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  42.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 206, False: 41.8k]
  |  |  ------------------
  |  | 2288|  42.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  42.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 42.0k]
  |  |  ------------------
  ------------------
 5980|  42.0k|	return(XML_ATTRIBUTE_NMTOKENS);
 5981|  49.2k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2275|  49.2k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  98.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  98.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  98.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 11.5k, False: 37.6k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 6.11k, False: 5.43k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  49.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 6.11k, False: 7]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 6.10k, False: 12]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 6.09k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 6.08k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 6.08k, False: 6]
  |  |  ------------------
  ------------------
 5982|  6.08k|	SKIP(7);
  ------------------
  |  | 2285|  6.08k|#define SKIP(val) do {							\
  |  | 2286|  6.08k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.08k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 238, False: 5.84k]
  |  |  ------------------
  |  | 2288|  6.08k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.08k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.08k]
  |  |  ------------------
  ------------------
 5983|  6.08k|	return(XML_ATTRIBUTE_NMTOKEN);
 5984|  6.08k|     }
 5985|  43.1k|     return(xmlParseEnumeratedType(ctxt, tree));
 5986|   135k|}
xmlParseAttributeListDecl:
 5999|   113k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 6000|   113k|    const xmlChar *elemName;
 6001|   113k|    const xmlChar *attrName;
 6002|   113k|    xmlEnumerationPtr tree;
 6003|       |
 6004|   113k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   113k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   113k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6004:9): [True: 0, False: 113k]
  |  Branch (6004:25): [True: 0, False: 113k]
  ------------------
 6005|      0|        return;
 6006|   113k|    SKIP(2);
  ------------------
  |  | 2285|   113k|#define SKIP(val) do {							\
  |  | 2286|   113k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   113k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 113k]
  |  |  ------------------
  |  | 2288|   113k|        xmlParserGrow(ctxt);						\
  |  | 2289|   113k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 113k]
  |  |  ------------------
  ------------------
 6007|       |
 6008|   113k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2275|   113k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   227k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   227k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   227k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 113k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 113k, False: 18]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   113k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 113k, False: 30]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 113k, False: 12]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 113k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 113k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 113k, False: 12]
  |  |  ------------------
  ------------------
 6009|   113k|#ifdef LIBXML_VALID_ENABLED
 6010|   113k|	int oldInputNr = ctxt->inputNr;
 6011|   113k|#endif
 6012|       |
 6013|   113k|	SKIP(7);
  ------------------
  |  | 2285|   113k|#define SKIP(val) do {							\
  |  | 2286|   113k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   113k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 296, False: 113k]
  |  |  ------------------
  |  | 2288|   113k|        xmlParserGrow(ctxt);						\
  |  | 2289|   113k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 113k]
  |  |  ------------------
  ------------------
 6014|   113k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   113k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6014:6): [True: 2.79k, False: 110k]
  ------------------
 6015|  2.79k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6016|  2.79k|		                 "Space required after '<!ATTLIST'\n");
 6017|  2.79k|	}
 6018|   113k|        elemName = xmlParseName(ctxt);
 6019|   113k|	if (elemName == NULL) {
  ------------------
  |  Branch (6019:6): [True: 649, False: 112k]
  ------------------
 6020|    649|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6021|    649|			   "ATTLIST: no name for Element\n");
 6022|    649|	    return;
 6023|    649|	}
 6024|   112k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   112k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6025|   112k|	GROW;
  ------------------
  |  | 2308|   112k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   112k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   112k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 106k, False: 6.71k]
  |  |  ------------------
  |  | 2309|   112k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   106k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 51.3k, False: 54.7k]
  |  |  ------------------
  |  | 2310|   112k|	xmlParserGrow(ctxt);
  ------------------
 6026|   194k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|   194k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   146k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6026:9): [True: 146k, False: 48.2k]
  |  Branch (6026:25): [True: 146k, False: 28]
  ------------------
 6027|   146k|	    int type;
 6028|   146k|	    int def;
 6029|   146k|	    xmlChar *defaultValue = NULL;
 6030|       |
 6031|   146k|	    GROW;
  ------------------
  |  | 2308|   146k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   146k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   146k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 131k, False: 14.9k]
  |  |  ------------------
  |  | 2309|   146k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   131k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 62.9k, False: 68.5k]
  |  |  ------------------
  |  | 2310|   146k|	xmlParserGrow(ctxt);
  ------------------
 6032|   146k|            tree = NULL;
 6033|   146k|	    attrName = xmlParseName(ctxt);
 6034|   146k|	    if (attrName == NULL) {
  ------------------
  |  Branch (6034:10): [True: 8.65k, False: 137k]
  ------------------
 6035|  8.65k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6036|  8.65k|			       "ATTLIST: no name for Attribute\n");
 6037|  8.65k|		break;
 6038|  8.65k|	    }
 6039|   137k|	    GROW;
  ------------------
  |  | 2308|   137k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   137k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   137k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 123k, False: 14.5k]
  |  |  ------------------
  |  | 2309|   137k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   123k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 59.8k, False: 63.4k]
  |  |  ------------------
  |  | 2310|   137k|	xmlParserGrow(ctxt);
  ------------------
 6040|   137k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   137k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6040:10): [True: 2.23k, False: 135k]
  ------------------
 6041|  2.23k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6042|  2.23k|		        "Space required after the attribute name\n");
 6043|  2.23k|		break;
 6044|  2.23k|	    }
 6045|       |
 6046|   135k|	    type = xmlParseAttributeType(ctxt, &tree);
 6047|   135k|	    if (type <= 0) {
  ------------------
  |  Branch (6047:10): [True: 4.87k, False: 130k]
  ------------------
 6048|  4.87k|	        break;
 6049|  4.87k|	    }
 6050|       |
 6051|   130k|	    GROW;
  ------------------
  |  | 2308|   130k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   130k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   130k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 116k, False: 14.1k]
  |  |  ------------------
  |  | 2309|   130k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   116k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 55.1k, False: 61.4k]
  |  |  ------------------
  |  | 2310|   130k|	xmlParserGrow(ctxt);
  ------------------
 6052|   130k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   130k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6052:10): [True: 2.82k, False: 127k]
  ------------------
 6053|  2.82k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6054|  2.82k|			       "Space required after the attribute type\n");
 6055|  2.82k|	        if (tree != NULL)
  ------------------
  |  Branch (6055:14): [True: 1.33k, False: 1.48k]
  ------------------
 6056|  1.33k|		    xmlFreeEnumeration(tree);
 6057|  2.82k|		break;
 6058|  2.82k|	    }
 6059|       |
 6060|   127k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6061|   127k|	    if (def <= 0) {
  ------------------
  |  Branch (6061:10): [True: 0, False: 127k]
  ------------------
 6062|      0|                if (defaultValue != NULL)
  ------------------
  |  Branch (6062:21): [True: 0, False: 0]
  ------------------
 6063|      0|		    xmlFree(defaultValue);
 6064|      0|	        if (tree != NULL)
  ------------------
  |  Branch (6064:14): [True: 0, False: 0]
  ------------------
 6065|      0|		    xmlFreeEnumeration(tree);
 6066|      0|	        break;
 6067|      0|	    }
 6068|   127k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6068:10): [True: 113k, False: 13.9k]
  |  Branch (6068:43): [True: 31.3k, False: 82.6k]
  ------------------
 6069|  31.3k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6070|       |
 6071|   127k|	    GROW;
  ------------------
  |  | 2308|   127k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   127k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   127k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 113k, False: 14.0k]
  |  |  ------------------
  |  | 2309|   127k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   113k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 79.5k, False: 34.2k]
  |  |  ------------------
  |  | 2310|   127k|	xmlParserGrow(ctxt);
  ------------------
 6072|   127k|            if (RAW != '>') {
  ------------------
  |  | 2261|   127k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6072:17): [True: 87.5k, False: 40.3k]
  ------------------
 6073|  87.5k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  87.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6073:7): [True: 45.8k, False: 41.6k]
  ------------------
 6074|  45.8k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6075|  45.8k|			"Space required after the attribute default value\n");
 6076|  45.8k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6076:11): [True: 1.11k, False: 44.7k]
  ------------------
 6077|  1.11k|			xmlFree(defaultValue);
 6078|  45.8k|		    if (tree != NULL)
  ------------------
  |  Branch (6078:11): [True: 3.27k, False: 42.6k]
  ------------------
 6079|  3.27k|			xmlFreeEnumeration(tree);
 6080|  45.8k|		    break;
 6081|  45.8k|		}
 6082|  87.5k|	    }
 6083|  81.9k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6083:10): [True: 81.9k, False: 0]
  |  Branch (6083:33): [True: 76.8k, False: 5.14k]
  ------------------
 6084|  76.8k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6084:3): [True: 76.8k, False: 0]
  ------------------
 6085|  76.8k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6086|  76.8k|	                        type, def, defaultValue, tree);
 6087|  5.14k|	    else if (tree != NULL)
  ------------------
  |  Branch (6087:15): [True: 1.37k, False: 3.77k]
  ------------------
 6088|  1.37k|		xmlFreeEnumeration(tree);
 6089|       |
 6090|  81.9k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6090:10): [True: 61.9k, False: 20.0k]
  |  Branch (6090:26): [True: 22.2k, False: 39.6k]
  ------------------
 6091|  22.2k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6091:10): [True: 22.2k, False: 0]
  ------------------
 6092|  22.2k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6092:3): [True: 22.2k, False: 0]
  ------------------
 6093|  22.2k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6094|  22.2k|	    }
 6095|  81.9k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6095:10): [True: 61.9k, False: 20.0k]
  ------------------
 6096|  61.9k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6097|  61.9k|	    }
 6098|  81.9k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6098:10): [True: 32.4k, False: 49.5k]
  ------------------
 6099|  32.4k|	        xmlFree(defaultValue);
 6100|  81.9k|	    GROW;
  ------------------
  |  | 2308|  81.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  81.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  81.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 68.1k, False: 13.8k]
  |  |  ------------------
  |  | 2309|  81.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  68.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 25.2k, False: 42.9k]
  |  |  ------------------
  |  | 2310|  81.9k|	xmlParserGrow(ctxt);
  ------------------
 6101|  81.9k|	}
 6102|   112k|	if (RAW == '>') {
  ------------------
  |  | 2261|   112k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6102:6): [True: 50.0k, False: 62.6k]
  ------------------
 6103|  50.0k|#ifdef LIBXML_VALID_ENABLED
 6104|  50.0k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6104:10): [True: 42.6k, False: 7.42k]
  |  Branch (6104:30): [True: 97, False: 42.5k]
  ------------------
 6105|     97|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6106|     97|                                 "Attribute list declaration doesn't start and"
 6107|     97|                                 " stop in the same entity\n",
 6108|     97|                                 NULL, NULL);
 6109|     97|	    }
 6110|  50.0k|#endif
 6111|  50.0k|	    NEXT;
  ------------------
  |  | 2316|  50.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6112|  50.0k|	}
 6113|   112k|    }
 6114|   113k|}
xmlParseElementMixedContentDecl:
 6179|  7.65k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6180|  7.65k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6181|  7.65k|    const xmlChar *elem = NULL;
 6182|       |
 6183|  7.65k|    GROW;
  ------------------
  |  | 2308|  7.65k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.65k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.65k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.10k, False: 1.55k]
  |  |  ------------------
  |  | 2309|  7.65k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.10k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.19k, False: 2.91k]
  |  |  ------------------
  |  | 2310|  7.65k|	xmlParserGrow(ctxt);
  ------------------
 6184|  7.65k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  7.65k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  15.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  15.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  15.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.65k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.65k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  7.65k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.65k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.65k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.65k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.65k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.65k, False: 0]
  |  |  ------------------
  ------------------
 6185|  7.65k|	SKIP(7);
  ------------------
  |  | 2285|  7.65k|#define SKIP(val) do {							\
  |  | 2286|  7.65k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.65k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 212, False: 7.44k]
  |  |  ------------------
  |  | 2288|  7.65k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.65k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.65k]
  |  |  ------------------
  ------------------
 6186|  7.65k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6187|  7.65k|	if (RAW == ')') {
  ------------------
  |  | 2261|  7.65k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6187:6): [True: 3.56k, False: 4.09k]
  ------------------
 6188|  3.56k|#ifdef LIBXML_VALID_ENABLED
 6189|  3.56k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6189:10): [True: 2.61k, False: 951]
  |  Branch (6189:30): [True: 10, False: 2.60k]
  ------------------
 6190|     10|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6191|     10|                                 "Element content declaration doesn't start "
 6192|     10|                                 "and stop in the same entity\n",
 6193|     10|                                 NULL, NULL);
 6194|     10|	    }
 6195|  3.56k|#endif
 6196|  3.56k|	    NEXT;
  ------------------
  |  | 2316|  3.56k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6197|  3.56k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6198|  3.56k|	    if (ret == NULL)
  ------------------
  |  Branch (6198:10): [True: 1, False: 3.56k]
  ------------------
 6199|      1|                goto mem_error;
 6200|  3.56k|	    if (RAW == '*') {
  ------------------
  |  | 2261|  3.56k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6200:10): [True: 273, False: 3.28k]
  ------------------
 6201|    273|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6202|    273|		NEXT;
  ------------------
  |  | 2316|    273|#define NEXT xmlNextChar(ctxt)
  ------------------
 6203|    273|	    }
 6204|  3.56k|	    return(ret);
 6205|  3.56k|	}
 6206|  4.09k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  4.09k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  4.08k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6206:6): [True: 2, False: 4.08k]
  |  Branch (6206:22): [True: 3.00k, False: 1.08k]
  ------------------
 6207|  3.00k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6208|  3.00k|	    if (ret == NULL)
  ------------------
  |  Branch (6208:10): [True: 2, False: 3.00k]
  ------------------
 6209|      2|                goto mem_error;
 6210|  3.00k|	}
 6211|  25.5k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  25.5k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  21.5k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6211:9): [True: 21.5k, False: 3.97k]
  |  Branch (6211:25): [True: 21.5k, False: 1]
  ------------------
 6212|  21.5k|	    NEXT;
  ------------------
  |  | 2316|  21.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6213|  21.5k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6214|  21.5k|            if (n == NULL)
  ------------------
  |  Branch (6214:17): [True: 1, False: 21.5k]
  ------------------
 6215|      1|                goto mem_error;
 6216|  21.5k|	    if (elem == NULL) {
  ------------------
  |  Branch (6216:10): [True: 3.00k, False: 18.5k]
  ------------------
 6217|  3.00k|		n->c1 = cur;
 6218|  3.00k|		if (cur != NULL)
  ------------------
  |  Branch (6218:7): [True: 3.00k, False: 0]
  ------------------
 6219|  3.00k|		    cur->parent = n;
 6220|  3.00k|		ret = cur = n;
 6221|  18.5k|	    } else {
 6222|  18.5k|	        cur->c2 = n;
 6223|  18.5k|		n->parent = cur;
 6224|  18.5k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6225|  18.5k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6225:21): [True: 1, False: 18.5k]
  ------------------
 6226|      1|                    goto mem_error;
 6227|  18.5k|		n->c1->parent = n;
 6228|  18.5k|		cur = n;
 6229|  18.5k|	    }
 6230|  21.5k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6231|  21.5k|	    elem = xmlParseName(ctxt);
 6232|  21.5k|	    if (elem == NULL) {
  ------------------
  |  Branch (6232:10): [True: 107, False: 21.4k]
  ------------------
 6233|    107|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6234|    107|			"xmlParseElementMixedContentDecl : Name expected\n");
 6235|    107|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|    107|		return(NULL);
 6237|    107|	    }
 6238|  21.4k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6239|  21.4k|	}
 6240|  3.98k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2261|  3.98k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2263|  2.79k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6240:6): [True: 2.79k, False: 1.18k]
  |  Branch (6240:22): [True: 2.78k, False: 9]
  ------------------
 6241|  2.78k|	    if (elem != NULL) {
  ------------------
  |  Branch (6241:10): [True: 2.78k, False: 0]
  ------------------
 6242|  2.78k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6243|  2.78k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6244|  2.78k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6244:7): [True: 1, False: 2.78k]
  ------------------
 6245|      1|                    goto mem_error;
 6246|  2.78k|		cur->c2->parent = cur;
 6247|  2.78k|            }
 6248|  2.78k|            if (ret != NULL)
  ------------------
  |  Branch (6248:17): [True: 2.78k, False: 0]
  ------------------
 6249|  2.78k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6250|  2.78k|#ifdef LIBXML_VALID_ENABLED
 6251|  2.78k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6251:10): [True: 2.08k, False: 698]
  |  Branch (6251:30): [True: 1, False: 2.08k]
  ------------------
 6252|      1|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6253|      1|                                 "Element content declaration doesn't start "
 6254|      1|                                 "and stop in the same entity\n",
 6255|      1|                                 NULL, NULL);
 6256|      1|	    }
 6257|  2.78k|#endif
 6258|  2.78k|	    SKIP(2);
  ------------------
  |  | 2285|  2.78k|#define SKIP(val) do {							\
  |  | 2286|  2.78k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.78k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 394, False: 2.39k]
  |  |  ------------------
  |  | 2288|  2.78k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.78k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
 6259|  2.78k|	} else {
 6260|  1.19k|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6261|  1.19k|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6262|  1.19k|	    return(NULL);
 6263|  1.19k|	}
 6264|       |
 6265|  3.98k|    } else {
 6266|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6267|      0|    }
 6268|  2.78k|    return(ret);
 6269|       |
 6270|      6|mem_error:
 6271|      6|    xmlErrMemory(ctxt);
 6272|      6|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6273|       |    return(NULL);
 6274|  7.65k|}
xmlParseElementContentDecl:
 6629|  18.6k|                           xmlElementContent **result) {
 6630|       |
 6631|  18.6k|    xmlElementContentPtr tree = NULL;
 6632|  18.6k|    int openInputNr = ctxt->inputNr;
 6633|  18.6k|    int res;
 6634|       |
 6635|  18.6k|    *result = NULL;
 6636|       |
 6637|  18.6k|    if (RAW != '(') {
  ------------------
  |  | 2261|  18.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6637:9): [True: 0, False: 18.6k]
  ------------------
 6638|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6639|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6640|      0|	return(-1);
 6641|      0|    }
 6642|  18.6k|    NEXT;
  ------------------
  |  | 2316|  18.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6643|  18.6k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6644|  18.6k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  18.6k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  37.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  37.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  37.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.70k, False: 10.9k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.69k, False: 16]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  18.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.68k, False: 7]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.67k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.66k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.66k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.65k, False: 8]
  |  |  ------------------
  ------------------
 6645|  7.65k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6646|  7.65k|	res = XML_ELEMENT_TYPE_MIXED;
 6647|  10.9k|    } else {
 6648|  10.9k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6649|  10.9k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6650|  10.9k|    }
 6651|  18.6k|    if (tree == NULL)
  ------------------
  |  Branch (6651:9): [True: 4.44k, False: 14.1k]
  ------------------
 6652|  4.44k|        return(-1);
 6653|  14.1k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  14.1k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6654|  14.1k|    *result = tree;
 6655|  14.1k|    return(res);
 6656|  18.6k|}
xmlParseElementDecl:
 6672|  27.8k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6673|  27.8k|    const xmlChar *name;
 6674|  27.8k|    int ret = -1;
 6675|  27.8k|    xmlElementContentPtr content  = NULL;
 6676|       |
 6677|  27.8k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  27.8k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  27.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6677:9): [True: 0, False: 27.8k]
  |  Branch (6677:25): [True: 0, False: 27.8k]
  ------------------
 6678|      0|        return(ret);
 6679|  27.8k|    SKIP(2);
  ------------------
  |  | 2285|  27.8k|#define SKIP(val) do {							\
  |  | 2286|  27.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  27.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 27.8k]
  |  |  ------------------
  |  | 2288|  27.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  27.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 27.8k]
  |  |  ------------------
  ------------------
 6680|       |
 6681|       |    /* GROW; done in the caller */
 6682|  27.8k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2275|  27.8k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  55.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  55.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  55.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 27.8k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 27.8k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  27.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 27.8k, False: 17]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 27.8k, False: 12]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 27.7k, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 27.7k, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 27.7k, False: 9]
  |  |  ------------------
  ------------------
 6683|  27.7k|#ifdef LIBXML_VALID_ENABLED
 6684|  27.7k|	int oldInputNr = ctxt->inputNr;
 6685|  27.7k|#endif
 6686|       |
 6687|  27.7k|	SKIP(7);
  ------------------
  |  | 2285|  27.7k|#define SKIP(val) do {							\
  |  | 2286|  27.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  27.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 371, False: 27.4k]
  |  |  ------------------
  |  | 2288|  27.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  27.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 27.7k]
  |  |  ------------------
  ------------------
 6688|  27.7k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  27.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6688:6): [True: 544, False: 27.2k]
  ------------------
 6689|    544|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6690|    544|		           "Space required after 'ELEMENT'\n");
 6691|    544|	    return(-1);
 6692|    544|	}
 6693|  27.2k|        name = xmlParseName(ctxt);
 6694|  27.2k|	if (name == NULL) {
  ------------------
  |  Branch (6694:6): [True: 388, False: 26.8k]
  ------------------
 6695|    388|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6696|    388|			   "xmlParseElementDecl: no name for Element\n");
 6697|    388|	    return(-1);
 6698|    388|	}
 6699|  26.8k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  26.8k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6699:6): [True: 2.50k, False: 24.3k]
  ------------------
 6700|  2.50k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6701|  2.50k|			   "Space required after the element name\n");
 6702|  2.50k|	}
 6703|  26.8k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2271|  26.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  53.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 5.71k, False: 21.1k]
  |  |  |  |  |  Branch (2268:41): [True: 5.70k, False: 14]
  |  |  |  |  ------------------
  |  |  |  | 2269|  26.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 5.69k, False: 4]
  |  |  |  |  |  Branch (2269:41): [True: 5.69k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 5.69k, False: 2]
  |  |  ------------------
  ------------------
 6704|  5.69k|	    SKIP(5);
  ------------------
  |  | 2285|  5.69k|#define SKIP(val) do {							\
  |  | 2286|  5.69k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.69k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 80, False: 5.61k]
  |  |  ------------------
  |  | 2288|  5.69k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.69k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.69k]
  |  |  ------------------
  ------------------
 6705|       |	    /*
 6706|       |	     * Element must always be empty.
 6707|       |	     */
 6708|  5.69k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6709|  21.1k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2261|  21.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2263|  1.07k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6709:13): [True: 1.07k, False: 20.0k]
  |  Branch (6709:29): [True: 1.07k, False: 2]
  ------------------
 6710|  1.07k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2263|  1.07k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6710:13): [True: 1.07k, False: 1]
  ------------------
 6711|  1.07k|	    SKIP(3);
  ------------------
  |  | 2285|  1.07k|#define SKIP(val) do {							\
  |  | 2286|  1.07k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.07k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 298, False: 776]
  |  |  ------------------
  |  | 2288|  1.07k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.07k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.07k]
  |  |  ------------------
  ------------------
 6712|       |	    /*
 6713|       |	     * Element is a generic container.
 6714|       |	     */
 6715|  1.07k|	    ret = XML_ELEMENT_TYPE_ANY;
 6716|  20.0k|	} else if (RAW == '(') {
  ------------------
  |  | 2261|  20.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6716:13): [True: 18.6k, False: 1.45k]
  ------------------
 6717|  18.6k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6718|  18.6k|            if (ret <= 0)
  ------------------
  |  Branch (6718:17): [True: 4.44k, False: 14.1k]
  ------------------
 6719|  4.44k|                return(-1);
 6720|  18.6k|	} else {
 6721|       |	    /*
 6722|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6723|       |	     */
 6724|  1.45k|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6725|  1.45k|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6726|  1.45k|	    return(-1);
 6727|  1.45k|	}
 6728|       |
 6729|  20.9k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  20.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6730|       |
 6731|  20.9k|	if (RAW != '>') {
  ------------------
  |  | 2261|  20.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6731:6): [True: 1.77k, False: 19.1k]
  ------------------
 6732|  1.77k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6733|  1.77k|	    if (content != NULL) {
  ------------------
  |  Branch (6733:10): [True: 1.37k, False: 397]
  ------------------
 6734|  1.37k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6735|  1.37k|	    }
 6736|  19.1k|	} else {
 6737|  19.1k|#ifdef LIBXML_VALID_ENABLED
 6738|  19.1k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6738:10): [True: 14.3k, False: 4.83k]
  |  Branch (6738:30): [True: 68, False: 14.2k]
  ------------------
 6739|     68|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6740|     68|                                 "Element declaration doesn't start and stop in"
 6741|     68|                                 " the same entity\n",
 6742|     68|                                 NULL, NULL);
 6743|     68|	    }
 6744|  19.1k|#endif
 6745|       |
 6746|  19.1k|	    NEXT;
  ------------------
  |  | 2316|  19.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6747|  19.1k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6747:10): [True: 19.1k, False: 0]
  |  Branch (6747:33): [True: 17.6k, False: 1.54k]
  ------------------
 6748|  17.6k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6748:3): [True: 17.6k, False: 0]
  ------------------
 6749|  17.6k|		if (content != NULL)
  ------------------
  |  Branch (6749:7): [True: 11.6k, False: 5.93k]
  ------------------
 6750|  11.6k|		    content->parent = NULL;
 6751|  17.6k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6752|  17.6k|		                       content);
 6753|  17.6k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6753:7): [True: 11.6k, False: 5.93k]
  |  Branch (6753:28): [True: 2.61k, False: 9.07k]
  ------------------
 6754|       |		    /*
 6755|       |		     * this is a trick: if xmlAddElementDecl is called,
 6756|       |		     * instead of copying the full tree it is plugged directly
 6757|       |		     * if called from the parser. Avoid duplicating the
 6758|       |		     * interfaces or change the API/ABI
 6759|       |		     */
 6760|  2.61k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6761|  2.61k|		}
 6762|  17.6k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6762:17): [True: 1.11k, False: 430]
  ------------------
 6763|  1.11k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6764|  1.11k|	    }
 6765|  19.1k|	}
 6766|  20.9k|    }
 6767|  21.0k|    return(ret);
 6768|  27.8k|}
xmlParseMarkupDecl:
 6943|   492k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6944|   492k|    GROW;
  ------------------
  |  | 2308|   492k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   492k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   492k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 456k, False: 35.9k]
  |  |  ------------------
  |  | 2309|   492k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   456k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 131k, False: 325k]
  |  |  ------------------
  |  | 2310|   492k|	xmlParserGrow(ctxt);
  ------------------
 6945|   492k|    if (CUR == '<') {
  ------------------
  |  | 2262|   492k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6945:9): [True: 492k, False: 0]
  ------------------
 6946|   492k|        if (NXT(1) == '!') {
  ------------------
  |  | 2263|   492k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6946:13): [True: 472k, False: 20.0k]
  ------------------
 6947|   472k|	    switch (NXT(2)) {
  ------------------
  |  | 2263|   472k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6948|   231k|	        case 'E':
  ------------------
  |  Branch (6948:10): [True: 231k, False: 241k]
  ------------------
 6949|   231k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2263|   231k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6949:11): [True: 27.8k, False: 203k]
  ------------------
 6950|  27.8k|			xmlParseElementDecl(ctxt);
 6951|   203k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2263|   203k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6951:16): [True: 203k, False: 31]
  ------------------
 6952|   203k|			xmlParseEntityDecl(ctxt);
 6953|     31|                    else
 6954|     31|                        SKIP(2);
  ------------------
  |  | 2285|     31|#define SKIP(val) do {							\
  |  | 2286|     31|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|     31|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 31]
  |  |  ------------------
  |  | 2288|     31|        xmlParserGrow(ctxt);						\
  |  | 2289|     31|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 31]
  |  |  ------------------
  ------------------
 6955|   231k|		    break;
 6956|   113k|	        case 'A':
  ------------------
  |  Branch (6956:10): [True: 113k, False: 359k]
  ------------------
 6957|   113k|		    xmlParseAttributeListDecl(ctxt);
 6958|   113k|		    break;
 6959|  4.69k|	        case 'N':
  ------------------
  |  Branch (6959:10): [True: 4.69k, False: 468k]
  ------------------
 6960|  4.69k|		    xmlParseNotationDecl(ctxt);
 6961|  4.69k|		    break;
 6962|   114k|	        case '-':
  ------------------
  |  Branch (6962:10): [True: 114k, False: 358k]
  ------------------
 6963|   114k|		    xmlParseComment(ctxt);
 6964|   114k|		    break;
 6965|  8.86k|		default:
  ------------------
  |  Branch (6965:3): [True: 8.86k, False: 463k]
  ------------------
 6966|  8.86k|                    xmlFatalErr(ctxt,
 6967|  8.86k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6967:33): [True: 1.42k, False: 7.44k]
  ------------------
 6968|  1.42k|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6969|  8.86k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6970|  8.86k|                                NULL);
 6971|  8.86k|                    SKIP(2);
  ------------------
  |  | 2285|  8.86k|#define SKIP(val) do {							\
  |  | 2286|  8.86k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.86k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 540, False: 8.32k]
  |  |  ------------------
  |  | 2288|  8.86k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.86k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.86k]
  |  |  ------------------
  ------------------
 6972|  8.86k|		    break;
 6973|   472k|	    }
 6974|   472k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2263|  20.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6974:13): [True: 20.0k, False: 0]
  ------------------
 6975|  20.0k|	    xmlParsePI(ctxt);
 6976|  20.0k|	}
 6977|   492k|    }
 6978|   492k|}
xmlParseTextDecl:
 6990|   233k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6991|   233k|    xmlChar *version;
 6992|       |
 6993|       |    /*
 6994|       |     * We know that '<?xml' is here.
 6995|       |     */
 6996|   233k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   233k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   467k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 233k, False: 0]
  |  |  |  |  |  Branch (2268:41): [True: 233k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2269|   233k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 233k, False: 0]
  |  |  |  |  |  Branch (2269:41): [True: 233k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 233k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   233k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   233k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 230k, False: 2.71k]
  |  |  |  |  ------------------
  |  |  |  |   91|   233k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.70k, False: 7]
  |  |  |  |  |  Branch (91:23): [True: 1.63k, False: 1.06k]
  |  |  |  |  ------------------
  |  |  |  |   92|   233k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.05k, False: 22]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|   233k|	SKIP(5);
  ------------------
  |  | 2285|   233k|#define SKIP(val) do {							\
  |  | 2286|   233k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   233k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 233k]
  |  |  ------------------
  |  | 2288|   233k|        xmlParserGrow(ctxt);						\
  |  | 2289|   233k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 233k]
  |  |  ------------------
  ------------------
 6998|   233k|    } else {
 6999|     22|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 7000|     22|	return;
 7001|     22|    }
 7002|       |
 7003|   233k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   233k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7003:9): [True: 0, False: 233k]
  ------------------
 7004|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7005|      0|		       "Space needed after '<?xml'\n");
 7006|      0|    }
 7007|       |
 7008|       |    /*
 7009|       |     * We may have the VersionInfo here.
 7010|       |     */
 7011|   233k|    version = xmlParseVersionInfo(ctxt);
 7012|   233k|    if (version == NULL) {
  ------------------
  |  Branch (7012:9): [True: 226k, False: 7.32k]
  ------------------
 7013|   226k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   226k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 7014|   226k|        if (version == NULL) {
  ------------------
  |  Branch (7014:13): [True: 7, False: 226k]
  ------------------
 7015|      7|            xmlErrMemory(ctxt);
 7016|      7|            return;
 7017|      7|        }
 7018|   226k|    } else {
 7019|  7.32k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.32k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7019:6): [True: 909, False: 6.41k]
  ------------------
 7020|    909|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7021|    909|		           "Space needed here\n");
 7022|    909|	}
 7023|  7.32k|    }
 7024|   233k|    ctxt->input->version = version;
 7025|       |
 7026|       |    /*
 7027|       |     * We must have the encoding declaration
 7028|       |     */
 7029|   233k|    xmlParseEncodingDecl(ctxt);
 7030|       |
 7031|   233k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   233k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7032|   233k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   233k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  3.66k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7032:9): [True: 3.66k, False: 229k]
  |  Branch (7032:25): [True: 2.81k, False: 854]
  ------------------
 7033|  2.81k|        SKIP(2);
  ------------------
  |  | 2285|  2.81k|#define SKIP(val) do {							\
  |  | 2286|  2.81k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.81k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 443, False: 2.37k]
  |  |  ------------------
  |  | 2288|  2.81k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.81k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.81k]
  |  |  ------------------
  ------------------
 7034|   230k|    } else if (RAW == '>') {
  ------------------
  |  | 2261|   230k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7034:16): [True: 198, False: 230k]
  ------------------
 7035|       |        /* Deprecated old WD ... */
 7036|    198|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7037|    198|	NEXT;
  ------------------
  |  | 2316|    198|#define NEXT xmlNextChar(ctxt)
  ------------------
 7038|   230k|    } else {
 7039|   230k|        int c;
 7040|       |
 7041|   230k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7042|   449M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   449M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   449M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7042:16): [True: 449M, False: 44]
  |  Branch (7042:47): [True: 449M, False: 11.6k]
  ------------------
 7043|   449M|            NEXT;
  ------------------
  |  | 2316|   449M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7044|   449M|            if (c == '>')
  ------------------
  |  Branch (7044:17): [True: 218k, False: 449M]
  ------------------
 7045|   218k|                break;
 7046|   449M|        }
 7047|   230k|    }
 7048|   233k|}
xmlParseExternalSubset:
 7065|  2.14k|                       const xmlChar *systemId) {
 7066|  2.14k|    int oldInputNr;
 7067|       |
 7068|  2.14k|    xmlCtxtInitializeLate(ctxt);
 7069|       |
 7070|  2.14k|    xmlDetectEncoding(ctxt);
 7071|       |
 7072|  2.14k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2271|  2.14k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.29k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 2.00k, False: 144]
  |  |  |  |  |  Branch (2268:41): [True: 232, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.14k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 167, False: 65]
  |  |  |  |  |  Branch (2269:41): [True: 156, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 133, False: 23]
  |  |  ------------------
  ------------------
 7073|    133|	xmlParseTextDecl(ctxt);
 7074|    133|    }
 7075|  2.14k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7075:9): [True: 0, False: 2.14k]
  ------------------
 7076|      0|        ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 7077|      0|	if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7077:6): [True: 0, False: 0]
  ------------------
 7078|      0|	    xmlErrMemory(ctxt);
 7079|      0|	    return;
 7080|      0|	}
 7081|      0|	ctxt->myDoc->properties = XML_DOC_INTERNAL;
 7082|      0|    }
 7083|  2.14k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7083:9): [True: 0, False: 2.14k]
  ------------------
 7084|      0|        (xmlCreateIntSubset(ctxt->myDoc, NULL, publicId, systemId) == NULL)) {
  ------------------
  |  Branch (7084:9): [True: 0, False: 0]
  ------------------
 7085|      0|        xmlErrMemory(ctxt);
 7086|      0|    }
 7087|       |
 7088|  2.14k|    ctxt->inSubset = 2;
 7089|  2.14k|    oldInputNr = ctxt->inputNr;
 7090|       |
 7091|  2.14k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  2.14k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7092|   160k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   160k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7092:12): [True: 160k, False: 149]
  ------------------
 7093|   160k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7093:13): [True: 1.82k, False: 158k]
  ------------------
 7094|  1.82k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7094:17): [True: 757, False: 1.06k]
  ------------------
 7095|    757|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7096|    757|                break;
 7097|    757|            }
 7098|       |
 7099|  1.06k|            xmlPopPE(ctxt);
 7100|   158k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   158k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   154k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   144k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7100:20): [True: 154k, False: 4.13k]
  |  Branch (7100:36): [True: 144k, False: 9.37k]
  |  Branch (7100:55): [True: 1.42k, False: 143k]
  ------------------
 7101|  1.42k|            xmlParseConditionalSections(ctxt);
 7102|   156k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   156k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   152k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  9.37k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7102:20): [True: 152k, False: 4.13k]
  |  Branch (7102:37): [True: 143k, False: 9.37k]
  |  Branch (7102:56): [True: 9.27k, False: 95]
  ------------------
 7103|   152k|            xmlParseMarkupDecl(ctxt);
 7104|   152k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  4.22k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7104:20): [True: 2.98k, False: 1.24k]
  ------------------
 7105|  2.98k|            xmlParsePERefInternal(ctxt, 1);
 7106|  2.98k|        } else {
 7107|  1.24k|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7108|       |
 7109|  1.44k|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7109:20): [True: 201, False: 1.24k]
  ------------------
 7110|    201|                xmlPopPE(ctxt);
 7111|  1.24k|            break;
 7112|  1.24k|        }
 7113|   158k|        SKIP_BLANKS;
  ------------------
  |  | 2312|   158k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7114|   158k|        SHRINK;
  ------------------
  |  | 2304|   158k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   158k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   158k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 158k, False: 0]
  |  |  ------------------
  |  | 2305|   158k|	xmlParserShrink(ctxt);
  ------------------
 7115|   158k|        GROW;
  ------------------
  |  | 2308|   158k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   158k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   158k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 158k, False: 0]
  |  |  ------------------
  |  | 2309|   158k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   158k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.5k, False: 146k]
  |  |  ------------------
  |  | 2310|   158k|	xmlParserGrow(ctxt);
  ------------------
 7116|   158k|    }
 7117|  2.14k|}
xmlParseReference:
 7133|   116k|xmlParseReference(xmlParserCtxt *ctxt) {
 7134|   116k|    xmlEntityPtr ent = NULL;
 7135|   116k|    const xmlChar *name;
 7136|   116k|    xmlChar *val;
 7137|       |
 7138|   116k|    if (RAW != '&')
  ------------------
  |  | 2261|   116k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7138:9): [True: 0, False: 116k]
  ------------------
 7139|      0|        return;
 7140|       |
 7141|       |    /*
 7142|       |     * Simple case of a CharRef
 7143|       |     */
 7144|   116k|    if (NXT(1) == '#') {
  ------------------
  |  | 2263|   116k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7144:9): [True: 30.3k, False: 85.9k]
  ------------------
 7145|  30.3k|	int i = 0;
 7146|  30.3k|	xmlChar out[16];
 7147|  30.3k|	int value = xmlParseCharRef(ctxt);
 7148|       |
 7149|  30.3k|	if (value == 0)
  ------------------
  |  Branch (7149:6): [True: 8.04k, False: 22.2k]
  ------------------
 7150|  8.04k|	    return;
 7151|       |
 7152|       |        /*
 7153|       |         * Just encode the value in UTF-8
 7154|       |         */
 7155|  22.2k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2333|  22.2k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 21.6k, False: 627]
  |  |  ------------------
  |  | 2334|  22.2k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7156|  22.2k|        out[i] = 0;
 7157|  22.2k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7157:13): [True: 22.2k, False: 0]
  |  Branch (7157:36): [True: 22.2k, False: 0]
  ------------------
 7158|  22.2k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7158:13): [True: 6.14k, False: 16.1k]
  ------------------
 7159|  6.14k|            ctxt->sax->characters(ctxt->userData, out, i);
 7160|  22.2k|	return;
 7161|  30.3k|    }
 7162|       |
 7163|       |    /*
 7164|       |     * We are seeing an entity reference
 7165|       |     */
 7166|  85.9k|    name = xmlParseEntityRefInternal(ctxt);
 7167|  85.9k|    if (name == NULL)
  ------------------
  |  Branch (7167:9): [True: 17.0k, False: 68.9k]
  ------------------
 7168|  17.0k|        return;
 7169|  68.9k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7170|  68.9k|    if (ent == NULL) {
  ------------------
  |  Branch (7170:9): [True: 38.0k, False: 30.8k]
  ------------------
 7171|       |        /*
 7172|       |         * Create a reference for undeclared entities.
 7173|       |         */
 7174|  38.0k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7174:13): [True: 34.6k, False: 3.37k]
  ------------------
 7175|  34.6k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7175:13): [True: 34.6k, False: 0]
  ------------------
 7176|  34.6k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7176:13): [True: 25.2k, False: 9.46k]
  ------------------
 7177|  25.2k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7177:13): [True: 25.2k, False: 0]
  ------------------
 7178|  25.2k|            ctxt->sax->reference(ctxt->userData, name);
 7179|  25.2k|        }
 7180|  38.0k|        return;
 7181|  38.0k|    }
 7182|  30.8k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7182:9): [True: 7.17k, False: 23.6k]
  ------------------
 7183|  7.17k|	return;
 7184|       |
 7185|       |    /* special case of predefined entities */
 7186|  23.6k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7186:9): [True: 0, False: 23.6k]
  ------------------
 7187|  23.6k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7187:9): [True: 1.32k, False: 22.3k]
  ------------------
 7188|  1.32k|	val = ent->content;
 7189|  1.32k|	if (val == NULL) return;
  ------------------
  |  Branch (7189:6): [True: 0, False: 1.32k]
  ------------------
 7190|       |	/*
 7191|       |	 * inline the entity.
 7192|       |	 */
 7193|  1.32k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7193:6): [True: 1.32k, False: 0]
  |  Branch (7193:29): [True: 1.32k, False: 0]
  ------------------
 7194|  1.32k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7194:6): [True: 1.32k, False: 0]
  ------------------
 7195|  1.32k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7196|  1.32k|	return;
 7197|  1.32k|    }
 7198|       |
 7199|       |    /*
 7200|       |     * Some users try to parse entities on their own and used to set
 7201|       |     * the renamed "checked" member. Fix the flags to cover this
 7202|       |     * case.
 7203|       |     */
 7204|  22.3k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  22.3k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7204:9): [True: 5.30k, False: 17.0k]
  |  Branch (7204:49): [True: 0, False: 5.30k]
  ------------------
 7205|      0|        ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|      0|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 7206|       |
 7207|       |    /*
 7208|       |     * The first reference to the entity trigger a parsing phase
 7209|       |     * where the ent->children is filled with the result from
 7210|       |     * the parsing.
 7211|       |     * Note: external parsed entities will not be loaded, it is not
 7212|       |     * required for a non-validating parser, unless the parsing option
 7213|       |     * of validating, or substituting entities were given. Doing so is
 7214|       |     * far more secure as the parser will only process data coming from
 7215|       |     * the document entity by default.
 7216|       |     *
 7217|       |     * FIXME: This doesn't work correctly since entities can be
 7218|       |     * expanded with different namespace declarations in scope.
 7219|       |     * For example:
 7220|       |     *
 7221|       |     * <!DOCTYPE doc [
 7222|       |     *   <!ENTITY ent "<ns:elem/>">
 7223|       |     * ]>
 7224|       |     * <doc>
 7225|       |     *   <decl1 xmlns:ns="urn:ns1">
 7226|       |     *     &ent;
 7227|       |     *   </decl1>
 7228|       |     *   <decl2 xmlns:ns="urn:ns2">
 7229|       |     *     &ent;
 7230|       |     *   </decl2>
 7231|       |     * </doc>
 7232|       |     *
 7233|       |     * Proposed fix:
 7234|       |     *
 7235|       |     * - Ignore current namespace declarations when parsing the
 7236|       |     *   entity. If a prefix can't be resolved, don't report an error
 7237|       |     *   but mark it as unresolved.
 7238|       |     * - Try to resolve these prefixes when expanding the entity.
 7239|       |     *   This will require a specialized version of xmlStaticCopyNode
 7240|       |     *   which can also make use of the namespace hash table to avoid
 7241|       |     *   quadratic behavior.
 7242|       |     *
 7243|       |     * Alternatively, we could simply reparse the entity on each
 7244|       |     * expansion like we already do with custom SAX callbacks.
 7245|       |     * External entity content should be cached in this case.
 7246|       |     */
 7247|  22.3k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7247:9): [True: 9.29k, False: 13.0k]
  ------------------
 7248|  13.0k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7248:10): [True: 12.3k, False: 755]
  ------------------
 7249|  12.3k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7249:11): [True: 9.57k, False: 2.75k]
  ------------------
 7250|  21.2k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7250:11): [True: 2.42k, False: 331]
  ------------------
 7251|  21.2k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  21.2k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7251:13): [True: 4.21k, False: 17.0k]
  ------------------
 7252|  4.21k|            xmlCtxtParseEntity(ctxt, ent);
 7253|  17.0k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7253:20): [True: 4.70k, False: 12.3k]
  ------------------
 7254|       |            /*
 7255|       |             * Probably running in SAX mode and the callbacks don't
 7256|       |             * build the entity content. Parse the entity again.
 7257|       |             *
 7258|       |             * This will also be triggered in normal tree builder mode
 7259|       |             * if an entity happens to be empty, causing unnecessary
 7260|       |             * reloads. It's hard to come up with a reliable check in
 7261|       |             * which mode we're running.
 7262|       |             */
 7263|  4.70k|            xmlCtxtParseEntity(ctxt, ent);
 7264|  4.70k|        }
 7265|  21.2k|    }
 7266|       |
 7267|       |    /*
 7268|       |     * We also check for amplification if entities aren't substituted.
 7269|       |     * They might be expanded later.
 7270|       |     */
 7271|  22.3k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7271:9): [True: 49, False: 22.3k]
  ------------------
 7272|     49|        return;
 7273|       |
 7274|  22.3k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7274:9): [True: 0, False: 22.3k]
  |  Branch (7274:32): [True: 944, False: 21.3k]
  ------------------
 7275|    944|        return;
 7276|       |
 7277|  21.3k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7277:9): [True: 6.61k, False: 14.7k]
  ------------------
 7278|       |	/*
 7279|       |	 * Create a reference
 7280|       |	 */
 7281|  6.61k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7281:13): [True: 6.61k, False: 0]
  ------------------
 7282|  6.61k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7283|  14.7k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7283:16): [True: 10.2k, False: 4.52k]
  |  Branch (7283:43): [True: 10.2k, False: 0]
  ------------------
 7284|  10.2k|        xmlNodePtr copy, cur;
 7285|       |
 7286|       |        /*
 7287|       |         * Seems we are generating the DOM content, copy the tree
 7288|       |	 */
 7289|  10.2k|        cur = ent->children;
 7290|       |
 7291|       |        /*
 7292|       |         * Handle first text node with SAX to coalesce text efficiently
 7293|       |         */
 7294|  10.2k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7294:13): [True: 8.90k, False: 1.33k]
  ------------------
 7295|  9.04k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7295:13): [True: 138, False: 1.19k]
  ------------------
 7296|  9.04k|            int len = xmlStrlen(cur->content);
 7297|       |
 7298|  9.04k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7298:17): [True: 8.90k, False: 138]
  ------------------
 7299|  8.90k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7299:17): [True: 0, False: 138]
  ------------------
 7300|  8.90k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7300:21): [True: 8.90k, False: 0]
  ------------------
 7301|  8.90k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7302|  8.90k|            } else {
 7303|    138|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7303:21): [True: 138, False: 0]
  ------------------
 7304|    138|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7305|    138|            }
 7306|       |
 7307|  9.04k|            cur = cur->next;
 7308|  9.04k|        }
 7309|       |
 7310|   151k|        while (cur != NULL) {
  ------------------
  |  Branch (7310:16): [True: 143k, False: 7.33k]
  ------------------
 7311|   143k|            xmlNodePtr last;
 7312|       |
 7313|       |            /*
 7314|       |             * Handle last text node with SAX to coalesce text efficiently
 7315|       |             */
 7316|   143k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7316:17): [True: 4.93k, False: 138k]
  ------------------
 7317|  4.93k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7317:18): [True: 1.98k, False: 2.94k]
  ------------------
 7318|  2.94k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7318:18): [True: 871, False: 2.07k]
  ------------------
 7319|  2.85k|                int len = xmlStrlen(cur->content);
 7320|       |
 7321|  2.85k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7321:21): [True: 1.98k, False: 871]
  ------------------
 7322|  1.98k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7322:21): [True: 0, False: 871]
  ------------------
 7323|  1.98k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7323:25): [True: 1.98k, False: 0]
  ------------------
 7324|  1.98k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7325|  1.98k|                                              len);
 7326|  1.98k|                } else {
 7327|    871|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7327:25): [True: 871, False: 0]
  ------------------
 7328|    871|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7329|    871|                                              len);
 7330|    871|                }
 7331|       |
 7332|  2.85k|                break;
 7333|  2.85k|            }
 7334|       |
 7335|       |            /*
 7336|       |             * Reset coalesce buffer stats only for non-text nodes.
 7337|       |             */
 7338|   140k|            ctxt->nodemem = 0;
 7339|   140k|            ctxt->nodelen = 0;
 7340|       |
 7341|   140k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7342|       |
 7343|   140k|            if (copy == NULL) {
  ------------------
  |  Branch (7343:17): [True: 52, False: 140k]
  ------------------
 7344|     52|                xmlErrMemory(ctxt);
 7345|     52|                break;
 7346|     52|            }
 7347|       |
 7348|   140k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7348:17): [True: 139k, False: 1.17k]
  ------------------
 7349|       |                /* Needed for reader */
 7350|   139k|                copy->extra = cur->extra;
 7351|       |                /* Maybe needed for reader */
 7352|   139k|                copy->_private = cur->_private;
 7353|   139k|            }
 7354|       |
 7355|   140k|            copy->parent = ctxt->node;
 7356|   140k|            last = ctxt->node->last;
 7357|   140k|            if (last == NULL) {
  ------------------
  |  Branch (7357:17): [True: 309, False: 140k]
  ------------------
 7358|    309|                ctxt->node->children = copy;
 7359|   140k|            } else {
 7360|   140k|                last->next = copy;
 7361|   140k|                copy->prev = last;
 7362|   140k|            }
 7363|   140k|            ctxt->node->last = copy;
 7364|       |
 7365|   140k|            cur = cur->next;
 7366|   140k|        }
 7367|  10.2k|    }
 7368|  21.3k|}
xmlParseDocTypeDecl:
 7971|  21.9k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7972|  21.9k|    const xmlChar *name = NULL;
 7973|  21.9k|    xmlChar *publicId = NULL;
 7974|  21.9k|    xmlChar *URI = NULL;
 7975|       |
 7976|       |    /*
 7977|       |     * We know that '<!DOCTYPE' has been detected.
 7978|       |     */
 7979|  21.9k|    SKIP(9);
  ------------------
  |  | 2285|  21.9k|#define SKIP(val) do {							\
  |  | 2286|  21.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  21.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 8, False: 21.9k]
  |  |  ------------------
  |  | 2288|  21.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  21.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 21.9k]
  |  |  ------------------
  ------------------
 7980|       |
 7981|  21.9k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  21.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7981:9): [True: 1.63k, False: 20.3k]
  ------------------
 7982|  1.63k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7983|  1.63k|                       "Space required after 'DOCTYPE'\n");
 7984|  1.63k|    }
 7985|       |
 7986|       |    /*
 7987|       |     * Parse the DOCTYPE name.
 7988|       |     */
 7989|  21.9k|    name = xmlParseName(ctxt);
 7990|  21.9k|    if (name == NULL) {
  ------------------
  |  Branch (7990:9): [True: 1.32k, False: 20.6k]
  ------------------
 7991|  1.32k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7992|  1.32k|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7993|  1.32k|    }
 7994|  21.9k|    ctxt->intSubName = name;
 7995|       |
 7996|  21.9k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  21.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7997|       |
 7998|       |    /*
 7999|       |     * Check for public and system identifier (URI)
 8000|       |     */
 8001|  21.9k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 8002|       |
 8003|  21.9k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (8003:9): [True: 3.91k, False: 18.0k]
  |  Branch (8003:26): [True: 20, False: 18.0k]
  ------------------
 8004|  3.93k|        ctxt->hasExternalSubset = 1;
 8005|  3.93k|    }
 8006|  21.9k|    ctxt->extSubURI = URI;
 8007|  21.9k|    ctxt->extSubSystem = publicId;
 8008|       |
 8009|  21.9k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  21.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8010|       |
 8011|       |    /*
 8012|       |     * Create and update the internal subset.
 8013|       |     */
 8014|  21.9k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (8014:9): [True: 21.9k, False: 0]
  |  Branch (8014:32): [True: 21.9k, False: 0]
  ------------------
 8015|  21.9k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8015:2): [True: 21.8k, False: 178]
  ------------------
 8016|  21.8k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 8017|       |
 8018|  21.9k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  21.9k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  5.59k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8018:9): [True: 5.59k, False: 16.3k]
  |  Branch (8018:25): [True: 282, False: 5.31k]
  ------------------
 8019|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8020|    282|    }
 8021|  21.9k|}
xmlParseAttribute:
 8127|   136k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8128|   136k|    const xmlChar *name;
 8129|   136k|    xmlChar *val;
 8130|       |
 8131|   136k|    *value = NULL;
 8132|   136k|    GROW;
  ------------------
  |  | 2308|   136k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   136k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   136k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 65.0k, False: 71.6k]
  |  |  ------------------
  |  | 2309|   136k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  65.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.9k, False: 52.1k]
  |  |  ------------------
  |  | 2310|   136k|	xmlParserGrow(ctxt);
  ------------------
 8133|   136k|    name = xmlParseName(ctxt);
 8134|   136k|    if (name == NULL) {
  ------------------
  |  Branch (8134:9): [True: 32.7k, False: 103k]
  ------------------
 8135|  32.7k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8136|  32.7k|	               "error parsing attribute name\n");
 8137|  32.7k|        return(NULL);
 8138|  32.7k|    }
 8139|       |
 8140|       |    /*
 8141|       |     * read the value
 8142|       |     */
 8143|   103k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   103k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8144|   103k|    if (RAW == '=') {
  ------------------
  |  | 2261|   103k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8144:9): [True: 92.8k, False: 11.0k]
  ------------------
 8145|  92.8k|        NEXT;
  ------------------
  |  | 2316|  92.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8146|  92.8k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  92.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8147|  92.8k|	val = xmlParseAttValue(ctxt);
 8148|  92.8k|    } else {
 8149|  11.0k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8150|  11.0k|	       "Specification mandates value for attribute %s\n", name);
 8151|  11.0k|	return(name);
 8152|  11.0k|    }
 8153|       |
 8154|       |    /*
 8155|       |     * Check that xml:lang conforms to the specification
 8156|       |     * No more registered as an error, just generate a warning now
 8157|       |     * since this was deprecated in XML second edition
 8158|       |     */
 8159|  92.8k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  41.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8159:9): [True: 41.8k, False: 51.0k]
  |  Branch (8159:29): [True: 9.33k, False: 32.4k]
  ------------------
 8160|  9.33k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8160:6): [True: 6.05k, False: 3.27k]
  ------------------
 8161|  6.05k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8162|  6.05k|		          "Malformed value for xml:lang : %s\n",
 8163|  6.05k|			  val, NULL);
 8164|  6.05k|	}
 8165|  9.33k|    }
 8166|       |
 8167|       |    /*
 8168|       |     * Check that xml:space conforms to the specification
 8169|       |     */
 8170|  92.8k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|  92.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8170:9): [True: 631, False: 92.2k]
  ------------------
 8171|    631|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    631|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8171:6): [True: 201, False: 430]
  ------------------
 8172|    201|	    *(ctxt->space) = 0;
 8173|    430|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    430|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8173:11): [True: 197, False: 233]
  ------------------
 8174|    197|	    *(ctxt->space) = 1;
 8175|    233|	else {
 8176|    233|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8177|    233|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8178|    233|                                 val, NULL);
 8179|    233|	}
 8180|    631|    }
 8181|       |
 8182|  92.8k|    *value = val;
 8183|  92.8k|    return(name);
 8184|   103k|}
xmlParseStartTag:
 8214|   340k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8215|   340k|    const xmlChar *name;
 8216|   340k|    const xmlChar *attname;
 8217|   340k|    xmlChar *attvalue;
 8218|   340k|    const xmlChar **atts = ctxt->atts;
 8219|   340k|    int nbatts = 0;
 8220|   340k|    int maxatts = ctxt->maxatts;
 8221|   340k|    int i;
 8222|       |
 8223|   340k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   340k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8223:9): [True: 0, False: 340k]
  ------------------
 8224|   340k|    NEXT1;
  ------------------
  |  | 2318|   340k|#define NEXT1 {								\
  |  | 2319|   340k|	ctxt->input->col++;						\
  |  | 2320|   340k|	ctxt->input->cur++;						\
  |  | 2321|   340k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 635, False: 339k]
  |  |  ------------------
  |  | 2322|   340k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   340k|    }
  ------------------
 8225|       |
 8226|   340k|    name = xmlParseName(ctxt);
 8227|   340k|    if (name == NULL) {
  ------------------
  |  Branch (8227:9): [True: 11.3k, False: 329k]
  ------------------
 8228|  11.3k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8229|  11.3k|	     "xmlParseStartTag: invalid element name\n");
 8230|  11.3k|        return(NULL);
 8231|  11.3k|    }
 8232|       |
 8233|       |    /*
 8234|       |     * Now parse the attributes, it ends up with the ending
 8235|       |     *
 8236|       |     * (S Attribute)* S?
 8237|       |     */
 8238|   329k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   329k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8239|   329k|    GROW;
  ------------------
  |  | 2308|   329k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   329k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   329k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 177k, False: 151k]
  |  |  ------------------
  |  | 2309|   329k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   177k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 29.3k, False: 147k]
  |  |  ------------------
  |  | 2310|   329k|	xmlParserGrow(ctxt);
  ------------------
 8240|       |
 8241|   380k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   380k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8241:13): [True: 217k, False: 162k]
  ------------------
 8242|   217k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   217k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|  76.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8242:6): [True: 140k, False: 76.7k]
  |  Branch (8242:22): [True: 3.09k, False: 73.6k]
  ------------------
 8243|   143k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   143k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   143k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 137k, False: 6.31k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 137k]
  |  |  |  |  ------------------
  |  |  |  |  109|   143k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 143k]
  |  |  |  |  ------------------
  |  |  |  |  110|   143k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 136k, False: 7.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   136k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8243:29): [True: 136k, False: 173]
  ------------------
 8244|   136k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8245|   136k|        if (attname == NULL)
  ------------------
  |  Branch (8245:13): [True: 32.7k, False: 103k]
  ------------------
 8246|  32.7k|	    break;
 8247|   103k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8247:13): [True: 89.8k, False: 14.0k]
  ------------------
 8248|       |	    /*
 8249|       |	     * [ WFC: Unique Att Spec ]
 8250|       |	     * No attribute name may appear more than once in the same
 8251|       |	     * start-tag or empty-element tag.
 8252|       |	     */
 8253|   242k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8253:18): [True: 162k, False: 79.6k]
  ------------------
 8254|   162k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8254:14): [True: 10.2k, False: 152k]
  ------------------
 8255|  10.2k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8256|  10.2k|		    goto failed;
 8257|  10.2k|		}
 8258|   162k|	    }
 8259|       |	    /*
 8260|       |	     * Add the pair to atts
 8261|       |	     */
 8262|  79.6k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8262:10): [True: 20.7k, False: 58.8k]
  ------------------
 8263|  20.7k|	        const xmlChar **n;
 8264|  20.7k|                int newSize;
 8265|       |
 8266|  20.7k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8267|  20.7k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  20.7k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8268|  20.7k|                if (newSize < 0) {
  ------------------
  |  Branch (8268:21): [True: 0, False: 20.7k]
  ------------------
 8269|      0|		    xmlErrMemory(ctxt);
 8270|      0|		    goto failed;
 8271|      0|		}
 8272|  20.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8273|  20.7k|                if (newSize < 2)
  ------------------
  |  Branch (8273:21): [True: 12.8k, False: 7.93k]
  ------------------
 8274|  12.8k|                    newSize = 2;
 8275|  20.7k|#endif
 8276|  20.7k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8277|  20.7k|		if (n == NULL) {
  ------------------
  |  Branch (8277:7): [True: 5, False: 20.7k]
  ------------------
 8278|      5|		    xmlErrMemory(ctxt);
 8279|      5|		    goto failed;
 8280|      5|		}
 8281|  20.7k|		atts = n;
 8282|  20.7k|                maxatts = newSize * 2;
 8283|  20.7k|		ctxt->atts = atts;
 8284|  20.7k|		ctxt->maxatts = maxatts;
 8285|  20.7k|	    }
 8286|       |
 8287|  79.6k|	    atts[nbatts++] = attname;
 8288|  79.6k|	    atts[nbatts++] = attvalue;
 8289|  79.6k|	    atts[nbatts] = NULL;
 8290|  79.6k|	    atts[nbatts + 1] = NULL;
 8291|       |
 8292|  79.6k|            attvalue = NULL;
 8293|  79.6k|	}
 8294|       |
 8295|   103k|failed:
 8296|       |
 8297|   103k|        if (attvalue != NULL)
  ------------------
  |  Branch (8297:13): [True: 10.2k, False: 93.6k]
  ------------------
 8298|  10.2k|            xmlFree(attvalue);
 8299|       |
 8300|   103k|	GROW
  ------------------
  |  | 2308|   103k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   103k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   103k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 44.1k, False: 59.7k]
  |  |  ------------------
  |  | 2309|   103k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  44.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.2k, False: 32.9k]
  |  |  ------------------
  |  | 2310|   103k|	xmlParserGrow(ctxt);
  ------------------
 8301|   103k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   103k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|  80.6k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  30.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8301:6): [True: 23.2k, False: 80.6k]
  |  Branch (8301:24): [True: 30.1k, False: 50.5k]
  |  Branch (8301:40): [True: 29.5k, False: 618]
  ------------------
 8302|  52.7k|	    break;
 8303|  51.1k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  51.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8303:6): [True: 18.3k, False: 32.7k]
  ------------------
 8304|  18.3k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8305|  18.3k|			   "attributes construct error\n");
 8306|  18.3k|	}
 8307|  51.1k|	SHRINK;
  ------------------
  |  | 2304|  51.1k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  51.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  51.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 16.7k, False: 34.3k]
  |  |  ------------------
  |  | 2305|  51.1k|	xmlParserShrink(ctxt);
  ------------------
 8308|  51.1k|        GROW;
  ------------------
  |  | 2308|  51.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  51.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  51.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 16.7k, False: 34.3k]
  |  |  ------------------
  |  | 2309|  51.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  16.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.00k, False: 10.7k]
  |  |  ------------------
  |  | 2310|  51.1k|	xmlParserGrow(ctxt);
  ------------------
 8309|  51.1k|    }
 8310|       |
 8311|       |    /*
 8312|       |     * SAX: Start of Element !
 8313|       |     */
 8314|   329k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8314:9): [True: 329k, False: 0]
  |  Branch (8314:32): [True: 329k, False: 0]
  ------------------
 8315|   329k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8315:2): [True: 303k, False: 25.5k]
  ------------------
 8316|   303k|	if (nbatts > 0)
  ------------------
  |  Branch (8316:6): [True: 57.0k, False: 246k]
  ------------------
 8317|  57.0k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8318|   246k|	else
 8319|   246k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8320|   303k|    }
 8321|       |
 8322|   329k|    if (atts != NULL) {
  ------------------
  |  Branch (8322:9): [True: 225k, False: 103k]
  ------------------
 8323|       |        /* Free only the content strings */
 8324|   305k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8324:20): [True: 79.6k, False: 225k]
  ------------------
 8325|  79.6k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8325:10): [True: 79.6k, False: 0]
  ------------------
 8326|  79.6k|	       xmlFree((xmlChar *) atts[i]);
 8327|   225k|    }
 8328|   329k|    return(name);
 8329|   329k|}
xmlParseCDSect:
 9480|  94.6k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9481|  94.6k|    xmlChar *buf = NULL;
 9482|  94.6k|    int len = 0;
 9483|  94.6k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  94.6k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9484|  94.6k|    int r, rl;
 9485|  94.6k|    int	s, sl;
 9486|  94.6k|    int cur, l;
 9487|  94.6k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9487:21): [True: 13.5k, False: 81.0k]
  ------------------
 9488|  13.5k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  13.5k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9489|  94.6k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  81.0k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9490|       |
 9491|  94.6k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2262|  94.6k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  94.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  94.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9491:9): [True: 0, False: 94.6k]
  |  Branch (9491:25): [True: 0, False: 94.6k]
  |  Branch (9491:44): [True: 0, False: 94.6k]
  ------------------
 9492|      0|        return;
 9493|  94.6k|    SKIP(3);
  ------------------
  |  | 2285|  94.6k|#define SKIP(val) do {							\
  |  | 2286|  94.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  94.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 94.6k]
  |  |  ------------------
  |  | 2288|  94.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  94.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 94.6k]
  |  |  ------------------
  ------------------
 9494|       |
 9495|  94.6k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2273|  94.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   189k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   189k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 94.6k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 94.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  94.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 94.6k, False: 0]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 94.6k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 94.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 94.6k, False: 0]
  |  |  ------------------
  ------------------
 9496|      0|        return;
 9497|  94.6k|    SKIP(6);
  ------------------
  |  | 2285|  94.6k|#define SKIP(val) do {							\
  |  | 2286|  94.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  94.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 579, False: 94.0k]
  |  |  ------------------
  |  | 2288|  94.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  94.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 94.6k]
  |  |  ------------------
  ------------------
 9498|       |
 9499|  94.6k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9500|  94.6k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  94.6k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  94.6k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 92.6k, False: 2.03k]
  |  |  |  |  ------------------
  |  |  |  |  118|  94.6k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  92.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 92.0k, False: 586]
  |  |  |  |  |  |  |  Branch (108:44): [True: 713, False: 91.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  92.6k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 91.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  92.6k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 91.2k, False: 609]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  94.6k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.03k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 261, False: 1.77k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.03k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.77k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.04k, False: 727]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.03k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 531, False: 196]
  |  |  |  |  |  Branch (121:27): [True: 531, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9500:9): [True: 805, False: 93.8k]
  ------------------
 9501|    805|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9502|    805|        goto out;
 9503|    805|    }
 9504|  93.8k|    NEXTL(rl);
  ------------------
  |  | 2325|  93.8k|#define NEXTL(l) do {							\
  |  | 2326|  93.8k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 700, False: 93.1k]
  |  |  ------------------
  |  | 2327|    700|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  93.1k|    } else ctxt->input->col++;						\
  |  | 2329|  93.8k|    ctxt->input->cur += l;				\
  |  | 2330|  93.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 93.8k]
  |  |  ------------------
  ------------------
 9505|  93.8k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9506|  93.8k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  93.8k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  93.8k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 92.0k, False: 1.76k]
  |  |  |  |  ------------------
  |  |  |  |  118|  93.8k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  92.0k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 91.5k, False: 561]
  |  |  |  |  |  |  |  Branch (108:44): [True: 215, False: 91.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  92.0k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 91.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  92.0k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 91.1k, False: 666]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  93.8k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.76k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 406, False: 1.36k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.76k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.36k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 925, False: 437]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.76k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 234, False: 203]
  |  |  |  |  |  Branch (121:27): [True: 234, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9506:9): [True: 869, False: 92.9k]
  ------------------
 9507|    869|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9508|    869|        goto out;
 9509|    869|    }
 9510|  92.9k|    NEXTL(sl);
  ------------------
  |  | 2325|  92.9k|#define NEXTL(l) do {							\
  |  | 2326|  92.9k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 205, False: 92.7k]
  |  |  ------------------
  |  | 2327|    205|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  92.7k|    } else ctxt->input->col++;						\
  |  | 2329|  92.9k|    ctxt->input->cur += l;				\
  |  | 2330|  92.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 92.9k]
  |  |  ------------------
  ------------------
 9511|  92.9k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9512|  92.9k|    buf = xmlMalloc(size);
 9513|  92.9k|    if (buf == NULL) {
  ------------------
  |  Branch (9513:9): [True: 2, False: 92.9k]
  ------------------
 9514|      2|	xmlErrMemory(ctxt);
 9515|      2|        goto out;
 9516|      2|    }
 9517|  3.56M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  3.56M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  7.13M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 3.56M, False: 2.60k]
  |  |  |  |  |  Branch (117:25): [True: 317k, False: 3.25M]
  |  |  |  |  ------------------
  |  |  |  |  118|  7.13M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   317k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 316k, False: 1.14k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.83k, False: 313k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   317k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 314k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   317k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 312k, False: 2.40k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  7.13M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.25M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 12.9k, False: 3.23M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.25M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.23M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.23M, False: 674]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.25M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 470, False: 204]
  |  |  |  |  |  Branch (121:27): [True: 470, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9518|  3.56M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9518:13): [True: 3.47M, False: 93.6k]
  |  Branch (9518:27): [True: 751, False: 92.8k]
  |  Branch (9518:41): [True: 2.49k, False: 90.3k]
  ------------------
 9519|  3.47M|	if (len + 5 >= size) {
  ------------------
  |  Branch (9519:6): [True: 1.28k, False: 3.47M]
  ------------------
 9520|  1.28k|	    xmlChar *tmp;
 9521|  1.28k|            int newSize;
 9522|       |
 9523|  1.28k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9524|  1.28k|            if (newSize < 0) {
  ------------------
  |  Branch (9524:17): [True: 0, False: 1.28k]
  ------------------
 9525|      0|                xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9526|      0|                               "CData section too big found\n");
 9527|      0|                goto out;
 9528|      0|            }
 9529|  1.28k|	    tmp = xmlRealloc(buf, newSize);
 9530|  1.28k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9530:10): [True: 1, False: 1.28k]
  ------------------
 9531|      1|		xmlErrMemory(ctxt);
 9532|      1|                goto out;
 9533|      1|	    }
 9534|  1.28k|	    buf = tmp;
 9535|  1.28k|	    size = newSize;
 9536|  1.28k|	}
 9537|  3.47M|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2333|  3.47M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 206k, False: 3.27M]
  |  |  ------------------
  |  | 2334|  3.47M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9538|  3.47M|	r = s;
 9539|  3.47M|	rl = sl;
 9540|  3.47M|	s = cur;
 9541|  3.47M|	sl = l;
 9542|  3.47M|	NEXTL(l);
  ------------------
  |  | 2325|  3.47M|#define NEXTL(l) do {							\
  |  | 2326|  3.47M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.36k, False: 3.47M]
  |  |  ------------------
  |  | 2327|  2.36k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.47M|    } else ctxt->input->col++;						\
  |  | 2329|  3.47M|    ctxt->input->cur += l;				\
  |  | 2330|  3.47M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.47M]
  |  |  ------------------
  ------------------
 9543|  3.47M|	cur = xmlCurrentCharRecover(ctxt, &l);
 9544|  3.47M|    }
 9545|  92.9k|    buf[len] = 0;
 9546|  92.9k|    if (cur != '>') {
  ------------------
  |  Branch (9546:9): [True: 2.60k, False: 90.3k]
  ------------------
 9547|  2.60k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9548|  2.60k|	                     "CData section not finished\n%.50s\n", buf);
 9549|  2.60k|        goto out;
 9550|  2.60k|    }
 9551|  90.3k|    NEXTL(l);
  ------------------
  |  | 2325|  90.3k|#define NEXTL(l) do {							\
  |  | 2326|  90.3k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 90.3k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  90.3k|    } else ctxt->input->col++;						\
  |  | 2329|  90.3k|    ctxt->input->cur += l;				\
  |  | 2330|  90.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 90.3k]
  |  |  ------------------
  ------------------
 9552|       |
 9553|       |    /*
 9554|       |     * OK the buffer is to be consumed as cdata.
 9555|       |     */
 9556|  90.3k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9556:9): [True: 90.3k, False: 0]
  |  Branch (9556:32): [True: 90.0k, False: 269]
  ------------------
 9557|  90.0k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9557:13): [True: 90.0k, False: 0]
  ------------------
 9558|  90.0k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9558:13): [True: 71.9k, False: 18.1k]
  ------------------
 9559|  71.9k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9560|  71.9k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9560:20): [True: 18.1k, False: 0]
  ------------------
 9561|  18.1k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9562|  18.1k|        }
 9563|  90.0k|    }
 9564|       |
 9565|  94.6k|out:
 9566|  94.6k|    xmlFree(buf);
 9567|  94.6k|}
xmlParseElement:
 9707|  9.69k|xmlParseElement(xmlParserCtxt *ctxt) {
 9708|  9.69k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9708:9): [True: 3.99k, False: 5.69k]
  ------------------
 9709|  3.99k|        return;
 9710|       |
 9711|  5.69k|    xmlParseContentInternal(ctxt);
 9712|       |
 9713|  5.69k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9713:9): [True: 659, False: 5.03k]
  ------------------
 9714|    659|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9714:13): [True: 4, False: 655]
  ------------------
 9715|      4|            const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9716|      4|            int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9717|      4|            xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9718|      4|                    "Premature end of data in tag %s line %d\n",
 9719|      4|                    name, line, NULL);
 9720|      4|        }
 9721|    659|        return;
 9722|    659|    }
 9723|       |
 9724|  5.03k|    xmlParseElementEnd(ctxt);
 9725|  5.03k|}
xmlParseVersionNum:
 9905|  13.2k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9906|  13.2k|    xmlChar *buf = NULL;
 9907|  13.2k|    int len = 0;
 9908|  13.2k|    int size = 10;
 9909|  13.2k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9909:21): [True: 4.60k, False: 8.65k]
  ------------------
 9910|  4.60k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.60k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9911|  13.2k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  8.65k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9912|  13.2k|    xmlChar cur;
 9913|       |
 9914|  13.2k|    buf = xmlMalloc(size);
 9915|  13.2k|    if (buf == NULL) {
  ------------------
  |  Branch (9915:9): [True: 6, False: 13.2k]
  ------------------
 9916|      6|	xmlErrMemory(ctxt);
 9917|      6|	return(NULL);
 9918|      6|    }
 9919|  13.2k|    cur = CUR;
  ------------------
  |  | 2262|  13.2k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  13.2k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9920:11): [True: 12.7k, False: 517]
  |  Branch (9920:27): [True: 12.5k, False: 220]
  ------------------
 9921|    737|	xmlFree(buf);
 9922|    737|	return(NULL);
 9923|    737|    }
 9924|  12.5k|    buf[len++] = cur;
 9925|  12.5k|    NEXT;
  ------------------
  |  | 2316|  12.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9926|  12.5k|    cur=CUR;
  ------------------
  |  | 2262|  12.5k|#define CUR (*ctxt->input->cur)
  ------------------
 9927|  12.5k|    if (cur != '.') {
  ------------------
  |  Branch (9927:9): [True: 2.83k, False: 9.67k]
  ------------------
 9928|  2.83k|	xmlFree(buf);
 9929|  2.83k|	return(NULL);
 9930|  2.83k|    }
 9931|  9.67k|    buf[len++] = cur;
 9932|  9.67k|    NEXT;
  ------------------
  |  | 2316|  9.67k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9933|  9.67k|    cur=CUR;
  ------------------
  |  | 2262|  9.67k|#define CUR (*ctxt->input->cur)
  ------------------
 9934|   206k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9934:12): [True: 196k, False: 9.34k]
  |  Branch (9934:28): [True: 196k, False: 329]
  ------------------
 9935|   196k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9935:6): [True: 643, False: 195k]
  ------------------
 9936|    643|	    xmlChar *tmp;
 9937|    643|            int newSize;
 9938|       |
 9939|    643|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9940|    643|            if (newSize < 0) {
  ------------------
  |  Branch (9940:17): [True: 1, False: 642]
  ------------------
 9941|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9942|      1|                xmlFree(buf);
 9943|      1|                return(NULL);
 9944|      1|            }
 9945|    642|	    tmp = xmlRealloc(buf, newSize);
 9946|    642|	    if (tmp == NULL) {
  ------------------
  |  Branch (9946:10): [True: 1, False: 641]
  ------------------
 9947|      1|		xmlErrMemory(ctxt);
 9948|      1|	        xmlFree(buf);
 9949|      1|		return(NULL);
 9950|      1|	    }
 9951|    641|	    buf = tmp;
 9952|    641|            size = newSize;
 9953|    641|	}
 9954|   196k|	buf[len++] = cur;
 9955|   196k|	NEXT;
  ------------------
  |  | 2316|   196k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9956|   196k|	cur=CUR;
  ------------------
  |  | 2262|   196k|#define CUR (*ctxt->input->cur)
  ------------------
 9957|   196k|    }
 9958|  9.67k|    buf[len] = 0;
 9959|  9.67k|    return(buf);
 9960|  9.67k|}
xmlParseVersionInfo:
 9976|   236k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9977|   236k|    xmlChar *version = NULL;
 9978|       |
 9979|   236k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2275|   236k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   473k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   473k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   473k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 19.3k, False: 217k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 17.9k, False: 1.40k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   236k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 16.8k, False: 1.09k]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 16.6k, False: 249]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 16.0k, False: 546]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 14.9k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 14.5k, False: 396]
  |  |  ------------------
  ------------------
 9980|  14.5k|	SKIP(7);
  ------------------
  |  | 2285|  14.5k|#define SKIP(val) do {							\
  |  | 2286|  14.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  14.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 280, False: 14.2k]
  |  |  ------------------
  |  | 2288|  14.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  14.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 14.5k]
  |  |  ------------------
  ------------------
 9981|  14.5k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  14.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9982|  14.5k|	if (RAW != '=') {
  ------------------
  |  | 2261|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9982:6): [True: 860, False: 13.7k]
  ------------------
 9983|    860|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9984|    860|	    return(NULL);
 9985|    860|        }
 9986|  13.7k|	NEXT;
  ------------------
  |  | 2316|  13.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9987|  13.7k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  13.7k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9988|  13.7k|	if (RAW == '"') {
  ------------------
  |  | 2261|  13.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9988:6): [True: 2.68k, False: 11.0k]
  ------------------
 9989|  2.68k|	    NEXT;
  ------------------
  |  | 2316|  2.68k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9990|  2.68k|	    version = xmlParseVersionNum(ctxt);
 9991|  2.68k|	    if (RAW != '"') {
  ------------------
  |  | 2261|  2.68k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9991:10): [True: 487, False: 2.20k]
  ------------------
 9992|    487|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9993|    487|	    } else
 9994|  2.20k|	        NEXT;
  ------------------
  |  | 2316|  2.20k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9995|  11.0k|	} else if (RAW == '\''){
  ------------------
  |  | 2261|  11.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9995:13): [True: 10.5k, False: 453]
  ------------------
 9996|  10.5k|	    NEXT;
  ------------------
  |  | 2316|  10.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9997|  10.5k|	    version = xmlParseVersionNum(ctxt);
 9998|  10.5k|	    if (RAW != '\'') {
  ------------------
  |  | 2261|  10.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9998:10): [True: 3.39k, False: 7.16k]
  ------------------
 9999|  3.39k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10000|  3.39k|	    } else
10001|  7.16k|	        NEXT;
  ------------------
  |  | 2316|  7.16k|#define NEXT xmlNextChar(ctxt)
  ------------------
10002|  10.5k|	} else {
10003|    453|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10004|    453|	}
10005|  13.7k|    }
10006|   235k|    return(version);
10007|   236k|}
xmlParseEncName:
10020|  7.15k|xmlParseEncName(xmlParserCtxt *ctxt) {
10021|  7.15k|    xmlChar *buf = NULL;
10022|  7.15k|    int len = 0;
10023|  7.15k|    int size = 10;
10024|  7.15k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (10024:21): [True: 3.08k, False: 4.06k]
  ------------------
10025|  3.08k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.08k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
10026|  7.15k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.06k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
10027|  7.15k|    xmlChar cur;
10028|       |
10029|  7.15k|    cur = CUR;
  ------------------
  |  | 2262|  7.15k|#define CUR (*ctxt->input->cur)
  ------------------
10030|  7.15k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10030:10): [True: 1.13k, False: 6.01k]
  |  Branch (10030:26): [True: 914, False: 225]
  ------------------
10031|  6.72k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (10031:10): [True: 6.03k, False: 206]
  |  Branch (10031:26): [True: 5.81k, False: 225]
  ------------------
10032|  6.72k|	buf = xmlMalloc(size);
10033|  6.72k|	if (buf == NULL) {
  ------------------
  |  Branch (10033:6): [True: 1, False: 6.72k]
  ------------------
10034|      1|	    xmlErrMemory(ctxt);
10035|      1|	    return(NULL);
10036|      1|	}
10037|       |
10038|  6.72k|	buf[len++] = cur;
10039|  6.72k|	NEXT;
  ------------------
  |  | 2316|  6.72k|#define NEXT xmlNextChar(ctxt)
  ------------------
10040|  6.72k|	cur = CUR;
  ------------------
  |  | 2262|  6.72k|#define CUR (*ctxt->input->cur)
  ------------------
10041|   301k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10041:10): [True: 2.64k, False: 298k]
  |  Branch (10041:26): [True: 2.30k, False: 345]
  ------------------
10042|   298k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10042:10): [True: 263k, False: 35.5k]
  |  Branch (10042:26): [True: 262k, False: 565]
  ------------------
10043|  36.1k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10043:10): [True: 20.9k, False: 15.1k]
  |  Branch (10043:26): [True: 20.4k, False: 585]
  ------------------
10044|  15.7k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10044:9): [True: 721, False: 15.0k]
  |  Branch (10044:25): [True: 219, False: 14.8k]
  ------------------
10045|   294k|	       (cur == '-')) {
  ------------------
  |  Branch (10045:9): [True: 8.09k, False: 6.72k]
  ------------------
10046|   294k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10046:10): [True: 3.85k, False: 290k]
  ------------------
10047|  3.85k|	        xmlChar *tmp;
10048|  3.85k|                int newSize;
10049|       |
10050|  3.85k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10051|  3.85k|                if (newSize < 0) {
  ------------------
  |  Branch (10051:21): [True: 1, False: 3.85k]
  ------------------
10052|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10053|      1|                    xmlFree(buf);
10054|      1|                    return(NULL);
10055|      1|                }
10056|  3.85k|		tmp = xmlRealloc(buf, newSize);
10057|  3.85k|		if (tmp == NULL) {
  ------------------
  |  Branch (10057:7): [True: 2, False: 3.85k]
  ------------------
10058|      2|		    xmlErrMemory(ctxt);
10059|      2|		    xmlFree(buf);
10060|      2|		    return(NULL);
10061|      2|		}
10062|  3.85k|		buf = tmp;
10063|  3.85k|                size = newSize;
10064|  3.85k|	    }
10065|   294k|	    buf[len++] = cur;
10066|   294k|	    NEXT;
  ------------------
  |  | 2316|   294k|#define NEXT xmlNextChar(ctxt)
  ------------------
10067|   294k|	    cur = CUR;
  ------------------
  |  | 2262|   294k|#define CUR (*ctxt->input->cur)
  ------------------
10068|   294k|        }
10069|  6.72k|	buf[len] = 0;
10070|  6.72k|    } else {
10071|    431|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10072|    431|    }
10073|  7.15k|    return(buf);
10074|  7.15k|}
xmlParseEncodingDecl:
10091|   235k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10092|   235k|    xmlChar *encoding = NULL;
10093|       |
10094|   235k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   235k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10095|   235k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2277|   235k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   471k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   471k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   471k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   471k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 10.3k, False: 225k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 9.99k, False: 325]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   235k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 9.79k, False: 205]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 9.41k, False: 373]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 9.21k, False: 202]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 8.83k, False: 377]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 8.64k, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 8.41k, False: 229]
  |  |  ------------------
  ------------------
  |  Branch (10095:9): [True: 227k, False: 8.41k]
  ------------------
10096|   227k|        return(NULL);
10097|       |
10098|  8.41k|    SKIP(8);
  ------------------
  |  | 2285|  8.41k|#define SKIP(val) do {							\
  |  | 2286|  8.41k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.41k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 208, False: 8.20k]
  |  |  ------------------
  |  | 2288|  8.41k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.41k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.41k]
  |  |  ------------------
  ------------------
10099|  8.41k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  8.41k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10100|  8.41k|    if (RAW != '=') {
  ------------------
  |  | 2261|  8.41k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10100:9): [True: 573, False: 7.83k]
  ------------------
10101|    573|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10102|    573|        return(NULL);
10103|    573|    }
10104|  7.83k|    NEXT;
  ------------------
  |  | 2316|  7.83k|#define NEXT xmlNextChar(ctxt)
  ------------------
10105|  7.83k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  7.83k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10106|  7.83k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.83k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10106:9): [True: 1.48k, False: 6.35k]
  ------------------
10107|  1.48k|        NEXT;
  ------------------
  |  | 2316|  1.48k|#define NEXT xmlNextChar(ctxt)
  ------------------
10108|  1.48k|        encoding = xmlParseEncName(ctxt);
10109|  1.48k|        if (RAW != '"') {
  ------------------
  |  | 2261|  1.48k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10109:13): [True: 576, False: 904]
  ------------------
10110|    576|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10111|    576|            xmlFree(encoding);
10112|    576|            return(NULL);
10113|    576|        } else
10114|    904|            NEXT;
  ------------------
  |  | 2316|    904|#define NEXT xmlNextChar(ctxt)
  ------------------
10115|  6.35k|    } else if (RAW == '\''){
  ------------------
  |  | 2261|  6.35k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10115:16): [True: 5.67k, False: 683]
  ------------------
10116|  5.67k|        NEXT;
  ------------------
  |  | 2316|  5.67k|#define NEXT xmlNextChar(ctxt)
  ------------------
10117|  5.67k|        encoding = xmlParseEncName(ctxt);
10118|  5.67k|        if (RAW != '\'') {
  ------------------
  |  | 2261|  5.67k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10118:13): [True: 306, False: 5.36k]
  ------------------
10119|    306|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10120|    306|            xmlFree(encoding);
10121|    306|            return(NULL);
10122|    306|        } else
10123|  5.36k|            NEXT;
  ------------------
  |  | 2316|  5.36k|#define NEXT xmlNextChar(ctxt)
  ------------------
10124|  5.67k|    } else {
10125|    683|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10126|    683|    }
10127|       |
10128|  6.95k|    if (encoding == NULL)
  ------------------
  |  Branch (10128:9): [True: 685, False: 6.27k]
  ------------------
10129|    685|        return(NULL);
10130|       |
10131|  6.27k|    xmlSetDeclaredEncoding(ctxt, encoding);
10132|       |
10133|  6.27k|    return(ctxt->encoding);
10134|  6.95k|}
xmlParseSDDecl:
10168|  1.25k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10169|  1.25k|    int standalone = -2;
10170|       |
10171|  1.25k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.25k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10172|  1.25k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2282|  1.25k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2279|  2.50k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2277|  2.50k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2275|  2.50k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2273|  2.50k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2271|  2.50k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2268|  2.50k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 313, False: 938]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 307, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2269|  1.25k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 305, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 300, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 298, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 297, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2275:42): [True: 296, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2277:46): [True: 295, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2280|  2.50k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2280:5): [True: 294, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2283|  1.25k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2283:5): [True: 290, False: 4]
  |  |  ------------------
  ------------------
10173|    290|	SKIP(10);
  ------------------
  |  | 2285|    290|#define SKIP(val) do {							\
  |  | 2286|    290|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    290|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 289]
  |  |  ------------------
  |  | 2288|    290|        xmlParserGrow(ctxt);						\
  |  | 2289|    290|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 290]
  |  |  ------------------
  ------------------
10174|    290|        SKIP_BLANKS;
  ------------------
  |  | 2312|    290|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10175|    290|	if (RAW != '=') {
  ------------------
  |  | 2261|    290|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10175:6): [True: 5, False: 285]
  ------------------
10176|      5|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10177|      5|	    return(standalone);
10178|      5|        }
10179|    285|	NEXT;
  ------------------
  |  | 2316|    285|#define NEXT xmlNextChar(ctxt)
  ------------------
10180|    285|	SKIP_BLANKS;
  ------------------
  |  | 2312|    285|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10181|    285|        if (RAW == '\''){
  ------------------
  |  | 2261|    285|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10181:13): [True: 273, False: 12]
  ------------------
10182|    273|	    NEXT;
  ------------------
  |  | 2316|    273|#define NEXT xmlNextChar(ctxt)
  ------------------
10183|    273|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|    273|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      6|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10183:10): [True: 6, False: 267]
  |  Branch (10183:26): [True: 5, False: 1]
  ------------------
10184|      5|	        standalone = 0;
10185|      5|                SKIP(2);
  ------------------
  |  | 2285|      5|#define SKIP(val) do {							\
  |  | 2286|      5|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      5|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 4]
  |  |  ------------------
  |  | 2288|      5|        xmlParserGrow(ctxt);						\
  |  | 2289|      5|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5]
  |  |  ------------------
  ------------------
10186|    268|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|    268|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|    265|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10186:17): [True: 265, False: 3]
  |  Branch (10186:33): [True: 264, False: 1]
  ------------------
10187|    264|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|    264|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10187:17): [True: 263, False: 1]
  ------------------
10188|    263|	        standalone = 1;
10189|    263|		SKIP(3);
  ------------------
  |  | 2285|    263|#define SKIP(val) do {							\
  |  | 2286|    263|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    263|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 262]
  |  |  ------------------
  |  | 2288|    263|        xmlParserGrow(ctxt);						\
  |  | 2289|    263|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 263]
  |  |  ------------------
  ------------------
10190|    263|            } else {
10191|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10192|      5|	    }
10193|    273|	    if (RAW != '\'') {
  ------------------
  |  | 2261|    273|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10193:10): [True: 15, False: 258]
  ------------------
10194|     15|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10195|     15|	    } else
10196|    258|	        NEXT;
  ------------------
  |  | 2316|    258|#define NEXT xmlNextChar(ctxt)
  ------------------
10197|    273|	} else if (RAW == '"'){
  ------------------
  |  | 2261|     12|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10197:13): [True: 9, False: 3]
  ------------------
10198|      9|	    NEXT;
  ------------------
  |  | 2316|      9|#define NEXT xmlNextChar(ctxt)
  ------------------
10199|      9|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10199:10): [True: 3, False: 6]
  |  Branch (10199:26): [True: 2, False: 1]
  ------------------
10200|      2|	        standalone = 0;
10201|      2|		SKIP(2);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10202|      7|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|      7|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10202:17): [True: 4, False: 3]
  |  Branch (10202:33): [True: 3, False: 1]
  ------------------
10203|      3|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10203:17): [True: 2, False: 1]
  ------------------
10204|      2|	        standalone = 1;
10205|      2|                SKIP(3);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10206|      5|            } else {
10207|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10208|      5|	    }
10209|      9|	    if (RAW != '"') {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10209:10): [True: 8, False: 1]
  ------------------
10210|      8|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10211|      8|	    } else
10212|      1|	        NEXT;
  ------------------
  |  | 2316|      1|#define NEXT xmlNextChar(ctxt)
  ------------------
10213|      9|	} else {
10214|      3|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10215|      3|        }
10216|    285|    }
10217|  1.24k|    return(standalone);
10218|  1.25k|}
xmlParseXMLDecl:
10230|  3.22k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10231|  3.22k|    xmlChar *version;
10232|       |
10233|       |    /*
10234|       |     * This value for standalone indicates that the document has an
10235|       |     * XML declaration but it does not have a standalone attribute.
10236|       |     * It will be overwritten later if a standalone attribute is found.
10237|       |     */
10238|       |
10239|  3.22k|    ctxt->standalone = -2;
10240|       |
10241|       |    /*
10242|       |     * We know that '<?xml' is here.
10243|       |     */
10244|  3.22k|    SKIP(5);
  ------------------
  |  | 2285|  3.22k|#define SKIP(val) do {							\
  |  | 2286|  3.22k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.22k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.22k]
  |  |  ------------------
  |  | 2288|  3.22k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.22k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.22k]
  |  |  ------------------
  ------------------
10245|       |
10246|  3.22k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.22k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.22k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.17k, False: 59]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.22k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 59, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 46, False: 13]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.22k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 13, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10247|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10248|      0|	               "Blank needed after '<?xml'\n");
10249|      0|    }
10250|  3.22k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  3.22k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10251|       |
10252|       |    /*
10253|       |     * We must have the VersionInfo here.
10254|       |     */
10255|  3.22k|    version = xmlParseVersionInfo(ctxt);
10256|  3.22k|    if (version == NULL) {
  ------------------
  |  Branch (10256:9): [True: 878, False: 2.35k]
  ------------------
10257|    878|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10258|  2.35k|    } else {
10259|  2.35k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.35k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10259:6): [True: 242, False: 2.10k]
  ------------------
10260|       |	    /*
10261|       |	     * Changed here for XML-1.0 5th edition
10262|       |	     */
10263|    242|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10263:10): [True: 26, False: 216]
  ------------------
10264|     26|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10265|     26|			          "Unsupported version '%s'\n",
10266|     26|			          version);
10267|    216|	    } else {
10268|    216|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10268:14): [True: 187, False: 29]
  |  Branch (10268:37): [True: 187, False: 0]
  ------------------
10269|    187|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10270|    187|		                  "Unsupported version '%s'\n",
10271|    187|				  version, NULL);
10272|    187|		} else {
10273|     29|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10274|     29|				      "Unsupported version '%s'\n",
10275|     29|				      version);
10276|     29|		}
10277|    216|	    }
10278|    242|	}
10279|  2.35k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10279:6): [True: 0, False: 2.35k]
  ------------------
10280|      0|	    xmlFree(ctxt->version);
10281|  2.35k|	ctxt->version = version;
10282|  2.35k|    }
10283|       |
10284|       |    /*
10285|       |     * We may have the encoding declaration
10286|       |     */
10287|  3.22k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.22k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.22k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.02k, False: 2.20k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.22k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.18k, False: 27]
  |  |  |  |  |  Branch (91:23): [True: 15, False: 2.16k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.22k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 2.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10288|  2.18k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  2.18k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  1.28k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10288:13): [True: 1.28k, False: 901]
  |  Branch (10288:29): [True: 1.27k, False: 13]
  ------------------
10289|  1.27k|	    SKIP(2);
  ------------------
  |  | 2285|  1.27k|#define SKIP(val) do {							\
  |  | 2286|  1.27k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.27k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1.27k]
  |  |  ------------------
  |  | 2288|  1.27k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.27k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.27k]
  |  |  ------------------
  ------------------
10290|  1.27k|	    return;
10291|  1.27k|	}
10292|    914|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10293|    914|    }
10294|  1.95k|    xmlParseEncodingDecl(ctxt);
10295|       |
10296|       |    /*
10297|       |     * We may have the standalone status.
10298|       |     */
10299|  1.95k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    837|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    837|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 38, False: 799]
  |  |  |  |  ------------------
  |  |  |  |   91|    837|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 786, False: 13]
  |  |  |  |  |  Branch (91:23): [True: 16, False: 770]
  |  |  |  |  ------------------
  |  |  |  |   92|    837|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 3, False: 780]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10299:9): [True: 837, False: 1.12k]
  ------------------
10300|    780|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|    780|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    725|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10300:13): [True: 725, False: 55]
  |  Branch (10300:29): [True: 706, False: 19]
  ------------------
10301|    706|	    SKIP(2);
  ------------------
  |  | 2285|    706|#define SKIP(val) do {							\
  |  | 2286|    706|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    706|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 2, False: 704]
  |  |  ------------------
  |  | 2288|    706|        xmlParserGrow(ctxt);						\
  |  | 2289|    706|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 706]
  |  |  ------------------
  ------------------
10302|    706|	    return;
10303|    706|	}
10304|     74|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10305|     74|    }
10306|       |
10307|       |    /*
10308|       |     * We can grow the input buffer freely at that point
10309|       |     */
10310|  1.25k|    GROW;
  ------------------
  |  | 2308|  1.25k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.25k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.25k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 64, False: 1.18k]
  |  |  ------------------
  |  | 2309|  1.25k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     64|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 46, False: 18]
  |  |  ------------------
  |  | 2310|  1.25k|	xmlParserGrow(ctxt);
  ------------------
10311|       |
10312|  1.25k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.25k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10313|  1.25k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10314|       |
10315|  1.25k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.25k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10316|  1.25k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  1.25k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    338|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10316:9): [True: 338, False: 913]
  |  Branch (10316:25): [True: 301, False: 37]
  ------------------
10317|    301|        SKIP(2);
  ------------------
  |  | 2285|    301|#define SKIP(val) do {							\
  |  | 2286|    301|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    301|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 300]
  |  |  ------------------
  |  | 2288|    301|        xmlParserGrow(ctxt);						\
  |  | 2289|    301|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 301]
  |  |  ------------------
  ------------------
10318|    950|    } else if (RAW == '>') {
  ------------------
  |  | 2261|    950|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10318:16): [True: 23, False: 927]
  ------------------
10319|       |        /* Deprecated old WD ... */
10320|     23|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10321|     23|	NEXT;
  ------------------
  |  | 2316|     23|#define NEXT xmlNextChar(ctxt)
  ------------------
10322|    927|    } else {
10323|    927|        int c;
10324|       |
10325|    927|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10326|   170k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   170k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10326:16): [True: 170k, False: 31]
  ------------------
10327|   170k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   170k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10327:16): [True: 170k, False: 428]
  ------------------
10328|   170k|            NEXT;
  ------------------
  |  | 2316|   170k|#define NEXT xmlNextChar(ctxt)
  ------------------
10329|   170k|            if (c == '>')
  ------------------
  |  Branch (10329:17): [True: 468, False: 169k]
  ------------------
10330|    468|                break;
10331|   170k|        }
10332|    927|    }
10333|  1.25k|}
xmlParseMisc:
10373|  22.3k|xmlParseMisc(xmlParserCtxt *ctxt) {
10374|  24.4k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  24.4k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10374:12): [True: 24.2k, False: 206]
  ------------------
10375|  24.2k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  24.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10376|  24.2k|        GROW;
  ------------------
  |  | 2308|  24.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  24.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  24.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 24.2k, False: 0]
  |  |  ------------------
  |  | 2309|  24.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  24.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 19.4k, False: 4.81k]
  |  |  ------------------
  |  | 2310|  24.2k|	xmlParserGrow(ctxt);
  ------------------
10377|  24.2k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|  24.2k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|  15.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10377:13): [True: 15.2k, False: 9.04k]
  |  Branch (10377:29): [True: 991, False: 14.2k]
  ------------------
10378|    991|	    xmlParsePI(ctxt);
10379|  23.2k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2268|  23.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 14.2k, False: 9.04k]
  |  |  |  Branch (2268:41): [True: 4.11k, False: 10.1k]
  |  |  ------------------
  |  | 2269|  23.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 1.13k, False: 2.98k]
  |  |  |  Branch (2269:41): [True: 1.13k, False: 1]
  |  |  ------------------
  ------------------
10380|  1.13k|	    xmlParseComment(ctxt);
10381|  22.1k|        } else {
10382|  22.1k|            break;
10383|  22.1k|        }
10384|  24.2k|    }
10385|  22.3k|}
xmlParseDocument:
10418|  9.81k|xmlParseDocument(xmlParserCtxt *ctxt) {
10419|  9.81k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10419:9): [True: 0, False: 9.81k]
  |  Branch (10419:27): [True: 0, False: 9.81k]
  ------------------
10420|      0|        return(-1);
10421|       |
10422|  9.81k|    GROW;
  ------------------
  |  | 2308|  9.81k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.81k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.81k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.81k, False: 0]
  |  |  ------------------
  |  | 2309|  9.81k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.81k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.15k, False: 2.65k]
  |  |  ------------------
  |  | 2310|  9.81k|	xmlParserGrow(ctxt);
  ------------------
10423|       |
10424|       |    /*
10425|       |     * SAX: detecting the level.
10426|       |     */
10427|  9.81k|    xmlCtxtInitializeLate(ctxt);
10428|       |
10429|  9.81k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10429:9): [True: 9.81k, False: 0]
  |  Branch (10429:24): [True: 9.81k, False: 0]
  ------------------
10430|  9.81k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10431|  9.81k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10432|  9.81k|    }
10433|       |
10434|  9.81k|    xmlDetectEncoding(ctxt);
10435|       |
10436|  9.81k|    if (CUR == 0) {
  ------------------
  |  | 2262|  9.81k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10436:9): [True: 3, False: 9.81k]
  ------------------
10437|      3|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10438|      3|	return(-1);
10439|      3|    }
10440|       |
10441|  9.81k|    GROW;
  ------------------
  |  | 2308|  9.81k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.81k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.81k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.81k, False: 0]
  |  |  ------------------
  |  | 2309|  9.81k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.81k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.15k, False: 2.65k]
  |  |  ------------------
  |  | 2310|  9.81k|	xmlParserGrow(ctxt);
  ------------------
10442|  9.81k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|  9.81k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  19.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 9.66k, False: 152]
  |  |  |  |  |  Branch (2268:41): [True: 663, False: 8.99k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  9.81k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 385, False: 278]
  |  |  |  |  |  Branch (2269:41): [True: 196, False: 189]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 185, False: 11]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    185|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    185|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 172, False: 13]
  |  |  |  |  ------------------
  |  |  |  |   91|    185|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 12, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 7, False: 5]
  |  |  |  |  ------------------
  |  |  |  |   92|    185|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10443|       |
10444|       |	/*
10445|       |	 * Note that we will switch encoding on the fly.
10446|       |	 */
10447|    181|	xmlParseXMLDecl(ctxt);
10448|    181|	SKIP_BLANKS;
  ------------------
  |  | 2312|    181|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10449|  9.63k|    } else {
10450|  9.63k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  9.63k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10451|  9.63k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10451:13): [True: 1, False: 9.63k]
  ------------------
10452|      1|            xmlErrMemory(ctxt);
10453|      1|            return(-1);
10454|      1|        }
10455|  9.63k|    }
10456|  9.81k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10456:9): [True: 9.81k, False: 0]
  |  Branch (10456:24): [True: 9.81k, False: 0]
  |  Branch (10456:54): [True: 9.75k, False: 59]
  ------------------
10457|  9.75k|        ctxt->sax->startDocument(ctxt->userData);
10458|  9.81k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10458:9): [True: 9.74k, False: 64]
  |  Branch (10458:34): [True: 9.74k, False: 0]
  ------------------
10459|  9.74k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10459:9): [True: 9.74k, False: 0]
  |  Branch (10459:39): [True: 0, False: 9.74k]
  ------------------
10460|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10461|      0|    }
10462|       |
10463|       |    /*
10464|       |     * The Misc part of the Prolog
10465|       |     */
10466|  9.81k|    xmlParseMisc(ctxt);
10467|       |
10468|       |    /*
10469|       |     * Then possibly doc type declaration(s) and more Misc
10470|       |     * (doctypedecl Misc*)?
10471|       |     */
10472|  9.81k|    GROW;
  ------------------
  |  | 2308|  9.81k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.81k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.81k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.81k, False: 0]
  |  |  ------------------
  |  | 2309|  9.81k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.81k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.18k, False: 2.62k]
  |  |  ------------------
  |  | 2310|  9.81k|	xmlParserGrow(ctxt);
  ------------------
10473|  9.81k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2279|  9.81k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  19.6k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  19.6k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  19.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  19.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  19.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 9.79k, False: 16]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.91k, False: 6.87k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  9.81k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.90k, False: 16]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.89k, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.88k, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.88k, False: 9]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 2.87k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 2.86k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  9.81k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 2.86k, False: 3]
  |  |  ------------------
  ------------------
10474|       |
10475|  2.86k|	ctxt->inSubset = 1;
10476|  2.86k|	xmlParseDocTypeDecl(ctxt);
10477|  2.86k|	if (RAW == '[') {
  ------------------
  |  | 2261|  2.86k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10477:6): [True: 1.22k, False: 1.64k]
  ------------------
10478|  1.22k|	    xmlParseInternalSubset(ctxt);
10479|  1.64k|	} else if (RAW == '>') {
  ------------------
  |  | 2261|  1.64k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10479:13): [True: 1.60k, False: 43]
  ------------------
10480|  1.60k|            NEXT;
  ------------------
  |  | 2316|  1.60k|#define NEXT xmlNextChar(ctxt)
  ------------------
10481|  1.60k|        }
10482|       |
10483|       |	/*
10484|       |	 * Create and update the external subset.
10485|       |	 */
10486|  2.86k|	ctxt->inSubset = 2;
10487|  2.86k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10487:6): [True: 2.86k, False: 0]
  |  Branch (10487:29): [True: 2.86k, False: 0]
  ------------------
10488|  2.86k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10488:6): [True: 2.76k, False: 102]
  ------------------
10489|  2.76k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10490|  2.76k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10491|  2.86k|	ctxt->inSubset = 0;
10492|       |
10493|  2.86k|        xmlCleanSpecialAttr(ctxt);
10494|       |
10495|  2.86k|	xmlParseMisc(ctxt);
10496|  2.86k|    }
10497|       |
10498|       |    /*
10499|       |     * Time to start parsing the tree itself
10500|       |     */
10501|  9.81k|    GROW;
  ------------------
  |  | 2308|  9.81k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.81k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.81k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 9.81k, False: 0]
  |  |  ------------------
  |  | 2309|  9.81k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  9.81k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 7.41k, False: 2.39k]
  |  |  ------------------
  |  | 2310|  9.81k|	xmlParserGrow(ctxt);
  ------------------
10502|  9.81k|    if (RAW != '<') {
  ------------------
  |  | 2261|  9.81k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10502:9): [True: 120, False: 9.69k]
  ------------------
10503|    120|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10503:13): [True: 12, False: 108]
  ------------------
10504|     12|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10505|     12|                           "Start tag expected, '<' not found\n");
10506|  9.69k|    } else {
10507|  9.69k|	xmlParseElement(ctxt);
10508|       |
10509|       |	/*
10510|       |	 * The Misc part at the end
10511|       |	 */
10512|  9.69k|	xmlParseMisc(ctxt);
10513|       |
10514|  9.69k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10515|  9.69k|    }
10516|       |
10517|  9.81k|    ctxt->instate = XML_PARSER_EOF;
10518|  9.81k|    xmlFinishDocument(ctxt);
10519|       |
10520|  9.81k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10520:9): [True: 1.25k, False: 8.55k]
  ------------------
10521|  1.25k|	ctxt->valid = 0;
10522|  1.25k|	return(-1);
10523|  1.25k|    }
10524|       |
10525|  8.55k|    return(0);
10526|  9.81k|}
xmlParseChunk:
11275|   447k|              int terminate) {
11276|   447k|    size_t curBase;
11277|   447k|    size_t maxLength;
11278|   447k|    size_t pos;
11279|   447k|    int end_in_lf = 0;
11280|   447k|    int res;
11281|       |
11282|   447k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11282:9): [True: 0, False: 447k]
  |  Branch (11282:27): [True: 0, False: 447k]
  ------------------
11283|      0|        return(XML_ERR_ARGUMENT);
11284|   447k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11284:9): [True: 0, False: 447k]
  |  Branch (11284:28): [True: 0, False: 0]
  ------------------
11285|      0|        return(XML_ERR_ARGUMENT);
11286|   447k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11286:9): [True: 0, False: 447k]
  |  Branch (11286:34): [True: 0, False: 447k]
  ------------------
11287|      0|        return(XML_ERR_ARGUMENT);
11288|   447k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11288:9): [True: 2.77k, False: 444k]
  ------------------
11289|  2.77k|        return(ctxt->errNo);
11290|       |
11291|   444k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   444k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11292|   444k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11292:9): [True: 43.3k, False: 401k]
  ------------------
11293|  43.3k|        xmlCtxtInitializeLate(ctxt);
11294|   444k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11294:9): [True: 411k, False: 33.0k]
  |  Branch (11294:23): [True: 411k, False: 0]
  |  Branch (11294:42): [True: 411k, False: 0]
  ------------------
11295|   411k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11295:9): [True: 1.77k, False: 409k]
  ------------------
11296|  1.77k|	end_in_lf = 1;
11297|  1.77k|	size--;
11298|  1.77k|    }
11299|       |
11300|       |    /*
11301|       |     * Also push an empty chunk to make sure that the raw buffer
11302|       |     * will be flushed if there is an encoder.
11303|       |     */
11304|   444k|    pos = ctxt->input->cur - ctxt->input->base;
11305|   444k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11306|   444k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11307|   444k|    if (res < 0) {
  ------------------
  |  Branch (11307:9): [True: 255, False: 444k]
  ------------------
11308|    255|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11309|    255|        return(ctxt->errNo);
11310|    255|    }
11311|       |
11312|   444k|    xmlParseTryOrFinish(ctxt, terminate);
11313|       |
11314|   444k|    curBase = ctxt->input->cur - ctxt->input->base;
11315|   444k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11315:17): [True: 231k, False: 213k]
  ------------------
11316|   231k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   231k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11317|   444k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   657k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11318|   444k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11318:9): [True: 0, False: 444k]
  ------------------
11319|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11320|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11321|      0|    }
11322|       |
11323|   444k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11323:9): [True: 89.5k, False: 354k]
  |  Branch (11323:40): [True: 12.7k, False: 76.7k]
  ------------------
11324|  12.7k|        return(ctxt->errNo);
11325|       |
11326|   431k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11326:9): [True: 1.77k, False: 429k]
  ------------------
11327|  1.77k|	pos = ctxt->input->cur - ctxt->input->base;
11328|  1.77k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11329|  1.77k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11330|  1.77k|        if (res < 0) {
  ------------------
  |  Branch (11330:13): [True: 3, False: 1.76k]
  ------------------
11331|      3|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11332|      3|            return(ctxt->errNo);
11333|      3|        }
11334|  1.77k|    }
11335|   431k|    if (terminate) {
  ------------------
  |  Branch (11335:9): [True: 22.6k, False: 408k]
  ------------------
11336|       |	/*
11337|       |	 * Check for termination
11338|       |	 */
11339|  22.6k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11339:13): [True: 12.4k, False: 10.2k]
  ------------------
11340|  12.4k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11340:13): [True: 5.91k, False: 6.48k]
  ------------------
11341|  5.91k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11341:17): [True: 4.11k, False: 1.80k]
  ------------------
11342|  4.11k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11343|  4.11k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11344|  4.11k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11345|  4.11k|                        "Premature end of data in tag %s line %d\n",
11346|  4.11k|                        name, line, NULL);
11347|  4.11k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11347:24): [True: 29, False: 1.77k]
  ------------------
11348|     29|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11349|  1.77k|            } else {
11350|  1.77k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11351|  1.77k|                               "Start tag expected, '<' not found\n");
11352|  1.77k|            }
11353|  16.7k|        } else {
11354|  16.7k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11355|  16.7k|        }
11356|  22.6k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11356:6): [True: 12.1k, False: 10.5k]
  ------------------
11357|  12.1k|            ctxt->instate = XML_PARSER_EOF;
11358|  12.1k|            xmlFinishDocument(ctxt);
11359|  12.1k|	}
11360|  22.6k|    }
11361|   431k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11361:9): [True: 23.3k, False: 408k]
  ------------------
11362|  23.3k|	return((xmlParserErrors) ctxt->errNo);
11363|   408k|    else
11364|   408k|        return(0);
11365|   431k|}
xmlCreatePushParserCtxt:
11396|  43.2k|                        const char *chunk, int size, const char *filename) {
11397|  43.2k|    xmlParserCtxtPtr ctxt;
11398|  43.2k|    xmlParserInputPtr input;
11399|       |
11400|  43.2k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11401|  43.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (11401:9): [True: 26, False: 43.2k]
  ------------------
11402|     26|	return(NULL);
11403|       |
11404|  43.2k|    ctxt->options &= ~XML_PARSE_NODICT;
11405|  43.2k|    ctxt->dictNames = 1;
11406|       |
11407|  43.2k|    input = xmlNewPushInput(filename, chunk, size);
11408|  43.2k|    if (input == NULL) {
  ------------------
  |  Branch (11408:9): [True: 18, False: 43.1k]
  ------------------
11409|     18|	xmlFreeParserCtxt(ctxt);
11410|     18|	return(NULL);
11411|     18|    }
11412|  43.1k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11412:9): [True: 0, False: 43.1k]
  ------------------
11413|      0|        xmlFreeInputStream(input);
11414|      0|        xmlFreeParserCtxt(ctxt);
11415|      0|        return(NULL);
11416|      0|    }
11417|       |
11418|  43.1k|    return(ctxt);
11419|  43.1k|}
xmlStopParser:
11428|  45.3k|xmlStopParser(xmlParserCtxt *ctxt) {
11429|  45.3k|    if (ctxt == NULL)
  ------------------
  |  Branch (11429:9): [True: 0, False: 45.3k]
  ------------------
11430|      0|        return;
11431|       |
11432|       |    /* This stops the parser */
11433|  45.3k|    ctxt->disableSAX = 2;
11434|       |
11435|       |    /*
11436|       |     * xmlStopParser is often called from error handlers,
11437|       |     * so we can't raise an error here to avoid infinite
11438|       |     * loops. Just make sure that an error condition is
11439|       |     * reported.
11440|       |     */
11441|  45.3k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11441:9): [True: 4.28k, False: 41.0k]
  ------------------
11442|  4.28k|        ctxt->errNo = XML_ERR_USER_STOP;
11443|  4.28k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11444|  4.28k|        ctxt->wellFormed = 0;
11445|  4.28k|    }
11446|  45.3k|}
xmlCtxtUseOptions:
13304|  54.1k|{
13305|  54.1k|    int keepMask;
13306|       |
13307|  54.1k|#ifdef LIBXML_HTML_ENABLED
13308|  54.1k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13308:9): [True: 54.1k, False: 0]
  |  Branch (13308:27): [True: 0, False: 54.1k]
  ------------------
13309|      0|        return(htmlCtxtUseOptions(ctxt, options));
13310|  54.1k|#endif
13311|       |
13312|       |    /*
13313|       |     * For historic reasons, some options can only be enabled.
13314|       |     */
13315|  54.1k|    keepMask = XML_PARSE_NOERROR |
13316|  54.1k|               XML_PARSE_NOWARNING |
13317|  54.1k|               XML_PARSE_NONET |
13318|  54.1k|               XML_PARSE_NSCLEAN |
13319|  54.1k|               XML_PARSE_NOCDATA |
13320|  54.1k|               XML_PARSE_COMPACT |
13321|  54.1k|               XML_PARSE_OLD10 |
13322|  54.1k|               XML_PARSE_HUGE |
13323|  54.1k|               XML_PARSE_OLDSAX |
13324|  54.1k|               XML_PARSE_IGNORE_ENC |
13325|  54.1k|               XML_PARSE_BIG_LINES;
13326|       |
13327|  54.1k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13328|  54.1k|}
parser.c:xmlParserNsLookup:
 1525|  2.05M|                  xmlParserNsBucket **bucketPtr) {
 1526|  2.05M|    xmlParserNsBucket *bucket, *tombstone;
 1527|  2.05M|    unsigned index, hashValue;
 1528|       |
 1529|  2.05M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1529:9): [True: 861k, False: 1.19M]
  ------------------
 1530|   861k|        return(ctxt->nsdb->defaultNsIndex);
 1531|       |
 1532|  1.19M|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1532:9): [True: 32.1k, False: 1.16M]
  ------------------
 1533|  32.1k|        return(INT_MAX);
 1534|       |
 1535|  1.16M|    hashValue = prefix->hashValue;
 1536|  1.16M|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1537|  1.16M|    bucket = &ctxt->nsdb->hash[index];
 1538|  1.16M|    tombstone = NULL;
 1539|       |
 1540|  1.70M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1540:12): [True: 1.48M, False: 222k]
  ------------------
 1541|  1.48M|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1541:13): [True: 137k, False: 1.34M]
  ------------------
 1542|   137k|            if (tombstone == NULL)
  ------------------
  |  Branch (1542:17): [True: 116k, False: 20.9k]
  ------------------
 1543|   116k|                tombstone = bucket;
 1544|  1.34M|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1544:20): [True: 940k, False: 405k]
  ------------------
 1545|   940k|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1545:17): [True: 940k, False: 0]
  ------------------
 1546|   940k|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1546:21): [True: 603k, False: 336k]
  ------------------
 1547|   603k|                    *bucketPtr = bucket;
 1548|   940k|                return(bucket->index);
 1549|   940k|            }
 1550|   940k|        }
 1551|       |
 1552|   542k|        index++;
 1553|   542k|        bucket++;
 1554|   542k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1554:13): [True: 128k, False: 413k]
  ------------------
 1555|   128k|            index = 0;
 1556|   128k|            bucket = ctxt->nsdb->hash;
 1557|   128k|        }
 1558|   542k|    }
 1559|       |
 1560|   222k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1560:9): [True: 90.1k, False: 132k]
  ------------------
 1561|  90.1k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1561:22): [True: 86.2k, False: 3.92k]
  ------------------
 1562|       |    return(INT_MAX);
 1563|  1.16M|}
parser.c:xmlFatalErrMsg:
  259|  25.1M|{
  260|  25.1M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  25.1M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  25.1M|}
parser.c:xmlErrMemory:
  224|    474|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    474|    xmlCtxtErrMemory(ctxt);
  226|    474|}
parser.c:xmlFatalErrMsgInt:
  313|  7.82M|{
  314|  7.82M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.82M|               NULL, NULL, NULL, val, msg, val);
  316|  7.82M|}
parser.c:xmlIsNameChar:
 3068|  30.1M|xmlIsNameChar(int c, int old10) {
 3069|  30.1M|    if (!old10)
  ------------------
  |  Branch (3069:9): [True: 19.7M, False: 10.3M]
  ------------------
 3070|  19.7M|        return(xmlIsNameCharNew(c));
 3071|  10.3M|    else
 3072|  10.3M|        return(xmlIsNameCharOld(c));
 3073|  30.1M|}
parser.c:xmlIsNameCharNew:
 3010|  19.7M|xmlIsNameCharNew(int c) {
 3011|       |    /*
 3012|       |     * Use the new checks of production [4] [4a] amd [5] of the
 3013|       |     * Update 5 of XML-1.0
 3014|       |     */
 3015|  19.7M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3015:9): [True: 19.7M, False: 72.1k]
  |  Branch (3015:23): [True: 19.7M, False: 21.5k]
  |  Branch (3015:37): [True: 19.6M, False: 11.0k]
  ------------------
 3016|  19.6M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (3016:11): [True: 12.7M, False: 6.97M]
  |  Branch (3016:25): [True: 1.73M, False: 10.9M]
  ------------------
 3017|  17.9M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (3017:11): [True: 15.2M, False: 2.69M]
  |  Branch (3017:25): [True: 4.25M, False: 11.0M]
  ------------------
 3018|  13.7M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (3018:11): [True: 13.4M, False: 224k]
  |  Branch (3018:25): [True: 1.07M, False: 12.4M]
  ------------------
 3019|  12.6M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3019:10): [True: 18.2k, False: 12.6M]
  |  Branch (3019:24): [True: 17.4k, False: 12.6M]
  ------------------
 3020|  12.6M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (3020:10): [True: 69.1k, False: 12.5M]
  |  Branch (3020:24): [True: 24.5k, False: 12.5M]
  |  Branch (3020:38): [True: 373, False: 12.5M]
  ------------------
 3021|  12.5M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (3021:11): [True: 10.9M, False: 1.53M]
  |  Branch (3021:26): [True: 285k, False: 10.6M]
  ------------------
 3022|  12.2M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (3022:11): [True: 10.6M, False: 1.53M]
  |  Branch (3022:26): [True: 6.51k, False: 10.6M]
  ------------------
 3023|  12.2M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (3023:11): [True: 10.6M, False: 1.53M]
  |  Branch (3023:26): [True: 9.94k, False: 10.6M]
  ------------------
 3024|  12.2M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (3024:11): [True: 10.6M, False: 1.53M]
  |  Branch (3024:27): [True: 3.17k, False: 10.6M]
  ------------------
 3025|  12.2M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (3025:11): [True: 10.6M, False: 1.53M]
  |  Branch (3025:27): [True: 344, False: 10.6M]
  ------------------
 3026|  12.2M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (3026:11): [True: 10.6M, False: 1.53M]
  |  Branch (3026:27): [True: 6.19M, False: 4.47M]
  ------------------
 3027|  6.00M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (3027:11): [True: 4.47M, False: 1.53M]
  |  Branch (3027:28): [True: 245, False: 4.47M]
  ------------------
 3028|  6.00M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (3028:11): [True: 4.47M, False: 1.53M]
  |  Branch (3028:28): [True: 204, False: 4.47M]
  ------------------
 3029|  6.00M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (3029:11): [True: 4.47M, False: 1.53M]
  |  Branch (3029:28): [True: 2.08k, False: 4.47M]
  ------------------
 3030|  6.00M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3030:11): [True: 4.47M, False: 1.53M]
  |  Branch (3030:28): [True: 2.81k, False: 4.46M]
  ------------------
 3031|  6.00M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3031:11): [True: 4.46M, False: 1.53M]
  |  Branch (3031:28): [True: 37.8k, False: 4.42M]
  ------------------
 3032|  5.96M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3032:11): [True: 4.42M, False: 1.53M]
  |  Branch (3032:28): [True: 277, False: 4.42M]
  ------------------
 3033|  5.96M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3033:11): [True: 4.42M, False: 1.53M]
  |  Branch (3033:28): [True: 4.40M, False: 24.4k]
  ------------------
 3034|  1.56M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3034:11): [True: 24.3k, False: 1.53M]
  |  Branch (3034:29): [True: 4.00k, False: 20.3k]
  ------------------
 3035|  18.1M|         return(1);
 3036|  1.66M|    return(0);
 3037|  19.7M|}
parser.c:xmlIsNameCharOld:
 3048|  10.3M|xmlIsNameCharOld(int c) {
 3049|  10.3M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3049:9): [True: 10.3M, False: 4.69k]
  |  Branch (3049:23): [True: 10.3M, False: 1.72k]
  |  Branch (3049:37): [True: 10.3M, False: 448]
  ------------------
 3050|  10.3M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  10.3M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  10.3M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  20.7M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 8.41M, False: 1.93M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 4.40M, False: 5.95M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  20.7M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  4.40M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 2.48M, False: 1.91M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 194k, False: 2.29M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  4.40M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 2.29M, False: 1.91M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.34M, False: 946k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  4.40M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 943k, False: 1.91M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 934k, False: 9.56k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  4.40M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 9.56k, False: 1.91M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 3.29k, False: 6.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  4.40M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 6.26k, False: 1.91M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  20.7M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  1.93M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  1.93M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.22k, False: 1.93M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 1.91M, False: 13.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  1.93M|				 0 :\
  |  |  |  |  |  |  171|  1.93M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.2k, False: 3.30k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 695, False: 9.58k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.5k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 202, False: 12.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.5k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.0k, False: 2.68k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 326, False: 9.67k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  1.93M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  1.93M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 1.91M, False: 12.3k]
  |  |  |  |  ------------------
  |  |  |  |  145|  1.93M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  1.91M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 1.88M, False: 28.0k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 244k, False: 1.64M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  1.93M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3050:28): [True: 244k, False: 1.68M]
  ------------------
 3051|  1.68M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3051:10): [True: 991, False: 1.68M]
  |  Branch (3051:24): [True: 3.10k, False: 1.68M]
  ------------------
 3052|  1.68M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3052:10): [True: 2.23k, False: 1.67M]
  |  Branch (3052:24): [True: 6.40k, False: 1.67M]
  ------------------
 3053|  1.67M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  1.67M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  1.67M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 1.66M, False: 11.8k]
  |  |  |  |  ------------------
  |  |  |  |  129|  1.67M|				 0 : \
  |  |  |  |  130|  1.67M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3053:10): [True: 1.34k, False: 1.67M]
  ------------------
 3054|  1.67M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  1.67M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  1.67M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 1.66M, False: 10.4k]
  |  |  |  |  ------------------
  |  |  |  |  161|  1.67M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.66M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  1.67M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3054:10): [True: 971, False: 1.67M]
  ------------------
 3055|  8.68M|        return(1);
 3056|  1.67M|    return(0);
 3057|  10.3M|}
parser.c:xmlIsNameStartChar:
 3060|  3.69M|xmlIsNameStartChar(int c, int old10) {
 3061|  3.69M|    if (!old10)
  ------------------
  |  Branch (3061:9): [True: 1.84M, False: 1.85M]
  ------------------
 3062|  1.84M|        return(xmlIsNameStartCharNew(c));
 3063|  1.85M|    else
 3064|  1.85M|        return(xmlIsNameStartCharOld(c));
 3065|  3.69M|}
parser.c:xmlIsNameStartCharNew:
 2984|  1.84M|xmlIsNameStartCharNew(int c) {
 2985|       |    /*
 2986|       |     * Use the new checks of production [4] [4a] amd [5] of the
 2987|       |     * Update 5 of XML-1.0
 2988|       |     */
 2989|  1.84M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2989:9): [True: 1.84M, False: 2.23k]
  |  Branch (2989:23): [True: 1.84M, False: 3.04k]
  |  Branch (2989:37): [True: 1.83M, False: 2.70k]
  ------------------
 2990|  1.83M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2990:11): [True: 1.59M, False: 248k]
  |  Branch (2990:25): [True: 1.55M, False: 39.7k]
  ------------------
 2991|   287k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2991:11): [True: 107k, False: 179k]
  |  Branch (2991:25): [True: 58.6k, False: 49.1k]
  ------------------
 2992|   229k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2992:10): [True: 6.19k, False: 222k]
  |  Branch (2992:24): [True: 4.40k, False: 218k]
  ------------------
 2993|   218k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2993:11): [True: 36.2k, False: 182k]
  |  Branch (2993:26): [True: 520, False: 35.7k]
  ------------------
 2994|   218k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2994:11): [True: 35.6k, False: 182k]
  |  Branch (2994:26): [True: 871, False: 34.8k]
  ------------------
 2995|   217k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2995:11): [True: 34.8k, False: 182k]
  |  Branch (2995:26): [True: 1.53k, False: 33.2k]
  ------------------
 2996|   215k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2996:11): [True: 33.2k, False: 182k]
  |  Branch (2996:27): [True: 235, False: 33.0k]
  ------------------
 2997|   215k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2997:11): [True: 33.0k, False: 182k]
  |  Branch (2997:27): [True: 2.95k, False: 30.0k]
  ------------------
 2998|   212k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2998:11): [True: 30.0k, False: 182k]
  |  Branch (2998:28): [True: 290, False: 29.8k]
  ------------------
 2999|   212k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2999:11): [True: 29.7k, False: 182k]
  |  Branch (2999:28): [True: 352, False: 29.3k]
  ------------------
 3000|   211k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3000:11): [True: 29.3k, False: 182k]
  |  Branch (3000:28): [True: 288, False: 29.0k]
  ------------------
 3001|   211k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3001:11): [True: 29.0k, False: 182k]
  |  Branch (3001:28): [True: 2.69k, False: 26.3k]
  ------------------
 3002|   208k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3002:11): [True: 26.3k, False: 182k]
  |  Branch (3002:28): [True: 281, False: 26.0k]
  ------------------
 3003|   208k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3003:11): [True: 26.0k, False: 182k]
  |  Branch (3003:28): [True: 9.12k, False: 16.9k]
  ------------------
 3004|   199k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3004:11): [True: 16.9k, False: 182k]
  |  Branch (3004:29): [True: 2.49k, False: 14.4k]
  ------------------
 3005|  1.64M|        return(1);
 3006|   204k|    return(0);
 3007|  1.84M|}
parser.c:xmlIsNameStartCharOld:
 3040|  1.85M|xmlIsNameStartCharOld(int c) {
 3041|  1.85M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3041:9): [True: 1.84M, False: 3.19k]
  |  Branch (3041:23): [True: 1.84M, False: 3.38k]
  |  Branch (3041:37): [True: 1.84M, False: 1.76k]
  ------------------
 3042|  1.84M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  3.68M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  1.84M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  3.68M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 1.66M, False: 183k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 1.82M, False: 14.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  3.68M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.82M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.66M, False: 166k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 11.3k, False: 1.65M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  1.82M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.64M, False: 168k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.64M, False: 2.72k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  1.82M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.61k, False: 169k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 393, False: 1.22k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.82M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 1.22k, False: 169k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 741, False: 484]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  1.82M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 484, False: 169k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  3.68M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|   183k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|   183k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 925, False: 182k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 169k, False: 13.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|   183k|				 0 :\
  |  |  |  |  |  |  171|   183k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.9k, False: 2.82k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 375, False: 10.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.7k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 232, False: 13.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.7k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.8k, False: 2.25k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 318, False: 10.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3042:27): [True: 372, False: 181k]
  |  Branch (3042:41): [True: 3.08k, False: 178k]
  ------------------
 3043|  1.66M|        return(1);
 3044|   187k|    return(0);
 3045|  1.85M|}
parser.c:xmlParseNameComplex:
 3123|   260k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3124|   260k|    const xmlChar *ret;
 3125|   260k|    int len = 0, l;
 3126|   260k|    int c;
 3127|   260k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3127:21): [True: 85.7k, False: 174k]
  ------------------
 3128|  85.7k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  85.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3129|   260k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   174k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3130|   260k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3130:17): [True: 70.7k, False: 189k]
  ------------------
 3131|       |
 3132|       |    /*
 3133|       |     * Handler for more complex cases
 3134|       |     */
 3135|   260k|    c = xmlCurrentChar(ctxt, &l);
 3136|   260k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3136:9): [True: 183k, False: 76.2k]
  ------------------
 3137|   183k|        return(NULL);
 3138|  76.2k|    len += l;
 3139|  76.2k|    NEXTL(l);
  ------------------
  |  | 2325|  76.2k|#define NEXTL(l) do {							\
  |  | 2326|  76.2k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 76.2k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  76.2k|    } else ctxt->input->col++;						\
  |  | 2329|  76.2k|    ctxt->input->cur += l;				\
  |  | 2330|  76.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 76.2k]
  |  |  ------------------
  ------------------
 3140|  76.2k|    c = xmlCurrentChar(ctxt, &l);
 3141|  6.50M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3141:12): [True: 6.42M, False: 76.2k]
  ------------------
 3142|  6.42M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3142:13): [True: 6.42M, False: 0]
  ------------------
 3143|  6.42M|            len += l;
 3144|  6.42M|        NEXTL(l);
  ------------------
  |  | 2325|  6.42M|#define NEXTL(l) do {							\
  |  | 2326|  6.42M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.42M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.42M|    } else ctxt->input->col++;						\
  |  | 2329|  6.42M|    ctxt->input->cur += l;				\
  |  | 2330|  6.42M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.42M]
  |  |  ------------------
  ------------------
 3145|  6.42M|        c = xmlCurrentChar(ctxt, &l);
 3146|  6.42M|    }
 3147|  76.2k|    if (len > maxLength) {
  ------------------
  |  Branch (3147:9): [True: 70, False: 76.2k]
  ------------------
 3148|     70|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3149|     70|        return(NULL);
 3150|     70|    }
 3151|  76.2k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 76.2k]
  ------------------
 3152|       |        /*
 3153|       |         * There were a couple of bugs where PERefs lead to to a change
 3154|       |         * of the buffer. Check the buffer size to avoid passing an invalid
 3155|       |         * pointer to xmlDictLookup.
 3156|       |         */
 3157|      0|        xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 3158|      0|                    "unexpected change of input buffer");
 3159|      0|        return (NULL);
 3160|      0|    }
 3161|  76.2k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3161:9): [True: 2.21k, False: 73.9k]
  |  Branch (3161:40): [True: 274, False: 1.94k]
  ------------------
 3162|    274|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3163|  75.9k|    else
 3164|  75.9k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3165|  76.2k|    if (ret == NULL)
  ------------------
  |  Branch (3165:9): [True: 2, False: 76.2k]
  ------------------
 3166|      2|        xmlErrMemory(ctxt);
 3167|  76.2k|    return(ret);
 3168|  76.2k|}
parser.c:xmlSBufInit:
  683|   583k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  684|       |    buf->mem = NULL;
  685|   583k|    buf->size = 0;
  686|   583k|    buf->cap = 0;
  687|   583k|    buf->max = max;
  688|   583k|    buf->code = XML_ERR_OK;
  689|   583k|}
parser.c:xmlExpandPEsInEntityValue:
 3498|   333k|                          const xmlChar *str, int length, int depth) {
 3499|   333k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3499:20): [True: 81.0k, False: 252k]
  ------------------
 3500|   333k|    const xmlChar *end, *chunk;
 3501|   333k|    int c, l;
 3502|       |
 3503|   333k|    if (str == NULL)
  ------------------
  |  Branch (3503:9): [True: 185k, False: 148k]
  ------------------
 3504|   185k|        return;
 3505|       |
 3506|   148k|    depth += 1;
 3507|   148k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3507:9): [True: 0, False: 148k]
  ------------------
 3508|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3509|      0|                       "Maximum entity nesting depth exceeded");
 3510|      0|	return;
 3511|      0|    }
 3512|       |
 3513|   148k|    end = str + length;
 3514|   148k|    chunk = str;
 3515|       |
 3516|   135M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|   135M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3516:12): [True: 135M, False: 62.7k]
  |  Branch (3516:27): [True: 135M, False: 93]
  ------------------
 3517|   135M|        c = *str;
 3518|       |
 3519|   135M|        if (c >= 0x80) {
  ------------------
  |  Branch (3519:13): [True: 68.9M, False: 66.7M]
  ------------------
 3520|  68.9M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3521|  68.9M|                    "invalid character in entity value\n");
 3522|  68.9M|            if (l == 0) {
  ------------------
  |  Branch (3522:17): [True: 23.7M, False: 45.2M]
  ------------------
 3523|  23.7M|                if (chunk < str)
  ------------------
  |  Branch (3523:21): [True: 163k, False: 23.5M]
  ------------------
 3524|   163k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3525|  23.7M|                xmlSBufAddReplChar(buf);
 3526|  23.7M|                str += 1;
 3527|  23.7M|                chunk = str;
 3528|  45.2M|            } else {
 3529|  45.2M|                str += l;
 3530|  45.2M|            }
 3531|  68.9M|        } else if (c == '&') {
  ------------------
  |  Branch (3531:20): [True: 122k, False: 66.6M]
  ------------------
 3532|   122k|            if (str[1] == '#') {
  ------------------
  |  Branch (3532:17): [True: 23.4k, False: 98.7k]
  ------------------
 3533|  23.4k|                if (chunk < str)
  ------------------
  |  Branch (3533:21): [True: 18.5k, False: 4.91k]
  ------------------
 3534|  18.5k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3535|       |
 3536|  23.4k|                c = xmlParseStringCharRef(ctxt, &str);
 3537|  23.4k|                if (c == 0)
  ------------------
  |  Branch (3537:21): [True: 3.49k, False: 19.9k]
  ------------------
 3538|  3.49k|                    return;
 3539|       |
 3540|  19.9k|                xmlSBufAddChar(buf, c);
 3541|       |
 3542|  19.9k|                chunk = str;
 3543|  98.7k|            } else {
 3544|  98.7k|                xmlChar *name;
 3545|       |
 3546|       |                /*
 3547|       |                 * General entity references are checked for
 3548|       |                 * syntactic validity.
 3549|       |                 */
 3550|  98.7k|                str++;
 3551|  98.7k|                name = xmlParseStringName(ctxt, &str);
 3552|       |
 3553|  98.7k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3553:21): [True: 1.81k, False: 96.9k]
  |  Branch (3553:39): [True: 13.5k, False: 83.3k]
  ------------------
 3554|  15.3k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3555|  15.3k|                            "EntityValue: '&' forbidden except for entities "
 3556|  15.3k|                            "references\n");
 3557|  15.3k|                    xmlFree(name);
 3558|  15.3k|                    return;
 3559|  15.3k|                }
 3560|       |
 3561|  83.3k|                xmlFree(name);
 3562|  83.3k|            }
 3563|  66.6M|        } else if (c == '%') {
  ------------------
  |  Branch (3563:20): [True: 261k, False: 66.3M]
  ------------------
 3564|   261k|            xmlEntityPtr ent;
 3565|       |
 3566|   261k|            if (chunk < str)
  ------------------
  |  Branch (3566:17): [True: 122k, False: 138k]
  ------------------
 3567|   122k|                xmlSBufAddString(buf, chunk, str - chunk);
 3568|       |
 3569|   261k|            ent = xmlParseStringPEReference(ctxt, &str);
 3570|   261k|            if (ent == NULL)
  ------------------
  |  Branch (3570:17): [True: 66.0k, False: 195k]
  ------------------
 3571|  66.0k|                return;
 3572|       |
 3573|   195k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   195k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 8.58k, False: 186k]
  |  |  ------------------
  |  |   56|   195k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 186k, False: 196]
  |  |  ------------------
  |  |   57|   186k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 186k, False: 0]
  |  |  ------------------
  ------------------
 3574|    196|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3575|    196|                return;
 3576|    196|            }
 3577|       |
 3578|   195k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3578:17): [True: 185k, False: 9.29k]
  ------------------
 3579|       |                /*
 3580|       |                 * Note: external parsed entities will not be loaded,
 3581|       |                 * it is not required for a non-validating parser to
 3582|       |                 * complete external PEReferences coming from the
 3583|       |                 * internal subset
 3584|       |                 */
 3585|   185k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3585:21): [True: 185k, False: 0]
  ------------------
 3586|   185k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3586:22): [True: 170k, False: 15.5k]
  ------------------
 3587|   185k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3587:22): [True: 15.3k, False: 209]
  ------------------
 3588|   185k|                    xmlLoadEntityContent(ctxt, ent);
 3589|   185k|                } else {
 3590|    209|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3591|    209|                                  "not validating will not read content for "
 3592|    209|                                  "PE entity %s\n", ent->name, NULL);
 3593|    209|                }
 3594|   185k|            }
 3595|       |
 3596|       |            /*
 3597|       |             * TODO: Skip if ent->content is still NULL.
 3598|       |             */
 3599|       |
 3600|   195k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3600:17): [True: 27, False: 195k]
  ------------------
 3601|     27|                return;
 3602|       |
 3603|   195k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   195k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3603:17): [True: 71, False: 195k]
  ------------------
 3604|     71|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3605|     71|                return;
 3606|     71|            }
 3607|       |
 3608|   195k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   195k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3609|   195k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3610|   195k|                                      depth);
 3611|   195k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   195k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3612|       |
 3613|   195k|            chunk = str;
 3614|  66.3M|        } else {
 3615|       |            /* Normal ASCII char */
 3616|  66.3M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  66.3M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  66.3M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 65.2M, False: 1.09M]
  |  |  |  |  |  Branch (108:44): [True: 19.0M, False: 46.2M]
  |  |  |  |  ------------------
  |  |  |  |  109|  66.3M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 55.5k, False: 47.2M]
  |  |  |  |  ------------------
  |  |  |  |  110|  66.3M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 46.1M, False: 1.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|  1.13M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3618|  1.13M|                        "invalid character in entity value\n");
 3619|  1.13M|                if (chunk < str)
  ------------------
  |  Branch (3619:21): [True: 11.1k, False: 1.12M]
  ------------------
 3620|  11.1k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3621|  1.13M|                xmlSBufAddReplChar(buf);
 3622|  1.13M|                str += 1;
 3623|  1.13M|                chunk = str;
 3624|  65.2M|            } else {
 3625|  65.2M|                str += 1;
 3626|  65.2M|            }
 3627|  66.3M|        }
 3628|   135M|    }
 3629|       |
 3630|  62.8k|    if (chunk < str)
  ------------------
  |  Branch (3630:9): [True: 59.5k, False: 3.27k]
  ------------------
 3631|  59.5k|        xmlSBufAddString(buf, chunk, str - chunk);
 3632|  62.8k|}
parser.c:xmlUTF8MultibyteLen:
  818|   138M|                    const char *errMsg) {
  819|   138M|    int c = str[0];
  820|   138M|    int c1 = str[1];
  821|       |
  822|   138M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (822:9): [True: 70.9M, False: 67.7M]
  ------------------
  823|  70.9M|        goto encoding_error;
  824|       |
  825|  67.7M|    if (c < 0xE0) {
  ------------------
  |  Branch (825:9): [True: 18.2M, False: 49.4M]
  ------------------
  826|       |        /* 2-byte sequence */
  827|  18.2M|        if (c < 0xC2)
  ------------------
  |  Branch (827:13): [True: 16.4M, False: 1.76M]
  ------------------
  828|  16.4M|            goto encoding_error;
  829|       |
  830|  1.76M|        return(2);
  831|  49.4M|    } else {
  832|  49.4M|        int c2 = str[2];
  833|       |
  834|  49.4M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (834:13): [True: 7.41k, False: 49.4M]
  ------------------
  835|  7.41k|            goto encoding_error;
  836|       |
  837|  49.4M|        if (c < 0xF0) {
  ------------------
  |  Branch (837:13): [True: 49.4M, False: 66.3k]
  ------------------
  838|       |            /* 3-byte sequence */
  839|  49.4M|            if (c == 0xE0) {
  ------------------
  |  Branch (839:17): [True: 4.56M, False: 44.8M]
  ------------------
  840|       |                /* overlong */
  841|  4.56M|                if (c1 < 0xA0)
  ------------------
  |  Branch (841:21): [True: 3.03k, False: 4.56M]
  ------------------
  842|  3.03k|                    goto encoding_error;
  843|  44.8M|            } else if (c == 0xED) {
  ------------------
  |  Branch (843:24): [True: 547, False: 44.8M]
  ------------------
  844|       |                /* surrogate */
  845|    547|                if (c1 >= 0xA0)
  ------------------
  |  Branch (845:21): [True: 212, False: 335]
  ------------------
  846|    212|                    goto encoding_error;
  847|  44.8M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (847:24): [True: 37.5M, False: 7.32M]
  ------------------
  848|       |                /* U+FFFE and U+FFFF are invalid Chars */
  849|  37.5M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (849:21): [True: 37.5M, False: 1.67k]
  |  Branch (849:37): [True: 778, False: 37.5M]
  ------------------
  850|    778|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  851|  37.5M|            }
  852|       |
  853|  49.4M|            return(3);
  854|  49.4M|        } else {
  855|       |            /* 4-byte sequence */
  856|  66.3k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (856:17): [True: 2.17k, False: 64.1k]
  ------------------
  857|  2.17k|                goto encoding_error;
  858|  64.1k|            if (c == 0xF0) {
  ------------------
  |  Branch (858:17): [True: 1.93k, False: 62.2k]
  ------------------
  859|       |                /* overlong */
  860|  1.93k|                if (c1 < 0x90)
  ------------------
  |  Branch (860:21): [True: 686, False: 1.25k]
  ------------------
  861|    686|                    goto encoding_error;
  862|  62.2k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (862:24): [True: 8.20k, False: 54.0k]
  ------------------
  863|       |                /* greater than 0x10FFFF */
  864|  8.20k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (864:21): [True: 7.24k, False: 956]
  |  Branch (864:35): [True: 307, False: 649]
  ------------------
  865|  7.55k|                    goto encoding_error;
  866|  8.20k|            }
  867|       |
  868|  55.9k|            return(4);
  869|  64.1k|        }
  870|  49.4M|    }
  871|       |
  872|  87.4M|encoding_error:
  873|       |    /* Only report the first error */
  874|  87.4M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  87.4M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (874:9): [True: 26.2k, False: 87.4M]
  ------------------
  875|  26.2k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  876|  26.2k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  26.2k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  877|  26.2k|    }
  878|       |
  879|  87.4M|    return(0);
  880|  67.7M|}
parser.c:xmlSBufAddString:
  719|   134M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  720|   134M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (720:9): [True: 0, False: 134M]
  ------------------
  721|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (721:13): [True: 0, False: 0]
  ------------------
  722|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  723|      0|        return;
  724|      0|    }
  725|       |
  726|   134M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (726:9): [True: 497k, False: 134M]
  ------------------
  727|   497k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (727:13): [True: 97, False: 497k]
  ------------------
  728|     97|            return;
  729|   497k|    }
  730|       |
  731|   134M|    if (len > 0)
  ------------------
  |  Branch (731:9): [True: 134M, False: 0]
  ------------------
  732|   134M|        memcpy(buf->mem + buf->size, str, len);
  733|   134M|    buf->size += len;
  734|   134M|}
parser.c:xmlSBufGrow:
  692|   503k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  693|   503k|    xmlChar *mem;
  694|   503k|    unsigned cap;
  695|       |
  696|   503k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (696:9): [True: 0, False: 503k]
  ------------------
  697|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  ------------------
  698|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  699|      0|        return(-1);
  700|      0|    }
  701|       |
  702|   503k|    cap = (buf->size + len) * 2;
  703|   503k|    if (cap < 240)
  ------------------
  |  Branch (703:9): [True: 327k, False: 175k]
  ------------------
  704|   327k|        cap = 240;
  705|       |
  706|   503k|    mem = xmlRealloc(buf->mem, cap);
  707|   503k|    if (mem == NULL) {
  ------------------
  |  Branch (707:9): [True: 103, False: 503k]
  ------------------
  708|    103|        buf->code = XML_ERR_NO_MEMORY;
  709|    103|        return(-1);
  710|    103|    }
  711|       |
  712|   503k|    buf->mem = mem;
  713|   503k|    buf->cap = cap;
  714|       |
  715|   503k|    return(0);
  716|   503k|}
parser.c:xmlSBufAddReplChar:
  767|   111M|xmlSBufAddReplChar(xmlSBuf *buf) {
  768|   111M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  769|   111M|}
parser.c:xmlSBufAddCString:
  737|   126M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  738|   126M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  739|   126M|}
parser.c:xmlParseStringCharRef:
 2671|  1.16M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2672|  1.16M|    const xmlChar *ptr;
 2673|  1.16M|    xmlChar cur;
 2674|  1.16M|    int val = 0;
 2675|       |
 2676|  1.16M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2676:9): [True: 0, False: 1.16M]
  |  Branch (2676:26): [True: 0, False: 1.16M]
  ------------------
 2677|  1.16M|    ptr = *str;
 2678|  1.16M|    cur = *ptr;
 2679|  1.16M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2679:9): [True: 1.16M, False: 0]
  |  Branch (2679:25): [True: 1.16M, False: 0]
  |  Branch (2679:44): [True: 12.4k, False: 1.14M]
  ------------------
 2680|  12.4k|	ptr += 3;
 2681|  12.4k|	cur = *ptr;
 2682|  41.8k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2682:9): [True: 30.2k, False: 11.6k]
  ------------------
 2683|  30.2k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2683:10): [True: 29.9k, False: 279]
  |  Branch (2683:26): [True: 16.0k, False: 13.9k]
  ------------------
 2684|  16.0k|	        val = val * 16 + (cur - '0');
 2685|  14.2k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2685:15): [True: 4.95k, False: 9.26k]
  |  Branch (2685:31): [True: 4.59k, False: 356]
  ------------------
 2686|  4.59k|	        val = val * 16 + (cur - 'a') + 10;
 2687|  9.62k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2687:15): [True: 9.33k, False: 283]
  |  Branch (2687:31): [True: 8.79k, False: 539]
  ------------------
 2688|  8.79k|	        val = val * 16 + (cur - 'A') + 10;
 2689|    822|	    else {
 2690|    822|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2691|    822|		val = 0;
 2692|    822|		break;
 2693|    822|	    }
 2694|  29.4k|	    if (val > 0x110000)
  ------------------
  |  Branch (2694:10): [True: 880, False: 28.5k]
  ------------------
 2695|    880|	        val = 0x110000;
 2696|       |
 2697|  29.4k|	    ptr++;
 2698|  29.4k|	    cur = *ptr;
 2699|  29.4k|	}
 2700|  12.4k|	if (cur == ';')
  ------------------
  |  Branch (2700:6): [True: 11.6k, False: 822]
  ------------------
 2701|  11.6k|	    ptr++;
 2702|  1.14M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2702:17): [True: 1.14M, False: 0]
  |  Branch (2702:33): [True: 1.14M, False: 0]
  ------------------
 2703|  1.14M|	ptr += 2;
 2704|  1.14M|	cur = *ptr;
 2705|  3.45M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2705:9): [True: 2.30M, False: 1.14M]
  ------------------
 2706|  2.30M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2706:10): [True: 2.30M, False: 398]
  |  Branch (2706:26): [True: 2.30M, False: 1.20k]
  ------------------
 2707|  2.30M|	        val = val * 10 + (cur - '0');
 2708|  1.60k|	    else {
 2709|  1.60k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2710|  1.60k|		val = 0;
 2711|  1.60k|		break;
 2712|  1.60k|	    }
 2713|  2.30M|	    if (val > 0x110000)
  ------------------
  |  Branch (2713:10): [True: 1.61k, False: 2.30M]
  ------------------
 2714|  1.61k|	        val = 0x110000;
 2715|       |
 2716|  2.30M|	    ptr++;
 2717|  2.30M|	    cur = *ptr;
 2718|  2.30M|	}
 2719|  1.14M|	if (cur == ';')
  ------------------
  |  Branch (2719:6): [True: 1.14M, False: 1.60k]
  ------------------
 2720|  1.14M|	    ptr++;
 2721|  1.14M|    } else {
 2722|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2723|      0|	return(0);
 2724|      0|    }
 2725|  1.16M|    *str = ptr;
 2726|       |
 2727|       |    /*
 2728|       |     * [ WFC: Legal Character ]
 2729|       |     * Characters referred to using character references must match the
 2730|       |     * production for Char.
 2731|       |     */
 2732|  1.16M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2732:9): [True: 215, False: 1.16M]
  ------------------
 2733|    215|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2734|    215|                "xmlParseStringCharRef: character reference out of bounds\n",
 2735|    215|                val);
 2736|  1.16M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.16M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.16M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.15M, False: 3.29k]
  |  |  |  |  |  Branch (117:25): [True: 1.15M, False: 5.88k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.16M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.15M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.15M, False: 3.01k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 792, False: 1.15M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.15M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 17.2k, False: 1.13M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.15M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.13M, False: 3.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.16M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 5.88k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 4.21k, False: 1.67k]
  |  |  |  |  ------------------
  |  |  |  |  120|  5.88k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.46k, False: 210]
  |  |  |  |  |  Branch (120:26): [True: 542, False: 925]
  |  |  |  |  ------------------
  |  |  |  |  121|  5.88k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 924, False: 211]
  |  |  |  |  |  Branch (121:27): [True: 924, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2737|  1.15M|        return(val);
 2738|  1.15M|    } else {
 2739|  3.29k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2740|  3.29k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2741|  3.29k|			  val);
 2742|  3.29k|    }
 2743|  3.50k|    return(0);
 2744|  1.16M|}
parser.c:xmlSBufAddChar:
  742|  1.19M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  743|  1.19M|    xmlChar *end;
  744|       |
  745|  1.19M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (745:9): [True: 0, False: 1.19M]
  ------------------
  746|      0|        if (buf->code == XML_ERR_OK)
  ------------------
  |  Branch (746:13): [True: 0, False: 0]
  ------------------
  747|      0|            buf->code = XML_ERR_RESOURCE_LIMIT;
  748|      0|        return;
  749|      0|    }
  750|       |
  751|  1.19M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (751:9): [True: 5.79k, False: 1.19M]
  ------------------
  752|  5.79k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (752:13): [True: 6, False: 5.78k]
  ------------------
  753|      6|            return;
  754|  5.79k|    }
  755|       |
  756|  1.19M|    end = buf->mem + buf->size;
  757|       |
  758|  1.19M|    if (c < 0x80) {
  ------------------
  |  Branch (758:9): [True: 1.19M, False: 5.64k]
  ------------------
  759|  1.19M|        *end = (xmlChar) c;
  760|  1.19M|        buf->size += 1;
  761|  1.19M|    } else {
  762|  5.64k|        buf->size += xmlCopyCharMultiByte(end, c);
  763|  5.64k|    }
  764|  1.19M|}
parser.c:xmlParseStringName:
 3377|  2.99M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3378|  2.99M|    xmlChar *ret;
 3379|  2.99M|    const xmlChar *cur = *str;
 3380|  2.99M|    int flags = 0;
 3381|  2.99M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3381:21): [True: 1.99M, False: 992k]
  ------------------
 3382|  1.99M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.99M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3383|  2.99M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   992k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3384|       |
 3385|  2.99M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3385:9): [True: 1.63M, False: 1.36M]
  ------------------
 3386|  1.63M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  1.63M|#define XML_SCAN_OLD10      4
  ------------------
 3387|       |
 3388|  2.99M|    cur = xmlScanName(*str, maxLength, flags);
 3389|  2.99M|    if (cur == NULL) {
  ------------------
  |  Branch (3389:9): [True: 75, False: 2.99M]
  ------------------
 3390|     75|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3391|     75|        return(NULL);
 3392|     75|    }
 3393|  2.99M|    if (cur == *str)
  ------------------
  |  Branch (3393:9): [True: 4.77k, False: 2.98M]
  ------------------
 3394|  4.77k|        return(NULL);
 3395|       |
 3396|  2.98M|    ret = xmlStrndup(*str, cur - *str);
 3397|  2.98M|    if (ret == NULL)
  ------------------
  |  Branch (3397:9): [True: 26, False: 2.98M]
  ------------------
 3398|     26|        xmlErrMemory(ctxt);
 3399|  2.98M|    *str = cur;
 3400|  2.98M|    return(ret);
 3401|  2.99M|}
parser.c:xmlParseStringPEReference:
 7898|   261k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7899|   261k|    const xmlChar *ptr;
 7900|   261k|    xmlChar cur;
 7901|   261k|    xmlChar *name;
 7902|   261k|    xmlEntityPtr entity = NULL;
 7903|       |
 7904|   261k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7904:9): [True: 0, False: 261k]
  |  Branch (7904:26): [True: 0, False: 261k]
  ------------------
 7905|   261k|    ptr = *str;
 7906|   261k|    cur = *ptr;
 7907|   261k|    if (cur != '%')
  ------------------
  |  Branch (7907:9): [True: 0, False: 261k]
  ------------------
 7908|      0|        return(NULL);
 7909|   261k|    ptr++;
 7910|   261k|    name = xmlParseStringName(ctxt, &ptr);
 7911|   261k|    if (name == NULL) {
  ------------------
  |  Branch (7911:9): [True: 3.03k, False: 258k]
  ------------------
 7912|  3.03k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7913|  3.03k|		       "xmlParseStringPEReference: no name\n");
 7914|  3.03k|	*str = ptr;
 7915|  3.03k|	return(NULL);
 7916|  3.03k|    }
 7917|   258k|    cur = *ptr;
 7918|   258k|    if (cur != ';') {
  ------------------
  |  Branch (7918:9): [True: 3.69k, False: 254k]
  ------------------
 7919|  3.69k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7920|  3.69k|	xmlFree(name);
 7921|  3.69k|	*str = ptr;
 7922|  3.69k|	return(NULL);
 7923|  3.69k|    }
 7924|   254k|    ptr++;
 7925|       |
 7926|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7927|   254k|    ctxt->hasPErefs = 1;
 7928|       |
 7929|       |    /*
 7930|       |     * Request the entity from SAX
 7931|       |     */
 7932|   254k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7932:9): [True: 254k, False: 0]
  ------------------
 7933|   254k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7933:2): [True: 254k, False: 0]
  ------------------
 7934|   254k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7935|       |
 7936|   254k|    if (entity == NULL) {
  ------------------
  |  Branch (7936:9): [True: 59.3k, False: 195k]
  ------------------
 7937|  59.3k|        xmlHandleUndeclaredEntity(ctxt, name);
 7938|   195k|    } else {
 7939|       |	/*
 7940|       |	 * Internal checking in case the entity quest barfed
 7941|       |	 */
 7942|   195k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7942:6): [True: 186k, False: 9.05k]
  ------------------
 7943|   186k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7943:6): [True: 0, False: 186k]
  ------------------
 7944|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7945|      0|			  "%%%s; is not a parameter entity\n",
 7946|      0|			  name, NULL);
 7947|      0|	}
 7948|   195k|    }
 7949|       |
 7950|   254k|    xmlFree(name);
 7951|   254k|    *str = ptr;
 7952|   254k|    return(entity);
 7953|   258k|}
parser.c:xmlHandleUndeclaredEntity:
 7371|   479k|xmlHandleUndeclaredEntity(xmlParserCtxtPtr ctxt, const xmlChar *name) {
 7372|       |    /*
 7373|       |     * [ WFC: Entity Declared ]
 7374|       |     * In a document without any DTD, a document with only an
 7375|       |     * internal DTD subset which contains no parameter entity
 7376|       |     * references, or a document with "standalone='yes'", the
 7377|       |     * Name given in the entity reference must match that in an
 7378|       |     * entity declaration, except that well-formed documents
 7379|       |     * need not declare any of the following entities: amp, lt,
 7380|       |     * gt, apos, quot.
 7381|       |     * The declaration of a parameter entity must precede any
 7382|       |     * reference to it.
 7383|       |     * Similarly, the declaration of a general entity must
 7384|       |     * precede any reference to it which appears in a default
 7385|       |     * value in an attribute-list declaration. Note that if
 7386|       |     * entities are declared in the external subset or in
 7387|       |     * external parameter entities, a non-validating processor
 7388|       |     * is not obligated to read and process their declarations;
 7389|       |     * for such documents, the rule that an entity must be
 7390|       |     * declared is a well-formedness constraint only if
 7391|       |     * standalone='yes'.
 7392|       |     */
 7393|   479k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7393:9): [True: 803, False: 478k]
  ------------------
 7394|   478k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7394:10): [True: 470k, False: 8.71k]
  ------------------
 7395|   470k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7395:10): [True: 129k, False: 340k]
  ------------------
 7396|   130k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7397|   130k|                          "Entity '%s' not defined\n", name);
 7398|   130k|#ifdef LIBXML_VALID_ENABLED
 7399|   349k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7399:16): [True: 297k, False: 51.9k]
  ------------------
 7400|       |        /*
 7401|       |         * [ VC: Entity Declared ]
 7402|       |         * In a document with an external subset or external
 7403|       |         * parameter entities with "standalone='no'", ...
 7404|       |         * ... The declaration of a parameter entity must
 7405|       |         * precede any reference to it...
 7406|       |         */
 7407|   297k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7408|   297k|                         "Entity '%s' not defined\n", name, NULL);
 7409|   297k|#endif
 7410|   297k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  51.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7410:16): [True: 35.2k, False: 16.6k]
  ------------------
 7411|  16.6k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7411:17): [True: 15.9k, False: 758]
  ------------------
 7412|  50.2k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7412:17): [True: 14.9k, False: 956]
  ------------------
 7413|       |        /*
 7414|       |         * Also raise a non-fatal error
 7415|       |         *
 7416|       |         * - if the external subset is loaded and all entity declarations
 7417|       |         *   should be available, or
 7418|       |         * - entity substition was requested without restricting
 7419|       |         *   external entity access.
 7420|       |         */
 7421|  50.2k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7422|  50.2k|                     "Entity '%s' not defined\n", name);
 7423|  50.2k|    } else {
 7424|  1.71k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7425|  1.71k|                      "Entity '%s' not defined\n", name, NULL);
 7426|  1.71k|    }
 7427|       |
 7428|   479k|    ctxt->valid = 0;
 7429|   479k|}
parser.c:xmlErrMsgStr:
  364|  50.2k|{
  365|  50.2k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  50.2k|               val, NULL, NULL, 0, msg, val);
  367|  50.2k|}
parser.c:xmlLoadEntityContent:
 7735|   185k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7736|   185k|    xmlParserInputPtr oldinput, input = NULL;
 7737|   185k|    xmlParserInputPtr *oldinputTab;
 7738|   185k|    xmlChar *oldencoding;
 7739|   185k|    xmlChar *content = NULL;
 7740|   185k|    xmlResourceType rtype;
 7741|   185k|    size_t length, i;
 7742|   185k|    int oldinputNr, oldinputMax;
 7743|   185k|    int ret = -1;
 7744|   185k|    int res;
 7745|       |
 7746|   185k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7746:9): [True: 0, False: 185k]
  |  Branch (7746:27): [True: 0, False: 185k]
  ------------------
 7747|   185k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7747:10): [True: 0, False: 185k]
  ------------------
 7748|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7748:3): [True: 0, False: 0]
  ------------------
 7749|   185k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7749:2): [True: 0, False: 185k]
  ------------------
 7750|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7751|      0|	            "xmlLoadEntityContent parameter error");
 7752|      0|        return(-1);
 7753|      0|    }
 7754|       |
 7755|   185k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7755:9): [True: 185k, False: 0]
  ------------------
 7756|   185k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7757|      0|    else
 7758|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7759|       |
 7760|   185k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7761|   185k|                            (char *) entity->ExternalID, rtype);
 7762|   185k|    if (input == NULL)
  ------------------
  |  Branch (7762:9): [True: 991, False: 184k]
  ------------------
 7763|    991|        return(-1);
 7764|       |
 7765|   184k|    oldinput = ctxt->input;
 7766|   184k|    oldinputNr = ctxt->inputNr;
 7767|   184k|    oldinputMax = ctxt->inputMax;
 7768|   184k|    oldinputTab = ctxt->inputTab;
 7769|   184k|    oldencoding = ctxt->encoding;
 7770|       |
 7771|   184k|    ctxt->input = NULL;
 7772|   184k|    ctxt->inputNr = 0;
 7773|   184k|    ctxt->inputMax = 1;
 7774|   184k|    ctxt->encoding = NULL;
 7775|   184k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7776|   184k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7776:9): [True: 4, False: 184k]
  ------------------
 7777|      4|        xmlErrMemory(ctxt);
 7778|      4|        xmlFreeInputStream(input);
 7779|      4|        goto error;
 7780|      4|    }
 7781|       |
 7782|   184k|    xmlBufResetInput(input->buf->buffer, input);
 7783|       |
 7784|   184k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7784:9): [True: 6, False: 184k]
  ------------------
 7785|      6|        xmlFreeInputStream(input);
 7786|      6|        goto error;
 7787|      6|    }
 7788|       |
 7789|   184k|    xmlDetectEncoding(ctxt);
 7790|       |
 7791|       |    /*
 7792|       |     * Parse a possible text declaration first
 7793|       |     */
 7794|   184k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   184k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   369k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 180k, False: 3.77k]
  |  |  |  |  |  Branch (2268:41): [True: 179k, False: 1.83k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   184k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 178k, False: 313]
  |  |  |  |  |  Branch (2269:41): [True: 178k, False: 247]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 178k, False: 466]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   178k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   178k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 176k, False: 2.00k]
  |  |  |  |  ------------------
  |  |  |  |   91|   178k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.79k, False: 212]
  |  |  |  |  |  Branch (91:23): [True: 1.11k, False: 682]
  |  |  |  |  ------------------
  |  |  |  |   92|   178k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 587, False: 307]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7795|   177k|	xmlParseTextDecl(ctxt);
 7796|       |        /*
 7797|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7798|       |         */
 7799|   177k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   177k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7799:13): [True: 4.72k, False: 172k]
  ------------------
 7800|  4.72k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  4.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7800:13): [True: 298, False: 4.43k]
  ------------------
 7801|    298|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7802|    298|                           "Version mismatch between document and entity\n");
 7803|    298|        }
 7804|   177k|    }
 7805|       |
 7806|   184k|    length = input->cur - input->base;
 7807|   184k|    xmlBufShrink(input->buf->buffer, length);
 7808|   184k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|       |
 7810|   200k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7810:12): [True: 15.5k, False: 184k]
  ------------------
 7811|  15.5k|        ;
 7812|       |
 7813|   184k|    xmlBufResetInput(input->buf->buffer, input);
 7814|       |
 7815|   184k|    if (res < 0) {
  ------------------
  |  Branch (7815:9): [True: 950, False: 183k]
  ------------------
 7816|    950|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7817|    950|        goto error;
 7818|    950|    }
 7819|       |
 7820|   183k|    length = xmlBufUse(input->buf->buffer);
 7821|   183k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7821:9): [True: 0, False: 183k]
  ------------------
 7822|      0|        xmlErrMemory(ctxt);
 7823|      0|        goto error;
 7824|      0|    }
 7825|       |
 7826|   183k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7827|   183k|    if (content == NULL) {
  ------------------
  |  Branch (7827:9): [True: 7, False: 183k]
  ------------------
 7828|      7|        xmlErrMemory(ctxt);
 7829|      7|        goto error;
 7830|      7|    }
 7831|       |
 7832|  23.8M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7832:17): [True: 23.8M, False: 137]
  ------------------
 7833|  23.8M|        int clen = length - i;
 7834|  23.8M|        int c = xmlGetUTF8Char(content + i, &clen);
 7835|       |
 7836|  23.8M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  23.6M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  23.6M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 17.1M, False: 6.47M]
  |  |  |  |  ------------------
  |  |  |  |  118|  23.6M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  17.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 17.1M, False: 20.4k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 312k, False: 16.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  17.1M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 193k, False: 16.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  17.1M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 16.6M, False: 20.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  23.6M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 6.47M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 6.47M, False: 6.64k]
  |  |  |  |  ------------------
  |  |  |  |  120|  6.47M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 6.64k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 4.10k, False: 2.54k]
  |  |  |  |  ------------------
  |  |  |  |  121|  6.47M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.80k, False: 734]
  |  |  |  |  |  Branch (121:27): [True: 1.80k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7836:13): [True: 161k, False: 23.6M]
  |  Branch (7836:24): [True: 21.6k, False: 23.6M]
  ------------------
 7837|   183k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7838|   183k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7839|   183k|                              content[i]);
 7840|   183k|            goto error;
 7841|   183k|        }
 7842|  23.6M|        i += clen;
 7843|  23.6M|    }
 7844|       |
 7845|    137|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7846|    137|    entity->content = content;
 7847|    137|    entity->length = length;
 7848|    137|    content = NULL;
 7849|    137|    ret = 0;
 7850|       |
 7851|   184k|error:
 7852|   369k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7852:12): [True: 184k, False: 184k]
  ------------------
 7853|   184k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7854|   184k|    xmlFree(ctxt->inputTab);
 7855|   184k|    xmlFree(ctxt->encoding);
 7856|       |
 7857|   184k|    ctxt->input = oldinput;
 7858|   184k|    ctxt->inputNr = oldinputNr;
 7859|   184k|    ctxt->inputMax = oldinputMax;
 7860|   184k|    ctxt->inputTab = oldinputTab;
 7861|   184k|    ctxt->encoding = oldencoding;
 7862|       |
 7863|   184k|    xmlFree(content);
 7864|       |
 7865|   184k|    return(ret);
 7866|    137|}
parser.c:xmlSBufFinish:
  781|   315k|              const char *errMsg) {
  782|   315k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (782:9): [True: 29.8k, False: 285k]
  ------------------
  783|  29.8k|        buf->mem = xmlMalloc(1);
  784|  29.8k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (784:13): [True: 8, False: 29.8k]
  ------------------
  785|      8|            buf->code = XML_ERR_NO_MEMORY;
  786|  29.8k|        } else {
  787|  29.8k|            buf->mem[0] = 0;
  788|  29.8k|        }
  789|   285k|    } else {
  790|   285k|        buf->mem[buf->size] = 0;
  791|   285k|    }
  792|       |
  793|   315k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (793:9): [True: 315k, False: 70]
  ------------------
  794|   315k|        if (sizeOut != NULL)
  ------------------
  |  Branch (794:13): [True: 27.2k, False: 287k]
  ------------------
  795|  27.2k|            *sizeOut = buf->size;
  796|   315k|        return(buf->mem);
  797|   315k|    }
  798|       |
  799|     70|    xmlSBufReportError(buf, ctxt, errMsg);
  800|       |
  801|     70|    xmlFree(buf->mem);
  802|       |
  803|     70|    if (sizeOut != NULL)
  ------------------
  |  Branch (803:9): [True: 7, False: 63]
  ------------------
  804|      7|        *sizeOut = 0;
  805|       |    return(NULL);
  806|   315k|}
parser.c:xmlSBufReportError:
  772|    111|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  773|    111|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (773:9): [True: 111, False: 0]
  ------------------
  774|    111|        xmlCtxtErrMemory(ctxt);
  775|      0|    else
  776|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  777|    111|}
parser.c:xmlSBufCleanup:
  809|   262k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  810|   262k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (810:9): [True: 41, False: 262k]
  ------------------
  811|     41|        xmlSBufReportError(buf, ctxt, errMsg);
  812|       |
  813|   262k|    xmlFree(buf->mem);
  814|   262k|}
parser.c:xmlExpandEntityInAttValue:
 3839|  1.74M|                          int *inSpace, int depth, int check) {
 3840|  1.74M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3840:20): [True: 1.22M, False: 519k]
  ------------------
 3841|  1.74M|    int c, chunkSize;
 3842|  1.74M|    int normChange = 0;
 3843|       |
 3844|  1.74M|    if (str == NULL)
  ------------------
  |  Branch (3844:9): [True: 276, False: 1.74M]
  ------------------
 3845|    276|        return(0);
 3846|       |
 3847|  1.74M|    depth += 1;
 3848|  1.74M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3848:9): [True: 1, False: 1.74M]
  ------------------
 3849|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3850|      1|                       "Maximum entity nesting depth exceeded");
 3851|      1|	return(0);
 3852|      1|    }
 3853|       |
 3854|  1.74M|    if (pent != NULL) {
  ------------------
  |  Branch (3854:9): [True: 1.72M, False: 25.7k]
  ------------------
 3855|  1.72M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.72M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3855:13): [True: 4, False: 1.72M]
  ------------------
 3856|      4|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3857|      4|            return(0);
 3858|      4|        }
 3859|       |
 3860|  1.72M|        if (check) {
  ------------------
  |  Branch (3860:13): [True: 1.71M, False: 4.86k]
  ------------------
 3861|  1.71M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3861:17): [True: 51, False: 1.71M]
  ------------------
 3862|     51|                return(0);
 3863|  1.71M|        }
 3864|  1.72M|    }
 3865|       |
 3866|  1.74M|    chunkSize = 0;
 3867|       |
 3868|       |    /*
 3869|       |     * Note that entity values are already validated. No special
 3870|       |     * handling for multi-byte characters is needed.
 3871|       |     */
 3872|   328M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   328M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3872:12): [True: 328M, False: 278]
  ------------------
 3873|   328M|        c = *str;
 3874|       |
 3875|   328M|	if (c != '&') {
  ------------------
  |  Branch (3875:6): [True: 325M, False: 3.75M]
  ------------------
 3876|   325M|            if (c == 0)
  ------------------
  |  Branch (3876:17): [True: 1.70M, False: 323M]
  ------------------
 3877|  1.70M|                break;
 3878|       |
 3879|       |            /*
 3880|       |             * If this function is called without an entity, it is used to
 3881|       |             * expand entities in an attribute content where less-than was
 3882|       |             * already unscaped and is allowed.
 3883|       |             */
 3884|   323M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3884:17): [True: 317M, False: 5.84M]
  |  Branch (3884:35): [True: 44.1k, False: 317M]
  ------------------
 3885|  44.1k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3886|  44.1k|                        "'<' in entity '%s' is not allowed in attributes "
 3887|  44.1k|                        "values\n", pent->name);
 3888|  44.1k|                break;
 3889|  44.1k|            }
 3890|       |
 3891|   323M|            if (c <= 0x20) {
  ------------------
  |  Branch (3891:17): [True: 17.0M, False: 306M]
  ------------------
 3892|  17.0M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3892:21): [True: 113k, False: 16.9M]
  |  Branch (3892:36): [True: 26.3k, False: 87.3k]
  ------------------
 3893|       |                    /* Skip char */
 3894|  26.3k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3894:25): [True: 11.0k, False: 15.2k]
  ------------------
 3895|  11.0k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3896|  11.0k|                        chunkSize = 0;
 3897|  11.0k|                    }
 3898|  26.3k|                    normChange = 1;
 3899|  17.0M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3899:28): [True: 6.74M, False: 10.2M]
  ------------------
 3900|  6.74M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3900:25): [True: 1.26M, False: 5.48M]
  ------------------
 3901|  1.26M|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3902|  1.26M|                        chunkSize = 0;
 3903|  1.26M|                    }
 3904|       |
 3905|  6.74M|                    xmlSBufAddCString(buf, " ", 1);
 3906|  10.2M|                } else {
 3907|  10.2M|                    chunkSize += 1;
 3908|  10.2M|                }
 3909|       |
 3910|  17.0M|                *inSpace = 1;
 3911|   306M|            } else {
 3912|   306M|                chunkSize += 1;
 3913|   306M|                *inSpace = 0;
 3914|   306M|            }
 3915|       |
 3916|   323M|            str += 1;
 3917|   323M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3917:20): [True: 1.13M, False: 2.61M]
  ------------------
 3918|  1.13M|            int val;
 3919|       |
 3920|  1.13M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3920:17): [True: 1.12M, False: 12.0k]
  ------------------
 3921|  1.12M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3922|  1.12M|                chunkSize = 0;
 3923|  1.12M|            }
 3924|       |
 3925|  1.13M|	    val = xmlParseStringCharRef(ctxt, &str);
 3926|  1.13M|	    if (val == 0) {
  ------------------
  |  Branch (3926:10): [True: 3, False: 1.13M]
  ------------------
 3927|      3|                if (pent != NULL)
  ------------------
  |  Branch (3927:21): [True: 3, False: 0]
  ------------------
 3928|      3|                    pent->content[0] = 0;
 3929|      3|                break;
 3930|      3|            }
 3931|       |
 3932|  1.13M|            if (val == ' ') {
  ------------------
  |  Branch (3932:17): [True: 4.21k, False: 1.13M]
  ------------------
 3933|  4.21k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3933:21): [True: 1.04k, False: 3.17k]
  |  Branch (3933:36): [True: 597, False: 446]
  ------------------
 3934|    597|                    normChange = 1;
 3935|  3.62k|                else
 3936|  3.62k|                    xmlSBufAddCString(buf, " ", 1);
 3937|  4.21k|                *inSpace = 1;
 3938|  1.13M|            } else {
 3939|  1.13M|                xmlSBufAddChar(buf, val);
 3940|  1.13M|                *inSpace = 0;
 3941|  1.13M|            }
 3942|  2.61M|	} else {
 3943|  2.61M|            xmlChar *name;
 3944|  2.61M|            xmlEntityPtr ent;
 3945|       |
 3946|  2.61M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3946:17): [True: 1.41M, False: 1.20M]
  ------------------
 3947|  1.41M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|  1.41M|                chunkSize = 0;
 3949|  1.41M|            }
 3950|       |
 3951|  2.61M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3952|  2.61M|            if (name == NULL) {
  ------------------
  |  Branch (3952:17): [True: 24, False: 2.61M]
  ------------------
 3953|     24|                if (pent != NULL)
  ------------------
  |  Branch (3953:21): [True: 23, False: 1]
  ------------------
 3954|     23|                    pent->content[0] = 0;
 3955|     24|                break;
 3956|     24|            }
 3957|       |
 3958|  2.61M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3959|  2.61M|            xmlFree(name);
 3960|       |
 3961|  2.61M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3961:10): [True: 2.52M, False: 87.9k]
  ------------------
 3962|  2.52M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3962:3): [True: 1.36M, False: 1.16M]
  ------------------
 3963|  1.36M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3963:7): [True: 0, False: 1.36M]
  ------------------
 3964|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3965|      0|			    "predefined entity has no content\n");
 3966|      0|                    break;
 3967|      0|                }
 3968|       |
 3969|  1.36M|                xmlSBufAddString(buf, ent->content, ent->length);
 3970|       |
 3971|  1.36M|                *inSpace = 0;
 3972|  1.36M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3972:17): [True: 1.16M, False: 87.9k]
  |  Branch (3972:34): [True: 1.16M, False: 331]
  ------------------
 3973|  1.16M|                if (pent != NULL)
  ------------------
  |  Branch (3973:21): [True: 1.16M, False: 1.16k]
  ------------------
 3974|  1.16M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.16M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3975|  1.16M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3976|  1.16M|                        ent->content, ent, normalize, inSpace, depth, check);
 3977|  1.16M|                if (pent != NULL)
  ------------------
  |  Branch (3977:21): [True: 1.16M, False: 1.16k]
  ------------------
 3978|  1.16M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.16M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3979|  1.16M|	    }
 3980|  2.61M|        }
 3981|   328M|    }
 3982|       |
 3983|  1.74M|    if (chunkSize > 0)
  ------------------
  |  Branch (3983:9): [True: 1.13M, False: 614k]
  ------------------
 3984|  1.13M|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3985|       |
 3986|  1.74M|    return(normChange);
 3987|  1.74M|}
parser.c:xmlParseStringEntityRef:
 7573|  2.63M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7574|  2.63M|    xmlChar *name;
 7575|  2.63M|    const xmlChar *ptr;
 7576|  2.63M|    xmlChar cur;
 7577|       |
 7578|  2.63M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7578:9): [True: 0, False: 2.63M]
  |  Branch (7578:26): [True: 0, False: 2.63M]
  ------------------
 7579|      0|        return(NULL);
 7580|  2.63M|    ptr = *str;
 7581|  2.63M|    cur = *ptr;
 7582|  2.63M|    if (cur != '&')
  ------------------
  |  Branch (7582:9): [True: 0, False: 2.63M]
  ------------------
 7583|      0|	return(NULL);
 7584|       |
 7585|  2.63M|    ptr++;
 7586|  2.63M|    name = xmlParseStringName(ctxt, &ptr);
 7587|  2.63M|    if (name == NULL) {
  ------------------
  |  Branch (7587:9): [True: 30, False: 2.63M]
  ------------------
 7588|     30|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7589|     30|		       "xmlParseStringEntityRef: no name\n");
 7590|     30|	*str = ptr;
 7591|     30|	return(NULL);
 7592|     30|    }
 7593|  2.63M|    if (*ptr != ';') {
  ------------------
  |  Branch (7593:9): [True: 8, False: 2.63M]
  ------------------
 7594|      8|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7595|      8|        xmlFree(name);
 7596|      8|	*str = ptr;
 7597|      8|	return(NULL);
 7598|      8|    }
 7599|  2.63M|    ptr++;
 7600|       |
 7601|  2.63M|    *str = ptr;
 7602|  2.63M|    return(name);
 7603|  2.63M|}
parser.c:xmlParseAttValueInternal:
 4056|   415k|                         int special, int isNamespace) {
 4057|   415k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4057:26): [True: 196k, False: 218k]
  ------------------
 4058|   196k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   196k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4059|   415k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   633k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4060|   415k|    xmlSBuf buf;
 4061|   415k|    xmlChar *ret;
 4062|   415k|    int c, l, quote, entFlags, chunkSize;
 4063|   415k|    int inSpace = 1;
 4064|   415k|    int replaceEntities;
 4065|   415k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   415k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   415k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4066|   415k|    int attvalFlags = 0;
 4067|       |
 4068|       |    /* Always expand namespace URIs */
 4069|   415k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4069:23): [True: 271k, False: 143k]
  |  Branch (4069:50): [True: 21.0k, False: 122k]
  ------------------
 4070|       |
 4071|   415k|    xmlSBufInit(&buf, maxLength);
 4072|       |
 4073|   415k|    GROW;
  ------------------
  |  | 2308|   415k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   415k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   415k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 216k, False: 199k]
  |  |  ------------------
  |  | 2309|   415k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   216k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 58.3k, False: 157k]
  |  |  ------------------
  |  | 2310|   415k|	xmlParserGrow(ctxt);
  ------------------
 4074|       |
 4075|   415k|    quote = CUR;
  ------------------
  |  | 2262|   415k|#define CUR (*ctxt->input->cur)
  ------------------
 4076|   415k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4076:9): [True: 255k, False: 159k]
  |  Branch (4076:27): [True: 5.31k, False: 250k]
  ------------------
 4077|  5.31k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4078|  5.31k|	return(NULL);
 4079|  5.31k|    }
 4080|   409k|    NEXTL(1);
  ------------------
  |  | 2325|   409k|#define NEXTL(l) do {							\
  |  | 2326|   409k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 409k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   409k|    } else ctxt->input->col++;						\
  |  | 2329|   409k|    ctxt->input->cur += l;				\
  |  | 2330|   409k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 409k]
  |  |  ------------------
  ------------------
 4081|       |
 4082|   409k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4082:9): [True: 327k, False: 82.0k]
  ------------------
 4083|   327k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   327k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   327k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4084|  82.0k|    else
 4085|  82.0k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  82.0k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4086|       |
 4087|   409k|    inSpace = 1;
 4088|   409k|    chunkSize = 0;
 4089|       |
 4090|   164M|    while (1) {
  ------------------
  |  Branch (4090:12): [True: 164M, Folded]
  ------------------
 4091|   164M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   164M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 142, False: 164M]
  |  |  ------------------
  ------------------
 4092|    142|            goto error;
 4093|       |
 4094|   164M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   164M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4094:13): [True: 49.2k, False: 164M]
  ------------------
 4095|  49.2k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4096|  49.2k|                           "AttValue: ' expected\n");
 4097|  49.2k|            goto error;
 4098|  49.2k|        }
 4099|       |
 4100|       |        /*
 4101|       |         * TODO: Check growth threshold
 4102|       |         */
 4103|   164M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   164M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4103:13): [True: 541k, False: 163M]
  ------------------
 4104|   541k|            GROW;
  ------------------
  |  | 2308|   541k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   541k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   541k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 483k, False: 58.0k]
  |  |  ------------------
  |  | 2309|   541k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   483k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 483k, False: 0]
  |  |  ------------------
  |  | 2310|   541k|	xmlParserGrow(ctxt);
  ------------------
 4105|       |
 4106|   164M|        c = CUR;
  ------------------
  |  | 2262|   164M|#define CUR (*ctxt->input->cur)
  ------------------
 4107|       |
 4108|   164M|        if (c >= 0x80) {
  ------------------
  |  Branch (4108:13): [True: 69.7M, False: 94.5M]
  ------------------
 4109|  69.7M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2264|  69.7M|#define CUR_PTR ctxt->input->cur
  ------------------
 4110|  69.7M|                    "invalid character in attribute value\n");
 4111|  69.7M|            if (l == 0) {
  ------------------
  |  Branch (4111:17): [True: 63.6M, False: 6.02M]
  ------------------
 4112|  63.6M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4112:21): [True: 324k, False: 63.3M]
  ------------------
 4113|   324k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   324k|#define CUR_PTR ctxt->input->cur
  ------------------
 4114|   324k|                    chunkSize = 0;
 4115|   324k|                }
 4116|  63.6M|                xmlSBufAddReplChar(&buf);
 4117|  63.6M|                NEXTL(1);
  ------------------
  |  | 2325|  63.6M|#define NEXTL(l) do {							\
  |  | 2326|  63.6M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 63.6M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  63.6M|    } else ctxt->input->col++;						\
  |  | 2329|  63.6M|    ctxt->input->cur += l;				\
  |  | 2330|  63.6M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 63.6M]
  |  |  ------------------
  ------------------
 4118|  63.6M|            } else {
 4119|  6.02M|                chunkSize += l;
 4120|  6.02M|                NEXTL(l);
  ------------------
  |  | 2325|  6.02M|#define NEXTL(l) do {							\
  |  | 2326|  6.02M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.02M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.02M|    } else ctxt->input->col++;						\
  |  | 2329|  6.02M|    ctxt->input->cur += l;				\
  |  | 2330|  6.02M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.02M]
  |  |  ------------------
  ------------------
 4121|  6.02M|            }
 4122|       |
 4123|  69.7M|            inSpace = 0;
 4124|  94.5M|        } else if (c != '&') {
  ------------------
  |  Branch (4124:20): [True: 93.4M, False: 1.10M]
  ------------------
 4125|  93.4M|            if (c > 0x20) {
  ------------------
  |  Branch (4125:17): [True: 60.2M, False: 33.2M]
  ------------------
 4126|  60.2M|                if (c == quote)
  ------------------
  |  Branch (4126:21): [True: 358k, False: 59.8M]
  ------------------
 4127|   358k|                    break;
 4128|       |
 4129|  59.8M|                if (c == '<')
  ------------------
  |  Branch (4129:21): [True: 760k, False: 59.1M]
  ------------------
 4130|   760k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4131|       |
 4132|  59.8M|                chunkSize += 1;
 4133|  59.8M|                inSpace = 0;
 4134|  59.8M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  33.2M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  33.2M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 9.95M, False: 23.2M]
  |  |  |  |  |  Branch (108:44): [True: 7.08M, False: 2.87M]
  |  |  |  |  ------------------
  |  |  |  |  109|  33.2M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 619k, False: 25.5M]
  |  |  |  |  ------------------
  |  |  |  |  110|  33.2M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 2.17M, False: 23.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4135|  23.3M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4136|  23.3M|                        "invalid character in attribute value\n");
 4137|  23.3M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4137:21): [True: 81.9k, False: 23.2M]
  ------------------
 4138|  81.9k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  81.9k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  81.9k|                    chunkSize = 0;
 4140|  81.9k|                }
 4141|  23.3M|                xmlSBufAddReplChar(&buf);
 4142|  23.3M|                inSpace = 0;
 4143|  23.3M|            } else {
 4144|       |                /* Whitespace */
 4145|  9.87M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4145:21): [True: 92.5k, False: 9.78M]
  |  Branch (4145:36): [True: 74.9k, False: 17.5k]
  ------------------
 4146|       |                    /* Skip char */
 4147|  74.9k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4147:25): [True: 4.01k, False: 70.9k]
  ------------------
 4148|  4.01k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  4.01k|#define CUR_PTR ctxt->input->cur
  ------------------
 4149|  4.01k|                        chunkSize = 0;
 4150|  4.01k|                    }
 4151|  74.9k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  74.9k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4152|  9.79M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4152:28): [True: 7.63M, False: 2.16M]
  ------------------
 4153|       |                    /* Convert to space */
 4154|  7.63M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4154:25): [True: 346k, False: 7.29M]
  ------------------
 4155|   346k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   346k|#define CUR_PTR ctxt->input->cur
  ------------------
 4156|   346k|                        chunkSize = 0;
 4157|   346k|                    }
 4158|       |
 4159|  7.63M|                    xmlSBufAddCString(&buf, " ", 1);
 4160|  7.63M|                } else {
 4161|  2.16M|                    chunkSize += 1;
 4162|  2.16M|                }
 4163|       |
 4164|  9.87M|                inSpace = 1;
 4165|       |
 4166|  9.87M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2263|   619k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4166:21): [True: 619k, False: 9.25M]
  |  Branch (4166:35): [True: 175k, False: 443k]
  ------------------
 4167|   175k|                    CUR_PTR++;
  ------------------
  |  | 2264|   175k|#define CUR_PTR ctxt->input->cur
  ------------------
 4168|  9.87M|            }
 4169|       |
 4170|  93.1M|            NEXTL(1);
  ------------------
  |  | 2325|  93.1M|#define NEXTL(l) do {							\
  |  | 2326|  93.1M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 6.98M, False: 86.1M]
  |  |  ------------------
  |  | 2327|  6.98M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  86.1M|    } else ctxt->input->col++;						\
  |  | 2329|  93.1M|    ctxt->input->cur += l;				\
  |  | 2330|  93.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 93.1M]
  |  |  ------------------
  ------------------
 4171|  93.1M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2263|  1.10M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4171:20): [True: 53.3k, False: 1.05M]
  ------------------
 4172|  53.3k|            int val;
 4173|       |
 4174|  53.3k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4174:17): [True: 39.1k, False: 14.1k]
  ------------------
 4175|  39.1k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  39.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4176|  39.1k|                chunkSize = 0;
 4177|  39.1k|            }
 4178|       |
 4179|  53.3k|            val = xmlParseCharRef(ctxt);
 4180|  53.3k|            if (val == 0)
  ------------------
  |  Branch (4180:17): [True: 2.09k, False: 51.2k]
  ------------------
 4181|  2.09k|                goto error;
 4182|       |
 4183|  51.2k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4183:17): [True: 3.61k, False: 47.6k]
  |  Branch (4183:33): [True: 1.71k, False: 1.90k]
  ------------------
 4184|       |                /*
 4185|       |                 * The reparsing will be done in xmlNodeParseContent()
 4186|       |                 * called from SAX2.c
 4187|       |                 */
 4188|  1.71k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4189|  1.71k|                inSpace = 0;
 4190|  49.5k|            } else if (val == ' ') {
  ------------------
  |  Branch (4190:24): [True: 1.47k, False: 48.0k]
  ------------------
 4191|  1.47k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4191:21): [True: 421, False: 1.05k]
  |  Branch (4191:36): [True: 201, False: 220]
  ------------------
 4192|    201|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    201|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4193|  1.27k|                else
 4194|  1.27k|                    xmlSBufAddCString(&buf, " ", 1);
 4195|  1.47k|                inSpace = 1;
 4196|  48.0k|            } else {
 4197|  48.0k|                xmlSBufAddChar(&buf, val);
 4198|  48.0k|                inSpace = 0;
 4199|  48.0k|            }
 4200|  1.05M|        } else {
 4201|  1.05M|            const xmlChar *name;
 4202|  1.05M|            xmlEntityPtr ent;
 4203|       |
 4204|  1.05M|            if (chunkSize > 0) {
  ------------------
  |  Branch (4204:17): [True: 646k, False: 404k]
  ------------------
 4205|   646k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   646k|#define CUR_PTR ctxt->input->cur
  ------------------
 4206|   646k|                chunkSize = 0;
 4207|   646k|            }
 4208|       |
 4209|  1.05M|            name = xmlParseEntityRefInternal(ctxt);
 4210|  1.05M|            if (name == NULL) {
  ------------------
  |  Branch (4210:17): [True: 180k, False: 870k]
  ------------------
 4211|       |                /*
 4212|       |                 * Probably a literal '&' which wasn't escaped.
 4213|       |                 * TODO: Handle gracefully in recovery mode.
 4214|       |                 */
 4215|   180k|                continue;
 4216|   180k|            }
 4217|       |
 4218|   870k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4219|   870k|            if (ent == NULL)
  ------------------
  |  Branch (4219:17): [True: 231k, False: 638k]
  ------------------
 4220|   231k|                continue;
 4221|       |
 4222|   638k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4222:17): [True: 39.7k, False: 599k]
  ------------------
 4223|  39.7k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4223:21): [True: 2.44k, False: 37.3k]
  |  Branch (4223:49): [True: 1.54k, False: 903]
  ------------------
 4224|  1.54k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4225|  38.2k|                else
 4226|  38.2k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4227|  39.7k|                inSpace = 0;
 4228|   599k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4228:24): [True: 558k, False: 40.7k]
  ------------------
 4229|   558k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4229:21): [True: 7.14k, False: 551k]
  ------------------
 4230|   558k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4231|   558k|                        /* check */ 1) > 0)
 4232|  7.14k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  7.14k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4233|   558k|            } else {
 4234|  40.7k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4234:21): [True: 1.11k, False: 39.6k]
  ------------------
 4235|  1.11k|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4236|       |
 4237|  40.7k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4237:21): [True: 123, False: 40.6k]
  ------------------
 4238|    123|                    ent->content[0] = 0;
 4239|    123|                    goto error;
 4240|    123|                }
 4241|       |
 4242|       |                /*
 4243|       |                 * Just output the reference
 4244|       |                 */
 4245|  40.6k|                xmlSBufAddCString(&buf, "&", 1);
 4246|  40.6k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4247|  40.6k|                xmlSBufAddCString(&buf, ";", 1);
 4248|       |
 4249|  40.6k|                inSpace = 0;
 4250|  40.6k|            }
 4251|   638k|	}
 4252|   164M|    }
 4253|       |
 4254|   358k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4254:9): [True: 304k, False: 53.1k]
  |  Branch (4254:30): [True: 207k, False: 97.5k]
  ------------------
 4255|   207k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2264|   207k|#define CUR_PTR ctxt->input->cur
  ------------------
 4256|       |
 4257|   207k|        if (attlen != NULL)
  ------------------
  |  Branch (4257:13): [True: 207k, False: 0]
  ------------------
 4258|   207k|            *attlen = chunkSize;
 4259|   207k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4259:13): [True: 3.74k, False: 203k]
  |  Branch (4259:28): [True: 660, False: 3.08k]
  |  Branch (4259:41): [True: 350, False: 310]
  ------------------
 4260|    350|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    350|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4261|    350|            *attlen -= 1;
 4262|    350|        }
 4263|       |
 4264|       |        /* Report potential error */
 4265|   207k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4266|   207k|    } else {
 4267|   150k|        if (chunkSize > 0)
  ------------------
  |  Branch (4267:13): [True: 126k, False: 24.3k]
  ------------------
 4268|   126k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   126k|#define CUR_PTR ctxt->input->cur
  ------------------
 4269|       |
 4270|   150k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4270:13): [True: 1.60k, False: 149k]
  |  Branch (4270:28): [True: 311, False: 1.28k]
  |  Branch (4270:41): [True: 311, False: 0]
  ------------------
 4271|    311|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    311|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4272|    311|            buf.size--;
 4273|    311|        }
 4274|       |
 4275|   150k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4276|   150k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   150k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4277|       |
 4278|   150k|        if (ret != NULL) {
  ------------------
  |  Branch (4278:13): [True: 150k, False: 27]
  ------------------
 4279|   150k|            if (attlen != NULL)
  ------------------
  |  Branch (4279:17): [True: 27.2k, False: 123k]
  ------------------
 4280|  27.2k|                *attlen = buf.size;
 4281|   150k|        }
 4282|   150k|    }
 4283|       |
 4284|   358k|    if (outFlags != NULL)
  ------------------
  |  Branch (4284:9): [True: 234k, False: 123k]
  ------------------
 4285|   234k|        *outFlags = attvalFlags;
 4286|       |
 4287|   358k|    NEXTL(1);
  ------------------
  |  | 2325|   358k|#define NEXTL(l) do {							\
  |  | 2326|   358k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 358k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   358k|    } else ctxt->input->col++;						\
  |  | 2329|   358k|    ctxt->input->cur += l;				\
  |  | 2330|   358k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 358k]
  |  |  ------------------
  ------------------
 4288|       |
 4289|   358k|    return(ret);
 4290|       |
 4291|  51.6k|error:
 4292|  51.6k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4293|       |    return(NULL);
 4294|   409k|}
parser.c:xmlCheckEntityInAttValue:
 3729|  5.94k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3730|  5.94k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3730:20): [True: 4.88k, False: 1.06k]
  ------------------
 3731|  5.94k|    const xmlChar *str;
 3732|  5.94k|    unsigned long expandedSize = pent->length;
 3733|  5.94k|    int c, flags;
 3734|       |
 3735|  5.94k|    depth += 1;
 3736|  5.94k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3736:9): [True: 1, False: 5.94k]
  ------------------
 3737|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3738|      1|                       "Maximum entity nesting depth exceeded");
 3739|      1|	return;
 3740|      1|    }
 3741|       |
 3742|  5.94k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  5.94k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3742:9): [True: 19, False: 5.92k]
  ------------------
 3743|     19|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3744|     19|        return;
 3745|     19|    }
 3746|       |
 3747|       |    /*
 3748|       |     * If we're parsing a default attribute value in DTD content,
 3749|       |     * the entity might reference other entities which weren't
 3750|       |     * defined yet, so the check isn't reliable.
 3751|       |     */
 3752|  5.92k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3752:9): [True: 5.71k, False: 210]
  ------------------
 3753|  5.71k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  5.71k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  5.71k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3754|    210|    else
 3755|    210|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    210|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3756|       |
 3757|  5.92k|    str = pent->content;
 3758|  5.92k|    if (str == NULL)
  ------------------
  |  Branch (3758:9): [True: 4, False: 5.91k]
  ------------------
 3759|      4|        goto done;
 3760|       |
 3761|       |    /*
 3762|       |     * Note that entity values are already validated. We only check
 3763|       |     * for illegal less-than signs and compute the expanded size
 3764|       |     * of the entity. No special handling for multi-byte characters
 3765|       |     * is needed.
 3766|       |     */
 3767|  28.7M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  28.7M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3767:12): [True: 28.7M, False: 128]
  ------------------
 3768|  28.7M|        c = *str;
 3769|       |
 3770|  28.7M|	if (c != '&') {
  ------------------
  |  Branch (3770:6): [True: 28.7M, False: 19.3k]
  ------------------
 3771|  28.7M|            if (c == 0)
  ------------------
  |  Branch (3771:17): [True: 5.77k, False: 28.7M]
  ------------------
 3772|  5.77k|                break;
 3773|       |
 3774|  28.7M|            if (c == '<')
  ------------------
  |  Branch (3774:17): [True: 2.25k, False: 28.6M]
  ------------------
 3775|  2.25k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3776|  2.25k|                        "'<' in entity '%s' is not allowed in attributes "
 3777|  2.25k|                        "values\n", pent->name);
 3778|       |
 3779|  28.7M|            str += 1;
 3780|  28.7M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3780:20): [True: 3.64k, False: 15.6k]
  ------------------
 3781|  3.64k|            int val;
 3782|       |
 3783|  3.64k|	    val = xmlParseStringCharRef(ctxt, &str);
 3784|  3.64k|	    if (val == 0) {
  ------------------
  |  Branch (3784:10): [True: 5, False: 3.64k]
  ------------------
 3785|      5|                pent->content[0] = 0;
 3786|      5|                break;
 3787|      5|            }
 3788|  15.6k|	} else {
 3789|  15.6k|            xmlChar *name;
 3790|  15.6k|            xmlEntityPtr ent;
 3791|       |
 3792|  15.6k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3793|  15.6k|	    if (name == NULL) {
  ------------------
  |  Branch (3793:10): [True: 14, False: 15.6k]
  ------------------
 3794|     14|                pent->content[0] = 0;
 3795|     14|                break;
 3796|     14|            }
 3797|       |
 3798|  15.6k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3799|  15.6k|            xmlFree(name);
 3800|       |
 3801|  15.6k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3801:17): [True: 10.7k, False: 4.94k]
  ------------------
 3802|  10.7k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3802:17): [True: 9.77k, False: 931]
  ------------------
 3803|  9.77k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3803:21): [True: 4.82k, False: 4.94k]
  ------------------
 3804|  4.82k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.82k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3805|  4.82k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3806|  4.82k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  4.82k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3807|  4.82k|                }
 3808|       |
 3809|  9.77k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3810|  9.77k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  9.77k|#define XML_ENT_FIXED_COST 20
  ------------------
 3811|  9.77k|            }
 3812|  15.6k|        }
 3813|  28.7M|    }
 3814|       |
 3815|  5.92k|done:
 3816|  5.92k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3816:9): [True: 5.71k, False: 210]
  ------------------
 3817|  5.71k|        pent->expandedSize = expandedSize;
 3818|       |
 3819|  5.92k|    pent->flags |= flags;
 3820|  5.92k|}
parser.c:xmlCurrentCharRecover:
 2337|  66.7M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2338|  66.7M|    int c = xmlCurrentChar(ctxt, len);
 2339|       |
 2340|  66.7M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  66.7M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2340:9): [True: 16.9M, False: 49.8M]
  ------------------
 2341|  16.9M|        c = 0xFFFD; /* replacement character */
 2342|       |
 2343|  66.7M|    return(c);
 2344|  66.7M|}
parser.c:xmlParseCharDataInternal:
 4570|  8.33M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4571|  8.33M|    const xmlChar *in;
 4572|  8.33M|    int line = ctxt->input->line;
 4573|  8.33M|    int col = ctxt->input->col;
 4574|  8.33M|    int ccol;
 4575|  8.33M|    int terminate = 0;
 4576|       |
 4577|  8.33M|    GROW;
  ------------------
  |  | 2308|  8.33M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.33M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.33M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.82M, False: 2.51M]
  |  |  ------------------
  |  | 2309|  8.33M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.82M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 45.6k, False: 5.77M]
  |  |  ------------------
  |  | 2310|  8.33M|	xmlParserGrow(ctxt);
  ------------------
 4578|       |    /*
 4579|       |     * Accelerated common case where input don't need to be
 4580|       |     * modified before passing it to the handler.
 4581|       |     */
 4582|  8.33M|    in = ctxt->input->cur;
 4583|  8.34M|    do {
 4584|  8.45M|get_more_space:
 4585|  8.68M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4585:16): [True: 226k, False: 8.45M]
  ------------------
 4586|  8.45M|        if (*in == 0xA) {
  ------------------
  |  Branch (4586:13): [True: 113k, False: 8.34M]
  ------------------
 4587|  3.98M|            do {
 4588|  3.98M|                ctxt->input->line++; ctxt->input->col = 1;
 4589|  3.98M|                in++;
 4590|  3.98M|            } while (*in == 0xA);
  ------------------
  |  Branch (4590:22): [True: 3.87M, False: 113k]
  ------------------
 4591|   113k|            goto get_more_space;
 4592|   113k|        }
 4593|  8.34M|        if (*in == '<') {
  ------------------
  |  Branch (4593:13): [True: 74.9k, False: 8.27M]
  ------------------
 4594|   149k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4594:20): [True: 74.9k, False: 74.9k]
  ------------------
 4595|  74.9k|                const xmlChar *tmp = ctxt->input->cur;
 4596|  74.9k|                size_t nbchar = in - tmp;
 4597|       |
 4598|  74.9k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|  74.9k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4598:21): [True: 0, False: 74.9k]
  ------------------
 4599|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4600|  74.9k|                ctxt->input->cur += nbchar;
 4601|       |
 4602|  74.9k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4603|  74.9k|            }
 4604|  74.9k|            return;
 4605|  74.9k|        }
 4606|       |
 4607|  8.68M|get_more:
 4608|  8.68M|        ccol = ctxt->input->col;
 4609|  18.5M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4609:16): [True: 9.88M, False: 8.68M]
  ------------------
 4610|  9.88M|            in++;
 4611|  9.88M|            ccol++;
 4612|  9.88M|        }
 4613|  8.68M|        ctxt->input->col = ccol;
 4614|  8.68M|        if (*in == 0xA) {
  ------------------
  |  Branch (4614:13): [True: 53.5k, False: 8.63M]
  ------------------
 4615|  2.68M|            do {
 4616|  2.68M|                ctxt->input->line++; ctxt->input->col = 1;
 4617|  2.68M|                in++;
 4618|  2.68M|            } while (*in == 0xA);
  ------------------
  |  Branch (4618:22): [True: 2.63M, False: 53.5k]
  ------------------
 4619|  53.5k|            goto get_more;
 4620|  53.5k|        }
 4621|  8.63M|        if (*in == ']') {
  ------------------
  |  Branch (4621:13): [True: 362k, False: 8.26M]
  ------------------
 4622|   362k|            size_t avail = ctxt->input->end - in;
 4623|       |
 4624|   362k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4624:17): [True: 321k, False: 41.7k]
  |  Branch (4624:28): [True: 69, False: 321k]
  ------------------
 4625|     69|                terminate = 1;
 4626|     69|                goto invoke_callback;
 4627|     69|            }
 4628|   362k|            if (in[1] == ']') {
  ------------------
  |  Branch (4628:17): [True: 300k, False: 62.2k]
  ------------------
 4629|   300k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4629:21): [True: 287k, False: 12.6k]
  |  Branch (4629:32): [True: 349, False: 287k]
  ------------------
 4630|    349|                    terminate = 1;
 4631|    349|                    goto invoke_callback;
 4632|    349|                }
 4633|   300k|                if (in[2] == '>')
  ------------------
  |  Branch (4633:21): [True: 1.85k, False: 298k]
  ------------------
 4634|  1.85k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4635|   300k|            }
 4636|       |
 4637|   362k|            in++;
 4638|   362k|            ctxt->input->col++;
 4639|   362k|            goto get_more;
 4640|   362k|        }
 4641|       |
 4642|  8.27M|invoke_callback:
 4643|  8.92M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4643:16): [True: 657k, False: 8.27M]
  ------------------
 4644|   657k|            const xmlChar *tmp = ctxt->input->cur;
 4645|   657k|            size_t nbchar = in - tmp;
 4646|       |
 4647|   657k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   657k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4647:17): [True: 0, False: 657k]
  ------------------
 4648|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4649|   657k|            ctxt->input->cur += nbchar;
 4650|       |
 4651|   657k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4652|       |
 4653|   657k|            line = ctxt->input->line;
 4654|   657k|            col = ctxt->input->col;
 4655|   657k|        }
 4656|  8.27M|        ctxt->input->cur = in;
 4657|  8.27M|        if (*in == 0xD) {
  ------------------
  |  Branch (4657:13): [True: 11.2k, False: 8.25M]
  ------------------
 4658|  11.2k|            in++;
 4659|  11.2k|            if (*in == 0xA) {
  ------------------
  |  Branch (4659:17): [True: 5.56k, False: 5.72k]
  ------------------
 4660|  5.56k|                ctxt->input->cur = in;
 4661|  5.56k|                in++;
 4662|  5.56k|                ctxt->input->line++; ctxt->input->col = 1;
 4663|  5.56k|                continue; /* while */
 4664|  5.56k|            }
 4665|  5.72k|            in--;
 4666|  5.72k|        }
 4667|  8.26M|        if (*in == '<') {
  ------------------
  |  Branch (4667:13): [True: 538k, False: 7.72M]
  ------------------
 4668|   538k|            return;
 4669|   538k|        }
 4670|  7.72M|        if (*in == '&') {
  ------------------
  |  Branch (4670:13): [True: 42.4k, False: 7.68M]
  ------------------
 4671|  42.4k|            return;
 4672|  42.4k|        }
 4673|  7.68M|        if (terminate) {
  ------------------
  |  Branch (4673:13): [True: 418, False: 7.68M]
  ------------------
 4674|    418|            return;
 4675|    418|        }
 4676|  7.68M|        SHRINK;
  ------------------
  |  | 2304|  7.68M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.68M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.68M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 5.34M, False: 2.34M]
  |  |  ------------------
  |  | 2305|  7.68M|	xmlParserShrink(ctxt);
  ------------------
 4677|  7.68M|        GROW;
  ------------------
  |  | 2308|  7.68M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.68M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.68M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.34M, False: 2.34M]
  |  |  ------------------
  |  | 2309|  7.68M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.34M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 18.5k, False: 5.32M]
  |  |  ------------------
  |  | 2310|  7.68M|	xmlParserGrow(ctxt);
  ------------------
 4678|  7.68M|        in = ctxt->input->cur;
 4679|  7.68M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4679:15): [True: 84.1k, False: 7.60M]
  |  Branch (4679:32): [True: 1.65k, False: 82.4k]
  ------------------
 4680|  7.68M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4680:14): [True: 1.95k, False: 7.68M]
  |  Branch (4680:31): [True: 1.64k, False: 7.68M]
  ------------------
 4681|  7.68M|    ctxt->input->line = line;
 4682|  7.68M|    ctxt->input->col = col;
 4683|  7.68M|    xmlParseCharDataComplex(ctxt, partial);
 4684|  7.68M|}
parser.c:xmlCharacters:
 4524|   922k|              int isBlank) {
 4525|   922k|    int checkBlanks;
 4526|       |
 4527|   922k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4527:9): [True: 0, False: 922k]
  |  Branch (4527:32): [True: 146k, False: 775k]
  ------------------
 4528|   146k|        return;
 4529|       |
 4530|   775k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4530:19): [True: 453k, False: 322k]
  ------------------
 4531|   322k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4531:19): [True: 0, False: 322k]
  ------------------
 4532|       |
 4533|       |    /*
 4534|       |     * Calling areBlanks with only parts of a text node
 4535|       |     * is fundamentally broken, making the NOBLANKS option
 4536|       |     * essentially unusable.
 4537|       |     */
 4538|   775k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4538:9): [True: 453k, False: 322k]
  ------------------
 4539|   453k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4539:9): [True: 12.1k, False: 441k]
  ------------------
 4540|  12.1k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4540:13): [True: 12.1k, False: 0]
  ------------------
 4541|  12.1k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4541:13): [True: 0, False: 12.1k]
  ------------------
 4542|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4543|   763k|    } else {
 4544|   763k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4544:13): [True: 763k, False: 0]
  ------------------
 4545|   763k|            ctxt->sax->characters(ctxt->userData, buf, size);
 4546|       |
 4547|       |        /*
 4548|       |         * The old code used to update this value for "complex" data
 4549|       |         * even if checkBlanks was false. This was probably a bug.
 4550|       |         */
 4551|   763k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4551:13): [True: 441k, False: 322k]
  |  Branch (4551:30): [True: 87.7k, False: 353k]
  ------------------
 4552|  87.7k|            *ctxt->space = -2;
 4553|   763k|    }
 4554|   775k|}
parser.c:areBlanks:
 2852|   453k|                     int blank_chars) {
 2853|   453k|    int i;
 2854|   453k|    xmlNodePtr lastChild;
 2855|       |
 2856|       |    /*
 2857|       |     * Check for xml:space value.
 2858|       |     */
 2859|   453k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2859:9): [True: 0, False: 453k]
  |  Branch (2859:34): [True: 212, False: 453k]
  ------------------
 2860|   453k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2860:9): [True: 352k, False: 100k]
  ------------------
 2861|   352k|	return(0);
 2862|       |
 2863|       |    /*
 2864|       |     * Check that the string is made of blanks
 2865|       |     */
 2866|   100k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2866:9): [True: 90.4k, False: 10.3k]
  ------------------
 2867|   174k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2867:13): [True: 168k, False: 5.11k]
  ------------------
 2868|   168k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   168k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   168k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 17.9k, False: 150k]
  |  |  |  |  ------------------
  |  |  |  |   91|   168k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 150k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 65.6k, False: 85.3k]
  |  |  |  |  ------------------
  |  |  |  |   92|   168k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 85.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|  90.4k|    }
 2870|       |
 2871|       |    /*
 2872|       |     * Look if the element is mixed content in the DTD if available
 2873|       |     */
 2874|  15.4k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2874:9): [True: 0, False: 15.4k]
  ------------------
 2875|  15.4k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2875:9): [True: 15.4k, False: 0]
  ------------------
 2876|  15.4k|        xmlElementPtr elemDecl = NULL;
 2877|  15.4k|        xmlDocPtr doc = ctxt->myDoc;
 2878|  15.4k|        const xmlChar *prefix = NULL;
 2879|       |
 2880|  15.4k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2880:13): [True: 2.41k, False: 13.0k]
  ------------------
 2881|  2.41k|            prefix = ctxt->node->ns->prefix;
 2882|  15.4k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2882:13): [True: 9.33k, False: 6.15k]
  ------------------
 2883|  9.33k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2884|  9.33k|                                      prefix);
 2885|  15.4k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2885:13): [True: 12.9k, False: 2.56k]
  |  Branch (2885:35): [True: 734, False: 12.1k]
  ------------------
 2886|    734|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2887|    734|                                      prefix);
 2888|  15.4k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2888:13): [True: 2.61k, False: 12.8k]
  ------------------
 2889|  2.61k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2889:17): [True: 1.41k, False: 1.20k]
  ------------------
 2890|  1.41k|                return(1);
 2891|  1.20k|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2891:17): [True: 251, False: 954]
  ------------------
 2892|    954|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2892:17): [True: 205, False: 749]
  ------------------
 2893|    456|                return(0);
 2894|  1.20k|        }
 2895|  15.4k|    }
 2896|       |
 2897|       |    /*
 2898|       |     * Otherwise, heuristic :-\
 2899|       |     *
 2900|       |     * When push parsing, we could be at the end of a chunk.
 2901|       |     * This makes the look-ahead and consequently the NOBLANKS
 2902|       |     * option unreliable.
 2903|       |     */
 2904|  13.6k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  13.6k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  3.45k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2904:9): [True: 3.45k, False: 10.1k]
  |  Branch (2904:25): [True: 1.37k, False: 2.07k]
  ------------------
 2905|  12.2k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2905:9): [True: 8.87k, False: 3.36k]
  ------------------
 2906|  8.87k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2261|  8.87k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2263|  7.26k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2906:2): [True: 7.26k, False: 1.60k]
  |  Branch (2906:18): [True: 491, False: 6.77k]
  ------------------
 2907|       |
 2908|  11.7k|    lastChild = xmlGetLastChild(ctxt->node);
 2909|  11.7k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2909:9): [True: 8.38k, False: 3.36k]
  ------------------
 2910|  8.38k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2910:13): [True: 0, False: 8.38k]
  ------------------
 2911|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2911:13): [True: 0, False: 0]
  ------------------
 2912|  8.38k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2912:16): [True: 479, False: 2.88k]
  ------------------
 2913|    479|        return(0);
 2914|  2.88k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2914:14): [True: 2.88k, False: 0]
  ------------------
 2915|  2.88k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2915:14): [True: 498, False: 2.38k]
  ------------------
 2916|    498|        return(0);
 2917|  10.7k|    return(1);
 2918|  11.7k|}
parser.c:xmlParseCharDataComplex:
 4697|  7.68M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4698|  7.68M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4699|  7.68M|    int nbchar = 0;
 4700|  7.68M|    int cur, l;
 4701|       |
 4702|  7.68M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4703|  21.8M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4703:12): [True: 21.8M, False: 50.9k]
  ------------------
 4704|  21.8M|           (cur != '&') &&
  ------------------
  |  Branch (4704:12): [True: 21.8M, False: 5.74k]
  ------------------
 4705|  21.8M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  21.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  21.8M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 12.2M, False: 9.54M]
  |  |  |  |  ------------------
  |  |  |  |  118|  21.8M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  12.2M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 4.69M, False: 7.57M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 1.88M, False: 2.81M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  12.2M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 10.3M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  12.2M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.76M, False: 7.62M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  21.8M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 9.54M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.70M, False: 5.83M]
  |  |  |  |  ------------------
  |  |  |  |  120|  9.54M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.83M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 5.82M, False: 4.84k]
  |  |  |  |  ------------------
  |  |  |  |  121|  9.54M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 2.81k, False: 2.02k]
  |  |  |  |  |  Branch (121:27): [True: 2.81k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4705:5): [True: 14.1M, False: 7.62M]
  ------------------
 4706|  14.1M|        if (cur == ']') {
  ------------------
  |  Branch (4706:13): [True: 200k, False: 13.9M]
  ------------------
 4707|   200k|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4708|       |
 4709|   200k|            if (partial && avail < 2)
  ------------------
  |  Branch (4709:17): [True: 191k, False: 8.46k]
  |  Branch (4709:28): [True: 72, False: 191k]
  ------------------
 4710|     72|                break;
 4711|   200k|            if (NXT(1) == ']') {
  ------------------
  |  | 2263|   200k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4711:17): [True: 183k, False: 16.8k]
  ------------------
 4712|   183k|                if (partial && avail < 3)
  ------------------
  |  Branch (4712:21): [True: 181k, False: 1.39k]
  |  Branch (4712:32): [True: 568, False: 181k]
  ------------------
 4713|    568|                    break;
 4714|   182k|                if (NXT(2) == '>')
  ------------------
  |  | 2263|   182k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4714:21): [True: 717, False: 181k]
  ------------------
 4715|    717|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4716|   182k|            }
 4717|   200k|        }
 4718|       |
 4719|  14.1M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2333|  14.1M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 3.89M, False: 10.2M]
  |  |  ------------------
  |  | 2334|  14.1M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4720|       |	/* move current position before possible calling of ctxt->sax->characters */
 4721|  14.1M|	NEXTL(l);
  ------------------
  |  | 2325|  14.1M|#define NEXTL(l) do {							\
  |  | 2326|  14.1M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 1.83M, False: 12.3M]
  |  |  ------------------
  |  | 2327|  1.83M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  12.3M|    } else ctxt->input->col++;						\
  |  | 2329|  14.1M|    ctxt->input->cur += l;				\
  |  | 2330|  14.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 14.1M]
  |  |  ------------------
  ------------------
 4722|  14.1M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  14.1M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4722:6): [True: 104k, False: 14.0M]
  ------------------
 4723|   104k|	    buf[nbchar] = 0;
 4724|       |
 4725|   104k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4726|   104k|	    nbchar = 0;
 4727|   104k|            SHRINK;
  ------------------
  |  | 2304|   104k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   104k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   104k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 92.0k, False: 12.2k]
  |  |  ------------------
  |  | 2305|   104k|	xmlParserShrink(ctxt);
  ------------------
 4728|   104k|	}
 4729|  14.1M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4730|  14.1M|    }
 4731|  7.68M|    if (nbchar != 0) {
  ------------------
  |  Branch (4731:9): [True: 86.0k, False: 7.59M]
  ------------------
 4732|  86.0k|        buf[nbchar] = 0;
 4733|       |
 4734|  86.0k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4735|  86.0k|    }
 4736|       |    /*
 4737|       |     * cur == 0 can mean
 4738|       |     *
 4739|       |     * - End of buffer.
 4740|       |     * - An actual 0 character.
 4741|       |     * - An incomplete UTF-8 sequence. This is allowed if partial is set.
 4742|       |     */
 4743|  7.68M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4743:9): [True: 7.67M, False: 4.77k]
  ------------------
 4744|  7.67M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2262|  7.42M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4744:13): [True: 7.42M, False: 258k]
  |  Branch (4744:27): [True: 621, False: 7.41M]
  ------------------
 4745|    621|            if (partial == 0) {
  ------------------
  |  Branch (4745:17): [True: 418, False: 203]
  ------------------
 4746|    418|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4747|    418|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2262|    418|#define CUR (*ctxt->input->cur)
  ------------------
 4748|    418|                NEXTL(1);
  ------------------
  |  | 2325|    418|#define NEXTL(l) do {							\
  |  | 2326|    418|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 418]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|    418|    } else ctxt->input->col++;						\
  |  | 2329|    418|    ctxt->input->cur += l;				\
  |  | 2330|    418|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 418]
  |  |  ------------------
  ------------------
 4749|    418|            }
 4750|  7.67M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4750:20): [True: 7.62M, False: 50.9k]
  |  Branch (4750:36): [True: 7.62M, False: 5.74k]
  |  Branch (4750:52): [True: 7.62M, False: 640]
  ------------------
 4751|       |            /* Generate the error and skip the offending character */
 4752|  7.62M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4753|  7.62M|                              "PCDATA invalid Char value %d\n", cur);
 4754|  7.62M|            NEXTL(l);
  ------------------
  |  | 2325|  7.62M|#define NEXTL(l) do {							\
  |  | 2326|  7.62M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 7.62M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  7.62M|    } else ctxt->input->col++;						\
  |  | 2329|  7.62M|    ctxt->input->cur += l;				\
  |  | 2330|  7.62M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 7.62M]
  |  |  ------------------
  ------------------
 4755|  7.62M|        }
 4756|  7.67M|    }
 4757|  7.68M|}
parser.c:xmlFatalErrMsgStr:
  348|   625k|{
  349|   625k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   625k|               val, NULL, NULL, 0, msg, val);
  351|   625k|}
parser.c:xmlParseCommentComplex:
 4856|   150k|                       size_t len, size_t size) {
 4857|   150k|    int q, ql;
 4858|   150k|    int r, rl;
 4859|   150k|    int cur, l;
 4860|   150k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4860:21): [True: 46.7k, False: 104k]
  ------------------
 4861|  46.7k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  46.7k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4862|   150k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   104k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4863|       |
 4864|   150k|    if (buf == NULL) {
  ------------------
  |  Branch (4864:9): [True: 24.3k, False: 126k]
  ------------------
 4865|  24.3k|        len = 0;
 4866|  24.3k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  24.3k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4867|  24.3k|	buf = xmlMalloc(size);
 4868|  24.3k|	if (buf == NULL) {
  ------------------
  |  Branch (4868:6): [True: 4, False: 24.3k]
  ------------------
 4869|      4|	    xmlErrMemory(ctxt);
 4870|      4|	    return;
 4871|      4|	}
 4872|  24.3k|    }
 4873|   150k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4874|   150k|    if (q == 0)
  ------------------
  |  Branch (4874:9): [True: 2.45k, False: 148k]
  ------------------
 4875|  2.45k|        goto not_terminated;
 4876|   148k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   148k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   148k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 66.2k, False: 82.0k]
  |  |  |  |  ------------------
  |  |  |  |  118|   148k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  66.2k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 65.8k, False: 445]
  |  |  |  |  |  |  |  Branch (108:44): [True: 63.1k, False: 2.64k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  66.2k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 3.08k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  66.2k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.46k, False: 619]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   148k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 82.0k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 9.58k, False: 72.5k]
  |  |  |  |  ------------------
  |  |  |  |  120|  82.0k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 72.5k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 72.0k, False: 482]
  |  |  |  |  ------------------
  |  |  |  |  121|  82.0k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 285, False: 197]
  |  |  |  |  |  Branch (121:27): [True: 285, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4876:9): [True: 816, False: 147k]
  ------------------
 4877|    816|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4878|    816|                          "xmlParseComment: invalid xmlChar value %d\n",
 4879|    816|	                  q);
 4880|    816|	xmlFree (buf);
 4881|    816|	return;
 4882|    816|    }
 4883|   147k|    NEXTL(ql);
  ------------------
  |  | 2325|   147k|#define NEXTL(l) do {							\
  |  | 2326|   147k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 299, False: 147k]
  |  |  ------------------
  |  | 2327|    299|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   147k|    } else ctxt->input->col++;						\
  |  | 2329|   147k|    ctxt->input->cur += l;				\
  |  | 2330|   147k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 147k]
  |  |  ------------------
  ------------------
 4884|   147k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4885|   147k|    if (r == 0)
  ------------------
  |  Branch (4885:9): [True: 486, False: 147k]
  ------------------
 4886|    486|        goto not_terminated;
 4887|   147k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   147k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   147k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 107k, False: 39.4k]
  |  |  |  |  ------------------
  |  |  |  |  118|   147k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   107k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 107k, False: 328]
  |  |  |  |  |  |  |  Branch (108:44): [True: 89.0k, False: 18.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   107k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   107k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 18.2k, False: 349]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   147k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 39.4k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.15k, False: 36.2k]
  |  |  |  |  ------------------
  |  |  |  |  120|  39.4k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 36.2k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 34.0k, False: 2.22k]
  |  |  |  |  ------------------
  |  |  |  |  121|  39.4k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.96k, False: 265]
  |  |  |  |  |  Branch (121:27): [True: 1.96k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4887:9): [True: 614, False: 146k]
  ------------------
 4888|    614|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4889|    614|                          "xmlParseComment: invalid xmlChar value %d\n",
 4890|    614|	                  r);
 4891|    614|	xmlFree (buf);
 4892|    614|	return;
 4893|    614|    }
 4894|   146k|    NEXTL(rl);
  ------------------
  |  | 2325|   146k|#define NEXTL(l) do {							\
  |  | 2326|   146k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 29.9k, False: 116k]
  |  |  ------------------
  |  | 2327|  29.9k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   116k|    } else ctxt->input->col++;						\
  |  | 2329|   146k|    ctxt->input->cur += l;				\
  |  | 2330|   146k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 146k]
  |  |  ------------------
  ------------------
 4895|   146k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4896|   146k|    if (cur == 0)
  ------------------
  |  Branch (4896:9): [True: 453, False: 145k]
  ------------------
 4897|    453|        goto not_terminated;
 4898|  28.2M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  28.2M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  56.4M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 28.2M, False: 5.05k]
  |  |  |  |  |  Branch (117:25): [True: 19.4M, False: 8.83M]
  |  |  |  |  ------------------
  |  |  |  |  118|  56.4M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  19.4M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 19.4M, False: 4.62k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 9.85M, False: 9.54M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  19.4M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 9.55M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  19.4M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 9.54M, False: 4.72k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  56.4M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 8.83M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 35.1k, False: 8.80M]
  |  |  |  |  ------------------
  |  |  |  |  120|  8.83M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 8.80M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 8.80M, False: 1.34k]
  |  |  |  |  ------------------
  |  |  |  |  121|  8.83M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.01k, False: 327]
  |  |  |  |  |  Branch (121:27): [True: 1.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4899|  28.2M|           ((cur != '>') ||
  ------------------
  |  Branch (4899:13): [True: 27.8M, False: 388k]
  ------------------
 4900|  28.1M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4900:6): [True: 197k, False: 191k]
  |  Branch (4900:20): [True: 50.4k, False: 140k]
  ------------------
 4901|  28.1M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4901:6): [True: 796k, False: 27.3M]
  |  Branch (4901:20): [True: 407k, False: 389k]
  ------------------
 4902|   407k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4903|   407k|	}
 4904|  28.1M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4904:6): [True: 87.8k, False: 28.0M]
  ------------------
 4905|  87.8k|	    xmlChar *tmp;
 4906|  87.8k|            int newSize;
 4907|       |
 4908|  87.8k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4909|  87.8k|            if (newSize < 0) {
  ------------------
  |  Branch (4909:17): [True: 0, False: 87.8k]
  ------------------
 4910|      0|                xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4911|      0|                             "Comment too big found", NULL);
 4912|      0|                xmlFree (buf);
 4913|      0|                return;
 4914|      0|            }
 4915|  87.8k|	    tmp = xmlRealloc(buf, newSize);
 4916|  87.8k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4916:10): [True: 3, False: 87.8k]
  ------------------
 4917|      3|		xmlErrMemory(ctxt);
 4918|      3|		xmlFree(buf);
 4919|      3|		return;
 4920|      3|	    }
 4921|  87.8k|	    buf = tmp;
 4922|  87.8k|            size = newSize;
 4923|  87.8k|	}
 4924|  28.1M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2333|  28.1M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 18.6M, False: 9.42M]
  |  |  ------------------
  |  | 2334|  28.1M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4925|       |
 4926|  28.1M|	q = r;
 4927|  28.1M|	ql = rl;
 4928|  28.1M|	r = cur;
 4929|  28.1M|	rl = l;
 4930|       |
 4931|  28.1M|	NEXTL(l);
  ------------------
  |  | 2325|  28.1M|#define NEXTL(l) do {							\
  |  | 2326|  28.1M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 9.26M, False: 18.8M]
  |  |  ------------------
  |  | 2327|  9.26M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  18.8M|    } else ctxt->input->col++;						\
  |  | 2329|  28.1M|    ctxt->input->cur += l;				\
  |  | 2330|  28.1M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 28.1M]
  |  |  ------------------
  ------------------
 4932|  28.1M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4933|       |
 4934|  28.1M|    }
 4935|   145k|    buf[len] = 0;
 4936|   145k|    if (cur == 0) {
  ------------------
  |  Branch (4936:9): [True: 4.10k, False: 141k]
  ------------------
 4937|  4.10k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4938|  4.10k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4939|   141k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   141k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   141k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 141k, False: 327]
  |  |  |  |  ------------------
  |  |  |  |  118|   141k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   141k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 141k, False: 513]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   141k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   141k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 140k, False: 619]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   141k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 327, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 327]
  |  |  |  |  ------------------
  |  |  |  |  120|    327|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 327, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 327]
  |  |  |  |  ------------------
  |  |  |  |  121|    327|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 327]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4939:16): [True: 946, False: 140k]
  ------------------
 4940|    946|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4941|    946|                          "xmlParseComment: invalid xmlChar value %d\n",
 4942|    946|	                  cur);
 4943|   140k|    } else {
 4944|   140k|        NEXT;
  ------------------
  |  | 2316|   140k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4945|   140k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4945:6): [True: 140k, False: 0]
  |  Branch (4945:29): [True: 140k, False: 0]
  ------------------
 4946|   140k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4946:6): [True: 133k, False: 7.49k]
  ------------------
 4947|   133k|	    ctxt->sax->comment(ctxt->userData, buf);
 4948|   140k|    }
 4949|   145k|    xmlFree(buf);
 4950|   145k|    return;
 4951|  3.39k|not_terminated:
 4952|  3.39k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4953|       |			 "Comment not terminated\n", NULL);
 4954|  3.39k|    xmlFree(buf);
 4955|  3.39k|}
parser.c:xmlNsErr:
  384|   195k|{
  385|   195k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   195k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   195k|}
parser.c:xmlSkipBlankCharsPE:
 2437|  1.42M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2438|  1.42M|    int res = 0;
 2439|  1.42M|    int inParam;
 2440|  1.42M|    int expandParam;
 2441|       |
 2442|  1.42M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.42M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 1.20M, False: 224k]
  |  |  ------------------
  |  |   51|  1.42M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 218k, False: 985k]
  |  |  ------------------
  |  |   52|  1.20M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 985k, False: 0]
  |  |  ------------------
  ------------------
 2443|  1.42M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.42M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 236k, False: 1.19M]
  |  |  ------------------
  |  |   56|  1.42M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 1.01M, False: 174k]
  |  |  ------------------
  |  |   57|  1.19M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 982k, False: 34.4k]
  |  |  ------------------
  ------------------
 2444|       |
 2445|  1.42M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2445:9): [True: 224k, False: 1.20M]
  |  Branch (2445:21): [True: 174k, False: 49.9k]
  ------------------
 2446|   174k|        return(xmlSkipBlankChars(ctxt));
 2447|       |
 2448|       |    /*
 2449|       |     * It's Okay to use CUR/NEXT here since all the blanks are on
 2450|       |     * the ASCII range.
 2451|       |     */
 2452|  2.54M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.54M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2452:12): [True: 2.54M, False: 378]
  ------------------
 2453|  2.54M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.54M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.54M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 935k, False: 1.60M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.54M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.53M, False: 79.2k]
  |  |  |  |  |  Branch (91:23): [True: 268k, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.54M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 48.0k, False: 1.29M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|  1.25M|            NEXT;
  ------------------
  |  | 2316|  1.25M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2455|  1.29M|        } else if (CUR == '%') {
  ------------------
  |  | 2262|  1.29M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2455:20): [True: 105k, False: 1.18M]
  ------------------
 2456|   105k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2456:17): [True: 22, False: 105k]
  ------------------
 2457|   105k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|   105k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   105k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 75.5k, False: 29.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|   105k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 27.7k, False: 1.74k]
  |  |  |  |  |  Branch (91:23): [True: 477, False: 27.2k]
  |  |  |  |  ------------------
  |  |  |  |   92|   105k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 20, False: 29.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2263|  29.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2457:42): [True: 1.74k, False: 27.2k]
  ------------------
 2458|  77.8k|                break;
 2459|       |
 2460|       |            /*
 2461|       |             * Expand parameter entity. We continue to consume
 2462|       |             * whitespace at the start of the entity and possible
 2463|       |             * even consume the whole entity and pop it. We might
 2464|       |             * even pop multiple PEs in this loop.
 2465|       |             */
 2466|  27.2k|            xmlParsePERefInternal(ctxt, 0);
 2467|       |
 2468|  27.2k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  27.2k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 26.4k, False: 782]
  |  |  ------------------
  |  |   51|  27.2k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 6.55k, False: 19.9k]
  |  |  ------------------
  |  |   52|  26.4k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 19.9k, False: 0]
  |  |  ------------------
  ------------------
 2469|  27.2k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  27.2k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 5.65k, False: 21.6k]
  |  |  ------------------
  |  |   56|  27.2k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 21.6k, False: 0]
  |  |  ------------------
  |  |   57|  21.6k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 18.3k, False: 3.23k]
  |  |  ------------------
  ------------------
 2470|  1.18M|        } else if (CUR == 0) {
  ------------------
  |  | 2262|  1.18M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2470:20): [True: 79.2k, False: 1.10M]
  ------------------
 2471|  79.2k|            if (inParam == 0)
  ------------------
  |  Branch (2471:17): [True: 200, False: 79.0k]
  ------------------
 2472|    200|                break;
 2473|       |
 2474|       |            /*
 2475|       |             * Don't pop parameter entities that start a markup
 2476|       |             * declaration to detect Well-formedness constraint:
 2477|       |             * PE Between Declarations.
 2478|       |             */
 2479|  79.0k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  79.0k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2479:17): [True: 66.6k, False: 12.3k]
  ------------------
 2480|  66.6k|                break;
 2481|       |
 2482|  12.3k|            xmlPopPE(ctxt);
 2483|       |
 2484|  12.3k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  12.3k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 9.02k, False: 3.34k]
  |  |  ------------------
  |  |   51|  12.3k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3, False: 9.02k]
  |  |  ------------------
  |  |   52|  9.02k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 9.02k, False: 0]
  |  |  ------------------
  ------------------
 2485|  12.3k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  12.3k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.93k, False: 8.43k]
  |  |  ------------------
  |  |   56|  12.3k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 8.43k, False: 3]
  |  |  ------------------
  |  |   57|  8.43k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 8.43k, False: 0]
  |  |  ------------------
  ------------------
 2486|  1.10M|        } else {
 2487|  1.10M|            break;
 2488|  1.10M|        }
 2489|       |
 2490|       |        /*
 2491|       |         * Also increase the counter when entering or exiting a PERef.
 2492|       |         * The spec says: "When a parameter-entity reference is recognized
 2493|       |         * in the DTD and included, its replacement text MUST be enlarged
 2494|       |         * by the attachment of one leading and one following space (#x20)
 2495|       |         * character."
 2496|       |         */
 2497|  1.29M|        if (res < INT_MAX)
  ------------------
  |  Branch (2497:13): [True: 1.29M, False: 0]
  ------------------
 2498|  1.29M|            res++;
 2499|  1.29M|    }
 2500|       |
 2501|  1.25M|    return(res);
 2502|  1.42M|}
parser.c:xmlValidityError:
  294|   300k|{
  295|   300k|    ctxt->valid = 0;
  296|       |
  297|   300k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   300k|}
parser.c:xmlAddDefAttrs:
 1057|  22.2k|               const xmlChar *value) {
 1058|  22.2k|    xmlDefAttrsPtr defaults;
 1059|  22.2k|    xmlDefAttr *attr;
 1060|  22.2k|    int len, expandedSize;
 1061|  22.2k|    xmlHashedString name;
 1062|  22.2k|    xmlHashedString prefix;
 1063|  22.2k|    xmlHashedString hvalue;
 1064|  22.2k|    const xmlChar *localname;
 1065|       |
 1066|       |    /*
 1067|       |     * Allows to detect attribute redefinitions
 1068|       |     */
 1069|  22.2k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1069:9): [True: 19.2k, False: 2.99k]
  ------------------
 1070|  19.2k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1070:13): [True: 10.9k, False: 8.29k]
  ------------------
 1071|  10.9k|	    return;
 1072|  19.2k|    }
 1073|       |
 1074|  11.2k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1074:9): [True: 3.10k, False: 8.18k]
  ------------------
 1075|  3.10k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1076|  3.10k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1076:6): [True: 2, False: 3.10k]
  ------------------
 1077|      2|	    goto mem_error;
 1078|  3.10k|    }
 1079|       |
 1080|       |    /*
 1081|       |     * split the element name into prefix:localname , the string found
 1082|       |     * are within the DTD and then not associated to namespace names.
 1083|       |     */
 1084|  11.2k|    localname = xmlSplitQName3(fullname, &len);
 1085|  11.2k|    if (localname == NULL) {
  ------------------
  |  Branch (1085:9): [True: 10.5k, False: 758]
  ------------------
 1086|  10.5k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1087|  10.5k|	prefix.name = NULL;
 1088|  10.5k|    } else {
 1089|    758|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1090|    758|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1091|    758|        if (prefix.name == NULL)
  ------------------
  |  Branch (1091:13): [True: 1, False: 757]
  ------------------
 1092|      1|            goto mem_error;
 1093|    758|    }
 1094|  11.2k|    if (name.name == NULL)
  ------------------
  |  Branch (1094:9): [True: 2, False: 11.2k]
  ------------------
 1095|      2|        goto mem_error;
 1096|       |
 1097|       |    /*
 1098|       |     * make sure there is some storage
 1099|       |     */
 1100|  11.2k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1101|  11.2k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1101:9): [True: 3.74k, False: 7.54k]
  ------------------
 1102|  7.54k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1102:9): [True: 751, False: 6.78k]
  ------------------
 1103|  4.50k|        xmlDefAttrsPtr temp;
 1104|  4.50k|        int newSize;
 1105|       |
 1106|  4.50k|        if (defaults == NULL) {
  ------------------
  |  Branch (1106:13): [True: 3.74k, False: 751]
  ------------------
 1107|  3.74k|            newSize = 4;
 1108|  3.74k|        } else {
 1109|    751|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    751|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1109:17): [True: 0, False: 751]
  ------------------
 1110|    751|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1110:17): [True: 0, False: 751]
  ------------------
 1111|    751|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1112|      0|                goto mem_error;
 1113|       |
 1114|    751|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    751|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1114:17): [True: 0, False: 751]
  ------------------
 1115|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1116|    751|            else
 1117|    751|                newSize = defaults->maxAttrs * 2;
 1118|    751|        }
 1119|  4.50k|        temp = xmlRealloc(defaults,
 1120|  4.50k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1121|  4.50k|	if (temp == NULL)
  ------------------
  |  Branch (1121:6): [True: 4, False: 4.49k]
  ------------------
 1122|      4|	    goto mem_error;
 1123|  4.49k|        if (defaults == NULL)
  ------------------
  |  Branch (1123:13): [True: 3.74k, False: 751]
  ------------------
 1124|  3.74k|            temp->nbAttrs = 0;
 1125|  4.49k|	temp->maxAttrs = newSize;
 1126|  4.49k|        defaults = temp;
 1127|  4.49k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1127:6): [True: 1, False: 4.49k]
  ------------------
 1128|  4.49k|	                        defaults, NULL) < 0) {
 1129|      1|	    xmlFree(defaults);
 1130|      1|	    goto mem_error;
 1131|      1|	}
 1132|  4.49k|    }
 1133|       |
 1134|       |    /*
 1135|       |     * Split the attribute name into prefix:localname , the string found
 1136|       |     * are within the DTD and hen not associated to namespace names.
 1137|       |     */
 1138|  11.2k|    localname = xmlSplitQName3(fullattr, &len);
 1139|  11.2k|    if (localname == NULL) {
  ------------------
  |  Branch (1139:9): [True: 7.83k, False: 3.45k]
  ------------------
 1140|  7.83k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1141|  7.83k|	prefix.name = NULL;
 1142|  7.83k|    } else {
 1143|  3.45k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1144|  3.45k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1145|  3.45k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1145:13): [True: 1, False: 3.45k]
  ------------------
 1146|      1|            goto mem_error;
 1147|  3.45k|    }
 1148|  11.2k|    if (name.name == NULL)
  ------------------
  |  Branch (1148:9): [True: 2, False: 11.2k]
  ------------------
 1149|      2|        goto mem_error;
 1150|       |
 1151|       |    /* intern the string and precompute the end */
 1152|  11.2k|    len = strlen((const char *) value);
 1153|  11.2k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1154|  11.2k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1154:9): [True: 1, False: 11.2k]
  ------------------
 1155|      1|        goto mem_error;
 1156|       |
 1157|  11.2k|    expandedSize = strlen((const char *) name.name);
 1158|  11.2k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1158:9): [True: 3.44k, False: 7.83k]
  ------------------
 1159|  3.44k|        expandedSize += strlen((const char *) prefix.name);
 1160|  11.2k|    expandedSize += len;
 1161|       |
 1162|  11.2k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1163|  11.2k|    attr->name = name;
 1164|  11.2k|    attr->prefix = prefix;
 1165|  11.2k|    attr->value = hvalue;
 1166|  11.2k|    attr->valueEnd = hvalue.name + len;
 1167|  11.2k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  11.2k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 694, False: 10.5k]
  |  |  ------------------
  |  |   56|  11.2k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 658, False: 9.92k]
  |  |  ------------------
  |  |   57|  10.5k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 599, False: 59]
  |  |  ------------------
  ------------------
 1168|  11.2k|    attr->expandedSize = expandedSize;
 1169|       |
 1170|  11.2k|    return;
 1171|       |
 1172|     14|mem_error:
 1173|     14|    xmlErrMemory(ctxt);
 1174|     14|}
parser.c:xmlAddSpecialAttr:
 1189|  61.9k|{
 1190|  61.9k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1190:9): [True: 3.79k, False: 58.1k]
  ------------------
 1191|  3.79k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1192|  3.79k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1192:6): [True: 3, False: 3.78k]
  ------------------
 1193|      3|	    goto mem_error;
 1194|  3.79k|    }
 1195|       |
 1196|  61.9k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  61.9k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 29.2k, False: 32.7k]
  |  |  ------------------
  |  |   56|  61.9k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 21.1k, False: 11.6k]
  |  |  ------------------
  |  |   57|  32.7k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 17.0k, False: 4.01k]
  |  |  ------------------
  ------------------
 1197|  46.3k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  46.3k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1198|       |
 1199|  61.9k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1199:9): [True: 1, False: 61.9k]
  ------------------
 1200|  61.9k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  61.9k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1201|      1|        goto mem_error;
 1202|  61.9k|    return;
 1203|       |
 1204|  61.9k|mem_error:
 1205|      4|    xmlErrMemory(ctxt);
 1206|      4|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6124|   877k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6125|   877k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   877k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6126|   877k|    GROW;
  ------------------
  |  | 2308|   877k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   877k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   877k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 96.0k, False: 781k]
  |  |  ------------------
  |  | 2309|   877k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  96.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 63.4k, False: 32.5k]
  |  |  ------------------
  |  | 2310|   877k|	xmlParserGrow(ctxt);
  ------------------
 6127|       |
 6128|   877k|    (void) openInputNr;
 6129|       |
 6130|   877k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|  1.75M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 33.4k, False: 843k]
  |  |  ------------------
  |  |   56|  1.75M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 61.4k, False: 782k]
  |  |  ------------------
  |  |   57|   843k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 36.7k, False: 24.6k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   806k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 24.6k, False: 782k]
  |  |  ------------------
  |  |   51|   806k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 24.6k, False: 0]
  |  |  ------------------
  |  |   52|  24.6k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6131|   782k|        return;
 6132|       |
 6133|   104k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   104k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6133:12): [True: 104k, False: 242]
  ------------------
 6134|   104k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6134:13): [True: 3.84k, False: 100k]
  ------------------
 6135|  3.84k|#ifdef LIBXML_VALID_ENABLED
 6136|  3.84k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6136:17): [True: 2.79k, False: 1.05k]
  |  Branch (6136:37): [True: 1.37k, False: 1.41k]
  ------------------
 6137|  1.37k|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6138|  1.37k|                                 "Element content declaration doesn't start "
 6139|  1.37k|                                 "and stop in the same entity\n",
 6140|  1.37k|                                 NULL, NULL);
 6141|  1.37k|            }
 6142|  3.84k|#endif
 6143|  3.84k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  3.84k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 3.78k, False: 59]
  |  |  ------------------
  |  |   51|  3.84k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 1.45k, False: 2.33k]
  |  |  ------------------
  |  |   52|  3.78k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 2.33k, False: 0]
  |  |  ------------------
  ------------------
 6144|  3.78k|                xmlPopPE(ctxt);
 6145|     59|            else
 6146|     59|                break;
 6147|   100k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|   100k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6147:20): [True: 5.54k, False: 94.6k]
  ------------------
 6148|  5.54k|            xmlParsePERefInternal(ctxt, 0);
 6149|  94.6k|        } else {
 6150|  94.6k|            break;
 6151|  94.6k|        }
 6152|       |
 6153|  9.33k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  9.33k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6154|  9.33k|        GROW;
  ------------------
  |  | 2308|  9.33k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  9.33k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  9.33k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.42k, False: 907]
  |  |  ------------------
  |  | 2309|  9.33k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.42k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.65k, False: 1.77k]
  |  |  ------------------
  |  | 2310|  9.33k|	xmlParserGrow(ctxt);
  ------------------
 6155|  9.33k|    }
 6156|  94.9k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6308|   107k|                                       int depth) {
 6309|   107k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6309:20): [True: 89.5k, False: 17.6k]
  ------------------
 6310|   107k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6311|   107k|    const xmlChar *elem;
 6312|   107k|    xmlChar type = 0;
 6313|       |
 6314|   107k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6314:9): [True: 2, False: 107k]
  ------------------
 6315|      2|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6316|      2|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6317|      2|                "use XML_PARSE_HUGE\n", depth);
 6318|      2|	return(NULL);
 6319|      2|    }
 6320|   107k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|   107k|    if (RAW == '(') {
  ------------------
  |  | 2261|   107k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:9): [True: 27.6k, False: 79.6k]
  ------------------
 6322|  27.6k|        int newInputNr = ctxt->inputNr;
 6323|       |
 6324|       |        /* Recurse on first child */
 6325|  27.6k|	NEXT;
  ------------------
  |  | 2316|  27.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6326|  27.6k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6327|  27.6k|                                                           depth + 1);
 6328|  27.6k|        if (cur == NULL)
  ------------------
  |  Branch (6328:13): [True: 25.8k, False: 1.80k]
  ------------------
 6329|  25.8k|            return(NULL);
 6330|  79.6k|    } else {
 6331|  79.6k|	elem = xmlParseName(ctxt);
 6332|  79.6k|	if (elem == NULL) {
  ------------------
  |  Branch (6332:6): [True: 429, False: 79.2k]
  ------------------
 6333|    429|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6334|    429|	    return(NULL);
 6335|    429|	}
 6336|  79.2k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6337|  79.2k|	if (cur == NULL) {
  ------------------
  |  Branch (6337:6): [True: 2, False: 79.2k]
  ------------------
 6338|      2|	    xmlErrMemory(ctxt);
 6339|      2|	    return(NULL);
 6340|      2|	}
 6341|  79.2k|	GROW;
  ------------------
  |  | 2308|  79.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  79.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  79.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.06k, False: 71.1k]
  |  |  ------------------
  |  | 2309|  79.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.06k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.26k, False: 3.80k]
  |  |  ------------------
  |  | 2310|  79.2k|	xmlParserGrow(ctxt);
  ------------------
 6342|  79.2k|	if (RAW == '?') {
  ------------------
  |  | 2261|  79.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6342:6): [True: 1.51k, False: 77.7k]
  ------------------
 6343|  1.51k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6344|  1.51k|	    NEXT;
  ------------------
  |  | 2316|  1.51k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6345|  77.7k|	} else if (RAW == '*') {
  ------------------
  |  | 2261|  77.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6345:13): [True: 2.06k, False: 75.6k]
  ------------------
 6346|  2.06k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6347|  2.06k|	    NEXT;
  ------------------
  |  | 2316|  2.06k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6348|  75.6k|	} else if (RAW == '+') {
  ------------------
  |  | 2261|  75.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6348:13): [True: 781, False: 74.8k]
  ------------------
 6349|    781|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6350|    781|	    NEXT;
  ------------------
  |  | 2316|    781|#define NEXT xmlNextChar(ctxt)
  ------------------
 6351|  74.8k|	} else {
 6352|  74.8k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6353|  74.8k|	}
 6354|  79.2k|	GROW;
  ------------------
  |  | 2308|  79.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  79.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  79.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.06k, False: 71.1k]
  |  |  ------------------
  |  | 2309|  79.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.06k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.26k, False: 3.80k]
  |  |  ------------------
  |  | 2310|  79.2k|	xmlParserGrow(ctxt);
  ------------------
 6355|  79.2k|    }
 6356|   391k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   391k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6356:12): [True: 389k, False: 1.53k]
  ------------------
 6357|   389k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6358|   389k|        if (RAW == ')')
  ------------------
  |  | 2261|   389k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6358:13): [True: 76.4k, False: 313k]
  ------------------
 6359|  76.4k|            break;
 6360|       |        /*
 6361|       |	 * Each loop we parse one separator and one element.
 6362|       |	 */
 6363|   313k|        if (RAW == ',') {
  ------------------
  |  | 2261|   313k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6363:13): [True: 199k, False: 113k]
  ------------------
 6364|   199k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  14.5k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6364:10): [True: 14.5k, False: 185k]
  ------------------
 6365|       |
 6366|       |	    /*
 6367|       |	     * Detect "Name | Name , Name" error
 6368|       |	     */
 6369|   185k|	    else if (type != CUR) {
  ------------------
  |  | 2262|   185k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6369:15): [True: 1, False: 185k]
  ------------------
 6370|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6371|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6372|      1|		                  type);
 6373|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6373:7): [True: 1, False: 0]
  |  Branch (6373:25): [True: 1, False: 0]
  ------------------
 6374|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6375|      1|		if (ret != NULL)
  ------------------
  |  Branch (6375:7): [True: 1, False: 0]
  ------------------
 6376|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6377|      1|		return(NULL);
 6378|      1|	    }
 6379|   199k|	    NEXT;
  ------------------
  |  | 2316|   199k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6380|       |
 6381|   199k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6382|   199k|	    if (op == NULL) {
  ------------------
  |  Branch (6382:10): [True: 3, False: 199k]
  ------------------
 6383|      3|                xmlErrMemory(ctxt);
 6384|      3|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6384:7): [True: 1, False: 2]
  |  Branch (6384:25): [True: 1, False: 0]
  ------------------
 6385|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6386|      3|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6387|      3|		return(NULL);
 6388|      3|	    }
 6389|   199k|	    if (last == NULL) {
  ------------------
  |  Branch (6389:10): [True: 14.5k, False: 185k]
  ------------------
 6390|  14.5k|		op->c1 = ret;
 6391|  14.5k|		if (ret != NULL)
  ------------------
  |  Branch (6391:7): [True: 14.5k, False: 0]
  ------------------
 6392|  14.5k|		    ret->parent = op;
 6393|  14.5k|		ret = cur = op;
 6394|   185k|	    } else {
 6395|   185k|	        cur->c2 = op;
 6396|   185k|		if (op != NULL)
  ------------------
  |  Branch (6396:7): [True: 185k, False: 0]
  ------------------
 6397|   185k|		    op->parent = cur;
 6398|   185k|		op->c1 = last;
 6399|   185k|		if (last != NULL)
  ------------------
  |  Branch (6399:7): [True: 185k, False: 0]
  ------------------
 6400|   185k|		    last->parent = op;
 6401|   185k|		cur =op;
 6402|   185k|		last = NULL;
 6403|   185k|	    }
 6404|   199k|	} else if (RAW == '|') {
  ------------------
  |  | 2261|   113k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6404:13): [True: 111k, False: 2.34k]
  ------------------
 6405|   111k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  47.9k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6405:10): [True: 47.9k, False: 63.2k]
  ------------------
 6406|       |
 6407|       |	    /*
 6408|       |	     * Detect "Name , Name | Name" error
 6409|       |	     */
 6410|  63.2k|	    else if (type != CUR) {
  ------------------
  |  | 2262|  63.2k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6410:15): [True: 2, False: 63.2k]
  ------------------
 6411|      2|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6412|      2|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6413|      2|				  type);
 6414|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6414:7): [True: 2, False: 0]
  |  Branch (6414:25): [True: 2, False: 0]
  ------------------
 6415|      2|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6416|      2|		if (ret != NULL)
  ------------------
  |  Branch (6416:7): [True: 2, False: 0]
  ------------------
 6417|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6418|      2|		return(NULL);
 6419|      2|	    }
 6420|   111k|	    NEXT;
  ------------------
  |  | 2316|   111k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6421|       |
 6422|   111k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6423|   111k|	    if (op == NULL) {
  ------------------
  |  Branch (6423:10): [True: 2, False: 111k]
  ------------------
 6424|      2|                xmlErrMemory(ctxt);
 6425|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6425:7): [True: 1, False: 1]
  |  Branch (6425:25): [True: 1, False: 0]
  ------------------
 6426|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6427|      2|		if (ret != NULL)
  ------------------
  |  Branch (6427:7): [True: 2, False: 0]
  ------------------
 6428|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6429|      2|		return(NULL);
 6430|      2|	    }
 6431|   111k|	    if (last == NULL) {
  ------------------
  |  Branch (6431:10): [True: 47.9k, False: 63.2k]
  ------------------
 6432|  47.9k|		op->c1 = ret;
 6433|  47.9k|		if (ret != NULL)
  ------------------
  |  Branch (6433:7): [True: 47.9k, False: 0]
  ------------------
 6434|  47.9k|		    ret->parent = op;
 6435|  47.9k|		ret = cur = op;
 6436|  63.2k|	    } else {
 6437|  63.2k|	        cur->c2 = op;
 6438|  63.2k|		if (op != NULL)
  ------------------
  |  Branch (6438:7): [True: 63.2k, False: 0]
  ------------------
 6439|  63.2k|		    op->parent = cur;
 6440|  63.2k|		op->c1 = last;
 6441|  63.2k|		if (last != NULL)
  ------------------
  |  Branch (6441:7): [True: 63.2k, False: 0]
  ------------------
 6442|  63.2k|		    last->parent = op;
 6443|  63.2k|		cur =op;
 6444|  63.2k|		last = NULL;
 6445|  63.2k|	    }
 6446|   111k|	} else {
 6447|  2.34k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6448|  2.34k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6448:10): [True: 1.08k, False: 1.26k]
  |  Branch (6448:28): [True: 1.08k, False: 0]
  ------------------
 6449|  1.08k|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6450|  2.34k|	    if (ret != NULL)
  ------------------
  |  Branch (6450:10): [True: 2.34k, False: 0]
  ------------------
 6451|  2.34k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6452|  2.34k|	    return(NULL);
 6453|  2.34k|	}
 6454|   310k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6455|   310k|        if (RAW == '(') {
  ------------------
  |  | 2261|   310k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6455:13): [True: 68.6k, False: 242k]
  ------------------
 6456|  68.6k|            int newInputNr = ctxt->inputNr;
 6457|       |
 6458|       |	    /* Recurse on second child */
 6459|  68.6k|	    NEXT;
  ------------------
  |  | 2316|  68.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6460|  68.6k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6461|  68.6k|                                                          depth + 1);
 6462|  68.6k|            if (last == NULL) {
  ------------------
  |  Branch (6462:17): [True: 352, False: 68.3k]
  ------------------
 6463|    352|		if (ret != NULL)
  ------------------
  |  Branch (6463:7): [True: 352, False: 0]
  ------------------
 6464|    352|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6465|    352|		return(NULL);
 6466|    352|            }
 6467|   242k|	} else {
 6468|   242k|	    elem = xmlParseName(ctxt);
 6469|   242k|	    if (elem == NULL) {
  ------------------
  |  Branch (6469:10): [True: 345, False: 241k]
  ------------------
 6470|    345|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6471|    345|		if (ret != NULL)
  ------------------
  |  Branch (6471:7): [True: 345, False: 0]
  ------------------
 6472|    345|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6473|    345|		return(NULL);
 6474|    345|	    }
 6475|   241k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6476|   241k|	    if (last == NULL) {
  ------------------
  |  Branch (6476:10): [True: 4, False: 241k]
  ------------------
 6477|      4|                xmlErrMemory(ctxt);
 6478|      4|		if (ret != NULL)
  ------------------
  |  Branch (6478:7): [True: 4, False: 0]
  ------------------
 6479|      4|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6480|      4|		return(NULL);
 6481|      4|	    }
 6482|   241k|	    if (RAW == '?') {
  ------------------
  |  | 2261|   241k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:10): [True: 25.3k, False: 216k]
  ------------------
 6483|  25.3k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6484|  25.3k|		NEXT;
  ------------------
  |  | 2316|  25.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6485|   216k|	    } else if (RAW == '*') {
  ------------------
  |  | 2261|   216k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6485:17): [True: 17.6k, False: 198k]
  ------------------
 6486|  17.6k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6487|  17.6k|		NEXT;
  ------------------
  |  | 2316|  17.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6488|   198k|	    } else if (RAW == '+') {
  ------------------
  |  | 2261|   198k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6488:17): [True: 26.3k, False: 172k]
  ------------------
 6489|  26.3k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6490|  26.3k|		NEXT;
  ------------------
  |  | 2316|  26.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6491|   172k|	    } else {
 6492|   172k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6493|   172k|	    }
 6494|   241k|	}
 6495|   310k|    }
 6496|  77.9k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6496:9): [True: 77.9k, False: 0]
  |  Branch (6496:26): [True: 60.6k, False: 17.3k]
  ------------------
 6497|  60.6k|        cur->c2 = last;
 6498|  60.6k|	if (last != NULL)
  ------------------
  |  Branch (6498:6): [True: 60.6k, False: 0]
  ------------------
 6499|  60.6k|	    last->parent = cur;
 6500|  60.6k|    }
 6501|  77.9k|#ifdef LIBXML_VALID_ENABLED
 6502|  77.9k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6502:9): [True: 73.2k, False: 4.73k]
  |  Branch (6502:29): [True: 102, False: 73.1k]
  ------------------
 6503|    102|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6504|    102|                         "Element content declaration doesn't start "
 6505|    102|                         "and stop in the same entity\n",
 6506|    102|                         NULL, NULL);
 6507|    102|    }
 6508|  77.9k|#endif
 6509|  77.9k|    NEXT;
  ------------------
  |  | 2316|  77.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6510|  77.9k|    if (RAW == '?') {
  ------------------
  |  | 2261|  77.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6510:9): [True: 12.5k, False: 65.4k]
  ------------------
 6511|  12.5k|	if (ret != NULL) {
  ------------------
  |  Branch (6511:6): [True: 12.5k, False: 0]
  ------------------
 6512|  12.5k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6512:10): [True: 59, False: 12.4k]
  ------------------
 6513|  12.4k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6513:10): [True: 76, False: 12.3k]
  ------------------
 6514|    135|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6515|  12.3k|	    else
 6516|  12.3k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6517|  12.5k|	}
 6518|  12.5k|	NEXT;
  ------------------
  |  | 2316|  12.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6519|  65.4k|    } else if (RAW == '*') {
  ------------------
  |  | 2261|  65.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6519:16): [True: 29.5k, False: 35.9k]
  ------------------
 6520|  29.5k|	if (ret != NULL) {
  ------------------
  |  Branch (6520:6): [True: 29.5k, False: 0]
  ------------------
 6521|  29.5k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6522|  29.5k|	    cur = ret;
 6523|       |	    /*
 6524|       |	     * Some normalization:
 6525|       |	     * (a | b* | c?)* == (a | b | c)*
 6526|       |	     */
 6527|  93.2k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6527:13): [True: 93.2k, False: 0]
  |  Branch (6527:30): [True: 63.6k, False: 29.5k]
  ------------------
 6528|  63.6k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6528:7): [True: 63.6k, False: 0]
  ------------------
 6529|  63.6k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6529:15): [True: 380, False: 63.3k]
  ------------------
 6530|  63.3k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6530:8): [True: 516, False: 62.7k]
  ------------------
 6531|    896|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6532|  63.6k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6532:7): [True: 63.6k, False: 0]
  ------------------
 6533|  63.6k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6533:15): [True: 130, False: 63.5k]
  ------------------
 6534|  63.5k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6534:8): [True: 94, False: 63.4k]
  ------------------
 6535|    224|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6536|  63.6k|		cur = cur->c2;
 6537|  63.6k|	    }
 6538|  29.5k|	}
 6539|  29.5k|	NEXT;
  ------------------
  |  | 2316|  29.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6540|  35.9k|    } else if (RAW == '+') {
  ------------------
  |  | 2261|  35.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6540:16): [True: 9.39k, False: 26.5k]
  ------------------
 6541|  9.39k|	if (ret != NULL) {
  ------------------
  |  Branch (6541:6): [True: 9.39k, False: 0]
  ------------------
 6542|  9.39k|	    int found = 0;
 6543|       |
 6544|  9.39k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6544:10): [True: 117, False: 9.27k]
  ------------------
 6545|  9.27k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6545:10): [True: 77, False: 9.20k]
  ------------------
 6546|    194|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6547|  9.20k|	    else
 6548|  9.20k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6549|       |	    /*
 6550|       |	     * Some normalization:
 6551|       |	     * (a | b*)+ == (a | b)*
 6552|       |	     * (a | b?)+ == (a | b)*
 6553|       |	     */
 6554|  18.7k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6554:13): [True: 18.7k, False: 0]
  |  Branch (6554:30): [True: 9.33k, False: 9.39k]
  ------------------
 6555|  9.33k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6555:7): [True: 9.33k, False: 0]
  ------------------
 6556|  9.33k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6556:15): [True: 272, False: 9.06k]
  ------------------
 6557|  9.06k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6557:8): [True: 366, False: 8.69k]
  ------------------
 6558|    638|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6559|    638|		    found = 1;
 6560|    638|		}
 6561|  9.33k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6561:7): [True: 9.33k, False: 0]
  ------------------
 6562|  9.33k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6562:15): [True: 80, False: 9.25k]
  ------------------
 6563|  9.25k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6563:8): [True: 18, False: 9.23k]
  ------------------
 6564|     98|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6565|     98|		    found = 1;
 6566|     98|		}
 6567|  9.33k|		cur = cur->c2;
 6568|  9.33k|	    }
 6569|  9.39k|	    if (found)
  ------------------
  |  Branch (6569:10): [True: 348, False: 9.04k]
  ------------------
 6570|    348|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6571|  9.39k|	}
 6572|  9.39k|	NEXT;
  ------------------
  |  | 2316|  9.39k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6573|  9.39k|    }
 6574|  77.9k|    return(ret);
 6575|  81.0k|}
parser.c:xmlCtxtInitializeLate:
  897|  55.3k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  898|  55.3k|    xmlSAXHandlerPtr sax;
  899|       |
  900|       |    /* Avoid unused variable warning if features are disabled. */
  901|  55.3k|    (void) sax;
  902|       |
  903|       |    /*
  904|       |     * Changing the SAX struct directly is still widespread practice
  905|       |     * in internal and external code.
  906|       |     */
  907|  55.3k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (907:9): [True: 0, False: 55.3k]
  ------------------
  908|  55.3k|    sax = ctxt->sax;
  909|  55.3k|#ifdef LIBXML_SAX1_ENABLED
  910|       |    /*
  911|       |     * Only enable SAX2 if there SAX2 element handlers, except when there
  912|       |     * are no element handlers at all.
  913|       |     */
  914|  55.3k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (914:9): [True: 32.3k, False: 23.0k]
  ------------------
  915|  32.3k|        (sax) &&
  ------------------
  |  Branch (915:9): [True: 32.3k, False: 0]
  ------------------
  916|  32.3k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  32.3k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (916:9): [True: 32.3k, False: 0]
  ------------------
  917|  32.3k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 32.3k, False: 0]
  ------------------
  918|      0|         (sax->endElementNs != NULL) ||
  ------------------
  |  Branch (918:10): [True: 0, False: 0]
  ------------------
  919|      0|         ((sax->startElement == NULL) && (sax->endElement == NULL))))
  ------------------
  |  Branch (919:11): [True: 0, False: 0]
  |  Branch (919:42): [True: 0, False: 0]
  ------------------
  920|  32.3k|        ctxt->sax2 = 1;
  921|       |#else
  922|       |    ctxt->sax2 = 1;
  923|       |#endif /* LIBXML_SAX1_ENABLED */
  924|       |
  925|       |    /*
  926|       |     * Some users replace the dictionary directly in the context struct.
  927|       |     * We really need an API function to do that cleanly.
  928|       |     */
  929|  55.3k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  55.3k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  55.3k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  55.3k|#define BAD_CAST (xmlChar *)
  ------------------
  931|  55.3k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  55.3k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  932|  55.3k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (932:9): [True: 11, False: 55.3k]
  |  Branch (932:34): [True: 0, False: 55.3k]
  ------------------
  933|  55.3k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (933:3): [True: 0, False: 55.3k]
  ------------------
  934|     11|        xmlErrMemory(ctxt);
  935|     11|    }
  936|       |
  937|  55.3k|    xmlDictSetLimit(ctxt->dict,
  938|  55.3k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (938:21): [True: 27.1k, False: 28.1k]
  ------------------
  939|  27.1k|                        0 :
  940|  55.3k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  83.4k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  941|       |
  942|  55.3k|#ifdef LIBXML_VALID_ENABLED
  943|  55.3k|    if (ctxt->validate)
  ------------------
  |  Branch (943:9): [True: 26.7k, False: 28.6k]
  ------------------
  944|  26.7k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  26.7k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  945|  28.6k|    else
  946|  28.6k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  28.6k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  947|  55.3k|#endif /* LIBXML_VALID_ENABLED */
  948|  55.3k|}
parser.c:xmlPopPE:
 2384|   133k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2385|   133k|    unsigned long consumed;
 2386|   133k|    xmlEntityPtr ent;
 2387|       |
 2388|   133k|    ent = ctxt->input->entity;
 2389|       |
 2390|   133k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   133k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2391|       |
 2392|   133k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   133k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2392:9): [True: 5.20k, False: 128k]
  ------------------
 2393|  5.20k|        int result;
 2394|       |
 2395|       |        /*
 2396|       |         * Read the rest of the stream in case of errors. We want
 2397|       |         * to account for the whole entity size.
 2398|       |         */
 2399|  5.40k|        do {
 2400|  5.40k|            ctxt->input->cur = ctxt->input->end;
 2401|  5.40k|            xmlParserShrink(ctxt);
 2402|  5.40k|            result = xmlParserGrow(ctxt);
 2403|  5.40k|        } while (result > 0);
  ------------------
  |  Branch (2403:18): [True: 201, False: 5.20k]
  ------------------
 2404|       |
 2405|  5.20k|        consumed = ctxt->input->consumed;
 2406|  5.20k|        xmlSaturatedAddSizeT(&consumed,
 2407|  5.20k|                             ctxt->input->end - ctxt->input->base);
 2408|       |
 2409|  5.20k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2410|       |
 2411|       |        /*
 2412|       |         * Add to sizeentities when parsing an external entity
 2413|       |         * for the first time.
 2414|       |         */
 2415|  5.20k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2415:13): [True: 3.84k, False: 1.36k]
  ------------------
 2416|  3.84k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2417|  3.84k|        }
 2418|       |
 2419|  5.20k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  5.20k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2420|  5.20k|    }
 2421|       |
 2422|   133k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2423|       |
 2424|   133k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2425|       |
 2426|   133k|    GROW;
  ------------------
  |  | 2308|   133k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   133k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   133k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 119k, False: 14.7k]
  |  |  ------------------
  |  | 2309|   133k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   119k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 82.0k, False: 37.0k]
  |  |  ------------------
  |  | 2310|   133k|	xmlParserGrow(ctxt);
  ------------------
 2427|   133k|}
parser.c:xmlParseConditionalSections:
 6783|  6.30k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6784|  6.30k|    size_t depth = 0;
 6785|  6.30k|    int isFreshPE = 0;
 6786|  6.30k|    int oldInputNr = ctxt->inputNr;
 6787|  6.30k|    int declInputNr = ctxt->inputNr;
 6788|       |
 6789|  12.7k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  12.7k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6789:12): [True: 12.6k, False: 4]
  ------------------
 6790|  12.6k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6790:13): [True: 722, False: 11.9k]
  ------------------
 6791|    722|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6791:17): [True: 435, False: 287]
  ------------------
 6792|    435|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6793|    435|                return;
 6794|    435|            }
 6795|       |
 6796|    287|            xmlPopPE(ctxt);
 6797|    287|            declInputNr = ctxt->inputNr;
 6798|  11.9k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|  11.9k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  8.78k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  8.48k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6798:20): [True: 8.78k, False: 3.19k]
  |  Branch (6798:36): [True: 8.48k, False: 294]
  |  Branch (6798:55): [True: 6.89k, False: 1.59k]
  ------------------
 6799|  6.89k|            SKIP(3);
  ------------------
  |  | 2285|  6.89k|#define SKIP(val) do {							\
  |  | 2286|  6.89k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.89k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 435, False: 6.46k]
  |  |  ------------------
  |  | 2288|  6.89k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.89k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.89k]
  |  |  ------------------
  ------------------
 6800|  6.89k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  6.89k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6801|       |
 6802|  6.89k|            isFreshPE = 0;
 6803|       |
 6804|  6.89k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2275|  6.89k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  13.7k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  13.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  13.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 5.88k, False: 1.01k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.41k, False: 2.46k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  6.89k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.40k, False: 7]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.40k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.40k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 3.39k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 3.39k, False: 3]
  |  |  ------------------
  ------------------
 6805|  3.39k|                SKIP(7);
  ------------------
  |  | 2285|  3.39k|#define SKIP(val) do {							\
  |  | 2286|  3.39k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.39k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 210, False: 3.18k]
  |  |  ------------------
  |  | 2288|  3.39k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.39k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.39k]
  |  |  ------------------
  ------------------
 6806|  3.39k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.39k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6807|  3.39k|                if (RAW != '[') {
  ------------------
  |  | 2261|  3.39k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6807:21): [True: 347, False: 3.04k]
  ------------------
 6808|    347|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6809|    347|                    return;
 6810|    347|                }
 6811|  3.04k|#ifdef LIBXML_VALID_ENABLED
 6812|  3.04k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6812:21): [True: 2.02k, False: 1.02k]
  |  Branch (6812:41): [True: 40, False: 1.98k]
  ------------------
 6813|     40|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6814|     40|                                     "All markup of the conditional section is"
 6815|     40|                                     " not in the same entity\n",
 6816|     40|                                     NULL, NULL);
 6817|     40|                }
 6818|  3.04k|#endif
 6819|  3.04k|                NEXT;
  ------------------
  |  | 2316|  3.04k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6820|       |
 6821|  3.04k|                depth++;
 6822|  3.50k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2273|  3.50k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  7.00k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  7.00k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.48k, False: 1.01k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.46k, False: 24]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  3.50k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.46k, False: 2]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.46k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 2.45k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 2.45k, False: 1]
  |  |  ------------------
  ------------------
 6823|  2.45k|                size_t ignoreDepth = 0;
 6824|       |
 6825|  2.45k|                SKIP(6);
  ------------------
  |  | 2285|  2.45k|#define SKIP(val) do {							\
  |  | 2286|  2.45k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.45k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 209, False: 2.24k]
  |  |  ------------------
  |  | 2288|  2.45k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.45k]
  |  |  ------------------
  ------------------
 6826|  2.45k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.45k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6827|  2.45k|                if (RAW != '[') {
  ------------------
  |  | 2261|  2.45k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6827:21): [True: 358, False: 2.10k]
  ------------------
 6828|    358|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6829|    358|                    return;
 6830|    358|                }
 6831|  2.10k|#ifdef LIBXML_VALID_ENABLED
 6832|  2.10k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6832:21): [True: 1.21k, False: 884]
  |  Branch (6832:41): [True: 7, False: 1.20k]
  ------------------
 6833|      7|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6834|      7|                                     "All markup of the conditional section is"
 6835|      7|                                     " not in the same entity\n",
 6836|      7|                                     NULL, NULL);
 6837|      7|                }
 6838|  2.10k|#endif
 6839|  2.10k|                NEXT;
  ------------------
  |  | 2316|  2.10k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6840|       |
 6841|   399k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|   399k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6841:24): [True: 399k, False: 3]
  ------------------
 6842|   399k|                    if (RAW == 0) {
  ------------------
  |  | 2261|   399k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6842:25): [True: 1.14k, False: 398k]
  ------------------
 6843|  1.14k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6844|  1.14k|                        return;
 6845|  1.14k|                    }
 6846|   398k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   398k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  15.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  13.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6846:25): [True: 15.7k, False: 382k]
  |  Branch (6846:41): [True: 13.2k, False: 2.44k]
  |  Branch (6846:60): [True: 6.70k, False: 6.54k]
  ------------------
 6847|  6.70k|                        SKIP(3);
  ------------------
  |  | 2285|  6.70k|#define SKIP(val) do {							\
  |  | 2286|  6.70k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.70k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 82, False: 6.62k]
  |  |  ------------------
  |  | 2288|  6.70k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.70k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.70k]
  |  |  ------------------
  ------------------
 6848|  6.70k|                        ignoreDepth++;
 6849|       |                        /* Check for integer overflow */
 6850|  6.70k|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6850:29): [True: 0, False: 6.70k]
  ------------------
 6851|      0|                            xmlErrMemory(ctxt);
 6852|      0|                            return;
 6853|      0|                        }
 6854|   391k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2261|   391k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2263|  16.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6854:32): [True: 16.3k, False: 375k]
  |  Branch (6854:48): [True: 7.85k, False: 8.47k]
  ------------------
 6855|  7.85k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2263|  7.85k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6855:32): [True: 1.23k, False: 6.61k]
  ------------------
 6856|  1.23k|                        SKIP(3);
  ------------------
  |  | 2285|  1.23k|#define SKIP(val) do {							\
  |  | 2286|  1.23k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.23k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 321, False: 915]
  |  |  ------------------
  |  | 2288|  1.23k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.23k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.23k]
  |  |  ------------------
  ------------------
 6857|  1.23k|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6857:29): [True: 951, False: 285]
  ------------------
 6858|    951|                            break;
 6859|    285|                        ignoreDepth--;
 6860|   390k|                    } else {
 6861|   390k|                        NEXT;
  ------------------
  |  | 2316|   390k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6862|   390k|                    }
 6863|   398k|                }
 6864|       |
 6865|    954|#ifdef LIBXML_VALID_ENABLED
 6866|    954|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6866:21): [True: 406, False: 548]
  |  Branch (6866:41): [True: 6, False: 400]
  ------------------
 6867|      6|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6868|      6|                                     "All markup of the conditional section is"
 6869|      6|                                     " not in the same entity\n",
 6870|      6|                                     NULL, NULL);
 6871|      6|                }
 6872|    954|#endif
 6873|  1.04k|            } else {
 6874|  1.04k|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6875|  1.04k|                return;
 6876|  1.04k|            }
 6877|  6.89k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6877:20): [True: 5.07k, False: 0]
  ------------------
 6878|  5.07k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2261|  5.07k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.26k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.26k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6878:20): [True: 2.26k, False: 2.81k]
  |  Branch (6878:36): [True: 2.26k, False: 6]
  |  Branch (6878:55): [True: 2.25k, False: 7]
  ------------------
 6879|  2.25k|            if (isFreshPE) {
  ------------------
  |  Branch (6879:17): [True: 1, False: 2.25k]
  ------------------
 6880|      1|                xmlFatalErrMsg(ctxt, XML_ERR_CONDSEC_INVALID,
 6881|      1|                               "Parameter entity must match "
 6882|      1|                               "extSubsetDecl\n");
 6883|      1|                return;
 6884|      1|            }
 6885|       |
 6886|  2.25k|            depth--;
 6887|  2.25k|#ifdef LIBXML_VALID_ENABLED
 6888|  2.25k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6888:17): [True: 1.54k, False: 710]
  |  Branch (6888:37): [True: 27, False: 1.51k]
  ------------------
 6889|     27|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6890|     27|                                 "All markup of the conditional section is not"
 6891|     27|                                 " in the same entity\n",
 6892|     27|                                 NULL, NULL);
 6893|     27|            }
 6894|  2.25k|#endif
 6895|  2.25k|            SKIP(3);
  ------------------
  |  | 2285|  2.25k|#define SKIP(val) do {							\
  |  | 2286|  2.25k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.25k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.11k, False: 1.14k]
  |  |  ------------------
  |  | 2288|  2.25k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.25k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.25k]
  |  |  ------------------
  ------------------
 6896|  2.82k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|  2.82k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  1.88k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|    294|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6896:20): [True: 1.88k, False: 940]
  |  Branch (6896:37): [True: 1.59k, False: 294]
  |  Branch (6896:56): [True: 286, False: 8]
  ------------------
 6897|  1.87k|            isFreshPE = 0;
 6898|  1.87k|            xmlParseMarkupDecl(ctxt);
 6899|  1.87k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|    948|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6899:20): [True: 892, False: 56]
  ------------------
 6900|    892|            xmlParsePERefInternal(ctxt, 1);
 6901|    892|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6901:17): [True: 285, False: 607]
  ------------------
 6902|    285|                isFreshPE = 1;
 6903|    285|                declInputNr = ctxt->inputNr;
 6904|    285|            }
 6905|    892|        } else {
 6906|     56|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6907|     56|            return;
 6908|     56|        }
 6909|       |
 6910|  9.31k|        if (depth == 0)
  ------------------
  |  Branch (6910:13): [True: 2.91k, False: 6.39k]
  ------------------
 6911|  2.91k|            break;
 6912|       |
 6913|  6.39k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  6.39k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6914|  6.39k|        SHRINK;
  ------------------
  |  | 2304|  6.39k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.39k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.39k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 6.35k, False: 38]
  |  |  ------------------
  |  | 2305|  6.39k|	xmlParserShrink(ctxt);
  ------------------
 6915|  6.39k|        GROW;
  ------------------
  |  | 2308|  6.39k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.39k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.39k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.35k, False: 38]
  |  |  ------------------
  |  | 2309|  6.39k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.35k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.47k, False: 880]
  |  |  ------------------
  |  | 2310|  6.39k|	xmlParserGrow(ctxt);
  ------------------
 6916|  6.39k|    }
 6917|  6.30k|}
parser.c:xmlParserEntityCheck:
  435|  2.80M|{
  436|  2.80M|    unsigned long consumed;
  437|  2.80M|    unsigned long *expandedSize;
  438|  2.80M|    xmlParserInputPtr input = ctxt->input;
  439|  2.80M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  2.80M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   571k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 571k, False: 2.23M]
  |  Branch (441:21): [True: 382k, False: 188k]
  ------------------
  442|   382k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.42M|    consumed = input->consumed;
  449|  2.42M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.42M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.42M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 188k, False: 2.23M]
  ------------------
  453|   188k|        expandedSize = &entity->expandedSize;
  454|  2.23M|    else
  455|  2.23M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.42M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.42M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.42M|#define XML_ENT_FIXED_COST 20
  ------------------
  462|       |
  463|       |    /*
  464|       |     * It's important to always use saturation arithmetic when tracking
  465|       |     * entity sizes to make the size checks reliable. If "sizeentcopy"
  466|       |     * overflows, we have to abort.
  467|       |     */
  468|  2.42M|    if ((ctxt->maxAmpl > 0) &&
  ------------------
  |  Branch (468:9): [True: 2.42M, False: 0]
  ------------------
  469|  2.42M|        (*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.42M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (469:9): [True: 819k, False: 1.60M]
  ------------------
  470|   819k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (470:10): [True: 0, False: 819k]
  ------------------
  471|   819k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (471:10): [True: 336, False: 818k]
  ------------------
  472|    336|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  473|    336|                       "Maximum entity amplification factor exceeded, see "
  474|    336|                       "xmlCtxtSetMaxAmplification.\n");
  475|    336|        return(1);
  476|    336|    }
  477|       |
  478|  2.42M|    return(0);
  479|  2.42M|}
parser.c:xmlLookupGeneralEntity:
 7432|  3.57M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7433|  3.57M|    xmlEntityPtr ent = NULL;
 7434|       |
 7435|       |    /*
 7436|       |     * Predefined entities override any extra definition
 7437|       |     */
 7438|  3.57M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7438:9): [True: 1.55M, False: 2.01M]
  ------------------
 7439|  1.55M|        ent = xmlGetPredefinedEntity(name);
 7440|  1.55M|        if (ent != NULL)
  ------------------
  |  Branch (7440:13): [True: 634k, False: 924k]
  ------------------
 7441|   634k|            return(ent);
 7442|  1.55M|    }
 7443|       |
 7444|       |    /*
 7445|       |     * Ask first SAX for entity resolution, otherwise try the
 7446|       |     * entities which may have stored in the parser context.
 7447|       |     */
 7448|  2.93M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7448:9): [True: 2.93M, False: 0]
  ------------------
 7449|  2.93M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7449:6): [True: 2.93M, False: 0]
  ------------------
 7450|  2.93M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7451|  2.93M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7451:6): [True: 39.9k, False: 2.89M]
  |  Branch (7451:34): [True: 3.20k, False: 36.7k]
  ------------------
 7452|  3.20k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7452:6): [True: 1.35k, False: 1.84k]
  ------------------
 7453|  1.35k|	    ent = xmlGetPredefinedEntity(name);
 7454|  2.93M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7454:6): [True: 39.9k, False: 2.89M]
  |  Branch (7454:34): [True: 3.20k, False: 36.7k]
  ------------------
 7455|  3.20k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7455:6): [True: 3.20k, False: 0]
  ------------------
 7456|  3.20k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7457|  3.20k|	}
 7458|  2.93M|    }
 7459|       |
 7460|  2.93M|    if (ent == NULL) {
  ------------------
  |  Branch (7460:9): [True: 361k, False: 2.57M]
  ------------------
 7461|   361k|        xmlHandleUndeclaredEntity(ctxt, name);
 7462|   361k|    }
 7463|       |
 7464|       |    /*
 7465|       |     * [ WFC: Parsed Entity ]
 7466|       |     * An entity reference must not contain the name of an
 7467|       |     * unparsed entity
 7468|       |     */
 7469|  2.57M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7469:14): [True: 197, False: 2.57M]
  ------------------
 7470|    197|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7471|    197|		 "Entity reference to unparsed entity %s\n", name);
 7472|    197|        ent = NULL;
 7473|    197|    }
 7474|       |
 7475|       |    /*
 7476|       |     * [ WFC: No External Entity References ]
 7477|       |     * Attribute values cannot contain direct or indirect
 7478|       |     * entity references to external entities.
 7479|       |     */
 7480|  2.57M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7480:14): [True: 17.7k, False: 2.55M]
  ------------------
 7481|  17.7k|        if (inAttr) {
  ------------------
  |  Branch (7481:13): [True: 763, False: 17.0k]
  ------------------
 7482|    763|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7483|    763|                 "Attribute references external entity '%s'\n", name);
 7484|    763|            ent = NULL;
 7485|    763|        }
 7486|  17.7k|    }
 7487|       |
 7488|  2.93M|    return(ent);
 7489|  3.57M|}
parser.c:xmlParseEntityRefInternal:
 7500|  1.13M|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7501|  1.13M|    const xmlChar *name;
 7502|       |
 7503|  1.13M|    GROW;
  ------------------
  |  | 2308|  1.13M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.13M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.13M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 552k, False: 584k]
  |  |  ------------------
  |  | 2309|  1.13M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   552k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 300k, False: 251k]
  |  |  ------------------
  |  | 2310|  1.13M|	xmlParserGrow(ctxt);
  ------------------
 7504|       |
 7505|  1.13M|    if (RAW != '&')
  ------------------
  |  | 2261|  1.13M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7505:9): [True: 0, False: 1.13M]
  ------------------
 7506|      0|        return(NULL);
 7507|  1.13M|    NEXT;
  ------------------
  |  | 2316|  1.13M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7508|  1.13M|    name = xmlParseName(ctxt);
 7509|  1.13M|    if (name == NULL) {
  ------------------
  |  Branch (7509:9): [True: 61.1k, False: 1.07M]
  ------------------
 7510|  61.1k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7511|  61.1k|		       "xmlParseEntityRef: no name\n");
 7512|  61.1k|        return(NULL);
 7513|  61.1k|    }
 7514|  1.07M|    if (RAW != ';') {
  ------------------
  |  | 2261|  1.07M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7514:9): [True: 136k, False: 939k]
  ------------------
 7515|   136k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7516|   136k|	return(NULL);
 7517|   136k|    }
 7518|   939k|    NEXT;
  ------------------
  |  | 2316|   939k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7519|       |
 7520|   939k|    return(name);
 7521|  1.07M|}
parser.c:xmlParsePERefInternal:
 7636|   225k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7637|   225k|    const xmlChar *name;
 7638|   225k|    xmlEntityPtr entity = NULL;
 7639|   225k|    xmlParserInputPtr input;
 7640|       |
 7641|   225k|    if (RAW != '%')
  ------------------
  |  | 2261|   225k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7641:9): [True: 0, False: 225k]
  ------------------
 7642|      0|        return;
 7643|   225k|    NEXT;
  ------------------
  |  | 2316|   225k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7644|   225k|    name = xmlParseName(ctxt);
 7645|   225k|    if (name == NULL) {
  ------------------
  |  Branch (7645:9): [True: 13.7k, False: 212k]
  ------------------
 7646|  13.7k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7647|  13.7k|	return;
 7648|  13.7k|    }
 7649|   212k|    if (RAW != ';') {
  ------------------
  |  | 2261|   212k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7649:9): [True: 16.6k, False: 195k]
  ------------------
 7650|  16.6k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7651|  16.6k|        return;
 7652|  16.6k|    }
 7653|       |
 7654|   195k|    NEXT;
  ------------------
  |  | 2316|   195k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7655|       |
 7656|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7657|   195k|    ctxt->hasPErefs = 1;
 7658|       |
 7659|       |    /*
 7660|       |     * Request the entity from SAX
 7661|       |     */
 7662|   195k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7662:9): [True: 195k, False: 0]
  ------------------
 7663|   195k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7663:2): [True: 195k, False: 0]
  ------------------
 7664|   195k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7665|       |
 7666|   195k|    if (entity == NULL) {
  ------------------
  |  Branch (7666:9): [True: 58.8k, False: 136k]
  ------------------
 7667|  58.8k|        xmlHandleUndeclaredEntity(ctxt, name);
 7668|   136k|    } else {
 7669|       |	/*
 7670|       |	 * Internal checking in case the entity quest barfed
 7671|       |	 */
 7672|   136k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7672:6): [True: 126k, False: 10.1k]
  ------------------
 7673|   126k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7673:6): [True: 0, False: 126k]
  ------------------
 7674|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7675|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7676|      0|			  name, NULL);
 7677|   136k|	} else {
 7678|   136k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7678:10): [True: 126k, False: 10.1k]
  ------------------
 7679|   126k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7679:18): [True: 201, False: 126k]
  ------------------
 7680|   126k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   126k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7680:5): [True: 31.2k, False: 95.0k]
  ------------------
 7681|  31.2k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7681:5): [True: 9.33k, False: 21.8k]
  ------------------
 7682|  9.33k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7682:5): [True: 194, False: 9.13k]
  ------------------
 7683|    395|		return;
 7684|       |
 7685|   136k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   136k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7685:17): [True: 9, False: 136k]
  ------------------
 7686|      9|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7687|      9|                return;
 7688|      9|            }
 7689|       |
 7690|   136k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7691|   136k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7691:10): [True: 1.73k, False: 134k]
  ------------------
 7692|  1.73k|                xmlFreeInputStream(input);
 7693|  1.73k|		return;
 7694|  1.73k|            }
 7695|       |
 7696|   134k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   134k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7697|       |
 7698|   134k|            if (markupDecl)
  ------------------
  |  Branch (7698:17): [True: 118k, False: 16.2k]
  ------------------
 7699|   118k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|   118k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7700|       |
 7701|   134k|            GROW;
  ------------------
  |  | 2308|   134k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   134k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   134k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 134k, False: 0]
  |  |  ------------------
  |  | 2309|   134k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   134k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 88.3k, False: 46.2k]
  |  |  ------------------
  |  | 2310|   134k|	xmlParserGrow(ctxt);
  ------------------
 7702|       |
 7703|   134k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7703:10): [True: 124k, False: 10.1k]
  ------------------
 7704|   124k|                xmlDetectEncoding(ctxt);
 7705|       |
 7706|   124k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|   124k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   248k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 98.4k, False: 25.8k]
  |  |  |  |  |  Branch (2268:41): [True: 64.0k, False: 34.4k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   124k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 59.1k, False: 4.87k]
  |  |  |  |  |  Branch (2269:41): [True: 58.1k, False: 980]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 56.7k, False: 1.43k]
  |  |  ------------------
  ------------------
 7707|  56.7k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  56.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  56.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 54.5k, False: 2.21k]
  |  |  |  |  ------------------
  |  |  |  |   91|  56.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.00k, False: 208]
  |  |  |  |  |  Branch (91:23): [True: 409, False: 1.59k]
  |  |  |  |  ------------------
  |  |  |  |   92|  56.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 447, False: 1.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7708|  55.3k|                    xmlParseTextDecl(ctxt);
 7709|  55.3k|                }
 7710|   124k|            }
 7711|   134k|	}
 7712|   136k|    }
 7713|   195k|}
parser.c:xmlErrAttributeDup:
  238|  86.3k|{
  239|  86.3k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 23.6k, False: 62.7k]
  ------------------
  240|  23.6k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  23.6k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  23.6k|                   "Attribute %s redefined\n", localname);
  243|  62.7k|    else
  244|  62.7k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  62.7k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  86.3k|}
parser.c:xmlParseEndTag1:
 8344|   100k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8345|   100k|    const xmlChar *name;
 8346|       |
 8347|   100k|    GROW;
  ------------------
  |  | 2308|   100k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   100k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   100k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 70.0k, False: 30.0k]
  |  |  ------------------
  |  | 2309|   100k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  70.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.4k, False: 58.5k]
  |  |  ------------------
  |  | 2310|   100k|	xmlParserGrow(ctxt);
  ------------------
 8348|   100k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   100k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   100k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8348:9): [True: 33, False: 100k]
  |  Branch (8348:25): [True: 20, False: 100k]
  ------------------
 8349|     53|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8350|     53|		       "xmlParseEndTag: '</' not found\n");
 8351|     53|	return;
 8352|     53|    }
 8353|   100k|    SKIP(2);
  ------------------
  |  | 2285|   100k|#define SKIP(val) do {							\
  |  | 2286|   100k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   100k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 328, False: 99.6k]
  |  |  ------------------
  |  | 2288|   100k|        xmlParserGrow(ctxt);						\
  |  | 2289|   100k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 100k]
  |  |  ------------------
  ------------------
 8354|       |
 8355|   100k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8356|       |
 8357|       |    /*
 8358|       |     * We should definitely be at the ending "S? '>'" part
 8359|       |     */
 8360|   100k|    GROW;
  ------------------
  |  | 2308|   100k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   100k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   100k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 69.9k, False: 30.0k]
  |  |  ------------------
  |  | 2309|   100k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  69.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.5k, False: 58.4k]
  |  |  ------------------
  |  | 2310|   100k|	xmlParserGrow(ctxt);
  ------------------
 8361|   100k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   100k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8362|   100k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   100k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   100k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 95.4k, False: 4.55k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 95.4k]
  |  |  |  |  ------------------
  |  |  |  |  109|   100k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 100k]
  |  |  |  |  ------------------
  |  |  |  |  110|   100k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 95.2k, False: 4.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|  95.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8362:33): [True: 5.18k, False: 90.0k]
  ------------------
 8363|  9.94k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8364|  9.94k|    } else
 8365|  90.0k|	NEXT1;
  ------------------
  |  | 2318|  90.0k|#define NEXT1 {								\
  |  | 2319|  90.0k|	ctxt->input->col++;						\
  |  | 2320|  90.0k|	ctxt->input->cur++;						\
  |  | 2321|  90.0k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.46k, False: 88.6k]
  |  |  ------------------
  |  | 2322|  90.0k|	    xmlParserGrow(ctxt);						\
  |  | 2323|  90.0k|    }
  ------------------
 8366|       |
 8367|       |    /*
 8368|       |     * [ WFC: Element Type Match ]
 8369|       |     * The Name in an element's end-tag must match the element type in the
 8370|       |     * start-tag.
 8371|       |     *
 8372|       |     */
 8373|   100k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8373:9): [True: 7.23k, False: 92.7k]
  ------------------
 8374|  7.23k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  2.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8374:13): [True: 2.22k, False: 5.00k]
  ------------------
 8375|  7.23k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8376|  7.23k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8377|  7.23k|		                ctxt->name, line, name);
 8378|  7.23k|    }
 8379|       |
 8380|       |    /*
 8381|       |     * SAX: End of Tag
 8382|       |     */
 8383|   100k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8383:9): [True: 100k, False: 0]
  |  Branch (8383:32): [True: 100k, False: 0]
  ------------------
 8384|   100k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8384:2): [True: 92.3k, False: 7.63k]
  ------------------
 8385|  92.3k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8386|       |
 8387|   100k|    namePop(ctxt);
 8388|   100k|    spacePop(ctxt);
 8389|   100k|}
parser.c:xmlParseNameAndCompare:
 3340|   211k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3341|   211k|    register const xmlChar *cmp = other;
 3342|   211k|    register const xmlChar *in;
 3343|   211k|    const xmlChar *ret;
 3344|       |
 3345|   211k|    GROW;
  ------------------
  |  | 2308|   211k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   211k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   211k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 163k, False: 48.3k]
  |  |  ------------------
  |  | 2309|   211k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   163k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 23.0k, False: 140k]
  |  |  ------------------
  |  | 2310|   211k|	xmlParserGrow(ctxt);
  ------------------
 3346|       |
 3347|   211k|    in = ctxt->input->cur;
 3348|   482k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3348:12): [True: 477k, False: 4.75k]
  |  Branch (3348:24): [True: 270k, False: 206k]
  ------------------
 3349|   270k|	++in;
 3350|   270k|	++cmp;
 3351|   270k|    }
 3352|   211k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  9.95k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  9.95k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 738, False: 9.21k]
  |  |  |  |  ------------------
  |  |  |  |   91|  9.95k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 5.99k, False: 3.22k]
  |  |  |  |  |  Branch (91:23): [True: 1.31k, False: 4.67k]
  |  |  |  |  ------------------
  |  |  |  |   92|  9.95k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 758, False: 7.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3352:9): [True: 195k, False: 15.7k]
  |  Branch (3352:23): [True: 185k, False: 9.95k]
  ------------------
 3353|       |	/* success */
 3354|   188k|	ctxt->input->col += in - ctxt->input->cur;
 3355|   188k|	ctxt->input->cur = in;
 3356|   188k|	return (const xmlChar*) 1;
 3357|   188k|    }
 3358|       |    /* failure (or end of input buffer), check with full function */
 3359|  22.8k|    ret = xmlParseName (ctxt);
 3360|       |    /* strings coming from the dictionary direct compare possible */
 3361|  22.8k|    if (ret == other) {
  ------------------
  |  Branch (3361:9): [True: 5.97k, False: 16.8k]
  ------------------
 3362|  5.97k|	return (const xmlChar*) 1;
 3363|  5.97k|    }
 3364|  16.8k|    return ret;
 3365|  22.8k|}
parser.c:namePop:
 2175|   910k|{
 2176|   910k|    const xmlChar *ret;
 2177|       |
 2178|   910k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2178:9): [True: 0, False: 910k]
  |  Branch (2178:27): [True: 3, False: 910k]
  ------------------
 2179|      3|        return (NULL);
 2180|   910k|    ctxt->nameNr--;
 2181|   910k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2181:9): [True: 900k, False: 10.1k]
  ------------------
 2182|   900k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2183|  10.1k|    else
 2184|  10.1k|        ctxt->name = NULL;
 2185|   910k|    ret = ctxt->nameTab[ctxt->nameNr];
 2186|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2187|   910k|    return (ret);
 2188|   910k|}
parser.c:spacePop:
 2216|  1.13M|static int spacePop(xmlParserCtxtPtr ctxt) {
 2217|  1.13M|    int ret;
 2218|  1.13M|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2218:9): [True: 0, False: 1.13M]
  ------------------
 2219|  1.13M|    ctxt->spaceNr--;
 2220|  1.13M|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2220:9): [True: 1.13M, False: 26]
  ------------------
 2221|  1.13M|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2222|     26|    else
 2223|     26|        ctxt->space = &ctxt->spaceTab[0];
 2224|  1.13M|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2225|  1.13M|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2226|  1.13M|    return(ret);
 2227|  1.13M|}
parser.c:xmlParseContentInternal:
 9577|  12.2k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9578|  12.2k|    int oldNameNr = ctxt->nameNr;
 9579|  12.2k|    int oldSpaceNr = ctxt->spaceNr;
 9580|  12.2k|    int oldNodeNr = ctxt->nodeNr;
 9581|       |
 9582|  12.2k|    GROW;
  ------------------
  |  | 2308|  12.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  12.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  12.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 12.2k, False: 0]
  |  |  ------------------
  |  | 2309|  12.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  12.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 9.90k, False: 2.36k]
  |  |  ------------------
  |  | 2310|  12.2k|	xmlParserGrow(ctxt);
  ------------------
 9583|  7.20M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9583:12): [True: 7.19M, False: 6.84k]
  ------------------
 9584|  7.19M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  7.19M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9584:5): [True: 7.19M, False: 461]
  ------------------
 9585|  7.19M|	const xmlChar *cur = ctxt->input->cur;
 9586|       |
 9587|       |	/*
 9588|       |	 * First case : a Processing Instruction.
 9589|       |	 */
 9590|  7.19M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9590:6): [True: 1.27M, False: 5.91M]
  |  Branch (9590:23): [True: 108k, False: 1.17M]
  ------------------
 9591|   108k|	    xmlParsePI(ctxt);
 9592|   108k|	}
 9593|       |
 9594|       |	/*
 9595|       |	 * Second case : a CDSection
 9596|       |	 */
 9597|       |	/* 2.6.0 test was *cur not RAW */
 9598|  7.08M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2279|  7.08M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  14.1M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  14.1M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  14.1M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  14.1M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  14.1M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 1.17M, False: 5.91M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 104k, False: 1.06M]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  7.08M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 71.8k, False: 32.3k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 70.8k, False: 993]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 70.3k, False: 500]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 70.0k, False: 340]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 69.8k, False: 232]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 69.5k, False: 262]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  7.08M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 69.2k, False: 259]
  |  |  ------------------
  ------------------
 9599|  69.2k|	    xmlParseCDSect(ctxt);
 9600|  69.2k|	}
 9601|       |
 9602|       |	/*
 9603|       |	 * Third case :  a comment
 9604|       |	 */
 9605|  7.01M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2263|  1.10M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9605:11): [True: 1.10M, False: 5.91M]
  |  Branch (9605:28): [True: 34.8k, False: 1.06M]
  ------------------
 9606|  34.8k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  34.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  20.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9606:4): [True: 20.5k, False: 14.3k]
  |  Branch (9606:23): [True: 20.2k, False: 321]
  ------------------
 9607|  20.2k|	    xmlParseComment(ctxt);
 9608|  20.2k|	}
 9609|       |
 9610|       |	/*
 9611|       |	 * Fourth case :  a sub-element.
 9612|       |	 */
 9613|  6.99M|	else if (*cur == '<') {
  ------------------
  |  Branch (9613:11): [True: 1.08M, False: 5.91M]
  ------------------
 9614|  1.08M|            if (NXT(1) == '/') {
  ------------------
  |  | 2263|  1.08M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9614:17): [True: 179k, False: 901k]
  ------------------
 9615|   179k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9615:21): [True: 4.96k, False: 174k]
  ------------------
 9616|  4.96k|                    break;
 9617|   174k|	        xmlParseElementEnd(ctxt);
 9618|   901k|            } else {
 9619|   901k|	        xmlParseElementStart(ctxt);
 9620|   901k|            }
 9621|  1.08M|	}
 9622|       |
 9623|       |	/*
 9624|       |	 * Fifth case : a reference. If if has not been resolved,
 9625|       |	 *    parsing returns it's Name, create the node
 9626|       |	 */
 9627|       |
 9628|  5.91M|	else if (*cur == '&') {
  ------------------
  |  Branch (9628:11): [True: 91.7k, False: 5.82M]
  ------------------
 9629|  91.7k|	    xmlParseReference(ctxt);
 9630|  91.7k|	}
 9631|       |
 9632|       |	/*
 9633|       |	 * Last case, text. Note that References are handled directly.
 9634|       |	 */
 9635|  5.82M|	else {
 9636|  5.82M|	    xmlParseCharDataInternal(ctxt, 0);
 9637|  5.82M|	}
 9638|       |
 9639|  7.19M|	SHRINK;
  ------------------
  |  | 2304|  7.19M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.19M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.19M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 7.19M, False: 0]
  |  |  ------------------
  |  | 2305|  7.19M|	xmlParserShrink(ctxt);
  ------------------
 9640|  7.19M|	GROW;
  ------------------
  |  | 2308|  7.19M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.19M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.19M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 7.19M, False: 0]
  |  |  ------------------
  |  | 2309|  7.19M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  7.19M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 153k, False: 7.03M]
  |  |  ------------------
  |  | 2310|  7.19M|	xmlParserGrow(ctxt);
  ------------------
 9641|  7.19M|    }
 9642|       |
 9643|  12.2k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9643:9): [True: 1.83k, False: 10.4k]
  ------------------
 9644|  1.83k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9644:9): [True: 1.62k, False: 210]
  ------------------
 9645|  1.62k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9645:9): [True: 37, False: 1.58k]
  ------------------
 9646|     37|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9647|     37|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9648|     37|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9649|     37|                "Premature end of data in tag %s line %d\n",
 9650|     37|                name, line, NULL);
 9651|     37|    }
 9652|       |
 9653|       |    /*
 9654|       |     * Clean up in error case
 9655|       |     */
 9656|       |
 9657|  74.9k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9657:12): [True: 62.6k, False: 12.2k]
  ------------------
 9658|  62.6k|        nodePop(ctxt);
 9659|       |
 9660|   112k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9660:12): [True: 100k, False: 12.2k]
  ------------------
 9661|   100k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9662|       |
 9663|   100k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9663:13): [True: 16.8k, False: 83.4k]
  ------------------
 9664|  16.8k|            xmlParserNsPop(ctxt, tag->nsNr);
 9665|       |
 9666|   100k|        namePop(ctxt);
 9667|   100k|    }
 9668|       |
 9669|   112k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9669:12): [True: 100k, False: 12.2k]
  ------------------
 9670|   100k|        spacePop(ctxt);
 9671|  12.2k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   226k|{
  333|   226k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   226k|}
parser.c:xmlParseElementStart:
 9736|   911k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9737|   911k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9737:20): [True: 625k, False: 285k]
  ------------------
 9738|   911k|    const xmlChar *name;
 9739|   911k|    const xmlChar *prefix = NULL;
 9740|   911k|    const xmlChar *URI = NULL;
 9741|   911k|    xmlParserNodeInfo node_info;
 9742|   911k|    int line;
 9743|   911k|    xmlNodePtr cur;
 9744|   911k|    int nbNs = 0;
 9745|       |
 9746|   911k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9746:9): [True: 14, False: 911k]
  ------------------
 9747|     14|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9748|     14|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9749|     14|                ctxt->nameNr);
 9750|     14|	return(-1);
 9751|     14|    }
 9752|       |
 9753|       |    /* Capture start position */
 9754|   911k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9754:9): [True: 0, False: 911k]
  ------------------
 9755|      0|        node_info.begin_pos = ctxt->input->consumed +
 9756|      0|                          (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9757|      0|	node_info.begin_line = ctxt->input->line;
 9758|      0|    }
 9759|       |
 9760|   911k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9760:9): [True: 0, False: 911k]
  ------------------
 9761|      0|	spacePush(ctxt, -1);
 9762|   911k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9762:14): [True: 232k, False: 679k]
  ------------------
 9763|   232k|	spacePush(ctxt, -1);
 9764|   679k|    else
 9765|   679k|	spacePush(ctxt, *ctxt->space);
 9766|       |
 9767|   911k|    line = ctxt->input->line;
 9768|   911k|#ifdef LIBXML_SAX1_ENABLED
 9769|   911k|    if (ctxt->sax2)
  ------------------
  |  Branch (9769:9): [True: 723k, False: 187k]
  ------------------
 9770|   723k|#endif /* LIBXML_SAX1_ENABLED */
 9771|   723k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9772|   187k|#ifdef LIBXML_SAX1_ENABLED
 9773|   187k|    else
 9774|   187k|	name = xmlParseStartTag(ctxt);
 9775|   911k|#endif /* LIBXML_SAX1_ENABLED */
 9776|   911k|    if (name == NULL) {
  ------------------
  |  Branch (9776:9): [True: 36.6k, False: 874k]
  ------------------
 9777|  36.6k|	spacePop(ctxt);
 9778|  36.6k|        return(-1);
 9779|  36.6k|    }
 9780|   874k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9781|   874k|    cur = ctxt->node;
 9782|       |
 9783|   874k|#ifdef LIBXML_VALID_ENABLED
 9784|       |    /*
 9785|       |     * [ VC: Root Element Type ]
 9786|       |     * The Name in the document type declaration must match the element
 9787|       |     * type of the root element.
 9788|       |     */
 9789|   874k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9789:9): [True: 127k, False: 747k]
  |  Branch (9789:27): [True: 10.7k, False: 116k]
  |  Branch (9789:47): [True: 10.7k, False: 0]
  ------------------
 9790|  10.7k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9790:9): [True: 10.7k, False: 0]
  |  Branch (9790:23): [True: 0, False: 10.7k]
  ------------------
 9791|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9792|   874k|#endif /* LIBXML_VALID_ENABLED */
 9793|       |
 9794|       |    /*
 9795|       |     * Check for an Empty Element.
 9796|       |     */
 9797|   874k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   874k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   411k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9797:9): [True: 411k, False: 463k]
  |  Branch (9797:25): [True: 403k, False: 7.35k]
  ------------------
 9798|   403k|        SKIP(2);
  ------------------
  |  | 2285|   403k|#define SKIP(val) do {							\
  |  | 2286|   403k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   403k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 893, False: 403k]
  |  |  ------------------
  |  | 2288|   403k|        xmlParserGrow(ctxt);						\
  |  | 2289|   403k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 403k]
  |  |  ------------------
  ------------------
 9799|   403k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9799:6): [True: 347k, False: 56.2k]
  ------------------
 9800|   347k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9800:10): [True: 347k, False: 0]
  |  Branch (9800:33): [True: 347k, False: 0]
  ------------------
 9801|   347k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9801:3): [True: 292k, False: 55.2k]
  ------------------
 9802|   292k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9803|   347k|#ifdef LIBXML_SAX1_ENABLED
 9804|   347k|	} else {
 9805|  56.2k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9805:10): [True: 56.2k, False: 0]
  |  Branch (9805:33): [True: 56.2k, False: 0]
  ------------------
 9806|  56.2k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9806:3): [True: 53.8k, False: 2.39k]
  ------------------
 9807|  53.8k|		ctxt->sax->endElement(ctxt->userData, name);
 9808|  56.2k|#endif /* LIBXML_SAX1_ENABLED */
 9809|  56.2k|	}
 9810|   403k|	namePop(ctxt);
 9811|   403k|	spacePop(ctxt);
 9812|   403k|	if (nbNs > 0)
  ------------------
  |  Branch (9812:6): [True: 55.6k, False: 348k]
  ------------------
 9813|  55.6k|	    xmlParserNsPop(ctxt, nbNs);
 9814|   403k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9814:6): [True: 373k, False: 30.1k]
  |  Branch (9814:21): [True: 0, False: 373k]
  ------------------
 9815|      0|            node_info.node = cur;
 9816|      0|            node_info.end_pos = ctxt->input->consumed +
 9817|      0|                                (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9818|      0|            node_info.end_line = ctxt->input->line;
 9819|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9820|      0|	}
 9821|   403k|	return(1);
 9822|   403k|    }
 9823|   470k|    if (RAW == '>') {
  ------------------
  |  | 2261|   470k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9823:9): [True: 280k, False: 190k]
  ------------------
 9824|   280k|        NEXT1;
  ------------------
  |  | 2318|   280k|#define NEXT1 {								\
  |  | 2319|   280k|	ctxt->input->col++;						\
  |  | 2320|   280k|	ctxt->input->cur++;						\
  |  | 2321|   280k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 2.56k, False: 278k]
  |  |  ------------------
  |  | 2322|   280k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   280k|    }
  ------------------
 9825|   280k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9825:13): [True: 236k, False: 44.3k]
  |  Branch (9825:28): [True: 0, False: 236k]
  ------------------
 9826|      0|            node_info.node = cur;
 9827|      0|            node_info.end_pos = 0;
 9828|      0|            node_info.end_line = 0;
 9829|      0|            xmlParserAddNodeInfo(ctxt, &node_info);
 9830|      0|        }
 9831|   280k|    } else {
 9832|   190k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9833|   190k|		     "Couldn't find end of Start Tag %s line %d\n",
 9834|   190k|		                name, line, NULL);
 9835|       |
 9836|       |	/*
 9837|       |	 * end of parsing of this node.
 9838|       |	 */
 9839|   190k|	nodePop(ctxt);
 9840|   190k|	namePop(ctxt);
 9841|   190k|	spacePop(ctxt);
 9842|   190k|	if (nbNs > 0)
  ------------------
  |  Branch (9842:6): [True: 106k, False: 83.3k]
  ------------------
 9843|   106k|	    xmlParserNsPop(ctxt, nbNs);
 9844|   190k|	return(-1);
 9845|   190k|    }
 9846|       |
 9847|   280k|    return(0);
 9848|   470k|}
parser.c:spacePush:
 2190|  1.29M|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2191|  1.29M|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2191:9): [True: 94.7k, False: 1.19M]
  ------------------
 2192|  94.7k|        int *tmp;
 2193|  94.7k|        int newSize;
 2194|       |
 2195|  94.7k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2196|  94.7k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  94.7k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2197|  94.7k|        if (newSize < 0) {
  ------------------
  |  Branch (2197:13): [True: 0, False: 94.7k]
  ------------------
 2198|      0|	    xmlErrMemory(ctxt);
 2199|      0|	    return(-1);
 2200|      0|        }
 2201|       |
 2202|  94.7k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2203|  94.7k|        if (tmp == NULL) {
  ------------------
  |  Branch (2203:13): [True: 53, False: 94.7k]
  ------------------
 2204|     53|	    xmlErrMemory(ctxt);
 2205|     53|	    return(-1);
 2206|     53|	}
 2207|  94.7k|	ctxt->spaceTab = tmp;
 2208|       |
 2209|  94.7k|        ctxt->spaceMax = newSize;
 2210|  94.7k|    }
 2211|  1.29M|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2212|  1.29M|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2213|  1.29M|    return(ctxt->spaceNr++);
 2214|  1.29M|}
parser.c:xmlParseStartTag2:
 8788|   945k|                  const xmlChar **URI, int *nbNsPtr) {
 8789|   945k|    xmlHashedString hlocalname;
 8790|   945k|    xmlHashedString hprefix;
 8791|   945k|    xmlHashedString hattname;
 8792|   945k|    xmlHashedString haprefix;
 8793|   945k|    const xmlChar *localname;
 8794|   945k|    const xmlChar *prefix;
 8795|   945k|    const xmlChar *attname;
 8796|   945k|    const xmlChar *aprefix;
 8797|   945k|    const xmlChar *uri;
 8798|   945k|    xmlChar *attvalue = NULL;
 8799|   945k|    const xmlChar **atts = ctxt->atts;
 8800|   945k|    unsigned attrHashSize = 0;
 8801|   945k|    int maxatts = ctxt->maxatts;
 8802|   945k|    int nratts, nbatts, nbdef;
 8803|   945k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8804|   945k|    int alloc = 0;
 8805|   945k|    int numNsErr = 0;
 8806|   945k|    int numDupErr = 0;
 8807|       |
 8808|   945k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   945k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8808:9): [True: 0, False: 945k]
  ------------------
 8809|   945k|    NEXT1;
  ------------------
  |  | 2318|   945k|#define NEXT1 {								\
  |  | 2319|   945k|	ctxt->input->col++;						\
  |  | 2320|   945k|	ctxt->input->cur++;						\
  |  | 2321|   945k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.04k, False: 944k]
  |  |  ------------------
  |  | 2322|   945k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   945k|    }
  ------------------
 8810|       |
 8811|   945k|    nbatts = 0;
 8812|   945k|    nratts = 0;
 8813|   945k|    nbdef = 0;
 8814|   945k|    nbNs = 0;
 8815|   945k|    nbTotalDef = 0;
 8816|   945k|    attval = 0;
 8817|       |
 8818|   945k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8818:9): [True: 0, False: 945k]
  ------------------
 8819|      0|        xmlErrMemory(ctxt);
 8820|      0|        return(NULL);
 8821|      0|    }
 8822|       |
 8823|   945k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8824|   945k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8824:9): [True: 27.4k, False: 918k]
  ------------------
 8825|  27.4k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8826|  27.4k|		       "StartTag: invalid element name\n");
 8827|  27.4k|        return(NULL);
 8828|  27.4k|    }
 8829|   918k|    localname = hlocalname.name;
 8830|   918k|    prefix = hprefix.name;
 8831|       |
 8832|       |    /*
 8833|       |     * Now parse the attributes, it ends up with the ending
 8834|       |     *
 8835|       |     * (S Attribute)* S?
 8836|       |     */
 8837|   918k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   918k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8838|   918k|    GROW;
  ------------------
  |  | 2308|   918k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   918k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   918k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 697k, False: 220k]
  |  |  ------------------
  |  | 2309|   918k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   697k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 39.2k, False: 658k]
  |  |  ------------------
  |  | 2310|   918k|	xmlParserGrow(ctxt);
  ------------------
 8839|       |
 8840|       |    /*
 8841|       |     * The ctxt->atts array will be ultimately passed to the SAX callback
 8842|       |     * containing five xmlChar pointers for each attribute:
 8843|       |     *
 8844|       |     * [0] attribute name
 8845|       |     * [1] attribute prefix
 8846|       |     * [2] namespace URI
 8847|       |     * [3] attribute value
 8848|       |     * [4] end of attribute value
 8849|       |     *
 8850|       |     * To save memory, we reuse this array temporarily and store integers
 8851|       |     * in these pointer variables.
 8852|       |     *
 8853|       |     * [0] attribute name
 8854|       |     * [1] attribute prefix
 8855|       |     * [2] hash value of attribute prefix, and later namespace index
 8856|       |     * [3] for non-allocated values: ptrdiff_t offset into input buffer
 8857|       |     * [4] for non-allocated values: ptrdiff_t offset into input buffer
 8858|       |     *
 8859|       |     * The ctxt->attallocs array contains an additional unsigned int for
 8860|       |     * each attribute, containing the hash value of the attribute name
 8861|       |     * and the alloc flag in bit 31.
 8862|       |     */
 8863|       |
 8864|  1.04M|    while (((RAW != '>') &&
  ------------------
  |  | 2261|  1.04M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8864:13): [True: 777k, False: 267k]
  ------------------
 8865|   777k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   777k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|   362k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8865:6): [True: 415k, False: 362k]
  |  Branch (8865:22): [True: 6.19k, False: 356k]
  ------------------
 8866|   421k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   421k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   421k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 416k, False: 4.92k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 416k]
  |  |  |  |  ------------------
  |  |  |  |  109|   421k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 421k]
  |  |  |  |  ------------------
  |  |  |  |  110|   421k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 416k, False: 5.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   416k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8866:29): [True: 416k, False: 44]
  ------------------
 8867|   416k|	int len = -1;
 8868|       |
 8869|   416k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8870|   416k|                                          &haprefix, &attvalue, &len,
 8871|   416k|                                          &alloc);
 8872|   416k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8872:13): [True: 163k, False: 252k]
  ------------------
 8873|   163k|	    break;
 8874|   252k|        if (attvalue == NULL)
  ------------------
  |  Branch (8874:13): [True: 18.2k, False: 234k]
  ------------------
 8875|  18.2k|            goto next_attr;
 8876|   234k|        attname = hattname.name;
 8877|   234k|        aprefix = haprefix.name;
 8878|   234k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8878:6): [True: 0, False: 234k]
  ------------------
 8879|       |
 8880|   234k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8880:13): [True: 16.5k, False: 218k]
  |  Branch (8880:45): [True: 16.1k, False: 409]
  ------------------
 8881|  16.1k|            xmlHashedString huri;
 8882|  16.1k|            xmlURIPtr parsedUri;
 8883|       |
 8884|  16.1k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8885|  16.1k|            uri = huri.name;
 8886|  16.1k|            if (uri == NULL) {
  ------------------
  |  Branch (8886:17): [True: 1, False: 16.1k]
  ------------------
 8887|      1|                xmlErrMemory(ctxt);
 8888|      1|                goto next_attr;
 8889|      1|            }
 8890|  16.1k|            if (*uri != 0) {
  ------------------
  |  Branch (8890:17): [True: 7.20k, False: 8.92k]
  ------------------
 8891|  7.20k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8891:21): [True: 18, False: 7.19k]
  ------------------
 8892|     18|                    xmlErrMemory(ctxt);
 8893|     18|                    goto next_attr;
 8894|     18|                }
 8895|  7.19k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8895:21): [True: 2.24k, False: 4.94k]
  ------------------
 8896|  2.24k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8897|  2.24k|                             "xmlns: '%s' is not a valid URI\n",
 8898|  2.24k|                                       uri, NULL, NULL);
 8899|  4.94k|                } else {
 8900|  4.94k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8900:25): [True: 2.58k, False: 2.36k]
  ------------------
 8901|  2.58k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8902|  2.58k|                                  "xmlns: URI %s is not absolute\n",
 8903|  2.58k|                                  uri, NULL, NULL);
 8904|  2.58k|                    }
 8905|  4.94k|                    xmlFreeURI(parsedUri);
 8906|  4.94k|                }
 8907|  7.19k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8907:21): [True: 626, False: 6.56k]
  ------------------
 8908|    626|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8908:25): [True: 626, False: 0]
  ------------------
 8909|    626|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8910|    626|                     "xml namespace URI cannot be the default namespace\n",
 8911|    626|                                 NULL, NULL, NULL);
 8912|    626|                    }
 8913|    626|                    goto next_attr;
 8914|    626|                }
 8915|  6.56k|                if ((len == 29) &&
  ------------------
  |  Branch (8915:21): [True: 1.01k, False: 5.54k]
  ------------------
 8916|  1.01k|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8916:21): [True: 433, False: 585]
  ------------------
 8917|  1.01k|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|  1.01k|#define BAD_CAST (xmlChar *)
  ------------------
 8918|    433|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8919|    433|                         "reuse of the xmlns namespace name is forbidden\n",
 8920|    433|                             NULL, NULL, NULL);
 8921|    433|                    goto next_attr;
 8922|    433|                }
 8923|  6.56k|            }
 8924|       |
 8925|  15.0k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8925:17): [True: 8.97k, False: 6.08k]
  ------------------
 8926|  8.97k|                nbNs++;
 8927|   218k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8927:20): [True: 73.8k, False: 144k]
  ------------------
 8928|  73.8k|            xmlHashedString huri;
 8929|  73.8k|            xmlURIPtr parsedUri;
 8930|       |
 8931|  73.8k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8932|  73.8k|            uri = huri.name;
 8933|  73.8k|            if (uri == NULL) {
  ------------------
  |  Branch (8933:17): [True: 2, False: 73.8k]
  ------------------
 8934|      2|                xmlErrMemory(ctxt);
 8935|      2|                goto next_attr;
 8936|      2|            }
 8937|       |
 8938|  73.8k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8938:17): [True: 477, False: 73.3k]
  ------------------
 8939|    477|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8939:21): [True: 205, False: 272]
  ------------------
 8940|    205|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8941|    205|                             "xml namespace prefix mapped to wrong URI\n",
 8942|    205|                             NULL, NULL, NULL);
 8943|    205|                }
 8944|       |                /*
 8945|       |                 * Do not keep a namespace definition node
 8946|       |                 */
 8947|    477|                goto next_attr;
 8948|    477|            }
 8949|  73.3k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8949:17): [True: 208, False: 73.1k]
  ------------------
 8950|    208|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8950:21): [True: 208, False: 0]
  ------------------
 8951|    208|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8952|    208|                             "xml namespace URI mapped to wrong prefix\n",
 8953|    208|                             NULL, NULL, NULL);
 8954|    208|                }
 8955|    208|                goto next_attr;
 8956|    208|            }
 8957|  73.1k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8957:17): [True: 331, False: 72.7k]
  ------------------
 8958|    331|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8959|    331|                         "redefinition of the xmlns prefix is forbidden\n",
 8960|    331|                         NULL, NULL, NULL);
 8961|    331|                goto next_attr;
 8962|    331|            }
 8963|  72.7k|            if ((len == 29) &&
  ------------------
  |  Branch (8963:17): [True: 499, False: 72.2k]
  ------------------
 8964|    499|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8964:17): [True: 194, False: 305]
  ------------------
 8965|    499|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    499|#define BAD_CAST (xmlChar *)
  ------------------
 8966|    194|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8967|    194|                         "reuse of the xmlns namespace name is forbidden\n",
 8968|    194|                         NULL, NULL, NULL);
 8969|    194|                goto next_attr;
 8970|    194|            }
 8971|  72.5k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8971:17): [True: 0, False: 72.5k]
  |  Branch (8971:34): [True: 208, False: 72.3k]
  ------------------
 8972|    208|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8973|    208|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8974|    208|                              attname, NULL, NULL);
 8975|    208|                goto next_attr;
 8976|  72.3k|            } else {
 8977|  72.3k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8977:21): [True: 3, False: 72.3k]
  ------------------
 8978|      3|                    xmlErrMemory(ctxt);
 8979|      3|                    goto next_attr;
 8980|      3|                }
 8981|  72.3k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8981:21): [True: 4.89k, False: 67.4k]
  ------------------
 8982|  4.89k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8983|  4.89k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8984|  4.89k|                                       attname, uri, NULL);
 8985|  67.4k|                } else {
 8986|  67.4k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8986:25): [True: 3.61k, False: 63.8k]
  |  Branch (8986:45): [True: 1.75k, False: 1.86k]
  ------------------
 8987|  1.75k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8988|  1.75k|                                  "xmlns:%s: URI %s is not absolute\n",
 8989|  1.75k|                                  attname, uri, NULL);
 8990|  1.75k|                    }
 8991|  67.4k|                    xmlFreeURI(parsedUri);
 8992|  67.4k|                }
 8993|  72.3k|            }
 8994|       |
 8995|  72.3k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8995:17): [True: 70.9k, False: 1.42k]
  ------------------
 8996|  70.9k|                nbNs++;
 8997|   144k|        } else {
 8998|       |            /*
 8999|       |             * Populate attributes array, see above for repurposing
 9000|       |             * of xmlChar pointers.
 9001|       |             */
 9002|   144k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9002:17): [True: 13.5k, False: 131k]
  |  Branch (9002:35): [True: 11.2k, False: 119k]
  ------------------
 9003|  24.7k|                int res = xmlCtxtGrowAttrs(ctxt);
 9004|       |
 9005|  24.7k|                maxatts = ctxt->maxatts;
 9006|  24.7k|                atts = ctxt->atts;
 9007|       |
 9008|  24.7k|                if (res < 0)
  ------------------
  |  Branch (9008:21): [True: 10, False: 24.7k]
  ------------------
 9009|     10|                    goto next_attr;
 9010|  24.7k|            }
 9011|   144k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 9012|   144k|                                        ((unsigned) alloc << 31);
 9013|   144k|            atts[nbatts++] = attname;
 9014|   144k|            atts[nbatts++] = aprefix;
 9015|   144k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   144k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9016|   144k|            if (alloc) {
  ------------------
  |  Branch (9016:17): [True: 22.0k, False: 122k]
  ------------------
 9017|  22.0k|                atts[nbatts++] = attvalue;
 9018|  22.0k|                attvalue += len;
 9019|  22.0k|                atts[nbatts++] = attvalue;
 9020|   122k|            } else {
 9021|       |                /*
 9022|       |                 * attvalue points into the input buffer which can be
 9023|       |                 * reallocated. Store differences to input->base instead.
 9024|       |                 * The pointers will be reconstructed later.
 9025|       |                 */
 9026|   122k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   122k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9027|   122k|                attvalue += len;
 9028|   122k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   122k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9029|   122k|            }
 9030|       |            /*
 9031|       |             * tag if some deallocation is needed
 9032|       |             */
 9033|   144k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (9033:17): [True: 22.0k, False: 122k]
  ------------------
 9034|   144k|            attvalue = NULL; /* moved into atts */
 9035|   144k|        }
 9036|       |
 9037|   252k|next_attr:
 9038|   252k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9038:13): [True: 89.9k, False: 163k]
  |  Branch (9038:35): [True: 5.18k, False: 84.7k]
  ------------------
 9039|  5.18k|            xmlFree(attvalue);
 9040|  5.18k|            attvalue = NULL;
 9041|  5.18k|        }
 9042|       |
 9043|   252k|	GROW
  ------------------
  |  | 2308|   252k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   252k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   252k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 116k, False: 136k]
  |  |  ------------------
  |  | 2309|   252k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   116k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 14.1k, False: 102k]
  |  |  ------------------
  |  | 2310|   252k|	xmlParserGrow(ctxt);
  ------------------
 9044|   252k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   252k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   216k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  65.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9044:6): [True: 36.6k, False: 216k]
  |  Branch (9044:24): [True: 65.0k, False: 151k]
  |  Branch (9044:40): [True: 64.4k, False: 614]
  ------------------
 9045|   101k|	    break;
 9046|   151k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   151k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9046:6): [True: 24.9k, False: 126k]
  ------------------
 9047|  24.9k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9048|  24.9k|			   "attributes construct error\n");
 9049|  24.9k|	    break;
 9050|  24.9k|	}
 9051|   126k|        GROW;
  ------------------
  |  | 2308|   126k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   126k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   126k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 29.8k, False: 97.0k]
  |  |  ------------------
  |  | 2309|   126k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  29.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.88k, False: 22.9k]
  |  |  ------------------
  |  | 2310|   126k|	xmlParserGrow(ctxt);
  ------------------
 9052|   126k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Namespaces from default attributes
 9056|       |     */
 9057|   918k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9057:9): [True: 294k, False: 623k]
  ------------------
 9058|   294k|        xmlDefAttrsPtr defaults;
 9059|       |
 9060|   294k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9061|   294k|	if (defaults != NULL) {
  ------------------
  |  Branch (9061:6): [True: 232k, False: 62.2k]
  ------------------
 9062|   931k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9062:18): [True: 699k, False: 232k]
  ------------------
 9063|   699k|                xmlDefAttr *attr = &defaults->attrs[i];
 9064|       |
 9065|   699k|	        attname = attr->name.name;
 9066|   699k|		aprefix = attr->prefix.name;
 9067|       |
 9068|   699k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9068:7): [True: 36.0k, False: 663k]
  |  Branch (9068:39): [True: 34.9k, False: 1.06k]
  ------------------
 9069|  34.9k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9070|       |
 9071|  34.9k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9071:25): [True: 33.8k, False: 1.08k]
  ------------------
 9072|  33.8k|                        nbNs++;
 9073|   664k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9073:14): [True: 337k, False: 326k]
  ------------------
 9074|   337k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9075|       |
 9076|   337k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9076:25): [True: 306k, False: 31.1k]
  ------------------
 9077|   337k|                                      NULL, 1) > 0)
 9078|   306k|                        nbNs++;
 9079|   337k|		} else {
 9080|   326k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   326k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9080:25): [True: 0, False: 326k]
  ------------------
 9081|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9082|      0|                                    "Maximum number of attributes exceeded");
 9083|      0|                        break;
 9084|      0|                    }
 9085|   326k|                    nbTotalDef += 1;
 9086|   326k|                }
 9087|   699k|	    }
 9088|   232k|	}
 9089|   294k|    }
 9090|       |
 9091|       |    /*
 9092|       |     * Resolve attribute namespaces
 9093|       |     */
 9094|  1.06M|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9094:17): [True: 144k, False: 918k]
  ------------------
 9095|   144k|        attname = atts[i];
 9096|   144k|        aprefix = atts[i+1];
 9097|       |
 9098|       |        /*
 9099|       |	* The default namespace does not apply to attribute names.
 9100|       |	*/
 9101|   144k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9101:6): [True: 57.7k, False: 87.0k]
  ------------------
 9102|  57.7k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  57.7k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9103|  87.0k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9103:20): [True: 68.8k, False: 18.1k]
  ------------------
 9104|  68.8k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  68.8k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9105|  68.8k|        } else {
 9106|  18.1k|            haprefix.name = aprefix;
 9107|  18.1k|            haprefix.hashValue = (size_t) atts[i+2];
 9108|  18.1k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9109|       |
 9110|  18.1k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9110:10): [True: 12.1k, False: 5.94k]
  |  Branch (9110:34): [True: 196, False: 5.75k]
  ------------------
 9111|  12.3k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9112|  12.3k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9113|  12.3k|		    aprefix, attname, localname);
 9114|  12.3k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  12.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9115|  12.3k|            }
 9116|  18.1k|        }
 9117|       |
 9118|   144k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   144k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9119|   144k|    }
 9120|       |
 9121|       |    /*
 9122|       |     * Maximum number of attributes including default attributes.
 9123|       |     */
 9124|   918k|    maxAtts = nratts + nbTotalDef;
 9125|       |
 9126|       |    /*
 9127|       |     * Verify that attribute names are unique.
 9128|       |     */
 9129|   918k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9129:9): [True: 57.0k, False: 861k]
  ------------------
 9130|  57.0k|        attrHashSize = 4;
 9131|   144k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9131:16): [True: 87.5k, False: 57.0k]
  ------------------
 9132|  87.5k|            attrHashSize *= 2;
 9133|       |
 9134|  57.0k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9134:13): [True: 8.06k, False: 49.0k]
  ------------------
 9135|  8.06k|            xmlAttrHashBucket *tmp;
 9136|       |
 9137|  8.06k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9138|  8.06k|            if (tmp == NULL) {
  ------------------
  |  Branch (9138:17): [True: 3, False: 8.06k]
  ------------------
 9139|      3|                xmlErrMemory(ctxt);
 9140|      3|                goto done;
 9141|      3|            }
 9142|       |
 9143|  8.06k|            ctxt->attrHash = tmp;
 9144|  8.06k|            ctxt->attrHashMax = attrHashSize;
 9145|  8.06k|        }
 9146|       |
 9147|  57.0k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9148|       |
 9149|   170k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9149:28): [True: 113k, False: 57.0k]
  ------------------
 9150|   113k|            const xmlChar *nsuri;
 9151|   113k|            unsigned hashValue, nameHashValue, uriHashValue;
 9152|   113k|            int res;
 9153|       |
 9154|   113k|            attname = atts[i];
 9155|   113k|            aprefix = atts[i+1];
 9156|   113k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   113k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9157|       |            /* Hash values always have bit 31 set, see dict.c */
 9158|   113k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9159|       |
 9160|   113k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|   113k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9160:17): [True: 46.9k, False: 66.3k]
  ------------------
 9161|       |                /*
 9162|       |                 * Prefix with empty namespace means an undeclared
 9163|       |                 * prefix which was already reported above.
 9164|       |                 */
 9165|  46.9k|                if (aprefix != NULL)
  ------------------
  |  Branch (9165:21): [True: 9.98k, False: 36.9k]
  ------------------
 9166|  9.98k|                    continue;
 9167|  36.9k|                nsuri = NULL;
 9168|  36.9k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  36.9k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9169|  66.3k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  66.3k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9169:24): [True: 60.8k, False: 5.53k]
  ------------------
 9170|  60.8k|                nsuri = ctxt->str_xml_ns;
 9171|  60.8k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  60.8k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9172|  60.8k|            } else {
 9173|  5.53k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9174|  5.53k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9175|  5.53k|            }
 9176|       |
 9177|   103k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9178|   103k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9179|   103k|                                    hashValue, i);
 9180|   103k|            if (res < 0)
  ------------------
  |  Branch (9180:17): [True: 0, False: 103k]
  ------------------
 9181|      0|                continue;
 9182|       |
 9183|       |            /*
 9184|       |             * [ WFC: Unique Att Spec ]
 9185|       |             * No attribute name may appear more than once in the same
 9186|       |             * start-tag or empty-element tag.
 9187|       |             * As extended by the Namespace in XML REC.
 9188|       |             */
 9189|   103k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9189:17): [True: 75.1k, False: 28.1k]
  ------------------
 9190|  75.1k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9190:21): [True: 72.9k, False: 2.25k]
  ------------------
 9191|  72.9k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9192|  72.9k|                    numDupErr += 1;
 9193|  72.9k|                } else {
 9194|  2.25k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9195|  2.25k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9196|  2.25k|                             attname, nsuri, NULL);
 9197|  2.25k|                    numNsErr += 1;
 9198|  2.25k|                }
 9199|  75.1k|            }
 9200|   103k|        }
 9201|  57.0k|    }
 9202|       |
 9203|       |    /*
 9204|       |     * Default attributes
 9205|       |     */
 9206|   918k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9206:9): [True: 294k, False: 623k]
  ------------------
 9207|   294k|        xmlDefAttrsPtr defaults;
 9208|       |
 9209|   294k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9210|   294k|	if (defaults != NULL) {
  ------------------
  |  Branch (9210:6): [True: 232k, False: 62.2k]
  ------------------
 9211|   931k|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9211:18): [True: 699k, False: 232k]
  ------------------
 9212|   699k|                xmlDefAttr *attr = &defaults->attrs[i];
 9213|   699k|                const xmlChar *nsuri = NULL;
 9214|   699k|                unsigned hashValue, uriHashValue = 0;
 9215|   699k|                int res;
 9216|       |
 9217|   699k|	        attname = attr->name.name;
 9218|   699k|		aprefix = attr->prefix.name;
 9219|       |
 9220|   699k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9220:7): [True: 36.0k, False: 663k]
  |  Branch (9220:39): [True: 34.9k, False: 1.06k]
  ------------------
 9221|  34.9k|                    continue;
 9222|   664k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9222:7): [True: 337k, False: 326k]
  ------------------
 9223|   337k|                    continue;
 9224|       |
 9225|   326k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9225:21): [True: 145k, False: 180k]
  ------------------
 9226|   145k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   145k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9227|   145k|                    nsuri = NULL;
 9228|   145k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   145k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9229|   180k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9229:28): [True: 47.4k, False: 133k]
  ------------------
 9230|  47.4k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  47.4k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9231|  47.4k|                    nsuri = ctxt->str_xml_ns;
 9232|  47.4k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  47.4k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9233|   133k|                } else {
 9234|   133k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9235|   133k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9235:25): [True: 113k, False: 20.0k]
  ------------------
 9236|   113k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9236:25): [True: 205, False: 19.8k]
  ------------------
 9237|   113k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9238|   113k|                                 "Namespace prefix %s for %s on %s is not "
 9239|   113k|                                 "defined\n",
 9240|   113k|                                 aprefix, attname, localname);
 9241|   113k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   113k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9242|   113k|                        nsuri = NULL;
 9243|   113k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   113k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9244|   113k|                    } else {
 9245|  19.8k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9246|  19.8k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9247|  19.8k|                    }
 9248|   133k|                }
 9249|       |
 9250|       |                /*
 9251|       |                 * Check whether the attribute exists
 9252|       |                 */
 9253|   326k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9253:21): [True: 294k, False: 31.9k]
  ------------------
 9254|   294k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9255|   294k|                                                   uriHashValue);
 9256|   294k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9257|   294k|                                            hashValue, nbatts);
 9258|   294k|                    if (res < 0)
  ------------------
  |  Branch (9258:25): [True: 0, False: 294k]
  ------------------
 9259|      0|                        continue;
 9260|   294k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9260:25): [True: 9.97k, False: 284k]
  ------------------
 9261|  9.97k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9261:29): [True: 1.12k, False: 8.84k]
  ------------------
 9262|  1.12k|                            continue;
 9263|  8.84k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9264|  8.84k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9265|  8.84k|                                 attname, nsuri, NULL);
 9266|  8.84k|                    }
 9267|   294k|                }
 9268|       |
 9269|   325k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9270|       |
 9271|   325k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9271:21): [True: 1.40k, False: 324k]
  |  Branch (9271:39): [True: 1.07k, False: 323k]
  ------------------
 9272|  2.48k|                    res = xmlCtxtGrowAttrs(ctxt);
 9273|       |
 9274|  2.48k|                    maxatts = ctxt->maxatts;
 9275|  2.48k|                    atts = ctxt->atts;
 9276|       |
 9277|  2.48k|                    if (res < 0) {
  ------------------
  |  Branch (9277:25): [True: 2, False: 2.48k]
  ------------------
 9278|      2|                        localname = NULL;
 9279|      2|                        goto done;
 9280|      2|                    }
 9281|  2.48k|                }
 9282|       |
 9283|   325k|                atts[nbatts++] = attname;
 9284|   325k|                atts[nbatts++] = aprefix;
 9285|   325k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   325k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9286|   325k|                atts[nbatts++] = attr->value.name;
 9287|   325k|                atts[nbatts++] = attr->valueEnd;
 9288|       |
 9289|   325k|#ifdef LIBXML_VALID_ENABLED
 9290|       |                /*
 9291|       |                 * This should be moved to valid.c, but we don't keep track
 9292|       |                 * whether an attribute was defaulted.
 9293|       |                 */
 9294|   325k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9294:21): [True: 168k, False: 157k]
  ------------------
 9295|   168k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9295:21): [True: 642, False: 167k]
  ------------------
 9296|    642|                    (attr->external != 0)) {
  ------------------
  |  Branch (9296:21): [True: 437, False: 205]
  ------------------
 9297|    437|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9298|    437|                            "standalone: attribute %s on %s defaulted "
 9299|    437|                            "from external subset\n",
 9300|    437|                            attname, localname);
 9301|    437|                }
 9302|   325k|#endif
 9303|   325k|                nbdef++;
 9304|   325k|	    }
 9305|   232k|	}
 9306|   294k|    }
 9307|       |
 9308|       |    /*
 9309|       |     * Using a single hash table for nsUri/localName pairs cannot
 9310|       |     * detect duplicate QNames reliably. The following example will
 9311|       |     * only result in two namespace errors.
 9312|       |     *
 9313|       |     * <doc xmlns:a="a" xmlns:b="a">
 9314|       |     *   <elem a:a="" b:a="" b:a=""/>
 9315|       |     * </doc>
 9316|       |     *
 9317|       |     * If we saw more than one namespace error but no duplicate QNames
 9318|       |     * were found, we have to scan for duplicate QNames.
 9319|       |     */
 9320|   918k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9320:9): [True: 917k, False: 1.10k]
  |  Branch (9320:29): [True: 623, False: 916k]
  ------------------
 9321|    623|        memset(ctxt->attrHash, -1,
 9322|    623|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9323|       |
 9324|  4.68k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9324:28): [True: 4.05k, False: 623]
  ------------------
 9325|  4.05k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9326|  4.05k|            int res;
 9327|       |
 9328|  4.05k|            aprefix = atts[i+1];
 9329|  4.05k|            if (aprefix == NULL)
  ------------------
  |  Branch (9329:17): [True: 388, False: 3.67k]
  ------------------
 9330|    388|                continue;
 9331|       |
 9332|  3.67k|            attname = atts[i];
 9333|       |            /* Hash values always have bit 31 set, see dict.c */
 9334|  3.67k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9335|  3.67k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9336|       |
 9337|  3.67k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9338|  3.67k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9339|  3.67k|                                         aprefix, hashValue, i);
 9340|  3.67k|            if (res < INT_MAX)
  ------------------
  |  Branch (9340:17): [True: 1.64k, False: 2.02k]
  ------------------
 9341|  1.64k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9342|  3.67k|        }
 9343|    623|    }
 9344|       |
 9345|       |    /*
 9346|       |     * Reconstruct attribute pointers
 9347|       |     */
 9348|  1.38M|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9348:24): [True: 470k, False: 918k]
  ------------------
 9349|       |        /* namespace URI */
 9350|   470k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   470k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9351|   470k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9351:13): [True: 328k, False: 141k]
  ------------------
 9352|   328k|            atts[i+2] = NULL;
 9353|   141k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9353:18): [True: 116k, False: 25.6k]
  ------------------
 9354|   116k|            atts[i+2] = ctxt->str_xml_ns;
 9355|  25.6k|        else
 9356|  25.6k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9357|       |
 9358|   470k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9358:13): [True: 144k, False: 325k]
  |  Branch (9358:29): [True: 122k, False: 22.0k]
  ------------------
 9359|   122k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2265|   122k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|   122k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9360|   122k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2265|   122k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|   122k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9361|   122k|        }
 9362|   470k|    }
 9363|       |
 9364|   918k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9365|   918k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9365:9): [True: 102k, False: 815k]
  |  Branch (9365:29): [True: 29.3k, False: 73.3k]
  ------------------
 9366|  29.3k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9367|  29.3k|	         "Namespace prefix %s on %s is not defined\n",
 9368|  29.3k|		 prefix, localname, NULL);
 9369|  29.3k|    }
 9370|   918k|    *pref = prefix;
 9371|   918k|    *URI = uri;
 9372|       |
 9373|       |    /*
 9374|       |     * SAX callback
 9375|       |     */
 9376|   918k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9376:9): [True: 918k, False: 0]
  |  Branch (9376:32): [True: 918k, False: 0]
  ------------------
 9377|   918k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9377:2): [True: 670k, False: 248k]
  ------------------
 9378|   670k|	if (nbNs > 0)
  ------------------
  |  Branch (9378:6): [True: 118k, False: 551k]
  ------------------
 9379|   118k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9380|   118k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9381|   118k|			  nbatts / 5, nbdef, atts);
 9382|   551k|	else
 9383|   551k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9384|   551k|                          0, NULL, nbatts / 5, nbdef, atts);
 9385|   670k|    }
 9386|       |
 9387|   918k|done:
 9388|       |    /*
 9389|       |     * Free allocated attribute values
 9390|       |     */
 9391|   918k|    if (attval != 0) {
  ------------------
  |  Branch (9391:9): [True: 11.5k, False: 906k]
  ------------------
 9392|  94.7k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9392:21): [True: 83.1k, False: 11.5k]
  ------------------
 9393|  83.1k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9393:10): [True: 22.0k, False: 61.0k]
  ------------------
 9394|  22.0k|	        xmlFree((xmlChar *) atts[i+3]);
 9395|  11.5k|    }
 9396|       |
 9397|   918k|    *nbNsPtr = nbNs;
 9398|   918k|    return(localname);
 9399|   918k|}
parser.c:xmlParserNsStartElement:
 1504|   945k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1505|   945k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1505:9): [True: 0, False: 945k]
  ------------------
 1506|      0|        return(-1);
 1507|   945k|    nsdb->elementId++;
 1508|       |
 1509|   945k|    return(0);
 1510|   945k|}
parser.c:xmlParseQNameHashed:
 8429|  1.37M|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8430|  1.37M|    xmlHashedString l, p;
 8431|  1.37M|    int start, isNCName = 0;
 8432|       |
 8433|  1.37M|    l.name = NULL;
 8434|  1.37M|    p.name = NULL;
 8435|       |
 8436|  1.37M|    GROW;
  ------------------
  |  | 2308|  1.37M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.37M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.37M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.00M, False: 374k]
  |  |  ------------------
  |  | 2309|  1.37M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.00M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 59.9k, False: 942k]
  |  |  ------------------
  |  | 2310|  1.37M|	xmlParserGrow(ctxt);
  ------------------
 8437|  1.37M|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|  1.37M|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|  1.37M|#define BASE_PTR ctxt->input->base
  ------------------
 8438|       |
 8439|  1.37M|    l = xmlParseNCName(ctxt);
 8440|  1.37M|    if (l.name != NULL) {
  ------------------
  |  Branch (8440:9): [True: 1.18M, False: 196k]
  ------------------
 8441|  1.18M|        isNCName = 1;
 8442|  1.18M|        if (CUR == ':') {
  ------------------
  |  | 2262|  1.18M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8442:13): [True: 278k, False: 902k]
  ------------------
 8443|   278k|            NEXT;
  ------------------
  |  | 2316|   278k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8444|   278k|            p = l;
 8445|   278k|            l = xmlParseNCName(ctxt);
 8446|   278k|        }
 8447|  1.18M|    }
 8448|  1.37M|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2262|  1.17M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8448:9): [True: 206k, False: 1.17M]
  |  Branch (8448:29): [True: 2.03k, False: 1.16M]
  ------------------
 8449|   208k|        xmlChar *tmp;
 8450|       |
 8451|   208k|        l.name = NULL;
 8452|   208k|        p.name = NULL;
 8453|   208k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2262|   196k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8453:13): [True: 196k, False: 11.8k]
  |  Branch (8453:32): [True: 191k, False: 4.87k]
  ------------------
 8454|   191k|            return(l);
 8455|  16.6k|        tmp = xmlParseNmtoken(ctxt);
 8456|  16.6k|        if (tmp != NULL)
  ------------------
  |  Branch (8456:13): [True: 8.16k, False: 8.53k]
  ------------------
 8457|  8.16k|            xmlFree(tmp);
 8458|  16.6k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2265|  16.6k|#define BASE_PTR ctxt->input->base
  ------------------
 8459|  16.6k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2264|  16.6k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2265|  16.6k|#define BASE_PTR ctxt->input->base
  ------------------
 8460|  16.6k|        if (l.name == NULL) {
  ------------------
  |  Branch (8460:13): [True: 1, False: 16.6k]
  ------------------
 8461|      1|            xmlErrMemory(ctxt);
 8462|      1|            return(l);
 8463|      1|        }
 8464|  16.6k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8465|  16.6k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8466|  16.6k|    }
 8467|       |
 8468|  1.18M|    *prefix = p;
 8469|  1.18M|    return(l);
 8470|  1.37M|}
parser.c:xmlParseNCName:
 3283|  1.65M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3284|  1.65M|    const xmlChar *in, *e;
 3285|  1.65M|    xmlHashedString ret;
 3286|  1.65M|    size_t count = 0;
 3287|  1.65M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3287:24): [True: 1.05M, False: 597k]
  ------------------
 3288|  1.05M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.05M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3289|  1.65M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  2.25M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3290|       |
 3291|  1.65M|    ret.name = NULL;
 3292|       |
 3293|       |    /*
 3294|       |     * Accelerator for simple ASCII names
 3295|       |     */
 3296|  1.65M|    in = ctxt->input->cur;
 3297|  1.65M|    e = ctxt->input->end;
 3298|  1.65M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3298:11): [True: 1.44M, False: 212k]
  |  Branch (3298:28): [True: 1.42M, False: 16.2k]
  ------------------
 3299|   228k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3299:4): [True: 35.7k, False: 193k]
  |  Branch (3299:21): [True: 18.1k, False: 17.6k]
  ------------------
 3300|  1.44M|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3300:3): [True: 714, False: 210k]
  |  Branch (3300:20): [True: 1.44M, False: 0]
  ------------------
 3301|  1.44M|	in++;
 3302|  4.74M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3302:11): [True: 1.92M, False: 2.82M]
  |  Branch (3302:28): [True: 1.91M, False: 10.2k]
  ------------------
 3303|  2.83M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3303:11): [True: 304k, False: 2.53M]
  |  Branch (3303:28): [True: 291k, False: 13.1k]
  ------------------
 3304|  2.54M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3304:11): [True: 2.01M, False: 531k]
  |  Branch (3304:28): [True: 1.08M, False: 924k]
  ------------------
 3305|  1.45M|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3305:10): [True: 2.38k, False: 1.45M]
  |  Branch (3305:26): [True: 6.37k, False: 1.44M]
  ------------------
 3306|  3.30M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3306:10): [True: 2.11k, False: 1.44M]
  |  Branch (3306:27): [True: 3.30M, False: 0]
  ------------------
 3307|  3.30M|	    in++;
 3308|  1.44M|	if (in >= e)
  ------------------
  |  Branch (3308:6): [True: 675, False: 1.44M]
  ------------------
 3309|    675|	    goto complex;
 3310|  1.44M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3310:6): [True: 1.44M, False: 3.70k]
  |  Branch (3310:19): [True: 1.43M, False: 9.00k]
  ------------------
 3311|  1.43M|	    count = in - ctxt->input->cur;
 3312|  1.43M|            if (count > maxLength) {
  ------------------
  |  Branch (3312:17): [True: 16, False: 1.43M]
  ------------------
 3313|     16|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3314|     16|                return(ret);
 3315|     16|            }
 3316|  1.43M|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3317|  1.43M|	    ctxt->input->cur = in;
 3318|  1.43M|	    ctxt->input->col += count;
 3319|  1.43M|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3319:10): [True: 4, False: 1.43M]
  ------------------
 3320|      4|	        xmlErrMemory(ctxt);
 3321|      4|	    }
 3322|  1.43M|	    return(ret);
 3323|  1.43M|	}
 3324|  1.44M|    }
 3325|   223k|complex:
 3326|   223k|    return(xmlParseNCNameComplex(ctxt));
 3327|  1.65M|}
parser.c:xmlParseNCNameComplex:
 3230|   223k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3231|   223k|    xmlHashedString ret;
 3232|   223k|    int len = 0, l;
 3233|   223k|    int c;
 3234|   223k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3234:21): [True: 188k, False: 34.6k]
  ------------------
 3235|   188k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   188k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3236|   223k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  34.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3237|   223k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3237:17): [True: 143k, False: 80.5k]
  ------------------
 3238|   223k|    size_t startPosition = 0;
 3239|       |
 3240|   223k|    ret.name = NULL;
 3241|   223k|    ret.hashValue = 0;
 3242|       |
 3243|       |    /*
 3244|       |     * Handler for more complex cases
 3245|       |     */
 3246|   223k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|   223k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|   223k|#define BASE_PTR ctxt->input->base
  ------------------
 3247|   223k|    c = xmlCurrentChar(ctxt, &l);
 3248|   223k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3248:9): [True: 1.75k, False: 221k]
  |  Branch (3248:23): [True: 2.16k, False: 219k]
  |  Branch (3248:37): [True: 6.53k, False: 213k]
  ------------------
 3249|   213k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3249:3): [True: 189k, False: 23.3k]
  |  Branch (3249:36): [True: 5.75k, False: 17.5k]
  ------------------
 3250|   205k|	return(ret);
 3251|   205k|    }
 3252|       |
 3253|  8.27M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3253:12): [True: 8.26M, False: 721]
  |  Branch (3253:26): [True: 8.26M, False: 1.39k]
  |  Branch (3253:40): [True: 8.26M, False: 237]
  ------------------
 3254|  8.26M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3254:6): [True: 8.25M, False: 13.8k]
  |  Branch (3254:33): [True: 8.25M, False: 1.40k]
  ------------------
 3255|  8.25M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3255:13): [True: 8.25M, False: 0]
  ------------------
 3256|  8.25M|	    len += l;
 3257|  8.25M|	NEXTL(l);
  ------------------
  |  | 2325|  8.25M|#define NEXTL(l) do {							\
  |  | 2326|  8.25M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 8.25M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  8.25M|    } else ctxt->input->col++;						\
  |  | 2329|  8.25M|    ctxt->input->cur += l;				\
  |  | 2330|  8.25M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 8.25M]
  |  |  ------------------
  ------------------
 3258|  8.25M|	c = xmlCurrentChar(ctxt, &l);
 3259|  8.25M|    }
 3260|  17.5k|    if (len > maxLength) {
  ------------------
  |  Branch (3260:9): [True: 55, False: 17.5k]
  ------------------
 3261|     55|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3262|     55|        return(ret);
 3263|     55|    }
 3264|  17.5k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2265|  17.5k|#define BASE_PTR ctxt->input->base
  ------------------
 3265|  17.5k|    if (ret.name == NULL)
  ------------------
  |  Branch (3265:9): [True: 2, False: 17.5k]
  ------------------
 3266|      2|        xmlErrMemory(ctxt);
 3267|  17.5k|    return(ret);
 3268|  17.5k|}
parser.c:xmlParseAttribute2:
 8567|   416k|{
 8568|   416k|    xmlHashedString hname;
 8569|   416k|    const xmlChar *prefix, *name;
 8570|   416k|    xmlChar *val = NULL, *internal_val = NULL;
 8571|   416k|    int special = 0;
 8572|   416k|    int isNamespace;
 8573|   416k|    int flags;
 8574|       |
 8575|   416k|    *value = NULL;
 8576|   416k|    GROW;
  ------------------
  |  | 2308|   416k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   416k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   416k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 264k, False: 151k]
  |  |  ------------------
  |  | 2309|   416k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   264k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 17.6k, False: 247k]
  |  |  ------------------
  |  | 2310|   416k|	xmlParserGrow(ctxt);
  ------------------
 8577|   416k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8578|   416k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8578:9): [True: 163k, False: 252k]
  ------------------
 8579|   163k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8580|   163k|                       "error parsing attribute name\n");
 8581|   163k|        return(hname);
 8582|   163k|    }
 8583|   252k|    name = hname.name;
 8584|   252k|    prefix = hprefix->name;
 8585|       |
 8586|       |    /*
 8587|       |     * get the type if needed
 8588|       |     */
 8589|   252k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8589:9): [True: 35.0k, False: 217k]
  ------------------
 8590|  35.0k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  35.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8591|  35.0k|                                              prefix, name));
 8592|  35.0k|    }
 8593|       |
 8594|       |    /*
 8595|       |     * read the value
 8596|       |     */
 8597|   252k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   252k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8598|   252k|    if (RAW != '=') {
  ------------------
  |  | 2261|   252k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8598:9): [True: 14.0k, False: 238k]
  ------------------
 8599|  14.0k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8600|  14.0k|                          "Specification mandates value for attribute %s\n",
 8601|  14.0k|                          name);
 8602|  14.0k|        goto error;
 8603|  14.0k|    }
 8604|       |
 8605|       |
 8606|   238k|    NEXT;
  ------------------
  |  | 2316|   238k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8607|   238k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   238k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8608|   238k|    flags = 0;
 8609|   238k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8609:21): [True: 77.0k, False: 161k]
  |  Branch (8609:41): [True: 16.4k, False: 60.5k]
  ------------------
 8610|   222k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8610:20): [True: 74.1k, False: 148k]
  ------------------
 8611|   238k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8612|   238k|                                   isNamespace);
 8613|   238k|    if (val == NULL)
  ------------------
  |  Branch (8613:9): [True: 4.28k, False: 234k]
  ------------------
 8614|  4.28k|        goto error;
 8615|       |
 8616|   234k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   234k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8617|       |
 8618|   234k|#ifdef LIBXML_VALID_ENABLED
 8619|   234k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8619:9): [True: 31.5k, False: 203k]
  ------------------
 8620|  31.5k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8620:9): [True: 410, False: 31.0k]
  ------------------
 8621|    410|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    410|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8621:9): [True: 140, False: 270]
  ------------------
 8622|    140|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    140|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8622:9): [True: 74, False: 66]
  ------------------
 8623|     74|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8624|     74|                         "standalone: normalization of attribute %s on %s "
 8625|     74|                         "by external subset declaration\n",
 8626|     74|                         name, elem);
 8627|     74|    }
 8628|   234k|#endif
 8629|       |
 8630|   234k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8630:9): [True: 68.8k, False: 165k]
  ------------------
 8631|       |        /*
 8632|       |         * Check that xml:lang conforms to the specification
 8633|       |         * No more registered as an error, just generate a warning now
 8634|       |         * since this was deprecated in XML second edition
 8635|       |         */
 8636|  68.8k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  14.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8636:13): [True: 14.8k, False: 54.0k]
  |  Branch (8636:33): [True: 10.9k, False: 3.94k]
  ------------------
 8637|  10.9k|            internal_val = xmlStrndup(val, *len);
 8638|  10.9k|            if (internal_val == NULL)
  ------------------
  |  Branch (8638:17): [True: 2, False: 10.9k]
  ------------------
 8639|      2|                goto mem_error;
 8640|  10.9k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8640:17): [True: 9.77k, False: 1.16k]
  ------------------
 8641|  9.77k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8642|  9.77k|                              "Malformed value for xml:lang : %s\n",
 8643|  9.77k|                              internal_val, NULL);
 8644|  9.77k|            }
 8645|  10.9k|        }
 8646|       |
 8647|       |        /*
 8648|       |         * Check that xml:space conforms to the specification
 8649|       |         */
 8650|  68.8k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  68.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8650:13): [True: 9.51k, False: 59.3k]
  ------------------
 8651|  9.51k|            internal_val = xmlStrndup(val, *len);
 8652|  9.51k|            if (internal_val == NULL)
  ------------------
  |  Branch (8652:17): [True: 1, False: 9.50k]
  ------------------
 8653|      1|                goto mem_error;
 8654|  9.50k|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|  9.50k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8654:17): [True: 328, False: 9.18k]
  ------------------
 8655|    328|                *(ctxt->space) = 0;
 8656|  9.18k|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|  9.18k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8656:22): [True: 8.95k, False: 222]
  ------------------
 8657|  8.95k|                *(ctxt->space) = 1;
 8658|    222|            else {
 8659|    222|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8660|    222|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8661|    222|                              internal_val, NULL);
 8662|    222|            }
 8663|  9.50k|        }
 8664|  68.8k|        if (internal_val) {
  ------------------
  |  Branch (8664:13): [True: 20.4k, False: 48.4k]
  ------------------
 8665|  20.4k|            xmlFree(internal_val);
 8666|  20.4k|        }
 8667|  68.8k|    }
 8668|       |
 8669|   234k|    *value = val;
 8670|   234k|    return (hname);
 8671|       |
 8672|      3|mem_error:
 8673|      3|    xmlErrMemory(ctxt);
 8674|  18.2k|error:
 8675|  18.2k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8675:9): [True: 3, False: 18.2k]
  |  Branch (8675:26): [True: 1, False: 2]
  ------------------
 8676|      1|        xmlFree(val);
 8677|  18.2k|    return(hname);
 8678|      3|}
parser.c:xmlNsWarn:
  406|  4.33k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  4.33k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  4.33k|}
parser.c:xmlCtxtGrowAttrs:
 1886|  27.2k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1887|  27.2k|    const xmlChar **atts;
 1888|  27.2k|    unsigned *attallocs;
 1889|  27.2k|    int newSize;
 1890|       |
 1891|  27.2k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1892|  27.2k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1893|  27.2k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  27.2k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1894|  27.2k|    if (newSize < 0) {
  ------------------
  |  Branch (1894:9): [True: 0, False: 27.2k]
  ------------------
 1895|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1896|      0|                    "Maximum number of attributes exceeded");
 1897|      0|        return(-1);
 1898|      0|    }
 1899|       |
 1900|  27.2k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1901|  27.2k|    if (atts == NULL)
  ------------------
  |  Branch (1901:9): [True: 6, False: 27.2k]
  ------------------
 1902|      6|        goto mem_error;
 1903|  27.2k|    ctxt->atts = atts;
 1904|       |
 1905|  27.2k|    attallocs = xmlRealloc(ctxt->attallocs,
 1906|  27.2k|                           newSize * sizeof(attallocs[0]));
 1907|  27.2k|    if (attallocs == NULL)
  ------------------
  |  Branch (1907:9): [True: 6, False: 27.1k]
  ------------------
 1908|      6|        goto mem_error;
 1909|  27.1k|    ctxt->attallocs = attallocs;
 1910|       |
 1911|  27.1k|    ctxt->maxatts = newSize * 5;
 1912|       |
 1913|  27.1k|    return(0);
 1914|       |
 1915|     12|mem_error:
 1916|     12|    xmlErrMemory(ctxt);
 1917|     12|    return(-1);
 1918|  27.2k|}
parser.c:xmlAttrHashInsert:
 8694|   398k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8695|   398k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8696|   398k|    xmlAttrHashBucket *bucket;
 8697|   398k|    unsigned hindex;
 8698|       |
 8699|   398k|    hindex = hashValue & (size - 1);
 8700|   398k|    bucket = &table[hindex];
 8701|       |
 8702|   429k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8702:12): [True: 116k, False: 312k]
  ------------------
 8703|   116k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8704|       |
 8705|   116k|        if (name == atts[0]) {
  ------------------
  |  Branch (8705:13): [True: 87.0k, False: 29.3k]
  ------------------
 8706|  87.0k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  87.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8707|       |
 8708|  87.0k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  87.0k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8708:17): [True: 23.3k, False: 63.7k]
  |  Branch (8708:17): [True: 85.1k, False: 1.90k]
  ------------------
 8709|  87.0k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  63.7k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8709:17): [True: 59.3k, False: 4.39k]
  ------------------
 8710|  63.7k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8711|  85.1k|                return(bucket->index);
 8712|  87.0k|        }
 8713|       |
 8714|  31.2k|        hindex++;
 8715|  31.2k|        bucket++;
 8716|  31.2k|        if (hindex >= size) {
  ------------------
  |  Branch (8716:13): [True: 2.35k, False: 28.9k]
  ------------------
 8717|  2.35k|            hindex = 0;
 8718|  2.35k|            bucket = table;
 8719|  2.35k|        }
 8720|  31.2k|    }
 8721|       |
 8722|   312k|    bucket->index = aindex;
 8723|       |
 8724|       |    return(INT_MAX);
 8725|   398k|}
parser.c:xmlAttrHashInsertQName:
 8730|  3.67k|                       unsigned hashValue, int aindex) {
 8731|  3.67k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8732|  3.67k|    xmlAttrHashBucket *bucket;
 8733|  3.67k|    unsigned hindex;
 8734|       |
 8735|  3.67k|    hindex = hashValue & (size - 1);
 8736|  3.67k|    bucket = &table[hindex];
 8737|       |
 8738|  4.84k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8738:12): [True: 2.82k, False: 2.02k]
  ------------------
 8739|  2.82k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8740|       |
 8741|  2.82k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8741:13): [True: 2.19k, False: 634]
  |  Branch (8741:34): [True: 1.64k, False: 545]
  ------------------
 8742|  1.64k|            return(bucket->index);
 8743|       |
 8744|  1.17k|        hindex++;
 8745|  1.17k|        bucket++;
 8746|  1.17k|        if (hindex >= size) {
  ------------------
  |  Branch (8746:13): [True: 195, False: 984]
  ------------------
 8747|    195|            hindex = 0;
 8748|    195|            bucket = table;
 8749|    195|        }
 8750|  1.17k|    }
 8751|       |
 8752|  2.02k|    bucket->index = aindex;
 8753|       |
 8754|       |    return(INT_MAX);
 8755|  3.67k|}
parser.c:xmlParserNsLookupUri:
 1573|   918k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1574|   918k|    const xmlChar *ret;
 1575|   918k|    int nsIndex;
 1576|       |
 1577|   918k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1577:9): [True: 451, False: 917k]
  ------------------
 1578|    451|        return(ctxt->str_xml_ns);
 1579|       |
 1580|       |    /*
 1581|       |     * minNsIndex is used when building an entity tree. We must
 1582|       |     * ignore namespaces declared outside the entity.
 1583|       |     */
 1584|   917k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1585|   917k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1585:9): [True: 774k, False: 143k]
  |  Branch (1585:33): [True: 519, False: 142k]
  ------------------
 1586|   775k|        return(NULL);
 1587|       |
 1588|   142k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1589|   142k|    if (ret[0] == 0)
  ------------------
  |  Branch (1589:9): [True: 19.4k, False: 123k]
  ------------------
 1590|  19.4k|        ret = NULL;
 1591|   142k|    return(ret);
 1592|   917k|}
parser.c:nameNsPush:
 2098|  1.09M|{
 2099|  1.09M|    xmlStartTag *tag;
 2100|       |
 2101|  1.09M|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2101:9): [True: 48.8k, False: 1.04M]
  ------------------
 2102|  48.8k|        const xmlChar **tmp;
 2103|  48.8k|        xmlStartTag *tmp2;
 2104|  48.8k|        int newSize;
 2105|       |
 2106|  48.8k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2107|  48.8k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2108|  48.8k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  48.8k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2109|  48.8k|        if (newSize < 0)
  ------------------
  |  Branch (2109:13): [True: 0, False: 48.8k]
  ------------------
 2110|      0|            goto mem_error;
 2111|       |
 2112|  48.8k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2113|  48.8k|        if (tmp == NULL)
  ------------------
  |  Branch (2113:13): [True: 16, False: 48.8k]
  ------------------
 2114|     16|	    goto mem_error;
 2115|  48.8k|	ctxt->nameTab = tmp;
 2116|       |
 2117|  48.8k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2118|  48.8k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2118:13): [True: 19, False: 48.8k]
  ------------------
 2119|     19|	    goto mem_error;
 2120|  48.8k|	ctxt->pushTab = tmp2;
 2121|       |
 2122|  48.8k|        ctxt->nameMax = newSize;
 2123|  1.04M|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2123:16): [True: 32.7k, False: 1.00M]
  ------------------
 2124|  32.7k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2125|  32.7k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2125:13): [True: 13, False: 32.7k]
  ------------------
 2126|     13|            goto mem_error;
 2127|  32.7k|    }
 2128|  1.09M|    ctxt->nameTab[ctxt->nameNr] = value;
 2129|  1.09M|    ctxt->name = value;
 2130|  1.09M|    tag = &ctxt->pushTab[ctxt->nameNr];
 2131|  1.09M|    tag->prefix = prefix;
 2132|  1.09M|    tag->URI = URI;
 2133|  1.09M|    tag->line = line;
 2134|  1.09M|    tag->nsNr = nsNr;
 2135|  1.09M|    return (ctxt->nameNr++);
 2136|     48|mem_error:
 2137|     48|    xmlErrMemory(ctxt);
 2138|     48|    return (-1);
 2139|  1.09M|}
parser.c:xmlParseElementEnd:
 9856|   179k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9857|   179k|    xmlNodePtr cur = ctxt->node;
 9858|       |
 9859|   179k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9859:9): [True: 6, False: 179k]
  ------------------
 9860|      6|        if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2261|      6|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9860:13): [True: 3, False: 3]
  |  Branch (9860:29): [True: 2, False: 1]
  ------------------
 9861|      2|            SKIP(2);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
 9862|      6|        return;
 9863|      6|    }
 9864|       |
 9865|       |    /*
 9866|       |     * parse the end of tag: '</' should be here.
 9867|       |     */
 9868|   179k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9868:9): [True: 109k, False: 70.0k]
  ------------------
 9869|   109k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9870|   109k|	namePop(ctxt);
 9871|   109k|    }
 9872|  70.0k|#ifdef LIBXML_SAX1_ENABLED
 9873|  70.0k|    else
 9874|  70.0k|	xmlParseEndTag1(ctxt, 0);
 9875|   179k|#endif /* LIBXML_SAX1_ENABLED */
 9876|       |
 9877|       |    /*
 9878|       |     * Capture end position
 9879|       |     */
 9880|   179k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9880:9): [True: 164k, False: 14.6k]
  |  Branch (9880:24): [True: 0, False: 164k]
  ------------------
 9881|      0|        xmlParserNodeInfoPtr node_info;
 9882|       |
 9883|      0|        node_info = (xmlParserNodeInfoPtr) xmlParserFindNodeInfo(ctxt, cur);
 9884|      0|        if (node_info != NULL) {
  ------------------
  |  Branch (9884:13): [True: 0, False: 0]
  ------------------
 9885|      0|            node_info->end_pos = ctxt->input->consumed +
 9886|      0|                                 (CUR_PTR - ctxt->input->base);
  ------------------
  |  | 2264|      0|#define CUR_PTR ctxt->input->cur
  ------------------
 9887|      0|            node_info->end_line = ctxt->input->line;
 9888|      0|        }
 9889|      0|    }
 9890|   179k|}
parser.c:xmlParseEndTag2:
 9414|   131k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9415|   131k|    const xmlChar *name;
 9416|       |
 9417|   131k|    GROW;
  ------------------
  |  | 2308|   131k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   131k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   131k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 109k, False: 21.6k]
  |  |  ------------------
  |  | 2309|   131k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   109k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 14.0k, False: 95.5k]
  |  |  ------------------
  |  | 2310|   131k|	xmlParserGrow(ctxt);
  ------------------
 9418|   131k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   131k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   131k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9418:9): [True: 30, False: 131k]
  |  Branch (9418:25): [True: 27, False: 131k]
  ------------------
 9419|     57|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9420|     57|	return;
 9421|     57|    }
 9422|   131k|    SKIP(2);
  ------------------
  |  | 2285|   131k|#define SKIP(val) do {							\
  |  | 2286|   131k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   131k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.60k, False: 129k]
  |  |  ------------------
  |  | 2288|   131k|        xmlParserGrow(ctxt);						\
  |  | 2289|   131k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 131k]
  |  |  ------------------
  ------------------
 9423|       |
 9424|   131k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9424:9): [True: 111k, False: 19.5k]
  ------------------
 9425|   111k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9426|  19.5k|    else
 9427|  19.5k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9428|       |
 9429|       |    /*
 9430|       |     * We should definitely be at the ending "S? '>'" part
 9431|       |     */
 9432|   131k|    GROW;
  ------------------
  |  | 2308|   131k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   131k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   131k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 109k, False: 21.6k]
  |  |  ------------------
  |  | 2309|   131k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   109k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 14.0k, False: 95.4k]
  |  |  ------------------
  |  | 2310|   131k|	xmlParserGrow(ctxt);
  ------------------
 9433|   131k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   131k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9434|   131k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   131k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   131k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 126k, False: 5.13k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 126k]
  |  |  |  |  ------------------
  |  |  |  |  109|   131k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 131k]
  |  |  |  |  ------------------
  |  |  |  |  110|   131k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 125k, False: 5.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   125k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9434:33): [True: 20.6k, False: 105k]
  ------------------
 9435|  26.0k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9436|  26.0k|    } else
 9437|   105k|	NEXT1;
  ------------------
  |  | 2318|   105k|#define NEXT1 {								\
  |  | 2319|   105k|	ctxt->input->col++;						\
  |  | 2320|   105k|	ctxt->input->cur++;						\
  |  | 2321|   105k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.43k, False: 103k]
  |  |  ------------------
  |  | 2322|   105k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   105k|    }
  ------------------
 9438|       |
 9439|       |    /*
 9440|       |     * [ WFC: Element Type Match ]
 9441|       |     * The Name in an element's end-tag must match the element type in the
 9442|       |     * start-tag.
 9443|       |     *
 9444|       |     */
 9445|   131k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9445:9): [True: 24.3k, False: 106k]
  ------------------
 9446|  24.3k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  4.41k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9446:13): [True: 4.41k, False: 19.8k]
  ------------------
 9447|  24.3k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9448|  24.3k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9449|  24.3k|		                ctxt->name, tag->line, name);
 9450|  24.3k|    }
 9451|       |
 9452|       |    /*
 9453|       |     * SAX: End of Tag
 9454|       |     */
 9455|   131k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9455:9): [True: 131k, False: 0]
  |  Branch (9455:32): [True: 131k, False: 0]
  ------------------
 9456|   131k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9456:2): [True: 116k, False: 14.6k]
  ------------------
 9457|   116k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9458|   116k|                                tag->URI);
 9459|       |
 9460|   131k|    spacePop(ctxt);
 9461|   131k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9461:9): [True: 8.64k, False: 122k]
  ------------------
 9462|  8.64k|	xmlParserNsPop(ctxt, tag->nsNr);
 9463|   131k|}
parser.c:xmlParseQNameAndCompare:
 8508|  19.5k|                        xmlChar const *prefix) {
 8509|  19.5k|    const xmlChar *cmp;
 8510|  19.5k|    const xmlChar *in;
 8511|  19.5k|    const xmlChar *ret;
 8512|  19.5k|    const xmlChar *prefix2;
 8513|       |
 8514|  19.5k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8514:9): [True: 0, False: 19.5k]
  ------------------
 8515|       |
 8516|  19.5k|    GROW;
  ------------------
  |  | 2308|  19.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  19.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  19.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 16.1k, False: 3.38k]
  |  |  ------------------
  |  | 2309|  19.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  16.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.46k, False: 13.6k]
  |  |  ------------------
  |  | 2310|  19.5k|	xmlParserGrow(ctxt);
  ------------------
 8517|  19.5k|    in = ctxt->input->cur;
 8518|       |
 8519|  19.5k|    cmp = prefix;
 8520|  39.1k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8520:12): [True: 38.0k, False: 1.13k]
  |  Branch (8520:24): [True: 19.6k, False: 18.3k]
  ------------------
 8521|  19.6k|	++in;
 8522|  19.6k|	++cmp;
 8523|  19.6k|    }
 8524|  19.5k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8524:9): [True: 17.6k, False: 1.84k]
  |  Branch (8524:24): [True: 5.81k, False: 11.8k]
  ------------------
 8525|  5.81k|        in++;
 8526|  5.81k|	cmp = name;
 8527|  19.9k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8527:9): [True: 19.0k, False: 888]
  |  Branch (8527:21): [True: 14.0k, False: 4.92k]
  ------------------
 8528|  14.0k|	    ++in;
 8529|  14.0k|	    ++cmp;
 8530|  14.0k|	}
 8531|  5.81k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  1.32k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.32k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 211, False: 1.11k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.32k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 833, False: 278]
  |  |  |  |  |  Branch (91:23): [True: 222, False: 611]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.32k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 383, False: 506]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8531:6): [True: 4.94k, False: 874]
  |  Branch (8531:20): [True: 3.61k, False: 1.32k]
  ------------------
 8532|       |	    /* success */
 8533|  4.43k|            ctxt->input->col += in - ctxt->input->cur;
 8534|  4.43k|	    ctxt->input->cur = in;
 8535|  4.43k|	    return((const xmlChar*) 1);
 8536|  4.43k|	}
 8537|  5.81k|    }
 8538|       |    /*
 8539|       |     * all strings coms from the dictionary, equality can be done directly
 8540|       |     */
 8541|  15.0k|    ret = xmlParseQName (ctxt, &prefix2);
 8542|  15.0k|    if (ret == NULL)
  ------------------
  |  Branch (8542:9): [True: 878, False: 14.2k]
  ------------------
 8543|    878|        return(NULL);
 8544|  14.2k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8544:9): [True: 12.4k, False: 1.75k]
  |  Branch (8544:26): [True: 454, False: 12.0k]
  ------------------
 8545|    454|	return((const xmlChar*) 1);
 8546|  13.7k|    return ret;
 8547|  14.2k|}
parser.c:xmlParseQName:
 8485|  15.0k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8486|  15.0k|    xmlHashedString n, p;
 8487|       |
 8488|  15.0k|    n = xmlParseQNameHashed(ctxt, &p);
 8489|  15.0k|    if (n.name == NULL)
  ------------------
  |  Branch (8489:9): [True: 878, False: 14.2k]
  ------------------
 8490|    878|        return(NULL);
 8491|  14.2k|    *prefix = p.name;
 8492|  14.2k|    return(n.name);
 8493|  15.0k|}
parser.c:xmlParseInternalSubset:
 8031|  16.2k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 8032|       |    /*
 8033|       |     * Is there any DTD definition ?
 8034|       |     */
 8035|  16.2k|    if (RAW == '[') {
  ------------------
  |  | 2261|  16.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8035:9): [True: 16.2k, False: 0]
  ------------------
 8036|  16.2k|        int oldInputNr = ctxt->inputNr;
 8037|       |
 8038|  16.2k|        NEXT;
  ------------------
  |  | 2316|  16.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8039|       |	/*
 8040|       |	 * Parse the succession of Markup declarations and
 8041|       |	 * PEReferences.
 8042|       |	 * Subsequence (markupdecl | PEReference | S)*
 8043|       |	 */
 8044|  16.2k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  16.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8045|   664k|        while (1) {
  ------------------
  |  Branch (8045:16): [True: 664k, Folded]
  ------------------
 8046|   664k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   664k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 668, False: 663k]
  |  |  ------------------
  ------------------
 8047|    668|                return;
 8048|   663k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8048:24): [True: 117k, False: 545k]
  ------------------
 8049|   117k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8049:21): [True: 2.03k, False: 115k]
  ------------------
 8050|  2.03k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8051|  2.03k|                    return;
 8052|  2.03k|                }
 8053|   115k|                xmlPopPE(ctxt);
 8054|   545k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2261|   545k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8054:24): [True: 10.1k, False: 535k]
  |  Branch (8054:40): [True: 10.1k, False: 2]
  ------------------
 8055|  10.1k|                NEXT;
  ------------------
  |  | 2316|  10.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8056|  10.1k|                SKIP_BLANKS;
  ------------------
  |  | 2312|  10.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8057|  10.1k|                break;
 8058|   535k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   535k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 535k]
  |  |  ------------------
  |  |   56|   535k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 472k, False: 63.1k]
  |  |  ------------------
  |  |   57|   535k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 469k, False: 3.07k]
  |  |  ------------------
  ------------------
 8059|   469k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   469k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   303k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   293k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8059:24): [True: 303k, False: 166k]
  |  Branch (8059:40): [True: 293k, False: 10.0k]
  |  Branch (8059:59): [True: 4.87k, False: 288k]
  ------------------
 8060|       |                /*
 8061|       |                 * Conditional sections are allowed in external entities
 8062|       |                 * included by PE References in the internal subset.
 8063|       |                 */
 8064|  4.87k|                xmlParseConditionalSections(ctxt);
 8065|   530k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   530k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   339k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  11.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8065:24): [True: 339k, False: 191k]
  |  Branch (8065:41): [True: 327k, False: 11.5k]
  |  Branch (8065:60): [True: 10.4k, False: 1.06k]
  ------------------
 8066|   338k|                xmlParseMarkupDecl(ctxt);
 8067|   338k|            } else if (RAW == '%') {
  ------------------
  |  | 2261|   192k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8067:24): [True: 189k, False: 3.35k]
  ------------------
 8068|   189k|                xmlParsePERefInternal(ctxt, 1);
 8069|   189k|            } else {
 8070|  3.35k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8071|       |
 8072|  3.91k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8072:24): [True: 561, False: 3.35k]
  ------------------
 8073|    561|                    xmlPopPE(ctxt);
 8074|  3.35k|                return;
 8075|  3.35k|            }
 8076|   647k|            SKIP_BLANKS;
  ------------------
  |  | 2312|   647k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8077|   647k|            SHRINK;
  ------------------
  |  | 2304|   647k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   647k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   647k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 590k, False: 57.1k]
  |  |  ------------------
  |  | 2305|   647k|	xmlParserShrink(ctxt);
  ------------------
 8078|   647k|            GROW;
  ------------------
  |  | 2308|   647k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   647k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   647k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 590k, False: 57.1k]
  |  |  ------------------
  |  | 2309|   647k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   590k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 359k, False: 231k]
  |  |  ------------------
  |  | 2310|   647k|	xmlParserGrow(ctxt);
  ------------------
 8079|   647k|        }
 8080|  16.2k|    }
 8081|       |
 8082|       |    /*
 8083|       |     * We should be at the end of the DOCTYPE declaration.
 8084|       |     */
 8085|  10.1k|    if (RAW != '>') {
  ------------------
  |  | 2261|  10.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8085:9): [True: 140, False: 10.0k]
  ------------------
 8086|    140|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8087|    140|        return;
 8088|    140|    }
 8089|  10.0k|    NEXT;
  ------------------
  |  | 2316|  10.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8090|  10.0k|}
parser.c:xmlCleanSpecialAttr:
 1231|  21.8k|{
 1232|  21.8k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1232:9): [True: 18.0k, False: 3.78k]
  ------------------
 1233|  18.0k|        return;
 1234|       |
 1235|  3.78k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1236|       |
 1237|  3.78k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1237:9): [True: 177, False: 3.61k]
  ------------------
 1238|    177|        xmlHashFree(ctxt->attsSpecial, NULL);
 1239|       |        ctxt->attsSpecial = NULL;
 1240|    177|    }
 1241|  3.78k|}
parser.c:xmlCleanSpecialAttrCallback:
 1214|  25.6k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1215|  25.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1216|       |
 1217|  25.6k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  25.6k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1217:9): [True: 1.79k, False: 23.8k]
  ------------------
 1218|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1219|  1.79k|    }
 1220|  25.6k|}
parser.c:xmlFinishDocument:
10388|  28.7k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10389|  28.7k|    xmlDocPtr doc;
10390|       |
10391|       |    /*
10392|       |     * SAX: end of the document processing.
10393|       |     */
10394|  28.7k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10394:9): [True: 28.7k, False: 0]
  |  Branch (10394:24): [True: 28.7k, False: 0]
  ------------------
10395|  28.7k|        ctxt->sax->endDocument(ctxt->userData);
10396|       |
10397|       |    /*
10398|       |     * Remove locally kept entity definitions if the tree was not built
10399|       |     */
10400|  28.7k|    doc = ctxt->myDoc;
10401|  28.7k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10401:9): [True: 28.6k, False: 81]
  ------------------
10402|  28.6k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  28.6k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  28.6k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10402:9): [True: 19, False: 28.6k]
  ------------------
10403|     19|        xmlFreeDoc(doc);
10404|       |        ctxt->myDoc = NULL;
10405|     19|    }
10406|  28.7k|}
parser.c:xmlParseTryOrFinish:
10867|   444k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10868|   444k|    int ret = 0;
10869|   444k|    size_t avail;
10870|   444k|    xmlChar cur, next;
10871|       |
10872|   444k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10872:9): [True: 0, False: 444k]
  ------------------
10873|      0|        return(0);
10874|       |
10875|   444k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10875:9): [True: 444k, False: 0]
  ------------------
10876|   444k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10876:9): [True: 2.41k, False: 441k]
  ------------------
10877|  2.41k|        xmlParserShrink(ctxt);
10878|  2.41k|    }
10879|       |
10880|  4.14M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10880:12): [True: 4.12M, False: 11.9k]
  ------------------
10881|  4.12M|        avail = ctxt->input->end - ctxt->input->cur;
10882|  4.12M|        if (avail < 1)
  ------------------
  |  Branch (10882:13): [True: 25.2k, False: 4.10M]
  ------------------
10883|  25.2k|	    goto done;
10884|  4.10M|        switch (ctxt->instate) {
10885|  7.18k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10885:13): [True: 7.18k, False: 4.09M]
  ------------------
10886|       |	        /*
10887|       |		 * Document parsing is done !
10888|       |		 */
10889|  7.18k|	        goto done;
10890|  43.3k|            case XML_PARSER_START:
  ------------------
  |  Branch (10890:13): [True: 43.3k, False: 4.06M]
  ------------------
10891|       |                /*
10892|       |                 * Very first chars read from the document flow.
10893|       |                 */
10894|  43.3k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10894:21): [True: 42.0k, False: 1.33k]
  |  Branch (10894:37): [True: 517, False: 41.4k]
  ------------------
10895|    517|                    goto done;
10896|       |
10897|       |                /*
10898|       |                 * We need more bytes to detect EBCDIC code pages.
10899|       |                 * See xmlDetectEBCDIC.
10900|       |                 */
10901|  42.8k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2268|  42.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 777, False: 42.0k]
  |  |  |  Branch (2268:41): [True: 761, False: 16]
  |  |  ------------------
  |  | 2269|  42.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 749, False: 12]
  |  |  |  Branch (2269:41): [True: 738, False: 11]
  |  |  ------------------
  ------------------
10902|    738|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10902:21): [True: 383, False: 355]
  |  Branch (10902:37): [True: 348, False: 35]
  ------------------
10903|    348|                    goto done;
10904|       |
10905|  42.4k|                xmlDetectEncoding(ctxt);
10906|  42.4k|                ctxt->instate = XML_PARSER_XML_DECL;
10907|  42.4k|		break;
10908|       |
10909|  56.8k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10909:13): [True: 56.8k, False: 4.04M]
  ------------------
10910|  56.8k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10910:7): [True: 54.3k, False: 2.44k]
  |  Branch (10910:23): [True: 9, False: 54.3k]
  ------------------
10911|      9|		    goto done;
10912|  56.7k|		cur = ctxt->input->cur[0];
10913|  56.7k|		next = ctxt->input->cur[1];
10914|  56.7k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10914:14): [True: 55.7k, False: 1.03k]
  |  Branch (10914:30): [True: 23.5k, False: 32.2k]
  ------------------
10915|       |		    /* PI or XML decl */
10916|  23.5k|		    if ((!terminate) &&
  ------------------
  |  Branch (10916:11): [True: 22.0k, False: 1.50k]
  ------------------
10917|  22.0k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10917:25): [True: 14.3k, False: 7.68k]
  ------------------
10918|  14.3k|			goto done;
10919|  9.19k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10919:11): [True: 7.17k, False: 2.01k]
  ------------------
10920|  7.17k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10920:4): [True: 6.26k, False: 913]
  ------------------
10921|  6.26k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10921:4): [True: 3.18k, False: 3.08k]
  ------------------
10922|  3.18k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.18k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.18k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.99k, False: 183]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.18k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 179, False: 4]
  |  |  |  |  |  Branch (91:23): [True: 39, False: 140]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.18k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 11, False: 133]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10923|  3.04k|			ret += 5;
10924|  3.04k|			xmlParseXMLDecl(ctxt);
10925|  6.14k|		    } else {
10926|  6.14k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  6.14k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10927|  6.14k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10927:29): [True: 3, False: 6.14k]
  ------------------
10928|      3|                            xmlErrMemory(ctxt);
10929|      3|                            break;
10930|      3|                        }
10931|  6.14k|		    }
10932|  33.2k|		} else {
10933|  33.2k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  33.2k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10934|  33.2k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10934:11): [True: 2, False: 33.2k]
  ------------------
10935|      2|		        xmlErrMemory(ctxt);
10936|      2|			break;
10937|      2|		    }
10938|  33.2k|		}
10939|  42.4k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10939:21): [True: 42.4k, False: 0]
  |  Branch (10939:36): [True: 42.4k, False: 0]
  ------------------
10940|  42.4k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10941|  42.4k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10942|  42.4k|                }
10943|  42.4k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10943:21): [True: 42.4k, False: 0]
  |  Branch (10943:36): [True: 42.4k, False: 0]
  ------------------
10944|  42.4k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10944:21): [True: 42.0k, False: 365]
  ------------------
10945|  42.0k|                    ctxt->sax->startDocument(ctxt->userData);
10946|  42.4k|                ctxt->instate = XML_PARSER_MISC;
10947|  42.4k|		break;
10948|   629k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10948:13): [True: 629k, False: 3.47M]
  ------------------
10949|   629k|	        const xmlChar *name;
10950|   629k|		const xmlChar *prefix = NULL;
10951|   629k|		const xmlChar *URI = NULL;
10952|   629k|                int line = ctxt->input->line;
10953|   629k|		int nbNs = 0;
10954|       |
10955|   629k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10955:7): [True: 558k, False: 70.7k]
  |  Branch (10955:23): [True: 184, False: 558k]
  ------------------
10956|    184|		    goto done;
10957|   628k|		cur = ctxt->input->cur[0];
10958|   628k|	        if (cur != '<') {
  ------------------
  |  Branch (10958:14): [True: 2.15k, False: 626k]
  ------------------
10959|  2.15k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10960|  2.15k|                                   "Start tag expected, '<' not found");
10961|  2.15k|                    ctxt->instate = XML_PARSER_EOF;
10962|  2.15k|                    xmlFinishDocument(ctxt);
10963|  2.15k|		    goto done;
10964|  2.15k|		}
10965|   626k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10965:7): [True: 557k, False: 69.1k]
  |  Branch (10965:23): [True: 252k, False: 305k]
  ------------------
10966|   252k|                    goto done;
10967|   374k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10967:7): [True: 0, False: 374k]
  ------------------
10968|      0|		    spacePush(ctxt, -1);
10969|   374k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10969:12): [True: 54.2k, False: 320k]
  ------------------
10970|  54.2k|		    spacePush(ctxt, -1);
10971|   320k|		else
10972|   320k|		    spacePush(ctxt, *ctxt->space);
10973|   374k|#ifdef LIBXML_SAX1_ENABLED
10974|   374k|		if (ctxt->sax2)
  ------------------
  |  Branch (10974:7): [True: 222k, False: 152k]
  ------------------
10975|   222k|#endif /* LIBXML_SAX1_ENABLED */
10976|   222k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10977|   152k|#ifdef LIBXML_SAX1_ENABLED
10978|   152k|		else
10979|   152k|		    name = xmlParseStartTag(ctxt);
10980|   374k|#endif /* LIBXML_SAX1_ENABLED */
10981|   374k|		if (name == NULL) {
  ------------------
  |  Branch (10981:7): [True: 2.06k, False: 372k]
  ------------------
10982|  2.06k|		    spacePop(ctxt);
10983|  2.06k|                    ctxt->instate = XML_PARSER_EOF;
10984|  2.06k|                    xmlFinishDocument(ctxt);
10985|  2.06k|		    goto done;
10986|  2.06k|		}
10987|   372k|#ifdef LIBXML_VALID_ENABLED
10988|       |		/*
10989|       |		 * [ VC: Root Element Type ]
10990|       |		 * The Name in the document type declaration must match
10991|       |		 * the element type of the root element.
10992|       |		 */
10993|   372k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10993:7): [True: 175k, False: 197k]
  |  Branch (10993:25): [True: 144k, False: 30.3k]
  |  Branch (10993:45): [True: 144k, False: 0]
  ------------------
10994|   144k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10994:7): [True: 144k, False: 0]
  |  Branch (10994:21): [True: 0, False: 144k]
  ------------------
10995|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10996|   372k|#endif /* LIBXML_VALID_ENABLED */
10997|       |
10998|       |		/*
10999|       |		 * Check for an Empty Element.
11000|       |		 */
11001|   372k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   372k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   122k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (11001:7): [True: 122k, False: 250k]
  |  Branch (11001:23): [True: 119k, False: 2.55k]
  ------------------
11002|   119k|		    SKIP(2);
  ------------------
  |  | 2285|   119k|#define SKIP(val) do {							\
  |  | 2286|   119k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   119k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.14k, False: 118k]
  |  |  ------------------
  |  | 2288|   119k|        xmlParserGrow(ctxt);						\
  |  | 2289|   119k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 119k]
  |  |  ------------------
  ------------------
11003|       |
11004|   119k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (11004:11): [True: 72.8k, False: 46.9k]
  ------------------
11005|  72.8k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11005:8): [True: 72.8k, False: 0]
  ------------------
11006|  72.8k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (11006:8): [True: 72.8k, False: 0]
  ------------------
11007|  72.8k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11007:8): [True: 72.7k, False: 59]
  ------------------
11008|  72.7k|			    ctxt->sax->endElementNs(ctxt->userData, name,
11009|  72.7k|			                            prefix, URI);
11010|  72.8k|			if (nbNs > 0)
  ------------------
  |  Branch (11010:8): [True: 5.34k, False: 67.4k]
  ------------------
11011|  5.34k|			    xmlParserNsPop(ctxt, nbNs);
11012|  72.8k|#ifdef LIBXML_SAX1_ENABLED
11013|  72.8k|		    } else {
11014|  46.9k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11014:8): [True: 46.9k, False: 0]
  ------------------
11015|  46.9k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (11015:8): [True: 46.9k, False: 0]
  ------------------
11016|  46.9k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11016:8): [True: 46.9k, False: 22]
  ------------------
11017|  46.9k|			    ctxt->sax->endElement(ctxt->userData, name);
11018|  46.9k|#endif /* LIBXML_SAX1_ENABLED */
11019|  46.9k|		    }
11020|   119k|		    spacePop(ctxt);
11021|   252k|		} else if (RAW == '>') {
  ------------------
  |  | 2261|   252k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11021:14): [True: 209k, False: 43.2k]
  ------------------
11022|   209k|		    NEXT;
  ------------------
  |  | 2316|   209k|#define NEXT xmlNextChar(ctxt)
  ------------------
11023|   209k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
11024|   209k|		} else {
11025|  43.2k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
11026|  43.2k|					 "Couldn't find end of Start Tag %s\n",
11027|  43.2k|					 name);
11028|  43.2k|		    nodePop(ctxt);
11029|  43.2k|		    spacePop(ctxt);
11030|  43.2k|                    if (nbNs > 0)
  ------------------
  |  Branch (11030:25): [True: 6.46k, False: 36.7k]
  ------------------
11031|  6.46k|                        xmlParserNsPop(ctxt, nbNs);
11032|  43.2k|		}
11033|       |
11034|   372k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (11034:21): [True: 10.2k, False: 362k]
  ------------------
11035|  10.2k|                    ctxt->instate = XML_PARSER_EPILOG;
11036|   362k|                else
11037|   362k|                    ctxt->instate = XML_PARSER_CONTENT;
11038|   372k|                break;
11039|   374k|	    }
11040|  3.06M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11040:13): [True: 3.06M, False: 1.03M]
  ------------------
11041|  3.06M|		cur = ctxt->input->cur[0];
11042|       |
11043|  3.06M|		if (cur == '<') {
  ------------------
  |  Branch (11043:7): [True: 504k, False: 2.56M]
  ------------------
11044|   504k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11044:25): [True: 431k, False: 73.0k]
  |  Branch (11044:41): [True: 1.52k, False: 430k]
  ------------------
11045|  1.52k|                        goto done;
11046|   503k|		    next = ctxt->input->cur[1];
11047|       |
11048|   503k|                    if (next == '/') {
  ------------------
  |  Branch (11048:25): [True: 52.8k, False: 450k]
  ------------------
11049|  52.8k|                        ctxt->instate = XML_PARSER_END_TAG;
11050|  52.8k|                        break;
11051|   450k|                    } else if (next == '?') {
  ------------------
  |  Branch (11051:32): [True: 24.9k, False: 425k]
  ------------------
11052|  24.9k|                        if ((!terminate) &&
  ------------------
  |  Branch (11052:29): [True: 21.5k, False: 3.32k]
  ------------------
11053|  21.5k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11053:29): [True: 6.98k, False: 14.6k]
  ------------------
11054|  6.98k|                            goto done;
11055|  17.9k|                        xmlParsePI(ctxt);
11056|  17.9k|                        ctxt->instate = XML_PARSER_CONTENT;
11057|  17.9k|                        break;
11058|   425k|                    } else if (next == '!') {
  ------------------
  |  Branch (11058:32): [True: 82.8k, False: 342k]
  ------------------
11059|  82.8k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11059:29): [True: 76.8k, False: 5.95k]
  |  Branch (11059:45): [True: 167, False: 76.7k]
  ------------------
11060|    167|                            goto done;
11061|  82.6k|                        next = ctxt->input->cur[2];
11062|       |
11063|  82.6k|                        if (next == '-') {
  ------------------
  |  Branch (11063:29): [True: 46.1k, False: 36.5k]
  ------------------
11064|  46.1k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11064:33): [True: 43.6k, False: 2.42k]
  |  Branch (11064:49): [True: 111, False: 43.5k]
  ------------------
11065|    111|                                goto done;
11066|  45.9k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11066:33): [True: 45.9k, False: 15]
  ------------------
11067|  45.9k|                                if ((!terminate) &&
  ------------------
  |  Branch (11067:37): [True: 43.5k, False: 2.41k]
  ------------------
11068|  43.5k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11068:37): [True: 5.83k, False: 37.7k]
  ------------------
11069|  5.83k|                                    goto done;
11070|  40.1k|                                xmlParseComment(ctxt);
11071|  40.1k|                                ctxt->instate = XML_PARSER_CONTENT;
11072|  40.1k|                                break;
11073|  45.9k|                            }
11074|  45.9k|                        } else if (next == '[') {
  ------------------
  |  Branch (11074:36): [True: 36.2k, False: 282]
  ------------------
11075|  36.2k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11075:33): [True: 32.8k, False: 3.42k]
  |  Branch (11075:49): [True: 283, False: 32.5k]
  ------------------
11076|    283|                                goto done;
11077|  36.0k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11077:33): [True: 36.0k, False: 0]
  ------------------
11078|  36.0k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11078:33): [True: 35.9k, False: 21]
  ------------------
11079|  35.9k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11079:33): [True: 35.9k, False: 7]
  ------------------
11080|  35.9k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11080:33): [True: 35.9k, False: 5]
  ------------------
11081|  35.9k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11081:33): [True: 35.9k, False: 12]
  ------------------
11082|  35.9k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11082:33): [True: 35.9k, False: 13]
  ------------------
11083|  35.9k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11083:33): [True: 35.9k, False: 10]
  ------------------
11084|  35.9k|                                if ((!terminate) &&
  ------------------
  |  Branch (11084:37): [True: 32.5k, False: 3.38k]
  ------------------
11085|  32.5k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11085:37): [True: 10.5k, False: 21.9k]
  ------------------
11086|  10.5k|                                    goto done;
11087|  25.3k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11088|  25.3k|                                xmlParseCDSect(ctxt);
11089|  25.3k|                                ctxt->instate = XML_PARSER_CONTENT;
11090|  25.3k|                                break;
11091|  35.9k|                            }
11092|  36.0k|                        }
11093|  82.6k|                    }
11094|  2.56M|		} else if (cur == '&') {
  ------------------
  |  Branch (11094:14): [True: 39.5k, False: 2.52M]
  ------------------
11095|  39.5k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11095:11): [True: 29.9k, False: 9.63k]
  |  Branch (11095:27): [True: 15.0k, False: 14.9k]
  ------------------
11096|  15.0k|			goto done;
11097|  24.5k|		    xmlParseReference(ctxt);
11098|  24.5k|                    break;
11099|  2.52M|		} else {
11100|       |		    /* TODO Avoid the extra copy, handle directly !!! */
11101|       |		    /*
11102|       |		     * Goal of the following test is:
11103|       |		     *  - minimize calls to the SAX 'character' callback
11104|       |		     *    when they are mergeable
11105|       |		     *  - handle an problem for isBlank when we only parse
11106|       |		     *    a sequence of blank chars and the next one is
11107|       |		     *    not available to check against '<' presence.
11108|       |		     *  - tries to homogenize the differences in SAX
11109|       |		     *    callbacks between the push and pull versions
11110|       |		     *    of the parser.
11111|       |		     */
11112|  2.52M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  2.52M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11112:11): [True: 136k, False: 2.38M]
  ------------------
11113|   136k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11113:8): [True: 114k, False: 22.3k]
  |  Branch (11113:24): [True: 7.47k, False: 106k]
  ------------------
11114|  7.47k|			    goto done;
11115|   136k|                    }
11116|  2.51M|                    ctxt->checkIndex = 0;
11117|  2.51M|		    xmlParseCharDataInternal(ctxt, !terminate);
11118|  2.51M|                    break;
11119|  2.52M|		}
11120|       |
11121|   342k|                ctxt->instate = XML_PARSER_START_TAG;
11122|   342k|		break;
11123|  3.06M|	    }
11124|  56.3k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11124:13): [True: 56.3k, False: 4.04M]
  ------------------
11125|  56.3k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11125:7): [True: 51.1k, False: 5.27k]
  |  Branch (11125:23): [True: 4.69k, False: 46.4k]
  ------------------
11126|  4.69k|		    goto done;
11127|  51.6k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11127:7): [True: 21.6k, False: 30.0k]
  ------------------
11128|  21.6k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11129|  21.6k|		    nameNsPop(ctxt);
11130|  21.6k|		}
11131|  30.0k|#ifdef LIBXML_SAX1_ENABLED
11132|  30.0k|		  else
11133|  30.0k|		    xmlParseEndTag1(ctxt, 0);
11134|  51.6k|#endif /* LIBXML_SAX1_ENABLED */
11135|  51.6k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11135:7): [True: 2.96k, False: 48.7k]
  ------------------
11136|  2.96k|		    ctxt->instate = XML_PARSER_EPILOG;
11137|  48.7k|		} else {
11138|  48.7k|		    ctxt->instate = XML_PARSER_CONTENT;
11139|  48.7k|		}
11140|  51.6k|		break;
11141|   106k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11141:13): [True: 106k, False: 3.99M]
  ------------------
11142|   188k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11142:13): [True: 81.1k, False: 4.02M]
  ------------------
11143|   194k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11143:13): [True: 6.60k, False: 4.09M]
  ------------------
11144|   194k|		SKIP_BLANKS;
  ------------------
  |  | 2312|   194k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11145|   194k|                avail = ctxt->input->end - ctxt->input->cur;
11146|   194k|		if (avail < 1)
  ------------------
  |  Branch (11146:7): [True: 3.79k, False: 190k]
  ------------------
11147|  3.79k|		    goto done;
11148|   190k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11148:7): [True: 186k, False: 4.40k]
  ------------------
11149|   186k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11149:25): [True: 180k, False: 6.11k]
  |  Branch (11149:41): [True: 233, False: 180k]
  ------------------
11150|    233|                        goto done;
11151|   186k|                    next = ctxt->input->cur[1];
11152|   186k|                    if (next == '?') {
  ------------------
  |  Branch (11152:25): [True: 38.5k, False: 147k]
  ------------------
11153|  38.5k|                        if ((!terminate) &&
  ------------------
  |  Branch (11153:29): [True: 37.3k, False: 1.22k]
  ------------------
11154|  37.3k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11154:29): [True: 5.99k, False: 31.3k]
  ------------------
11155|  5.99k|                            goto done;
11156|  32.5k|                        xmlParsePI(ctxt);
11157|  32.5k|                        break;
11158|   147k|                    } else if (next == '!') {
  ------------------
  |  Branch (11158:32): [True: 113k, False: 34.1k]
  ------------------
11159|   113k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11159:29): [True: 110k, False: 2.90k]
  |  Branch (11159:45): [True: 171, False: 110k]
  ------------------
11160|    171|                            goto done;
11161|       |
11162|   113k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11162:29): [True: 73.8k, False: 39.5k]
  ------------------
11163|  73.8k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11163:33): [True: 73.1k, False: 693]
  |  Branch (11163:49): [True: 153, False: 73.0k]
  ------------------
11164|    153|                                goto done;
11165|  73.6k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11165:33): [True: 73.6k, False: 15]
  ------------------
11166|  73.6k|                                if ((!terminate) &&
  ------------------
  |  Branch (11166:37): [True: 73.0k, False: 682]
  ------------------
11167|  73.0k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11167:37): [True: 11.3k, False: 61.6k]
  ------------------
11168|  11.3k|                                    goto done;
11169|  62.3k|                                xmlParseComment(ctxt);
11170|  62.3k|                                break;
11171|  73.6k|                            }
11172|  73.6k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11172:36): [True: 39.5k, False: 77]
  ------------------
11173|  39.5k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11173:33): [True: 37.3k, False: 2.16k]
  |  Branch (11173:49): [True: 23, False: 37.3k]
  ------------------
11174|     23|                                goto done;
11175|  39.4k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11175:33): [True: 39.4k, False: 14]
  ------------------
11176|  39.4k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11176:33): [True: 39.4k, False: 7]
  ------------------
11177|  39.4k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11177:33): [True: 39.4k, False: 8]
  ------------------
11178|  39.4k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11178:33): [True: 39.4k, False: 5]
  ------------------
11179|  39.4k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11179:33): [True: 39.4k, False: 9]
  ------------------
11180|  39.4k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11180:33): [True: 39.4k, False: 1]
  ------------------
11181|  39.4k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11181:33): [True: 39.4k, False: 4]
  ------------------
11182|  39.4k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11182:37): [True: 37.3k, False: 2.12k]
  |  Branch (11182:53): [True: 20.3k, False: 16.9k]
  ------------------
11183|  20.3k|                                    goto done;
11184|  19.1k|                                ctxt->inSubset = 1;
11185|  19.1k|                                xmlParseDocTypeDecl(ctxt);
11186|  19.1k|                                if (RAW == '[') {
  ------------------
  |  | 2261|  19.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11186:37): [True: 15.1k, False: 3.95k]
  ------------------
11187|  15.1k|                                    ctxt->instate = XML_PARSER_DTD;
11188|  15.1k|                                } else {
11189|  3.95k|                                    if (RAW == '>')
  ------------------
  |  | 2261|  3.95k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11189:41): [True: 3.71k, False: 239]
  ------------------
11190|  3.71k|                                        NEXT;
  ------------------
  |  | 2316|  3.71k|#define NEXT xmlNextChar(ctxt)
  ------------------
11191|       |                                    /*
11192|       |                                     * Create and update the external subset.
11193|       |                                     */
11194|  3.95k|                                    ctxt->inSubset = 2;
11195|  3.95k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11195:41): [True: 3.95k, False: 0]
  ------------------
11196|  3.95k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11196:41): [True: 3.82k, False: 125]
  ------------------
11197|  3.82k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11197:41): [True: 3.82k, False: 0]
  ------------------
11198|  3.82k|                                        ctxt->sax->externalSubset(
11199|  3.82k|                                                ctxt->userData,
11200|  3.82k|                                                ctxt->intSubName,
11201|  3.82k|                                                ctxt->extSubSystem,
11202|  3.82k|                                                ctxt->extSubURI);
11203|  3.95k|                                    ctxt->inSubset = 0;
11204|  3.95k|                                    xmlCleanSpecialAttr(ctxt);
11205|  3.95k|                                    ctxt->instate = XML_PARSER_PROLOG;
11206|  3.95k|                                }
11207|  19.1k|                                break;
11208|  39.4k|                            }
11209|  39.4k|                        }
11210|   113k|                    }
11211|   186k|                }
11212|       |
11213|  38.7k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11213:21): [True: 2.55k, False: 36.1k]
  ------------------
11214|  2.55k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11214:25): [True: 29, False: 2.52k]
  ------------------
11215|     29|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11216|  2.55k|		    ctxt->instate = XML_PARSER_EOF;
11217|  2.55k|                    xmlFinishDocument(ctxt);
11218|  36.1k|                } else {
11219|  36.1k|		    ctxt->instate = XML_PARSER_START_TAG;
11220|  36.1k|		}
11221|  38.7k|		break;
11222|  48.4k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11222:13): [True: 48.4k, False: 4.05M]
  ------------------
11223|  48.4k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11223:21): [True: 42.7k, False: 5.72k]
  |  Branch (11223:37): [True: 33.4k, False: 9.31k]
  ------------------
11224|  33.4k|                    goto done;
11225|  15.0k|		xmlParseInternalSubset(ctxt);
11226|  15.0k|		ctxt->inSubset = 2;
11227|  15.0k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11227:7): [True: 15.0k, False: 0]
  |  Branch (11227:30): [True: 12.7k, False: 2.32k]
  ------------------
11228|  12.7k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11228:7): [True: 12.7k, False: 0]
  ------------------
11229|  12.7k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11230|  12.7k|			    ctxt->extSubSystem, ctxt->extSubURI);
11231|  15.0k|		ctxt->inSubset = 0;
11232|  15.0k|		xmlCleanSpecialAttr(ctxt);
11233|  15.0k|		ctxt->instate = XML_PARSER_PROLOG;
11234|  15.0k|                break;
11235|  48.4k|	    }
11236|      0|            default:
  ------------------
  |  Branch (11236:13): [True: 0, False: 4.10M]
  ------------------
11237|      0|                xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
11238|      0|			"PP: internal error\n");
11239|      0|		ctxt->instate = XML_PARSER_EOF;
11240|      0|		break;
11241|  4.10M|	}
11242|  4.10M|    }
11243|   444k|done:
11244|   444k|    return(ret);
11245|   444k|}
parser.c:xmlParseLookupString:
10647|   230k|                     const char *str, size_t strLen) {
10648|   230k|    const xmlChar *cur, *term;
10649|       |
10650|   230k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10650:9): [True: 177k, False: 52.7k]
  ------------------
10651|   177k|        cur = ctxt->input->cur + startDelta;
10652|   177k|    } else {
10653|  52.7k|        cur = ctxt->input->cur + ctxt->checkIndex;
10654|  52.7k|    }
10655|       |
10656|   230k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   230k|#define BAD_CAST (xmlChar *)
  ------------------
10657|   230k|    if (term == NULL) {
  ------------------
  |  Branch (10657:9): [True: 55.1k, False: 174k]
  ------------------
10658|  55.1k|        const xmlChar *end = ctxt->input->end;
10659|  55.1k|        size_t index;
10660|       |
10661|       |        /* Rescan (strLen - 1) characters. */
10662|  55.1k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10662:13): [True: 1.02k, False: 54.1k]
  ------------------
10663|  1.02k|            end = cur;
10664|  54.1k|        else
10665|  54.1k|            end -= strLen - 1;
10666|  55.1k|        index = end - ctxt->input->cur;
10667|  55.1k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10667:13): [True: 0, False: 55.1k]
  ------------------
10668|      0|            ctxt->checkIndex = 0;
10669|      0|            return(ctxt->input->end - strLen);
10670|      0|        }
10671|  55.1k|        ctxt->checkIndex = index;
10672|   174k|    } else {
10673|   174k|        ctxt->checkIndex = 0;
10674|   174k|    }
10675|       |
10676|   230k|    return(term);
10677|   230k|}
parser.c:xmlParseLookupGt:
10714|   594k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10715|   594k|    const xmlChar *cur;
10716|   594k|    const xmlChar *end = ctxt->input->end;
10717|   594k|    int state = ctxt->endCheckState;
10718|   594k|    size_t index;
10719|       |
10720|   594k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10720:9): [True: 333k, False: 261k]
  ------------------
10721|   333k|        cur = ctxt->input->cur + 1;
10722|   261k|    else
10723|   261k|        cur = ctxt->input->cur + ctxt->checkIndex;
10724|       |
10725|   144M|    while (cur < end) {
  ------------------
  |  Branch (10725:12): [True: 144M, False: 272k]
  ------------------
10726|   144M|        if (state) {
  ------------------
  |  Branch (10726:13): [True: 132M, False: 11.8M]
  ------------------
10727|   132M|            if (*cur == state)
  ------------------
  |  Branch (10727:17): [True: 194k, False: 132M]
  ------------------
10728|   194k|                state = 0;
10729|   132M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10729:20): [True: 81.5k, False: 11.7M]
  |  Branch (10729:36): [True: 116k, False: 11.6M]
  ------------------
10730|   197k|            state = *cur;
10731|  11.6M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10731:20): [True: 322k, False: 11.3M]
  ------------------
10732|   322k|            ctxt->checkIndex = 0;
10733|   322k|            ctxt->endCheckState = 0;
10734|   322k|            return(1);
10735|   322k|        }
10736|   144M|        cur++;
10737|   144M|    }
10738|       |
10739|   272k|    index = cur - ctxt->input->cur;
10740|   272k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10740:9): [True: 0, False: 272k]
  ------------------
10741|      0|        ctxt->checkIndex = 0;
10742|      0|        ctxt->endCheckState = 0;
10743|      0|        return(1);
10744|      0|    }
10745|   272k|    ctxt->checkIndex = index;
10746|   272k|    ctxt->endCheckState = state;
10747|   272k|    return(0);
10748|   272k|}
parser.c:xmlParseLookupChar:
10613|  81.0k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10614|  81.0k|    const xmlChar *cur;
10615|       |
10616|  81.0k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10616:9): [True: 65.2k, False: 15.8k]
  ------------------
10617|  65.2k|        cur = ctxt->input->cur + 1;
10618|  65.2k|    } else {
10619|  15.8k|        cur = ctxt->input->cur + ctxt->checkIndex;
10620|  15.8k|    }
10621|       |
10622|  81.0k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10622:9): [True: 19.7k, False: 61.3k]
  ------------------
10623|  19.7k|        size_t index = ctxt->input->end - ctxt->input->cur;
10624|       |
10625|  19.7k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10625:13): [True: 0, False: 19.7k]
  ------------------
10626|      0|            ctxt->checkIndex = 0;
10627|      0|            return(1);
10628|      0|        }
10629|  19.7k|        ctxt->checkIndex = index;
10630|  19.7k|        return(0);
10631|  61.3k|    } else {
10632|  61.3k|        ctxt->checkIndex = 0;
10633|  61.3k|        return(1);
10634|  61.3k|    }
10635|  81.0k|}
parser.c:xmlParseLookupCharData:
10685|   114k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10686|   114k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10687|   114k|    const xmlChar *end = ctxt->input->end;
10688|   114k|    size_t index;
10689|       |
10690|  1.26M|    while (cur < end) {
  ------------------
  |  Branch (10690:12): [True: 1.26M, False: 7.47k]
  ------------------
10691|  1.26M|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10691:13): [True: 99.4k, False: 1.16M]
  |  Branch (10691:30): [True: 7.29k, False: 1.15M]
  ------------------
10692|   106k|            ctxt->checkIndex = 0;
10693|   106k|            return(1);
10694|   106k|        }
10695|  1.15M|        cur++;
10696|  1.15M|    }
10697|       |
10698|  7.47k|    index = cur - ctxt->input->cur;
10699|  7.47k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10699:9): [True: 0, False: 7.47k]
  ------------------
10700|      0|        ctxt->checkIndex = 0;
10701|      0|        return(1);
10702|      0|    }
10703|  7.47k|    ctxt->checkIndex = index;
10704|  7.47k|    return(0);
10705|  7.47k|}
parser.c:nameNsPop:
 2149|  21.6k|{
 2150|  21.6k|    const xmlChar *ret;
 2151|       |
 2152|  21.6k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2152:9): [True: 0, False: 21.6k]
  ------------------
 2153|      0|        return (NULL);
 2154|  21.6k|    ctxt->nameNr--;
 2155|  21.6k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2155:9): [True: 19.9k, False: 1.68k]
  ------------------
 2156|  19.9k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2157|  1.68k|    else
 2158|  1.68k|        ctxt->name = NULL;
 2159|  21.6k|    ret = ctxt->nameTab[ctxt->nameNr];
 2160|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2161|  21.6k|    return (ret);
 2162|  21.6k|}
parser.c:xmlParseLookupInternalSubset:
10757|  42.7k|xmlParseLookupInternalSubset(xmlParserCtxtPtr ctxt) {
10758|       |    /*
10759|       |     * Sorry, but progressive parsing of the internal subset is not
10760|       |     * supported. We first check that the full content of the internal
10761|       |     * subset is available and parsing is launched only at that point.
10762|       |     * Internal subset ends with "']' S? '>'" in an unescaped section and
10763|       |     * not in a ']]>' sequence which are conditional sections.
10764|       |     */
10765|  42.7k|    const xmlChar *cur, *start;
10766|  42.7k|    const xmlChar *end = ctxt->input->end;
10767|  42.7k|    int state = ctxt->endCheckState;
10768|  42.7k|    size_t index;
10769|       |
10770|  42.7k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10770:9): [True: 13.2k, False: 29.4k]
  ------------------
10771|  13.2k|        cur = ctxt->input->cur + 1;
10772|  29.4k|    } else {
10773|  29.4k|        cur = ctxt->input->cur + ctxt->checkIndex;
10774|  29.4k|    }
10775|  42.7k|    start = cur;
10776|       |
10777|  26.3M|    while (cur < end) {
  ------------------
  |  Branch (10777:12): [True: 26.3M, False: 33.4k]
  ------------------
10778|  26.3M|        if (state == '-') {
  ------------------
  |  Branch (10778:13): [True: 146k, False: 26.1M]
  ------------------
10779|   146k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10779:17): [True: 24.8k, False: 121k]
  ------------------
10780|  24.8k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10780:17): [True: 20.4k, False: 4.36k]
  ------------------
10781|  20.4k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10781:17): [True: 13.9k, False: 6.47k]
  ------------------
10782|  13.9k|                state = 0;
10783|  13.9k|                cur += 3;
10784|  13.9k|                start = cur;
10785|  13.9k|                continue;
10786|  13.9k|            }
10787|   146k|        }
10788|  26.1M|        else if (state == ']') {
  ------------------
  |  Branch (10788:18): [True: 11.0k, False: 26.1M]
  ------------------
10789|  11.0k|            if (*cur == '>') {
  ------------------
  |  Branch (10789:17): [True: 9.07k, False: 2.02k]
  ------------------
10790|  9.07k|                ctxt->checkIndex = 0;
10791|  9.07k|                ctxt->endCheckState = 0;
10792|  9.07k|                return(1);
10793|  9.07k|            }
10794|  2.02k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.02k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.02k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 244, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.02k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.58k, False: 198]
  |  |  |  |  |  Branch (91:23): [True: 466, False: 1.11k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.02k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 461, False: 854]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10795|  1.17k|                state = ' ';
10796|  1.17k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10796:24): [True: 545, False: 309]
  ------------------
10797|    545|                state = 0;
10798|    545|                start = cur;
10799|    545|                continue;
10800|    545|            }
10801|  2.02k|        }
10802|  26.1M|        else if (state == ' ') {
  ------------------
  |  Branch (10802:18): [True: 1.91k, False: 26.1M]
  ------------------
10803|  1.91k|            if (*cur == '>') {
  ------------------
  |  Branch (10803:17): [True: 243, False: 1.67k]
  ------------------
10804|    243|                ctxt->checkIndex = 0;
10805|    243|                ctxt->endCheckState = 0;
10806|    243|                return(1);
10807|    243|            }
10808|  1.67k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.67k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.67k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 207, False: 1.46k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.67k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.22k, False: 242]
  |  |  |  |  |  Branch (91:23): [True: 295, False: 927]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.67k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 245, False: 924]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10809|    924|                state = 0;
10810|    924|                start = cur;
10811|    924|                continue;
10812|    924|            }
10813|  1.67k|        }
10814|  26.1M|        else if (state != 0) {
  ------------------
  |  Branch (10814:18): [True: 20.5M, False: 5.58M]
  ------------------
10815|  20.5M|            if (*cur == state) {
  ------------------
  |  Branch (10815:17): [True: 38.4k, False: 20.5M]
  ------------------
10816|  38.4k|                state = 0;
10817|  38.4k|                start = cur + 1;
10818|  38.4k|            }
10819|  20.5M|        }
10820|  5.58M|        else if (*cur == '<') {
  ------------------
  |  Branch (10820:18): [True: 61.8k, False: 5.52M]
  ------------------
10821|  61.8k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10821:17): [True: 47.6k, False: 14.1k]
  ------------------
10822|  47.6k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10822:17): [True: 14.2k, False: 33.3k]
  ------------------
10823|  14.2k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10823:17): [True: 14.0k, False: 278]
  ------------------
10824|  14.0k|                state = '-';
10825|  14.0k|                cur += 4;
10826|       |                /* Don't treat <!--> as comment */
10827|  14.0k|                start = cur;
10828|  14.0k|                continue;
10829|  14.0k|            }
10830|  61.8k|        }
10831|  5.52M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10831:18): [True: 24.6k, False: 5.49M]
  |  Branch (10831:35): [True: 14.3k, False: 5.48M]
  |  Branch (10831:53): [True: 10.8k, False: 5.47M]
  ------------------
10832|  49.8k|            state = *cur;
10833|  49.8k|        }
10834|       |
10835|  26.2M|        cur++;
10836|  26.2M|    }
10837|       |
10838|       |    /*
10839|       |     * Rescan the three last characters to detect "<!--" and "-->"
10840|       |     * split across chunks.
10841|       |     */
10842|  33.4k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10842:9): [True: 6.58k, False: 26.8k]
  |  Branch (10842:25): [True: 389, False: 26.4k]
  ------------------
10843|  6.97k|        if (cur - start < 3)
  ------------------
  |  Branch (10843:13): [True: 582, False: 6.38k]
  ------------------
10844|    582|            cur = start;
10845|  6.38k|        else
10846|  6.38k|            cur -= 3;
10847|  6.97k|    }
10848|  33.4k|    index = cur - ctxt->input->cur;
10849|  33.4k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10849:9): [True: 0, False: 33.4k]
  ------------------
10850|      0|        ctxt->checkIndex = 0;
10851|      0|        ctxt->endCheckState = 0;
10852|      0|        return(1);
10853|      0|    }
10854|  33.4k|    ctxt->checkIndex = index;
10855|  33.4k|    ctxt->endCheckState = state;
10856|  33.4k|    return(0);
10857|  33.4k|}
parser.c:xmlCtxtParseEntity:
11796|  8.91k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11797|  8.91k|    xmlParserInputPtr input;
11798|  8.91k|    xmlNodePtr list;
11799|  8.91k|    unsigned long consumed;
11800|  8.91k|    int isExternal;
11801|  8.91k|    int buildTree;
11802|  8.91k|    int oldMinNsIndex;
11803|  8.91k|    int oldNodelen, oldNodemem;
11804|       |
11805|  8.91k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11806|  8.91k|    buildTree = (ctxt->node != NULL);
11807|       |
11808|       |    /*
11809|       |     * Recursion check
11810|       |     */
11811|  8.91k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  8.91k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11811:9): [True: 7, False: 8.91k]
  ------------------
11812|      7|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11813|      7|        goto error;
11814|      7|    }
11815|       |
11816|       |    /*
11817|       |     * Load entity
11818|       |     */
11819|  8.91k|    input = xmlNewEntityInputStream(ctxt, ent);
11820|  8.91k|    if (input == NULL)
  ------------------
  |  Branch (11820:9): [True: 2.33k, False: 6.57k]
  ------------------
11821|  2.33k|        goto error;
11822|       |
11823|       |    /*
11824|       |     * When building a tree, we need to limit the scope of namespace
11825|       |     * declarations, so that entities don't reference xmlNs structs
11826|       |     * from the parent of a reference.
11827|       |     */
11828|  6.57k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11829|  6.57k|    if (buildTree)
  ------------------
  |  Branch (11829:9): [True: 6.57k, False: 0]
  ------------------
11830|  6.57k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11831|       |
11832|  6.57k|    oldNodelen = ctxt->nodelen;
11833|  6.57k|    oldNodemem = ctxt->nodemem;
11834|  6.57k|    ctxt->nodelen = 0;
11835|  6.57k|    ctxt->nodemem = 0;
11836|       |
11837|       |    /*
11838|       |     * Parse content
11839|       |     *
11840|       |     * This initiates a recursive call chain:
11841|       |     *
11842|       |     * - xmlCtxtParseContentInternal
11843|       |     * - xmlParseContentInternal
11844|       |     * - xmlParseReference
11845|       |     * - xmlCtxtParseEntity
11846|       |     *
11847|       |     * The nesting depth is limited by the maximum number of inputs,
11848|       |     * see xmlCtxtPushInput.
11849|       |     *
11850|       |     * It's possible to make this non-recursive (minNsIndex must be
11851|       |     * stored in the input struct) at the expense of code readability.
11852|       |     */
11853|       |
11854|  6.57k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.57k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11855|       |
11856|  6.57k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11857|       |
11858|  6.57k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.57k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11859|       |
11860|  6.57k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11861|  6.57k|    ctxt->nodelen = oldNodelen;
11862|  6.57k|    ctxt->nodemem = oldNodemem;
11863|       |
11864|       |    /*
11865|       |     * Entity size accounting
11866|       |     */
11867|  6.57k|    consumed = input->consumed;
11868|  6.57k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11869|       |
11870|  6.57k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  6.57k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11870:9): [True: 3.99k, False: 2.58k]
  ------------------
11871|  3.99k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11872|       |
11873|  6.57k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  6.57k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11873:9): [True: 3.99k, False: 2.58k]
  ------------------
11874|  3.99k|        if (isExternal)
  ------------------
  |  Branch (11874:13): [True: 1.91k, False: 2.08k]
  ------------------
11875|  1.91k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11876|       |
11877|  3.99k|        ent->children = list;
11878|       |
11879|  60.3k|        while (list != NULL) {
  ------------------
  |  Branch (11879:16): [True: 56.3k, False: 3.99k]
  ------------------
11880|  56.3k|            list->parent = (xmlNodePtr) ent;
11881|       |
11882|       |            /*
11883|       |             * Downstream code like the nginx xslt module can set
11884|       |             * ctxt->myDoc->extSubset to a separate DTD, so the entity
11885|       |             * might have a different or a NULL document.
11886|       |             */
11887|  56.3k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11887:17): [True: 0, False: 56.3k]
  ------------------
11888|      0|                xmlSetTreeDoc(list, ent->doc);
11889|       |
11890|  56.3k|            if (list->next == NULL)
  ------------------
  |  Branch (11890:17): [True: 2.89k, False: 53.4k]
  ------------------
11891|  2.89k|                ent->last = list;
11892|  56.3k|            list = list->next;
11893|  56.3k|        }
11894|  3.99k|    } else {
11895|  2.58k|        xmlFreeNodeList(list);
11896|  2.58k|    }
11897|       |
11898|  6.57k|    xmlFreeInputStream(input);
11899|       |
11900|  8.91k|error:
11901|  8.91k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  8.91k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  8.91k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11902|  8.91k|}
parser.c:xmlCtxtParseContentInternal:
11706|  6.57k|                            int hasTextDecl, int buildTree) {
11707|  6.57k|    xmlNodePtr root = NULL;
11708|  6.57k|    xmlNodePtr list = NULL;
11709|  6.57k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  6.57k|#define BAD_CAST (xmlChar *)
  ------------------
11710|  6.57k|    int result;
11711|       |
11712|  6.57k|    if (buildTree) {
  ------------------
  |  Branch (11712:9): [True: 6.57k, False: 0]
  ------------------
11713|  6.57k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11714|  6.57k|        if (root == NULL) {
  ------------------
  |  Branch (11714:13): [True: 4, False: 6.57k]
  ------------------
11715|      4|            xmlErrMemory(ctxt);
11716|      4|            goto error;
11717|      4|        }
11718|  6.57k|    }
11719|       |
11720|  6.57k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11720:9): [True: 3, False: 6.57k]
  ------------------
11721|      3|        goto error;
11722|       |
11723|  6.57k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11724|  6.57k|    spacePush(ctxt, -1);
11725|       |
11726|  6.57k|    if (buildTree)
  ------------------
  |  Branch (11726:9): [True: 6.57k, False: 0]
  ------------------
11727|  6.57k|        nodePush(ctxt, root);
11728|       |
11729|  6.57k|    if (hasTextDecl) {
  ------------------
  |  Branch (11729:9): [True: 2.44k, False: 4.12k]
  ------------------
11730|  2.44k|        xmlDetectEncoding(ctxt);
11731|       |
11732|       |        /*
11733|       |         * Parse a possible text declaration first
11734|       |         */
11735|  2.44k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|  2.44k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.89k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.43k, False: 1.01k]
  |  |  |  |  |  Branch (2268:41): [True: 416, False: 1.01k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.44k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 376, False: 40]
  |  |  |  |  |  Branch (2269:41): [True: 375, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 370, False: 5]
  |  |  ------------------
  ------------------
11736|    370|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    370|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    370|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 252, False: 118]
  |  |  |  |  ------------------
  |  |  |  |   91|    370|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 117, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 98, False: 19]
  |  |  |  |  ------------------
  |  |  |  |   92|    370|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 18, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11737|    368|            xmlParseTextDecl(ctxt);
11738|       |            /*
11739|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11740|       |             */
11741|    368|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    368|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11741:17): [True: 360, False: 8]
  ------------------
11742|    360|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    360|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11742:17): [True: 94, False: 266]
  ------------------
11743|     94|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11744|     94|                               "Version mismatch between document and "
11745|     94|                               "entity\n");
11746|     94|            }
11747|    368|        }
11748|  2.44k|    }
11749|       |
11750|  6.57k|    xmlParseContentInternal(ctxt);
11751|       |
11752|  6.57k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11752:9): [True: 388, False: 6.18k]
  ------------------
11753|    388|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11754|       |
11755|  6.57k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11755:9): [True: 4.61k, False: 1.95k]
  ------------------
11756|  5.65k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11756:10): [True: 1.23k, False: 721]
  |  Branch (11756:30): [True: 1.03k, False: 197]
  ------------------
11757|  5.65k|        if (root != NULL) {
  ------------------
  |  Branch (11757:13): [True: 5.65k, False: 0]
  ------------------
11758|  5.65k|            xmlNodePtr cur;
11759|       |
11760|       |            /*
11761|       |             * Unlink newly created node list.
11762|       |             */
11763|  5.65k|            list = root->children;
11764|  5.65k|            root->children = NULL;
11765|  5.65k|            root->last = NULL;
11766|  67.5k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11766:30): [True: 61.9k, False: 5.65k]
  ------------------
11767|  61.9k|                cur->parent = NULL;
11768|  5.65k|        }
11769|  5.65k|    }
11770|       |
11771|       |    /*
11772|       |     * Read the rest of the stream in case of errors. We want
11773|       |     * to account for the whole entity size.
11774|       |     */
11775|  6.78k|    do {
11776|  6.78k|        ctxt->input->cur = ctxt->input->end;
11777|  6.78k|        xmlParserShrink(ctxt);
11778|  6.78k|        result = xmlParserGrow(ctxt);
11779|  6.78k|    } while (result > 0);
  ------------------
  |  Branch (11779:14): [True: 209, False: 6.57k]
  ------------------
11780|       |
11781|  6.57k|    if (buildTree)
  ------------------
  |  Branch (11781:9): [True: 6.57k, False: 0]
  ------------------
11782|  6.57k|        nodePop(ctxt);
11783|       |
11784|  6.57k|    namePop(ctxt);
11785|  6.57k|    spacePop(ctxt);
11786|       |
11787|  6.57k|    xmlCtxtPopInput(ctxt);
11788|       |
11789|  6.57k|error:
11790|  6.57k|    xmlFreeNode(root);
11791|       |
11792|  6.57k|    return(list);
11793|  6.57k|}
parser.c:xmlParserNsPush:
 1703|   460k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1704|   460k|    xmlParserNsBucket *bucket = NULL;
 1705|   460k|    xmlParserNsExtra *extra;
 1706|   460k|    const xmlChar **ns;
 1707|   460k|    unsigned hashValue, nsIndex, oldIndex;
 1708|       |
 1709|   460k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1709:9): [True: 410k, False: 50.0k]
  |  Branch (1709:29): [True: 195, False: 409k]
  ------------------
 1710|    195|        return(0);
 1711|       |
 1712|   459k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1712:9): [True: 18.5k, False: 441k]
  |  Branch (1712:40): [True: 24, False: 18.5k]
  ------------------
 1713|     24|        xmlErrMemory(ctxt);
 1714|     24|        return(-1);
 1715|     24|    }
 1716|       |
 1717|       |    /*
 1718|       |     * Default namespace and 'xml' namespace
 1719|       |     */
 1720|   459k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1720:9): [True: 49.9k, False: 409k]
  |  Branch (1720:29): [True: 0, False: 409k]
  ------------------
 1721|  49.9k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1722|       |
 1723|  49.9k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1723:13): [True: 47.0k, False: 2.90k]
  ------------------
 1724|  47.0k|            extra = &ctxt->nsdb->extra[oldIndex];
 1725|       |
 1726|  47.0k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1726:17): [True: 930, False: 46.1k]
  ------------------
 1727|    930|                if (defAttr == 0)
  ------------------
  |  Branch (1727:21): [True: 405, False: 525]
  ------------------
 1728|    405|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    405|#define BAD_CAST (xmlChar *)
  ------------------
 1729|    930|                return(0);
 1730|    930|            }
 1731|       |
 1732|  46.1k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1732:17): [True: 7.75k, False: 38.3k]
  ------------------
 1733|  7.75k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1733:17): [True: 6.21k, False: 1.54k]
  ------------------
 1734|  6.21k|                return(0);
 1735|  46.1k|        }
 1736|       |
 1737|  42.8k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1738|  42.8k|        goto populate_entry;
 1739|  49.9k|    }
 1740|       |
 1741|       |    /*
 1742|       |     * Hash table lookup
 1743|       |     */
 1744|   409k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1745|   409k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1745:9): [True: 310k, False: 99.7k]
  ------------------
 1746|   310k|        extra = &ctxt->nsdb->extra[oldIndex];
 1747|       |
 1748|       |        /*
 1749|       |         * Check for duplicate definitions on the same element.
 1750|       |         */
 1751|   310k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1751:13): [True: 1.31k, False: 308k]
  ------------------
 1752|  1.31k|            if (defAttr == 0)
  ------------------
  |  Branch (1752:17): [True: 1.12k, False: 195]
  ------------------
 1753|  1.12k|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|  1.12k|#define BAD_CAST (xmlChar *)
  ------------------
 1754|  1.31k|            return(0);
 1755|  1.31k|        }
 1756|       |
 1757|   308k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1757:13): [True: 32.0k, False: 276k]
  ------------------
 1758|  32.0k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1758:13): [True: 31.0k, False: 959]
  ------------------
 1759|  31.0k|            return(0);
 1760|       |
 1761|   277k|        bucket->index = ctxt->nsNr;
 1762|   277k|        goto populate_entry;
 1763|   308k|    }
 1764|       |
 1765|       |    /*
 1766|       |     * Insert new bucket
 1767|       |     */
 1768|       |
 1769|  99.7k|    hashValue = prefix->hashValue;
 1770|       |
 1771|       |    /*
 1772|       |     * Grow hash table, 50% fill factor
 1773|       |     */
 1774|  99.7k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1774:9): [True: 10.3k, False: 89.4k]
  ------------------
 1775|  10.3k|        xmlParserNsBucket *newHash;
 1776|  10.3k|        unsigned newSize, i, index;
 1777|       |
 1778|  10.3k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1778:13): [True: 0, False: 10.3k]
  ------------------
 1779|      0|            xmlErrMemory(ctxt);
 1780|      0|            return(-1);
 1781|      0|        }
 1782|  10.3k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1782:19): [True: 775, False: 9.59k]
  ------------------
 1783|  10.3k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1784|  10.3k|        if (newHash == NULL) {
  ------------------
  |  Branch (1784:13): [True: 6, False: 10.3k]
  ------------------
 1785|      6|            xmlErrMemory(ctxt);
 1786|      6|            return(-1);
 1787|      6|        }
 1788|  10.3k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1789|       |
 1790|   265k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1790:21): [True: 254k, False: 10.3k]
  ------------------
 1791|   254k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1792|   254k|            unsigned newIndex;
 1793|       |
 1794|   254k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1794:17): [True: 251k, False: 3.17k]
  |  Branch (1794:30): [True: 1.24k, False: 1.93k]
  ------------------
 1795|   252k|                continue;
 1796|  1.93k|            newIndex = hv & (newSize - 1);
 1797|       |
 1798|  3.07k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1798:20): [True: 1.13k, False: 1.93k]
  ------------------
 1799|  1.13k|                newIndex++;
 1800|  1.13k|                if (newIndex == newSize)
  ------------------
  |  Branch (1800:21): [True: 206, False: 931]
  ------------------
 1801|    206|                    newIndex = 0;
 1802|  1.13k|            }
 1803|       |
 1804|  1.93k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1805|  1.93k|        }
 1806|       |
 1807|  10.3k|        xmlFree(ctxt->nsdb->hash);
 1808|  10.3k|        ctxt->nsdb->hash = newHash;
 1809|  10.3k|        ctxt->nsdb->hashSize = newSize;
 1810|       |
 1811|       |        /*
 1812|       |         * Relookup
 1813|       |         */
 1814|  10.3k|        index = hashValue & (newSize - 1);
 1815|       |
 1816|  10.7k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1816:16): [True: 373, False: 10.3k]
  ------------------
 1817|    373|            index++;
 1818|    373|            if (index == newSize)
  ------------------
  |  Branch (1818:17): [True: 56, False: 317]
  ------------------
 1819|     56|                index = 0;
 1820|    373|        }
 1821|       |
 1822|  10.3k|        bucket = &newHash[index];
 1823|  10.3k|    }
 1824|       |
 1825|  99.7k|    bucket->hashValue = hashValue;
 1826|  99.7k|    bucket->index = ctxt->nsNr;
 1827|  99.7k|    ctxt->nsdb->hashElems++;
 1828|  99.7k|    oldIndex = INT_MAX;
 1829|       |
 1830|   420k|populate_entry:
 1831|   420k|    nsIndex = ctxt->nsNr;
 1832|       |
 1833|   420k|    ns = &ctxt->nsTab[nsIndex * 2];
 1834|   420k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1834:13): [True: 377k, False: 42.8k]
  ------------------
 1835|   420k|    ns[1] = uri->name;
 1836|       |
 1837|   420k|    extra = &ctxt->nsdb->extra[nsIndex];
 1838|   420k|    extra->saxData = saxData;
 1839|   420k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1839:30): [True: 377k, False: 42.8k]
  ------------------
 1840|   420k|    extra->uriHashValue = uri->hashValue;
 1841|   420k|    extra->elementId = ctxt->nsdb->elementId;
 1842|   420k|    extra->oldIndex = oldIndex;
 1843|       |
 1844|   420k|    ctxt->nsNr++;
 1845|       |
 1846|   420k|    return(1);
 1847|  99.7k|}
parser.c:xmlParserNsGrow:
 1661|  18.5k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1662|  18.5k|    const xmlChar **table;
 1663|  18.5k|    xmlParserNsExtra *extra;
 1664|  18.5k|    int newSize;
 1665|       |
 1666|  18.5k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1667|  18.5k|                              sizeof(table[0]) + sizeof(extra[0]),
 1668|  18.5k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  18.5k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1669|  18.5k|    if (newSize < 0)
  ------------------
  |  Branch (1669:9): [True: 0, False: 18.5k]
  ------------------
 1670|      0|        goto error;
 1671|       |
 1672|  18.5k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1673|  18.5k|    if (table == NULL)
  ------------------
  |  Branch (1673:9): [True: 9, False: 18.5k]
  ------------------
 1674|      9|        goto error;
 1675|  18.5k|    ctxt->nsTab = table;
 1676|       |
 1677|  18.5k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1678|  18.5k|    if (extra == NULL)
  ------------------
  |  Branch (1678:9): [True: 15, False: 18.5k]
  ------------------
 1679|     15|        goto error;
 1680|  18.5k|    ctxt->nsdb->extra = extra;
 1681|       |
 1682|  18.5k|    ctxt->nsMax = newSize;
 1683|  18.5k|    return(0);
 1684|       |
 1685|     24|error:
 1686|     24|    xmlErrMemory(ctxt);
 1687|     24|    return(-1);
 1688|  18.5k|}
parser.c:xmlParserNsPop:
 1858|   199k|{
 1859|   199k|    int i;
 1860|       |
 1861|       |    /* assert(nr <= ctxt->nsNr); */
 1862|       |
 1863|   511k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1863:30): [True: 311k, False: 199k]
  ------------------
 1864|   311k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1865|   311k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1866|       |
 1867|   311k|        if (prefix == NULL) {
  ------------------
  |  Branch (1867:13): [True: 17.9k, False: 293k]
  ------------------
 1868|  17.9k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1869|   293k|        } else {
 1870|   293k|            xmlHashedString hprefix;
 1871|   293k|            xmlParserNsBucket *bucket = NULL;
 1872|       |
 1873|   293k|            hprefix.name = prefix;
 1874|   293k|            hprefix.hashValue = extra->prefixHashValue;
 1875|   293k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1876|       |            /* assert(bucket && bucket->hashValue); */
 1877|   293k|            bucket->index = extra->oldIndex;
 1878|   293k|        }
 1879|   311k|    }
 1880|       |
 1881|   199k|    ctxt->nsNr -= nr;
 1882|   199k|    return(nr);
 1883|   199k|}
parser.c:xmlCtxtSetOptionsInternal:
13169|  54.1k|{
13170|  54.1k|    int allMask;
13171|       |
13172|  54.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (13172:9): [True: 0, False: 54.1k]
  ------------------
13173|      0|        return(-1);
13174|       |
13175|       |    /*
13176|       |     * XInclude options aren't handled by the parser.
13177|       |     *
13178|       |     * XML_PARSE_XINCLUDE
13179|       |     * XML_PARSE_NOXINCNODE
13180|       |     * XML_PARSE_NOBASEFIX
13181|       |     */
13182|  54.1k|    allMask = XML_PARSE_RECOVER |
13183|  54.1k|              XML_PARSE_NOENT |
13184|  54.1k|              XML_PARSE_DTDLOAD |
13185|  54.1k|              XML_PARSE_DTDATTR |
13186|  54.1k|              XML_PARSE_DTDVALID |
13187|  54.1k|              XML_PARSE_NOERROR |
13188|  54.1k|              XML_PARSE_NOWARNING |
13189|  54.1k|              XML_PARSE_PEDANTIC |
13190|  54.1k|              XML_PARSE_NOBLANKS |
13191|  54.1k|#ifdef LIBXML_SAX1_ENABLED
13192|  54.1k|              XML_PARSE_SAX1 |
13193|  54.1k|#endif
13194|  54.1k|              XML_PARSE_NONET |
13195|  54.1k|              XML_PARSE_NODICT |
13196|  54.1k|              XML_PARSE_NSCLEAN |
13197|  54.1k|              XML_PARSE_NOCDATA |
13198|  54.1k|              XML_PARSE_COMPACT |
13199|  54.1k|              XML_PARSE_OLD10 |
13200|  54.1k|              XML_PARSE_HUGE |
13201|  54.1k|              XML_PARSE_OLDSAX |
13202|  54.1k|              XML_PARSE_IGNORE_ENC |
13203|  54.1k|              XML_PARSE_BIG_LINES |
13204|  54.1k|              XML_PARSE_NO_XXE |
13205|  54.1k|              XML_PARSE_UNZIP |
13206|  54.1k|              XML_PARSE_NO_SYS_CATALOG |
13207|  54.1k|              XML_PARSE_CATALOG_PI;
13208|       |
13209|  54.1k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13210|       |
13211|       |    /*
13212|       |     * For some options, struct members are historically the source
13213|       |     * of truth. The values are initalized from global variables and
13214|       |     * old code could also modify them directly. Several older API
13215|       |     * functions that don't take an options argument rely on these
13216|       |     * deprecated mechanisms.
13217|       |     *
13218|       |     * Once public access to struct members and the globals are
13219|       |     * disabled, we can use the options bitmask as source of
13220|       |     * truth, making all these struct members obsolete.
13221|       |     *
13222|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13223|       |     * loading of the external subset.
13224|       |     */
13225|  54.1k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13225:22): [True: 27.5k, False: 26.6k]
  ------------------
13226|  54.1k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13226:29): [True: 27.3k, False: 26.8k]
  ------------------
13227|  54.1k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  29.8k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13227:24): [True: 29.8k, False: 24.3k]
  ------------------
13228|  54.1k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  26.3k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13228:25): [True: 26.3k, False: 27.8k]
  ------------------
13229|  54.1k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  25.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13229:25): [True: 25.9k, False: 28.2k]
  ------------------
13230|  54.1k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13230:22): [True: 25.8k, False: 28.3k]
  ------------------
13231|  54.1k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13231:22): [True: 12.4k, False: 41.7k]
  ------------------
13232|  54.1k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13232:24): [True: 25.1k, False: 29.0k]
  ------------------
13233|  54.1k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13233:23): [True: 22.3k, False: 31.8k]
  ------------------
13234|       |
13235|  54.1k|    return(options & ~allMask);
13236|  54.1k|}

xmlCtxtSetErrorHandler:
  122|  54.1k|{
  123|  54.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 54.1k]
  ------------------
  124|      0|        return;
  125|  54.1k|    ctxt->errorHandler = handler;
  126|  54.1k|    ctxt->errorCtxt = data;
  127|  54.1k|}
xmlCtxtErrMemory:
  179|  14.8k|{
  180|  14.8k|    xmlStructuredErrorFunc schannel = NULL;
  181|  14.8k|    xmlGenericErrorFunc channel = NULL;
  182|  14.8k|    void *data;
  183|       |
  184|  14.8k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 14.8k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  14.8k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  14.8k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  14.8k|    ctxt->wellFormed = 0;
  192|  14.8k|    ctxt->disableSAX = 2;
  193|       |
  194|  14.8k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 14.8k, False: 0]
  ------------------
  195|  14.8k|        schannel = ctxt->errorHandler;
  196|  14.8k|        data = ctxt->errorCtxt;
  197|  14.8k|    } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|      0|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (197:16): [True: 0, False: 0]
  ------------------
  198|      0|        (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|        schannel = ctxt->sax->serror;
  200|      0|        data = ctxt->userData;
  201|      0|    } else {
  202|      0|        channel = ctxt->sax->error;
  203|      0|        data = ctxt->userData;
  204|      0|    }
  205|       |
  206|  14.8k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  14.8k|                        &ctxt->lastError);
  208|  14.8k|}
xmlCtxtErrIO:
  221|   273k|{
  222|   273k|    const char *errstr, *msg, *str1, *str2;
  223|   273k|    xmlErrorLevel level;
  224|       |
  225|   273k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 273k]
  ------------------
  226|      0|        return;
  227|       |
  228|   273k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 6.35k, False: 266k]
  ------------------
  229|   266k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 266k]
  ------------------
  230|       |        /*
  231|       |         * Only report a warning if a file could not be found. This should
  232|       |         * only be done for external entities, but the external entity loader
  233|       |         * of xsltproc can try multiple paths and assumes that ENOENT doesn't
  234|       |         * raise an error and aborts parsing.
  235|       |         */
  236|  6.35k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 2.03k, False: 4.31k]
  ------------------
  237|  2.03k|            level = XML_ERR_WARNING;
  238|  4.31k|        else
  239|  4.31k|            level = XML_ERR_ERROR;
  240|   266k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 266k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   266k|    } else {
  243|   266k|        level = XML_ERR_FATAL;
  244|   266k|    }
  245|       |
  246|   273k|    errstr = xmlErrString(code);
  247|       |
  248|   273k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 266k, False: 6.40k]
  ------------------
  249|   266k|        msg = "%s\n";
  250|   266k|        str1 = errstr;
  251|   266k|        str2 = NULL;
  252|   266k|    } else {
  253|  6.40k|        msg = "failed to load \"%s\": %s\n";
  254|  6.40k|        str1 = uri;
  255|  6.40k|        str2 = errstr;
  256|  6.40k|    }
  257|       |
  258|   273k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   273k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   273k|               msg, str1, str2);
  261|   273k|}
xmlCtxtIsCatastrophicError:
  268|  43.9M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  43.9M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 43.9M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  43.9M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  43.9M|                                  ctxt->lastError.code));
  274|  43.9M|}
xmlCtxtVErr:
  296|  44.3M|{
  297|  44.3M|    xmlStructuredErrorFunc schannel = NULL;
  298|  44.3M|    xmlGenericErrorFunc channel = NULL;
  299|  44.3M|    void *data = NULL;
  300|  44.3M|    const char *file = NULL;
  301|  44.3M|    int line = 0;
  302|  44.3M|    int col = 0;
  303|  44.3M|    int res;
  304|       |
  305|  44.3M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 3.71k, False: 44.3M]
  ------------------
  306|  3.71k|        xmlCtxtErrMemory(ctxt);
  307|  3.71k|        return;
  308|  3.71k|    }
  309|       |
  310|  44.3M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 44.3M]
  ------------------
  311|      0|        res = xmlVRaiseError(NULL, NULL, NULL, NULL, node, domain, code,
  312|      0|                             level, NULL, 0, (const char *) str1,
  313|      0|                             (const char *) str2, (const char *) str3,
  314|      0|                             int1, 0, msg, ap);
  315|      0|        if (res < 0)
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  317|       |
  318|      0|        return;
  319|      0|    }
  320|       |
  321|  44.3M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  44.3M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 418k, False: 43.9M]
  |  |  ------------------
  ------------------
  322|   418k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  43.9M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 43.9M]
  ------------------
  326|      0|        return;
  327|       |
  328|  43.9M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 105k, False: 43.8M]
  ------------------
  329|   105k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   105k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 56.0k, False: 49.4k]
  ------------------
  330|  56.0k|            return;
  331|  49.4k|        ctxt->nbWarnings += 1;
  332|  43.8M|    } else {
  333|       |        /*
  334|       |         * By long-standing design, the parser isn't completely
  335|       |         * stopped on well-formedness errors. Only SAX callbacks
  336|       |         * are disabled.
  337|       |         *
  338|       |         * In some situations, we really want to abort as fast
  339|       |         * as possible.
  340|       |         */
  341|  43.8M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 12, False: 43.8M]
  ------------------
  342|  43.8M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 357, False: 43.8M]
  ------------------
  343|  43.8M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 100, False: 43.8M]
  ------------------
  344|    469|            ctxt->disableSAX = 2; /* really stop parser */
  345|  43.8M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  43.8M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|  87.6M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 43.1M, False: 638k]
  ------------------
  348|  43.1M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 792k, False: 42.4M]
  |  Branch (348:43): [True: 42.4M, False: 220]
  ------------------
  349|  43.1M|                return;
  350|       |
  351|   639k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 480k, False: 158k]
  |  Branch (351:43): [True: 114k, False: 366k]
  ------------------
  352|   114k|                ctxt->disableSAX = 1;
  353|   639k|        }
  354|       |
  355|   639k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 481k, False: 158k]
  ------------------
  356|   481k|            ctxt->wellFormed = 0;
  357|   639k|        ctxt->errNo = code;
  358|   639k|        ctxt->nbErrors += 1;
  359|   639k|    }
  360|       |
  361|   689k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 262k, False: 426k]
  ------------------
  362|   262k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 241k, False: 20.7k]
  ------------------
  363|   251k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 9.69k, False: 11.0k]
  ------------------
  364|   251k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 251k, False: 0]
  ------------------
  365|   251k|            schannel = ctxt->errorHandler;
  366|   251k|            data = ctxt->errorCtxt;
  367|   251k|        } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|      0|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (367:20): [True: 0, False: 0]
  ------------------
  368|      0|            (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (368:13): [True: 0, False: 0]
  ------------------
  369|      0|            schannel = ctxt->sax->serror;
  370|      0|            data = ctxt->userData;
  371|      0|        } else if ((domain == XML_FROM_VALID) || (domain == XML_FROM_DTD)) {
  ------------------
  |  Branch (371:20): [True: 0, False: 0]
  |  Branch (371:50): [True: 0, False: 0]
  ------------------
  372|      0|            if (level == XML_ERR_WARNING)
  ------------------
  |  Branch (372:17): [True: 0, False: 0]
  ------------------
  373|      0|                channel = ctxt->vctxt.warning;
  374|      0|            else
  375|      0|                channel = ctxt->vctxt.error;
  376|      0|            data = ctxt->vctxt.userData;
  377|      0|        } else {
  378|      0|            if (level == XML_ERR_WARNING)
  ------------------
  |  Branch (378:17): [True: 0, False: 0]
  ------------------
  379|      0|                channel = ctxt->sax->warning;
  380|      0|            else
  381|      0|                channel = ctxt->sax->error;
  382|      0|            data = ctxt->userData;
  383|      0|        }
  384|   251k|    }
  385|       |
  386|   689k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 686k, False: 2.94k]
  ------------------
  387|   686k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   686k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 398k, False: 287k]
  ------------------
  390|   398k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 25.8k, False: 372k]
  ------------------
  391|  25.8k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  25.8k|        }
  393|   686k|        file = input->filename;
  394|   686k|        line = input->line;
  395|   686k|        col = input->col;
  396|   686k|    }
  397|       |
  398|   689k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   689k|                         level, file, line, (const char *) str1,
  400|   689k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   689k|                         msg, ap);
  402|       |
  403|   689k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.65k, False: 686k]
  ------------------
  404|  2.65k|        xmlCtxtErrMemory(ctxt);
  405|  2.65k|        return;
  406|  2.65k|    }
  407|   689k|}
xmlCtxtErr:
  429|  43.9M|{
  430|  43.9M|    va_list ap;
  431|       |
  432|  43.9M|    va_start(ap, msg);
  433|  43.9M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  43.9M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  43.9M|}
xmlFatalErr:
  481|  9.13M|{
  482|  9.13M|    const char *errmsg;
  483|  9.13M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  9.13M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  9.13M|    errmsg = xmlErrString(code);
  487|       |
  488|  9.13M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 9.13M, False: 0]
  |  Branch (488:27): [True: 0, False: 9.13M]
  ------------------
  489|      0|        domain = XML_FROM_HTML;
  490|       |
  491|       |        /* Continue if encoding is unsupported */
  492|      0|        if (code == XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (492:13): [True: 0, False: 0]
  ------------------
  493|      0|            level = XML_ERR_ERROR;
  494|      0|    }
  495|       |
  496|  9.13M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.67M, False: 7.46M]
  ------------------
  497|  1.67M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.67M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  7.46M|    } else {
  500|  7.46M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  7.46M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  7.46M|                   "%s: %s\n", errmsg, info);
  503|  7.46M|    }
  504|  9.13M|}
xmlParserGrow:
  616|  9.02M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  9.02M|    xmlParserInputPtr in = ctxt->input;
  618|  9.02M|    xmlParserInputBufferPtr buf = in->buf;
  619|  9.02M|    size_t curEnd = in->end - in->cur;
  620|  9.02M|    size_t curBase = in->cur - in->base;
  621|  9.02M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 3.30M, False: 5.71M]
  ------------------
  622|  3.30M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  3.30M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  9.02M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  14.7M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  9.02M|    int ret;
  625|       |
  626|  9.02M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 9.02M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  9.02M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  9.02M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  9.02M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.17M, False: 6.84M]
  |  |  ------------------
  ------------------
  630|  2.17M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  6.84M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 6.42M, False: 421k]
  |  Branch (632:35): [True: 6.42M, False: 0]
  ------------------
  633|  6.42M|        return(0);
  634|   421k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 87.8k, False: 333k]
  ------------------
  635|  87.8k|        return(-1);
  636|       |
  637|   333k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 333k]
  ------------------
  638|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
  639|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
  640|      0|	return(-1);
  641|      0|    }
  642|       |
  643|   333k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   333k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 342, False: 333k]
  ------------------
  644|    342|        return(0);
  645|       |
  646|   333k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   333k|#define INPUT_CHUNK	250
  ------------------
  647|   333k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   333k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 522, False: 332k]
  ------------------
  650|    522|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    522|    }
  652|       |
  653|   333k|    return(ret);
  654|   333k|}
xmlParserCheckEOF:
  664|  27.1k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  27.1k|    xmlParserInputPtr in = ctxt->input;
  666|  27.1k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  27.1k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 22.4k, False: 4.78k]
  ------------------
  669|  22.4k|        return;
  670|       |
  671|  4.78k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 6, False: 4.77k]
  ------------------
  672|      6|        xmlFatalErr(ctxt, code, NULL);
  673|      6|        return;
  674|      6|    }
  675|       |
  676|  4.77k|    buf = in->buf;
  677|  4.77k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 4.77k, False: 0]
  |  Branch (677:26): [True: 15, False: 4.76k]
  ------------------
  678|     15|        size_t curBase = in->cur - in->base;
  679|     15|        size_t sizeOut = 64;
  680|     15|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|     15|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|     15|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|     15|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 1, False: 14]
  ------------------
  688|      1|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      1|            return;
  690|      1|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|     14|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 14]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|     14|    }
  696|  4.77k|}
xmlParserShrink:
  749|  14.2M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  14.2M|    xmlParserInputPtr in = ctxt->input;
  751|  14.2M|    xmlParserInputBufferPtr buf = in->buf;
  752|  14.2M|    size_t used, res;
  753|       |
  754|  14.2M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 14.2M]
  ------------------
  755|      0|        return;
  756|       |
  757|  14.2M|    used = in->cur - in->base;
  758|       |
  759|  14.2M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  14.2M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 8.57M, False: 5.67M]
  ------------------
  760|  8.57M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  8.57M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  8.57M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 8.57M, False: 277]
  ------------------
  763|  8.57M|            used -= res;
  764|  8.57M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  8.57M|        }
  766|       |
  767|  8.57M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  8.57M|    }
  769|  14.2M|}
xmlNextChar:
  818|   457M|{
  819|   457M|    const unsigned char *cur;
  820|   457M|    size_t avail;
  821|   457M|    int c;
  822|       |
  823|   457M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 457M]
  |  Branch (823:27): [True: 0, False: 457M]
  ------------------
  824|      0|        return;
  825|       |
  826|   457M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   457M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   457M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 2.63M, False: 454M]
  ------------------
  829|  2.63M|        xmlParserGrow(ctxt);
  830|  2.63M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 717, False: 2.63M]
  ------------------
  831|    717|            return;
  832|  2.63M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  2.63M|    }
  834|       |
  835|   457M|    cur = ctxt->input->cur;
  836|   457M|    c = *cur;
  837|       |
  838|   457M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 426M, False: 31.2M]
  ------------------
  839|   426M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 1.28M, False: 424M]
  ------------------
  840|  1.28M|            ctxt->input->cur++;
  841|  1.28M|            ctxt->input->line++;
  842|  1.28M|            ctxt->input->col = 1;
  843|   424M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 50.0k, False: 424M]
  ------------------
  844|       |            /*
  845|       |             *   2.11 End-of-Line Handling
  846|       |             *   the literal two-character sequence "#xD#xA" or a standalone
  847|       |             *   literal #xD, an XML processor must pass to the application
  848|       |             *   the single character #xA.
  849|       |             */
  850|  50.0k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 47.3k, False: 2.74k]
  ------------------
  851|  50.0k|            ctxt->input->line++;
  852|  50.0k|            ctxt->input->col = 1;
  853|  50.0k|            return;
  854|   424M|        } else {
  855|   424M|            ctxt->input->cur++;
  856|   424M|            ctxt->input->col++;
  857|   424M|        }
  858|   426M|    } else {
  859|  31.2M|        ctxt->input->col++;
  860|       |
  861|  31.2M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.38k, False: 31.2M]
  |  Branch (861:28): [True: 27.4M, False: 3.78M]
  ------------------
  862|  27.4M|            goto encoding_error;
  863|       |
  864|  3.78M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 3.50M, False: 289k]
  ------------------
  865|       |            /* 2-byte code */
  866|  3.50M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 2.33M, False: 1.16M]
  ------------------
  867|  2.33M|                goto encoding_error;
  868|  1.16M|            ctxt->input->cur += 2;
  869|  1.16M|        } else {
  870|   289k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   289k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 364, False: 288k]
  |  Branch (872:32): [True: 6.68k, False: 282k]
  ------------------
  873|  7.04k|                goto encoding_error;
  874|       |
  875|   282k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 266k, False: 15.8k]
  ------------------
  876|       |                /* 3-byte code */
  877|   266k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 209, False: 266k]
  |  Branch (877:40): [True: 88.8k, False: 177k]
  |  Branch (877:59): [True: 4.48k, False: 84.3k]
  ------------------
  878|  4.69k|                    goto encoding_error;
  879|   261k|                ctxt->input->cur += 3;
  880|   261k|            } else {
  881|  15.8k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 205, False: 15.6k]
  |  Branch (881:36): [True: 379, False: 15.2k]
  ------------------
  882|    584|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  15.2k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 339, False: 14.9k]
  |  Branch (885:39): [True: 873, False: 14.0k]
  ------------------
  886|  1.21k|                    goto encoding_error;
  887|  14.0k|                ctxt->input->cur += 4;
  888|  14.0k|            }
  889|   282k|        }
  890|  3.78M|    }
  891|       |
  892|   427M|    return;
  893|       |
  894|   427M|encoding_error:
  895|       |    /* Only report the first error */
  896|  29.7M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  29.7M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 222k, False: 29.5M]
  ------------------
  897|   222k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   222k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   222k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   222k|    }
  900|  29.7M|    ctxt->input->cur++;
  901|  29.7M|}
xmlCurrentChar:
  924|  85.9M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  85.9M|    const unsigned char *cur;
  926|  85.9M|    size_t avail;
  927|  85.9M|    int c;
  928|       |
  929|  85.9M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 85.9M]
  |  Branch (929:27): [True: 0, False: 85.9M]
  |  Branch (929:44): [True: 0, False: 85.9M]
  ------------------
  930|       |
  931|  85.9M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  85.9M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  85.9M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 2.59M, False: 83.3M]
  ------------------
  934|  2.59M|        xmlParserGrow(ctxt);
  935|  2.59M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  2.59M|    }
  937|       |
  938|  85.9M|    cur = ctxt->input->cur;
  939|  85.9M|    c = *cur;
  940|       |
  941|  85.9M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 36.8M, False: 49.1M]
  ------------------
  942|       |	/* 1-byte code */
  943|  36.8M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 19.7M, False: 17.0M]
  ------------------
  944|       |            /*
  945|       |             *   2.11 End-of-Line Handling
  946|       |             *   the literal two-character sequence "#xD#xA" or a standalone
  947|       |             *   literal #xD, an XML processor must pass to the application
  948|       |             *   the single character #xA.
  949|       |             */
  950|  19.7M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 713k, False: 19.0M]
  ------------------
  951|       |                /*
  952|       |                 * TODO: This function shouldn't change the 'cur' pointer
  953|       |                 * as side effect, but the NEXTL macro in parser.c relies
  954|       |                 * on this behavior when incrementing line numbers.
  955|       |                 */
  956|   713k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 20.0k, False: 693k]
  ------------------
  957|  20.0k|                    ctxt->input->cur++;
  958|   713k|                *len = 1;
  959|   713k|                c = '\n';
  960|  19.0M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 7.49M, False: 11.5M]
  ------------------
  961|  7.49M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 38.1k, False: 7.46M]
  ------------------
  962|  38.1k|                    *len = 0;
  963|  7.46M|                } else {
  964|  7.46M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  7.46M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  7.46M|                            "Char 0x0 out of allowed range\n");
  971|  7.46M|                }
  972|  11.5M|            } else {
  973|  11.5M|                *len = 1;
  974|  11.5M|            }
  975|  19.7M|        } else {
  976|  17.0M|            *len = 1;
  977|  17.0M|        }
  978|       |
  979|  36.8M|        return(c);
  980|  49.1M|    } else {
  981|  49.1M|        int val;
  982|       |
  983|  49.1M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.32k, False: 49.1M]
  ------------------
  984|  1.32k|            goto incomplete_sequence;
  985|  49.1M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 16.0M, False: 33.1M]
  ------------------
  986|  16.0M|            goto encoding_error;
  987|       |
  988|  33.1M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 4.59M, False: 28.5M]
  ------------------
  989|       |            /* 2-byte code */
  990|  4.59M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 940k, False: 3.65M]
  ------------------
  991|   940k|                goto encoding_error;
  992|  3.65M|            val = (c & 0x1f) << 6;
  993|  3.65M|            val |= cur[1] & 0x3f;
  994|  3.65M|            *len = 2;
  995|  28.5M|        } else {
  996|  28.5M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 249, False: 28.5M]
  ------------------
  997|    249|                goto incomplete_sequence;
  998|  28.5M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 6.54k, False: 28.5M]
  ------------------
  999|  6.54k|                goto encoding_error;
 1000|       |
 1001|  28.5M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 28.5M, False: 22.9k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  28.5M|                val = (c & 0xf) << 12;
 1004|  28.5M|                val |= (cur[1] & 0x3f) << 6;
 1005|  28.5M|                val |= cur[2] & 0x3f;
 1006|  28.5M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 460, False: 28.5M]
  |  Branch (1006:39): [True: 9.87M, False: 18.6M]
  |  Branch (1006:58): [True: 277, False: 9.87M]
  ------------------
 1007|    737|                    goto encoding_error;
 1008|  28.5M|                *len = 3;
 1009|  28.5M|            } else {
 1010|  22.9k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 247, False: 22.7k]
  ------------------
 1011|    247|                    goto incomplete_sequence;
 1012|  22.7k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 2.19k, False: 20.5k]
  ------------------
 1013|  2.19k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  20.5k|                val = (c & 0x0f) << 18;
 1017|  20.5k|                val |= (cur[1] & 0x3f) << 12;
 1018|  20.5k|                val |= (cur[2] & 0x3f) << 6;
 1019|  20.5k|                val |= cur[3] & 0x3f;
 1020|  20.5k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 261, False: 20.2k]
  |  Branch (1020:40): [True: 5.92k, False: 14.3k]
  ------------------
 1021|  6.18k|                    goto encoding_error;
 1022|  14.3k|                *len = 4;
 1023|  14.3k|            }
 1024|  28.5M|        }
 1025|       |
 1026|  32.1M|        return(val);
 1027|  33.1M|    }
 1028|       |
 1029|  16.9M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  16.9M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  16.9M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 14.1k, False: 16.9M]
  ------------------
 1032|  14.1k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  14.1k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  14.1k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  14.1k|    }
 1035|  16.9M|    *len = 1;
 1036|  16.9M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  16.9M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  1.82k|incomplete_sequence:
 1039|       |    /*
 1040|       |     * An encoding problem may arise from a truncated input buffer
 1041|       |     * splitting a character in the middle. In that case do not raise
 1042|       |     * an error but return 0. This should only happen when push parsing
 1043|       |     * char data.
 1044|       |     */
 1045|  1.82k|    *len = 0;
 1046|  1.82k|    return(0);
 1047|  85.9M|}
xmlCopyCharMultiByte:
 1086|  37.6M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  37.6M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 37.6M]
  |  Branch (1087:26): [True: 0, False: 37.6M]
  ------------------
 1088|       |    /*
 1089|       |     * We are supposed to handle UTF8, check it's valid
 1090|       |     * From rfc2044: encoding of the Unicode values on UTF-8:
 1091|       |     *
 1092|       |     * UCS-4 range (hex.)           UTF-8 octet sequence (binary)
 1093|       |     * 0000 0000-0000 007F   0xxxxxxx
 1094|       |     * 0000 0080-0000 07FF   110xxxxx 10xxxxxx
 1095|       |     * 0000 0800-0000 FFFF   1110xxxx 10xxxxxx 10xxxxxx
 1096|       |     */
 1097|  37.6M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 37.6M, False: 12.3k]
  ------------------
 1098|  37.6M|	xmlChar *savedout = out;
 1099|  37.6M|	int bits;
 1100|  37.6M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 3.24M, False: 34.3M]
  ------------------
 1101|  34.3M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 34.3M, False: 11.2k]
  ------------------
 1102|  11.2k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 11.2k, False: 0]
  ------------------
 1103|      0|	else {
 1104|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1105|      0|            xmlAbort("xmlCopyCharMultiByte: codepoint out of range\n");
 1106|      0|#endif
 1107|      0|	    return(0);
 1108|      0|	}
 1109|   109M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 71.9M, False: 37.6M]
  ------------------
 1110|  71.9M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  37.6M|	return (out - savedout);
 1112|  37.6M|    }
 1113|  12.3k|    *out = val;
 1114|  12.3k|    return 1;
 1115|  37.6M|}
xmlSwitchEncoding:
 1263|  6.54k|{
 1264|  6.54k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  6.54k|    int ret;
 1266|  6.54k|    xmlParserErrors code;
 1267|       |
 1268|  6.54k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 6.54k]
  |  Branch (1268:27): [True: 0, False: 6.54k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  6.54k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  6.54k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 3, False: 6.54k]
  ------------------
 1273|      3|        xmlFatalErr(ctxt, code, NULL);
 1274|      3|        return(-1);
 1275|      3|    }
 1276|       |
 1277|  6.54k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  6.54k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.81k, False: 1.72k]
  |  Branch (1279:23): [True: 0, False: 4.81k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  6.54k|    return(ret);
 1284|  6.54k|}
xmlInputSetEncodingHandler:
 1353|  15.3k|                           xmlCharEncodingHandler *handler) {
 1354|  15.3k|    xmlParserInputBufferPtr in;
 1355|  15.3k|    xmlBufPtr buf;
 1356|  15.3k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  15.3k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 15.3k]
  |  Branch (1358:28): [True: 0, False: 15.3k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  15.3k|    in = input->buf;
 1363|       |
 1364|  15.3k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  15.3k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  15.3k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 14.8k, False: 470]
  ------------------
 1370|  14.8k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.8k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 14.8k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  15.3k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 470, False: 14.8k]
  ------------------
 1376|    470|        return(XML_ERR_OK);
 1377|       |
 1378|  14.8k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 14.8k]
  ------------------
 1379|       |        /*
 1380|       |         * Switching encodings during parsing is a really bad idea,
 1381|       |         * but Chromium can switch between ISO-8859-1 and UTF-16 before
 1382|       |         * separate calls to xmlParseChunk.
 1383|       |         *
 1384|       |         * TODO: We should check whether the "raw" input buffer is empty and
 1385|       |         * convert the old content using the old encoder.
 1386|       |         */
 1387|       |
 1388|      0|        xmlCharEncCloseFunc(in->encoder);
 1389|      0|        in->encoder = handler;
 1390|      0|        return(XML_ERR_OK);
 1391|      0|    }
 1392|       |
 1393|  14.8k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  14.8k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  14.8k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 18, False: 14.8k]
  ------------------
 1395|     18|        xmlCharEncCloseFunc(handler);
 1396|     18|        return(XML_ERR_NO_MEMORY);
 1397|     18|    }
 1398|       |
 1399|  14.8k|    in->encoder = handler;
 1400|  14.8k|    in->raw = in->buffer;
 1401|  14.8k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  14.8k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 14.8k, False: 0]
  ------------------
 1407|  14.8k|        size_t processed;
 1408|  14.8k|        size_t nbchars;
 1409|  14.8k|        xmlCharEncError res;
 1410|       |
 1411|       |        /*
 1412|       |         * Shrink the current input buffer.
 1413|       |         * Move it as the raw buffer and create a new input buffer
 1414|       |         */
 1415|  14.8k|        processed = input->cur - input->base;
 1416|  14.8k|        xmlBufShrink(in->raw, processed);
 1417|  14.8k|        input->consumed += processed;
 1418|  14.8k|        in->rawconsumed = processed;
 1419|       |
 1420|       |        /*
 1421|       |         * If we're push-parsing, we must convert the whole buffer.
 1422|       |         *
 1423|       |         * If we're pull-parsing, we could be parsing from a huge
 1424|       |         * memory buffer which we don't want to convert completely.
 1425|       |         */
 1426|  14.8k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  14.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.28k, False: 13.5k]
  ------------------
 1427|  1.28k|            nbchars = SIZE_MAX;
 1428|  13.5k|        else
 1429|  13.5k|            nbchars = 4000 /* MINLEN */;
 1430|  14.8k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  14.8k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.41k, False: 12.4k]
  ------------------
 1432|  2.41k|            code = in->error;
 1433|  14.8k|    }
 1434|       |
 1435|  14.8k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  14.8k|    return(code);
 1438|  14.8k|}
xmlSwitchToEncoding:
 1475|  11.1k|{
 1476|  11.1k|    xmlParserErrors code;
 1477|       |
 1478|  11.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 11.1k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  11.1k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  11.1k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.81k, False: 9.30k]
  ------------------
 1483|  1.81k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.81k|        return(-1);
 1485|  1.81k|    }
 1486|       |
 1487|  9.30k|    return(0);
 1488|  11.1k|}
xmlDetectEncoding:
 1498|   365k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   365k|    const xmlChar *in;
 1500|   365k|    xmlCharEncoding enc;
 1501|   365k|    int bomSize;
 1502|   365k|    int autoFlag = 0;
 1503|       |
 1504|   365k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 365k]
  ------------------
 1505|      0|        return;
 1506|   365k|    in = ctxt->input->cur;
 1507|   365k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.68k, False: 364k]
  ------------------
 1508|  1.68k|        return;
 1509|       |
 1510|   364k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   364k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 364k]
  ------------------
 1511|       |        /*
 1512|       |         * If the encoding was already set, only skip the BOM which was
 1513|       |         * possibly decoded to UTF-8.
 1514|       |         */
 1515|      0|        if ((in[0] == 0xEF) && (in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1515:13): [True: 0, False: 0]
  |  Branch (1515:32): [True: 0, False: 0]
  |  Branch (1515:51): [True: 0, False: 0]
  ------------------
 1516|      0|            ctxt->input->cur += 3;
 1517|      0|        }
 1518|       |
 1519|      0|        return;
 1520|      0|    }
 1521|       |
 1522|   364k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   364k|    bomSize = 0;
 1524|       |
 1525|       |    /*
 1526|       |     * BOM sniffing and detection of initial bytes of an XML
 1527|       |     * declaration.
 1528|       |     *
 1529|       |     * The HTML5 spec doesn't cover UTF-32 (UCS-4) or EBCDIC.
 1530|       |     */
 1531|   364k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 336k, False: 27.4k]
  ------------------
 1532|  1.98k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 1.98k, False: 362k]
  ------------------
 1533|  1.98k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 1.98k, False: 0]
  ------------------
 1534|  1.98k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 668, False: 1.31k]
  |  Branch (1534:36): [True: 466, False: 202]
  |  Branch (1534:55): [True: 243, False: 223]
  ------------------
 1535|    243|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|    243|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    243|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|  1.74k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 1.27k, False: 469]
  |  Branch (1537:43): [True: 1.06k, False: 211]
  |  Branch (1537:62): [True: 984, False: 77]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    984|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    984|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    984|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    984|            }
 1545|  1.98k|            break;
 1546|       |
 1547|   326k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 326k, False: 37.3k]
  ------------------
 1548|   326k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.34k, False: 322k]
  ------------------
 1549|  4.34k|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 4.34k, False: 0]
  ------------------
 1550|  4.34k|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 1.26k, False: 3.08k]
  |  Branch (1550:40): [True: 1.01k, False: 247]
  ------------------
 1551|  1.01k|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|  1.01k|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  1.01k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.33k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 2.91k, False: 420]
  |  Branch (1553:47): [True: 2.67k, False: 240]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  2.67k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  2.67k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  2.67k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  2.67k|                }
 1561|  4.34k|            }
 1562|   326k|            break;
 1563|       |
 1564|  5.46k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 5.46k, False: 358k]
  ------------------
 1565|  5.46k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 5.46k, False: 0]
  ------------------
 1566|  5.46k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 5.24k, False: 224]
  |  Branch (1566:36): [True: 4.94k, False: 300]
  |  Branch (1566:55): [True: 4.69k, False: 248]
  ------------------
 1567|  4.69k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  4.69k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  4.69k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  4.69k|            }
 1570|  5.46k|            break;
 1571|       |
 1572|    341|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 341, False: 363k]
  ------------------
 1573|    341|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 85, False: 256]
  |  Branch (1573:36): [True: 7, False: 78]
  ------------------
 1574|      7|                enc = XML_CHAR_ENCODING_UTF8;
 1575|      7|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|      7|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|      7|                bomSize = 3;
 1577|      7|            }
 1578|    341|            break;
 1579|       |
 1580|  1.55k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 1.55k, False: 362k]
  ------------------
 1581|  1.55k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 1.32k, False: 228]
  ------------------
 1582|  1.32k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  1.32k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  1.32k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  1.32k|                bomSize = 2;
 1585|  1.32k|            }
 1586|  1.55k|            break;
 1587|       |
 1588|    527|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 527, False: 363k]
  ------------------
 1589|    527|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 301, False: 226]
  ------------------
 1590|    301|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    301|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    301|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    301|                bomSize = 2;
 1593|    301|            }
 1594|    527|            break;
 1595|   364k|    }
 1596|       |
 1597|   364k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 1.63k, False: 362k]
  ------------------
 1598|  1.63k|        ctxt->input->cur += bomSize;
 1599|  1.63k|    }
 1600|       |
 1601|   364k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 11.2k, False: 352k]
  ------------------
 1602|  11.2k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  11.2k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 4.69k, False: 6.54k]
  ------------------
 1605|  4.69k|            xmlCharEncodingHandlerPtr handler;
 1606|  4.69k|            xmlParserErrors res;
 1607|       |
 1608|  4.69k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  4.69k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 112, False: 4.58k]
  ------------------
 1610|    112|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  4.58k|            } else {
 1612|  4.58k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  4.58k|            }
 1614|  6.54k|        } else {
 1615|  6.54k|            xmlSwitchEncoding(ctxt, enc);
 1616|  6.54k|        }
 1617|  11.2k|    }
 1618|   364k|}
xmlSetDeclaredEncoding:
 1632|  6.27k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  6.27k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  6.27k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 6.26k, False: 5]
  ------------------
 1634|  6.26k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 5.10k, False: 1.15k]
  ------------------
 1635|  5.10k|        xmlCharEncodingHandlerPtr handler;
 1636|  5.10k|        xmlParserErrors res;
 1637|  5.10k|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1638|       |
 1639|       |        /*
 1640|       |         * xmlSwitchEncodingName treats unsupported encodings as
 1641|       |         * warnings, but we want it to be an error in an encoding
 1642|       |         * declaration.
 1643|       |         */
 1644|  5.10k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 5.10k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  5.10k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  5.10k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  5.10k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 912, False: 4.19k]
  ------------------
 1649|    912|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    912|            xmlFree(encoding);
 1651|    912|            return;
 1652|    912|        }
 1653|       |
 1654|  4.19k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  4.19k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 614, False: 3.58k]
  ------------------
 1656|    614|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|    614|            xmlFree(encoding);
 1658|    614|            return;
 1659|    614|        }
 1660|       |
 1661|  3.58k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  3.58k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  3.58k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|  1.16k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 5, False: 1.15k]
  ------------------
 1663|      5|        static const char *allowedUTF8[] = {
 1664|      5|            "UTF-8", "UTF8", NULL
 1665|      5|        };
 1666|      5|        static const char *allowedUTF16LE[] = {
 1667|      5|            "UTF-16", "UTF-16LE", "UTF16", NULL
 1668|      5|        };
 1669|      5|        static const char *allowedUTF16BE[] = {
 1670|      5|            "UTF-16", "UTF-16BE", "UTF16", NULL
 1671|      5|        };
 1672|      5|        const char **allowed = NULL;
 1673|      5|        const char *autoEnc = NULL;
 1674|       |
 1675|      5|        switch (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|      5|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1675:17): [True: 4, False: 1]
  ------------------
 1676|      4|            case XML_INPUT_AUTO_UTF8:
  ------------------
  |  |   35|      4|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
  |  Branch (1676:13): [True: 4, False: 1]
  ------------------
 1677|      4|                allowed = allowedUTF8;
 1678|      4|                autoEnc = "UTF-8";
 1679|      4|                break;
 1680|      0|            case XML_INPUT_AUTO_UTF16LE:
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
  |  Branch (1680:13): [True: 0, False: 5]
  ------------------
 1681|      0|                allowed = allowedUTF16LE;
 1682|      0|                autoEnc = "UTF-16LE";
 1683|      0|                break;
 1684|      0|            case XML_INPUT_AUTO_UTF16BE:
  ------------------
  |  |   37|      0|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
  |  Branch (1684:13): [True: 0, False: 5]
  ------------------
 1685|      0|                allowed = allowedUTF16BE;
 1686|      0|                autoEnc = "UTF-16BE";
 1687|      0|                break;
 1688|      5|        }
 1689|       |
 1690|      5|        if (allowed != NULL) {
  ------------------
  |  Branch (1690:13): [True: 4, False: 1]
  ------------------
 1691|      4|            const char **p;
 1692|      4|            int match = 0;
 1693|       |
 1694|     10|            for (p = allowed; *p != NULL; p++) {
  ------------------
  |  Branch (1694:31): [True: 7, False: 3]
  ------------------
 1695|      7|                if (xmlStrcasecmp(encoding, BAD_CAST *p) == 0) {
  ------------------
  |  |   34|      7|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1695:21): [True: 1, False: 6]
  ------------------
 1696|      1|                    match = 1;
 1697|      1|                    break;
 1698|      1|                }
 1699|      7|            }
 1700|       |
 1701|      4|            if (match == 0) {
  ------------------
  |  Branch (1701:17): [True: 3, False: 1]
  ------------------
 1702|      3|                xmlWarningMsg(ctxt, XML_WAR_ENCODING_MISMATCH,
 1703|      3|                              "Encoding '%s' doesn't match "
 1704|      3|                              "auto-detected '%s'\n",
 1705|      3|                              encoding, BAD_CAST autoEnc);
  ------------------
  |  |   34|      3|#define BAD_CAST (xmlChar *)
  ------------------
 1706|      3|                xmlFree(encoding);
 1707|      3|                encoding = xmlStrdup(BAD_CAST autoEnc);
  ------------------
  |  |   34|      3|#define BAD_CAST (xmlChar *)
  ------------------
 1708|      3|                if (encoding == NULL)
  ------------------
  |  Branch (1708:21): [True: 1, False: 2]
  ------------------
 1709|      1|                    xmlCtxtErrMemory(ctxt);
 1710|      3|            }
 1711|      4|        }
 1712|      5|    }
 1713|       |
 1714|  4.74k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.44k, False: 3.30k]
  ------------------
 1715|  1.44k|        xmlFree(ctxt->encoding);
 1716|  4.74k|    ctxt->encoding = encoding;
 1717|  4.74k|}
xmlGetActualEncoding:
 1740|  32.0k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  32.0k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  32.0k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  32.0k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 744, False: 31.2k]
  ------------------
 1744|  31.2k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  31.2k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 509, False: 30.7k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.25k|        encoding = ctxt->encoding;
 1747|  30.7k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 30.7k, False: 0]
  |  Branch (1747:38): [True: 201, False: 30.5k]
  ------------------
 1748|    201|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    201|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  30.5k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  30.5k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 203, False: 30.3k]
  ------------------
 1750|    203|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    203|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    203|    }
 1752|       |
 1753|  32.0k|    return(encoding);
 1754|  32.0k|}
xmlFreeInputStream:
 1768|   382k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   382k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 1.86k, False: 381k]
  ------------------
 1770|       |
 1771|   381k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 323k, False: 57.5k]
  ------------------
 1772|   381k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 233k, False: 147k]
  ------------------
 1773|   381k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 381k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   381k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 381k, False: 0]
  ------------------
 1776|   381k|        xmlFreeParserInputBuffer(input->buf);
 1777|   381k|    xmlFree(input);
 1778|   381k|}
xmlNewInputFromMemory:
 1892|   323k|                      xmlParserInputFlags flags) {
 1893|   323k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   323k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 323k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   323k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   323k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 23, False: 323k]
  ------------------
 1900|     23|        return(NULL);
 1901|       |
 1902|   323k|    return(xmlNewInputInternal(buf, url));
 1903|   323k|}
xmlNewInputFromString:
 1954|  14.3k|                      xmlParserInputFlags flags) {
 1955|  14.3k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  14.3k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 14.3k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  14.3k|    buf = xmlNewInputBufferString(str, flags);
 1961|  14.3k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 4, False: 14.3k]
  ------------------
 1962|      4|        return(NULL);
 1963|       |
 1964|  14.3k|    return(xmlNewInputInternal(buf, url));
 1965|  14.3k|}
xmlCtxtNewInputFromString:
 1978|  14.3k|                          xmlParserInputFlags flags) {
 1979|  14.3k|    xmlParserInputPtr input;
 1980|       |
 1981|  14.3k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 14.3k]
  |  Branch (1981:27): [True: 0, False: 14.3k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  14.3k|    input = xmlNewInputFromString(url, str, flags);
 1985|  14.3k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 8, False: 14.3k]
  ------------------
 1986|      8|        xmlCtxtErrMemory(ctxt);
 1987|      8|        return(NULL);
 1988|      8|    }
 1989|       |
 1990|  14.3k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 14.3k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  14.3k|    return(input);
 1994|  14.3k|}
xmlNewPushInput:
 2155|  43.2k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  43.2k|    xmlParserInputBufferPtr buf;
 2157|  43.2k|    xmlParserInputPtr input;
 2158|       |
 2159|  43.2k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  43.2k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 11, False: 43.1k]
  ------------------
 2161|     11|        return(NULL);
 2162|       |
 2163|  43.1k|    input = xmlNewInputInternal(buf, url);
 2164|  43.1k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 7, False: 43.1k]
  ------------------
 2165|      7|	return(NULL);
 2166|       |
 2167|  43.1k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  43.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  43.1k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 41.9k, False: 1.18k]
  |  Branch (2169:23): [True: 41.9k, False: 0]
  ------------------
 2170|  41.9k|        int res;
 2171|       |
 2172|  41.9k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  41.9k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  41.9k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 41.9k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  41.9k|    }
 2179|       |
 2180|  43.1k|    return(input);
 2181|  43.1k|}
xmlNewEntityInputStream:
 2224|   145k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   145k|    xmlParserInputPtr input;
 2226|       |
 2227|   145k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 145k]
  |  Branch (2227:27): [True: 0, False: 145k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   145k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 14.3k, False: 130k]
  ------------------
 2231|  14.3k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  14.3k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|   130k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 130k, False: 445]
  ------------------
 2234|   130k|        xmlResourceType rtype;
 2235|       |
 2236|   130k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 125k, False: 4.63k]
  ------------------
 2237|   125k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  4.63k|        else
 2239|  4.63k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|   130k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|   130k|                                (char *) ent->ExternalID, rtype);
 2243|   130k|    } else {
 2244|    445|        return(NULL);
 2245|    445|    }
 2246|       |
 2247|   144k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 3.62k, False: 141k]
  ------------------
 2248|  3.62k|        return(NULL);
 2249|       |
 2250|   141k|    input->entity = ent;
 2251|       |
 2252|   141k|    return(input);
 2253|   144k|}
xmlCtxtSetResourceLoader:
 2645|  54.1k|                         void *vctxt) {
 2646|  54.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 54.1k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  54.1k|    ctxt->resourceLoader = loader;
 2650|  54.1k|    ctxt->resourceCtxt = vctxt;
 2651|  54.1k|}
xmlLoadResource:
 2662|   330k|                xmlResourceType type) {
 2663|   330k|    char *canonicFilename;
 2664|   330k|    xmlParserInputPtr ret;
 2665|       |
 2666|   330k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 230, False: 329k]
  ------------------
 2667|    230|        return(NULL);
 2668|       |
 2669|   329k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 329k, False: 0]
  |  Branch (2669:27): [True: 329k, False: 0]
  ------------------
 2670|   329k|        char *resource = NULL;
 2671|   329k|        void *userData;
 2672|   329k|        xmlParserInputFlags flags = 0;
 2673|   329k|        int code;
 2674|       |
 2675|   329k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   329k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   329k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 329k]
  ------------------
 2678|      0|            url = resource;
 2679|   329k|#endif
 2680|       |
 2681|   329k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 205k, False: 124k]
  ------------------
 2682|   205k|            flags |= XML_INPUT_UNZIP;
 2683|   329k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 219k, False: 110k]
  ------------------
 2684|   219k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   329k|        userData = ctxt->resourceCtxt;
 2687|   329k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 329k, False: 0]
  ------------------
 2688|   329k|            userData = ctxt;
 2689|       |
 2690|   329k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   329k|                                    flags, &ret);
 2692|   329k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 6.40k, False: 323k]
  ------------------
 2693|  6.40k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  6.40k|            ret = NULL;
 2695|  6.40k|        }
 2696|   329k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 329k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   329k|        return(ret);
 2699|   329k|    }
 2700|       |
 2701|      0|    canonicFilename = (char *) xmlCanonicPath((const xmlChar *) url);
 2702|      0|    if (canonicFilename == NULL) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 0]
  ------------------
 2703|      0|        xmlCtxtErrMemory(ctxt);
 2704|      0|        return(NULL);
 2705|      0|    }
 2706|       |
 2707|      0|    ret = xmlCurrentExternalEntityLoader(canonicFilename, publicId, ctxt);
 2708|      0|    xmlFree(canonicFilename);
 2709|      0|    return(ret);
 2710|      0|}
xmlFreeParserCtxt:
 2947|  54.2k|{
 2948|  54.2k|    xmlParserInputPtr input;
 2949|       |
 2950|  54.2k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 50, False: 54.2k]
  ------------------
 2951|       |
 2952|   107k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 53.6k, False: 54.2k]
  ------------------
 2953|  53.6k|        xmlFreeInputStream(input);
 2954|  53.6k|    }
 2955|  54.2k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 54.2k, False: 29]
  ------------------
 2956|  54.2k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 54.2k, False: 26]
  ------------------
 2957|  54.2k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 54.2k, False: 21]
  ------------------
 2958|  54.2k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 54.2k]
  ------------------
 2959|  54.2k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 54.2k, False: 15]
  ------------------
 2960|  54.2k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 51.3k, False: 2.88k]
  ------------------
 2961|  54.2k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 1.04k, False: 53.1k]
  ------------------
 2962|  54.2k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 3.91k, False: 50.3k]
  ------------------
 2963|  54.2k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 820, False: 53.4k]
  ------------------
 2964|  54.2k|#ifdef LIBXML_SAX1_ENABLED
 2965|  54.2k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 54.2k, False: 9]
  ------------------
 2966|  54.2k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 54.2k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  54.2k|        xmlFree(ctxt->sax);
 2971|  54.2k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 11.9k, False: 42.2k]
  ------------------
 2972|  54.2k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 54.2k]
  ------------------
 2973|  54.2k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 27.7k, False: 26.5k]
  ------------------
 2974|  54.2k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 54.2k, False: 5]
  ------------------
 2975|  54.2k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 11.0k, False: 43.2k]
  ------------------
 2976|  54.2k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 54.2k, False: 34]
  ------------------
 2977|  54.2k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 7.91k, False: 46.3k]
  ------------------
 2978|  54.2k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 32.7k, False: 21.5k]
  ------------------
 2979|  54.2k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 14.9k, False: 39.3k]
  ------------------
 2980|  54.2k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 3.10k, False: 51.1k]
  ------------------
 2981|  3.10k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  54.2k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 3.61k, False: 50.6k]
  ------------------
 2983|  3.61k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  54.2k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 28.9k, False: 25.2k]
  ------------------
 2985|  28.9k|        xmlNodePtr cur, next;
 2986|       |
 2987|  28.9k|	cur = ctxt->freeElems;
 2988|  57.9k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 28.9k, False: 28.9k]
  ------------------
 2989|  28.9k|	    next = cur->next;
 2990|  28.9k|	    xmlFree(cur);
 2991|  28.9k|	    cur = next;
 2992|  28.9k|	}
 2993|  28.9k|    }
 2994|  54.2k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 16.4k, False: 37.8k]
  ------------------
 2995|  16.4k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  16.4k|	cur = ctxt->freeAttrs;
 2998|  32.8k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 16.4k, False: 16.4k]
  ------------------
 2999|  16.4k|	    next = cur->next;
 3000|  16.4k|	    xmlFree(cur);
 3001|  16.4k|	    cur = next;
 3002|  16.4k|	}
 3003|  16.4k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  54.2k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 38.0k, False: 16.2k]
  ------------------
 3008|  38.0k|        xmlFree(ctxt->lastError.message);
 3009|  54.2k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 10.2k, False: 43.9k]
  ------------------
 3010|  10.2k|        xmlFree(ctxt->lastError.file);
 3011|  54.2k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 21.2k, False: 32.9k]
  ------------------
 3012|  21.2k|        xmlFree(ctxt->lastError.str1);
 3013|  54.2k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 6.44k, False: 47.7k]
  ------------------
 3014|  6.44k|        xmlFree(ctxt->lastError.str2);
 3015|  54.2k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 623, False: 53.6k]
  ------------------
 3016|    623|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  54.2k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  54.2k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 54.2k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  54.2k|#endif
 3022|  54.2k|    xmlFree(ctxt);
 3023|  54.2k|}
xmlNewParserCtxt:
 3033|  11.0k|{
 3034|  11.0k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  11.0k|}
xmlNewSAXParserCtxt:
 3054|  54.2k|{
 3055|  54.2k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  54.2k|    xmlInitParser();
 3058|       |
 3059|  54.2k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  54.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 8, False: 54.2k]
  ------------------
 3061|      8|	return(NULL);
 3062|  54.2k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  54.2k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 34, False: 54.2k]
  ------------------
 3064|     34|        xmlFreeParserCtxt(ctxt);
 3065|     34|	return(NULL);
 3066|     34|    }
 3067|  54.2k|    return(ctxt);
 3068|  54.2k|}
xmlInitNodeInfoSeq:
 3540|  54.2k|{
 3541|  54.2k|    if (seq == NULL)
  ------------------
  |  Branch (3541:9): [True: 0, False: 54.2k]
  ------------------
 3542|      0|        return;
 3543|  54.2k|    seq->length = 0;
 3544|  54.2k|    seq->maximum = 0;
 3545|       |    seq->buffer = NULL;
 3546|  54.2k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  4.69k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  4.69k|    xmlChar out[200];
 1170|  4.69k|    xmlParserInputPtr input = ctxt->input;
 1171|  4.69k|    xmlCharEncodingHandlerPtr handler;
 1172|  4.69k|    int inlen, outlen, i;
 1173|  4.69k|    xmlParserErrors code;
 1174|  4.69k|    xmlCharEncError res;
 1175|       |
 1176|  4.69k|    *hout = NULL;
 1177|       |
 1178|       |    /*
 1179|       |     * To detect the EBCDIC code page, we convert the first 200 bytes
 1180|       |     * to IBM037 (EBCDIC-US) and try to find the encoding declaration.
 1181|       |     */
 1182|  4.69k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  4.69k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  4.69k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 8, False: 4.68k]
  ------------------
 1185|      8|        return(code);
 1186|  4.68k|    outlen = sizeof(out) - 1;
 1187|  4.68k|    inlen = input->end - input->cur;
 1188|  4.68k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  4.68k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  4.68k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 854, False: 3.83k]
  ------------------
 1195|    854|        goto done;
 1196|  3.83k|    out[outlen] = 0;
 1197|       |
 1198|   112k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 110k, False: 2.02k]
  ------------------
 1199|   110k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 325, False: 109k]
  ------------------
 1200|    325|            break;
 1201|   109k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 5.00k, False: 104k]
  ------------------
 1202|  5.00k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  5.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.48k, False: 3.52k]
  ------------------
 1203|  1.48k|            int start, cur, quote;
 1204|       |
 1205|  1.48k|            i += 8;
 1206|  1.48k|            while (IS_BLANK_CH(out[i]))
 1207|    805|                i += 1;
 1208|  1.48k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 237, False: 1.24k]
  ------------------
 1209|    237|                break;
 1210|  1.24k|            while (IS_BLANK_CH(out[i]))
 1211|    953|                i += 1;
 1212|  1.24k|            quote = out[i++];
 1213|  1.24k|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 993, False: 253]
  |  Branch (1213:36): [True: 552, False: 441]
  ------------------
 1214|    552|                break;
 1215|    694|            start = i;
 1216|    694|            cur = out[i];
 1217|  4.32k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 980, False: 3.34k]
  |  Branch (1217:37): [True: 733, False: 247]
  ------------------
 1218|  3.59k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.24k, False: 1.34k]
  |  Branch (1218:37): [True: 1.15k, False: 1.08k]
  ------------------
 1219|  2.43k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.47k, False: 961]
  |  Branch (1219:37): [True: 383, False: 1.09k]
  ------------------
 1220|  2.05k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 235, False: 1.81k]
  |  Branch (1220:36): [True: 839, False: 977]
  ------------------
 1221|    977|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 283, False: 694]
  ------------------
 1222|  3.62k|                cur = out[++i];
 1223|    694|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 510, False: 184]
  ------------------
 1224|    510|                break;
 1225|    184|            out[i] = 0;
 1226|    184|            xmlCharEncCloseFunc(handler);
 1227|    184|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    184|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    184|                    &handler);
 1230|    184|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 94, False: 90]
  ------------------
 1231|     94|                return(code);
 1232|     90|            *hout = handler;
 1233|     90|            return(XML_ERR_OK);
 1234|    184|        }
 1235|   109k|    }
 1236|       |
 1237|  4.50k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  4.50k|    xmlCharEncCloseFunc(handler);
 1242|  4.50k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  4.50k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  4.50k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 10, False: 4.49k]
  ------------------
 1245|     10|        return(code);
 1246|  4.49k|    *hout = handler;
 1247|  4.49k|    return(XML_ERR_OK);
 1248|  4.50k|}
parserInternals.c:xmlNewInputInternal:
 1842|   381k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   381k|    xmlParserInputPtr input;
 1844|       |
 1845|   381k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   381k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 23, False: 381k]
  ------------------
 1847|     23|	xmlFreeParserInputBuffer(buf);
 1848|     23|	return(NULL);
 1849|     23|    }
 1850|   381k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   381k|    input->line = 1;
 1852|   381k|    input->col = 1;
 1853|       |
 1854|   381k|    input->buf = buf;
 1855|   381k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   381k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 323k, False: 57.5k]
  ------------------
 1858|   323k|        input->filename = xmlMemStrdup(filename);
 1859|   323k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 10, False: 323k]
  ------------------
 1860|     10|            xmlFreeInputStream(input);
 1861|     10|            return(NULL);
 1862|     10|        }
 1863|   323k|    }
 1864|       |
 1865|   381k|    return(input);
 1866|   381k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   329k|                          const char *publicId) {
 2364|   329k|    char *resource;
 2365|   329k|    void *localCatalogs = NULL;
 2366|   329k|    int allowGlobal = 1;
 2367|   329k|    xmlParserErrors code;
 2368|       |
 2369|   329k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 329k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   329k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 329k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   329k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   329k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 45.3k, False: 284k]
  ------------------
 2379|  45.3k|            allowGlobal = 0;
 2380|   329k|    }
 2381|       |
 2382|   329k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 329k, False: 0]
  ------------------
 2383|   329k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 329k, False: 0]
  ------------------
 2384|   329k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 329k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 329k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 329k]
  ------------------
 2392|      0|            break;
 2393|   329k|    }
 2394|       |
 2395|      0|    code = xmlResolveFromCatalog(url, publicId, localCatalogs,
 2396|      0|                                 allowGlobal, &resource);
 2397|      0|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (2397:9): [True: 0, False: 0]
  ------------------
 2398|      0|        xmlCtxtErr(ctxt, NULL, XML_FROM_CATALOG, code, XML_ERR_ERROR,
 2399|      0|                   BAD_CAST url, BAD_CAST publicId, NULL, 0,
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
                                 BAD_CAST url, BAD_CAST publicId, NULL, 0,
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2400|      0|                   "%s\n", xmlErrString(code), NULL);
 2401|       |
 2402|      0|    return(resource);
 2403|   329k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  54.2k|{
 2767|  54.2k|    xmlParserInputPtr input;
 2768|  54.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  54.2k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  54.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 54.2k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  54.2k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 54.2k, False: 0]
  ------------------
 2778|  54.2k|	ctxt->dict = xmlDictCreate();
 2779|  54.2k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 5, False: 54.2k]
  ------------------
 2780|      5|	return(-1);
 2781|       |
 2782|  54.2k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 54.2k, False: 0]
  ------------------
 2783|  54.2k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  54.2k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 4, False: 54.2k]
  ------------------
 2785|      4|	return(-1);
 2786|  54.2k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 11.0k, False: 43.2k]
  ------------------
 2787|  11.0k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  11.0k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  11.0k|        ctxt->userData = ctxt;
 2790|  43.2k|    } else {
 2791|  43.2k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  43.2k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 43.2k, False: 0]
  ------------------
 2792|  43.2k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  43.2k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  43.2k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 43.2k]
  ------------------
 2798|  43.2k|    }
 2799|       |
 2800|  54.2k|    ctxt->maxatts = 0;
 2801|  54.2k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  54.2k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 54.2k, False: 0]
  ------------------
 2804|  54.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  54.2k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  54.2k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  54.2k|	ctxt->inputMax = initialSize;
 2812|  54.2k|    }
 2813|  54.2k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 6, False: 54.2k]
  ------------------
 2814|      6|	return(-1);
 2815|  54.2k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 54.2k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  54.2k|    ctxt->inputNr = 0;
 2819|  54.2k|    ctxt->input = NULL;
 2820|       |
 2821|  54.2k|    ctxt->version = NULL;
 2822|  54.2k|    ctxt->encoding = NULL;
 2823|  54.2k|    ctxt->standalone = -1;
 2824|  54.2k|    ctxt->hasExternalSubset = 0;
 2825|  54.2k|    ctxt->hasPErefs = 0;
 2826|  54.2k|    ctxt->html = 0;
 2827|  54.2k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  54.2k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 54.2k, False: 0]
  ------------------
 2831|  54.2k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  54.2k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  54.2k|    }
 2834|  54.2k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 6, False: 54.2k]
  ------------------
 2835|      6|	return(-1);
 2836|  54.2k|    ctxt->nodeNr = 0;
 2837|  54.2k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  54.2k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 54.2k, False: 0]
  ------------------
 2841|  54.2k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  54.2k|	ctxt->nameMax = initialNodeTabSize;
 2843|  54.2k|    }
 2844|  54.2k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 5, False: 54.2k]
  ------------------
 2845|      5|	return(-1);
 2846|  54.2k|    ctxt->nameNr = 0;
 2847|  54.2k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  54.2k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 54.2k, False: 0]
  ------------------
 2851|  54.2k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  54.2k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  54.2k|    }
 2854|  54.2k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 3, False: 54.2k]
  ------------------
 2855|      3|	return(-1);
 2856|  54.2k|    ctxt->spaceNr = 1;
 2857|  54.2k|    ctxt->spaceTab[0] = -1;
 2858|  54.2k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  54.2k|    ctxt->myDoc = NULL;
 2860|  54.2k|    ctxt->wellFormed = 1;
 2861|  54.2k|    ctxt->nsWellFormed = 1;
 2862|  54.2k|    ctxt->valid = 1;
 2863|       |
 2864|  54.2k|    ctxt->options = XML_PARSE_NODICT;
 2865|       |
 2866|       |    /*
 2867|       |     * Initialize some parser options from deprecated global variables.
 2868|       |     * Note that the "modern" API taking options arguments or
 2869|       |     * xmlCtxtSetOptions will ignore these defaults. They're only
 2870|       |     * relevant if old API functions like xmlParseFile are used.
 2871|       |     */
 2872|  54.2k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  54.2k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  54.2k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 54.2k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  54.2k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  54.2k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  54.2k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 54.2k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  54.2k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  54.2k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  54.2k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 54.2k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  54.2k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  54.2k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  54.2k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 54.2k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  54.2k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  54.2k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  54.2k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 54.2k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  54.2k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  54.2k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 54.2k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  54.2k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  54.2k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  54.2k|    ctxt->vctxt.userData = ctxt;
 2898|  54.2k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  54.2k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  54.2k|    ctxt->record_info = 0;
 2902|  54.2k|    ctxt->checkIndex = 0;
 2903|  54.2k|    ctxt->inSubset = 0;
 2904|  54.2k|    ctxt->errNo = XML_ERR_OK;
 2905|  54.2k|    ctxt->depth = 0;
 2906|  54.2k|    ctxt->catalogs = NULL;
 2907|  54.2k|    ctxt->sizeentities = 0;
 2908|  54.2k|    ctxt->sizeentcopy = 0;
 2909|  54.2k|    ctxt->input_id = 1;
 2910|  54.2k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  54.2k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  54.2k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  54.2k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 54.2k, False: 0]
  ------------------
 2914|  54.2k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  54.2k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 5, False: 54.2k]
  ------------------
 2916|      5|            return(-1);
 2917|  54.2k|    }
 2918|       |
 2919|  54.2k|    return(0);
 2920|  54.2k|}

xmlInitRelaxNGInternal:
 2710|      2|{
 2711|      2|    xmlInitMutex(&xmlRelaxNGMutex);
 2712|      2|}

xmlInitMutex:
   57|     12|{
   58|     12|#ifdef HAVE_POSIX_THREADS
   59|     12|    pthread_mutex_init(&mutex->lock, NULL);
   60|       |#elif defined HAVE_WIN32_THREADS
   61|       |    InitializeCriticalSection(&mutex->cs);
   62|       |#else
   63|       |    (void) mutex;
   64|       |#endif
   65|     12|}
xmlMutexLock:
  124|   168k|{
  125|   168k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 168k]
  ------------------
  126|      0|        return;
  127|   168k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   168k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   168k|}
xmlMutexUnlock:
  146|   168k|{
  147|   168k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 168k]
  ------------------
  148|      0|        return;
  149|   168k|#ifdef HAVE_POSIX_THREADS
  150|   168k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   168k|}
xmlInitRMutex:
  162|      4|xmlInitRMutex(xmlRMutex *tok) {
  163|      4|    (void) tok;
  164|       |
  165|      4|#ifdef HAVE_POSIX_THREADS
  166|      4|    pthread_mutex_init(&tok->lock, NULL);
  167|      4|    tok->held = 0;
  168|      4|    tok->waiters = 0;
  169|      4|    pthread_cond_init(&tok->cv, NULL);
  170|       |#elif defined HAVE_WIN32_THREADS
  171|       |    InitializeCriticalSection(&tok->cs);
  172|       |#endif
  173|      4|}
xmlRMutexLock:
  234|      2|{
  235|      2|    if (tok == NULL)
  ------------------
  |  Branch (235:9): [True: 0, False: 2]
  ------------------
  236|      0|        return;
  237|      2|#ifdef HAVE_POSIX_THREADS
  238|      2|    pthread_mutex_lock(&tok->lock);
  239|      2|    if (tok->held) {
  ------------------
  |  Branch (239:9): [True: 0, False: 2]
  ------------------
  240|      0|        if (pthread_equal(tok->tid, pthread_self())) {
  ------------------
  |  Branch (240:13): [True: 0, False: 0]
  ------------------
  241|      0|            tok->held++;
  242|      0|            pthread_mutex_unlock(&tok->lock);
  243|      0|            return;
  244|      0|        } else {
  245|      0|            tok->waiters++;
  246|      0|            while (tok->held)
  ------------------
  |  Branch (246:20): [True: 0, False: 0]
  ------------------
  247|      0|                pthread_cond_wait(&tok->cv, &tok->lock);
  248|      0|            tok->waiters--;
  249|      0|        }
  250|      0|    }
  251|      2|    tok->tid = pthread_self();
  252|      2|    tok->held = 1;
  253|      2|    pthread_mutex_unlock(&tok->lock);
  254|       |#elif defined HAVE_WIN32_THREADS
  255|       |    EnterCriticalSection(&tok->cs);
  256|       |#endif
  257|      2|}
xmlRMutexUnlock:
  266|      2|{
  267|      2|    if (tok == NULL)
  ------------------
  |  Branch (267:9): [True: 0, False: 2]
  ------------------
  268|      0|        return;
  269|      2|#ifdef HAVE_POSIX_THREADS
  270|      2|    pthread_mutex_lock(&tok->lock);
  271|      2|    tok->held--;
  272|      2|    if (tok->held == 0) {
  ------------------
  |  Branch (272:9): [True: 2, False: 0]
  ------------------
  273|      2|        if (tok->waiters)
  ------------------
  |  Branch (273:13): [True: 0, False: 2]
  ------------------
  274|      0|            pthread_cond_signal(&tok->cv);
  275|      2|        memset(&tok->tid, 0, sizeof(tok->tid));
  276|      2|    }
  277|      2|    pthread_mutex_unlock(&tok->lock);
  278|       |#elif defined HAVE_WIN32_THREADS
  279|       |    LeaveCriticalSection(&tok->cs);
  280|       |#endif
  281|      2|}
xmlInitParser:
  404|  2.77M|xmlInitParser(void) {
  405|  2.77M|#ifdef HAVE_POSIX_THREADS
  406|  2.77M|    pthread_once(&onceControl, xmlInitParserInternal);
  407|       |#elif defined(HAVE_WIN32_THREADS)
  408|       |    InitOnceExecuteOnce(&onceControl, xmlInitParserWinWrapper, NULL, NULL);
  409|       |#else
  410|       |    if (onceControl == 0) {
  411|       |        xmlInitParserInternal();
  412|       |        onceControl = 1;
  413|       |    }
  414|       |#endif
  415|  2.77M|}
threads.c:xmlInitParserInternal:
  356|      2|xmlInitParserInternal(void) {
  357|       |    /*
  358|       |     * Note that the initialization code must not make memory allocations.
  359|       |     */
  360|      2|    xmlInitRandom(); /* Required by xmlInitGlobalsInternal */
  361|      2|    xmlInitMemoryInternal();
  362|      2|    xmlInitThreadsInternal();
  363|      2|    xmlInitGlobalsInternal();
  364|      2|    xmlInitDictInternal();
  365|      2|    xmlInitEncodingInternal();
  366|      2|#if defined(LIBXML_XPATH_ENABLED)
  367|      2|    xmlInitXPathInternal();
  368|      2|#endif
  369|      2|    xmlInitIOCallbacks();
  370|      2|#ifdef LIBXML_CATALOG_ENABLED
  371|      2|    xmlInitCatalogInternal();
  372|      2|#endif
  373|      2|#ifdef LIBXML_SCHEMAS_ENABLED
  374|      2|    xmlInitSchemasTypesInternal();
  375|      2|#endif
  376|      2|#ifdef LIBXML_RELAXNG_ENABLED
  377|      2|    xmlInitRelaxNGInternal();
  378|      2|#endif
  379|       |
  380|      2|    xmlParserInitialized = 1;
  381|      2|}
threads.c:xmlInitThreadsInternal:
  330|      2|xmlInitThreadsInternal(void) {
  331|      2|    xmlInitRMutex(&xmlLibraryLock);
  332|      2|}

libxml_domnode_binary_insertion_sort:
  249|  29.6k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  29.6k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 29.6k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  29.6k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  29.6k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  29.6k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  29.6k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  29.6k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  29.6k|}
libxml_domnode_tim_sort:
  533|  39.6k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  39.6k|  size_t minrun;
  535|  39.6k|  TEMP_STORAGE_T _store, *store;
  536|  39.6k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  39.6k|  size_t stack_curr = 0;
  538|  39.6k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  39.6k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 39.6k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  39.6k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 29.6k, False: 9.95k]
  ------------------
  546|  29.6k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  29.6k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  29.6k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  29.6k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  29.6k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  29.6k|    return;
  548|  29.6k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  9.95k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  9.95k|  store = &_store;
  554|  9.95k|  store->alloc = 0;
  555|  9.95k|  store->storage = NULL;
  556|       |
  557|  9.95k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 9.95k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  9.95k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 7.10k, False: 2.85k]
  ------------------
  562|  7.10k|    return;
  563|  7.10k|  }
  564|       |
  565|  2.85k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 2.27k, False: 582]
  ------------------
  566|  2.27k|    return;
  567|  2.27k|  }
  568|       |
  569|  6.87k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 6.87k, Folded]
  ------------------
  570|  6.87k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  6.87k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  6.87k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  6.87k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  6.87k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 2.57k, False: 4.29k]
  ------------------
  571|  2.57k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  2.57k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  2.57k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.57k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.57k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  2.57k|      continue;
  573|  2.57k|    }
  574|       |
  575|  4.29k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 582, False: 3.71k]
  ------------------
  576|    582|      return;
  577|    582|    }
  578|  4.29k|  }
  579|    582|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  36.5k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  36.5k|  size_t i;
  221|       |
  222|   458k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 421k, False: 36.5k]
  ------------------
  223|   421k|    size_t j;
  224|   421k|    SORT_TYPE x;
  ------------------
  |  |  593|   421k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   421k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   421k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   421k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 272k, False: 148k]
  ------------------
  229|   272k|      continue;
  230|   272k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   148k|    x = dst[i];
  234|   148k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   148k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   148k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   148k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   148k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   867k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 722k, False: 144k]
  ------------------
  237|   722k|      dst[j + 1] = dst[j];
  238|       |
  239|   722k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 4.73k, False: 718k]
  ------------------
  240|  4.73k|        break;
  241|  4.73k|      }
  242|   722k|    }
  243|       |
  244|   148k|    dst[location] = x;
  245|   148k|  }
  246|  36.5k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   148k|    const size_t size) {
  181|   148k|  size_t l, c, r;
  182|   148k|  SORT_TYPE cx;
  ------------------
  |  |  593|   148k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   148k|  l = 0;
  184|   148k|  r = size - 1;
  185|   148k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   148k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   148k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 4.73k, False: 144k]
  ------------------
  189|  4.73k|    return 0;
  190|   144k|  } else if (SORT_CMP(x, dst[r]) > 0) {
  ------------------
  |  |  617|   144k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (190:14): [True: 0, False: 144k]
  ------------------
  191|      0|    return r;
  192|      0|  }
  193|       |
  194|   144k|  cx = dst[c];
  195|       |
  196|   608k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 608k, Folded]
  ------------------
  197|   608k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   608k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   608k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 134k, False: 474k]
  ------------------
  200|   134k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 52.4k, False: 81.9k]
  ------------------
  201|  52.4k|        return c;
  202|  52.4k|      }
  203|       |
  204|  81.9k|      r = c;
  205|   474k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   474k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 91.7k, False: 382k]
  ------------------
  207|  91.7k|        return c + 1;
  208|  91.7k|      }
  209|       |
  210|   382k|      l = c;
  211|   382k|    }
  212|       |
  213|   464k|    c = l + ((r - l) >> 1);
  214|   464k|    cx = dst[c];
  215|   464k|  }
  216|   144k|}
xpath.c:compute_minrun:
  129|  9.95k|static __inline int compute_minrun(const uint64_t size) {
  130|  9.95k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  9.95k|#define CLZ __builtin_clzll
  ------------------
  131|  9.95k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  9.95k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 9.95k, False: 0]
  |  |  ------------------
  ------------------
  132|  9.95k|  const int minrun = size >> shift;
  133|  9.95k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  9.95k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 5.91k, False: 4.04k]
  ------------------
  136|  5.91k|    return minrun + 1;
  137|  5.91k|  }
  138|       |
  139|  4.04k|  return minrun;
  140|  9.95k|}
xpath.c:PUSH_NEXT:
  496|  27.0k|                              size_t *curr) {
  497|  27.0k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  27.0k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  27.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  27.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  27.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  27.0k|  size_t run = minrun;
  499|       |
  500|  27.0k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 9.55k, False: 17.5k]
  ------------------
  501|  9.55k|    run = size - *curr;
  502|  9.55k|  }
  503|       |
  504|  27.0k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 6.94k, False: 20.1k]
  ------------------
  505|  6.94k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  6.94k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  6.94k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  6.94k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  6.94k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  6.94k|    len = run;
  507|  6.94k|  }
  508|       |
  509|  27.0k|  run_stack[*stack_curr].start = *curr;
  510|  27.0k|  run_stack[*stack_curr].length = len;
  511|  27.0k|  (*stack_curr)++;
  512|  27.0k|  *curr += len;
  513|       |
  514|  27.0k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 9.95k, False: 17.1k]
  ------------------
  515|       |    /* finish up */
  516|  22.6k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 12.6k, False: 9.95k]
  ------------------
  517|  12.6k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  12.6k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  12.6k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  12.6k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  12.6k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  12.6k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  12.6k|      (*stack_curr)--;
  520|  12.6k|    }
  521|       |
  522|  9.95k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 9.95k, False: 0]
  ------------------
  523|  9.95k|      free(store->storage);
  524|  9.95k|      store->storage = NULL;
  525|  9.95k|    }
  526|       |
  527|  9.95k|    return 0;
  528|  9.95k|  }
  529|       |
  530|  17.1k|  return 1;
  531|  27.0k|}
xpath.c:libxml_domnode_count_run:
  272|  27.0k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  27.0k|  size_t curr;
  274|       |
  275|  27.0k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 8.23k, False: 18.8k]
  ------------------
  276|  8.23k|    return 1;
  277|  8.23k|  }
  278|       |
  279|  18.8k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 345, False: 18.4k]
  ------------------
  280|    345|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|    345|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 93, False: 252]
  ------------------
  281|     93|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     93|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     93|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     93|    }
  283|       |
  284|    345|    return 2;
  285|    345|  }
  286|       |
  287|  18.4k|  curr = start + 2;
  288|       |
  289|  18.4k|  if (SORT_CMP(dst[start], dst[start + 1]) <= 0) {
  ------------------
  |  |  617|  18.4k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (289:7): [True: 17.0k, False: 1.41k]
  ------------------
  290|       |    /* increasing run */
  291|  1.59M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.59M, Folded]
  ------------------
  292|  1.59M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 9.27k, False: 1.58M]
  ------------------
  293|  9.27k|        break;
  294|  9.27k|      }
  295|       |
  296|  1.58M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.58M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 7.80k, False: 1.58M]
  ------------------
  297|  7.80k|        break;
  298|  7.80k|      }
  299|       |
  300|  1.58M|      curr++;
  301|  1.58M|    }
  302|       |
  303|  17.0k|    return curr - start;
  304|  17.0k|  } else {
  305|       |    /* decreasing run */
  306|  3.85k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 3.85k, Folded]
  ------------------
  307|  3.85k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 205, False: 3.65k]
  ------------------
  308|    205|        break;
  309|    205|      }
  310|       |
  311|  3.65k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  3.65k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.21k, False: 2.44k]
  ------------------
  312|  1.21k|        break;
  313|  1.21k|      }
  314|       |
  315|  2.44k|      curr++;
  316|  2.44k|    }
  317|       |
  318|       |    /* reverse in-place */
  319|  1.41k|    REVERSE_ELEMENTS(dst, start, curr - 1);
  ------------------
  |  |  151|  1.41k|#define REVERSE_ELEMENTS               SORT_MAKE_STR(reverse_elements)
  |  |  ------------------
  |  |  |  |  146|  1.41k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.41k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.41k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.41k|    return curr - start;
  321|  1.41k|  }
  322|  18.4k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.41k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  3.88k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 3.88k, Folded]
  ------------------
  262|  3.88k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.41k, False: 2.47k]
  ------------------
  263|  1.41k|      return;
  264|  1.41k|    }
  265|       |
  266|  2.47k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  2.47k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  2.47k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  2.47k|    start++;
  268|  2.47k|    end--;
  269|  2.47k|  }
  270|  1.41k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  17.1k|                           TEMP_STORAGE_T *store) {
  375|  17.1k|  const size_t A = stack[stack_curr - 2].length;
  376|  17.1k|  const size_t B = stack[stack_curr - 1].length;
  377|  17.1k|  const size_t curr = stack[stack_curr - 2].start;
  378|  17.1k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  17.1k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  17.1k|  size_t i, j, k;
  380|  17.1k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  17.1k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  17.1k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  17.1k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  17.1k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  17.1k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 4.61k, False: 12.5k]
  |  |  ------------------
  ------------------
  381|  17.1k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  17.1k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 4.61k, False: 12.5k]
  ------------------
  385|  4.61k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  4.61k|    i = 0;
  387|  4.61k|    j = curr + A;
  388|       |
  389|   676k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 675k, False: 545]
  ------------------
  390|   675k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 671k, False: 4.06k]
  |  Branch (390:22): [True: 658k, False: 12.5k]
  ------------------
  391|   658k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   658k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 319k, False: 339k]
  ------------------
  392|   319k|          dst[k] = storage[i++];
  393|   339k|        } else {
  394|   339k|          dst[k] = dst[j++];
  395|   339k|        }
  396|   658k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 12.5k, False: 4.06k]
  ------------------
  397|  12.5k|        dst[k] = storage[i++];
  398|  12.5k|      } else {
  399|  4.06k|        break;
  400|  4.06k|      }
  401|   675k|    }
  402|  12.5k|  } else {
  403|       |    /* right merge */
  404|  12.5k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  12.5k|    i = B;
  406|  12.5k|    j = curr + A;
  407|  12.5k|    k = curr + A + B;
  408|       |
  409|   601k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 601k, False: 756]
  ------------------
  410|   601k|      k--;
  411|   601k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 589k, False: 11.7k]
  |  Branch (411:22): [True: 576k, False: 12.4k]
  ------------------
  412|   576k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   576k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 182k, False: 394k]
  ------------------
  413|   182k|          dst[k] = dst[--j];
  414|   394k|        } else {
  415|   394k|          dst[k] = storage[--i];
  416|   394k|        }
  417|   576k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 12.4k, False: 11.7k]
  ------------------
  418|  12.4k|        dst[k] = storage[--i];
  419|  12.4k|      } else {
  420|  11.7k|        break;
  421|  11.7k|      }
  422|   601k|    }
  423|  12.5k|  }
  424|  17.1k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  17.1k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  17.1k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 13.0k, False: 4.10k]
  ------------------
  360|  13.0k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  13.0k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  13.0k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 13.0k]
  ------------------
  363|      0|      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes",
  364|      0|              (unsigned long)(sizeof(SORT_TYPE) * new_size));
  365|      0|      exit(1);
  366|      0|    }
  367|       |
  368|  13.0k|    store->storage = tempstore;
  369|  13.0k|    store->alloc = new_size;
  370|  13.0k|  }
  371|  17.1k|}
xpath.c:libxml_domnode_check_invariant:
  324|  6.87k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  6.87k|  size_t A, B, C;
  326|       |
  327|  6.87k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 363, False: 6.51k]
  ------------------
  328|    363|    return 1;
  329|    363|  }
  330|       |
  331|  6.51k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 924, False: 5.59k]
  ------------------
  332|    924|    const size_t A1 = stack[stack_curr - 2].length;
  333|    924|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    924|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 20, False: 904]
  ------------------
  336|     20|      return 0;
  337|     20|    }
  338|       |
  339|    904|    return 1;
  340|    924|  }
  341|       |
  342|  5.59k|  A = stack[stack_curr - 3].length;
  343|  5.59k|  B = stack[stack_curr - 2].length;
  344|  5.59k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  5.59k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.75k, False: 3.83k]
  |  Branch (346:23): [True: 806, False: 3.03k]
  ------------------
  347|  2.55k|    return 0;
  348|  2.55k|  }
  349|       |
  350|  3.03k|  return 1;
  351|  5.59k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  2.57k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  6.65k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 6.65k, Folded]
  ------------------
  429|  6.65k|    size_t A, B, C, D;
  430|  6.65k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  6.65k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 6.65k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  6.65k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 1.17k, False: 5.47k]
  |  Branch (438:30): [True: 0, False: 1.17k]
  ------------------
  439|      0|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|      0|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|      0|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|      0|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  440|      0|      stack[0].length += stack[1].length;
  441|      0|      stack_curr--;
  442|      0|      break;
  443|      0|    }
  444|       |    /* check if the invariant is off for a stack of 2 elements */
  445|  6.65k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 1.17k, False: 5.47k]
  |  Branch (445:35): [True: 363, False: 815]
  ------------------
  446|    363|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    363|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    363|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    363|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    363|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    363|      stack[0].length += stack[1].length;
  448|    363|      stack_curr--;
  449|    363|      break;
  450|  6.29k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 815, False: 5.47k]
  ------------------
  451|    815|      break;
  452|    815|    }
  453|       |
  454|  5.47k|    B = stack[stack_curr - 3].length;
  455|  5.47k|    C = stack[stack_curr - 2].length;
  456|  5.47k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  5.47k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 3.62k, False: 1.84k]
  ------------------
  459|  3.62k|      A = stack[stack_curr - 4].length;
  460|  3.62k|      ABC = (A <= B + C);
  461|  3.62k|    } else {
  462|  1.84k|      ABC = 0;
  463|  1.84k|    }
  464|       |
  465|  5.47k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 2.52k, False: 2.94k]
  |  Branch (465:27): [True: 40, False: 2.90k]
  ------------------
  466|  5.47k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  5.47k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 2.90k, False: 2.56k]
  |  Branch (469:17): [True: 1.40k, False: 1.50k]
  ------------------
  470|  1.40k|      break;
  471|  1.40k|    }
  472|       |
  473|       |    /* left merge */
  474|  4.07k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 2.56k, False: 1.50k]
  |  Branch (474:16): [True: 1.13k, False: 1.43k]
  ------------------
  475|  1.13k|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|  1.13k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  1.13k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.13k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.13k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|  1.13k|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|  1.13k|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|  1.13k|      stack_curr--;
  479|  2.94k|    } else {
  480|       |      /* right merge */
  481|  2.94k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.94k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.94k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.94k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.94k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.94k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.94k|      stack_curr--;
  484|  2.94k|    }
  485|  4.07k|  }
  486|       |
  487|  2.57k|  return stack_curr;
  488|  2.57k|}

xmlBuildQName:
  170|   632k|	      xmlChar *memory, int len) {
  171|   632k|    size_t lenn, lenp;
  172|   632k|    xmlChar *ret;
  173|       |
  174|   632k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 632k]
  |  Branch (174:29): [True: 0, False: 632k]
  ------------------
  175|   632k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 496k, False: 135k]
  ------------------
  176|       |
  177|   135k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   135k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 78.3k, False: 57.6k]
  ------------------
  180|  78.3k|        len = 8;
  181|   135k|#endif
  182|       |
  183|   135k|    lenn = strlen((char *) ncname);
  184|   135k|    lenp = strlen((char *) prefix);
  185|   135k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 135k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   135k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 57.6k, False: 78.3k]
  |  Branch (188:29): [True: 30.5k, False: 47.8k]
  ------------------
  189|  88.1k|	ret = xmlMalloc(lenn + lenp + 2);
  190|  88.1k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 65, False: 88.0k]
  ------------------
  191|     65|	    return(NULL);
  192|  88.1k|    } else {
  193|  47.8k|	ret = memory;
  194|  47.8k|    }
  195|   135k|    memcpy(&ret[0], prefix, lenp);
  196|   135k|    ret[lenp] = ':';
  197|   135k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   135k|    ret[lenn + lenp + 1] = 0;
  199|   135k|    return(ret);
  200|   135k|}
xmlSplitQName3:
  268|   398k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   398k|    int l = 0;
  270|       |
  271|   398k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 398k]
  ------------------
  272|   398k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 398k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   398k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.53k, False: 397k]
  ------------------
  276|  1.53k|	return(NULL);
  277|       |
  278|       |    /*
  279|       |     * we are not trying to validate but just to cut, and yes it will
  280|       |     * work even if this is as set of UTF-8 encoded chars
  281|       |     */
  282|  1.62M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 1.25M, False: 371k]
  |  Branch (282:30): [True: 1.23M, False: 26.2k]
  ------------------
  283|  1.23M|	l++;
  284|       |
  285|   397k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 371k, False: 26.2k]
  |  Branch (285:27): [True: 959, False: 25.2k]
  ------------------
  286|   371k|	return(NULL);
  287|       |
  288|  25.2k|    *len = l;
  289|       |
  290|  25.2k|    return(&name[l+1]);
  291|   397k|}
xmlSplitQName4:
  306|   624k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   624k|    xmlChar *prefix;
  308|   624k|    int l = 0;
  309|       |
  310|   624k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 624k]
  |  Branch (310:27): [True: 0, False: 624k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   624k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   624k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 3.82k, False: 620k]
  ------------------
  317|  3.82k|	return(name);
  318|       |
  319|       |    /*
  320|       |     * we are not trying to validate but just to cut, and yes it will
  321|       |     * work even if this is as set of UTF-8 encoded chars
  322|       |     */
  323|  2.44M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 1.96M, False: 485k]
  |  Branch (323:30): [True: 1.82M, False: 135k]
  ------------------
  324|  1.82M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   620k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 485k, False: 135k]
  |  Branch (329:27): [True: 1.96k, False: 133k]
  ------------------
  330|   487k|	return(name);
  331|       |
  332|   133k|    prefix = xmlStrndup(name, l);
  333|   133k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 40, False: 133k]
  ------------------
  334|     40|        return(NULL);
  335|       |
  336|   133k|    *prefixPtr = prefix;
  337|   133k|    return(&name[l+1]);
  338|   133k|}
xmlValidateNCName:
  355|  4.08k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  4.08k|    const xmlChar *cur;
  357|       |
  358|  4.08k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 4.08k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  4.08k|    cur = value;
  362|       |
  363|  4.08k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 4.08k, False: 0]
  ------------------
  364|  4.08k|	while (IS_BLANK_CH(*cur))
  365|    839|            cur++;
  366|  4.08k|    }
  367|       |
  368|  4.08k|    value = cur;
  369|  4.08k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  4.08k|#define XML_SCAN_NC         1
  ------------------
  370|  4.08k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 4.08k]
  |  Branch (370:26): [True: 868, False: 3.21k]
  ------------------
  371|    868|        return(1);
  372|       |
  373|  3.21k|    if (space) {
  ------------------
  |  Branch (373:9): [True: 3.21k, False: 0]
  ------------------
  374|  3.21k|	while (IS_BLANK_CH(*cur))
  375|  1.00k|            cur++;
  376|  3.21k|    }
  377|       |
  378|  3.21k|    return(*cur != 0);
  379|  4.08k|}
xmlNewNs:
  517|  4.30M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  4.30M|    xmlNsPtr cur;
  519|       |
  520|  4.30M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 55.2k, False: 4.24M]
  |  Branch (520:27): [True: 0, False: 55.2k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  4.30M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  4.30M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 52, False: 4.30M]
  ------------------
  528|     52|	return(NULL);
  529|  4.30M|    memset(cur, 0, sizeof(xmlNs));
  530|  4.30M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  4.30M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  4.30M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 4.28M, False: 16.9k]
  ------------------
  533|  4.28M|	cur->href = xmlStrdup(href);
  534|  4.28M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 58, False: 4.28M]
  ------------------
  535|     58|            goto error;
  536|  4.28M|    }
  537|  4.30M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 4.24M, False: 57.6k]
  ------------------
  538|  4.24M|	cur->prefix = xmlStrdup(prefix);
  539|  4.24M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 47, False: 4.24M]
  ------------------
  540|     47|            goto error;
  541|  4.24M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  4.30M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 55.2k, False: 4.24M]
  ------------------
  548|  55.2k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 48.9k, False: 6.23k]
  ------------------
  549|  48.9k|	    node->nsDef = cur;
  550|  48.9k|	} else {
  551|  6.23k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  6.23k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 6.23k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  9.24k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 3.01k, False: 6.23k]
  ------------------
  557|  3.01k|	        prev = prev->next;
  558|  3.01k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 3.01k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  3.01k|	    }
  562|  6.23k|	    prev->next = cur;
  563|  6.23k|	}
  564|  55.2k|    }
  565|  4.30M|    return(cur);
  566|       |
  567|    105|error:
  568|    105|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  4.30M|}
xmlSetNs:
  580|  62.1k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  62.1k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 62.1k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  62.1k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 62.1k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  62.1k|	node->ns = ns;
  587|  62.1k|}
xmlFreeNs:
  595|  4.30M|xmlFreeNs(xmlNs *cur) {
  596|  4.30M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 4.30M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  4.30M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 4.29M, False: 17.0k]
  ------------------
  600|  4.30M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 4.25M, False: 57.8k]
  ------------------
  601|  4.30M|    xmlFree(cur);
  602|  4.30M|}
xmlFreeNsList:
  610|  3.87M|xmlFreeNsList(xmlNs *cur) {
  611|  3.87M|    xmlNsPtr next;
  612|  3.87M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 45, False: 3.87M]
  ------------------
  613|     45|	return;
  614|     45|    }
  615|  8.18M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 4.30M, False: 3.87M]
  ------------------
  616|  4.30M|        next = cur->next;
  617|  4.30M|        xmlFreeNs(cur);
  618|  4.30M|	cur = next;
  619|  4.30M|    }
  620|  3.87M|}
xmlNewDtd:
  640|  12.4k|          const xmlChar *systemId) {
  641|  12.4k|    xmlDtdPtr cur;
  642|       |
  643|  12.4k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 2.16k, False: 10.2k]
  |  Branch (643:26): [True: 0, False: 2.16k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  12.4k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  12.4k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 11, False: 12.4k]
  ------------------
  652|     11|	return(NULL);
  653|  12.4k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  12.4k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  12.4k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 12.4k, False: 0]
  ------------------
  657|  12.4k|	cur->name = xmlStrdup(name);
  658|  12.4k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 18, False: 12.4k]
  ------------------
  659|     18|            goto error;
  660|  12.4k|    }
  661|  12.4k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 385, False: 12.0k]
  ------------------
  662|    385|	cur->ExternalID = xmlStrdup(publicId);
  663|    385|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 2, False: 383]
  ------------------
  664|      2|            goto error;
  665|    385|    }
  666|  12.3k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 2.93k, False: 9.46k]
  ------------------
  667|  2.93k|	cur->SystemID = xmlStrdup(systemId);
  668|  2.93k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 6, False: 2.92k]
  ------------------
  669|      6|            goto error;
  670|  2.93k|    }
  671|  12.3k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 2.16k, False: 10.2k]
  ------------------
  672|  2.16k|	doc->extSubset = cur;
  673|  12.3k|    cur->doc = doc;
  674|       |
  675|  12.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 12.3k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  12.3k|    return(cur);
  678|       |
  679|     26|error:
  680|     26|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  12.3k|}
xmlGetIntSubset:
  691|  88.1k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  88.1k|    xmlNodePtr cur;
  693|       |
  694|  88.1k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 9.87k, False: 78.2k]
  ------------------
  695|  9.87k|	return(NULL);
  696|  78.2k|    cur = doc->children;
  697|  93.0k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 43.5k, False: 49.4k]
  ------------------
  698|  43.5k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 28.7k, False: 14.8k]
  ------------------
  699|  28.7k|	    return((xmlDtdPtr) cur);
  700|  14.8k|	cur = cur->next;
  701|  14.8k|    }
  702|  49.4k|    return((xmlDtdPtr) doc->intSubset);
  703|  78.2k|}
xmlCreateIntSubset:
  722|  21.9k|                   const xmlChar *systemId) {
  723|  21.9k|    xmlDtdPtr cur;
  724|       |
  725|  21.9k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 21.9k, False: 0]
  ------------------
  726|  21.9k|        cur = xmlGetIntSubset(doc);
  727|  21.9k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 21.9k]
  ------------------
  728|      0|            return(cur);
  729|  21.9k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  21.9k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  21.9k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 5, False: 21.9k]
  ------------------
  736|      5|	return(NULL);
  737|  21.9k|    memset(cur, 0, sizeof(xmlDtd));
  738|  21.9k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  21.9k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 20.6k, False: 1.30k]
  ------------------
  741|  20.6k|	cur->name = xmlStrdup(name);
  742|  20.6k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 2, False: 20.6k]
  ------------------
  743|      2|            goto error;
  744|  20.6k|    }
  745|  21.9k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 804, False: 21.1k]
  ------------------
  746|    804|	cur->ExternalID = xmlStrdup(publicId);
  747|    804|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 1, False: 803]
  ------------------
  748|      1|            goto error;
  749|    804|    }
  750|  21.9k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 3.84k, False: 18.1k]
  ------------------
  751|  3.84k|	cur->SystemID = xmlStrdup(systemId);
  752|  3.84k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 3.84k]
  ------------------
  753|      1|            goto error;
  754|  3.84k|    }
  755|  21.9k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 21.9k, False: 0]
  ------------------
  756|  21.9k|	doc->intSubset = cur;
  757|  21.9k|	cur->parent = doc;
  758|  21.9k|	cur->doc = doc;
  759|  21.9k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 19.7k, False: 2.24k]
  ------------------
  760|  19.7k|	    doc->children = (xmlNodePtr) cur;
  761|  19.7k|	    doc->last = (xmlNodePtr) cur;
  762|  19.7k|	} else {
  763|  2.24k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 2.24k]
  ------------------
  764|      0|		xmlNodePtr prev;
  765|       |
  766|      0|		prev = doc->children;
  767|      0|		prev->prev = (xmlNodePtr) cur;
  768|      0|		cur->next = prev;
  769|      0|		doc->children = (xmlNodePtr) cur;
  770|  2.24k|	    } else {
  771|  2.24k|		xmlNodePtr next;
  772|       |
  773|  2.24k|		next = doc->children;
  774|  4.62k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.55k, False: 2.07k]
  |  Branch (774:28): [True: 2.38k, False: 170]
  ------------------
  775|  2.38k|		    next = next->next;
  776|  2.24k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 2.07k, False: 170]
  ------------------
  777|  2.07k|		    cur->prev = doc->last;
  778|  2.07k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  2.07k|		    cur->next = NULL;
  780|  2.07k|		    doc->last = (xmlNodePtr) cur;
  781|  2.07k|		} else {
  782|    170|		    cur->next = next;
  783|    170|		    cur->prev = next->prev;
  784|    170|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 157, False: 13]
  ------------------
  785|    157|			doc->children = (xmlNodePtr) cur;
  786|     13|		    else
  787|     13|			cur->prev->next = (xmlNodePtr) cur;
  788|    170|		    next->prev = (xmlNodePtr) cur;
  789|    170|		}
  790|  2.24k|	    }
  791|  2.24k|	}
  792|  21.9k|    }
  793|       |
  794|  21.9k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 21.9k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  21.9k|    return(cur);
  797|       |
  798|      4|error:
  799|      4|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  21.9k|}
xmlFreeDtd:
  820|  34.3k|xmlFreeDtd(xmlDtd *cur) {
  821|  34.3k|    xmlDictPtr dict = NULL;
  822|       |
  823|  34.3k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 34.3k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  34.3k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 24.1k, False: 10.2k]
  ------------------
  827|       |
  828|  34.3k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 34.3k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  34.3k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 22.1k, False: 12.2k]
  ------------------
  832|  22.1k|	xmlNodePtr next, c = cur->children;
  833|       |
  834|       |	/*
  835|       |	 * Cleanup all nodes which are not part of the specific lists
  836|       |	 * of notations, elements, attributes and entities.
  837|       |	 */
  838|   222k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 200k, False: 22.1k]
  ------------------
  839|   200k|	    next = c->next;
  840|   200k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 182k, False: 17.4k]
  ------------------
  841|   182k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 142k, False: 40.1k]
  ------------------
  842|   142k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 114k, False: 28.2k]
  ------------------
  843|   114k|		xmlUnlinkNodeInternal(c);
  844|   114k|		xmlFreeNode(c);
  845|   114k|	    }
  846|   200k|	    c = next;
  847|   200k|	}
  848|  22.1k|    }
  849|       |
  850|  34.3k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  34.3k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 33.0k, False: 1.32k]
  |  |  |  Branch (810:16): [True: 19.8k, False: 13.2k]
  |  |  ------------------
  |  |  811|  33.0k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 13.2k, False: 0]
  |  |  ------------------
  |  |  812|  34.3k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  34.3k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 6.77k, False: 27.6k]
  ------------------
  853|  6.77k|        xmlFree(cur->SystemID);
  854|  34.3k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 1.18k, False: 33.2k]
  ------------------
  855|  1.18k|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  34.3k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 1.93k, False: 32.4k]
  ------------------
  859|  1.93k|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  34.3k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 14.6k, False: 19.7k]
  ------------------
  862|  14.6k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  34.3k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 9.33k, False: 25.0k]
  ------------------
  864|  9.33k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  34.3k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 7.69k, False: 26.6k]
  ------------------
  866|  7.69k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  34.3k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 4.34k, False: 30.0k]
  ------------------
  868|  4.34k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  34.3k|    xmlFree(cur);
  871|  34.3k|}
xmlNewDoc:
  880|  51.8k|xmlNewDoc(const xmlChar *version) {
  881|  51.8k|    xmlDocPtr cur;
  882|       |
  883|  51.8k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 515, False: 51.3k]
  ------------------
  884|    515|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  51.8k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  51.8k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 12, False: 51.8k]
  ------------------
  891|     12|	return(NULL);
  892|  51.8k|    memset(cur, 0, sizeof(xmlDoc));
  893|  51.8k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  51.8k|    cur->version = xmlStrdup(version);
  896|  51.8k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 14, False: 51.8k]
  ------------------
  897|     14|	xmlFree(cur);
  898|     14|	return(NULL);
  899|     14|    }
  900|  51.8k|    cur->standalone = -1;
  901|  51.8k|    cur->compression = -1; /* not initialized */
  902|  51.8k|    cur->doc = cur;
  903|  51.8k|    cur->parseFlags = 0;
  904|  51.8k|    cur->properties = XML_DOC_USERBUILT;
  905|       |    /*
  906|       |     * The in memory encoding is always UTF8
  907|       |     * This field will never change and would
  908|       |     * be obsolete if not for binary compatibility.
  909|       |     */
  910|  51.8k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  51.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 51.8k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  51.8k|    return(cur);
  915|  51.8k|}
xmlFreeDoc:
  923|  15.6k|xmlFreeDoc(xmlDoc *cur) {
  924|  15.6k|    xmlDtdPtr extSubset, intSubset;
  925|  15.6k|    xmlDictPtr dict = NULL;
  926|       |
  927|  15.6k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 2.23k, False: 13.4k]
  ------------------
  928|  2.23k|	return;
  929|  2.23k|    }
  930|       |
  931|  13.4k|    dict = cur->dict;
  932|       |
  933|  13.4k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 13.4k]
  |  Branch (933:35): [True: 0, False: 0]
  ------------------
  934|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  935|       |
  936|       |    /*
  937|       |     * Do this before freeing the children list to avoid ID lookups
  938|       |     */
  939|  13.4k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 219, False: 13.2k]
  ------------------
  940|  13.4k|    cur->ids = NULL;
  941|  13.4k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 321, False: 13.1k]
  ------------------
  942|  13.4k|    cur->refs = NULL;
  943|  13.4k|    extSubset = cur->extSubset;
  944|  13.4k|    intSubset = cur->intSubset;
  945|  13.4k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 8.63k, False: 4.82k]
  ------------------
  946|  8.63k|	extSubset = NULL;
  947|  13.4k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 560, False: 12.8k]
  ------------------
  948|    560|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    560|	cur->extSubset = NULL;
  950|    560|	xmlFreeDtd(extSubset);
  951|    560|    }
  952|  13.4k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 4.83k, False: 8.61k]
  ------------------
  953|  4.83k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  4.83k|	cur->intSubset = NULL;
  955|  4.83k|	xmlFreeDtd(intSubset);
  956|  4.83k|    }
  957|       |
  958|  13.4k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 12.6k, False: 820]
  ------------------
  959|  13.4k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.63k, False: 11.8k]
  ------------------
  960|       |
  961|  13.4k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  13.4k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 13.4k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  13.4k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  13.4k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 13.4k, False: 0]
  ------------------
  964|  13.4k|        xmlFree(cur->version);
  965|  13.4k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 71, False: 13.3k]
  ------------------
  966|     71|        xmlFree(cur->encoding);
  967|  13.4k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 9.73k, False: 3.71k]
  ------------------
  968|  9.73k|        xmlFree(cur->URL);
  969|       |
  970|  13.4k|    xmlFree(cur);
  971|  13.4k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 7.32k, False: 6.12k]
  ------------------
  972|  13.4k|}
xmlNodeParseAttValue:
  998|  88.9k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|  88.9k|    xmlNodePtr head = NULL, last = NULL;
 1000|  88.9k|    xmlNodePtr node;
 1001|  88.9k|    xmlChar *val = NULL;
 1002|  88.9k|    const xmlChar *cur;
 1003|  88.9k|    const xmlChar *q;
 1004|  88.9k|    xmlEntityPtr ent;
 1005|  88.9k|    xmlBufPtr buf;
 1006|  88.9k|    size_t remaining = len;
 1007|       |
 1008|  88.9k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 88.9k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|  88.9k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 88.9k]
  |  Branch (1011:28): [True: 3.58k, False: 85.3k]
  ------------------
 1012|  3.58k|        goto done;
 1013|       |
 1014|  85.3k|    cur = value;
 1015|       |
 1016|  85.3k|    buf = xmlBufCreate(50);
 1017|  85.3k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 37, False: 85.3k]
  ------------------
 1018|     37|        return(-1);
 1019|       |
 1020|  85.3k|    q = cur;
 1021|   100M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 100M, False: 50.3k]
  |  Branch (1021:31): [True: 100M, False: 34.7k]
  ------------------
 1022|   100M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 41.6k, False: 100M]
  ------------------
 1023|  41.6k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  41.6k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 30.5k, False: 11.1k]
  ------------------
 1029|  30.5k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 2, False: 30.5k]
  ------------------
 1030|      2|		    goto out;
 1031|  30.5k|	        q = cur;
 1032|  30.5k|	    }
 1033|       |
 1034|  41.6k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 41.6k, False: 0]
  |  Branch (1034:29): [True: 15.7k, False: 25.9k]
  |  Branch (1034:48): [True: 3.42k, False: 12.3k]
  ------------------
 1035|  3.42k|	        int tmp = 0;
 1036|       |
 1037|  3.42k|		cur += 3;
 1038|  3.42k|                remaining -= 3;
 1039|  14.8k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 14.8k, False: 0]
  |  Branch (1039:29): [True: 11.3k, False: 3.42k]
  ------------------
 1040|  11.3k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 11.3k, False: 0]
  |  Branch (1040:27): [True: 1.21k, False: 10.1k]
  ------------------
 1041|  1.21k|			charval = charval * 16 + (tmp - '0');
 1042|  10.1k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 2.99k, False: 7.18k]
  |  Branch (1042:32): [True: 2.99k, False: 0]
  ------------------
 1043|  2.99k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  7.18k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 7.18k, False: 0]
  |  Branch (1044:32): [True: 7.18k, False: 0]
  ------------------
 1045|  7.18k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  11.3k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 11.3k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  11.3k|		    cur++;
 1053|  11.3k|                    remaining--;
 1054|  11.3k|		}
 1055|  3.42k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 3.42k, False: 0]
  ------------------
 1056|  3.42k|		    cur++;
 1057|  3.42k|                    remaining--;
 1058|  3.42k|                }
 1059|  3.42k|		q = cur;
 1060|  38.2k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 38.2k, False: 0]
  |  Branch (1060:36): [True: 12.3k, False: 25.9k]
  ------------------
 1061|  12.3k|	        int tmp = 0;
 1062|       |
 1063|  12.3k|		cur += 2;
 1064|  12.3k|                remaining -= 2;
 1065|  36.9k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 36.9k, False: 0]
  |  Branch (1065:29): [True: 24.6k, False: 12.3k]
  ------------------
 1066|  24.6k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 24.6k, False: 0]
  |  Branch (1066:27): [True: 24.6k, False: 0]
  ------------------
 1067|  24.6k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  24.6k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 24.6k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  24.6k|		    cur++;
 1075|  24.6k|                    remaining--;
 1076|  24.6k|		}
 1077|  12.3k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 12.3k, False: 0]
  ------------------
 1078|  12.3k|		    cur++;
 1079|  12.3k|                    remaining--;
 1080|  12.3k|                }
 1081|  12.3k|		q = cur;
 1082|  25.9k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  25.9k|		cur++;
 1087|  25.9k|                remaining--;
 1088|  25.9k|		q = cur;
 1089|   213k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 213k, False: 0]
  |  Branch (1089:29): [True: 213k, False: 0]
  |  Branch (1089:44): [True: 187k, False: 25.9k]
  ------------------
 1090|   187k|                    cur++;
 1091|   187k|                    remaining--;
 1092|   187k|                }
 1093|  25.9k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 25.9k]
  |  Branch (1093:27): [True: 0, False: 25.9k]
  ------------------
 1094|      0|		    break;
 1095|  25.9k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 25.9k, False: 0]
  ------------------
 1096|  25.9k|		    val = xmlStrndup(q, cur - q);
 1097|  25.9k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 5, False: 25.9k]
  ------------------
 1098|      5|                        goto out;
 1099|  25.9k|		    ent = xmlGetDocEntity(doc, val);
 1100|  25.9k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 22.3k, False: 3.61k]
  ------------------
 1101|  22.3k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 384, False: 21.9k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    384|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 1, False: 383]
  ------------------
 1106|      1|			    goto out;
 1107|  25.5k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 3.61k, False: 21.9k]
  ------------------
 1108|  25.5k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  21.9k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 21.9k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  25.5k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 18.0k, False: 7.55k]
  ------------------
 1113|  18.0k|			    node = xmlNewDocText(doc, NULL);
 1114|  18.0k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 5, False: 18.0k]
  ------------------
 1115|      5|				goto out;
 1116|  18.0k|			    node->content = xmlBufDetach(buf);
 1117|  18.0k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  18.0k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 1.11k, False: 16.8k]
  ------------------
 1120|  1.11k|				head = node;
 1121|  16.8k|			    } else {
 1122|  16.8k|                                last->next = node;
 1123|  16.8k|                                node->prev = last;
 1124|  16.8k|			    }
 1125|  18.0k|                            last = node;
 1126|  18.0k|			}
 1127|       |
 1128|  25.5k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 21.9k, False: 3.61k]
  ------------------
 1129|  21.9k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  21.9k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 1.24k, False: 20.7k]
  ------------------
 1130|  1.24k|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 1.15k, False: 86]
  ------------------
 1131|  1.15k|                            int res;
 1132|       |
 1133|  1.15k|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.15k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|  1.15k|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|  1.15k|                                                       ent->content, SIZE_MAX,
 1136|  1.15k|                                                       NULL);
 1137|  1.15k|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.15k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|  1.15k|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 176, False: 979]
  ------------------
 1139|    176|                                goto out;
 1140|    979|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    979|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    979|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|  25.3k|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|  25.3k|                        val = NULL;
 1148|  25.3k|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 11, False: 25.3k]
  ------------------
 1149|     11|			    goto out;
 1150|  25.3k|                        node->parent = (xmlNode *) attr;
 1151|  25.3k|                        node->last = (xmlNodePtr) ent;
 1152|  25.3k|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 21.7k, False: 3.60k]
  ------------------
 1153|  21.7k|                            node->children = (xmlNodePtr) ent;
 1154|  21.7k|                            node->content = ent->content;
 1155|  21.7k|                        }
 1156|       |
 1157|  25.3k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.56k, False: 23.8k]
  ------------------
 1158|  1.56k|			    head = node;
 1159|  23.8k|			} else {
 1160|  23.8k|                            last->next = node;
 1161|  23.8k|                            node->prev = last;
 1162|  23.8k|			}
 1163|  25.3k|                        last = node;
 1164|  25.3k|		    }
 1165|  25.7k|		    xmlFree(val);
 1166|  25.7k|                    val = NULL;
 1167|  25.7k|		}
 1168|  25.7k|		cur++;
 1169|  25.7k|                remaining--;
 1170|  25.7k|		q = cur;
 1171|  25.7k|	    }
 1172|  41.4k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 15.7k, False: 25.7k]
  ------------------
 1173|  15.7k|		xmlChar buffer[10];
 1174|  15.7k|		int l;
 1175|       |
 1176|  15.7k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 15.7k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  15.7k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  15.7k|		buffer[l] = 0;
 1181|       |
 1182|  15.7k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 15.7k]
  ------------------
 1183|      1|		    goto out;
 1184|  15.7k|	    }
 1185|   100M|	} else {
 1186|   100M|	    cur++;
 1187|   100M|            remaining--;
 1188|   100M|        }
 1189|   100M|    }
 1190|       |
 1191|  85.0k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 82.1k, False: 2.97k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  82.1k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 4, False: 82.1k]
  ------------------
 1196|      4|	    goto out;
 1197|  82.1k|    }
 1198|       |
 1199|  85.0k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 83.6k, False: 1.45k]
  ------------------
 1200|  83.6k|	node = xmlNewDocText(doc, NULL);
 1201|  83.6k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 26, False: 83.6k]
  ------------------
 1202|     26|            goto out;
 1203|  83.6k|        node->parent = (xmlNode *) attr;
 1204|  83.6k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  83.6k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 82.4k, False: 1.15k]
  ------------------
 1207|  82.4k|	    head = node;
 1208|  82.4k|	} else {
 1209|  1.15k|            last->next = node;
 1210|  1.15k|            node->prev = last;
 1211|  1.15k|	}
 1212|  83.6k|        last = node;
 1213|  83.6k|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 1.45k]
  ------------------
 1214|      0|        head = xmlNewDocText(doc, BAD_CAST "");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1215|      0|        if (head == NULL)
  ------------------
  |  Branch (1215:13): [True: 0, False: 0]
  ------------------
 1216|      0|            goto out;
 1217|      0|        head->parent = (xmlNode *) attr;
 1218|      0|        last = head;
 1219|      0|    }
 1220|       |
 1221|  85.0k|    xmlBufFree(buf);
 1222|       |
 1223|  88.6k|done:
 1224|  88.6k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 88.6k, False: 0]
  ------------------
 1225|  88.6k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 88.6k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  88.6k|        attr->children = head;
 1228|  88.6k|        attr->last = last;
 1229|  88.6k|    }
 1230|       |
 1231|  88.6k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 88.6k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  88.6k|    return(0);
 1235|       |
 1236|    231|out:
 1237|    231|    xmlBufFree(buf);
 1238|    231|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 182, False: 49]
  ------------------
 1239|    182|        xmlFree(val);
 1240|    231|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 70, False: 161]
  ------------------
 1241|     70|        xmlFreeNodeList(head);
 1242|    231|    return(-1);
 1243|  85.0k|}
xmlNodeListGetStringInternal:
 1297|  1.25k|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|  1.25k|    xmlBufPtr buf;
 1299|  1.25k|    xmlChar *ret;
 1300|       |
 1301|  1.25k|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.25k]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|  1.25k|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 1.25k, False: 0]
  ------------------
 1305|  1.25k|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 1.01k, False: 249]
  ------------------
 1306|    249|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 249]
  ------------------
 1307|  1.01k|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 646, False: 364]
  ------------------
 1308|    646|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 646]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    646|        return(xmlStrdup(node->content));
 1311|    646|    }
 1312|       |
 1313|    613|    buf = xmlBufCreate(50);
 1314|    613|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 12, False: 601]
  ------------------
 1315|     12|        return(NULL);
 1316|       |
 1317|  1.90k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 1.30k, False: 601]
  ------------------
 1318|  1.30k|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 565, False: 741]
  ------------------
 1319|    741|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 741]
  ------------------
 1320|    565|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 565, False: 0]
  ------------------
 1321|    565|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 565, False: 0]
  ------------------
 1322|    565|                    xmlBufCat(buf, node->content);
 1323|    565|                } else {
 1324|      0|                    xmlChar *encoded;
 1325|       |
 1326|      0|                    encoded = xmlEscapeText(node->content, flags);
 1327|      0|                    if (encoded == NULL)
  ------------------
  |  Branch (1327:25): [True: 0, False: 0]
  ------------------
 1328|      0|                        goto error;
 1329|      0|                    xmlBufCat(buf, encoded);
 1330|      0|                    xmlFree(encoded);
 1331|      0|                }
 1332|    565|            }
 1333|    741|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 741, False: 0]
  ------------------
 1334|    741|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 741, False: 0]
  ------------------
 1335|    741|                xmlBufGetNodeContent(buf, node);
 1336|    741|            } else {
 1337|      0|                xmlBufAdd(buf, BAD_CAST "&", 1);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1338|      0|                xmlBufCat(buf, node->name);
 1339|      0|                xmlBufAdd(buf, BAD_CAST ";", 1);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1340|      0|            }
 1341|    741|        }
 1342|       |
 1343|  1.30k|        node = node->next;
 1344|  1.30k|    }
 1345|       |
 1346|    601|    ret = xmlBufDetach(buf);
 1347|    601|    xmlBufFree(buf);
 1348|    601|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    601|}
xmlNodeListGetString:
 1374|  1.25k|{
 1375|  1.25k|    int flags = 0;
 1376|  1.25k|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|  1.25k|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 1.25k]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|  1.25k|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 1.25k]
  ------------------
 1383|      0|        escape = 1;
 1384|       |
 1385|      0|        if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (1385:13): [True: 0, False: 0]
  |  Branch (1385:30): [True: 0, False: 0]
  ------------------
 1386|      0|            flags |= XML_ESCAPE_HTML;
  ------------------
  |  |   24|      0|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
 1387|      0|        else if ((doc == NULL) || (doc->encoding == NULL))
  ------------------
  |  Branch (1387:18): [True: 0, False: 0]
  |  Branch (1387:35): [True: 0, False: 0]
  ------------------
 1388|      0|            flags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
 1389|       |
 1390|      0|        if ((list->parent != NULL) &&
  ------------------
  |  Branch (1390:13): [True: 0, False: 0]
  ------------------
 1391|      0|            (list->parent->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (1391:13): [True: 0, False: 0]
  ------------------
 1392|      0|            flags |= XML_ESCAPE_ATTR;
  ------------------
  |  |   22|      0|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
 1393|      0|    }
 1394|       |
 1395|  1.25k|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|  1.25k|}
xmlNewNsProp:
 1572|  72.5k|           const xmlChar *value) {
 1573|       |
 1574|  72.5k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 72.5k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  72.5k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  72.5k|}
xmlNewDocProp:
 1621|  2.09M|xmlNewDocProp(xmlDoc *doc, const xmlChar *name, const xmlChar *value) {
 1622|  2.09M|    xmlAttrPtr cur;
 1623|       |
 1624|  2.09M|    if (name == NULL) {
  ------------------
  |  Branch (1624:9): [True: 3.99k, False: 2.09M]
  ------------------
 1625|  3.99k|	return(NULL);
 1626|  3.99k|    }
 1627|       |
 1628|       |    /*
 1629|       |     * Allocate a new property and fill the fields.
 1630|       |     */
 1631|  2.09M|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1632|  2.09M|    if (cur == NULL)
  ------------------
  |  Branch (1632:9): [True: 21, False: 2.09M]
  ------------------
 1633|     21|	return(NULL);
 1634|  2.09M|    memset(cur, 0, sizeof(xmlAttr));
 1635|  2.09M|    cur->type = XML_ATTRIBUTE_NODE;
 1636|       |
 1637|  2.09M|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1637:9): [True: 2.09M, False: 330]
  |  Branch (1637:26): [True: 1.71M, False: 381k]
  ------------------
 1638|  1.71M|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|   381k|    else
 1640|   381k|	cur->name = xmlStrdup(name);
 1641|  2.09M|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 9, False: 2.09M]
  ------------------
 1642|      9|        goto error;
 1643|  2.09M|    cur->doc = doc;
 1644|  2.09M|    if (value != NULL) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.09M]
  ------------------
 1645|       |        /*
 1646|       |         * We shouldn't parse the attribute value here,
 1647|       |         * but the API can't be changed.
 1648|       |         */
 1649|      0|        if (xmlNodeParseAttValue(doc, cur, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1649:13): [True: 0, False: 0]
  ------------------
 1650|      0|            goto error;
 1651|      0|    }
 1652|       |
 1653|  2.09M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1653:9): [True: 0, False: 2.09M]
  |  Branch (1653:35): [True: 0, False: 0]
  ------------------
 1654|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1655|  2.09M|    return(cur);
 1656|       |
 1657|      9|error:
 1658|      9|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|  2.09M|}
xmlFreePropList:
 1668|  1.64M|xmlFreePropList(xmlAttr *cur) {
 1669|  1.64M|    xmlAttrPtr next;
 1670|  1.64M|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.84k, False: 1.63M]
  ------------------
 1671|  3.63M|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 1.99M, False: 1.63M]
  ------------------
 1672|  1.99M|        next = cur->next;
 1673|  1.99M|        xmlFreeProp(cur);
 1674|  1.99M|	cur = next;
 1675|  1.99M|    }
 1676|  1.63M|}
xmlFreeProp:
 1684|  1.99M|xmlFreeProp(xmlAttr *cur) {
 1685|  1.99M|    xmlDictPtr dict = NULL;
 1686|  1.99M|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 1.99M]
  ------------------
 1687|       |
 1688|  1.99M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 1.99M, False: 339]
  ------------------
 1689|       |
 1690|  1.99M|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 1.99M]
  |  Branch (1690:35): [True: 0, False: 0]
  ------------------
 1691|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 1692|       |
 1693|       |    /* Check for ID removal -> leading to invalid references ! */
 1694|  1.99M|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 1.99M, False: 339]
  |  Branch (1694:29): [True: 2.89k, False: 1.99M]
  ------------------
 1695|  2.89k|        xmlRemoveID(cur->doc, cur);
 1696|  2.89k|    }
 1697|  1.99M|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 1.52M, False: 473k]
  ------------------
 1698|  1.99M|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  1.99M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 1.99M, False: 50]
  |  |  |  Branch (810:16): [True: 469k, False: 1.53M]
  |  |  ------------------
  |  |  811|  1.99M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 1.53M]
  |  |  ------------------
  |  |  812|  1.99M|	    xmlFree((char *)(str));
  ------------------
 1699|  1.99M|    xmlFree(cur);
 1700|  1.99M|}
xmlNewDocPI:
 1753|   163k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|   163k|    xmlNodePtr cur;
 1755|       |
 1756|   163k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 163k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|   163k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|   163k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 4, False: 163k]
  ------------------
 1765|      4|	return(NULL);
 1766|   163k|    memset(cur, 0, sizeof(xmlNode));
 1767|   163k|    cur->type = XML_PI_NODE;
 1768|   163k|    cur->doc = doc;
 1769|       |
 1770|   163k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 163k, False: 0]
  |  Branch (1770:26): [True: 125k, False: 37.9k]
  ------------------
 1771|   125k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  37.9k|    else
 1773|  37.9k|	cur->name = xmlStrdup(name);
 1774|   163k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 1, False: 163k]
  ------------------
 1775|      1|        goto error;
 1776|   163k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 17.2k, False: 146k]
  ------------------
 1777|  17.2k|	cur->content = xmlStrdup(content);
 1778|  17.2k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 3, False: 17.2k]
  ------------------
 1779|      3|            goto error;
 1780|  17.2k|    }
 1781|       |
 1782|   163k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 163k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|   163k|    return(cur);
 1785|       |
 1786|      4|error:
 1787|      4|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|   163k|}
xmlNewDocNode:
 1900|   566k|              const xmlChar *name, const xmlChar *content) {
 1901|   566k|    xmlNodePtr cur;
 1902|   566k|    xmlChar *copy;
 1903|       |
 1904|   566k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 566k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   566k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 566k, False: 0]
  |  Branch (1907:26): [True: 117k, False: 449k]
  ------------------
 1908|   117k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|   117k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 3, False: 117k]
  ------------------
 1911|      3|            return(NULL);
 1912|   117k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|   117k|    }
 1914|       |
 1915|   449k|    copy = xmlStrdup(name);
 1916|   449k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 39, False: 449k]
  ------------------
 1917|     39|        return(NULL);
 1918|       |
 1919|   449k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   449k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 40, False: 448k]
  ------------------
 1921|     40|        xmlFree(copy);
 1922|     40|        return(NULL);
 1923|     40|    }
 1924|       |
 1925|   448k|    return(cur);
 1926|   449k|}
xmlNewDocNodeEatName:
 1944|   425k|                     xmlChar *name, const xmlChar *content) {
 1945|   425k|    xmlNodePtr cur;
 1946|       |
 1947|   425k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 425k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   425k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   425k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 36, False: 425k]
  ------------------
 1952|       |        /* if name doesn't come from the doc dictionary free it here */
 1953|     36|        if ((doc == NULL) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 36]
  ------------------
 1954|     36|            (doc->dict == NULL) ||
  ------------------
  |  Branch (1954:13): [True: 2, False: 34]
  ------------------
 1955|     34|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 34]
  ------------------
 1956|      2|            xmlFree(name);
 1957|     36|        return(NULL);
 1958|     36|    }
 1959|       |
 1960|   425k|    return(cur);
 1961|   425k|}
xmlNewText:
 2037|   140k|xmlNewText(const xmlChar *content) {
 2038|   140k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   140k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   140k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 53, False: 140k]
  ------------------
 2045|     53|	return(NULL);
 2046|   140k|    memset(cur, 0, sizeof(xmlNode));
 2047|   140k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   140k|    cur->name = xmlStringText;
 2050|   140k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 38.1k, False: 101k]
  ------------------
 2051|  38.1k|	cur->content = xmlStrdup(content);
 2052|  38.1k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 21, False: 38.1k]
  ------------------
 2053|     21|            goto error;
 2054|  38.1k|    }
 2055|       |
 2056|   140k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 140k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   140k|    return(cur);
 2059|       |
 2060|     21|error:
 2061|     21|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   140k|}
xmlNewReference:
 2209|  31.8k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  31.8k|    xmlNodePtr cur;
 2211|  31.8k|    xmlEntityPtr ent;
 2212|       |
 2213|  31.8k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 31.8k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  31.8k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  31.8k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 4, False: 31.8k]
  ------------------
 2221|      4|	return(NULL);
 2222|  31.8k|    memset(cur, 0, sizeof(xmlNode));
 2223|  31.8k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  31.8k|    cur->doc = (xmlDoc *)doc;
 2226|  31.8k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 31.8k]
  ------------------
 2227|      0|        int len;
 2228|      0|        name++;
 2229|      0|	len = xmlStrlen(name);
 2230|      0|	if (name[len - 1] == ';')
  ------------------
  |  Branch (2230:6): [True: 0, False: 0]
  ------------------
 2231|      0|	    cur->name = xmlStrndup(name, len - 1);
 2232|      0|	else
 2233|      0|	    cur->name = xmlStrndup(name, len);
 2234|      0|    } else
 2235|  31.8k|	cur->name = xmlStrdup(name);
 2236|  31.8k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 6, False: 31.8k]
  ------------------
 2237|      6|        goto error;
 2238|       |
 2239|  31.8k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  31.8k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 6.62k, False: 25.1k]
  ------------------
 2241|  6.62k|	cur->content = ent->content;
 2242|       |	/*
 2243|       |	 * The parent pointer in entity is a DTD pointer and thus is NOT
 2244|       |	 * updated.  Not sure if this is 100% correct.
 2245|       |	 *  -George
 2246|       |	 */
 2247|  6.62k|	cur->children = (xmlNodePtr) ent;
 2248|  6.62k|	cur->last = (xmlNodePtr) ent;
 2249|  6.62k|    }
 2250|       |
 2251|  31.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 31.8k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  31.8k|    return(cur);
 2254|       |
 2255|      6|error:
 2256|      6|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  31.8k|}
xmlNewDocText:
 2269|   140k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   140k|    xmlNodePtr cur;
 2271|       |
 2272|   140k|    cur = xmlNewText(content);
 2273|   140k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 140k, False: 74]
  ------------------
 2274|   140k|    return(cur);
 2275|   140k|}
xmlNewComment:
 2342|   215k|xmlNewComment(const xmlChar *content) {
 2343|   215k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   215k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   215k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 5, False: 215k]
  ------------------
 2350|      5|	return(NULL);
 2351|   215k|    memset(cur, 0, sizeof(xmlNode));
 2352|   215k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   215k|    cur->name = xmlStringComment;
 2355|   215k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 215k, False: 0]
  ------------------
 2356|   215k|	cur->content = xmlStrdup(content);
 2357|   215k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 4, False: 215k]
  ------------------
 2358|      4|            goto error;
 2359|   215k|    }
 2360|       |
 2361|   215k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 215k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   215k|    return(cur);
 2364|       |
 2365|      4|error:
 2366|      4|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   215k|}
xmlNewCDataBlock:
 2380|  72.9k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  72.9k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  72.9k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  72.9k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 2, False: 72.9k]
  ------------------
 2388|      2|	return(NULL);
 2389|  72.9k|    memset(cur, 0, sizeof(xmlNode));
 2390|  72.9k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  72.9k|    cur->doc = doc;
 2392|       |
 2393|  72.9k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 72.9k, False: 0]
  ------------------
 2394|  72.9k|	cur->content = xmlStrndup(content, len);
 2395|  72.9k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 2, False: 72.9k]
  ------------------
 2396|      2|            xmlFree(cur);
 2397|      2|            return(NULL);
 2398|      2|        }
 2399|  72.9k|    }
 2400|       |
 2401|  72.9k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 72.9k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  72.9k|    return(cur);
 2404|  72.9k|}
xmlNewDocComment:
 2415|   215k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   215k|    xmlNodePtr cur;
 2417|       |
 2418|   215k|    cur = xmlNewComment(content);
 2419|   215k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 215k, False: 9]
  ------------------
 2420|   215k|    return(cur);
 2421|   215k|}
xmlAddNextSibling:
 2893|  14.2k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  14.2k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 14.2k]
  |  Branch (2894:27): [True: 0, False: 14.2k]
  ------------------
 2895|  14.2k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 14.2k]
  |  Branch (2895:26): [True: 0, False: 14.2k]
  ------------------
 2896|  14.2k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 14.2k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  14.2k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 14.2k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  14.2k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  14.2k|}
xmlAddPrevSibling:
 2922|   214k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   214k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 214k]
  |  Branch (2923:27): [True: 0, False: 214k]
  ------------------
 2924|   214k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 214k]
  |  Branch (2924:26): [True: 0, False: 214k]
  ------------------
 2925|   214k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 214k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   214k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 214k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   214k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   214k|}
xmlGetLastChild:
 3141|  11.7k|xmlGetLastChild(const xmlNode *parent) {
 3142|  11.7k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3142:9): [True: 0, False: 11.7k]
  |  Branch (3142:29): [True: 0, False: 11.7k]
  ------------------
 3143|      0|	return(NULL);
 3144|      0|    }
 3145|  11.7k|    return(parent->last);
 3146|  11.7k|}
xmlFreeNodeList:
 3328|  1.56M|xmlFreeNodeList(xmlNode *cur) {
 3329|  1.56M|    xmlNodePtr next;
 3330|  1.56M|    xmlNodePtr parent;
 3331|  1.56M|    xmlDictPtr dict = NULL;
 3332|  1.56M|    size_t depth = 0;
 3333|       |
 3334|  1.56M|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 9.82k, False: 1.55M]
  ------------------
 3335|  1.55M|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 1.55M]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|  1.55M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 1.55M, False: 1.12k]
  ------------------
 3340|  13.8M|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 13.8M, Folded]
  ------------------
 3341|  18.1M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 4.34M, False: 13.8M]
  ------------------
 3342|  4.34M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 4.34M, False: 0]
  ------------------
 3343|  4.34M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 4.34M, False: 0]
  ------------------
 3344|  4.34M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 4.34M, False: 0]
  ------------------
 3345|  4.34M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 4.33M, False: 5.70k]
  ------------------
 3346|  4.33M|            cur = cur->children;
 3347|  4.33M|            depth += 1;
 3348|  4.33M|        }
 3349|       |
 3350|  13.8M|        next = cur->next;
 3351|  13.8M|        parent = cur->parent;
 3352|  13.8M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 13.8M]
  ------------------
 3353|  13.8M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 13.8M]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|  13.8M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 13.8M]
  ------------------
 3356|       |            /*
 3357|       |             * TODO: We should consider freeing the DTD if it isn't
 3358|       |             * referenced from doc->intSubset or doc->extSubset.
 3359|       |             */
 3360|      0|            cur->prev = NULL;
 3361|      0|            cur->next = NULL;
 3362|  13.8M|        } else {
 3363|  13.8M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 13.8M]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|  13.8M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 6.59M, False: 7.22M]
  ------------------
 3367|  7.22M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 21.6k, False: 7.20M]
  ------------------
 3368|  7.20M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 1.98M, False: 5.21M]
  ------------------
 3369|  8.60M|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 1.63M, False: 6.97M]
  ------------------
 3370|  1.63M|		xmlFreePropList(cur->properties);
 3371|  13.8M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 7.22M, False: 6.59M]
  ------------------
 3372|  7.22M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 7.20M, False: 21.6k]
  ------------------
 3373|  7.20M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 5.21M, False: 1.98M]
  ------------------
 3374|  5.21M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 5.18M, False: 34.9k]
  ------------------
 3375|  5.18M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 4.99M, False: 191k]
  ------------------
 3376|  4.99M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  4.99M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 4.69M, False: 293k]
  |  |  |  Branch (810:16): [True: 968k, False: 3.72M]
  |  |  ------------------
  |  |  811|  4.69M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 3.72M, False: 257]
  |  |  ------------------
  |  |  812|  4.99M|	    xmlFree((char *)(str));
  ------------------
 3377|  4.99M|	    }
 3378|  13.8M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 6.59M, False: 7.22M]
  ------------------
 3379|  7.22M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 21.6k, False: 7.20M]
  ------------------
 3380|  7.20M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 1.98M, False: 5.21M]
  ------------------
 3381|  8.60M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 2.29M, False: 6.30M]
  ------------------
 3382|  2.29M|		xmlFreeNsList(cur->nsDef);
 3383|       |
 3384|       |	    /*
 3385|       |	     * When a node is a text node or a comment, it uses a global static
 3386|       |	     * variable for the name of the node.
 3387|       |	     * Otherwise the node name might come from the document's
 3388|       |	     * dictionary
 3389|       |	     */
 3390|  13.8M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 13.6M, False: 195k]
  ------------------
 3391|  13.6M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 9.00M, False: 4.61M]
  ------------------
 3392|  9.00M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 8.93M, False: 76.2k]
  ------------------
 3393|  8.93M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  8.93M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 8.93M, False: 0]
  |  |  |  Branch (810:16): [True: 694k, False: 8.23M]
  |  |  ------------------
  |  |  811|  8.93M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 9.09k, False: 8.22M]
  |  |  ------------------
  |  |  812|  8.93M|	    xmlFree((char *)(str));
  ------------------
 3394|  13.8M|	    xmlFree(cur);
 3395|  13.8M|	}
 3396|       |
 3397|  13.8M|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 7.92M, False: 5.89M]
  ------------------
 3398|  7.92M|	    cur = next;
 3399|  7.92M|        } else {
 3400|  5.89M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 1.55M, False: 4.33M]
  |  Branch (3400:33): [True: 0, False: 4.33M]
  ------------------
 3401|  1.55M|                break;
 3402|  4.33M|            depth -= 1;
 3403|  4.33M|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|  4.33M|        }
 3406|  13.8M|    }
 3407|  1.55M|}
xmlFreeNode:
 3418|   191k|xmlFreeNode(xmlNode *cur) {
 3419|   191k|    xmlDictPtr dict = NULL;
 3420|       |
 3421|   191k|    if (cur == NULL) return;
  ------------------
  |  Branch (3421:9): [True: 217, False: 191k]
  ------------------
 3422|       |
 3423|       |    /* use xmlFreeDtd for DTD nodes */
 3424|   191k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3424:9): [True: 9.87k, False: 181k]
  ------------------
 3425|  9.87k|	xmlFreeDtd((xmlDtdPtr) cur);
 3426|  9.87k|	return;
 3427|  9.87k|    }
 3428|   181k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3428:9): [True: 0, False: 181k]
  ------------------
 3429|      0|	xmlFreeNs((xmlNsPtr) cur);
 3430|      0|        return;
 3431|      0|    }
 3432|   181k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 181k]
  ------------------
 3433|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3434|      0|	return;
 3435|      0|    }
 3436|   181k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3436:9): [True: 0, False: 181k]
  ------------------
 3437|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3438|      0|        return;
 3439|      0|    }
 3440|       |
 3441|   181k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3441:9): [True: 0, False: 181k]
  |  Branch (3441:35): [True: 0, False: 0]
  ------------------
 3442|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3443|       |
 3444|   181k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3444:9): [True: 181k, False: 178]
  ------------------
 3445|       |
 3446|   181k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3446:9): [True: 10.0k, False: 171k]
  ------------------
 3447|  10.0k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3447:2): [True: 9.32k, False: 687]
  ------------------
 3448|  9.32k|	xmlFreeNodeList(cur->children);
 3449|       |
 3450|   181k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3450:9): [True: 39.3k, False: 142k]
  ------------------
 3451|   142k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3451:9): [True: 1.65k, False: 140k]
  ------------------
 3452|   140k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3452:9): [True: 309, False: 140k]
  ------------------
 3453|  41.2k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3453:13): [True: 6.00k, False: 35.2k]
  ------------------
 3454|  6.00k|            xmlFreePropList(cur->properties);
 3455|  41.2k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3455:13): [True: 7.26k, False: 34.0k]
  ------------------
 3456|  7.26k|            xmlFreeNsList(cur->nsDef);
 3457|   140k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3457:16): [True: 136k, False: 3.79k]
  ------------------
 3458|   136k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3458:16): [True: 136k, False: 386]
  ------------------
 3459|   136k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3459:16): [True: 135k, False: 923]
  ------------------
 3460|   135k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   135k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 135k, False: 0]
  |  |  |  Branch (810:16): [True: 32.2k, False: 102k]
  |  |  ------------------
  |  |  811|   135k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 102k, False: 197]
  |  |  ------------------
  |  |  812|   135k|	    xmlFree((char *)(str));
  ------------------
 3461|   135k|    }
 3462|       |
 3463|       |    /*
 3464|       |     * When a node is a text node or a comment, it uses a global static
 3465|       |     * variable for the name of the node.
 3466|       |     * Otherwise the node name might come from the document's dictionary
 3467|       |     */
 3468|   181k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3468:9): [True: 180k, False: 930]
  ------------------
 3469|   180k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3469:9): [True: 161k, False: 19.2k]
  ------------------
 3470|   161k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3470:9): [True: 54.5k, False: 106k]
  ------------------
 3471|  54.5k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  54.5k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 54.5k, False: 0]
  |  |  |  Branch (810:16): [True: 26.6k, False: 27.9k]
  |  |  ------------------
  |  |  811|  54.5k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 232, False: 27.7k]
  |  |  ------------------
  |  |  812|  54.5k|	    xmlFree((char *)(str));
  ------------------
 3472|       |
 3473|   181k|    xmlFree(cur);
 3474|   181k|}
xmlUnlinkNode:
 3518|   329k|xmlUnlinkNode(xmlNode *cur) {
 3519|   329k|    if (cur == NULL)
  ------------------
  |  Branch (3519:9): [True: 0, False: 329k]
  ------------------
 3520|      0|	return;
 3521|       |
 3522|   329k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3522:9): [True: 0, False: 329k]
  ------------------
 3523|      0|        return;
 3524|       |
 3525|   329k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3525:9): [True: 18.7k, False: 311k]
  ------------------
 3526|  18.7k|	xmlDocPtr doc = cur->doc;
 3527|       |
 3528|  18.7k|	if (doc != NULL) {
  ------------------
  |  Branch (3528:6): [True: 18.7k, False: 0]
  ------------------
 3529|  18.7k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3529:10): [True: 17.1k, False: 1.58k]
  ------------------
 3530|  17.1k|		doc->intSubset = NULL;
 3531|  18.7k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3531:10): [True: 1.58k, False: 17.1k]
  ------------------
 3532|  1.58k|		doc->extSubset = NULL;
 3533|  18.7k|	}
 3534|  18.7k|    }
 3535|       |
 3536|   329k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3536:9): [True: 0, False: 329k]
  ------------------
 3537|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3538|       |
 3539|   329k|    xmlUnlinkNodeInternal(cur);
 3540|   329k|}
xmlCopyNamespace:
 3616|  4.00M|xmlCopyNamespace(xmlNs *cur) {
 3617|  4.00M|    xmlNsPtr ret;
 3618|       |
 3619|  4.00M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3619:9): [True: 0, False: 4.00M]
  ------------------
 3620|  4.00M|    switch (cur->type) {
 3621|  4.00M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  4.00M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3621:2): [True: 4.00M, False: 0]
  ------------------
 3622|  4.00M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3623|  4.00M|	    break;
 3624|      0|	default:
  ------------------
  |  Branch (3624:2): [True: 0, False: 4.00M]
  ------------------
 3625|      0|	    return(NULL);
 3626|  4.00M|    }
 3627|  4.00M|    return(ret);
 3628|  4.00M|}
xmlCopyNamespaceList:
 3638|  3.70M|xmlCopyNamespaceList(xmlNs *cur) {
 3639|  3.70M|    xmlNsPtr ret = NULL;
 3640|  3.70M|    xmlNsPtr p = NULL,q;
 3641|       |
 3642|  7.70M|    while (cur != NULL) {
  ------------------
  |  Branch (3642:12): [True: 4.00M, False: 3.70M]
  ------------------
 3643|  4.00M|        q = xmlCopyNamespace(cur);
 3644|  4.00M|        if (q == NULL) {
  ------------------
  |  Branch (3644:13): [True: 58, False: 4.00M]
  ------------------
 3645|     58|            xmlFreeNsList(ret);
 3646|     58|            return(NULL);
 3647|     58|        }
 3648|  4.00M|	if (p == NULL) {
  ------------------
  |  Branch (3648:6): [True: 3.70M, False: 299k]
  ------------------
 3649|  3.70M|	    ret = p = q;
 3650|  3.70M|	} else {
 3651|   299k|	    p->next = q;
 3652|   299k|	    p = q;
 3653|   299k|	}
 3654|  4.00M|	cur = cur->next;
 3655|  4.00M|    }
 3656|  3.70M|    return(ret);
 3657|  3.70M|}
xmlCopyProp:
 3792|  2.09M|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3793|       |	return xmlCopyPropInternal(NULL, target, cur);
 3794|  2.09M|}
xmlCopyPropList:
 3807|  1.80M|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3808|  1.80M|    xmlAttrPtr ret = NULL;
 3809|  1.80M|    xmlAttrPtr p = NULL,q;
 3810|       |
 3811|  1.80M|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3811:9): [True: 1.80M, False: 0]
  |  Branch (3811:29): [True: 0, False: 1.80M]
  ------------------
 3812|      0|        return(NULL);
 3813|  3.89M|    while (cur != NULL) {
  ------------------
  |  Branch (3813:12): [True: 2.09M, False: 1.79M]
  ------------------
 3814|  2.09M|        q = xmlCopyProp(target, cur);
 3815|  2.09M|	if (q == NULL) {
  ------------------
  |  Branch (3815:6): [True: 4.07k, False: 2.09M]
  ------------------
 3816|  4.07k|            xmlFreePropList(ret);
 3817|  4.07k|	    return(NULL);
 3818|  4.07k|        }
 3819|  2.09M|	if (p == NULL) {
  ------------------
  |  Branch (3819:6): [True: 1.79M, False: 294k]
  ------------------
 3820|  1.79M|	    ret = p = q;
 3821|  1.79M|	} else {
 3822|   294k|	    p->next = q;
 3823|   294k|	    q->prev = p;
 3824|   294k|	    p = q;
 3825|   294k|	}
 3826|  2.09M|	cur = cur->next;
 3827|  2.09M|    }
 3828|  1.79M|    return(ret);
 3829|  1.80M|}
xmlStaticCopyNode:
 3861|  19.2M|                  int extended) {
 3862|  19.2M|    xmlNodePtr ret;
 3863|       |
 3864|  19.2M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 19.2M]
  ------------------
 3865|  19.2M|    switch (node->type) {
 3866|  5.83M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 5.83M, False: 13.4M]
  ------------------
 3867|  5.97M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 139k, False: 19.1M]
  ------------------
 3868|  15.4M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 9.50M, False: 9.74M]
  ------------------
 3869|  15.4M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 19.2M]
  ------------------
 3870|  15.4M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 2.86k, False: 19.2M]
  ------------------
 3871|  15.6M|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 190k, False: 19.0M]
  ------------------
 3872|  15.7M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 56.1k, False: 19.1M]
  ------------------
 3873|  15.7M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 23.8k, False: 19.2M]
  ------------------
 3874|  19.2M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 3.49M, False: 15.7M]
  ------------------
 3875|  19.2M|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 19.2M]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 19.2M]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|  10.2k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 10.2k, False: 19.2M]
  ------------------
 3881|  10.2k|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 19.2M]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 19.2M]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 19.2M]
  ------------------
 3886|      0|            return(NULL);
 3887|  19.2M|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|  19.2M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|  19.2M|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 207, False: 19.2M]
  ------------------
 3894|    207|	return(NULL);
 3895|  19.2M|    memset(ret, 0, sizeof(xmlNode));
 3896|  19.2M|    ret->type = node->type;
 3897|       |
 3898|  19.2M|    ret->doc = doc;
 3899|  19.2M|    ret->parent = parent;
 3900|  19.2M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 5.83M, False: 13.4M]
  ------------------
 3901|  5.83M|	ret->name = xmlStringText;
 3902|  13.4M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 13.4M]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|  13.4M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 56.1k, False: 13.3M]
  ------------------
 3905|  56.1k|	ret->name = xmlStringComment;
 3906|  13.3M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 13.2M, False: 139k]
  ------------------
 3907|  13.2M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 13.2M, False: 4.37k]
  |  Branch (3907:30): [True: 11.9M, False: 1.29M]
  ------------------
 3908|  11.9M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|  1.29M|	else
 3910|  1.29M|	    ret->name = xmlStrdup(node->name);
 3911|  13.2M|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 56, False: 13.2M]
  ------------------
 3912|     56|            goto error;
 3913|  13.2M|    }
 3914|  19.2M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 9.73M, False: 9.50M]
  ------------------
 3915|  9.73M|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 6.02M, False: 3.70M]
  ------------------
 3916|  6.02M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 6.02M, False: 1.58k]
  ------------------
 3917|  6.02M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 6.02M, False: 0]
  ------------------
 3918|  6.02M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 6.02M, False: 0]
  ------------------
 3919|  6.02M|	ret->content = xmlStrdup(node->content);
 3920|  6.02M|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 88, False: 6.02M]
  ------------------
 3921|     88|            goto error;
 3922|  13.2M|    }else{
 3923|  13.2M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 9.50M, False: 3.71M]
  ------------------
 3924|  9.50M|        ret->line = node->line;
 3925|  13.2M|    }
 3926|       |
 3927|  19.2M|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 147, False: 19.2M]
  ------------------
 3928|    147|	goto out;
 3929|  19.2M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 9.50M, False: 9.73M]
  ------------------
 3930|  9.73M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 23.8k, False: 9.71M]
  |  Branch (3930:49): [True: 3.70M, False: 5.82M]
  ------------------
 3931|  3.70M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|  3.70M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 58, False: 3.70M]
  ------------------
 3933|     58|            goto error;
 3934|  3.70M|    }
 3935|       |
 3936|  19.2M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 9.50M, False: 9.73M]
  |  Branch (3936:45): [True: 605k, False: 8.89M]
  ------------------
 3937|   605k|        xmlNsPtr ns = NULL;
 3938|   605k|        int res;
 3939|       |
 3940|   605k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|   605k|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 1, False: 605k]
  ------------------
 3942|      1|            goto error;
 3943|   605k|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 861, False: 605k]
  ------------------
 3944|       |	    /*
 3945|       |	     * Humm, we are copying an element whose namespace is defined
 3946|       |	     * out of the new tree scope. Search it in the original tree
 3947|       |	     * and add it at the top of the new tree.
 3948|       |             *
 3949|       |             * TODO: Searching the original tree seems unnecessary. We
 3950|       |             * already have a namespace URI.
 3951|       |	     */
 3952|    861|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|    861|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 861]
  ------------------
 3954|      0|                goto error;
 3955|    861|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 861, False: 0]
  ------------------
 3956|    861|	        xmlNodePtr root = ret;
 3957|       |
 3958|  1.30k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 439, False: 861]
  ------------------
 3959|    861|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|    861|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|    861|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 2, False: 859]
  ------------------
 3964|      2|                goto error;
 3965|   605k|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|   605k|	    ret->ns = ns;
 3970|   605k|	}
 3971|   605k|    }
 3972|  19.2M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 9.50M, False: 9.73M]
  |  Branch (3972:45): [True: 1.80M, False: 7.70M]
  ------------------
 3973|  1.80M|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|  1.80M|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 4.07k, False: 1.79M]
  ------------------
 3975|  4.07k|            goto error;
 3976|  1.80M|    }
 3977|  19.2M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 2.86k, False: 19.2M]
  ------------------
 3978|  2.86k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 910, False: 1.95k]
  |  Branch (3978:23): [True: 256, False: 1.69k]
  ------------------
 3979|       |	    /*
 3980|       |	     * The copied node will go into a separate document, so
 3981|       |	     * to avoid dangling references to the ENTITY_DECL node
 3982|       |	     * we cannot keep the reference. Try to find it in the
 3983|       |	     * target document.
 3984|       |	     */
 3985|  1.16k|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|  1.69k|	} else {
 3987|  1.69k|            ret->children = node->children;
 3988|  1.69k|	}
 3989|  2.86k|	ret->last = ret->children;
 3990|  19.2M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 7.21M, False: 12.0M]
  |  Branch (3990:44): [True: 28.0k, False: 7.18M]
  ------------------
 3991|  28.0k|        xmlNodePtr cur, insert;
 3992|       |
 3993|  28.0k|        cur = node->children;
 3994|  28.0k|        insert = ret;
 3995|  15.8M|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 15.8M, False: 24.2k]
  ------------------
 3996|  15.8M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|  15.8M|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 3.77k, False: 15.8M]
  ------------------
 3998|  3.77k|                goto error;
 3999|       |
 4000|       |            /* Check for coalesced text nodes */
 4001|  15.8M|            if (insert->last != copy) {
  ------------------
  |  Branch (4001:17): [True: 15.8M, False: 0]
  ------------------
 4002|  15.8M|                if (insert->last == NULL) {
  ------------------
  |  Branch (4002:21): [True: 7.05M, False: 8.78M]
  ------------------
 4003|  7.05M|                    insert->children = copy;
 4004|  8.78M|                } else {
 4005|  8.78M|                    copy->prev = insert->last;
 4006|  8.78M|                    insert->last->next = copy;
 4007|  8.78M|                }
 4008|  15.8M|                insert->last = copy;
 4009|  15.8M|            }
 4010|       |
 4011|  15.8M|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4011:17): [True: 15.8M, False: 839]
  ------------------
 4012|  15.8M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 7.02M, False: 8.80M]
  ------------------
 4013|  7.02M|                cur = cur->children;
 4014|  7.02M|                insert = copy;
 4015|  7.02M|                continue;
 4016|  7.02M|            }
 4017|       |
 4018|  15.7M|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 15.7M, Folded]
  ------------------
 4019|  15.7M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 8.78M, False: 6.99M]
  ------------------
 4020|  8.78M|                    cur = cur->next;
 4021|  8.78M|                    break;
 4022|  8.78M|                }
 4023|       |
 4024|  6.99M|                cur = cur->parent;
 4025|  6.99M|                insert = insert->parent;
 4026|  6.99M|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 24.2k, False: 6.97M]
  ------------------
 4027|  24.2k|                    cur = NULL;
 4028|  24.2k|                    break;
 4029|  24.2k|                }
 4030|  6.99M|            }
 4031|  8.80M|        }
 4032|  28.0k|    }
 4033|       |
 4034|  19.2M|out:
 4035|  19.2M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 19.2M]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|  19.2M|    return(ret);
 4038|       |
 4039|  8.05k|error:
 4040|  8.05k|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|  19.2M|}
xmlStaticCopyNodeList:
 4055|  1.55M|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4056|  1.55M|    xmlNodePtr ret = NULL;
 4057|  1.55M|    xmlNodePtr p = NULL,q;
 4058|  1.55M|    xmlDtdPtr newSubset = NULL;
 4059|  1.55M|    int linkedSubset = 0;
 4060|       |
 4061|  3.11M|    while (node != NULL) {
  ------------------
  |  Branch (4061:12): [True: 1.55M, False: 1.55M]
  ------------------
 4062|  1.55M|        xmlNodePtr next = node->next;
 4063|       |
 4064|  1.55M|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4064:6): [True: 0, False: 1.55M]
  ------------------
 4065|      0|	    if (doc == NULL) {
  ------------------
  |  Branch (4065:10): [True: 0, False: 0]
  ------------------
 4066|      0|		node = next;
 4067|      0|		continue;
 4068|      0|	    }
 4069|      0|	    if ((doc->intSubset == NULL) && (newSubset == NULL)) {
  ------------------
  |  Branch (4069:10): [True: 0, False: 0]
  |  Branch (4069:38): [True: 0, False: 0]
  ------------------
 4070|      0|		q = (xmlNodePtr) xmlCopyDtd( (xmlDtdPtr) node );
 4071|      0|		if (q == NULL) goto error;
  ------------------
  |  Branch (4071:7): [True: 0, False: 0]
  ------------------
 4072|       |                /* Can't fail on DTD */
 4073|      0|		xmlSetTreeDoc(q, doc);
 4074|      0|		q->parent = parent;
 4075|      0|		newSubset = (xmlDtdPtr) q;
 4076|      0|	    } else {
 4077|       |                /*
 4078|       |                 * We don't allow multiple internal subsets in a document,
 4079|       |                 * so we move the DTD instead of creating a copy.
 4080|       |                 */
 4081|      0|                linkedSubset = 1;
 4082|      0|		q = (xmlNodePtr) doc->intSubset;
 4083|       |                /* Unlink */
 4084|      0|                if (q->prev == NULL) {
  ------------------
  |  Branch (4084:21): [True: 0, False: 0]
  ------------------
 4085|      0|                    if (q->parent != NULL)
  ------------------
  |  Branch (4085:25): [True: 0, False: 0]
  ------------------
 4086|      0|                        q->parent->children = q->next;
 4087|      0|                } else {
 4088|      0|                    q->prev->next = q->next;
 4089|      0|                }
 4090|      0|                if (q->next == NULL) {
  ------------------
  |  Branch (4090:21): [True: 0, False: 0]
  ------------------
 4091|      0|                    if (q->parent != NULL)
  ------------------
  |  Branch (4091:25): [True: 0, False: 0]
  ------------------
 4092|      0|                        q->parent->last = q->prev;
 4093|      0|                } else {
 4094|      0|                    q->next->prev = q->prev;
 4095|      0|                }
 4096|      0|                q->parent = parent;
 4097|      0|                q->next = NULL;
 4098|      0|                q->prev = NULL;
 4099|      0|	    }
 4100|      0|	} else
 4101|  1.55M|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4102|  1.55M|	if (q == NULL) goto error;
  ------------------
  |  Branch (4102:6): [True: 42, False: 1.55M]
  ------------------
 4103|  1.55M|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 1.55M, False: 5.00k]
  ------------------
 4104|  1.55M|	    q->prev = NULL;
 4105|  1.55M|	    ret = p = q;
 4106|  1.55M|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 5.00k, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|  5.00k|	    p->next = q;
 4109|  5.00k|	    q->prev = p;
 4110|  5.00k|	    p = q;
 4111|  5.00k|	}
 4112|  1.55M|	node = next;
 4113|  1.55M|    }
 4114|  1.55M|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 1.55M, False: 1.12k]
  |  Branch (4114:26): [True: 0, False: 1.55M]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|  1.55M|    return(ret);
 4117|     42|error:
 4118|     42|    xmlFreeNodeList(ret);
 4119|     42|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 42]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|     42|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 42]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|  1.55M|}
xmlCopyNode:
 4146|    150|xmlCopyNode(xmlNode *node, int extended) {
 4147|    150|    xmlNodePtr ret;
 4148|       |
 4149|    150|    ret = xmlStaticCopyNode(node, NULL, NULL, extended);
 4150|    150|    return(ret);
 4151|    150|}
xmlDocCopyNode:
 4170|   192k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4171|   192k|    xmlNodePtr ret;
 4172|       |
 4173|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4174|   192k|    return(ret);
 4175|   192k|}
xmlCopyDtd:
 4211|  10.2k|xmlCopyDtd(xmlDtd *dtd) {
 4212|  10.2k|    xmlDtdPtr ret;
 4213|  10.2k|    xmlNodePtr cur, p = NULL, q;
 4214|       |
 4215|  10.2k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (4215:9): [True: 0, False: 10.2k]
  ------------------
 4216|  10.2k|    ret = xmlNewDtd(NULL, dtd->name, dtd->ExternalID, dtd->SystemID);
 4217|  10.2k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4217:9): [True: 33, False: 10.2k]
  ------------------
 4218|  10.2k|    if (dtd->entities != NULL) {
  ------------------
  |  Branch (4218:9): [True: 2.02k, False: 8.20k]
  ------------------
 4219|  2.02k|        ret->entities = (void *) xmlCopyEntitiesTable(
 4220|  2.02k|	                    (xmlEntitiesTablePtr) dtd->entities);
 4221|  2.02k|        if (ret->entities == NULL)
  ------------------
  |  Branch (4221:13): [True: 48, False: 1.97k]
  ------------------
 4222|     48|            goto error;
 4223|  2.02k|    }
 4224|  10.1k|    if (dtd->notations != NULL) {
  ------------------
  |  Branch (4224:9): [True: 1.69k, False: 8.48k]
  ------------------
 4225|  1.69k|        ret->notations = (void *) xmlCopyNotationTable(
 4226|  1.69k|	                    (xmlNotationTablePtr) dtd->notations);
 4227|  1.69k|        if (ret->notations == NULL)
  ------------------
  |  Branch (4227:13): [True: 32, False: 1.66k]
  ------------------
 4228|     32|            goto error;
 4229|  1.69k|    }
 4230|  10.1k|    if (dtd->elements != NULL) {
  ------------------
  |  Branch (4230:9): [True: 6.02k, False: 4.12k]
  ------------------
 4231|  6.02k|        ret->elements = (void *) xmlCopyElementTable(
 4232|  6.02k|	                    (xmlElementTablePtr) dtd->elements);
 4233|  6.02k|        if (ret->elements == NULL)
  ------------------
  |  Branch (4233:13): [True: 129, False: 5.89k]
  ------------------
 4234|    129|            goto error;
 4235|  6.02k|    }
 4236|  10.0k|    if (dtd->attributes != NULL) {
  ------------------
  |  Branch (4236:9): [True: 3.79k, False: 6.22k]
  ------------------
 4237|  3.79k|        ret->attributes = (void *) xmlCopyAttributeTable(
 4238|  3.79k|	                    (xmlAttributeTablePtr) dtd->attributes);
 4239|  3.79k|        if (ret->attributes == NULL)
  ------------------
  |  Branch (4239:13): [True: 120, False: 3.67k]
  ------------------
 4240|    120|            goto error;
 4241|  3.79k|    }
 4242|  9.89k|    if (dtd->pentities != NULL) {
  ------------------
  |  Branch (4242:9): [True: 719, False: 9.18k]
  ------------------
 4243|    719|	ret->pentities = (void *) xmlCopyEntitiesTable(
 4244|    719|			    (xmlEntitiesTablePtr) dtd->pentities);
 4245|    719|        if (ret->pentities == NULL)
  ------------------
  |  Branch (4245:13): [True: 19, False: 700]
  ------------------
 4246|     19|            goto error;
 4247|    719|    }
 4248|       |
 4249|  9.88k|    cur = dtd->children;
 4250|  28.2k|    while (cur != NULL) {
  ------------------
  |  Branch (4250:12): [True: 18.4k, False: 9.87k]
  ------------------
 4251|  18.4k|	q = NULL;
 4252|       |
 4253|  18.4k|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (4253:6): [True: 4.09k, False: 14.3k]
  ------------------
 4254|  4.09k|	    xmlEntityPtr tmp = (xmlEntityPtr) cur;
 4255|  4.09k|	    switch (tmp->etype) {
  ------------------
  |  Branch (4255:14): [True: 4.09k, False: 0]
  ------------------
 4256|  1.30k|		case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (4256:3): [True: 1.30k, False: 2.78k]
  ------------------
 4257|  2.36k|		case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (4257:3): [True: 1.05k, False: 3.03k]
  ------------------
 4258|  3.16k|		case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (4258:3): [True: 798, False: 3.29k]
  ------------------
 4259|  3.16k|		    q = (xmlNodePtr) xmlGetEntityFromDtd(ret, tmp->name);
 4260|  3.16k|		    break;
 4261|    475|		case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4261:3): [True: 475, False: 3.61k]
  ------------------
 4262|    930|		case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4262:3): [True: 455, False: 3.63k]
  ------------------
 4263|    930|		    q = (xmlNodePtr)
 4264|    930|			xmlGetParameterEntityFromDtd(ret, tmp->name);
 4265|    930|		    break;
 4266|      0|		case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (4266:3): [True: 0, False: 4.09k]
  ------------------
 4267|      0|		    break;
 4268|  4.09k|	    }
 4269|  14.3k|	} else if (cur->type == XML_ELEMENT_DECL) {
  ------------------
  |  Branch (4269:13): [True: 5.25k, False: 9.07k]
  ------------------
 4270|  5.25k|	    xmlElementPtr tmp = (xmlElementPtr) cur;
 4271|  5.25k|	    q = (xmlNodePtr)
 4272|  5.25k|		xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
 4273|  9.07k|	} else if (cur->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (4273:13): [True: 8.75k, False: 315]
  ------------------
 4274|  8.75k|	    xmlAttributePtr tmp = (xmlAttributePtr) cur;
 4275|  8.75k|	    q = (xmlNodePtr)
 4276|  8.75k|		xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
 4277|  8.75k|	} else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4277:13): [True: 150, False: 165]
  ------------------
 4278|    150|	    q = xmlCopyNode(cur, 0);
 4279|    150|            if (q == NULL)
  ------------------
  |  Branch (4279:17): [True: 3, False: 147]
  ------------------
 4280|      3|                goto error;
 4281|    150|	}
 4282|       |
 4283|  18.4k|	if (q == NULL) {
  ------------------
  |  Branch (4283:6): [True: 165, False: 18.2k]
  ------------------
 4284|    165|	    cur = cur->next;
 4285|    165|	    continue;
 4286|    165|	}
 4287|       |
 4288|  18.2k|	if (p == NULL)
  ------------------
  |  Branch (4288:6): [True: 7.31k, False: 10.9k]
  ------------------
 4289|  7.31k|	    ret->children = q;
 4290|  10.9k|	else
 4291|  10.9k|	    p->next = q;
 4292|       |
 4293|  18.2k|	q->prev = p;
 4294|  18.2k|	q->parent = (xmlNodePtr) ret;
 4295|  18.2k|	q->next = NULL;
 4296|  18.2k|	ret->last = q;
 4297|  18.2k|	p = q;
 4298|  18.2k|	cur = cur->next;
 4299|  18.2k|    }
 4300|       |
 4301|  9.87k|    return(ret);
 4302|       |
 4303|    351|error:
 4304|    351|    xmlFreeDtd(ret);
 4305|       |    return(NULL);
 4306|  9.88k|}
xmlGetLineNo:
 4446|  32.4k|{
 4447|  32.4k|    return(xmlGetLineNoInternal(node, 0));
 4448|  32.4k|}
xmlDocGetRootElement:
 4674|   307k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   307k|    xmlNodePtr ret;
 4676|       |
 4677|   307k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 307k]
  ------------------
 4678|   307k|    ret = doc->children;
 4679|   581k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 581k, False: 1]
  ------------------
 4680|   581k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 307k, False: 273k]
  ------------------
 4681|   307k|	    return(ret);
 4682|   273k|        ret = ret->next;
 4683|   273k|    }
 4684|      1|    return(ret);
 4685|   307k|}
xmlNodeGetLang:
 4771|  6.78k|xmlNodeGetLang(const xmlNode *cur) {
 4772|  6.78k|    xmlChar *lang;
 4773|  6.78k|    int res;
 4774|       |
 4775|  6.78k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4775:9): [True: 0, False: 6.78k]
  |  Branch (4775:26): [True: 0, False: 6.78k]
  ------------------
 4776|      0|        return(NULL);
 4777|       |
 4778|  94.2k|    while (cur != NULL) {
  ------------------
  |  Branch (4778:12): [True: 87.9k, False: 6.30k]
  ------------------
 4779|  87.9k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  87.9k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  87.9k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4780|  87.9k|                                  &lang);
 4781|  87.9k|        if (res < 0)
  ------------------
  |  Branch (4781:13): [True: 1, False: 87.9k]
  ------------------
 4782|      1|            return(NULL);
 4783|  87.9k|	if (lang != NULL)
  ------------------
  |  Branch (4783:6): [True: 484, False: 87.4k]
  ------------------
 4784|    484|	    return(lang);
 4785|       |
 4786|  87.4k|	cur = cur->parent;
 4787|  87.4k|    }
 4788|       |
 4789|  6.30k|    return(NULL);
 4790|  6.78k|}
xmlNodeGetSpacePreserve:
 4837|    880|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4838|    880|    xmlChar *space;
 4839|    880|        int res;
 4840|       |
 4841|    880|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4841:9): [True: 0, False: 880]
  |  Branch (4841:26): [True: 880, False: 0]
  ------------------
 4842|    880|        return(-1);
 4843|       |
 4844|      0|    while (cur != NULL) {
  ------------------
  |  Branch (4844:12): [True: 0, False: 0]
  ------------------
 4845|      0|	res = xmlNodeGetAttrValue(cur, BAD_CAST "space", XML_XML_NAMESPACE,
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
              	res = xmlNodeGetAttrValue(cur, BAD_CAST "space", XML_XML_NAMESPACE,
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4846|      0|                                  &space);
 4847|      0|        if (res < 0)
  ------------------
  |  Branch (4847:13): [True: 0, False: 0]
  ------------------
 4848|      0|            return(-1);
 4849|      0|	if (space != NULL) {
  ------------------
  |  Branch (4849:6): [True: 0, False: 0]
  ------------------
 4850|      0|	    if (xmlStrEqual(space, BAD_CAST "preserve")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4850:10): [True: 0, False: 0]
  ------------------
 4851|      0|		xmlFree(space);
 4852|      0|		return(1);
 4853|      0|	    }
 4854|      0|	    if (xmlStrEqual(space, BAD_CAST "default")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4854:10): [True: 0, False: 0]
  ------------------
 4855|      0|		xmlFree(space);
 4856|      0|		return(0);
 4857|      0|	    }
 4858|      0|	    xmlFree(space);
 4859|      0|	}
 4860|       |
 4861|      0|	cur = cur->parent;
 4862|      0|    }
 4863|       |
 4864|      0|    return(-1);
 4865|      0|}
xmlNodeSetBase:
 4921|  2.93k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4922|  2.93k|    xmlNsPtr ns;
 4923|  2.93k|    xmlChar* fixed;
 4924|       |
 4925|  2.93k|    if (cur == NULL)
  ------------------
  |  Branch (4925:9): [True: 0, False: 2.93k]
  ------------------
 4926|      0|        return(-1);
 4927|  2.93k|    switch(cur->type) {
 4928|  2.93k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4928:9): [True: 2.93k, False: 0]
  ------------------
 4929|  2.93k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 2.93k]
  ------------------
 4930|  2.93k|	    break;
 4931|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4931:9): [True: 0, False: 2.93k]
  ------------------
 4932|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4932:9): [True: 0, False: 2.93k]
  ------------------
 4933|      0|	    xmlDocPtr doc = (xmlDocPtr) cur;
 4934|       |
 4935|      0|	    if (doc->URL != NULL)
  ------------------
  |  Branch (4935:10): [True: 0, False: 0]
  ------------------
 4936|      0|		xmlFree(doc->URL);
 4937|      0|	    if (uri == NULL) {
  ------------------
  |  Branch (4937:10): [True: 0, False: 0]
  ------------------
 4938|      0|		doc->URL = NULL;
 4939|      0|            } else {
 4940|      0|		doc->URL = xmlPathToURI(uri);
 4941|      0|                if (doc->URL == NULL)
  ------------------
  |  Branch (4941:21): [True: 0, False: 0]
  ------------------
 4942|      0|                    return(-1);
 4943|      0|            }
 4944|      0|	    return(0);
 4945|      0|	}
 4946|      0|        default:
  ------------------
  |  Branch (4946:9): [True: 0, False: 2.93k]
  ------------------
 4947|      0|	    return(-1);
 4948|  2.93k|    }
 4949|       |
 4950|  2.93k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  2.93k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4951|  2.93k|    if (ns == NULL)
  ------------------
  |  Branch (4951:9): [True: 5, False: 2.92k]
  ------------------
 4952|      5|	return(-1);
 4953|  2.92k|    fixed = xmlPathToURI(uri);
 4954|  2.92k|    if (fixed == NULL)
  ------------------
  |  Branch (4954:9): [True: 4, False: 2.92k]
  ------------------
 4955|      4|        return(-1);
 4956|  2.92k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  2.92k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4956:9): [True: 16, False: 2.90k]
  ------------------
 4957|     16|        xmlFree(fixed);
 4958|     16|        return(-1);
 4959|     16|    }
 4960|  2.90k|    xmlFree(fixed);
 4961|       |
 4962|  2.90k|    return(0);
 4963|  2.92k|}
xmlNodeGetBaseSafe:
 4982|   166k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4983|   166k|    xmlChar *ret = NULL;
 4984|   166k|    xmlChar *base, *newbase;
 4985|   166k|    int res;
 4986|       |
 4987|   166k|    if (baseOut == NULL)
  ------------------
  |  Branch (4987:9): [True: 0, False: 166k]
  ------------------
 4988|      0|        return(1);
 4989|   166k|    *baseOut = NULL;
 4990|   166k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4990:9): [True: 0, False: 166k]
  |  Branch (4990:26): [True: 0, False: 0]
  ------------------
 4991|      0|        return(1);
 4992|   166k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4992:9): [True: 166k, False: 0]
  |  Branch (4992:26): [True: 0, False: 166k]
  ------------------
 4993|      0|        return(1);
 4994|   166k|    if (doc == NULL)
  ------------------
  |  Branch (4994:9): [True: 45.4k, False: 120k]
  ------------------
 4995|  45.4k|        doc = cur->doc;
 4996|       |
 4997|   166k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4997:9): [True: 166k, False: 0]
  |  Branch (4997:26): [True: 0, False: 166k]
  ------------------
 4998|      0|        cur = doc->children;
 4999|      0|	while ((cur != NULL) && (cur->name != NULL)) {
  ------------------
  |  Branch (4999:9): [True: 0, False: 0]
  |  Branch (4999:26): [True: 0, False: 0]
  ------------------
 5000|      0|	    if (cur->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5000:10): [True: 0, False: 0]
  ------------------
 5001|      0|	        cur = cur->next;
 5002|      0|		continue;
 5003|      0|	    }
 5004|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5004:10): [True: 0, False: 0]
  ------------------
 5005|      0|	        cur = cur->children;
 5006|      0|		continue;
 5007|      0|	    }
 5008|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "head")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5008:10): [True: 0, False: 0]
  ------------------
 5009|      0|	        cur = cur->children;
 5010|      0|		continue;
 5011|      0|	    }
 5012|      0|	    if (!xmlStrcasecmp(cur->name, BAD_CAST "base")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5012:10): [True: 0, False: 0]
  ------------------
 5013|      0|                if (xmlNodeGetAttrValue(cur, BAD_CAST "href", NULL, &ret) < 0)
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5013:21): [True: 0, False: 0]
  ------------------
 5014|      0|                    return(-1);
 5015|      0|                if (ret == NULL)
  ------------------
  |  Branch (5015:21): [True: 0, False: 0]
  ------------------
 5016|      0|                    return(1);
 5017|      0|                goto found;
 5018|      0|	    }
 5019|      0|	    cur = cur->next;
 5020|      0|	}
 5021|      0|	return(0);
 5022|      0|    }
 5023|       |
 5024|  6.97M|    while (cur != NULL) {
  ------------------
  |  Branch (5024:12): [True: 6.82M, False: 153k]
  ------------------
 5025|  6.82M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5025:6): [True: 287, False: 6.82M]
  ------------------
 5026|    287|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5027|       |
 5028|    287|            if (ent->URI == NULL)
  ------------------
  |  Branch (5028:17): [True: 199, False: 88]
  ------------------
 5029|    199|                break;
 5030|     88|            xmlFree(ret);
 5031|     88|	    ret = xmlStrdup(ent->URI);
 5032|     88|            if (ret == NULL)
  ------------------
  |  Branch (5032:17): [True: 1, False: 87]
  ------------------
 5033|      1|                return(-1);
 5034|     87|            goto found;
 5035|     88|	}
 5036|  6.82M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5036:6): [True: 6.66M, False: 154k]
  ------------------
 5037|  6.66M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  6.66M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  6.66M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5037:10): [True: 151, False: 6.66M]
  ------------------
 5038|  6.66M|                                    &base) < 0) {
 5039|    151|                xmlFree(ret);
 5040|    151|                return(-1);
 5041|    151|            }
 5042|  6.66M|	    if (base != NULL) {
  ------------------
  |  Branch (5042:10): [True: 1.34M, False: 5.31M]
  ------------------
 5043|  1.34M|		if (ret != NULL) {
  ------------------
  |  Branch (5043:7): [True: 1.29M, False: 48.5k]
  ------------------
 5044|  1.29M|		    res = xmlBuildURISafe(ret, base, &newbase);
 5045|  1.29M|                    xmlFree(ret);
 5046|  1.29M|                    xmlFree(base);
 5047|  1.29M|                    if (res != 0)
  ------------------
  |  Branch (5047:25): [True: 9.12k, False: 1.28M]
  ------------------
 5048|  9.12k|                        return(res);
 5049|  1.28M|		    ret = newbase;
 5050|  1.28M|		} else {
 5051|  48.5k|		    ret = base;
 5052|  48.5k|		}
 5053|  1.33M|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|  1.33M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 870, False: 1.33M]
  ------------------
 5054|  1.33M|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|  1.33M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5054:7): [True: 504, False: 1.33M]
  ------------------
 5055|  1.33M|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|  1.33M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5055:7): [True: 1.71k, False: 1.33M]
  ------------------
 5056|  3.09k|                    goto found;
 5057|  1.33M|	    }
 5058|  6.66M|	}
 5059|  6.80M|	cur = cur->parent;
 5060|  6.80M|    }
 5061|       |
 5062|   153k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5062:9): [True: 153k, False: 0]
  |  Branch (5062:26): [True: 99.8k, False: 53.7k]
  ------------------
 5063|  99.8k|	if (ret == NULL) {
  ------------------
  |  Branch (5063:6): [True: 98.4k, False: 1.47k]
  ------------------
 5064|  98.4k|	    ret = xmlStrdup(doc->URL);
 5065|  98.4k|            if (ret == NULL)
  ------------------
  |  Branch (5065:17): [True: 24, False: 98.3k]
  ------------------
 5066|     24|                return(-1);
 5067|  98.4k|        } else {
 5068|  1.47k|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5069|  1.47k|            xmlFree(ret);
 5070|  1.47k|            if (res != 0)
  ------------------
  |  Branch (5070:17): [True: 476, False: 997]
  ------------------
 5071|    476|                return(res);
 5072|    997|            ret = newbase;
 5073|    997|        }
 5074|  99.8k|    }
 5075|       |
 5076|   156k|found:
 5077|   156k|    *baseOut = ret;
 5078|   156k|    return(0);
 5079|   153k|}
xmlBufGetNodeContent:
 5205|   152k|{
 5206|   152k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5206:9): [True: 0, False: 152k]
  |  Branch (5206:26): [True: 0, False: 152k]
  ------------------
 5207|      0|        return(-1);
 5208|       |
 5209|   152k|    switch (cur->type) {
 5210|  84.0k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 84.0k, False: 67.9k]
  ------------------
 5211|  84.0k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5211:9): [True: 0, False: 152k]
  ------------------
 5212|  84.0k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5212:9): [True: 0, False: 152k]
  ------------------
 5213|   150k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5213:9): [True: 65.9k, False: 86.0k]
  ------------------
 5214|   150k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5214:9): [True: 0, False: 152k]
  ------------------
 5215|   150k|            xmlBufGetChildContent(buf, cur, 0);
 5216|   150k|            break;
 5217|  1.20k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5217:9): [True: 1.20k, False: 150k]
  ------------------
 5218|  1.20k|            xmlBufGetChildContent(buf, cur, 1);
 5219|  1.20k|            break;
 5220|       |
 5221|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5221:9): [True: 0, False: 152k]
  ------------------
 5222|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5222:9): [True: 0, False: 152k]
  ------------------
 5223|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5223:9): [True: 0, False: 152k]
  ------------------
 5224|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5224:9): [True: 0, False: 152k]
  ------------------
 5225|      0|	    xmlBufCat(buf, cur->content);
 5226|      0|            break;
 5227|       |
 5228|    741|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5228:9): [True: 741, False: 151k]
  ------------------
 5229|    741|            xmlBufGetEntityRefContent(buf, cur, 0);
 5230|    741|            break;
 5231|       |
 5232|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5232:9): [True: 0, False: 152k]
  ------------------
 5233|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5234|      0|	    break;
 5235|       |
 5236|      0|        default:
  ------------------
  |  Branch (5236:9): [True: 0, False: 152k]
  ------------------
 5237|      0|            break;
 5238|   152k|    }
 5239|       |
 5240|   152k|    return(0);
 5241|   152k|}
xmlNodeGetContent:
 5258|  1.83M|{
 5259|  1.83M|    xmlBufPtr buf;
 5260|  1.83M|    xmlChar *ret;
 5261|       |
 5262|  1.83M|    if (cur == NULL)
  ------------------
  |  Branch (5262:9): [True: 0, False: 1.83M]
  ------------------
 5263|      0|        return (NULL);
 5264|       |
 5265|  1.83M|    switch (cur->type) {
 5266|  84.1k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5266:9): [True: 84.1k, False: 1.74M]
  ------------------
 5267|  84.1k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 0, False: 1.83M]
  ------------------
 5268|  84.1k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5268:9): [True: 0, False: 1.83M]
  ------------------
 5269|  84.1k|            break;
 5270|       |
 5271|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5271:9): [True: 0, False: 1.83M]
  ------------------
 5272|   325k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5272:9): [True: 325k, False: 1.50M]
  ------------------
 5273|  1.71M|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5273:9): [True: 1.39M, False: 442k]
  ------------------
 5274|  1.71M|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5274:9): [True: 0, False: 1.83M]
  ------------------
 5275|  1.71M|            xmlNodePtr children = cur->children;
 5276|       |
 5277|  1.71M|            if (children == NULL)
  ------------------
  |  Branch (5277:17): [True: 783k, False: 932k]
  ------------------
 5278|   783k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   783k|#define BAD_CAST (xmlChar *)
  ------------------
 5279|       |
 5280|       |            /* Optimization for single text children */
 5281|   932k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5281:18): [True: 902k, False: 30.2k]
  ------------------
 5282|  30.2k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5282:18): [True: 1.57k, False: 28.6k]
  ------------------
 5283|   904k|                (children->next == NULL)) {
  ------------------
  |  Branch (5283:17): [True: 866k, False: 37.6k]
  ------------------
 5284|   866k|                if (children->content == NULL)
  ------------------
  |  Branch (5284:21): [True: 0, False: 866k]
  ------------------
 5285|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5286|   866k|                return(xmlStrdup(children->content));
 5287|   866k|            }
 5288|       |
 5289|  66.3k|            break;
 5290|   932k|        }
 5291|       |
 5292|  66.3k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5292:9): [True: 807, False: 1.83M]
  ------------------
 5293|  27.1k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5293:9): [True: 26.3k, False: 1.80M]
  ------------------
 5294|  31.1k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5294:9): [True: 3.94k, False: 1.82M]
  ------------------
 5295|  31.5k|        case XML_PI_NODE:
  ------------------
  |  Branch (5295:9): [True: 407, False: 1.83M]
  ------------------
 5296|  31.5k|            if (cur->content != NULL)
  ------------------
  |  Branch (5296:17): [True: 31.1k, False: 407]
  ------------------
 5297|  31.1k|                return(xmlStrdup(cur->content));
 5298|    407|            else
 5299|    407|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    407|#define BAD_CAST (xmlChar *)
  ------------------
 5300|       |
 5301|  1.39k|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5301:9): [True: 1.39k, False: 1.83M]
  ------------------
 5302|  1.39k|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5303|       |
 5304|      0|        default:
  ------------------
  |  Branch (5304:9): [True: 0, False: 1.83M]
  ------------------
 5305|      0|            return(NULL);
 5306|  1.83M|    }
 5307|       |
 5308|   150k|    buf = xmlBufCreate(50);
 5309|   150k|    if (buf == NULL)
  ------------------
  |  Branch (5309:9): [True: 71, False: 150k]
  ------------------
 5310|     71|        return (NULL);
 5311|   150k|    xmlBufGetNodeContent(buf, cur);
 5312|   150k|    ret = xmlBufDetach(buf);
 5313|   150k|    xmlBufFree(buf);
 5314|       |
 5315|   150k|    return(ret);
 5316|   150k|}
xmlNodeAddContentLen:
 5419|     83|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5420|     83|    if (cur == NULL)
  ------------------
  |  Branch (5420:9): [True: 0, False: 83]
  ------------------
 5421|      0|	return(1);
 5422|     83|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5422:9): [True: 0, False: 83]
  |  Branch (5422:30): [True: 20, False: 63]
  ------------------
 5423|     20|        return(0);
 5424|       |
 5425|     63|    switch (cur->type) {
 5426|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5426:9): [True: 0, False: 63]
  ------------------
 5427|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5427:9): [True: 0, False: 63]
  ------------------
 5428|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5428:9): [True: 0, False: 63]
  ------------------
 5429|      0|	    xmlNodePtr newNode, tmp;
 5430|       |
 5431|      0|	    newNode = xmlNewDocTextLen(cur->doc, content, len);
 5432|      0|	    if (newNode == NULL)
  ------------------
  |  Branch (5432:10): [True: 0, False: 0]
  ------------------
 5433|      0|                return(-1);
 5434|      0|            tmp = xmlAddChild(cur, newNode);
 5435|      0|            if (tmp == NULL) {
  ------------------
  |  Branch (5435:17): [True: 0, False: 0]
  ------------------
 5436|      0|                xmlFreeNode(newNode);
 5437|      0|                return(-1);
 5438|      0|            }
 5439|      0|	    break;
 5440|      0|	}
 5441|      0|	    break;
 5442|     63|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5442:9): [True: 63, False: 0]
  ------------------
 5443|     63|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5443:9): [True: 0, False: 63]
  ------------------
 5444|     63|        case XML_PI_NODE:
  ------------------
  |  Branch (5444:9): [True: 0, False: 63]
  ------------------
 5445|     63|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5445:9): [True: 0, False: 63]
  ------------------
 5446|     63|            return(xmlTextAddContent(cur, content, len));
 5447|      0|        default:
  ------------------
  |  Branch (5447:9): [True: 0, False: 63]
  ------------------
 5448|      0|            break;
 5449|     63|    }
 5450|       |
 5451|      0|    return(0);
 5452|     63|}
xmlGetNsListSafe:
 5518|  75.5k|{
 5519|  75.5k|    xmlNsPtr cur;
 5520|  75.5k|    xmlNsPtr *namespaces = NULL;
 5521|  75.5k|    int nbns = 0;
 5522|  75.5k|    int maxns = 0;
 5523|  75.5k|    int i;
 5524|       |
 5525|  75.5k|    if (out == NULL)
  ------------------
  |  Branch (5525:9): [True: 0, False: 75.5k]
  ------------------
 5526|      0|        return(1);
 5527|  75.5k|    *out = NULL;
 5528|  75.5k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5528:9): [True: 0, False: 75.5k]
  |  Branch (5528:27): [True: 0, False: 75.5k]
  ------------------
 5529|      0|        return(1);
 5530|       |
 5531|   334k|    while (node != NULL) {
  ------------------
  |  Branch (5531:12): [True: 259k, False: 75.5k]
  ------------------
 5532|   259k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5532:13): [True: 183k, False: 75.5k]
  ------------------
 5533|   183k|            cur = node->nsDef;
 5534|   300k|            while (cur != NULL) {
  ------------------
  |  Branch (5534:20): [True: 116k, False: 183k]
  ------------------
 5535|   157k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5535:29): [True: 42.1k, False: 115k]
  ------------------
 5536|  42.1k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5536:25): [True: 203, False: 41.9k]
  ------------------
 5537|  41.9k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5537:25): [True: 273, False: 41.6k]
  ------------------
 5538|    476|                        break;
 5539|  42.1k|                }
 5540|   116k|                if (i >= nbns) {
  ------------------
  |  Branch (5540:21): [True: 115k, False: 476]
  ------------------
 5541|   115k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5541:25): [True: 74.8k, False: 40.8k]
  ------------------
 5542|  74.8k|                        xmlNsPtr *tmp;
 5543|  74.8k|                        int newSize;
 5544|       |
 5545|  74.8k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5546|  74.8k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  74.8k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5547|  74.8k|                        if (newSize < 0) {
  ------------------
  |  Branch (5547:29): [True: 0, False: 74.8k]
  ------------------
 5548|      0|                            xmlFree(namespaces);
 5549|      0|                            return(-1);
 5550|      0|                        }
 5551|  74.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5552|  74.8k|                        if (newSize < 2)
  ------------------
  |  Branch (5552:29): [True: 74.4k, False: 395]
  ------------------
 5553|  74.4k|                            newSize = 2;
 5554|  74.8k|#endif
 5555|  74.8k|                        tmp = xmlRealloc(namespaces,
 5556|  74.8k|                                         (newSize + 1) * sizeof(tmp[0]));
 5557|  74.8k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5557:29): [True: 4, False: 74.8k]
  ------------------
 5558|      4|                            xmlFree(namespaces);
 5559|      4|                            return(-1);
 5560|      4|                        }
 5561|  74.8k|                        namespaces = tmp;
 5562|  74.8k|                        maxns = newSize;
 5563|  74.8k|                    }
 5564|   115k|                    namespaces[nbns++] = cur;
 5565|   115k|                    namespaces[nbns] = NULL;
 5566|   115k|                }
 5567|       |
 5568|   116k|                cur = cur->next;
 5569|   116k|            }
 5570|   183k|        }
 5571|   259k|        node = node->parent;
 5572|   259k|    }
 5573|       |
 5574|  75.5k|    *out = namespaces;
 5575|  75.5k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5575:12): [True: 1.05k, False: 74.4k]
  ------------------
 5576|  75.5k|}
xmlSearchNsSafe:
 5655|  2.49M|                xmlNs **out) {
 5656|  2.49M|    xmlNsPtr cur;
 5657|  2.49M|    xmlDocPtr doc;
 5658|  2.49M|    xmlNodePtr orig = node;
 5659|  2.49M|    xmlNodePtr parent;
 5660|       |
 5661|  2.49M|    if (out == NULL)
  ------------------
  |  Branch (5661:9): [True: 0, False: 2.49M]
  ------------------
 5662|      0|        return(1);
 5663|  2.49M|    *out = NULL;
 5664|  2.49M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5664:9): [True: 0, False: 2.49M]
  |  Branch (5664:27): [True: 0, False: 2.49M]
  ------------------
 5665|      0|        return(1);
 5666|       |
 5667|  2.49M|    doc = node->doc;
 5668|       |
 5669|  2.49M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  2.49M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.98M, False: 512k]
  |  |  |  Branch (100:43): [True: 1.79M, False: 187k]
  |  |  ------------------
  |  |  101|  2.49M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 1.32M, False: 465k]
  |  |  |  Branch (101:22): [True: 1.32M, False: 1.38k]
  |  |  |  Branch (101:41): [True: 1.32M, False: 2.12k]
  |  |  ------------------
  ------------------
  |  Branch (5669:9): [True: 2.49M, False: 282]
  ------------------
 5670|  1.32M|        cur = xmlTreeEnsureXMLDecl(doc);
 5671|  1.32M|        if (cur == NULL)
  ------------------
  |  Branch (5671:13): [True: 36, False: 1.32M]
  ------------------
 5672|     36|            return(-1);
 5673|  1.32M|        *out = cur;
 5674|  1.32M|        return(0);
 5675|  1.32M|    }
 5676|       |
 5677|  1.17M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5677:12): [True: 16.0k, False: 1.15M]
  ------------------
 5678|  16.0k|        node = node->parent;
 5679|  16.0k|        if (node == NULL)
  ------------------
  |  Branch (5679:13): [True: 14.0k, False: 2.01k]
  ------------------
 5680|  14.0k|            return(0);
 5681|  16.0k|    }
 5682|       |
 5683|  1.15M|    parent = node;
 5684|       |
 5685|  99.4M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5685:12): [True: 99.3M, False: 46.0k]
  |  Branch (5685:30): [True: 98.9M, False: 427k]
  ------------------
 5686|  98.9M|        cur = node->nsDef;
 5687|   101M|        while (cur != NULL) {
  ------------------
  |  Branch (5687:16): [True: 2.93M, False: 98.3M]
  ------------------
 5688|  2.93M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5688:17): [True: 676k, False: 2.25M]
  ------------------
 5689|   676k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5689:17): [True: 617k, False: 59.5k]
  ------------------
 5690|   617k|                *out = cur;
 5691|   617k|                return(0);
 5692|   617k|            }
 5693|  2.31M|            cur = cur->next;
 5694|  2.31M|        }
 5695|  98.3M|        if (orig != node) {
  ------------------
  |  Branch (5695:13): [True: 97.3M, False: 983k]
  ------------------
 5696|  97.3M|            cur = node->ns;
 5697|  97.3M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5697:17): [True: 998k, False: 96.3M]
  ------------------
 5698|   998k|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5698:17): [True: 64.2k, False: 934k]
  ------------------
 5699|  64.2k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5699:17): [True: 64.2k, False: 0]
  ------------------
 5700|  64.2k|                *out = cur;
 5701|  64.2k|                return(0);
 5702|  64.2k|            }
 5703|  97.3M|        }
 5704|       |
 5705|  98.2M|	node = node->parent;
 5706|  98.2M|    }
 5707|       |
 5708|       |    /*
 5709|       |     * The XML-1.0 namespace is normally held on the document
 5710|       |     * element. In this case exceptionally create it on the
 5711|       |     * node element.
 5712|       |     */
 5713|   473k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|    263|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 263, False: 0]
  |  |  |  Branch (100:43): [True: 263, False: 0]
  |  |  ------------------
  |  |  101|    263|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 263, False: 0]
  |  |  |  Branch (101:22): [True: 263, False: 0]
  |  |  |  Branch (101:41): [True: 263, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5713:9): [True: 263, False: 473k]
  ------------------
 5714|    263|        cur = xmlNewXmlNs();
 5715|    263|        if (cur == NULL)
  ------------------
  |  Branch (5715:13): [True: 1, False: 262]
  ------------------
 5716|      1|            return(-1);
 5717|    262|        cur->next = parent->nsDef;
 5718|    262|        parent->nsDef = cur;
 5719|    262|        *out = cur;
 5720|    262|    }
 5721|       |
 5722|   473k|    return(0);
 5723|   473k|}
xmlSearchNsByHrefSafe:
 5802|  4.52k|                      xmlNs **out) {
 5803|  4.52k|    xmlNsPtr cur;
 5804|  4.52k|    xmlDocPtr doc;
 5805|  4.52k|    xmlNodePtr orig = node;
 5806|  4.52k|    xmlNodePtr parent;
 5807|  4.52k|    int is_attr;
 5808|       |
 5809|  4.52k|    if (out == NULL)
  ------------------
  |  Branch (5809:9): [True: 0, False: 4.52k]
  ------------------
 5810|      0|        return(1);
 5811|  4.52k|    *out = NULL;
 5812|  4.52k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5812:9): [True: 0, False: 4.52k]
  |  Branch (5812:27): [True: 0, False: 4.52k]
  ------------------
 5813|      0|        return(1);
 5814|       |
 5815|  4.52k|    doc = node->doc;
 5816|       |
 5817|  4.52k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  4.52k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5817:9): [True: 4.52k, False: 0]
  |  Branch (5817:26): [True: 2.93k, False: 1.59k]
  ------------------
 5818|  2.93k|        cur = xmlTreeEnsureXMLDecl(doc);
 5819|  2.93k|        if (cur == NULL)
  ------------------
  |  Branch (5819:13): [True: 5, False: 2.92k]
  ------------------
 5820|      5|            return(-1);
 5821|  2.92k|        *out = cur;
 5822|  2.92k|        return(0);
 5823|  2.93k|    }
 5824|       |
 5825|  1.59k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5826|       |
 5827|  1.59k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5827:12): [True: 0, False: 1.59k]
  ------------------
 5828|      0|        node = node->parent;
 5829|      0|        if (node == NULL)
  ------------------
  |  Branch (5829:13): [True: 0, False: 0]
  ------------------
 5830|      0|            return(0);
 5831|      0|    }
 5832|       |
 5833|  1.59k|    parent = node;
 5834|       |
 5835|  16.0k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5835:12): [True: 15.3k, False: 686]
  |  Branch (5835:30): [True: 15.3k, False: 0]
  ------------------
 5836|  15.3k|        cur = node->nsDef;
 5837|  27.4k|        while (cur != NULL) {
  ------------------
  |  Branch (5837:16): [True: 12.7k, False: 14.6k]
  ------------------
 5838|  12.7k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5838:17): [True: 3.66k, False: 9.08k]
  ------------------
 5839|  3.66k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5839:22): [True: 3.66k, False: 0]
  |  Branch (5839:36): [True: 0, False: 0]
  ------------------
 5840|  3.66k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5840:21): [True: 650, False: 3.01k]
  ------------------
 5841|    650|                    *out = cur;
 5842|    650|                    return(0);
 5843|    650|                }
 5844|  3.66k|            }
 5845|  12.1k|            cur = cur->next;
 5846|  12.1k|        }
 5847|  14.6k|        if (orig != node) {
  ------------------
  |  Branch (5847:13): [True: 13.1k, False: 1.48k]
  ------------------
 5848|  13.1k|            cur = node->ns;
 5849|  13.1k|            if (cur != NULL) {
  ------------------
  |  Branch (5849:17): [True: 11.1k, False: 2.07k]
  ------------------
 5850|  11.1k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5850:21): [True: 3.99k, False: 7.12k]
  ------------------
 5851|  3.99k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5851:26): [True: 3.99k, False: 0]
  |  Branch (5851:40): [True: 0, False: 0]
  ------------------
 5852|  3.99k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5852:25): [True: 257, False: 3.73k]
  ------------------
 5853|  3.99k|                                      cur->prefix) == 1)) {
 5854|    257|                        *out = cur;
 5855|    257|                        return(0);
 5856|    257|                    }
 5857|  3.99k|                }
 5858|  11.1k|            }
 5859|  13.1k|        }
 5860|       |
 5861|  14.4k|        node = node->parent;
 5862|  14.4k|    }
 5863|       |
 5864|       |    /*
 5865|       |     * The XML-1.0 namespace is normally held on the document
 5866|       |     * element. In this case exceptionally create it on the
 5867|       |     * node element.
 5868|       |     */
 5869|    686|    if ((doc == NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5869:9): [True: 0, False: 686]
  |  Branch (5869:26): [True: 0, False: 0]
  ------------------
 5870|      0|        cur = xmlNewXmlNs();
 5871|      0|        if (cur == NULL)
  ------------------
  |  Branch (5871:13): [True: 0, False: 0]
  ------------------
 5872|      0|            return(-1);
 5873|      0|        cur->next = parent->nsDef;
 5874|      0|        parent->nsDef = cur;
 5875|      0|        *out = cur;
 5876|      0|    }
 5877|       |
 5878|    686|    return(0);
 5879|    686|}
xmlNodeGetAttrValue:
 6356|  7.13M|                    const xmlChar *nsUri, xmlChar **out) {
 6357|  7.13M|    xmlAttrPtr prop;
 6358|       |
 6359|  7.13M|    if (out == NULL)
  ------------------
  |  Branch (6359:9): [True: 0, False: 7.13M]
  ------------------
 6360|      0|        return(1);
 6361|  7.13M|    *out = NULL;
 6362|       |
 6363|  7.13M|    prop = xmlGetPropNodeInternal(node, name, nsUri, 0);
 6364|  7.13M|    if (prop == NULL)
  ------------------
  |  Branch (6364:9): [True: 5.74M, False: 1.38M]
  ------------------
 6365|  5.74M|	return(1);
 6366|       |
 6367|  1.38M|    *out = xmlGetPropNodeValueInternal(prop);
 6368|  1.38M|    if (*out == NULL)
  ------------------
  |  Branch (6368:9): [True: 226, False: 1.38M]
  ------------------
 6369|    226|        return(-1);
 6370|  1.38M|    return(0);
 6371|  1.38M|}
xmlUnsetProp:
 6473|    201|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6474|    201|    xmlAttrPtr prop;
 6475|       |
 6476|    201|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6477|    201|    if (prop == NULL)
  ------------------
  |  Branch (6477:9): [True: 57, False: 144]
  ------------------
 6478|     57|	return(-1);
 6479|    144|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6480|    144|    xmlFreeProp(prop);
 6481|    144|    return(0);
 6482|    201|}
xmlUnsetNsProp:
 6493|  94.8k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6494|  94.8k|    xmlAttrPtr prop;
 6495|       |
 6496|  94.8k|    prop = xmlGetPropNodeInternal(node, name,
 6497|  94.8k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6497:35): [True: 94.8k, False: 0]
  ------------------
 6498|  94.8k|    if (prop == NULL)
  ------------------
  |  Branch (6498:9): [True: 93.7k, False: 1.13k]
  ------------------
 6499|  93.7k|	return(-1);
 6500|  1.13k|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6501|  1.13k|    xmlFreeProp(prop);
 6502|  1.13k|    return(0);
 6503|  94.8k|}
xmlSetNsProp:
 6558|  2.92k|{
 6559|  2.92k|    xmlAttrPtr prop;
 6560|       |
 6561|  2.92k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6561:9): [True: 2.92k, False: 0]
  |  Branch (6561:15): [True: 0, False: 2.92k]
  ------------------
 6562|      0|	return(NULL);
 6563|  2.92k|    if (name == NULL)
  ------------------
  |  Branch (6563:9): [True: 0, False: 2.92k]
  ------------------
 6564|      0|        return(NULL);
 6565|  2.92k|    prop = xmlGetPropNodeInternal(node, name,
 6566|  2.92k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6566:35): [True: 2.92k, False: 0]
  ------------------
 6567|  2.92k|    if (prop != NULL) {
  ------------------
  |  Branch (6567:9): [True: 1.63k, False: 1.29k]
  ------------------
 6568|  1.63k|        xmlNodePtr children = NULL;
 6569|       |
 6570|       |	/*
 6571|       |	* Modify the attribute's value.
 6572|       |	*/
 6573|  1.63k|        if (value != NULL) {
  ------------------
  |  Branch (6573:13): [True: 1.63k, False: 0]
  ------------------
 6574|  1.63k|	    children = xmlNewDocText(node->doc, value);
 6575|  1.63k|            if (children == NULL)
  ------------------
  |  Branch (6575:17): [True: 7, False: 1.62k]
  ------------------
 6576|      7|                return(NULL);
 6577|  1.63k|        }
 6578|       |
 6579|  1.62k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6579:6): [True: 0, False: 1.62k]
  ------------------
 6580|      0|	    xmlRemoveID(node->doc, prop);
 6581|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6582|      0|	}
 6583|  1.62k|	if (prop->children != NULL)
  ------------------
  |  Branch (6583:6): [True: 1.60k, False: 20]
  ------------------
 6584|  1.60k|	    xmlFreeNodeList(prop->children);
 6585|  1.62k|	prop->children = NULL;
 6586|  1.62k|	prop->last = NULL;
 6587|  1.62k|	prop->ns = ns;
 6588|  1.62k|	if (value != NULL) {
  ------------------
  |  Branch (6588:6): [True: 1.62k, False: 0]
  ------------------
 6589|  1.62k|	    xmlNodePtr tmp;
 6590|       |
 6591|  1.62k|	    prop->children = children;
 6592|  1.62k|	    prop->last = NULL;
 6593|  1.62k|	    tmp = prop->children;
 6594|  3.24k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6594:13): [True: 1.62k, False: 1.62k]
  ------------------
 6595|  1.62k|		tmp->parent = (xmlNodePtr) prop;
 6596|  1.62k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6596:7): [True: 1.62k, False: 0]
  ------------------
 6597|  1.62k|		    prop->last = tmp;
 6598|  1.62k|		tmp = tmp->next;
 6599|  1.62k|	    }
 6600|  1.62k|	}
 6601|  1.62k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6601:6): [True: 0, False: 1.62k]
  ------------------
 6602|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6602:6): [True: 0, False: 0]
  ------------------
 6603|      0|            return(NULL);
 6604|      0|        }
 6605|  1.62k|	return(prop);
 6606|  1.62k|    }
 6607|       |    /*
 6608|       |    * No equal attr found; create a new one.
 6609|       |    */
 6610|  1.29k|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6611|  2.92k|}
xmlNodeIsText:
 6620|  6.24k|xmlNodeIsText(const xmlNode *node) {
 6621|  6.24k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6621:9): [True: 0, False: 6.24k]
  ------------------
 6622|       |
 6623|  6.24k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6623:9): [True: 977, False: 5.27k]
  ------------------
 6624|  5.27k|    return(0);
 6625|  6.24k|}
xmlIsBlankNode:
 6635|  24.1k|xmlIsBlankNode(const xmlNode *node) {
 6636|  24.1k|    const xmlChar *cur;
 6637|  24.1k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6637:9): [True: 0, False: 24.1k]
  ------------------
 6638|       |
 6639|  24.1k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6639:9): [True: 408, False: 23.7k]
  ------------------
 6640|    408|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6640:9): [True: 408, False: 0]
  ------------------
 6641|    408|	return(0);
 6642|  23.7k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6642:9): [True: 212, False: 23.5k]
  ------------------
 6643|  23.5k|    cur = node->content;
 6644|  65.2k|    while (*cur != 0) {
  ------------------
  |  Branch (6644:12): [True: 62.2k, False: 3.00k]
  ------------------
 6645|  62.2k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  62.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  62.2k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 34.1k, False: 28.0k]
  |  |  |  |  ------------------
  |  |  |  |   91|  62.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 27.8k, False: 215]
  |  |  |  |  |  Branch (91:23): [True: 7.24k, False: 20.6k]
  |  |  |  |  ------------------
  |  |  |  |   92|  62.2k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 298, False: 20.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|  41.6k|	cur++;
 6647|  41.6k|    }
 6648|       |
 6649|  3.00k|    return(1);
 6650|  23.5k|}
xmlIsXHTML:
 8851|  28.7k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8852|  28.7k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8852:9): [True: 9.39k, False: 19.3k]
  |  Branch (8852:31): [True: 9.39k, False: 0]
  ------------------
 8853|  9.39k|	return(-1);
 8854|  19.3k|    if (publicID != NULL) {
  ------------------
  |  Branch (8854:9): [True: 18.2k, False: 1.18k]
  ------------------
 8855|  18.2k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8830|  18.2k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  18.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8831|  18.2k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8855:6): [True: 624, False: 17.5k]
  ------------------
 8856|  17.5k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8834|  17.5k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  17.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8835|  17.5k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8856:6): [True: 7.43k, False: 10.1k]
  ------------------
 8857|  10.1k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8838|  10.1k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.1k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8839|  10.1k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8857:6): [True: 1.49k, False: 8.65k]
  ------------------
 8858|  10.1k|    }
 8859|  9.83k|    if (systemID != NULL) {
  ------------------
  |  Branch (8859:9): [True: 9.83k, False: 0]
  ------------------
 8860|  9.83k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8832|  9.83k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  9.83k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8833|  9.83k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8860:6): [True: 6.75k, False: 3.07k]
  ------------------
 8861|  3.07k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8836|  3.07k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  3.07k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8837|  3.07k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8861:6): [True: 639, False: 2.43k]
  ------------------
 8862|  2.43k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8840|  2.43k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  2.43k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8841|  2.43k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8862:6): [True: 579, False: 1.85k]
  ------------------
 8863|  2.43k|    }
 8864|  1.85k|    return(0);
 8865|  9.83k|}
tree.c:xmlNewPropInternal:
 1435|  73.8k|{
 1436|  73.8k|    xmlAttrPtr cur;
 1437|  73.8k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  73.8k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 73.8k, False: 0]
  |  Branch (1439:27): [True: 0, False: 73.8k]
  ------------------
 1440|      0|        if ((eatname == 1) &&
  ------------------
  |  Branch (1440:13): [True: 0, False: 0]
  ------------------
 1441|      0|	    ((node->doc == NULL) || (node->doc->dict == NULL) ||
  ------------------
  |  Branch (1441:7): [True: 0, False: 0]
  |  Branch (1441:30): [True: 0, False: 0]
  ------------------
 1442|      0|	     (!(xmlDictOwns(node->doc->dict, name)))))
  ------------------
  |  Branch (1442:7): [True: 0, False: 0]
  ------------------
 1443|      0|            xmlFree((xmlChar *) name);
 1444|      0|        return (NULL);
 1445|      0|    }
 1446|       |
 1447|       |    /*
 1448|       |     * Allocate a new property and fill the fields.
 1449|       |     */
 1450|  73.8k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  73.8k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 16, False: 73.8k]
  ------------------
 1452|     16|        if ((eatname == 1) &&
  ------------------
  |  Branch (1452:13): [True: 0, False: 16]
  ------------------
 1453|      0|	    ((node == NULL) || (node->doc == NULL) ||
  ------------------
  |  Branch (1453:7): [True: 0, False: 0]
  |  Branch (1453:25): [True: 0, False: 0]
  ------------------
 1454|      0|             (node->doc->dict == NULL) ||
  ------------------
  |  Branch (1454:14): [True: 0, False: 0]
  ------------------
 1455|      0|	     (!(xmlDictOwns(node->doc->dict, name)))))
  ------------------
  |  Branch (1455:7): [True: 0, False: 0]
  ------------------
 1456|      0|            xmlFree((xmlChar *) name);
 1457|     16|        return (NULL);
 1458|     16|    }
 1459|  73.8k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  73.8k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  73.8k|    cur->parent = node;
 1463|  73.8k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 73.8k, False: 0]
  ------------------
 1464|  73.8k|        doc = node->doc;
 1465|  73.8k|        cur->doc = doc;
 1466|  73.8k|    }
 1467|  73.8k|    cur->ns = ns;
 1468|       |
 1469|  73.8k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 73.8k, False: 0]
  ------------------
 1470|  73.8k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 73.8k, False: 0]
  |  Branch (1470:30): [True: 30.6k, False: 43.2k]
  ------------------
 1471|  30.6k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  43.2k|        else
 1473|  43.2k|            cur->name = xmlStrdup(name);
 1474|  73.8k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 14, False: 73.8k]
  ------------------
 1475|     14|            goto error;
 1476|  73.8k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  73.8k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 1.28k, False: 72.5k]
  ------------------
 1480|  1.28k|        xmlNodePtr tmp;
 1481|       |
 1482|  1.28k|        cur->children = xmlNewDocText(doc, value);
 1483|  1.28k|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 5, False: 1.28k]
  ------------------
 1484|      5|            goto error;
 1485|  1.28k|        cur->last = NULL;
 1486|  1.28k|        tmp = cur->children;
 1487|  2.56k|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 1.28k, False: 1.28k]
  ------------------
 1488|  1.28k|            tmp->parent = (xmlNodePtr) cur;
 1489|  1.28k|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 1.28k, False: 0]
  ------------------
 1490|  1.28k|                cur->last = tmp;
 1491|  1.28k|            tmp = tmp->next;
 1492|  1.28k|        }
 1493|       |
 1494|  1.28k|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 1.28k, False: 0]
  ------------------
 1495|  1.28k|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|  1.28k|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 2, False: 1.28k]
  ------------------
 1498|      2|                goto error;
 1499|  1.28k|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 1.28k]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|  1.28k|        }
 1502|  1.28k|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  73.8k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 73.8k, False: 0]
  ------------------
 1508|  73.8k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 53.1k, False: 20.6k]
  ------------------
 1509|  53.1k|            node->properties = cur;
 1510|  53.1k|        } else {
 1511|  20.6k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   123k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 102k, False: 20.6k]
  ------------------
 1514|   102k|                prev = prev->next;
 1515|  20.6k|            prev->next = cur;
 1516|  20.6k|            cur->prev = prev;
 1517|  20.6k|        }
 1518|  73.8k|    }
 1519|       |
 1520|  73.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 73.8k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  73.8k|    return (cur);
 1523|       |
 1524|     21|error:
 1525|     21|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  73.8k|}
tree.c:xmlNewElem:
 1842|   992k|           const xmlChar *content) {
 1843|   992k|    xmlNodePtr cur;
 1844|       |
 1845|   992k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   992k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 114, False: 991k]
  ------------------
 1847|    114|	return(NULL);
 1848|   991k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   991k|    cur->type = XML_ELEMENT_NODE;
 1851|   991k|    cur->doc = doc;
 1852|   991k|    cur->name = name;
 1853|   991k|    cur->ns = ns;
 1854|       |
 1855|   991k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 991k]
  ------------------
 1856|       |        /*
 1857|       |         * We shouldn't parse the content as attribute value here,
 1858|       |         * but the API can't be changed.
 1859|       |         */
 1860|      0|        if (xmlNodeParseAttValue(doc, (xmlAttr *) cur, content, SIZE_MAX,
  ------------------
  |  Branch (1860:13): [True: 0, False: 0]
  ------------------
 1861|      0|                                 NULL) < 0) {
 1862|       |            /* Don't free name on error */
 1863|      0|            xmlFree(cur);
 1864|      0|            return(NULL);
 1865|      0|        }
 1866|      0|    }
 1867|       |
 1868|   991k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 991k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   991k|    return(cur);
 1872|   991k|}
tree.c:xmlNewEntityRef:
 2137|  25.3k|xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) {
 2138|  25.3k|    xmlNodePtr cur;
 2139|       |
 2140|       |    /*
 2141|       |     * Allocate a new node and fill the fields.
 2142|       |     */
 2143|  25.3k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2144|  25.3k|    if (cur == NULL) {
  ------------------
  |  Branch (2144:9): [True: 11, False: 25.3k]
  ------------------
 2145|     11|        xmlFree(name);
 2146|     11|	return(NULL);
 2147|     11|    }
 2148|  25.3k|    memset(cur, 0, sizeof(xmlNode));
 2149|  25.3k|    cur->type = XML_ENTITY_REF_NODE;
 2150|  25.3k|    cur->doc = doc;
 2151|  25.3k|    cur->name = name;
 2152|       |
 2153|  25.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2153:9): [True: 0, False: 25.3k]
  |  Branch (2153:35): [True: 0, False: 0]
  ------------------
 2154|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2155|       |
 2156|  25.3k|    return(cur);
 2157|  25.3k|}
tree.c:xmlInsertNode:
 2791|   229k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   229k|    xmlNodePtr oldParent;
 2793|       |
 2794|   229k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 229k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   229k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 229k]
  |  Branch (2800:23): [True: 0, False: 0]
  ------------------
 2801|      0|	if ((prev != NULL) && (prev->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2801:6): [True: 0, False: 0]
  |  Branch (2801:24): [True: 0, False: 0]
  ------------------
 2802|      0|            (prev->name == cur->name)) {
  ------------------
  |  Branch (2802:13): [True: 0, False: 0]
  ------------------
 2803|      0|            if (xmlTextAddContent(prev, cur->content, -1) < 0)
  ------------------
  |  Branch (2803:17): [True: 0, False: 0]
  ------------------
 2804|      0|                return(NULL);
 2805|      0|            xmlUnlinkNodeInternal(cur);
 2806|      0|	    xmlFreeNode(cur);
 2807|      0|	    return(prev);
 2808|      0|	}
 2809|       |
 2810|      0|	if ((next != NULL) && (next->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2810:6): [True: 0, False: 0]
  |  Branch (2810:24): [True: 0, False: 0]
  ------------------
 2811|      0|            (next->name == cur->name)) {
  ------------------
  |  Branch (2811:13): [True: 0, False: 0]
  ------------------
 2812|      0|            if (cur->content != NULL) {
  ------------------
  |  Branch (2812:17): [True: 0, False: 0]
  ------------------
 2813|      0|	        xmlChar *merged;
 2814|       |
 2815|      0|                merged = xmlStrncatNew(cur->content, next->content, -1);
 2816|      0|                if (merged == NULL)
  ------------------
  |  Branch (2816:21): [True: 0, False: 0]
  ------------------
 2817|      0|                    return(NULL);
 2818|      0|                xmlTextSetContent(next, merged);
 2819|      0|            }
 2820|       |
 2821|      0|            xmlUnlinkNodeInternal(cur);
 2822|      0|	    xmlFreeNode(cur);
 2823|      0|	    return(next);
 2824|      0|	}
 2825|      0|    }
 2826|       |
 2827|       |    /* Unlink */
 2828|   229k|    oldParent = cur->parent;
 2829|   229k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 229k]
  ------------------
 2830|      0|        if (oldParent->children == cur)
  ------------------
  |  Branch (2830:13): [True: 0, False: 0]
  ------------------
 2831|      0|            oldParent->children = cur->next;
 2832|      0|        if (oldParent->last == cur)
  ------------------
  |  Branch (2832:13): [True: 0, False: 0]
  ------------------
 2833|      0|            oldParent->last = cur->prev;
 2834|      0|    }
 2835|   229k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 208k, False: 20.3k]
  ------------------
 2836|   208k|        cur->next->prev = cur->prev;
 2837|   229k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 229k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   229k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 229k]
  ------------------
 2841|      0|	if (xmlSetTreeDoc(cur, doc) < 0) {
  ------------------
  |  Branch (2841:6): [True: 0, False: 0]
  ------------------
 2842|       |            /*
 2843|       |             * We shouldn't make any modifications to the inserted
 2844|       |             * tree if a memory allocation fails, but that's hard to
 2845|       |             * implement. The tree has been moved to the target
 2846|       |             * document now but some contents are corrupted.
 2847|       |             * Unlinking is the best we can do.
 2848|       |             */
 2849|      0|            cur->parent = NULL;
 2850|      0|            cur->prev = NULL;
 2851|      0|            cur->next = NULL;
 2852|      0|            return(NULL);
 2853|      0|        }
 2854|      0|    }
 2855|       |
 2856|   229k|    cur->parent = parent;
 2857|   229k|    cur->prev = prev;
 2858|   229k|    cur->next = next;
 2859|       |
 2860|   229k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 229k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   229k|    } else {
 2864|   229k|        prev->next = cur;
 2865|   229k|    }
 2866|   229k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 1.16k, False: 227k]
  ------------------
 2867|  1.16k|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 1.16k, False: 0]
  ------------------
 2868|  1.16k|            parent->last = cur;
 2869|   227k|    } else {
 2870|   227k|        next->prev = cur;
 2871|   227k|    }
 2872|       |
 2873|   229k|    return(cur);
 2874|   229k|}
tree.c:xmlTextSetContent:
 2717|     61|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     61|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 61]
  ------------------
 2719|      0|        (text->content != (xmlChar *) &text->properties)) {
  ------------------
  |  Branch (2719:9): [True: 0, False: 0]
  ------------------
 2720|      0|        xmlDocPtr doc = text->doc;
 2721|       |
 2722|      0|        if ((doc == NULL) ||
  ------------------
  |  Branch (2722:13): [True: 0, False: 0]
  ------------------
 2723|      0|            (doc->dict == NULL) ||
  ------------------
  |  Branch (2723:13): [True: 0, False: 0]
  ------------------
 2724|      0|            (!xmlDictOwns(doc->dict, text->content)))
  ------------------
  |  Branch (2724:13): [True: 0, False: 0]
  ------------------
 2725|      0|            xmlFree(text->content);
 2726|      0|    }
 2727|       |
 2728|     61|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     61|}
tree.c:xmlTextAddContent:
 2733|     63|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     63|    xmlChar *merged;
 2735|       |
 2736|     63|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 63]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     63|    merged = xmlStrncatNew(text->content, content, len);
 2740|     63|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 2, False: 61]
  ------------------
 2741|      2|        return(-1);
 2742|       |
 2743|     61|    xmlTextSetContent(text, merged);
 2744|     61|    return(0);
 2745|     63|}
tree.c:xmlUnlinkNodeInternal:
 3485|   450k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|   450k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 396k, False: 54.2k]
  ------------------
 3487|   396k|	xmlNodePtr parent;
 3488|   396k|	parent = cur->parent;
 3489|   396k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 1.28k, False: 395k]
  ------------------
 3490|  1.28k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 1.20k, False: 76]
  ------------------
 3491|  1.20k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|   395k|	} else {
 3493|   395k|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 235k, False: 160k]
  ------------------
 3494|   235k|		parent->children = cur->next;
 3495|   395k|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 53.5k, False: 341k]
  ------------------
 3496|  53.5k|		parent->last = cur->prev;
 3497|   395k|	}
 3498|   396k|	cur->parent = NULL;
 3499|   396k|    }
 3500|       |
 3501|   450k|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 342k, False: 108k]
  ------------------
 3502|   342k|        cur->next->prev = cur->prev;
 3503|   450k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 160k, False: 290k]
  ------------------
 3504|   160k|        cur->prev->next = cur->next;
 3505|   450k|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|   450k|}
tree.c:xmlCopyPropInternal:
 3660|  2.09M|xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
 3661|  2.09M|    xmlAttrPtr ret = NULL;
 3662|       |
 3663|  2.09M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3663:9): [True: 0, False: 2.09M]
  ------------------
 3664|  2.09M|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3664:9): [True: 2.09M, False: 0]
  |  Branch (3664:29): [True: 0, False: 2.09M]
  ------------------
 3665|      0|        return(NULL);
 3666|  2.09M|    if (target != NULL)
  ------------------
  |  Branch (3666:9): [True: 2.09M, False: 0]
  ------------------
 3667|  2.09M|	ret = xmlNewDocProp(target->doc, cur->name, NULL);
 3668|      0|    else if (doc != NULL)
  ------------------
  |  Branch (3668:14): [True: 0, False: 0]
  ------------------
 3669|      0|	ret = xmlNewDocProp(doc, cur->name, NULL);
 3670|      0|    else if (cur->parent != NULL)
  ------------------
  |  Branch (3670:14): [True: 0, False: 0]
  ------------------
 3671|      0|	ret = xmlNewDocProp(cur->parent->doc, cur->name, NULL);
 3672|      0|    else if (cur->children != NULL)
  ------------------
  |  Branch (3672:14): [True: 0, False: 0]
  ------------------
 3673|      0|	ret = xmlNewDocProp(cur->children->doc, cur->name, NULL);
 3674|      0|    else
 3675|      0|	ret = xmlNewDocProp(NULL, cur->name, NULL);
 3676|  2.09M|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (3676:9): [True: 4.02k, False: 2.09M]
  ------------------
 3677|  2.09M|    ret->parent = target;
 3678|       |
 3679|  2.09M|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3679:9): [True: 1.26M, False: 826k]
  |  Branch (3679:30): [True: 1.26M, False: 0]
  ------------------
 3680|  1.26M|      xmlNsPtr ns;
 3681|  1.26M|      int res;
 3682|       |
 3683|  1.26M|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3684|  1.26M|      if (res < 0)
  ------------------
  |  Branch (3684:11): [True: 2, False: 1.26M]
  ------------------
 3685|      2|          goto error;
 3686|  1.26M|      if (ns == NULL) {
  ------------------
  |  Branch (3686:11): [True: 280, False: 1.26M]
  ------------------
 3687|       |        /*
 3688|       |         * Humm, we are copying an element whose namespace is defined
 3689|       |         * out of the new tree scope. Search it in the original tree
 3690|       |         * and add it at the top of the new tree
 3691|       |         */
 3692|    280|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3693|    280|        if (res < 0)
  ------------------
  |  Branch (3693:13): [True: 0, False: 280]
  ------------------
 3694|      0|          goto error;
 3695|    280|        if (ns != NULL) {
  ------------------
  |  Branch (3695:13): [True: 280, False: 0]
  ------------------
 3696|    280|          xmlNodePtr root = target;
 3697|    280|          xmlNodePtr pred = NULL;
 3698|       |
 3699|    549|          while (root->parent != NULL) {
  ------------------
  |  Branch (3699:18): [True: 269, False: 280]
  ------------------
 3700|    269|            pred = root;
 3701|    269|            root = root->parent;
 3702|    269|          }
 3703|    280|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3703:15): [True: 0, False: 280]
  ------------------
 3704|       |            /* correct possibly cycling above the document elt */
 3705|      0|            root = pred;
 3706|      0|          }
 3707|    280|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3708|    280|          if (ret->ns == NULL)
  ------------------
  |  Branch (3708:15): [True: 1, False: 279]
  ------------------
 3709|      1|              goto error;
 3710|    280|        }
 3711|  1.26M|      } else {
 3712|       |        /*
 3713|       |         * we have to find something appropriate here since
 3714|       |         * we can't be sure, that the namespace we found is identified
 3715|       |         * by the prefix
 3716|       |         */
 3717|  1.26M|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3717:13): [True: 1.26M, False: 1.59k]
  ------------------
 3718|       |          /* this is the nice case */
 3719|  1.26M|          ret->ns = ns;
 3720|  1.26M|        } else {
 3721|       |          /*
 3722|       |           * we are in trouble: we need a new reconciled namespace.
 3723|       |           * This is expensive
 3724|       |           */
 3725|  1.59k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3726|  1.59k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3726:15): [True: 1, False: 1.59k]
  ------------------
 3727|      1|              goto error;
 3728|  1.59k|        }
 3729|  1.26M|      }
 3730|       |
 3731|  1.26M|    } else
 3732|   826k|        ret->ns = NULL;
 3733|       |
 3734|  2.09M|    if (cur->children != NULL) {
  ------------------
  |  Branch (3734:9): [True: 1.55M, False: 541k]
  ------------------
 3735|  1.55M|	xmlNodePtr tmp;
 3736|       |
 3737|  1.55M|	ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret);
 3738|  1.55M|        if (ret->children == NULL)
  ------------------
  |  Branch (3738:13): [True: 38, False: 1.55M]
  ------------------
 3739|     38|            goto error;
 3740|  1.55M|	ret->last = NULL;
 3741|  1.55M|	tmp = ret->children;
 3742|  3.10M|	while (tmp != NULL) {
  ------------------
  |  Branch (3742:9): [True: 1.55M, False: 1.55M]
  ------------------
 3743|       |	    /* tmp->parent = (xmlNodePtr)ret; */
 3744|  1.55M|	    if (tmp->next == NULL)
  ------------------
  |  Branch (3744:10): [True: 1.55M, False: 528]
  ------------------
 3745|  1.55M|	        ret->last = tmp;
 3746|  1.55M|	    tmp = tmp->next;
 3747|  1.55M|	}
 3748|  1.55M|    }
 3749|       |    /*
 3750|       |     * Try to handle IDs
 3751|       |     */
 3752|  2.09M|    if ((target != NULL) && (cur != NULL) &&
  ------------------
  |  Branch (3752:9): [True: 2.09M, False: 0]
  |  Branch (3752:29): [True: 2.09M, False: 0]
  ------------------
 3753|  2.09M|	(target->doc != NULL) && (cur->doc != NULL) &&
  ------------------
  |  Branch (3753:2): [True: 2.09M, False: 329]
  |  Branch (3753:27): [True: 2.09M, False: 0]
  ------------------
 3754|  2.09M|        (cur->parent != NULL) &&
  ------------------
  |  Branch (3754:9): [True: 2.09M, False: 0]
  ------------------
 3755|  2.09M|        (cur->children != NULL)) {
  ------------------
  |  Branch (3755:9): [True: 1.55M, False: 541k]
  ------------------
 3756|  1.55M|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3757|       |
 3758|  1.55M|        if (res < 0)
  ------------------
  |  Branch (3758:13): [True: 3, False: 1.55M]
  ------------------
 3759|      3|            goto error;
 3760|  1.55M|	if (res != 0) {
  ------------------
  |  Branch (3760:6): [True: 5.83k, False: 1.54M]
  ------------------
 3761|  5.83k|	    xmlChar *id;
 3762|       |
 3763|  5.83k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3764|  5.83k|	    if (id == NULL)
  ------------------
  |  Branch (3764:10): [True: 1, False: 5.83k]
  ------------------
 3765|      1|                goto error;
 3766|  5.83k|            res = xmlAddIDSafe(ret, id);
 3767|  5.83k|	    xmlFree(id);
 3768|  5.83k|            if (res < 0)
  ------------------
  |  Branch (3768:17): [True: 6, False: 5.82k]
  ------------------
 3769|      6|                goto error;
 3770|  5.83k|	}
 3771|  1.55M|    }
 3772|  2.09M|    return(ret);
 3773|       |
 3774|     52|error:
 3775|     52|    xmlFreeProp(ret);
 3776|       |    return(NULL);
 3777|  2.09M|}
tree.c:xmlGetEntityFromDtd:
  119|  3.16k|xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  120|  3.16k|    xmlEntitiesTablePtr table;
  121|       |
  122|  3.16k|    if((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (122:8): [True: 3.16k, False: 0]
  |  Branch (122:25): [True: 3.16k, False: 0]
  ------------------
  123|  3.16k|	table = (xmlEntitiesTablePtr) dtd->entities;
  124|  3.16k|	return((xmlEntityPtr) xmlHashLookup(table, name));
  125|       |	/* return(xmlGetEntityFromTable(table, name)); */
  126|  3.16k|    }
  127|      0|    return(NULL);
  128|  3.16k|}
tree.c:xmlGetParameterEntityFromDtd:
  137|    930|xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  138|    930|    xmlEntitiesTablePtr table;
  139|       |
  140|    930|    if ((dtd != NULL) && (dtd->pentities != NULL)) {
  ------------------
  |  Branch (140:9): [True: 930, False: 0]
  |  Branch (140:26): [True: 930, False: 0]
  ------------------
  141|    930|	table = (xmlEntitiesTablePtr) dtd->pentities;
  142|    930|	return((xmlEntityPtr) xmlHashLookup(table, name));
  143|       |	/* return(xmlGetEntityFromTable(table, name)); */
  144|    930|    }
  145|      0|    return(NULL);
  146|    930|}
tree.c:xmlGetLineNoInternal:
 4398|  75.3k|{
 4399|  75.3k|    long result = -1;
 4400|       |
 4401|  75.3k|    if (depth >= 5)
  ------------------
  |  Branch (4401:9): [True: 7.63k, False: 67.7k]
  ------------------
 4402|  7.63k|        return(-1);
 4403|       |
 4404|  67.7k|    if (!node)
  ------------------
  |  Branch (4404:9): [True: 0, False: 67.7k]
  ------------------
 4405|      0|        return result;
 4406|  67.7k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4406:9): [True: 55.9k, False: 11.7k]
  ------------------
 4407|  11.7k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4407:9): [True: 9.87k, False: 1.89k]
  ------------------
 4408|  1.89k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4408:2): [True: 199, False: 1.69k]
  ------------------
 4409|  66.6k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4409:2): [True: 649, False: 1.04k]
  ------------------
 4410|  66.6k|	if (node->line == 65535) {
  ------------------
  |  Branch (4410:6): [True: 49.6k, False: 17.0k]
  ------------------
 4411|  49.6k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4411:10): [True: 9.86k, False: 39.7k]
  |  Branch (4411:43): [True: 3.28k, False: 6.57k]
  ------------------
 4412|  3.28k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  3.28k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4413|  46.3k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4413:15): [True: 38.9k, False: 7.42k]
  ------------------
 4414|  38.9k|	             (node->children != NULL))
  ------------------
  |  Branch (4414:15): [True: 2.99k, False: 35.9k]
  ------------------
 4415|  2.99k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4416|  43.3k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4416:15): [True: 14.9k, False: 28.4k]
  ------------------
 4417|  14.9k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4418|  28.4k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4418:15): [True: 23.9k, False: 4.45k]
  ------------------
 4419|  23.9k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4420|  49.6k|	}
 4421|  66.6k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4421:6): [True: 29.1k, False: 37.5k]
  |  Branch (4421:24): [True: 30.3k, False: 7.17k]
  ------------------
 4422|  59.4k|	    result = node->line;
 4423|  66.6k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4423:16): [True: 826, False: 216]
  ------------------
 4424|    826|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4424:15): [True: 245, False: 581]
  ------------------
 4425|    581|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4425:8): [True: 310, False: 271]
  ------------------
 4426|    271|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4426:8): [True: 0, False: 271]
  ------------------
 4427|    271|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4427:8): [True: 67, False: 204]
  ------------------
 4428|    622|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4429|    420|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4429:14): [True: 420, False: 0]
  ------------------
 4430|    420|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4430:14): [True: 408, False: 12]
  ------------------
 4431|    408|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4432|       |
 4433|  67.7k|    return result;
 4434|  67.7k|}
tree.c:xmlBufGetChildContent:
 5157|   153k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree, int normalize) {
 5158|   153k|    const xmlNode *cur = tree->children;
 5159|       |
 5160|  32.7M|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 32.7M, False: 1.61k]
  ------------------
 5161|  32.7M|        switch (cur->type) {
 5162|  4.19M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 4.19M, False: 28.5M]
  ------------------
 5163|  4.32M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 131k, False: 32.5M]
  ------------------
 5164|  4.32M|                if (normalize)
  ------------------
  |  Branch (5164:21): [True: 2.10k, False: 4.32M]
  ------------------
 5165|  2.10k|                    xmlBufCat(buf, xmlAttrNormalize(cur->content));
 5166|  4.32M|                else
 5167|  4.32M|                    xmlBufCat(buf, cur->content);
 5168|  4.32M|                break;
 5169|       |
 5170|  2.21k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5170:13): [True: 2.21k, False: 32.7M]
  ------------------
 5171|  2.21k|                xmlBufGetEntityRefContent(buf, cur, normalize);
 5172|  2.21k|                break;
 5173|       |
 5174|  28.3M|            default:
  ------------------
  |  Branch (5174:13): [True: 28.3M, False: 4.33M]
  ------------------
 5175|  28.3M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5175:21): [True: 11.4M, False: 16.9M]
  ------------------
 5176|  11.4M|                    cur = cur->children;
 5177|  11.4M|                    continue;
 5178|  11.4M|                }
 5179|  16.9M|                break;
 5180|  32.7M|        }
 5181|       |
 5182|  32.7M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5182:16): [True: 11.5M, False: 21.1M]
  ------------------
 5183|  11.5M|            cur = cur->parent;
 5184|  11.5M|            if (cur == tree)
  ------------------
  |  Branch (5184:17): [True: 152k, False: 11.4M]
  ------------------
 5185|   152k|                return;
 5186|  11.5M|        }
 5187|  21.1M|        cur = cur->next;
 5188|  21.1M|    }
 5189|   153k|}
tree.c:xmlBufGetEntityRefContent:
 5126|  2.95k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref, int normalize) {
 5127|  2.95k|    xmlEntityPtr ent;
 5128|       |
 5129|  2.95k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5129:9): [True: 2.63k, False: 317]
  ------------------
 5130|  2.63k|        ent = (xmlEntityPtr) ref->children;
 5131|  2.63k|    } else {
 5132|       |        /* lookup entity declaration */
 5133|    317|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5134|    317|        if (ent == NULL)
  ------------------
  |  Branch (5134:13): [True: 317, False: 0]
  ------------------
 5135|    317|            return;
 5136|    317|    }
 5137|       |
 5138|       |    /*
 5139|       |     * The parser should always expand predefined entities but it's
 5140|       |     * possible to create references to predefined entities using
 5141|       |     * the tree API.
 5142|       |     */
 5143|  2.63k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5143:9): [True: 0, False: 2.63k]
  ------------------
 5144|      0|        xmlBufCat(buf, ent->content);
 5145|      0|        return;
 5146|      0|    }
 5147|       |
 5148|  2.63k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.63k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5148:9): [True: 0, False: 2.63k]
  ------------------
 5149|      0|        return;
 5150|       |
 5151|  2.63k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.63k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.63k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent, normalize);
 5153|  2.63k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.63k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5154|  2.63k|}
tree.c:xmlTreeEnsureXMLDecl:
 5631|  1.32M|{
 5632|  1.32M|    xmlNsPtr ns;
 5633|       |
 5634|  1.32M|    ns = doc->oldNs;
 5635|  1.32M|    if (ns != NULL)
  ------------------
  |  Branch (5635:9): [True: 1.32M, False: 5.94k]
  ------------------
 5636|  1.32M|	return (ns);
 5637|       |
 5638|  5.94k|    ns = xmlNewXmlNs();
 5639|  5.94k|    doc->oldNs = ns;
 5640|       |
 5641|  5.94k|    return(ns);
 5642|  1.32M|}
tree.c:xmlNewXmlNs:
 5599|  6.20k|xmlNewXmlNs(void) {
 5600|  6.20k|    xmlNsPtr ns;
 5601|       |
 5602|  6.20k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5603|  6.20k|    if (ns == NULL)
  ------------------
  |  Branch (5603:9): [True: 7, False: 6.20k]
  ------------------
 5604|      7|        return(NULL);
 5605|  6.20k|    memset(ns, 0, sizeof(xmlNs));
 5606|  6.20k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  6.20k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5607|  6.20k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  6.20k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5608|  6.20k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5608:9): [True: 24, False: 6.17k]
  ------------------
 5609|     24|        xmlFreeNs(ns);
 5610|     24|        return(NULL);
 5611|     24|    }
 5612|  6.17k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  6.17k|#define BAD_CAST (xmlChar *)
  ------------------
 5613|  6.17k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5613:9): [True: 11, False: 6.16k]
  ------------------
 5614|     11|        xmlFreeNs(ns);
 5615|     11|        return(NULL);
 5616|     11|    }
 5617|       |
 5618|  6.16k|    return(ns);
 5619|  6.17k|}
tree.c:xmlNsInScope:
 5764|  7.66k|{
 5765|  7.66k|    xmlNsPtr tst;
 5766|       |
 5767|  20.3k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5767:12): [True: 20.3k, False: 0]
  |  Branch (5767:30): [True: 19.4k, False: 907]
  ------------------
 5768|  19.4k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5768:13): [True: 0, False: 19.4k]
  ------------------
 5769|  19.4k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5769:13): [True: 0, False: 19.4k]
  ------------------
 5770|      0|            return (-1);
 5771|  19.4k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5771:13): [True: 19.4k, False: 0]
  ------------------
 5772|  19.4k|            tst = node->nsDef;
 5773|  29.9k|            while (tst != NULL) {
  ------------------
  |  Branch (5773:20): [True: 17.2k, False: 12.6k]
  ------------------
 5774|  17.2k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5774:21): [True: 2.55k, False: 14.7k]
  ------------------
 5775|  2.55k|                    && (prefix == NULL))
  ------------------
  |  Branch (5775:24): [True: 917, False: 1.63k]
  ------------------
 5776|    917|                    return (0);
 5777|  16.3k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5777:21): [True: 14.7k, False: 1.63k]
  ------------------
 5778|  14.7k|                    && (prefix != NULL)
  ------------------
  |  Branch (5778:24): [True: 11.1k, False: 3.54k]
  ------------------
 5779|  11.1k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5779:24): [True: 5.83k, False: 5.33k]
  ------------------
 5780|  5.83k|                    return (0);
 5781|  10.5k|                tst = tst->next;
 5782|  10.5k|            }
 5783|  19.4k|        }
 5784|  12.6k|        node = node->parent;
 5785|  12.6k|    }
 5786|    907|    if (node != ancestor)
  ------------------
  |  Branch (5786:9): [True: 0, False: 907]
  ------------------
 5787|      0|        return (-1);
 5788|    907|    return (1);
 5789|    907|}
tree.c:xmlNewReconciledNs:
 5914|  1.59k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5915|  1.59k|    xmlNsPtr def;
 5916|  1.59k|    xmlChar prefix[50];
 5917|  1.59k|    int counter = 1;
 5918|  1.59k|    int res;
 5919|       |
 5920|  1.59k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5920:9): [True: 0, False: 1.59k]
  |  Branch (5920:27): [True: 0, False: 1.59k]
  ------------------
 5921|      0|	return(NULL);
 5922|      0|    }
 5923|  1.59k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5923:9): [True: 0, False: 1.59k]
  |  Branch (5923:25): [True: 0, False: 1.59k]
  ------------------
 5924|      0|	return(NULL);
 5925|      0|    }
 5926|       |    /*
 5927|       |     * Search an existing namespace definition inherited.
 5928|       |     */
 5929|  1.59k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5930|  1.59k|    if (res < 0)
  ------------------
  |  Branch (5930:9): [True: 0, False: 1.59k]
  ------------------
 5931|      0|        return(NULL);
 5932|  1.59k|    if (def != NULL)
  ------------------
  |  Branch (5932:9): [True: 907, False: 686]
  ------------------
 5933|    907|        return(def);
 5934|       |
 5935|       |    /*
 5936|       |     * Find a close prefix which is not already in use.
 5937|       |     * Let's strip namespace prefixes longer than 20 chars !
 5938|       |     */
 5939|    686|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5939:9): [True: 0, False: 686]
  ------------------
 5940|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5941|    686|    else
 5942|    686|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5943|       |
 5944|    686|    res = xmlSearchNsSafe(tree, prefix, &def);
 5945|    686|    if (res < 0)
  ------------------
  |  Branch (5945:9): [True: 0, False: 686]
  ------------------
 5946|      0|        return(NULL);
 5947|  2.17k|    while (def != NULL) {
  ------------------
  |  Branch (5947:12): [True: 1.49k, False: 686]
  ------------------
 5948|  1.49k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5948:13): [True: 0, False: 1.49k]
  ------------------
 5949|  1.49k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5949:6): [True: 0, False: 1.49k]
  ------------------
 5950|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5951|  1.49k|	else
 5952|  1.49k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5953|  1.49k|		(char *)ns->prefix, counter++);
 5954|  1.49k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5955|  1.49k|        if (res < 0)
  ------------------
  |  Branch (5955:13): [True: 0, False: 1.49k]
  ------------------
 5956|      0|            return(NULL);
 5957|  1.49k|    }
 5958|       |
 5959|       |    /*
 5960|       |     * OK, now we are ready to create a new one.
 5961|       |     */
 5962|    686|    def = xmlNewNs(tree, ns->href, prefix);
 5963|    686|    return(def);
 5964|    686|}
tree.c:xmlGetPropNodeInternal:
 6124|  7.23M|{
 6125|  7.23M|    xmlAttrPtr prop;
 6126|       |
 6127|       |    /* Avoid unused variable warning if features are disabled. */
 6128|  7.23M|    (void) useDTD;
 6129|       |
 6130|  7.23M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6130:9): [True: 0, False: 7.23M]
  |  Branch (6130:27): [True: 19.8k, False: 7.21M]
  |  Branch (6130:63): [True: 0, False: 7.21M]
  ------------------
 6131|  19.8k|	return(NULL);
 6132|       |
 6133|  7.21M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6133:9): [True: 1.73M, False: 5.47M]
  ------------------
 6134|  1.73M|	prop = node->properties;
 6135|  1.73M|	if (nsName == NULL) {
  ------------------
  |  Branch (6135:6): [True: 72.3k, False: 1.66M]
  ------------------
 6136|       |	    /*
 6137|       |	    * We want the attr to be in no namespace.
 6138|       |	    */
 6139|   118k|	    do {
 6140|   118k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6140:7): [True: 107k, False: 10.6k]
  |  Branch (6140:29): [True: 36.2k, False: 71.1k]
  ------------------
 6141|  36.2k|		    return(prop);
 6142|  36.2k|		}
 6143|  81.7k|		prop = prop->next;
 6144|  81.7k|	    } while (prop != NULL);
  ------------------
  |  Branch (6144:15): [True: 45.7k, False: 36.0k]
  ------------------
 6145|  1.66M|	} else {
 6146|       |	    /*
 6147|       |	    * We want the attr to be in the specified namespace.
 6148|       |	    */
 6149|  1.77M|	    do {
 6150|  1.77M|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6150:7): [True: 1.43M, False: 341k]
  |  Branch (6150:29): [True: 1.35M, False: 86.6k]
  ------------------
 6151|  1.35M|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6151:8): [True: 1.84k, False: 1.34M]
  ------------------
 6152|  1.34M|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6152:8): [True: 1.34M, False: 663]
  ------------------
 6153|  1.35M|		{
 6154|  1.35M|		    return(prop);
 6155|  1.35M|		}
 6156|   429k|		prop = prop->next;
 6157|   429k|	    } while (prop != NULL);
  ------------------
  |  Branch (6157:15): [True: 115k, False: 313k]
  ------------------
 6158|  1.66M|	}
 6159|  1.73M|    }
 6160|       |
 6161|  5.82M|    if (! useDTD)
  ------------------
  |  Branch (6161:9): [True: 5.82M, False: 0]
  ------------------
 6162|  5.82M|	return(NULL);
 6163|       |    /*
 6164|       |     * Check if there is a default/fixed attribute declaration in
 6165|       |     * the internal or external subset.
 6166|       |     */
 6167|      0|    if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
  ------------------
  |  Branch (6167:9): [True: 0, False: 0]
  |  Branch (6167:32): [True: 0, False: 0]
  ------------------
 6168|      0|	xmlDocPtr doc = node->doc;
 6169|      0|	xmlAttributePtr attrDecl = NULL;
 6170|      0|	xmlChar *elemQName, *tmpstr = NULL;
 6171|       |
 6172|       |	/*
 6173|       |	* We need the QName of the element for the DTD-lookup.
 6174|       |	*/
 6175|      0|	if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
  ------------------
  |  Branch (6175:6): [True: 0, False: 0]
  |  Branch (6175:28): [True: 0, False: 0]
  ------------------
 6176|      0|	    tmpstr = xmlStrdup(node->ns->prefix);
 6177|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6177:10): [True: 0, False: 0]
  ------------------
 6178|      0|		return(NULL);
 6179|      0|	    tmpstr = xmlStrcat(tmpstr, BAD_CAST ":");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6180|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6180:10): [True: 0, False: 0]
  ------------------
 6181|      0|		return(NULL);
 6182|      0|	    tmpstr = xmlStrcat(tmpstr, node->name);
 6183|      0|	    if (tmpstr == NULL)
  ------------------
  |  Branch (6183:10): [True: 0, False: 0]
  ------------------
 6184|      0|		return(NULL);
 6185|      0|	    elemQName = tmpstr;
 6186|      0|	} else
 6187|      0|	    elemQName = (xmlChar *) node->name;
 6188|      0|	if (nsName == NULL) {
  ------------------
  |  Branch (6188:6): [True: 0, False: 0]
  ------------------
 6189|       |	    /*
 6190|       |	    * The common and nice case: Attr in no namespace.
 6191|       |	    */
 6192|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6193|      0|		elemQName, name, NULL);
 6194|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6194:10): [True: 0, False: 0]
  |  Branch (6194:32): [True: 0, False: 0]
  ------------------
 6195|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6196|      0|		    elemQName, name, NULL);
 6197|      0|	    }
 6198|      0|        } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
  ------------------
  |  |  146|      0|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (6198:20): [True: 0, False: 0]
  ------------------
 6199|       |	    /*
 6200|       |	    * The XML namespace must be bound to prefix 'xml'.
 6201|       |	    */
 6202|      0|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
 6203|      0|		elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6204|      0|	    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (6204:10): [True: 0, False: 0]
  |  Branch (6204:32): [True: 0, False: 0]
  ------------------
 6205|      0|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
 6206|      0|		    elemQName, name, BAD_CAST "xml");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 6207|      0|	    }
 6208|      0|	} else {
 6209|      0|	    xmlNsPtr *nsList, *cur;
 6210|       |
 6211|       |	    /*
 6212|       |	    * The ugly case: Search using the prefixes of in-scope
 6213|       |	    * ns-decls corresponding to @nsName.
 6214|       |	    */
 6215|      0|	    nsList = xmlGetNsList(node->doc, node);
 6216|      0|	    if (nsList == NULL) {
  ------------------
  |  Branch (6216:10): [True: 0, False: 0]
  ------------------
 6217|      0|		if (tmpstr != NULL)
  ------------------
  |  Branch (6217:7): [True: 0, False: 0]
  ------------------
 6218|      0|		    xmlFree(tmpstr);
 6219|      0|		return(NULL);
 6220|      0|	    }
 6221|      0|	    cur = nsList;
 6222|      0|	    while (*cur != NULL) {
  ------------------
  |  Branch (6222:13): [True: 0, False: 0]
  ------------------
 6223|      0|		if (xmlStrEqual((*cur)->href, nsName)) {
  ------------------
  |  Branch (6223:7): [True: 0, False: 0]
  ------------------
 6224|      0|		    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elemQName,
 6225|      0|			name, (*cur)->prefix);
 6226|      0|		    if (attrDecl)
  ------------------
  |  Branch (6226:11): [True: 0, False: 0]
  ------------------
 6227|      0|			break;
 6228|      0|		    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (6228:11): [True: 0, False: 0]
  ------------------
 6229|      0|			attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elemQName,
 6230|      0|			    name, (*cur)->prefix);
 6231|      0|			if (attrDecl)
  ------------------
  |  Branch (6231:8): [True: 0, False: 0]
  ------------------
 6232|      0|			    break;
 6233|      0|		    }
 6234|      0|		}
 6235|      0|		cur++;
 6236|      0|	    }
 6237|      0|	    xmlFree(nsList);
 6238|      0|	}
 6239|      0|	if (tmpstr != NULL)
  ------------------
  |  Branch (6239:6): [True: 0, False: 0]
  ------------------
 6240|      0|	    xmlFree(tmpstr);
 6241|       |	/*
 6242|       |	* Only default/fixed attrs are relevant.
 6243|       |	*/
 6244|      0|	if ((attrDecl != NULL) && (attrDecl->defaultValue != NULL))
  ------------------
  |  Branch (6244:6): [True: 0, False: 0]
  |  Branch (6244:28): [True: 0, False: 0]
  ------------------
 6245|      0|	    return((xmlAttrPtr) attrDecl);
 6246|      0|    }
 6247|       |
 6248|      0|    return(NULL);
 6249|      0|}
tree.c:xmlGetPropNodeValueInternal:
 6253|  1.38M|{
 6254|  1.38M|    if (prop == NULL)
  ------------------
  |  Branch (6254:9): [True: 0, False: 1.38M]
  ------------------
 6255|      0|	return(NULL);
 6256|  1.38M|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6256:9): [True: 1.38M, False: 0]
  ------------------
 6257|  1.38M|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6258|  1.38M|    } else if (prop->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (6258:16): [True: 0, False: 0]
  ------------------
 6259|      0|	return(xmlStrdup(((xmlAttributePtr)prop)->defaultValue));
 6260|      0|    }
 6261|      0|    return(NULL);
 6262|  1.38M|}

xmlParseURISafe:
  962|  1.45M|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|  1.45M|    xmlURIPtr uri;
  964|  1.45M|    int ret;
  965|       |
  966|  1.45M|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 1.45M]
  ------------------
  967|      0|        return(1);
  968|  1.45M|    *uriOut = NULL;
  969|  1.45M|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 1.45M]
  ------------------
  970|      0|	return(1);
  971|       |
  972|  1.45M|    uri = xmlCreateURI();
  973|  1.45M|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 148, False: 1.45M]
  ------------------
  974|    148|        return(-1);
  975|       |
  976|  1.45M|    ret = xmlParse3986URIReference(uri, str);
  977|  1.45M|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 26.1k, False: 1.43M]
  ------------------
  978|  26.1k|        xmlFreeURI(uri);
  979|  26.1k|        return(ret);
  980|  26.1k|    }
  981|       |
  982|  1.43M|    *uriOut = uri;
  983|  1.43M|    return(0);
  984|  1.45M|}
xmlParseURIReference:
 1012|  1.01k|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|  1.01k|    return(xmlParse3986URIReference(uri, str));
 1014|  1.01k|}
xmlCreateURI:
 1058|  1.57M|xmlCreateURI(void) {
 1059|  1.57M|    xmlURIPtr ret;
 1060|       |
 1061|  1.57M|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|  1.57M|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 188, False: 1.57M]
  ------------------
 1063|    188|	return(NULL);
 1064|  1.57M|    memset(ret, 0, sizeof(xmlURI));
 1065|  1.57M|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|  1.57M|#define PORT_EMPTY           0
  ------------------
 1066|  1.57M|    return(ret);
 1067|  1.57M|}
xmlSaveUri:
 1095|   139k|xmlSaveUri(xmlURI *uri) {
 1096|   139k|    xmlChar *ret = NULL;
 1097|   139k|    xmlChar *temp;
 1098|   139k|    const char *p;
 1099|   139k|    int len;
 1100|   139k|    int max;
 1101|       |
 1102|   139k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 139k]
  ------------------
 1103|       |
 1104|       |
 1105|   139k|    max = 80;
 1106|   139k|    ret = xmlMalloc(max + 1);
 1107|   139k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 106, False: 139k]
  ------------------
 1108|    106|	return(NULL);
 1109|   139k|    len = 0;
 1110|       |
 1111|   139k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 13.8k, False: 125k]
  ------------------
 1112|  13.8k|	p = uri->scheme;
 1113|   114k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 101k, False: 13.8k]
  ------------------
 1114|   101k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 416, False: 100k]
  ------------------
 1115|    416|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    416|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 1, False: 415]
  ------------------
 1117|    415|		ret = temp;
 1118|    415|	    }
 1119|   101k|	    ret[len++] = *p++;
 1120|   101k|	}
 1121|  13.8k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 214, False: 13.6k]
  ------------------
 1122|    214|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    214|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 2, False: 212]
  ------------------
 1124|    212|            ret = temp;
 1125|    212|	}
 1126|  13.8k|	ret[len++] = ':';
 1127|  13.8k|    }
 1128|   139k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 139k]
  ------------------
 1129|      0|	p = uri->opaque;
 1130|      0|	while (*p != 0) {
  ------------------
  |  Branch (1130:9): [True: 0, False: 0]
  ------------------
 1131|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1131:10): [True: 0, False: 0]
  ------------------
 1132|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1133|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1133:21): [True: 0, False: 0]
  ------------------
 1134|      0|                ret = temp;
 1135|      0|	    }
 1136|      0|	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |   95|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 0, False: 0]
  |  |  |  Branch (95:41): [True: 0, False: 0]
  |  |  |  Branch (95:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   96|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 0, False: 0]
  |  |  |  Branch (96:25): [True: 0, False: 0]
  |  |  |  Branch (96:41): [True: 0, False: 0]
  |  |  |  Branch (96:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   97|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 0, False: 0]
  |  |  |  Branch (97:25): [True: 0, False: 0]
  |  |  |  Branch (97:41): [True: 0, False: 0]
  |  |  |  Branch (97:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   98|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
              	    if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
  ------------------
  |  |  103|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (68:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   80|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1137|      0|		ret[len++] = *p++;
 1138|      0|	    else {
 1139|      0|		int val = *(unsigned char *)p++;
 1140|      0|		int hi = val / 0x10, lo = val % 0x10;
 1141|      0|		ret[len++] = '%';
 1142|      0|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1142:22): [True: 0, False: 0]
  ------------------
 1143|      0|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1143:22): [True: 0, False: 0]
  ------------------
 1144|      0|	    }
 1145|      0|	}
 1146|   139k|    } else {
 1147|   139k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|   129k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 10.1k, False: 129k]
  |  Branch (1147:31): [True: 3.27k, False: 126k]
  ------------------
 1148|  13.3k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 199, False: 13.1k]
  ------------------
 1149|    199|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    199|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 196]
  ------------------
 1151|    196|                ret = temp;
 1152|    196|	    }
 1153|  13.3k|	    ret[len++] = '/';
 1154|  13.3k|	    ret[len++] = '/';
 1155|  13.3k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 4.34k, False: 9.03k]
  ------------------
 1156|  4.34k|		p = uri->user;
 1157|  39.0M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 39.0M, False: 4.33k]
  ------------------
 1158|  39.0M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 2.21k, False: 39.0M]
  ------------------
 1159|  2.21k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  2.21k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 11, False: 2.20k]
  ------------------
 1161|  2.20k|                        ret = temp;
 1162|  2.20k|		    }
 1163|  39.0M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  39.0M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  78.0M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  78.0M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  78.0M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 28.3k, False: 38.9M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 23.9k, False: 4.38k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  38.9M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 36.9M, False: 1.99M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 36.9M, False: 6.36k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.99M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 54.6k, False: 1.94M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 26.4k, False: 28.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.97M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.67k, False: 1.96M]
  |  |  |  |  |  Branch (79:37): [True: 1.86k, False: 1.96M]
  |  |  |  |  |  Branch (79:53): [True: 2.70k, False: 1.96M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.97M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 1.38k, False: 1.96M]
  |  |  |  |  |  Branch (80:21): [True: 2.02k, False: 1.96M]
  |  |  |  |  |  Branch (80:37): [True: 924, False: 1.96M]
  |  |  |  |  |  Branch (80:53): [True: 1.34k, False: 1.95M]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.97M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.52k, False: 1.95M]
  |  |  |  |  |  Branch (81:21): [True: 1.48k, False: 1.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|  1.95M|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 3.49k, False: 1.95M]
  |  Branch (1164:23): [True: 4.25k, False: 1.94M]
  ------------------
 1165|  1.94M|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 375, False: 1.94M]
  |  Branch (1165:23): [True: 2.59k, False: 1.94M]
  ------------------
 1166|  1.94M|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.06k, False: 1.94M]
  |  Branch (1166:23): [True: 1.15k, False: 1.94M]
  ------------------
 1167|  1.94M|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 436, False: 1.94M]
  ------------------
 1168|  37.0M|			ret[len++] = *p++;
 1169|  1.94M|		    else {
 1170|  1.94M|			int val = *(unsigned char *)p++;
 1171|  1.94M|			int hi = val / 0x10, lo = val % 0x10;
 1172|  1.94M|			ret[len++] = '%';
 1173|  1.94M|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 4.01k, False: 1.93M]
  ------------------
 1174|  1.94M|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 33.0k, False: 1.90M]
  ------------------
 1175|  1.94M|		    }
 1176|  39.0M|		}
 1177|  4.33k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 204, False: 4.12k]
  ------------------
 1178|    204|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    204|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 3, False: 201]
  ------------------
 1180|    201|                    ret = temp;
 1181|    201|		}
 1182|  4.33k|		ret[len++] = '@';
 1183|  4.33k|	    }
 1184|  13.3k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 10.0k, False: 3.26k]
  ------------------
 1185|  10.0k|		p = uri->server;
 1186|  3.90M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 3.89M, False: 10.0k]
  ------------------
 1187|  3.89M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 256, False: 3.89M]
  ------------------
 1188|    256|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    256|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 8, False: 248]
  ------------------
 1190|    248|			ret = temp;
 1191|    248|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  3.89M|		    ret[len++] = (xmlChar) *p++;
 1194|  3.89M|		}
 1195|  10.0k|	    }
 1196|  13.3k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.58k, False: 11.7k]
  ------------------
 1197|  1.58k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 197, False: 1.38k]
  ------------------
 1198|    197|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    197|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 1, False: 196]
  ------------------
 1200|    196|                    ret = temp;
 1201|    196|                }
 1202|  1.58k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.58k|            }
 1204|   126k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 126k]
  ------------------
 1205|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1205:10): [True: 0, False: 0]
  ------------------
 1206|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1207|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1207:21): [True: 0, False: 0]
  ------------------
 1208|      0|                ret = temp;
 1209|      0|	    }
 1210|      0|	    ret[len++] = '/';
 1211|      0|	    ret[len++] = '/';
 1212|      0|	    p = uri->authority;
 1213|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1213:13): [True: 0, False: 0]
  ------------------
 1214|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1214:7): [True: 0, False: 0]
  ------------------
 1215|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1216|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1216:25): [True: 0, False: 0]
  ------------------
 1217|      0|                    ret = temp;
 1218|      0|		}
 1219|      0|		if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (68:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   80|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1220|      0|                    ((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) ||
  ------------------
  |  Branch (1220:21): [True: 0, False: 0]
  |  Branch (1220:40): [True: 0, False: 0]
  |  Branch (1220:59): [True: 0, False: 0]
  ------------------
 1221|      0|                    ((*(p) == ':')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1221:21): [True: 0, False: 0]
  |  Branch (1221:40): [True: 0, False: 0]
  |  Branch (1221:59): [True: 0, False: 0]
  ------------------
 1222|      0|                    ((*(p) == '=')) || ((*(p) == '+')))
  ------------------
  |  Branch (1222:21): [True: 0, False: 0]
  |  Branch (1222:40): [True: 0, False: 0]
  ------------------
 1223|      0|		    ret[len++] = *p++;
 1224|      0|		else {
 1225|      0|		    int val = *(unsigned char *)p++;
 1226|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1227|      0|		    ret[len++] = '%';
 1228|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1228:26): [True: 0, False: 0]
  ------------------
 1229|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1229:26): [True: 0, False: 0]
  ------------------
 1230|      0|		}
 1231|      0|	    }
 1232|   126k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 842, False: 125k]
  ------------------
 1233|    842|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 205, False: 637]
  ------------------
 1234|    205|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    205|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 1, False: 204]
  ------------------
 1236|    204|                ret = temp;
 1237|    204|	    }
 1238|    842|	}
 1239|   139k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 132k, False: 7.30k]
  ------------------
 1240|   132k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|   132k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 9.18k, False: 123k]
  ------------------
 1246|  9.18k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 8.31k, False: 874]
  ------------------
 1247|  8.31k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 2.15k, False: 6.15k]
  |  Branch (1247:22): [True: 1.83k, False: 319]
  ------------------
 1248|  6.47k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 862, False: 5.61k]
  |  Branch (1248:22): [True: 540, False: 322]
  ------------------
 1249|  2.37k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 673, False: 1.70k]
  ------------------
 1250|    673|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    673|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    673|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 405, False: 268]
  ------------------
 1251|    405|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 209, False: 196]
  ------------------
 1252|    209|                    temp = xmlSaveUriRealloc(ret, &max);
 1253|    209|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1253:25): [True: 1, False: 208]
  ------------------
 1254|    208|                    ret = temp;
 1255|    208|		}
 1256|    404|		ret[len++] = *p++;
 1257|    404|		ret[len++] = *p++;
 1258|    404|		ret[len++] = *p++;
 1259|    404|	    }
 1260|  6.19M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 6.06M, False: 132k]
  ------------------
 1261|  6.06M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 11.4k, False: 6.05M]
  ------------------
 1262|  11.4k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  11.4k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 8, False: 11.4k]
  ------------------
 1264|  11.4k|                    ret = temp;
 1265|  11.4k|		}
 1266|  6.06M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  6.06M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  12.1M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  12.1M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  12.1M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 769k, False: 5.29M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 765k, False: 3.42k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  5.30M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 2.55M, False: 2.74M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 2.55M, False: 4.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  2.74M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 229k, False: 2.51M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 212k, False: 17.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  2.53M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 32.2k, False: 2.50M]
  |  |  |  |  |  Branch (79:37): [True: 446, False: 2.50M]
  |  |  |  |  |  Branch (79:53): [True: 142k, False: 2.36M]
  |  |  |  |  ------------------
  |  |  |  |   80|  2.53M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 9.38k, False: 2.35M]
  |  |  |  |  |  Branch (80:21): [True: 1.41k, False: 2.35M]
  |  |  |  |  |  Branch (80:37): [True: 2.17M, False: 172k]
  |  |  |  |  |  Branch (80:53): [True: 3.84k, False: 168k]
  |  |  |  |  ------------------
  |  |  |  |   81|  2.53M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 2.05k, False: 166k]
  |  |  |  |  |  Branch (81:21): [True: 2.53k, False: 163k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 132k, False: 31.0k]
  ------------------
 1267|  31.0k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 1.73k, False: 29.3k]
  |  Branch (1267:40): [True: 4.66k, False: 24.6k]
  |  Branch (1267:59): [True: 407, False: 24.2k]
  ------------------
 1268|  24.2k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 1.15k, False: 23.1k]
  |  Branch (1268:33): [True: 2.19k, False: 20.9k]
  |  Branch (1268:52): [True: 1.40k, False: 19.5k]
  ------------------
 1269|  19.5k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.13k, False: 17.3k]
  ------------------
 1270|  6.04M|		    ret[len++] = *p++;
 1271|  17.3k|		else {
 1272|  17.3k|		    int val = *(unsigned char *)p++;
 1273|  17.3k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  17.3k|		    ret[len++] = '%';
 1275|  17.3k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.12k, False: 16.2k]
  ------------------
 1276|  17.3k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 9.08k, False: 8.30k]
  ------------------
 1277|  17.3k|		}
 1278|  6.06M|	    }
 1279|   132k|	}
 1280|   139k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 7.25k, False: 132k]
  ------------------
 1281|  7.25k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 198, False: 7.06k]
  ------------------
 1282|    198|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    198|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 197]
  ------------------
 1284|    197|                ret = temp;
 1285|    197|	    }
 1286|  7.25k|	    ret[len++] = '?';
 1287|  7.25k|	    p = uri->query_raw;
 1288|  13.8M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 13.7M, False: 7.24k]
  ------------------
 1289|  13.7M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 10.6k, False: 13.7M]
  ------------------
 1290|  10.6k|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|  10.6k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 13, False: 10.6k]
  ------------------
 1292|  10.6k|                    ret = temp;
 1293|  10.6k|		}
 1294|  13.7M|		ret[len++] = *p++;
 1295|  13.7M|	    }
 1296|   132k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 132k]
  ------------------
 1297|      0|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1297:10): [True: 0, False: 0]
  ------------------
 1298|      0|                temp = xmlSaveUriRealloc(ret, &max);
 1299|      0|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1299:21): [True: 0, False: 0]
  ------------------
 1300|      0|                ret = temp;
 1301|      0|	    }
 1302|      0|	    ret[len++] = '?';
 1303|      0|	    p = uri->query;
 1304|      0|	    while (*p != 0) {
  ------------------
  |  Branch (1304:13): [True: 0, False: 0]
  ------------------
 1305|      0|		if (len + 3 >= max) {
  ------------------
  |  Branch (1305:7): [True: 0, False: 0]
  ------------------
 1306|      0|                    temp = xmlSaveUriRealloc(ret, &max);
 1307|      0|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1307:25): [True: 0, False: 0]
  ------------------
 1308|      0|                    ret = temp;
 1309|      0|		}
 1310|      0|		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|      0|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|      0|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|      0|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|      0|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|      0|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (68:38): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|      0|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (79:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   80|      0|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:21): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (80:53): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |   81|      0|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 0, False: 0]
  |  |  |  |  |  Branch (81:21): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|      0|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 0, False: 0]
  |  |  |  Branch (95:41): [True: 0, False: 0]
  |  |  |  Branch (95:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   96|      0|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 0, False: 0]
  |  |  |  Branch (96:25): [True: 0, False: 0]
  |  |  |  Branch (96:41): [True: 0, False: 0]
  |  |  |  Branch (96:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   97|      0|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 0, False: 0]
  |  |  |  Branch (97:25): [True: 0, False: 0]
  |  |  |  Branch (97:41): [True: 0, False: 0]
  |  |  |  Branch (97:57): [True: 0, False: 0]
  |  |  ------------------
  |  |   98|      0|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1311|      0|		    ret[len++] = *p++;
 1312|      0|		else {
 1313|      0|		    int val = *(unsigned char *)p++;
 1314|      0|		    int hi = val / 0x10, lo = val % 0x10;
 1315|      0|		    ret[len++] = '%';
 1316|      0|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1316:26): [True: 0, False: 0]
  ------------------
 1317|      0|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1317:26): [True: 0, False: 0]
  ------------------
 1318|      0|		}
 1319|      0|	    }
 1320|      0|	}
 1321|   139k|    }
 1322|   139k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 8.80k, False: 130k]
  ------------------
 1323|  8.80k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 367, False: 8.44k]
  ------------------
 1324|    367|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    367|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 3, False: 364]
  ------------------
 1326|    364|            ret = temp;
 1327|    364|	}
 1328|  8.80k|	ret[len++] = '#';
 1329|  8.80k|	p = uri->fragment;
 1330|  66.6k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 57.8k, False: 8.80k]
  ------------------
 1331|  57.8k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 404, False: 57.3k]
  ------------------
 1332|    404|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    404|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 3, False: 401]
  ------------------
 1334|    401|                ret = temp;
 1335|    401|	    }
 1336|  57.7k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  57.7k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|   115k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   115k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|   115k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 7.03k, False: 50.7k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 6.65k, False: 377]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  51.1k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 28.2k, False: 22.8k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 26.7k, False: 1.49k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  24.3k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 7.09k, False: 17.2k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 3.18k, False: 3.91k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  21.1k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 436, False: 20.7k]
  |  |  |  |  |  Branch (79:37): [True: 258, False: 20.4k]
  |  |  |  |  |  Branch (79:53): [True: 2.97k, False: 17.5k]
  |  |  |  |  ------------------
  |  |  |  |   80|  21.1k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 651, False: 16.8k]
  |  |  |  |  |  Branch (80:21): [True: 363, False: 16.5k]
  |  |  |  |  |  Branch (80:37): [True: 719, False: 15.7k]
  |  |  |  |  |  Branch (80:53): [True: 493, False: 15.2k]
  |  |  |  |  ------------------
  |  |  |  |   81|  21.1k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 491, False: 14.8k]
  |  |  |  |  |  Branch (81:21): [True: 459, False: 14.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  14.3k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 799, False: 13.5k]
  |  |  |  Branch (95:41): [True: 745, False: 12.8k]
  |  |  |  Branch (95:57): [True: 489, False: 12.3k]
  |  |  ------------------
  |  |   96|  14.3k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 509, False: 11.8k]
  |  |  |  Branch (96:25): [True: 314, False: 11.4k]
  |  |  |  Branch (96:41): [True: 194, False: 11.2k]
  |  |  |  Branch (96:57): [True: 306, False: 10.9k]
  |  |  ------------------
  |  |   97|  14.3k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 491, False: 10.5k]
  |  |  |  Branch (97:25): [True: 543, False: 9.95k]
  |  |  |  Branch (97:41): [True: 8.49k, False: 1.46k]
  |  |  |  Branch (97:57): [True: 429, False: 1.03k]
  |  |  ------------------
  |  |   98|  14.3k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 430, False: 602]
  |  |  ------------------
  ------------------
 1337|  57.1k|		ret[len++] = *p++;
 1338|    602|	    else {
 1339|    602|		int val = *(unsigned char *)p++;
 1340|    602|		int hi = val / 0x10, lo = val % 0x10;
 1341|    602|		ret[len++] = '%';
 1342|    602|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 368, False: 234]
  ------------------
 1343|    602|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 318, False: 284]
  ------------------
 1344|    602|	    }
 1345|  57.7k|	}
 1346|  8.80k|    }
 1347|   139k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 200, False: 139k]
  ------------------
 1348|    200|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    200|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 3, False: 197]
  ------------------
 1350|    197|        ret = temp;
 1351|    197|    }
 1352|   139k|    ret[len] = 0;
 1353|   139k|    return(ret);
 1354|       |
 1355|     62|mem_error:
 1356|     62|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|   139k|}
xmlFreeURI:
 1412|  1.66M|xmlFreeURI(xmlURI *uri) {
 1413|  1.66M|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 97.6k, False: 1.57M]
  ------------------
 1414|       |
 1415|  1.57M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 44.0k, False: 1.52M]
  ------------------
 1416|  1.57M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 32.1k, False: 1.53M]
  ------------------
 1417|  1.57M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 7.91k, False: 1.56M]
  ------------------
 1418|  1.57M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 269k, False: 1.30M]
  ------------------
 1419|  1.57M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 1.27M, False: 299k]
  ------------------
 1420|  1.57M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 1.57M]
  ------------------
 1421|  1.57M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 1.57M]
  ------------------
 1422|  1.57M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 12.5k, False: 1.55M]
  ------------------
 1423|  1.57M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 17.1k, False: 1.55M]
  ------------------
 1424|  1.57M|    xmlFree(uri);
 1425|  1.57M|}
xmlNormalizeURIPath:
 1555|  9.44k|xmlNormalizeURIPath(char *path) {
 1556|  9.44k|    return(xmlNormalizePath(path, 0));
 1557|  9.44k|}
xmlURIUnescapeString:
 1580|  2.76M|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|  2.76M|    char *ret, *out;
 1582|  2.76M|    const char *in;
 1583|       |
 1584|  2.76M|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 2.76M]
  ------------------
 1585|      0|	return(NULL);
 1586|  2.76M|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 1.28M, False: 1.48M]
  ------------------
 1587|  2.76M|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 2.76M]
  ------------------
 1588|       |
 1589|  2.76M|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 2.76M, False: 0]
  ------------------
 1590|  2.76M|	ret = xmlMalloc(len + 1);
 1591|  2.76M|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 338, False: 2.76M]
  ------------------
 1592|    338|	    return(NULL);
 1593|  2.76M|    } else
 1594|      0|	ret = target;
 1595|  2.76M|    in = str;
 1596|  2.76M|    out = ret;
 1597|   158M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 155M, False: 2.76M]
  ------------------
 1598|   155M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 152M, False: 2.90M]
  |  Branch (1598:19): [True: 1.95M, False: 150M]
  |  Branch (1598:35): [True: 1.95M, False: 1.84k]
  |  Branch (1598:54): [True: 1.95M, False: 1.11k]
  ------------------
 1599|  1.95M|            int c = 0;
 1600|  1.95M|	    in++;
 1601|  1.95M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 1.95M, False: 0]
  |  Branch (1601:26): [True: 1.93M, False: 18.1k]
  ------------------
 1602|  1.93M|	        c = (*in - '0');
 1603|  18.1k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 7.14k, False: 11.0k]
  |  Branch (1603:31): [True: 7.14k, False: 0]
  ------------------
 1604|  7.14k|	        c = (*in - 'a') + 10;
 1605|  11.0k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 11.0k, False: 0]
  |  Branch (1605:31): [True: 11.0k, False: 0]
  ------------------
 1606|  11.0k|	        c = (*in - 'A') + 10;
 1607|  1.95M|	    in++;
 1608|  1.95M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 1.95M, False: 0]
  |  Branch (1608:26): [True: 1.92M, False: 30.2k]
  ------------------
 1609|  1.92M|	        c = c * 16 + (*in - '0');
 1610|  30.2k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 7.60k, False: 22.6k]
  |  Branch (1610:31): [True: 7.60k, False: 0]
  ------------------
 1611|  7.60k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  22.6k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 22.6k, False: 0]
  |  Branch (1612:31): [True: 22.6k, False: 0]
  ------------------
 1613|  22.6k|	        c = c * 16 + (*in - 'A') + 10;
 1614|  1.95M|	    in++;
 1615|  1.95M|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|  1.95M|	    *out++ = (char) c;
 1618|   153M|	} else {
 1619|   153M|	    *out++ = *in++;
 1620|   153M|	    len--;
 1621|   153M|	}
 1622|   155M|    }
 1623|  2.76M|    *out = 0;
 1624|  2.76M|    return(ret);
 1625|  2.76M|}
xmlURIEscapeStr:
 1637|  2.41k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  2.41k|    xmlChar *ret, ch;
 1639|  2.41k|    const xmlChar *in;
 1640|  2.41k|    int len, out;
 1641|       |
 1642|  2.41k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2.41k]
  ------------------
 1643|      0|	return(NULL);
 1644|  2.41k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.41k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  2.41k|    len = xmlStrlen(str);
 1647|  2.41k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 2.41k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  2.41k|    len += 20;
 1651|  2.41k|    ret = xmlMalloc(len);
 1652|  2.41k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 4, False: 2.41k]
  ------------------
 1653|      4|	return(NULL);
 1654|  2.41k|    in = (const xmlChar *) str;
 1655|  2.41k|    out = 0;
 1656|  3.46M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 3.46M, False: 2.41k]
  ------------------
 1657|  3.46M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 827, False: 3.46M]
  ------------------
 1658|    827|            xmlChar *temp;
 1659|    827|            int newSize;
 1660|       |
 1661|    827|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    827|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    827|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 827]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    827|            temp = xmlRealloc(ret, newSize);
 1667|    827|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 1, False: 826]
  ------------------
 1668|      1|		xmlFree(ret);
 1669|      1|		return(NULL);
 1670|      1|	    }
 1671|    826|	    ret = temp;
 1672|    826|            len = newSize;
 1673|    826|	}
 1674|       |
 1675|  3.46M|	ch = *in;
 1676|       |
 1677|  3.46M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  3.46M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  6.92M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  6.92M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  6.92M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 240k, False: 3.22M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 173k, False: 66.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.28M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 188k, False: 3.10M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 119k, False: 68.9k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  3.17M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 104k, False: 3.06M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 21.4k, False: 83.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  3.14M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 31.1k, False: 3.11M]
  |  |  |  |  |  Branch (79:37): [True: 414, False: 3.11M]
  |  |  |  |  |  Branch (79:53): [True: 128k, False: 2.98M]
  |  |  |  |  ------------------
  |  |  |  |   80|  3.14M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.14k, False: 2.98M]
  |  |  |  |  |  Branch (80:21): [True: 1.92k, False: 2.98M]
  |  |  |  |  |  Branch (80:37): [True: 1.25M, False: 1.73M]
  |  |  |  |  |  Branch (80:53): [True: 4.01k, False: 1.72M]
  |  |  |  |  ------------------
  |  |  |  |   81|  3.14M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 19.5k, False: 1.70M]
  |  |  |  |  |  Branch (81:21): [True: 20.0k, False: 1.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 3.46M, False: 864]
  |  Branch (1677:45): [True: 1.57M, False: 118k]
  ------------------
 1678|  1.57M|	    unsigned char val;
 1679|  1.57M|	    ret[out++] = '%';
 1680|  1.57M|	    val = ch >> 4;
 1681|  1.57M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 1.56M, False: 6.98k]
  ------------------
 1682|  1.56M|		ret[out++] = '0' + val;
 1683|  6.98k|	    else
 1684|  6.98k|		ret[out++] = 'A' + val - 0xA;
 1685|  1.57M|	    val = ch & 0xF;
 1686|  1.57M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 1.50M, False: 62.9k]
  ------------------
 1687|  1.50M|		ret[out++] = '0' + val;
 1688|  62.9k|	    else
 1689|  62.9k|		ret[out++] = 'A' + val - 0xA;
 1690|  1.57M|	    in++;
 1691|  1.89M|	} else {
 1692|  1.89M|	    ret[out++] = *in++;
 1693|  1.89M|	}
 1694|       |
 1695|  3.46M|    }
 1696|  2.41k|    ret[out] = 0;
 1697|  2.41k|    return(ret);
 1698|  2.41k|}
xmlBuildURISafe:
 1972|  1.33M|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|  1.33M|    xmlChar *val = NULL;
 1974|  1.33M|    int ret, len, indx, cur, out;
 1975|  1.33M|    xmlURIPtr ref = NULL;
 1976|  1.33M|    xmlURIPtr bas = NULL;
 1977|  1.33M|    xmlURIPtr res = NULL;
 1978|       |
 1979|  1.33M|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 1.33M]
  ------------------
 1980|      0|        return(1);
 1981|  1.33M|    *valPtr = NULL;
 1982|       |
 1983|  1.33M|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 1.33M]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|  1.33M|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 21.3k, False: 1.31M]
  ------------------
 1987|  21.3k|        val = xmlStrdup(URI);
 1988|  21.3k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 3, False: 21.3k]
  ------------------
 1989|      3|            return(-1);
 1990|  21.3k|        *valPtr = val;
 1991|  21.3k|        return(0);
 1992|  21.3k|    }
 1993|       |
 1994|       |    /*
 1995|       |     * 1) The URI reference is parsed into the potential four components and
 1996|       |     *    fragment identifier, as described in Section 4.3.
 1997|       |     *
 1998|       |     *    NOTE that a completely empty URI is treated by modern browsers
 1999|       |     *    as a reference to "." rather than as a synonym for the current
 2000|       |     *    URI.  Should we do that here?
 2001|       |     */
 2002|  1.31M|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 1.30M, False: 4.04k]
  ------------------
 2003|  1.30M|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  4.04k|    else
 2005|  4.04k|        ret = 0;
 2006|  1.31M|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.35k, False: 1.30M]
  ------------------
 2007|  8.35k|	goto done;
 2008|  1.30M|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 1.29M, False: 4.04k]
  |  Branch (2008:26): [True: 5.03k, False: 1.29M]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  5.03k|	val = xmlStrdup(URI);
 2013|  5.03k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 25, False: 5.01k]
  ------------------
 2014|     25|            ret = -1;
 2015|  5.03k|	goto done;
 2016|  5.03k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|  1.29M|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  1.29M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 1.27M, False: 26.1k]
  ------------------
 2023|  1.27M|        xmlFreeURI(ref);
 2024|  1.27M|        return(xmlResolvePath(URI, base, valPtr));
 2025|  1.27M|    }
 2026|       |
 2027|       |#if defined(LIBXML_WINPATH_ENABLED)
 2028|       |    /*
 2029|       |     * Resolve paths with a Windows drive letter as filesystem path
 2030|       |     * even if base has a scheme.
 2031|       |     */
 2032|       |    if ((ref != NULL) && (ref->path != NULL)) {
 2033|       |        int c = ref->path[0];
 2034|       |
 2035|       |        if ((((c >= 'A') && (c <= 'Z')) ||
 2036|       |             ((c >= 'a') && (c <= 'z'))) &&
 2037|       |            (ref->path[1] == ':')) {
 2038|       |            xmlFreeURI(ref);
 2039|       |            return(xmlResolvePath(URI, base, valPtr));
 2040|       |        }
 2041|       |    }
 2042|       |#endif
 2043|       |
 2044|  26.1k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  26.1k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 149, False: 26.0k]
  ------------------
 2046|    149|        goto done;
 2047|  26.0k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 7.08k, False: 18.9k]
  ------------------
 2048|  7.08k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.45k, False: 626]
  ------------------
 2049|  6.45k|            ret = 0;
 2050|  6.45k|	    val = xmlSaveUri(ref);
 2051|  6.45k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 16, False: 6.43k]
  ------------------
 2052|     16|                ret = -1;
 2053|  6.45k|        }
 2054|  7.08k|	goto done;
 2055|  7.08k|    }
 2056|  18.9k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 2.64k, False: 16.2k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  2.64k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 398, False: 2.24k]
  ------------------
 2061|    398|	    xmlFree(bas->fragment);
 2062|    398|	    bas->fragment = NULL;
 2063|    398|	}
 2064|  2.64k|	val = xmlSaveUri(bas);
 2065|  2.64k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 32, False: 2.61k]
  ------------------
 2066|     32|            ret = -1;
 2067|  2.64k|	goto done;
 2068|  2.64k|    }
 2069|       |
 2070|       |    /*
 2071|       |     * 2) If the path component is empty and the scheme, authority, and
 2072|       |     *    query components are undefined, then it is a reference to the
 2073|       |     *    current document and we are done.  Otherwise, the reference URI's
 2074|       |     *    query and fragment components are defined as found (or not found)
 2075|       |     *    within the URI reference and not inherited from the base URI.
 2076|       |     *
 2077|       |     *    NOTE that in modern browsers, the parsing differs from the above
 2078|       |     *    in the following aspect:  the query component is allowed to be
 2079|       |     *    defined while still treating this as a reference to the current
 2080|       |     *    document.
 2081|       |     */
 2082|  16.2k|    ret = -1;
 2083|  16.2k|    res = xmlCreateURI();
 2084|  16.2k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 28, False: 16.2k]
  ------------------
 2085|     28|	goto done;
 2086|  16.2k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 16.2k, False: 0]
  |  Branch (2086:34): [True: 5.49k, False: 10.7k]
  ------------------
 2087|  5.49k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.49k, False: 0]
  |  Branch (2087:31): [True: 4.66k, False: 830]
  ------------------
 2088|  4.66k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.66k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.40k, False: 262]
  ------------------
 2089|  4.40k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.69k, False: 713]
  ------------------
 2090|  3.69k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.69k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 11, False: 3.68k]
  ------------------
 2092|     11|                goto done;
 2093|  3.69k|        }
 2094|  4.39k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.39k]
  ------------------
 2095|      0|	    res->authority = xmlMemStrdup(bas->authority);
 2096|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2096:17): [True: 0, False: 0]
  ------------------
 2097|      0|                goto done;
 2098|  4.39k|        } else {
 2099|  4.39k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 2.51k, False: 1.88k]
  ------------------
 2100|  2.51k|		res->server = xmlMemStrdup(bas->server);
 2101|  2.51k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 9, False: 2.50k]
  ------------------
 2102|      9|                    goto done;
 2103|  2.51k|            }
 2104|  4.38k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 2.05k, False: 2.33k]
  ------------------
 2105|  2.05k|		res->user = xmlMemStrdup(bas->user);
 2106|  2.05k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 7, False: 2.04k]
  ------------------
 2107|      7|                    goto done;
 2108|  2.05k|            }
 2109|  4.37k|	    res->port = bas->port;
 2110|  4.37k|	}
 2111|  4.37k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.40k, False: 1.97k]
  ------------------
 2112|  2.40k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.40k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 10, False: 2.39k]
  ------------------
 2114|     10|                goto done;
 2115|  2.40k|        }
 2116|  4.36k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 893, False: 3.47k]
  ------------------
 2117|    893|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    893|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 4, False: 889]
  ------------------
 2119|      4|                goto done;
 2120|  3.47k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 3.47k]
  ------------------
 2121|      0|	    res->query = xmlMemStrdup(ref->query);
 2122|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2122:17): [True: 0, False: 0]
  ------------------
 2123|      0|                goto done;
 2124|  3.47k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.56k, False: 1.90k]
  ------------------
 2125|  1.56k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.56k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 4, False: 1.56k]
  ------------------
 2127|      4|                goto done;
 2128|  1.90k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 1.90k]
  ------------------
 2129|      0|	    res->query = xmlMemStrdup(bas->query);
 2130|      0|            if (res->query == NULL)
  ------------------
  |  Branch (2130:17): [True: 0, False: 0]
  ------------------
 2131|      0|                goto done;
 2132|      0|        }
 2133|  4.36k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.45k, False: 910]
  ------------------
 2134|  3.45k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.45k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 7, False: 3.44k]
  ------------------
 2136|      7|                goto done;
 2137|  3.45k|        }
 2138|  4.35k|	goto step_7;
 2139|  4.36k|    }
 2140|       |
 2141|       |    /*
 2142|       |     * 3) If the scheme component is defined, indicating that the reference
 2143|       |     *    starts with a scheme name, then the reference is interpreted as an
 2144|       |     *    absolute URI and we are done.  Otherwise, the reference URI's
 2145|       |     *    scheme is inherited from the base URI's scheme component.
 2146|       |     */
 2147|  11.8k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 11.8k]
  ------------------
 2148|      0|	val = xmlSaveUri(ref);
 2149|      0|        if (val != NULL)
  ------------------
  |  Branch (2149:13): [True: 0, False: 0]
  ------------------
 2150|      0|            ret = 0;
 2151|      0|	goto done;
 2152|      0|    }
 2153|  11.8k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 7.92k, False: 3.92k]
  ------------------
 2154|  7.92k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  7.92k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 18, False: 7.90k]
  ------------------
 2156|     18|            goto done;
 2157|  7.92k|    }
 2158|       |
 2159|  11.8k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 2.13k, False: 9.70k]
  ------------------
 2160|  2.13k|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|  2.13k|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 3, False: 2.12k]
  ------------------
 2162|      3|            goto done;
 2163|  9.70k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 9.70k]
  ------------------
 2164|      0|	res->query = xmlMemStrdup(ref->query);
 2165|      0|        if (res->query == NULL)
  ------------------
  |  Branch (2165:13): [True: 0, False: 0]
  ------------------
 2166|      0|            goto done;
 2167|      0|    }
 2168|  11.8k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 2.41k, False: 9.41k]
  ------------------
 2169|  2.41k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  2.41k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 2, False: 2.41k]
  ------------------
 2171|      2|            goto done;
 2172|  2.41k|    }
 2173|       |
 2174|       |    /*
 2175|       |     * 4) If the authority component is defined, then the reference is a
 2176|       |     *    network-path and we skip to step 7.  Otherwise, the reference
 2177|       |     *    URI's authority is inherited from the base URI's authority
 2178|       |     *    component, which will also be undefined if the URI scheme does not
 2179|       |     *    use an authority component.
 2180|       |     */
 2181|  11.8k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 11.8k]
  |  Branch (2181:37): [True: 1.04k, False: 10.7k]
  ------------------
 2182|  10.7k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  10.7k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 277, False: 10.5k]
  ------------------
 2183|  1.32k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.32k]
  ------------------
 2184|      0|	    res->authority = xmlMemStrdup(ref->authority);
 2185|      0|            if (res->authority == NULL)
  ------------------
  |  Branch (2185:17): [True: 0, False: 0]
  ------------------
 2186|      0|                goto done;
 2187|  1.32k|        } else {
 2188|  1.32k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 1.04k, False: 277]
  ------------------
 2189|  1.04k|                res->server = xmlMemStrdup(ref->server);
 2190|  1.04k|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 3, False: 1.04k]
  ------------------
 2191|      3|                    goto done;
 2192|  1.04k|            }
 2193|  1.32k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 226, False: 1.09k]
  ------------------
 2194|    226|		res->user = xmlMemStrdup(ref->user);
 2195|    226|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 1, False: 225]
  ------------------
 2196|      1|                    goto done;
 2197|    226|            }
 2198|  1.32k|            res->port = ref->port;
 2199|  1.32k|	}
 2200|  1.32k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 235, False: 1.08k]
  ------------------
 2201|    235|	    res->path = xmlMemStrdup(ref->path);
 2202|    235|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 2, False: 233]
  ------------------
 2203|      2|                goto done;
 2204|    235|        }
 2205|  1.32k|	goto step_7;
 2206|  1.32k|    }
 2207|  10.5k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 10.5k]
  ------------------
 2208|      0|	res->authority = xmlMemStrdup(bas->authority);
 2209|      0|        if (res->authority == NULL)
  ------------------
  |  Branch (2209:13): [True: 0, False: 0]
  ------------------
 2210|      0|            goto done;
 2211|  10.5k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  6.00k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 4.50k, False: 6.00k]
  |  Branch (2211:41): [True: 1.56k, False: 4.43k]
  ------------------
 2212|  6.06k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 4.50k, False: 1.56k]
  ------------------
 2213|  4.50k|	    res->server = xmlMemStrdup(bas->server);
 2214|  4.50k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 10, False: 4.49k]
  ------------------
 2215|     10|                goto done;
 2216|  4.50k|        }
 2217|  6.05k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 868, False: 5.18k]
  ------------------
 2218|    868|	    res->user = xmlMemStrdup(bas->user);
 2219|    868|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 2, False: 866]
  ------------------
 2220|      2|                goto done;
 2221|    868|        }
 2222|  6.05k|	res->port = bas->port;
 2223|  6.05k|    }
 2224|       |
 2225|       |    /*
 2226|       |     * 5) If the path component begins with a slash character ("/"), then
 2227|       |     *    the reference is an absolute-path and we skip to step 7.
 2228|       |     */
 2229|  10.4k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 10.4k, False: 0]
  |  Branch (2229:32): [True: 1.02k, False: 9.46k]
  ------------------
 2230|  1.02k|	res->path = xmlMemStrdup(ref->path);
 2231|  1.02k|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 4, False: 1.01k]
  ------------------
 2232|      4|            goto done;
 2233|  1.01k|	goto step_7;
 2234|  1.02k|    }
 2235|       |
 2236|       |
 2237|       |    /*
 2238|       |     * 6) If this step is reached, then we are resolving a relative-path
 2239|       |     *    reference.  The relative path needs to be merged with the base
 2240|       |     *    URI's path.  Although there are many ways to do this, we will
 2241|       |     *    describe a simple method using a separate string buffer.
 2242|       |     *
 2243|       |     * Allocate a buffer large enough for the result string.
 2244|       |     */
 2245|  9.46k|    len = 2; /* extra / and 0 */
 2246|  9.46k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 9.46k, False: 0]
  ------------------
 2247|  9.46k|	len += strlen(ref->path);
 2248|  9.46k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 4.64k, False: 4.82k]
  ------------------
 2249|  4.64k|	len += strlen(bas->path);
 2250|  9.46k|    res->path = xmlMalloc(len);
 2251|  9.46k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 25, False: 9.44k]
  ------------------
 2252|     25|	goto done;
 2253|  9.44k|    res->path[0] = 0;
 2254|       |
 2255|       |    /*
 2256|       |     * a) All but the last segment of the base URI's path component is
 2257|       |     *    copied to the buffer.  In other words, any characters after the
 2258|       |     *    last (right-most) slash character, if any, are excluded.
 2259|       |     */
 2260|  9.44k|    cur = 0;
 2261|  9.44k|    out = 0;
 2262|  9.44k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 4.63k, False: 4.80k]
  ------------------
 2263|  45.2k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 44.2k, False: 973]
  ------------------
 2264|  1.62M|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 1.62M, False: 3.66k]
  |  Branch (2264:38): [True: 1.58M, False: 40.5k]
  ------------------
 2265|  1.58M|		cur++;
 2266|  44.2k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 3.66k, False: 40.5k]
  ------------------
 2267|  3.66k|		break;
 2268|       |
 2269|  40.5k|	    cur++;
 2270|  1.60M|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 1.56M, False: 40.5k]
  ------------------
 2271|  1.56M|		res->path[out] = bas->path[out];
 2272|  1.56M|		out++;
 2273|  1.56M|	    }
 2274|  40.5k|	}
 2275|  4.63k|    }
 2276|  9.44k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  9.44k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 9.44k, False: 0]
  |  Branch (2282:30): [True: 9.24k, False: 195]
  ------------------
 2283|  9.24k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  9.24k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  2.60k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 5.64k, False: 3.60k]
  |  Branch (2287:21): [True: 3.03k, False: 2.60k]
  |  Branch (2287:46): [True: 1.00k, False: 1.59k]
  ------------------
 2288|  4.04k|	    res->path[out++] = '/';
 2289|   633k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 624k, False: 9.24k]
  ------------------
 2290|   624k|	    res->path[out++] = ref->path[indx++];
 2291|   624k|	}
 2292|  9.24k|    }
 2293|  9.44k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  9.44k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  16.1k|step_7:
 2301|       |
 2302|       |    /*
 2303|       |     * 7) The resulting URI components, including any inherited from the
 2304|       |     *    base URI, are recombined to give the absolute form of the URI
 2305|       |     *    reference.
 2306|       |     */
 2307|  16.1k|    val = xmlSaveUri(res);
 2308|  16.1k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 16.0k, False: 85]
  ------------------
 2309|  16.0k|        ret = 0;
 2310|       |
 2311|  39.5k|done:
 2312|  39.5k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 27.8k, False: 11.6k]
  ------------------
 2313|  27.8k|	xmlFreeURI(ref);
 2314|  39.5k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 18.9k, False: 20.6k]
  ------------------
 2315|  18.9k|	xmlFreeURI(bas);
 2316|  39.5k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 16.2k, False: 23.2k]
  ------------------
 2317|  16.2k|	xmlFreeURI(res);
 2318|  39.5k|    *valPtr = val;
 2319|  39.5k|    return(ret);
 2320|  16.1k|}
xmlBuildRelativeURISafe:
 2493|  95.0k|{
 2494|  95.0k|    xmlChar *val = NULL;
 2495|  95.0k|    int ret = 0;
 2496|  95.0k|    size_t ix = 0;
 2497|  95.0k|    size_t nbslash = 0;
 2498|  95.0k|    size_t len = 0;
 2499|  95.0k|    xmlURIPtr ref = NULL;
 2500|  95.0k|    xmlURIPtr bas = NULL;
 2501|  95.0k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  95.0k|    xmlChar *vptr;
 2503|  95.0k|    int remove_path = 0;
 2504|  95.0k|    int refDrive, baseDrive;
 2505|       |
 2506|  95.0k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 95.0k]
  ------------------
 2507|      0|        return(1);
 2508|  95.0k|    *valPtr = NULL;
 2509|  95.0k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 95.0k]
  |  Branch (2509:26): [True: 629, False: 94.4k]
  ------------------
 2510|    629|	return(1);
 2511|       |
 2512|  94.4k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  94.4k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 36, False: 94.3k]
  ------------------
 2514|     36|        goto done;
 2515|  94.3k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 392, False: 93.9k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    392|        ret = 0;
 2518|    392|        val = xmlStrdup(URI);
 2519|    392|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 391]
  ------------------
 2520|      1|            ret = -1;
 2521|    392|        goto done;
 2522|    392|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  93.9k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 93.9k]
  |  Branch (2525:27): [True: 91.4k, False: 2.53k]
  ------------------
 2526|  91.4k|        goto done;
 2527|       |
 2528|  2.53k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  2.53k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 10, False: 2.52k]
  ------------------
 2530|     10|        goto done;
 2531|  2.52k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 234, False: 2.29k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    234|        ret = 0;
 2534|    234|        goto done;
 2535|    234|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  2.29k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 205, False: 2.08k]
  ------------------
 2542|  2.08k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 68, False: 2.01k]
  ------------------
 2543|  2.01k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 2.01k]
  ------------------
 2544|  2.01k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 2.01k]
  ------------------
 2545|    273|	goto done;
 2546|    273|    }
 2547|  2.01k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 120, False: 1.89k]
  ------------------
 2548|    120|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    120|#define BAD_CAST (xmlChar *)
  ------------------
 2549|    120|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 2, False: 118]
  ------------------
 2550|      2|            ret = -1;
 2551|    120|	goto done;
 2552|    120|    }
 2553|  1.89k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 9, False: 1.88k]
  ------------------
 2554|      9|	val = xmlStrdup((xmlChar *)ref->path);
 2555|      9|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 8]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      8|	goto escape;
 2560|      9|    }
 2561|  1.88k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 66, False: 1.82k]
  ------------------
 2562|     66|        ref->path = (char *) "/";
 2563|     66|	remove_path = 1;
 2564|     66|    }
 2565|       |
 2566|  1.88k|    bptr = (xmlChar *) bas->path;
 2567|  1.88k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.88k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 320, False: 1.56k]
  ------------------
 2573|    320|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|  1.56k|    {
 2579|  1.56k|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  4.22k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.65k, False: 1.56k]
  |  Branch (2584:37): [True: 2.65k, False: 0]
  ------------------
 2585|  2.65k|	    pos++;
 2586|       |
 2587|  1.56k|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 1.56k]
  ------------------
 2588|      0|	    val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 2589|      0|            if (val == NULL)
  ------------------
  |  Branch (2589:17): [True: 0, False: 0]
  ------------------
 2590|      0|                ret = -1;
 2591|      0|	    goto done;		/* (I can't imagine why anyone would do this) */
 2592|      0|	}
 2593|       |
 2594|       |	/*
 2595|       |	 * In URI, "back up" to the last '/' encountered.  This will be the
 2596|       |	 * beginning of the "unique" suffix of URI
 2597|       |	 */
 2598|  1.56k|	ix = pos;
 2599|  2.72k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.31k, False: 1.41k]
  ------------------
 2600|  1.31k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 155, False: 1.15k]
  ------------------
 2601|    155|		break;
 2602|  1.31k|	}
 2603|  1.56k|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   228k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 226k, False: 1.56k]
  ------------------
 2609|   226k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 57.8k, False: 168k]
  ------------------
 2610|  57.8k|		nbslash++;
 2611|   226k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|  1.56k|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 404, False: 1.16k]
  |  Branch (2616:22): [True: 20, False: 384]
  ------------------
 2617|     20|	    val = xmlStrdup(BAD_CAST "./");
  ------------------
  |  |   34|     20|#define BAD_CAST (xmlChar *)
  ------------------
 2618|     20|            if (val == NULL)
  ------------------
  |  Branch (2618:17): [True: 1, False: 19]
  ------------------
 2619|      1|                ret = -1;
 2620|     20|	    goto done;
 2621|     20|	}
 2622|       |
 2623|  1.54k|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|  1.54k|    }
 2625|       |
 2626|  1.54k|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 384, False: 1.16k]
  ------------------
 2627|    384|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 384, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    384|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    384|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    384|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 2, False: 382]
  ------------------
 2631|      2|                ret = -1;
 2632|    384|        }
 2633|    384|	goto done;
 2634|    384|    }
 2635|       |
 2636|       |    /*
 2637|       |     * Allocate just enough space for the returned string -
 2638|       |     * length of the remainder of the URI, plus enough space
 2639|       |     * for the "../" groups, plus one for the terminator
 2640|       |     */
 2641|  1.16k|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 1.16k]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|  1.16k|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|  1.16k|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 1, False: 1.16k]
  ------------------
 2647|      1|        ret = -1;
 2648|      1|	goto done;
 2649|      1|    }
 2650|  1.16k|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  58.9k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 57.8k, False: 1.16k]
  ------------------
 2655|  57.8k|	*vptr++ = '.';
 2656|  57.8k|	*vptr++ = '.';
 2657|  57.8k|	*vptr++ = '/';
 2658|  57.8k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|  1.16k|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 1.16k, False: 0]
  ------------------
 2663|  1.16k|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 1.16k, False: 0]
  |  Branch (2663:29): [True: 1.16k, False: 0]
  ------------------
 2664|  1.16k|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 1.16k]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|  1.16k|	} else {
 2668|  1.16k|	    memcpy (vptr, uptr, len);
 2669|  1.16k|	    vptr[len - 1] = 0;
 2670|  1.16k|	}
 2671|  1.16k|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|  1.17k|escape:
 2676|       |    /* escape the freshly-built path */
 2677|  1.17k|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|  1.17k|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|  1.17k|#define BAD_CAST (xmlChar *)
  ------------------
 2680|  1.17k|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 2, False: 1.17k]
  ------------------
 2681|      2|        ret = -1;
 2682|  1.17k|    else
 2683|  1.17k|        ret = 0;
 2684|  1.17k|    xmlFree(vptr);
 2685|       |
 2686|  94.4k|done:
 2687|  94.4k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 94.3k, False: 56]
  |  Branch (2687:23): [True: 92.2k, False: 2.08k]
  ------------------
 2688|  92.2k|        val = xmlSaveUri(ref);
 2689|  92.2k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 17, False: 92.2k]
  ------------------
 2690|     17|            ret = -1;
 2691|  92.2k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  94.4k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 66, False: 94.3k]
  ------------------
 2697|     66|        ref->path = NULL;
 2698|  94.4k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 93.9k, False: 428]
  ------------------
 2699|  93.9k|	xmlFreeURI (ref);
 2700|  94.4k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 2.29k, False: 92.1k]
  ------------------
 2701|  2.29k|	xmlFreeURI (bas);
 2702|  94.4k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 73, False: 94.3k]
  ------------------
 2703|     73|        xmlFree(val);
 2704|     73|        val = NULL;
 2705|     73|    }
 2706|       |
 2707|  94.4k|    *valPtr = val;
 2708|  94.4k|    return(ret);
 2709|  1.17k|}
xmlCanonicPath:
 2747|  12.6k|{
 2748|  12.6k|    xmlChar *ret;
 2749|       |
 2750|  12.6k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 12.6k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  12.6k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  12.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 863, False: 11.8k]
  ------------------
 2755|       |	/*
 2756|       |         * Escape all characters except reserved, unreserved and the
 2757|       |         * percent sign.
 2758|       |         *
 2759|       |         * xmlURIEscapeStr already keeps unreserved characters, so we
 2760|       |         * pass gen-delims, sub-delims and "%" to ignore.
 2761|       |         */
 2762|    863|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    863|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  11.8k|    } else {
 2764|  11.8k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  11.8k|    }
 2766|       |
 2767|  12.6k|    return(ret);
 2768|  12.6k|}
xmlPathToURI:
 2781|  12.6k|{
 2782|  12.6k|    return(xmlCanonicPath(path));
 2783|  12.6k|}
uri.c:xmlParse3986URIReference:
  924|  1.45M|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|  1.45M|    int ret;
  926|       |
  927|  1.45M|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 1.45M]
  ------------------
  928|      0|	return(-1);
  929|  1.45M|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|  1.45M|    ret = xmlParse3986URI(uri, str);
  936|  1.45M|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 144, False: 1.45M]
  ------------------
  937|    144|        return(ret);
  938|  1.45M|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 1.42M, False: 32.4k]
  ------------------
  939|  1.42M|	xmlCleanURI(uri);
  940|  1.42M|        ret = xmlParse3986RelativeRef(uri, str);
  941|  1.42M|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 26.5k, False: 1.39M]
  ------------------
  942|  26.5k|	    xmlCleanURI(uri);
  943|  26.5k|	    return(ret);
  944|  26.5k|	}
  945|  1.42M|    }
  946|  1.43M|    return(0);
  947|  1.45M|}
uri.c:xmlCleanURI:
 1383|  2.94M|xmlCleanURI(xmlURIPtr uri) {
 1384|  2.94M|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 2.94M]
  ------------------
 1385|       |
 1386|  2.94M|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 98.8k, False: 2.84M]
  ------------------
 1387|  2.94M|    uri->scheme = NULL;
 1388|  2.94M|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 3.56k, False: 2.93M]
  ------------------
 1389|  2.94M|    uri->server = NULL;
 1390|  2.94M|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 391, False: 2.94M]
  ------------------
 1391|  2.94M|    uri->user = NULL;
 1392|  2.94M|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 20.5k, False: 2.92M]
  ------------------
 1393|  2.94M|    uri->path = NULL;
 1394|  2.94M|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 1.82k, False: 2.93M]
  ------------------
 1395|  2.94M|    uri->fragment = NULL;
 1396|  2.94M|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 2.94M]
  ------------------
 1397|  2.94M|    uri->opaque = NULL;
 1398|  2.94M|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 2.94M]
  ------------------
 1399|  2.94M|    uri->authority = NULL;
 1400|  2.94M|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 2.94k, False: 2.93M]
  ------------------
 1401|  2.94M|    uri->query = NULL;
 1402|  2.94M|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 2.92k, False: 2.93M]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|  2.94M|}
uri.c:xmlParse3986URI:
  885|  1.45M|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|  1.45M|    int ret;
  887|       |
  888|  1.45M|    ret = xmlParse3986Scheme(uri, &str);
  889|  1.45M|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 1.32M, False: 131k]
  ------------------
  890|   131k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 91.3k, False: 40.0k]
  ------------------
  891|  91.3k|	return(1);
  892|  91.3k|    }
  893|  40.0k|    str++;
  894|  40.0k|    ret = xmlParse3986HierPart(uri, &str);
  895|  40.0k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.40k, False: 38.6k]
  ------------------
  896|  38.6k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 2.94k, False: 35.6k]
  ------------------
  897|  2.94k|	str++;
  898|  2.94k|	ret = xmlParse3986Query(uri, &str);
  899|  2.94k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 18, False: 2.92k]
  ------------------
  900|  2.94k|    }
  901|  38.6k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 2.12k, False: 36.4k]
  ------------------
  902|  2.12k|	str++;
  903|  2.12k|	ret = xmlParse3986Fragment(uri, &str);
  904|  2.12k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 5, False: 2.12k]
  ------------------
  905|  2.12k|    }
  906|  38.5k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 6.19k, False: 32.4k]
  ------------------
  907|  6.19k|	xmlCleanURI(uri);
  908|  6.19k|	return(1);
  909|  6.19k|    }
  910|  32.4k|    return(0);
  911|  38.5k|}
uri.c:xmlParse3986Scheme:
  224|  1.45M|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|  1.45M|    const char *cur;
  226|       |
  227|  1.45M|    cur = *str;
  228|  1.45M|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|  1.45M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 128k, False: 1.33M]
  |  |  |  Branch (128:41): [True: 126k, False: 2.02k]
  |  |  ------------------
  |  |  129|  1.45M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.87k, False: 1.32M]
  |  |  |  Branch (129:41): [True: 5.33k, False: 2.54k]
  |  |  ------------------
  ------------------
  229|  1.32M|	return(1);
  230|   131k|    cur++;
  231|       |
  232|       |#if defined(LIBXML_WINPATH_ENABLED)
  233|       |    /*
  234|       |     * Don't treat Windows drive letters as scheme.
  235|       |     */
  236|       |    if (*cur == ':')
  237|       |        return(1);
  238|       |#endif
  239|       |
  240|   313k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   626k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 101k, False: 212k]
  |  |  |  Branch (128:41): [True: 100k, False: 499]
  |  |  ------------------
  |  |  129|   626k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 61.2k, False: 151k]
  |  |  |  Branch (129:41): [True: 60.6k, False: 618]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   465k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 51.2k, False: 100k]
  |  |  |  Branch (127:40): [True: 7.28k, False: 43.9k]
  |  |  ------------------
  ------------------
  241|   182k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 7.01k, False: 137k]
  |  Branch (241:29): [True: 3.99k, False: 133k]
  |  Branch (241:46): [True: 2.20k, False: 131k]
  ------------------
  242|   131k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 131k, False: 0]
  ------------------
  243|   131k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 131k]
  ------------------
  244|   131k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|   131k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|   131k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 47, False: 131k]
  ------------------
  246|     47|            return(-1);
  247|   131k|    }
  248|   131k|    *str = cur;
  249|   131k|    return(0);
  250|   131k|}
uri.c:xmlParse3986HierPart:
  782|  40.0k|{
  783|  40.0k|    const char *cur;
  784|  40.0k|    int ret;
  785|       |
  786|  40.0k|    cur = *str;
  787|       |
  788|  40.0k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 31.0k, False: 8.93k]
  |  Branch (788:26): [True: 30.1k, False: 946]
  ------------------
  789|  30.1k|        cur += 2;
  790|  30.1k|	ret = xmlParse3986Authority(uri, &cur);
  791|  30.1k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.36k, False: 28.7k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  28.7k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  4.31k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 4.31k, False: 24.4k]
  |  Branch (795:31): [True: 4.04k, False: 266]
  ------------------
  796|  4.04k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  4.04k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  28.7k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  28.7k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 10, False: 28.7k]
  ------------------
  799|  28.7k|	*str = cur;
  800|  28.7k|	return(0);
  801|  28.7k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 946, False: 8.93k]
  ------------------
  802|    946|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|    946|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 2, False: 944]
  ------------------
  804|  8.93k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  8.93k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  17.8k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.43k, False: 6.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  15.4k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.84k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.69k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.56k, False: 285]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 389, False: 1.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 691, False: 766]
  |  |  |  |  |  |  |  Branch (131:43): [True: 493, False: 198]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.84k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 639, False: 325]
  |  |  |  |  |  |  |  Branch (132:27): [True: 439, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.32k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  2.64k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.07k, False: 247]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 228, False: 846]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 440, False: 653]
  |  |  |  |  |  |  |  Branch (131:43): [True: 221, False: 219]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.32k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 625, False: 247]
  |  |  |  |  |  |  |  Branch (132:27): [True: 406, False: 219]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 1.84k, False: 4.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  14.5k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 199, False: 5.43k]
  |  |  |  |  |  Branch (139:27): [True: 207, False: 5.23k]
  |  |  |  |  |  Branch (139:46): [True: 225, False: 5.00k]
  |  |  |  |  ------------------
  |  |  |  |  140|  5.63k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 214, False: 4.79k]
  |  |  |  |  |  Branch (140:27): [True: 202, False: 4.59k]
  |  |  |  |  |  Branch (140:46): [True: 203, False: 4.38k]
  |  |  |  |  ------------------
  |  |  |  |  141|  5.63k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 617, False: 3.77k]
  |  |  |  |  |  Branch (141:27): [True: 211, False: 3.56k]
  |  |  |  |  |  Branch (141:46): [True: 417, False: 3.14k]
  |  |  |  |  ------------------
  |  |  |  |  142|  5.63k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 195, False: 2.94k]
  |  |  |  |  |  Branch (142:27): [True: 232, False: 2.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  8.93k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 636, False: 2.08k]
  |  |  |  Branch (175:26): [True: 200, False: 1.88k]
  |  |  ------------------
  ------------------
  805|  7.05k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  7.05k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 20, False: 7.03k]
  ------------------
  807|  7.05k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  1.88k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 1.88k, False: 0]
  ------------------
  810|  1.88k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 1.88k]
  ------------------
  811|  1.88k|	    uri->path = NULL;
  812|  1.88k|	}
  813|  1.88k|    }
  814|  9.85k|    *str = cur;
  815|  9.85k|    return (0);
  816|  40.0k|}
uri.c:xmlParse3986Authority:
  529|  33.6k|{
  530|  33.6k|    const char *cur;
  531|  33.6k|    int ret;
  532|       |
  533|  33.6k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  33.6k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  33.6k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 17, False: 33.5k]
  ------------------
  539|     17|        return(ret);
  540|  33.5k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 28.4k, False: 5.17k]
  |  Branch (540:23): [True: 0, False: 5.17k]
  ------------------
  541|  28.4k|        cur = *str;
  542|  5.17k|    else
  543|  5.17k|        cur++;
  544|  33.5k|    ret = xmlParse3986Host(uri, &cur);
  545|  33.5k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 311, False: 33.2k]
  ------------------
  546|  33.2k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.73k, False: 29.5k]
  ------------------
  547|  3.73k|        cur++;
  548|  3.73k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.73k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.41k, False: 2.31k]
  ------------------
  550|  3.73k|    }
  551|  31.8k|    *str = cur;
  552|  31.8k|    return(0);
  553|  33.2k|}
uri.c:xmlParse3986Userinfo:
  379|  33.6k|{
  380|  33.6k|    const char *cur;
  381|       |
  382|  33.6k|    cur = *str;
  383|  2.23M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  4.46M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 218k, False: 2.01M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  4.24M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.95M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.91M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.95M, False: 230]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.95M, False: 5.97k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.45k, False: 4.75k]
  |  |  |  |  |  Branch (131:43): [True: 1.25k, False: 198]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.95M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 4.71k, False: 236]
  |  |  |  |  |  Branch (132:27): [True: 4.47k, False: 236]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.95M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.91M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.95M, False: 386]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.93M, False: 24.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 851, False: 24.3k]
  |  |  |  |  |  Branch (131:43): [True: 603, False: 248]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.95M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 24.0k, False: 562]
  |  |  |  |  |  Branch (132:27): [True: 23.7k, False: 253]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 1.95M, False: 55.2k]
  |  |  ------------------
  ------------------
  384|  56.5k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  2.28M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.36k, False: 55.1k]
  |  |  |  Branch (139:27): [True: 796, False: 54.3k]
  |  |  |  Branch (139:46): [True: 384, False: 53.9k]
  |  |  ------------------
  |  |  140|  56.5k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 2.43k, False: 51.5k]
  |  |  |  Branch (140:27): [True: 2.72k, False: 48.8k]
  |  |  |  Branch (140:46): [True: 1.95k, False: 46.8k]
  |  |  ------------------
  |  |  141|  56.5k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 967, False: 45.8k]
  |  |  |  Branch (141:27): [True: 2.82k, False: 43.0k]
  |  |  |  Branch (141:46): [True: 745, False: 42.3k]
  |  |  ------------------
  |  |  142|  56.5k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 876, False: 41.4k]
  |  |  |  Branch (142:27): [True: 2.78k, False: 38.6k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 5.03k, False: 33.6k]
  ------------------
  385|  2.19M|	NEXT(cur);
  ------------------
  |  |  108|  2.19M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 1.95M, False: 241k]
  |  |  ------------------
  ------------------
  386|  33.6k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 5.18k, False: 28.4k]
  ------------------
  387|  5.18k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 5.18k, False: 0]
  ------------------
  388|  5.18k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 5.18k]
  ------------------
  389|  5.18k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  5.18k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 5.18k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  5.18k|	    else
  392|  5.18k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  5.18k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 17, False: 5.17k]
  ------------------
  394|     17|                return(-1);
  395|  5.18k|	}
  396|  5.17k|	*str = cur;
  397|  5.17k|	return(0);
  398|  5.18k|    }
  399|  28.4k|    return(1);
  400|  33.6k|}
uri.c:xmlParse3986Host:
  452|  33.5k|{
  453|  33.5k|    const char *cur = *str;
  454|  33.5k|    const char *host;
  455|       |
  456|  33.5k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  33.5k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 466, False: 33.1k]
  ------------------
  461|    466|        cur++;
  462|  3.77k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 3.58k, False: 197]
  |  Branch (462:26): [True: 3.31k, False: 269]
  ------------------
  463|  3.31k|	    cur++;
  464|    466|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 269, False: 197]
  ------------------
  465|    269|	    return(1);
  466|    197|	cur++;
  467|    197|	goto found;
  468|    466|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  33.1k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  33.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 24.7k, False: 8.40k]
  |  |  |  Branch (127:40): [True: 7.34k, False: 17.3k]
  |  |  ------------------
  ------------------
  473|  7.34k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 1.17k, False: 6.16k]
  ------------------
  474|  1.17k|	    goto not_ipv4;
  475|  6.16k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.21k, False: 2.95k]
  ------------------
  476|  3.21k|	    goto not_ipv4;
  477|  2.95k|	cur++;
  478|  2.95k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.18k, False: 1.77k]
  ------------------
  479|  1.18k|	    goto not_ipv4;
  480|  1.77k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.56k, False: 204]
  ------------------
  481|  1.56k|	    goto not_ipv4;
  482|    204|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 204, False: 0]
  ------------------
  483|    204|	    goto not_ipv4;
  484|      0|	if (*cur != '.')
  ------------------
  |  Branch (484:6): [True: 0, False: 0]
  ------------------
  485|      0|	    goto not_ipv4;
  486|      0|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (486:13): [True: 0, False: 0]
  ------------------
  487|      0|	    goto not_ipv4;
  488|      0|	goto found;
  489|  7.34k|not_ipv4:
  490|  7.34k|        cur = *str;
  491|  7.34k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  4.67M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  9.35M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 4.61M, False: 62.9k]
  |  |  ------------------
  ------------------
  496|  62.9k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  4.73M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  11.5k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  23.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 11.3k, False: 219]
  |  |  |  |  |  |  |  Branch (127:40): [True: 8.89k, False: 2.46k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.66k, False: 1.02k]
  |  |  |  |  |  Branch (131:43): [True: 1.46k, False: 198]
  |  |  |  |  ------------------
  |  |  |  |  132|  11.5k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 949, False: 273]
  |  |  |  |  |  Branch (132:27): [True: 711, False: 238]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  11.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  22.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 10.6k, False: 414]
  |  |  |  |  |  |  |  Branch (127:40): [True: 8.37k, False: 2.28k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.16k, False: 1.53k]
  |  |  |  |  |  Branch (131:43): [True: 915, False: 250]
  |  |  |  |  ------------------
  |  |  |  |  132|  11.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.19k, False: 590]
  |  |  |  |  |  Branch (132:27): [True: 939, False: 255]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 11.5k, False: 51.3k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  52.7k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 1.37k, False: 51.3k]
  |  |  |  Branch (139:27): [True: 1.05k, False: 50.3k]
  |  |  |  Branch (139:46): [True: 625, False: 49.7k]
  |  |  ------------------
  |  |  140|  52.7k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.42k, False: 48.2k]
  |  |  |  Branch (140:27): [True: 1.39k, False: 46.8k]
  |  |  |  Branch (140:46): [True: 1.11k, False: 45.7k]
  |  |  ------------------
  |  |  141|  52.7k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.38k, False: 44.3k]
  |  |  |  Branch (141:27): [True: 2.70k, False: 41.6k]
  |  |  |  Branch (141:46): [True: 4.51k, False: 37.1k]
  |  |  ------------------
  |  |  142|  52.7k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 2.24k, False: 34.9k]
  |  |  |  Branch (142:27): [True: 1.77k, False: 33.1k]
  |  |  ------------------
  ------------------
  497|  4.64M|        NEXT(cur);
  ------------------
  |  |  108|  4.67M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 10.2k, False: 4.63M]
  |  |  ------------------
  ------------------
  498|  33.3k|found:
  499|  33.3k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 33.3k, False: 0]
  ------------------
  500|  33.3k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 33.3k]
  ------------------
  501|  33.3k|	uri->authority = NULL;
  502|  33.3k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 33.3k]
  ------------------
  503|  33.3k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 27.6k, False: 5.64k]
  ------------------
  504|  27.6k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  27.6k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 27.6k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  27.6k|	    else
  507|  27.6k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  27.6k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 42, False: 27.6k]
  ------------------
  509|     42|                return(-1);
  510|  27.6k|	} else
  511|  5.64k|	    uri->server = NULL;
  512|  33.3k|    }
  513|  33.2k|    *str = cur;
  514|  33.2k|    return(0);
  515|  33.3k|}
uri.c:xmlParse3986DecOctet:
  415|  10.4k|xmlParse3986DecOctet(const char **str) {
  416|  10.4k|    const char *cur = *str;
  417|       |
  418|  10.4k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  10.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 9.84k, False: 654]
  |  |  |  Branch (127:40): [True: 9.52k, False: 322]
  |  |  ------------------
  ------------------
  419|    976|        return(1);
  420|  9.52k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  9.52k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 5.66k, False: 3.85k]
  |  |  |  Branch (127:40): [True: 4.47k, False: 1.18k]
  |  |  ------------------
  ------------------
  421|  5.04k|	cur++;
  422|  4.47k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.91k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.91k, False: 0]
  |  |  |  Branch (127:40): [True: 3.91k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  3.91k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.93k, False: 986]
  |  |  |  Branch (127:40): [True: 2.52k, False: 406]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 3.91k, False: 562]
  ------------------
  423|  1.39k|	cur += 2;
  424|  3.08k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    508|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 508, False: 0]
  |  |  |  Branch (127:40): [True: 508, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    508|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 508, False: 0]
  |  |  |  Branch (127:40): [True: 508, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 508, False: 2.57k]
  ------------------
  425|    508|	cur += 3;
  426|  2.57k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.40k, False: 1.16k]
  |  Branch (426:31): [True: 1.40k, False: 0]
  ------------------
  427|  1.40k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    464|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 464, False: 0]
  |  |  |  Branch (127:40): [True: 464, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 464, False: 945]
  ------------------
  428|    464|	cur += 3;
  429|  2.11k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 945, False: 1.16k]
  |  Branch (429:31): [True: 533, False: 412]
  ------------------
  430|    533|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 533, False: 0]
  |  Branch (430:30): [True: 533, False: 0]
  ------------------
  431|    533|	cur += 3;
  432|  1.58k|    else
  433|  1.58k|        return(1);
  434|  7.94k|    *str = cur;
  435|  7.94k|    return(0);
  436|  9.52k|}
uri.c:xmlParse3986Port:
  342|  3.73k|{
  343|  3.73k|    const char *cur = *str;
  344|  3.73k|    int port = 0;
  345|       |
  346|  3.73k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.73k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.17k, False: 558]
  |  |  |  Branch (127:40): [True: 2.71k, False: 459]
  |  |  ------------------
  ------------------
  347|  11.3k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  11.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 9.32k, False: 2.05k]
  |  |  |  Branch (127:40): [True: 9.05k, False: 267]
  |  |  ------------------
  ------------------
  348|  9.05k|            int digit = *cur - '0';
  349|       |
  350|  9.05k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 203, False: 8.85k]
  ------------------
  351|    203|                return(1);
  352|  8.85k|            port *= 10;
  353|  8.85k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 196, False: 8.66k]
  ------------------
  354|    196|                return(1);
  355|  8.66k|	    port += digit;
  356|       |
  357|  8.66k|	    cur++;
  358|  8.66k|	}
  359|  2.31k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 2.31k, False: 0]
  ------------------
  360|  2.31k|	    uri->port = port;
  361|  2.31k|	*str = cur;
  362|  2.31k|	return(0);
  363|  2.71k|    }
  364|  1.01k|    return(1);
  365|  3.73k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  31.8k|{
  610|  31.8k|    const char *cur;
  611|  31.8k|    int ret;
  612|       |
  613|  31.8k|    cur = *str;
  614|       |
  615|   117k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 85.6k, False: 31.8k]
  ------------------
  616|  85.6k|        cur++;
  617|  85.6k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  85.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 85.6k]
  ------------------
  619|  85.6k|    }
  620|  31.8k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 31.8k, False: 0]
  ------------------
  621|  31.8k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 31.8k]
  ------------------
  622|  31.8k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 17.4k, False: 14.3k]
  ------------------
  623|  17.4k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  17.4k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 17.4k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  17.4k|            else
  626|  17.4k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  17.4k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 12, False: 17.4k]
  ------------------
  628|     12|                return (-1);
  629|  17.4k|        } else {
  630|  14.3k|            uri->path = NULL;
  631|  14.3k|        }
  632|  31.8k|    }
  633|  31.8k|    *str = cur;
  634|  31.8k|    return (0);
  635|  31.8k|}
uri.c:xmlParse3986Segment:
  572|   362k|{
  573|   362k|    const char *cur;
  574|       |
  575|   362k|    cur = *str;
  576|   362k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   724k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   724k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 220k, False: 141k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   503k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.39k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.79k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.16k, False: 234]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.24k, False: 2.91k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.42k, False: 1.72k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.22k, False: 198]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.39k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.68k, False: 238]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.43k, False: 248]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.91k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.82k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.68k, False: 225]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 986, False: 2.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.00k, False: 1.92k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 803, False: 197]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.91k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.89k, False: 226]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.56k, False: 334]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.39k, False: 137k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   500k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 3.37k, False: 135k]
  |  |  |  |  |  Branch (139:27): [True: 2.18k, False: 132k]
  |  |  |  |  |  Branch (139:46): [True: 809, False: 132k]
  |  |  |  |  ------------------
  |  |  |  |  140|   138k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.02k, False: 131k]
  |  |  |  |  |  Branch (140:27): [True: 1.25k, False: 129k]
  |  |  |  |  |  Branch (140:46): [True: 83.7k, False: 46.0k]
  |  |  |  |  ------------------
  |  |  |  |  141|   138k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.97k, False: 43.0k]
  |  |  |  |  |  Branch (141:27): [True: 1.46k, False: 41.5k]
  |  |  |  |  |  Branch (141:46): [True: 2.38k, False: 39.2k]
  |  |  |  |  ------------------
  |  |  |  |  142|   138k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.27k, False: 37.9k]
  |  |  |  |  |  Branch (142:27): [True: 1.62k, False: 36.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   362k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.85k, False: 32.4k]
  |  |  |  Branch (175:26): [True: 4.08k, False: 28.3k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 1.34k, False: 332k]
  ------------------
  577|  29.7k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 25.6k, False: 4.01k]
  ------------------
  578|  25.6k|	    return(0);
  579|  4.01k|	return(1);
  580|  29.7k|    }
  581|   332k|    NEXT(cur);
  ------------------
  |  |  108|   332k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 3.35k, False: 329k]
  |  |  ------------------
  ------------------
  582|       |
  583|       |#if defined(LIBXML_WINPATH_ENABLED)
  584|       |    /*
  585|       |     * Allow Windows drive letters.
  586|       |     */
  587|       |    if ((forbid == ':') && (*cur == forbid))
  588|       |        NEXT(cur);
  589|       |#endif
  590|       |
  591|  7.09M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  14.1M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  14.1M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 3.89M, False: 3.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  10.3M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  22.1k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.6k, False: 391]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.41k, False: 3.26k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.44k, False: 2.20k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.24k, False: 200]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  11.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.99k, False: 414]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.63k, False: 359]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.2k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  20.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 9.98k, False: 317]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 4.42k, False: 5.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.38k, False: 4.48k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.14k, False: 237]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.2k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 4.31k, False: 416]
  |  |  |  |  |  |  |  Branch (132:27): [True: 3.93k, False: 375]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 11.0k, False: 3.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  10.2M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 9.85k, False: 3.18M]
  |  |  |  |  |  Branch (139:27): [True: 1.19k, False: 3.18M]
  |  |  |  |  |  Branch (139:46): [True: 497, False: 3.18M]
  |  |  |  |  ------------------
  |  |  |  |  140|  3.19M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 77.9k, False: 3.10M]
  |  |  |  |  |  Branch (140:27): [True: 2.55k, False: 3.10M]
  |  |  |  |  |  Branch (140:46): [True: 2.74M, False: 358k]
  |  |  |  |  ------------------
  |  |  |  |  141|  3.19M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.42k, False: 356k]
  |  |  |  |  |  Branch (141:27): [True: 2.82k, False: 353k]
  |  |  |  |  |  Branch (141:46): [True: 2.06k, False: 351k]
  |  |  |  |  ------------------
  |  |  |  |  142|  3.19M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 2.22k, False: 349k]
  |  |  |  |  |  Branch (142:27): [True: 7.97k, False: 341k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  7.09M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 13.8k, False: 327k]
  |  |  |  Branch (175:26): [True: 3.41k, False: 323k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 6.76M, False: 8.54k]
  ------------------
  592|  6.76M|        NEXT(cur);
  ------------------
  |  |  108|  7.09M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 9.50k, False: 6.75M]
  |  |  ------------------
  ------------------
  593|   332k|    *str = cur;
  594|   332k|    return (0);
  595|   362k|}
uri.c:xmlParse3986PathAbsolute:
  649|  8.65k|{
  650|  8.65k|    const char *cur;
  651|  8.65k|    int ret;
  652|       |
  653|  8.65k|    cur = *str;
  654|       |
  655|  8.65k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 8.65k]
  ------------------
  656|      0|        return(1);
  657|  8.65k|    cur++;
  658|  8.65k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  8.65k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 5.98k, False: 2.67k]
  ------------------
  660|  17.0k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 11.0k, False: 5.98k]
  ------------------
  661|  11.0k|	    cur++;
  662|  11.0k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  11.0k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 11.0k]
  ------------------
  664|  11.0k|	}
  665|  5.98k|    }
  666|  8.65k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 8.65k, False: 0]
  ------------------
  667|  8.65k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 8.65k]
  ------------------
  668|  8.65k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 8.65k, False: 0]
  ------------------
  669|  8.65k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  8.65k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 8.65k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  8.65k|            else
  672|  8.65k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  8.65k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 17, False: 8.64k]
  ------------------
  674|     17|                return (-1);
  675|  8.65k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  8.65k|    }
  679|  8.64k|    *str = cur;
  680|  8.64k|    return (0);
  681|  8.65k|}
uri.c:xmlIsUnreserved:
  196|  69.8M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  69.8M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 69.8M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  69.8M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  69.8M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  69.8M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 9.65M, False: 60.2M]
  |  |  |  |  |  Branch (128:41): [True: 9.62M, False: 28.0k]
  |  |  |  |  ------------------
  |  |  |  |  129|  69.8M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 40.6M, False: 19.6M]
  |  |  |  |  |  Branch (129:41): [True: 40.5M, False: 37.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  19.6M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 3.27M, False: 16.4M]
  |  |  |  |  |  Branch (127:40): [True: 1.61M, False: 1.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 82.6k, False: 17.9M]
  |  |  ------------------
  |  |  162|  69.8M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 167k, False: 17.8M]
  |  |  |  Branch (162:27): [True: 3.48k, False: 17.8M]
  |  |  |  Branch (162:46): [True: 27.4k, False: 17.7M]
  |  |  ------------------
  ------------------
  201|  52.0M|        return(1);
  202|       |
  203|  17.7M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  17.7M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 17.7M]
  ------------------
  204|      0|        if (IS_UNWISE(cur))
  ------------------
  |  |   87|      0|      (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) ||         \
  |  |  ------------------
  |  |  |  Branch (87:8): [True: 0, False: 0]
  |  |  |  Branch (87:27): [True: 0, False: 0]
  |  |  |  Branch (87:46): [True: 0, False: 0]
  |  |  ------------------
  |  |   88|      0|       ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) ||        \
  |  |  ------------------
  |  |  |  Branch (88:8): [True: 0, False: 0]
  |  |  |  Branch (88:28): [True: 0, False: 0]
  |  |  |  Branch (88:47): [True: 0, False: 0]
  |  |  ------------------
  |  |   89|      0|       ((*(p) == ']')) || ((*(p) == '`')))
  |  |  ------------------
  |  |  |  Branch (89:8): [True: 0, False: 0]
  |  |  |  Branch (89:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  205|      0|            return(1);
  206|  17.7M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  17.7M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 17.7M]
  ------------------
  207|      0|        if (ISA_UCSCHAR(cur))
  ------------------
  |  |  185|      0|    ((*(p) <= 0x20) || (*(p) >= 0x7F) || (*(p) == '<') || (*(p) == '>') || \
  |  |  ------------------
  |  |  |  Branch (185:6): [True: 0, False: 0]
  |  |  |  Branch (185:24): [True: 0, False: 0]
  |  |  |  Branch (185:42): [True: 0, False: 0]
  |  |  |  Branch (185:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  186|      0|     (*(p) == '"')  || (*(p) == '{')  || (*(p) == '}') || (*(p) == '|') || \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 0, False: 0]
  |  |  |  Branch (186:24): [True: 0, False: 0]
  |  |  |  Branch (186:42): [True: 0, False: 0]
  |  |  |  Branch (186:59): [True: 0, False: 0]
  |  |  ------------------
  |  |  187|      0|     (*(p) == '\\') || (*(p) == '^')  || (*(p) == '`'))
  |  |  ------------------
  |  |  |  Branch (187:6): [True: 0, False: 0]
  |  |  |  Branch (187:24): [True: 0, False: 0]
  |  |  |  Branch (187:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  208|      0|            return(1);
  209|      0|    }
  210|       |
  211|  17.7M|    return(0);
  212|  17.7M|}
uri.c:xmlParse3986PathRootless:
  695|  7.05k|{
  696|  7.05k|    const char *cur;
  697|  7.05k|    int ret;
  698|       |
  699|  7.05k|    cur = *str;
  700|       |
  701|  7.05k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  7.05k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 7.05k]
  ------------------
  703|  11.3k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 4.26k, False: 7.05k]
  ------------------
  704|  4.26k|        cur++;
  705|  4.26k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  4.26k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 4.26k]
  ------------------
  707|  4.26k|    }
  708|  7.05k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 7.05k, False: 0]
  ------------------
  709|  7.05k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 7.05k]
  ------------------
  710|  7.05k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 7.05k, False: 0]
  ------------------
  711|  7.05k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.05k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 7.05k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  7.05k|            else
  714|  7.05k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  7.05k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 20, False: 7.03k]
  ------------------
  716|     20|                return (-1);
  717|  7.05k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  7.05k|    }
  721|  7.03k|    *str = cur;
  722|  7.03k|    return (0);
  723|  7.05k|}
uri.c:xmlParse3986Query:
  300|  15.5k|{
  301|  15.5k|    const char *cur;
  302|       |
  303|  15.5k|    cur = *str;
  304|       |
  305|  38.0M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  38.0M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  76.1M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 33.4M, False: 4.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  42.6M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  9.13k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  18.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 8.88k, False: 255]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 5.95k, False: 2.92k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.85k, False: 1.32k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.63k, False: 226]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  9.13k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.12k, False: 425]
  |  |  |  |  |  |  |  Branch (132:27): [True: 901, False: 226]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.48k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  16.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 8.18k, False: 307]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.10k, False: 7.07k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.39k, False: 5.99k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.06k, False: 327]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.48k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 5.97k, False: 340]
  |  |  |  |  |  |  |  Branch (132:27): [True: 5.49k, False: 479]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 9.13k, False: 4.54M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  42.6M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 17.8k, False: 4.53M]
  |  |  |  |  |  Branch (139:27): [True: 733, False: 4.53M]
  |  |  |  |  |  Branch (139:46): [True: 273, False: 4.53M]
  |  |  |  |  ------------------
  |  |  |  |  140|  4.55M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 2.17k, False: 4.52M]
  |  |  |  |  |  Branch (140:27): [True: 3.02k, False: 4.52M]
  |  |  |  |  |  Branch (140:46): [True: 3.98M, False: 536k]
  |  |  |  |  ------------------
  |  |  |  |  141|  4.55M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 912, False: 535k]
  |  |  |  |  |  Branch (141:27): [True: 397, False: 535k]
  |  |  |  |  |  Branch (141:46): [True: 918, False: 534k]
  |  |  |  |  ------------------
  |  |  |  |  142|  4.55M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 916, False: 533k]
  |  |  |  |  |  Branch (142:27): [True: 7.98k, False: 525k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  38.0M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 12.1k, False: 513k]
  |  |  |  Branch (175:26): [True: 38.8k, False: 474k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 237k, False: 237k]
  |  Branch (305:54): [True: 221k, False: 15.5k]
  ------------------
  306|  38.0M|        NEXT(cur);
  ------------------
  |  |  108|  38.0M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 7.66k, False: 38.0M]
  |  |  ------------------
  ------------------
  307|  15.5k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 15.5k, False: 0]
  ------------------
  308|  15.5k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 15.5k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  15.5k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  15.5k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 15.5k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  15.5k|	else
  313|  15.5k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  15.5k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 18, False: 15.5k]
  ------------------
  315|     18|            return (-1);
  316|       |
  317|       |	/* Save the raw bytes of the query as well.
  318|       |	 * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
  319|       |	 */
  320|  15.5k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 15.5k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  15.5k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  15.5k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  15.5k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 41, False: 15.4k]
  ------------------
  324|     41|            return (-1);
  325|  15.5k|    }
  326|  15.4k|    *str = cur;
  327|  15.4k|    return (0);
  328|  15.5k|}
uri.c:xmlParse3986Fragment:
  267|  1.26M|{
  268|  1.26M|    const char *cur;
  269|       |
  270|  1.26M|    cur = *str;
  271|       |
  272|  16.0M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  16.0M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  32.0M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 9.52M, False: 6.51M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  22.5M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  15.7k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  31.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 15.4k, False: 232]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 11.4k, False: 4.02k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.95k, False: 2.30k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.75k, False: 199]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  15.7k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.22k, False: 279]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.98k, False: 242]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  15.1k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  30.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 14.9k, False: 243]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 8.34k, False: 6.60k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.66k, False: 5.17k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.36k, False: 302]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  15.1k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 5.19k, False: 288]
  |  |  |  |  |  |  |  Branch (132:27): [True: 4.72k, False: 464]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 15.7k, False: 6.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  22.5M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.27M, False: 5.22M]
  |  |  |  |  |  Branch (139:27): [True: 762, False: 5.22M]
  |  |  |  |  |  Branch (139:46): [True: 500, False: 5.22M]
  |  |  |  |  ------------------
  |  |  |  |  140|  6.49M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 10.5k, False: 5.21M]
  |  |  |  |  |  Branch (140:27): [True: 9.50k, False: 5.20M]
  |  |  |  |  |  Branch (140:46): [True: 154k, False: 5.05M]
  |  |  |  |  ------------------
  |  |  |  |  141|  6.49M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.04k, False: 5.04M]
  |  |  |  |  |  Branch (141:27): [True: 1.24M, False: 3.80M]
  |  |  |  |  |  Branch (141:46): [True: 6.15k, False: 3.79M]
  |  |  |  |  ------------------
  |  |  |  |  142|  6.49M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.86k, False: 3.79M]
  |  |  |  |  |  Branch (142:27): [True: 1.70k, False: 3.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  16.0M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 1.24M, False: 2.54M]
  |  |  |  Branch (175:26): [True: 2.96k, False: 2.54M]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 1.26M, False: 1.27M]
  |  Branch (272:54): [True: 5.17k, False: 1.27M]
  ------------------
  273|  1.27M|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 1.89k, False: 1.27M]
  |  Branch (273:29): [True: 2.06k, False: 1.26M]
  ------------------
  274|  14.7M|        NEXT(cur);
  ------------------
  |  |  108|  14.7M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 14.4k, False: 14.7M]
  |  |  ------------------
  ------------------
  275|  1.26M|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 1.26M, False: 0]
  ------------------
  276|  1.26M|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 1.26M]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|  1.26M|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  1.26M|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 1.26M]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|  1.26M|	else
  281|  1.26M|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|  1.26M|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 40, False: 1.26M]
  ------------------
  283|     40|            return (-1);
  284|  1.26M|    }
  285|  1.26M|    *str = cur;
  286|  1.26M|    return (0);
  287|  1.26M|}
uri.c:xmlParse3986RelativeRef:
  833|  1.42M|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|  1.42M|    int ret;
  835|       |
  836|  1.42M|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 11.1k, False: 1.41M]
  |  Branch (836:26): [True: 3.47k, False: 7.71k]
  ------------------
  837|  3.47k|        str += 2;
  838|  3.47k|	ret = xmlParse3986Authority(uri, &str);
  839|  3.47k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 376, False: 3.09k]
  ------------------
  840|  3.09k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  3.09k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 2, False: 3.09k]
  ------------------
  842|  1.42M|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.71k, False: 1.41M]
  ------------------
  843|  7.71k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.71k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 15, False: 7.69k]
  ------------------
  845|  1.41M|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|  1.41M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  2.82M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 127k, False: 1.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  2.70M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.50k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.01k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.20k, False: 304]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 761, False: 2.44k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.26k, False: 1.48k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.05k, False: 213]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.50k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.34k, False: 350]
  |  |  |  |  |  |  |  Branch (132:27): [True: 992, False: 354]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.80k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  5.60k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.53k, False: 269]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 723, False: 1.81k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 660, False: 1.42k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 447, False: 213]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.80k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.16k, False: 467]
  |  |  |  |  |  |  |  Branch (132:27): [True: 818, False: 349]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 3.50k, False: 1.28M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  2.69M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.68k, False: 1.28M]
  |  |  |  |  |  Branch (139:27): [True: 1.75k, False: 1.28M]
  |  |  |  |  |  Branch (139:46): [True: 506, False: 1.27M]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.28M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 662, False: 1.27M]
  |  |  |  |  |  Branch (140:27): [True: 576, False: 1.27M]
  |  |  |  |  |  Branch (140:46): [True: 6.10k, False: 1.27M]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.28M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.51k, False: 1.27M]
  |  |  |  |  |  Branch (141:27): [True: 637, False: 1.27M]
  |  |  |  |  |  Branch (141:46): [True: 1.35k, False: 1.26M]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.28M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.00k, False: 1.26M]
  |  |  |  |  |  Branch (142:27): [True: 841, False: 1.26M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  1.41M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 1.34k, False: 1.26M]
  |  |  |  Branch (175:26): [True: 685, False: 1.26M]
  |  |  ------------------
  ------------------
  846|   149k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   149k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.47k, False: 147k]
  ------------------
  848|  1.26M|    } else {
  849|       |	/* path-empty is effectively empty */
  850|  1.26M|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 1.26M, False: 0]
  ------------------
  851|  1.26M|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 1.26M]
  ------------------
  852|  1.26M|	    uri->path = NULL;
  853|  1.26M|	}
  854|  1.26M|    }
  855|       |
  856|  1.42M|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 12.5k, False: 1.41M]
  ------------------
  857|  12.5k|	str++;
  858|  12.5k|	ret = xmlParse3986Query(uri, &str);
  859|  12.5k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 41, False: 12.5k]
  ------------------
  860|  12.5k|    }
  861|  1.42M|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 1.26M, False: 156k]
  ------------------
  862|  1.26M|	str++;
  863|  1.26M|	ret = xmlParse3986Fragment(uri, &str);
  864|  1.26M|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 35, False: 1.26M]
  ------------------
  865|  1.26M|    }
  866|  1.42M|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 24.6k, False: 1.39M]
  ------------------
  867|  24.6k|	xmlCleanURI(uri);
  868|  24.6k|	return(1);
  869|  24.6k|    }
  870|  1.39M|    return(0);
  871|  1.42M|}
uri.c:xmlParse3986PathNoScheme:
  737|   149k|{
  738|   149k|    const char *cur;
  739|   149k|    int ret;
  740|       |
  741|   149k|    cur = *str;
  742|       |
  743|   149k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   149k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 1.34k, False: 147k]
  ------------------
  745|   244k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 96.2k, False: 147k]
  ------------------
  746|  96.2k|        cur++;
  747|  96.2k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  96.2k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 96.2k]
  ------------------
  749|  96.2k|    }
  750|   147k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 147k, False: 0]
  ------------------
  751|   147k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 147k]
  ------------------
  752|   147k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 147k, False: 0]
  ------------------
  753|   147k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   147k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 147k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   147k|            else
  756|   147k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   147k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 133, False: 147k]
  ------------------
  758|    133|                return (-1);
  759|   147k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   147k|    }
  763|   147k|    *str = cur;
  764|   147k|    return (0);
  765|   147k|}
uri.c:xmlSaveUriRealloc:
 1074|  27.3k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  27.3k|    xmlChar *temp;
 1076|  27.3k|    int newSize;
 1077|       |
 1078|  27.3k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  27.3k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  27.3k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 29, False: 27.3k]
  ------------------
 1080|     29|        return(NULL);
 1081|  27.3k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  27.3k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 33, False: 27.3k]
  ------------------
 1083|     33|        return(NULL);
 1084|  27.3k|    *max = newSize;
 1085|  27.3k|    return(temp);
 1086|  27.3k|}
uri.c:xmlNormalizePath:
 1456|   118k|xmlNormalizePath(char *path, int isFile) {
 1457|   118k|    char *cur, *out;
 1458|   118k|    int numSeg = 0;
 1459|       |
 1460|   118k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.91k, False: 116k]
  ------------------
 1461|  1.91k|	return(-1);
 1462|       |
 1463|   116k|    cur = path;
 1464|   116k|    out = path;
 1465|       |
 1466|   116k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 195, False: 116k]
  ------------------
 1467|    195|        return(0);
 1468|       |
 1469|   116k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 7.36k, False: 109k]
  ------------------
 1470|  7.36k|        cur++;
 1471|  7.36k|        *out++ = '/';
 1472|  7.36k|    }
 1473|       |
 1474|   481k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 366k, False: 115k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   398k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 31.7k, False: 366k]
  ------------------
 1480|       |#if defined(LIBXML_WINPATH_ENABLED)
 1481|       |            /* Allow two separators at start of path */
 1482|       |            if ((isFile) && (out == path + 1))
 1483|       |                *out++ = '/';
 1484|       |#endif
 1485|  31.7k|            cur++;
 1486|  31.7k|        }
 1487|       |
 1488|   366k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 158k, False: 207k]
  ------------------
 1489|   158k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 760, False: 158k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|    760|                break;
 1492|   158k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 94.8k, False: 63.3k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  94.8k|                cur += 2;
 1495|  94.8k|                continue;
 1496|  94.8k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 61.9k, False: 1.41k]
  ------------------
 1497|  61.9k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 617, False: 61.3k]
  |  Branch (1497:42): [True: 61.0k, False: 302]
  ------------------
 1498|  61.6k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 5.33k, False: 56.2k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  26.4k|                    do {
 1501|  26.4k|                        out--;
 1502|  26.4k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 25.8k, False: 574]
  ------------------
 1503|  25.8k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 21.0k, False: 4.76k]
  ------------------
 1504|  5.33k|                    numSeg--;
 1505|       |
 1506|  5.33k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 246, False: 5.09k]
  ------------------
 1507|    246|                        break;
 1508|  5.09k|                    cur += 3;
 1509|  5.09k|                    continue;
 1510|  56.2k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 428, False: 55.8k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    428|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 196, False: 232]
  ------------------
 1513|    196|                        break;
 1514|    232|                    cur += 3;
 1515|    232|                    continue;
 1516|  55.8k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  55.8k|                    numSeg--;
 1519|  55.8k|                }
 1520|  61.6k|            }
 1521|   158k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  3.65M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 3.53M, False: 114k]
  |  Branch (1524:31): [True: 3.38M, False: 150k]
  ------------------
 1525|  3.38M|            *out++ = *cur++;
 1526|  3.38M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   264k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 150k, False: 114k]
  ------------------
 1530|   150k|            cur++;
 1531|   150k|            *out++ = '/';
 1532|   150k|        }
 1533|       |
 1534|   264k|        numSeg++;
 1535|   264k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|   116k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 107k, False: 9.41k]
  |  Branch (1538:21): [True: 753, False: 106k]
  ------------------
 1539|    753|        *out++ = '.';
 1540|   116k|    *out = 0;
 1541|       |
 1542|   116k|    return(0);
 1543|   116k|}
uri.c:xmlIsPathSeparator:
 1434|  4.53M|xmlIsPathSeparator(int c, int isFile) {
 1435|  4.53M|    (void) isFile;
 1436|       |
 1437|  4.53M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 365k, False: 4.16M]
  ------------------
 1438|   365k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  4.16M|    return(0);
 1446|  4.53M|}
uri.c:is_hex:
 1559|  3.91M|static int is_hex(char c) {
 1560|  3.91M|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 3.91M, False: 1.03k]
  |  Branch (1560:24): [True: 3.86M, False: 51.3k]
  ------------------
 1561|  52.4k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 16.6k, False: 35.7k]
  |  Branch (1561:24): [True: 15.6k, False: 1.03k]
  ------------------
 1562|  36.7k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 35.1k, False: 1.67k]
  |  Branch (1562:24): [True: 33.8k, False: 1.28k]
  ------------------
 1563|  3.91M|	return(1);
 1564|  2.95k|    return(0);
 1565|  3.91M|}
uri.c:xmlResolvePath:
 1863|  1.27M|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|  1.27M|    const xmlChar *fragment;
 1865|  1.27M|    xmlChar *tmp = NULL;
 1866|  1.27M|    xmlChar *ref = NULL;
 1867|  1.27M|    xmlChar *result = NULL;
 1868|  1.27M|    int ret = -1;
 1869|  1.27M|    int i;
 1870|       |
 1871|  1.27M|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 1.27M]
  ------------------
 1872|      0|        return(1);
 1873|  1.27M|    *out = NULL;
 1874|       |
 1875|  1.27M|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 1.27M]
  |  Branch (1875:29): [True: 739, False: 1.27M]
  ------------------
 1876|    739|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 739]
  |  Branch (1876:31): [True: 360, False: 379]
  ------------------
 1877|    360|            return(1);
 1878|    379|        ref = xmlStrdup(base);
 1879|    379|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 376]
  ------------------
 1880|      3|            goto err_memory;
 1881|    376|        *out = ref;
 1882|    376|        return(0);
 1883|    379|    }
 1884|       |
 1885|       |    /*
 1886|       |     * If a URI is resolved, we can assume it is a valid URI and not
 1887|       |     * a filesystem path. This means we have to unescape the part
 1888|       |     * before the fragment.
 1889|       |     */
 1890|  1.27M|    fragment = xmlStrchr(escRef, '#');
 1891|  1.27M|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 1.25M, False: 16.3k]
  ------------------
 1892|  1.25M|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|  1.25M|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 13, False: 1.25M]
  ------------------
 1894|     13|            goto err_memory;
 1895|  1.25M|        escRef = tmp;
 1896|  1.25M|    }
 1897|       |
 1898|  1.27M|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|  1.27M|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 39, False: 1.27M]
  ------------------
 1900|     39|        goto err_memory;
 1901|       |
 1902|  1.27M|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 1.27M]
  |  Branch (1902:27): [True: 1.25M, False: 15.7k]
  ------------------
 1903|  1.25M|        goto done;
 1904|       |
 1905|  15.7k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 2.56k, False: 13.1k]
  ------------------
 1906|  2.56k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  13.1k|    i = xmlStrlen(base);
 1912|   125k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 124k, False: 1.69k]
  |  Branch (1912:23): [True: 112k, False: 11.4k]
  ------------------
 1913|   112k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  13.1k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 11.4k, False: 1.69k]
  ------------------
 1919|  11.4k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  11.4k|        result = xmlMalloc(i + refLen + 1);
 1922|  11.4k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 21, False: 11.4k]
  ------------------
 1923|     21|            goto err_memory;
 1924|       |
 1925|  11.4k|        memcpy(result, base, i);
 1926|  11.4k|        memcpy(result + i, ref, refLen + 1);
 1927|  11.4k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  13.1k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|  1.27M|done:
 1935|  1.27M|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 1.25M, False: 11.4k]
  ------------------
 1936|  1.25M|        result = ref;
 1937|  1.25M|        ref = NULL;
 1938|  1.25M|    }
 1939|       |
 1940|  1.27M|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 1.25M, False: 16.3k]
  ------------------
 1941|  1.25M|        result = xmlStrcat(result, fragment);
 1942|  1.25M|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 11, False: 1.25M]
  ------------------
 1943|     11|            goto err_memory;
 1944|  1.25M|    }
 1945|       |
 1946|  1.27M|    *out = result;
 1947|  1.27M|    ret = 0;
 1948|       |
 1949|  1.27M|err_memory:
 1950|  1.27M|    xmlFree(tmp);
 1951|  1.27M|    xmlFree(ref);
 1952|  1.27M|    return(ret);
 1953|  1.27M|}
uri.c:xmlIsAbsolutePath:
 1837|   111k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|   111k|    int c = path[0];
 1839|       |
 1840|   111k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 3.46k, False: 108k]
  ------------------
 1841|  3.46k|        return(1);
 1842|       |
 1843|       |#if defined(LIBXML_WINPATH_ENABLED)
 1844|       |    if ((((c >= 'A') && (c <= 'Z')) ||
 1845|       |         ((c >= 'a') && (c <= 'z'))) &&
 1846|       |        (path[1] == ':'))
 1847|       |        return(1);
 1848|       |#endif
 1849|       |
 1850|   108k|    return(0);
 1851|   111k|}
uri.c:xmlParseUriOrPath:
 2344|  96.9k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  96.9k|    xmlURIPtr uri;
 2346|  96.9k|    char *buf = NULL;
 2347|  96.9k|    int ret;
 2348|       |
 2349|  96.9k|    *out = NULL;
 2350|  96.9k|    *drive = 0;
 2351|       |
 2352|  96.9k|    uri = xmlCreateURI();
 2353|  96.9k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 12, False: 96.9k]
  ------------------
 2354|     12|        ret = -1;
 2355|     12|	goto done;
 2356|     12|    }
 2357|       |
 2358|  96.9k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  96.9k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  96.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 95.9k, False: 1.01k]
  ------------------
 2359|  95.9k|        const char *path;
 2360|  95.9k|        size_t pathSize;
 2361|  95.9k|        int prependSlash = 0;
 2362|       |
 2363|  95.9k|        buf = xmlMemStrdup(str);
 2364|  95.9k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 16, False: 95.8k]
  ------------------
 2365|     16|            ret = -1;
 2366|     16|            goto done;
 2367|     16|        }
 2368|  95.8k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  95.8k|        path = buf;
 2371|       |
 2372|  95.8k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  95.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 897, False: 95.0k]
  ------------------
 2373|       |#if defined(LIBXML_WINPATH_ENABLED)
 2374|       |            const char *server = NULL;
 2375|       |            int isFileScheme = 0;
 2376|       |#endif
 2377|       |
 2378|       |#if defined(LIBXML_WINPATH_ENABLED)
 2379|       |            if (strncmp(buf, "//?/UNC/", 8) == 0) {
 2380|       |                server = buf + 8;
 2381|       |                isFileScheme = 1;
 2382|       |            } else if (strncmp(buf, "//?/", 4) == 0) {
 2383|       |                path = buf + 3;
 2384|       |                isFileScheme = 1;
 2385|       |            } else if (strncmp(buf, "//", 2) == 0) {
 2386|       |                server = buf + 2;
 2387|       |                isFileScheme = 1;
 2388|       |            }
 2389|       |
 2390|       |            if (server != NULL) {
 2391|       |                const char *end = strchr(server, '/');
 2392|       |
 2393|       |                if (end == NULL) {
 2394|       |                    uri->server = xmlMemStrdup(server);
 2395|       |                    path = "/";
 2396|       |                } else {
 2397|       |                    uri->server = (char *) xmlStrndup(BAD_CAST server,
 2398|       |                                                      end - server);
 2399|       |                    path = end;
 2400|       |                }
 2401|       |                if (uri->server == NULL) {
 2402|       |                    ret = -1;
 2403|       |                    goto done;
 2404|       |                }
 2405|       |            }
 2406|       |
 2407|       |            if ((((path[0] >= 'A') && (path[0] <= 'Z')) ||
 2408|       |                 ((path[0] >= 'a') && (path[0] <= 'z'))) &&
 2409|       |                (path[1] == ':')) {
 2410|       |                prependSlash = 1;
 2411|       |                isFileScheme = 1;
 2412|       |            }
 2413|       |
 2414|       |            if (isFileScheme) {
 2415|       |                uri->scheme = xmlMemStrdup("file");
 2416|       |                if (uri->scheme == NULL) {
 2417|       |                    ret = -1;
 2418|       |                    goto done;
 2419|       |                }
 2420|       |
 2421|       |                if (uri->server == NULL)
 2422|       |                    uri->port = PORT_EMPTY_SERVER;
 2423|       |            }
 2424|       |#endif
 2425|    897|        }
 2426|       |
 2427|  95.8k|        pathSize = strlen(path);
 2428|  95.8k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  95.8k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 12, False: 95.8k]
  ------------------
 2430|     12|            ret = -1;
 2431|     12|            goto done;
 2432|     12|        }
 2433|  95.8k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 95.8k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  95.8k|        } else {
 2437|  95.8k|            memcpy(uri->path, path, pathSize + 1);
 2438|  95.8k|        }
 2439|  95.8k|    } else {
 2440|  1.01k|	ret = xmlParseURIReference(uri, str);
 2441|  1.01k|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 632, False: 381]
  ------------------
 2442|    632|	    goto done;
 2443|       |
 2444|    381|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    381|    }
 2446|       |
 2447|       |#if defined(LIBXML_WINPATH_ENABLED)
 2448|       |    if ((uri->path[0] == '/') &&
 2449|       |        (((uri->path[1] >= 'A') && (uri->path[1] <= 'Z')) ||
 2450|       |         ((uri->path[1] >= 'a') && (uri->path[1] <= 'z'))) &&
 2451|       |        (uri->path[2] == ':'))
 2452|       |        *drive = uri->path[1];
 2453|       |#endif
 2454|       |
 2455|  96.2k|    *out = uri;
 2456|  96.2k|    uri = NULL;
 2457|  96.2k|    ret = 0;
 2458|       |
 2459|  96.9k|done:
 2460|  96.9k|    xmlFreeURI(uri);
 2461|  96.9k|    xmlFree(buf);
 2462|       |
 2463|  96.9k|    return(ret);
 2464|  96.2k|}

xmlValidBuildContentModel:
  597|  2.01k|xmlValidBuildContentModel(xmlValidCtxt *ctxt, xmlElement *elem) {
  598|  2.01k|    int ret = 0;
  599|       |
  600|  2.01k|    if ((ctxt == NULL) || (elem == NULL))
  ------------------
  |  Branch (600:9): [True: 0, False: 2.01k]
  |  Branch (600:27): [True: 0, False: 2.01k]
  ------------------
  601|      0|	return(0);
  602|  2.01k|    if (elem->type != XML_ELEMENT_DECL)
  ------------------
  |  Branch (602:9): [True: 0, False: 2.01k]
  ------------------
  603|      0|	return(0);
  604|  2.01k|    if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (604:9): [True: 0, False: 2.01k]
  ------------------
  605|      0|	return(1);
  606|       |    /* TODO: should we rebuild in this case ? */
  607|  2.01k|    if (elem->contModel != NULL) {
  ------------------
  |  Branch (607:9): [True: 0, False: 2.01k]
  ------------------
  608|      0|	if (!xmlRegexpIsDeterminist(elem->contModel)) {
  ------------------
  |  Branch (608:6): [True: 0, False: 0]
  ------------------
  609|      0|	    ctxt->valid = 0;
  610|      0|	    return(0);
  611|      0|	}
  612|      0|	return(1);
  613|      0|    }
  614|       |
  615|  2.01k|    ctxt->am = xmlNewAutomata();
  616|  2.01k|    if (ctxt->am == NULL) {
  ------------------
  |  Branch (616:9): [True: 10, False: 2.00k]
  ------------------
  617|     10|        xmlVErrMemory(ctxt);
  618|     10|	return(0);
  619|     10|    }
  620|  2.00k|    ctxt->state = xmlAutomataGetInitState(ctxt->am);
  621|  2.00k|    if (xmlValidBuildAContentModel(elem->content, ctxt, elem->name) == 0)
  ------------------
  |  Branch (621:9): [True: 14, False: 1.98k]
  ------------------
  622|     14|        goto done;
  623|  1.98k|    xmlAutomataSetFinalState(ctxt->am, ctxt->state);
  624|  1.98k|    elem->contModel = xmlAutomataCompile(ctxt->am);
  625|  1.98k|    if (elem->contModel == NULL) {
  ------------------
  |  Branch (625:9): [True: 534, False: 1.45k]
  ------------------
  626|    534|        xmlVErrMemory(ctxt);
  627|    534|        goto done;
  628|    534|    }
  629|  1.45k|    if (xmlRegexpIsDeterminist(elem->contModel) != 1) {
  ------------------
  |  Branch (629:9): [True: 482, False: 970]
  ------------------
  630|    482|	char expr[5000];
  631|    482|	expr[0] = 0;
  632|    482|	xmlSnprintfElementContent(expr, 5000, elem->content, 1);
  633|    482|	xmlErrValidNode(ctxt, (xmlNodePtr) elem,
  634|    482|	                XML_DTD_CONTENT_NOT_DETERMINIST,
  635|    482|	       "Content model of %s is not deterministic: %s\n",
  636|    482|	       elem->name, BAD_CAST expr, NULL);
  ------------------
  |  |   34|    482|#define BAD_CAST (xmlChar *)
  ------------------
  637|    482|        ctxt->valid = 0;
  638|    482|	goto done;
  639|    482|    }
  640|       |
  641|    970|    ret = 1;
  642|       |
  643|  2.00k|done:
  644|  2.00k|    ctxt->state = NULL;
  645|  2.00k|    xmlFreeAutomata(ctxt->am);
  646|       |    ctxt->am = NULL;
  647|  2.00k|    return(ret);
  648|    970|}
xmlNewDocElementContent:
  708|   681k|                        xmlElementContentType type) {
  709|   681k|    xmlElementContentPtr ret;
  710|   681k|    xmlDictPtr dict = NULL;
  711|       |
  712|   681k|    if (doc != NULL)
  ------------------
  |  Branch (712:9): [True: 681k, False: 224]
  ------------------
  713|   681k|        dict = doc->dict;
  714|       |
  715|   681k|    ret = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  716|   681k|    if (ret == NULL)
  ------------------
  |  Branch (716:9): [True: 13, False: 681k]
  ------------------
  717|     13|	return(NULL);
  718|   681k|    memset(ret, 0, sizeof(xmlElementContent));
  719|   681k|    ret->type = type;
  720|   681k|    ret->ocur = XML_ELEMENT_CONTENT_ONCE;
  721|   681k|    if (name != NULL) {
  ------------------
  |  Branch (721:9): [True: 342k, False: 339k]
  ------------------
  722|   342k|        int l;
  723|   342k|	const xmlChar *tmp;
  724|       |
  725|   342k|	tmp = xmlSplitQName3(name, &l);
  726|   342k|	if (tmp == NULL) {
  ------------------
  |  Branch (726:6): [True: 335k, False: 6.77k]
  ------------------
  727|   335k|	    if (dict == NULL)
  ------------------
  |  Branch (727:10): [True: 126k, False: 208k]
  ------------------
  728|   126k|		ret->name = xmlStrdup(name);
  729|   208k|	    else
  730|   208k|	        ret->name = xmlDictLookup(dict, name, -1);
  731|   335k|	} else {
  732|  6.77k|	    if (dict == NULL) {
  ------------------
  |  Branch (732:10): [True: 2.91k, False: 3.86k]
  ------------------
  733|  2.91k|		ret->prefix = xmlStrndup(name, l);
  734|  2.91k|		ret->name = xmlStrdup(tmp);
  735|  3.86k|	    } else {
  736|  3.86k|	        ret->prefix = xmlDictLookup(dict, name, l);
  737|  3.86k|		ret->name = xmlDictLookup(dict, tmp, -1);
  738|  3.86k|	    }
  739|  6.77k|            if (ret->prefix == NULL)
  ------------------
  |  Branch (739:17): [True: 2, False: 6.77k]
  ------------------
  740|      2|                goto error;
  741|  6.77k|	}
  742|   342k|        if (ret->name == NULL)
  ------------------
  |  Branch (742:13): [True: 2, False: 342k]
  ------------------
  743|      2|            goto error;
  744|   342k|    }
  745|   681k|    return(ret);
  746|       |
  747|      4|error:
  748|      4|    xmlFreeDocElementContent(doc, ret);
  749|       |    return(NULL);
  750|   681k|}
xmlCopyDocElementContent:
  778|  19.3k|xmlCopyDocElementContent(xmlDoc *doc, xmlElementContent *cur) {
  779|  19.3k|    xmlElementContentPtr ret = NULL, prev = NULL, tmp;
  780|  19.3k|    xmlDictPtr dict = NULL;
  781|       |
  782|  19.3k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (782:9): [True: 0, False: 19.3k]
  ------------------
  783|       |
  784|  19.3k|    if (doc != NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 19.3k]
  ------------------
  785|      0|        dict = doc->dict;
  786|       |
  787|  19.3k|    ret = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  788|  19.3k|    if (ret == NULL)
  ------------------
  |  Branch (788:9): [True: 21, False: 19.3k]
  ------------------
  789|     21|	return(NULL);
  790|  19.3k|    memset(ret, 0, sizeof(xmlElementContent));
  791|  19.3k|    ret->type = cur->type;
  792|  19.3k|    ret->ocur = cur->ocur;
  793|  19.3k|    if (cur->name != NULL) {
  ------------------
  |  Branch (793:9): [True: 15.4k, False: 3.90k]
  ------------------
  794|  15.4k|	if (dict)
  ------------------
  |  Branch (794:6): [True: 0, False: 15.4k]
  ------------------
  795|      0|	    ret->name = xmlDictLookup(dict, cur->name, -1);
  796|  15.4k|	else
  797|  15.4k|	    ret->name = xmlStrdup(cur->name);
  798|  15.4k|        if (ret->name == NULL)
  ------------------
  |  Branch (798:13): [True: 20, False: 15.3k]
  ------------------
  799|     20|            goto error;
  800|  15.4k|    }
  801|       |
  802|  19.3k|    if (cur->prefix != NULL) {
  ------------------
  |  Branch (802:9): [True: 1.25k, False: 18.0k]
  ------------------
  803|  1.25k|	if (dict)
  ------------------
  |  Branch (803:6): [True: 0, False: 1.25k]
  ------------------
  804|      0|	    ret->prefix = xmlDictLookup(dict, cur->prefix, -1);
  805|  1.25k|	else
  806|  1.25k|	    ret->prefix = xmlStrdup(cur->prefix);
  807|  1.25k|        if (ret->prefix == NULL)
  ------------------
  |  Branch (807:13): [True: 4, False: 1.25k]
  ------------------
  808|      4|            goto error;
  809|  1.25k|    }
  810|  19.2k|    if (cur->c1 != NULL) {
  ------------------
  |  Branch (810:9): [True: 3.56k, False: 15.7k]
  ------------------
  811|  3.56k|        ret->c1 = xmlCopyDocElementContent(doc, cur->c1);
  812|  3.56k|        if (ret->c1 == NULL)
  ------------------
  |  Branch (812:13): [True: 11, False: 3.55k]
  ------------------
  813|     11|            goto error;
  814|  3.55k|	ret->c1->parent = ret;
  815|  3.55k|    }
  816|  19.2k|    if (cur->c2 != NULL) {
  ------------------
  |  Branch (816:9): [True: 3.55k, False: 15.7k]
  ------------------
  817|  3.55k|        prev = ret;
  818|  3.55k|	cur = cur->c2;
  819|  19.2k|	while (cur != NULL) {
  ------------------
  |  Branch (819:9): [True: 15.9k, False: 3.32k]
  ------------------
  820|  15.9k|	    tmp = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  821|  15.9k|	    if (tmp == NULL)
  ------------------
  |  Branch (821:10): [True: 12, False: 15.9k]
  ------------------
  822|     12|                goto error;
  823|  15.9k|	    memset(tmp, 0, sizeof(xmlElementContent));
  824|  15.9k|	    tmp->type = cur->type;
  825|  15.9k|	    tmp->ocur = cur->ocur;
  826|  15.9k|	    prev->c2 = tmp;
  827|  15.9k|	    tmp->parent = prev;
  828|  15.9k|	    if (cur->name != NULL) {
  ------------------
  |  Branch (828:10): [True: 3.33k, False: 12.5k]
  ------------------
  829|  3.33k|		if (dict)
  ------------------
  |  Branch (829:7): [True: 0, False: 3.33k]
  ------------------
  830|      0|		    tmp->name = xmlDictLookup(dict, cur->name, -1);
  831|  3.33k|		else
  832|  3.33k|		    tmp->name = xmlStrdup(cur->name);
  833|  3.33k|                if (tmp->name == NULL)
  ------------------
  |  Branch (833:21): [True: 10, False: 3.32k]
  ------------------
  834|     10|                    goto error;
  835|  3.33k|	    }
  836|       |
  837|  15.9k|	    if (cur->prefix != NULL) {
  ------------------
  |  Branch (837:10): [True: 319, False: 15.5k]
  ------------------
  838|    319|		if (dict)
  ------------------
  |  Branch (838:7): [True: 0, False: 319]
  ------------------
  839|      0|		    tmp->prefix = xmlDictLookup(dict, cur->prefix, -1);
  840|    319|		else
  841|    319|		    tmp->prefix = xmlStrdup(cur->prefix);
  842|    319|                if (tmp->prefix == NULL)
  ------------------
  |  Branch (842:21): [True: 6, False: 313]
  ------------------
  843|      6|                    goto error;
  844|    319|	    }
  845|  15.9k|	    if (cur->c1 != NULL) {
  ------------------
  |  Branch (845:10): [True: 12.5k, False: 3.32k]
  ------------------
  846|  12.5k|	        tmp->c1 = xmlCopyDocElementContent(doc,cur->c1);
  847|  12.5k|	        if (tmp->c1 == NULL)
  ------------------
  |  Branch (847:14): [True: 204, False: 12.3k]
  ------------------
  848|    204|                    goto error;
  849|  12.3k|		tmp->c1->parent = tmp;
  850|  12.3k|            }
  851|  15.7k|	    prev = tmp;
  852|  15.7k|	    cur = cur->c2;
  853|  15.7k|	}
  854|  3.55k|    }
  855|  19.0k|    return(ret);
  856|       |
  857|    267|error:
  858|    267|    xmlFreeElementContent(ret);
  859|       |    return(NULL);
  860|  19.2k|}
xmlCopyElementContent:
  872|  3.18k|xmlCopyElementContent(xmlElementContent *cur) {
  873|       |    return(xmlCopyDocElementContent(NULL, cur));
  874|  3.18k|}
xmlFreeDocElementContent:
  885|  38.0k|xmlFreeDocElementContent(xmlDoc *doc, xmlElementContent *cur) {
  886|  38.0k|    xmlDictPtr dict = NULL;
  887|  38.0k|    size_t depth = 0;
  888|       |
  889|  38.0k|    if (cur == NULL)
  ------------------
  |  Branch (889:9): [True: 16.1k, False: 21.9k]
  ------------------
  890|  16.1k|        return;
  891|  21.9k|    if (doc != NULL)
  ------------------
  |  Branch (891:9): [True: 18.5k, False: 3.40k]
  ------------------
  892|  18.5k|        dict = doc->dict;
  893|       |
  894|   716k|    while (1) {
  ------------------
  |  Branch (894:12): [True: 716k, Folded]
  ------------------
  895|   716k|        xmlElementContentPtr parent;
  896|       |
  897|  1.06M|        while ((cur->c1 != NULL) || (cur->c2 != NULL)) {
  ------------------
  |  Branch (897:16): [True: 348k, False: 716k]
  |  Branch (897:37): [True: 0, False: 716k]
  ------------------
  898|   348k|            cur = (cur->c1 != NULL) ? cur->c1 : cur->c2;
  ------------------
  |  Branch (898:19): [True: 348k, False: 0]
  ------------------
  899|   348k|            depth += 1;
  900|   348k|        }
  901|       |
  902|   716k|	if (dict) {
  ------------------
  |  Branch (902:6): [True: 422k, False: 294k]
  ------------------
  903|   422k|	    if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name)))
  ------------------
  |  Branch (903:10): [True: 212k, False: 209k]
  |  Branch (903:33): [True: 0, False: 212k]
  ------------------
  904|      0|	        xmlFree((xmlChar *) cur->name);
  905|   422k|	    if ((cur->prefix != NULL) && (!xmlDictOwns(dict, cur->prefix)))
  ------------------
  |  Branch (905:10): [True: 3.86k, False: 418k]
  |  Branch (905:35): [True: 0, False: 3.86k]
  ------------------
  906|      0|	        xmlFree((xmlChar *) cur->prefix);
  907|   422k|	} else {
  908|   294k|	    if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
  ------------------
  |  Branch (908:10): [True: 148k, False: 145k]
  ------------------
  909|   294k|	    if (cur->prefix != NULL) xmlFree((xmlChar *) cur->prefix);
  ------------------
  |  Branch (909:10): [True: 4.47k, False: 289k]
  ------------------
  910|   294k|	}
  911|   716k|        parent = cur->parent;
  912|   716k|        if ((depth == 0) || (parent == NULL)) {
  ------------------
  |  Branch (912:13): [True: 21.9k, False: 694k]
  |  Branch (912:29): [True: 0, False: 694k]
  ------------------
  913|  21.9k|            xmlFree(cur);
  914|  21.9k|            break;
  915|  21.9k|        }
  916|   694k|        if (cur == parent->c1)
  ------------------
  |  Branch (916:13): [True: 348k, False: 346k]
  ------------------
  917|   348k|            parent->c1 = NULL;
  918|   346k|        else
  919|   346k|            parent->c2 = NULL;
  920|   694k|	xmlFree(cur);
  921|       |
  922|   694k|        if (parent->c2 != NULL) {
  ------------------
  |  Branch (922:13): [True: 346k, False: 348k]
  ------------------
  923|   346k|	    cur = parent->c2;
  924|   348k|        } else {
  925|   348k|            depth -= 1;
  926|   348k|            cur = parent;
  927|   348k|        }
  928|   694k|    }
  929|  21.9k|}
xmlFreeElementContent:
  940|    267|xmlFreeElementContent(xmlElementContent *cur) {
  941|       |    xmlFreeDocElementContent(NULL, cur);
  942|    267|}
xmlSnprintfElementContent:
  973|   159k|xmlSnprintfElementContent(char *buf, int size, xmlElementContent *content, int englob) {
  974|   159k|    int len;
  975|       |
  976|   159k|    if (content == NULL) return;
  ------------------
  |  Branch (976:9): [True: 0, False: 159k]
  ------------------
  977|   159k|    len = strlen(buf);
  978|   159k|    if (size - len < 50) {
  ------------------
  |  Branch (978:9): [True: 97, False: 159k]
  ------------------
  979|     97|	if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (979:6): [True: 97, False: 0]
  |  Branch (979:26): [True: 97, False: 0]
  ------------------
  980|     97|	    strcat(buf, " ...");
  981|     97|	return;
  982|     97|    }
  983|   159k|    if (englob) strcat(buf, "(");
  ------------------
  |  Branch (983:9): [True: 20.2k, False: 139k]
  ------------------
  984|   159k|    switch (content->type) {
  ------------------
  |  Branch (984:13): [True: 159k, False: 0]
  ------------------
  985|      0|        case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (985:9): [True: 0, False: 159k]
  ------------------
  986|      0|            strcat(buf, "#PCDATA");
  987|      0|	    break;
  988|  81.8k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (988:2): [True: 81.8k, False: 77.5k]
  ------------------
  989|  81.8k|            int qnameLen = xmlStrlen(content->name);
  990|       |
  991|  81.8k|	    if (content->prefix != NULL)
  ------------------
  |  Branch (991:10): [True: 2.87k, False: 79.0k]
  ------------------
  992|  2.87k|                qnameLen += xmlStrlen(content->prefix) + 1;
  993|  81.8k|	    if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (993:10): [True: 374, False: 81.5k]
  ------------------
  994|    374|		strcat(buf, " ...");
  995|    374|		return;
  996|    374|	    }
  997|  81.5k|	    if (content->prefix != NULL) {
  ------------------
  |  Branch (997:10): [True: 2.87k, False: 78.6k]
  ------------------
  998|  2.87k|		strcat(buf, (char *) content->prefix);
  999|  2.87k|		strcat(buf, ":");
 1000|  2.87k|	    }
 1001|  81.5k|	    if (content->name != NULL)
  ------------------
  |  Branch (1001:10): [True: 81.5k, False: 0]
  ------------------
 1002|  81.5k|		strcat(buf, (char *) content->name);
 1003|  81.5k|	    break;
 1004|  81.8k|        }
 1005|  34.5k|	case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (1005:2): [True: 34.5k, False: 124k]
  ------------------
 1006|  34.5k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1006:10): [True: 6.62k, False: 27.8k]
  ------------------
 1007|  27.8k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1007:10): [True: 2.65k, False: 25.2k]
  ------------------
 1008|  9.27k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1009|  25.2k|	    else
 1010|  25.2k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1011|  34.5k|	    len = strlen(buf);
 1012|  34.5k|	    if (size - len < 50) {
  ------------------
  |  Branch (1012:10): [True: 308, False: 34.2k]
  ------------------
 1013|    308|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1013:7): [True: 231, False: 77]
  |  Branch (1013:27): [True: 151, False: 80]
  ------------------
 1014|    151|		    strcat(buf, " ...");
 1015|    308|		return;
 1016|    308|	    }
 1017|  34.2k|            strcat(buf, " , ");
 1018|  34.2k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1018:11): [True: 87, False: 34.1k]
  ------------------
 1019|  34.1k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1019:4): [True: 2.27k, False: 31.8k]
  ------------------
 1020|  2.36k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1020:3): [True: 104, False: 2.25k]
  ------------------
 1021|    104|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1022|  34.1k|	    else
 1023|  34.1k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1024|  34.2k|	    break;
 1025|  43.0k|	case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (1025:2): [True: 43.0k, False: 116k]
  ------------------
 1026|  43.0k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1026:10): [True: 5.59k, False: 37.4k]
  ------------------
 1027|  37.4k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1027:10): [True: 249, False: 37.2k]
  ------------------
 1028|  5.84k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1029|  37.2k|	    else
 1030|  37.2k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1031|  43.0k|	    len = strlen(buf);
 1032|  43.0k|	    if (size - len < 50) {
  ------------------
  |  Branch (1032:10): [True: 200, False: 42.8k]
  ------------------
 1033|    200|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1033:7): [True: 189, False: 11]
  |  Branch (1033:27): [True: 112, False: 77]
  ------------------
 1034|    112|		    strcat(buf, " ...");
 1035|    200|		return;
 1036|    200|	    }
 1037|  42.8k|            strcat(buf, " | ");
 1038|  42.8k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
  ------------------
  |  Branch (1038:11): [True: 95, False: 42.7k]
  ------------------
 1039|  42.7k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1039:4): [True: 4.61k, False: 38.1k]
  ------------------
 1040|  4.70k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1040:3): [True: 101, False: 4.60k]
  ------------------
 1041|    101|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1042|  42.7k|	    else
 1043|  42.7k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1044|  42.8k|	    break;
 1045|   159k|    }
 1046|   158k|    if (size - strlen(buf) <= 2) return;
  ------------------
  |  Branch (1046:9): [True: 1.36k, False: 157k]
  ------------------
 1047|   157k|    if (englob)
  ------------------
  |  Branch (1047:9): [True: 20.1k, False: 137k]
  ------------------
 1048|  20.1k|        strcat(buf, ")");
 1049|   157k|    switch (content->ocur) {
  ------------------
  |  Branch (1049:13): [True: 157k, False: 0]
  ------------------
 1050|   128k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (1050:9): [True: 128k, False: 28.8k]
  ------------------
 1051|   128k|	    break;
 1052|  9.70k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (1052:9): [True: 9.70k, False: 147k]
  ------------------
 1053|  9.70k|	    strcat(buf, "?");
 1054|  9.70k|	    break;
 1055|  13.0k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (1055:9): [True: 13.0k, False: 144k]
  ------------------
 1056|  13.0k|	    strcat(buf, "*");
 1057|  13.0k|	    break;
 1058|  6.14k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (1058:9): [True: 6.14k, False: 151k]
  ------------------
 1059|  6.14k|	    strcat(buf, "+");
 1060|  6.14k|	    break;
 1061|   157k|    }
 1062|   157k|}
xmlAddElementDecl:
 1106|  17.6k|		  xmlElementContent *content) {
 1107|  17.6k|    xmlElementPtr ret;
 1108|  17.6k|    xmlElementTablePtr table;
 1109|  17.6k|    xmlAttributePtr oldAttributes = NULL;
 1110|  17.6k|    const xmlChar *localName;
 1111|  17.6k|    xmlChar *prefix = NULL;
 1112|       |
 1113|  17.6k|    if ((dtd == NULL) || (name == NULL))
  ------------------
  |  Branch (1113:9): [True: 0, False: 17.6k]
  |  Branch (1113:26): [True: 0, False: 17.6k]
  ------------------
 1114|      0|	return(NULL);
 1115|       |
 1116|  17.6k|    switch (type) {
 1117|  5.36k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (1117:9): [True: 5.36k, False: 12.2k]
  ------------------
 1118|  5.93k|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (1118:9): [True: 573, False: 17.0k]
  ------------------
 1119|  5.93k|            if (content != NULL)
  ------------------
  |  Branch (1119:17): [True: 0, False: 5.93k]
  ------------------
 1120|      0|                return(NULL);
 1121|  5.93k|            break;
 1122|  5.93k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (1122:9): [True: 5.31k, False: 12.3k]
  ------------------
 1123|  11.6k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (1123:9): [True: 6.37k, False: 11.2k]
  ------------------
 1124|  11.6k|            if (content == NULL)
  ------------------
  |  Branch (1124:17): [True: 0, False: 11.6k]
  ------------------
 1125|      0|                return(NULL);
 1126|  11.6k|            break;
 1127|  11.6k|        default:
  ------------------
  |  Branch (1127:9): [True: 0, False: 17.6k]
  ------------------
 1128|      0|            return(NULL);
 1129|  17.6k|    }
 1130|       |
 1131|       |    /*
 1132|       |     * check if name is a QName
 1133|       |     */
 1134|  17.6k|    localName = xmlSplitQName4(name, &prefix);
 1135|  17.6k|    if (localName == NULL)
  ------------------
  |  Branch (1135:9): [True: 1, False: 17.6k]
  ------------------
 1136|      1|        goto mem_error;
 1137|       |
 1138|       |    /*
 1139|       |     * Create the Element table if needed.
 1140|       |     */
 1141|  17.6k|    table = (xmlElementTablePtr) dtd->elements;
 1142|  17.6k|    if (table == NULL) {
  ------------------
  |  Branch (1142:9): [True: 4.51k, False: 13.1k]
  ------------------
 1143|  4.51k|	xmlDictPtr dict = NULL;
 1144|       |
 1145|  4.51k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1145:6): [True: 4.51k, False: 0]
  ------------------
 1146|  4.51k|	    dict = dtd->doc->dict;
 1147|  4.51k|        table = xmlHashCreateDict(0, dict);
 1148|  4.51k|        if (table == NULL)
  ------------------
  |  Branch (1148:13): [True: 3, False: 4.50k]
  ------------------
 1149|      3|            goto mem_error;
 1150|  4.50k|	dtd->elements = (void *) table;
 1151|  4.50k|    }
 1152|       |
 1153|       |    /*
 1154|       |     * lookup old attributes inserted on an undefined element in the
 1155|       |     * internal subset.
 1156|       |     */
 1157|  17.6k|    if ((dtd->doc != NULL) && (dtd->doc->intSubset != NULL)) {
  ------------------
  |  Branch (1157:9): [True: 17.6k, False: 0]
  |  Branch (1157:31): [True: 17.6k, False: 0]
  ------------------
 1158|  17.6k|	ret = xmlHashLookup2(dtd->doc->intSubset->elements, localName, prefix);
 1159|  17.6k|	if ((ret != NULL) && (ret->etype == XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (1159:6): [True: 3.81k, False: 13.8k]
  |  Branch (1159:23): [True: 181, False: 3.63k]
  ------------------
 1160|    181|	    oldAttributes = ret->attributes;
 1161|    181|	    ret->attributes = NULL;
 1162|    181|	    xmlHashRemoveEntry2(dtd->doc->intSubset->elements, localName, prefix,
 1163|    181|                                NULL);
 1164|    181|	    xmlFreeElement(ret);
 1165|    181|	}
 1166|  17.6k|    }
 1167|       |
 1168|       |    /*
 1169|       |     * The element may already be present if one of its attribute
 1170|       |     * was registered first
 1171|       |     */
 1172|  17.6k|    ret = xmlHashLookup2(table, localName, prefix);
 1173|  17.6k|    if (ret != NULL) {
  ------------------
  |  Branch (1173:9): [True: 5.48k, False: 12.1k]
  ------------------
 1174|  5.48k|	if (ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
  ------------------
  |  Branch (1174:6): [True: 5.44k, False: 40]
  ------------------
 1175|  5.44k|#ifdef LIBXML_VALID_ENABLED
 1176|       |	    /*
 1177|       |	     * The element is already defined in this DTD.
 1178|       |	     */
 1179|  5.44k|            if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  5.44k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1179:17): [True: 5.44k, False: 0]
  |  Branch (1179:35): [True: 3.43k, False: 2.01k]
  ------------------
 1180|  3.43k|                xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ELEM_REDEFINED,
 1181|  3.43k|                                "Redefinition of element %s\n",
 1182|  3.43k|                                name, NULL, NULL);
 1183|  5.44k|#endif /* LIBXML_VALID_ENABLED */
 1184|  5.44k|            if (prefix != NULL)
  ------------------
  |  Branch (1184:17): [True: 293, False: 5.15k]
  ------------------
 1185|    293|	        xmlFree(prefix);
 1186|  5.44k|	    return(NULL);
 1187|  5.44k|	}
 1188|     40|	if (prefix != NULL) {
  ------------------
  |  Branch (1188:6): [True: 1, False: 39]
  ------------------
 1189|      1|	    xmlFree(prefix);
 1190|      1|	    prefix = NULL;
 1191|      1|	}
 1192|  12.1k|    } else {
 1193|  12.1k|        int res;
 1194|       |
 1195|  12.1k|	ret = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 1196|  12.1k|	if (ret == NULL)
  ------------------
  |  Branch (1196:6): [True: 3, False: 12.1k]
  ------------------
 1197|      3|            goto mem_error;
 1198|  12.1k|	memset(ret, 0, sizeof(xmlElement));
 1199|  12.1k|	ret->type = XML_ELEMENT_DECL;
 1200|       |
 1201|       |	/*
 1202|       |	 * fill the structure.
 1203|       |	 */
 1204|  12.1k|	ret->name = xmlStrdup(localName);
 1205|  12.1k|	if (ret->name == NULL) {
  ------------------
  |  Branch (1205:6): [True: 1, False: 12.1k]
  ------------------
 1206|      1|	    xmlFree(ret);
 1207|      1|	    goto mem_error;
 1208|      1|	}
 1209|  12.1k|	ret->prefix = prefix;
 1210|  12.1k|        prefix = NULL;
 1211|       |
 1212|       |	/*
 1213|       |	 * Validity Check:
 1214|       |	 * Insertion must not fail
 1215|       |	 */
 1216|  12.1k|        res = xmlHashAdd2(table, localName, ret->prefix, ret);
 1217|  12.1k|        if (res <= 0) {
  ------------------
  |  Branch (1217:13): [True: 7, False: 12.1k]
  ------------------
 1218|      7|	    xmlFreeElement(ret);
 1219|      7|            goto mem_error;
 1220|      7|	}
 1221|       |	/*
 1222|       |	 * For new element, may have attributes from earlier
 1223|       |	 * definition in internal subset
 1224|       |	 */
 1225|  12.1k|	ret->attributes = oldAttributes;
 1226|  12.1k|    }
 1227|       |
 1228|       |    /*
 1229|       |     * Finish to fill the structure.
 1230|       |     */
 1231|  12.1k|    ret->etype = type;
 1232|       |    /*
 1233|       |     * Avoid a stupid copy when called by the parser
 1234|       |     * and flag it by setting a special parent value
 1235|       |     * so the parser doesn't unallocate it.
 1236|       |     */
 1237|  12.1k|    if (content != NULL) {
  ------------------
  |  Branch (1237:9): [True: 9.07k, False: 3.09k]
  ------------------
 1238|  9.07k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_USE_PCTXT)) {
  ------------------
  |  |   20|  9.07k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (1238:13): [True: 9.07k, False: 0]
  |  Branch (1238:31): [True: 9.07k, False: 0]
  ------------------
 1239|  9.07k|            ret->content = content;
 1240|  9.07k|            content->parent = (xmlElementContentPtr) 1;
 1241|  9.07k|        } else if (content != NULL){
  ------------------
  |  Branch (1241:20): [True: 0, False: 0]
  ------------------
 1242|      0|            ret->content = xmlCopyDocElementContent(dtd->doc, content);
 1243|      0|            if (ret->content == NULL)
  ------------------
  |  Branch (1243:17): [True: 0, False: 0]
  ------------------
 1244|      0|                goto mem_error;
 1245|      0|        }
 1246|  9.07k|    }
 1247|       |
 1248|       |    /*
 1249|       |     * Link it to the DTD
 1250|       |     */
 1251|  12.1k|    ret->parent = dtd;
 1252|  12.1k|    ret->doc = dtd->doc;
 1253|  12.1k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1253:9): [True: 4.13k, False: 8.02k]
  ------------------
 1254|  4.13k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1255|  8.02k|    } else {
 1256|  8.02k|        dtd->last->next = (xmlNodePtr) ret;
 1257|  8.02k|	ret->prev = dtd->last;
 1258|  8.02k|	dtd->last = (xmlNodePtr) ret;
 1259|  8.02k|    }
 1260|  12.1k|    if (prefix != NULL)
  ------------------
  |  Branch (1260:9): [True: 0, False: 12.1k]
  ------------------
 1261|      0|	xmlFree(prefix);
 1262|  12.1k|    return(ret);
 1263|       |
 1264|     15|mem_error:
 1265|     15|    xmlVErrMemory(ctxt);
 1266|     15|    if (prefix != NULL)
  ------------------
  |  Branch (1266:9): [True: 1, False: 14]
  ------------------
 1267|      1|        xmlFree(prefix);
 1268|       |    return(NULL);
 1269|  12.1k|}
xmlFreeElementTable:
 1284|  14.6k|xmlFreeElementTable(xmlElementTable *table) {
 1285|  14.6k|    xmlHashFree(table, xmlFreeElementTableEntry);
 1286|  14.6k|}
xmlCopyElementTable:
 1339|  6.02k|xmlCopyElementTable(xmlElementTable *table) {
 1340|  6.02k|    return(xmlHashCopySafe(table, xmlCopyElement, xmlFreeElementTableEntry));
 1341|  6.02k|}
xmlCreateEnumeration:
 1413|  54.4k|xmlCreateEnumeration(const xmlChar *name) {
 1414|  54.4k|    xmlEnumerationPtr ret;
 1415|       |
 1416|  54.4k|    ret = (xmlEnumerationPtr) xmlMalloc(sizeof(xmlEnumeration));
 1417|  54.4k|    if (ret == NULL)
  ------------------
  |  Branch (1417:9): [True: 16, False: 54.4k]
  ------------------
 1418|     16|        return(NULL);
 1419|  54.4k|    memset(ret, 0, sizeof(xmlEnumeration));
 1420|       |
 1421|  54.4k|    if (name != NULL) {
  ------------------
  |  Branch (1421:9): [True: 54.4k, False: 0]
  ------------------
 1422|  54.4k|        ret->name = xmlStrdup(name);
 1423|  54.4k|        if (ret->name == NULL) {
  ------------------
  |  Branch (1423:13): [True: 12, False: 54.4k]
  ------------------
 1424|     12|            xmlFree(ret);
 1425|     12|            return(NULL);
 1426|     12|        }
 1427|  54.4k|    }
 1428|       |
 1429|  54.4k|    return(ret);
 1430|  54.4k|}
xmlFreeEnumeration:
 1438|  47.8k|xmlFreeEnumeration(xmlEnumeration *cur) {
 1439|   102k|    while (cur != NULL) {
  ------------------
  |  Branch (1439:12): [True: 54.4k, False: 47.8k]
  ------------------
 1440|  54.4k|        xmlEnumerationPtr next = cur->next;
 1441|       |
 1442|  54.4k|        xmlFree((xmlChar *) cur->name);
 1443|  54.4k|        xmlFree(cur);
 1444|       |
 1445|  54.4k|        cur = next;
 1446|  54.4k|    }
 1447|  47.8k|}
xmlCopyEnumeration:
 1459|  5.33k|xmlCopyEnumeration(xmlEnumeration *cur) {
 1460|  5.33k|    xmlEnumerationPtr ret = NULL;
 1461|  5.33k|    xmlEnumerationPtr last = NULL;
 1462|       |
 1463|  12.3k|    while (cur != NULL) {
  ------------------
  |  Branch (1463:12): [True: 7.04k, False: 5.31k]
  ------------------
 1464|  7.04k|        xmlEnumerationPtr copy = xmlCreateEnumeration(cur->name);
 1465|       |
 1466|  7.04k|        if (copy == NULL) {
  ------------------
  |  Branch (1466:13): [True: 24, False: 7.01k]
  ------------------
 1467|     24|            xmlFreeEnumeration(ret);
 1468|     24|            return(NULL);
 1469|     24|        }
 1470|       |
 1471|  7.01k|        if (ret == NULL) {
  ------------------
  |  Branch (1471:13): [True: 5.32k, False: 1.69k]
  ------------------
 1472|  5.32k|            ret = last = copy;
 1473|  5.32k|        } else {
 1474|  1.69k|            last->next = copy;
 1475|  1.69k|            last = copy;
 1476|  1.69k|        }
 1477|       |
 1478|  7.01k|        cur = cur->next;
 1479|  7.01k|    }
 1480|       |
 1481|  5.31k|    return(ret);
 1482|  5.33k|}
xmlAddAttributeDecl:
 1572|  76.8k|		    const xmlChar *defaultValue, xmlEnumeration *tree) {
 1573|  76.8k|    xmlAttributePtr ret = NULL;
 1574|  76.8k|    xmlAttributeTablePtr table;
 1575|  76.8k|    xmlElementPtr elemDef;
 1576|  76.8k|    xmlDictPtr dict = NULL;
 1577|  76.8k|    int res;
 1578|       |
 1579|  76.8k|    if (dtd == NULL) {
  ------------------
  |  Branch (1579:9): [True: 0, False: 76.8k]
  ------------------
 1580|      0|	xmlFreeEnumeration(tree);
 1581|      0|	return(NULL);
 1582|      0|    }
 1583|  76.8k|    if (name == NULL) {
  ------------------
  |  Branch (1583:9): [True: 9, False: 76.8k]
  ------------------
 1584|      9|	xmlFreeEnumeration(tree);
 1585|      9|	return(NULL);
 1586|      9|    }
 1587|  76.8k|    if (elem == NULL) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 76.8k]
  ------------------
 1588|      0|	xmlFreeEnumeration(tree);
 1589|      0|	return(NULL);
 1590|      0|    }
 1591|  76.8k|    if (dtd->doc != NULL)
  ------------------
  |  Branch (1591:9): [True: 76.8k, False: 0]
  ------------------
 1592|  76.8k|	dict = dtd->doc->dict;
 1593|       |
 1594|  76.8k|#ifdef LIBXML_VALID_ENABLED
 1595|  76.8k|    if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE) &&
  ------------------
  |  |   24|  76.8k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1595:9): [True: 76.8k, False: 0]
  |  Branch (1595:27): [True: 63.6k, False: 13.1k]
  ------------------
 1596|  63.6k|        (defaultValue != NULL) &&
  ------------------
  |  Branch (1596:9): [True: 20.2k, False: 43.4k]
  ------------------
 1597|  20.2k|        (!xmlValidateAttributeValueInternal(dtd->doc, type, defaultValue))) {
  ------------------
  |  Branch (1597:9): [True: 10.2k, False: 9.96k]
  ------------------
 1598|  10.2k|	xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT,
 1599|  10.2k|	                "Attribute %s of %s: invalid default value\n",
 1600|  10.2k|	                elem, name, defaultValue);
 1601|  10.2k|	defaultValue = NULL;
 1602|  10.2k|	if (ctxt != NULL)
  ------------------
  |  Branch (1602:6): [True: 10.2k, False: 0]
  ------------------
 1603|  10.2k|	    ctxt->valid = 0;
 1604|  10.2k|    }
 1605|  76.8k|#endif /* LIBXML_VALID_ENABLED */
 1606|       |
 1607|       |    /*
 1608|       |     * Check first that an attribute defined in the external subset wasn't
 1609|       |     * already defined in the internal subset
 1610|       |     */
 1611|  76.8k|    if ((dtd->doc != NULL) && (dtd->doc->extSubset == dtd) &&
  ------------------
  |  Branch (1611:9): [True: 76.8k, False: 0]
  |  Branch (1611:31): [True: 32.8k, False: 43.9k]
  ------------------
 1612|  32.8k|	(dtd->doc->intSubset != NULL) &&
  ------------------
  |  Branch (1612:2): [True: 32.8k, False: 0]
  ------------------
 1613|  32.8k|	(dtd->doc->intSubset->attributes != NULL)) {
  ------------------
  |  Branch (1613:2): [True: 7.21k, False: 25.6k]
  ------------------
 1614|  7.21k|        ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
 1615|  7.21k|	if (ret != NULL) {
  ------------------
  |  Branch (1615:6): [True: 3.55k, False: 3.66k]
  ------------------
 1616|  3.55k|	    xmlFreeEnumeration(tree);
 1617|  3.55k|	    return(NULL);
 1618|  3.55k|	}
 1619|  7.21k|    }
 1620|       |
 1621|       |    /*
 1622|       |     * Create the Attribute table if needed.
 1623|       |     */
 1624|  73.2k|    table = (xmlAttributeTablePtr) dtd->attributes;
 1625|  73.2k|    if (table == NULL) {
  ------------------
  |  Branch (1625:9): [True: 5.66k, False: 67.6k]
  ------------------
 1626|  5.66k|        table = xmlHashCreateDict(0, dict);
 1627|  5.66k|	dtd->attributes = (void *) table;
 1628|  5.66k|    }
 1629|  73.2k|    if (table == NULL)
  ------------------
  |  Branch (1629:9): [True: 4, False: 73.2k]
  ------------------
 1630|      4|        goto mem_error;
 1631|       |
 1632|  73.2k|    ret = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
 1633|  73.2k|    if (ret == NULL)
  ------------------
  |  Branch (1633:9): [True: 2, False: 73.2k]
  ------------------
 1634|      2|        goto mem_error;
 1635|  73.2k|    memset(ret, 0, sizeof(xmlAttribute));
 1636|  73.2k|    ret->type = XML_ATTRIBUTE_DECL;
 1637|       |
 1638|       |    /*
 1639|       |     * fill the structure.
 1640|       |     */
 1641|  73.2k|    ret->atype = type;
 1642|       |    /*
 1643|       |     * doc must be set before possible error causes call
 1644|       |     * to xmlFreeAttribute (because it's used to check on
 1645|       |     * dict use)
 1646|       |     */
 1647|  73.2k|    ret->doc = dtd->doc;
 1648|  73.2k|    if (dict) {
  ------------------
  |  Branch (1648:9): [True: 50.6k, False: 22.5k]
  ------------------
 1649|  50.6k|	ret->name = xmlDictLookup(dict, name, -1);
 1650|  50.6k|	ret->elem = xmlDictLookup(dict, elem, -1);
 1651|  50.6k|    } else {
 1652|  22.5k|	ret->name = xmlStrdup(name);
 1653|  22.5k|	ret->elem = xmlStrdup(elem);
 1654|  22.5k|    }
 1655|  73.2k|    if ((ret->name == NULL) || (ret->elem == NULL))
  ------------------
  |  Branch (1655:9): [True: 6, False: 73.2k]
  |  Branch (1655:32): [True: 2, False: 73.2k]
  ------------------
 1656|      8|        goto mem_error;
 1657|  73.2k|    if (ns != NULL) {
  ------------------
  |  Branch (1657:9): [True: 6.04k, False: 67.2k]
  ------------------
 1658|  6.04k|        if (dict)
  ------------------
  |  Branch (1658:13): [True: 3.48k, False: 2.55k]
  ------------------
 1659|  3.48k|            ret->prefix = xmlDictLookup(dict, ns, -1);
 1660|  2.55k|        else
 1661|  2.55k|            ret->prefix = xmlStrdup(ns);
 1662|  6.04k|        if (ret->prefix == NULL)
  ------------------
  |  Branch (1662:13): [True: 1, False: 6.04k]
  ------------------
 1663|      1|            goto mem_error;
 1664|  6.04k|    }
 1665|  73.2k|    ret->def = def;
 1666|  73.2k|    ret->tree = tree;
 1667|  73.2k|    tree = NULL;
 1668|  73.2k|    if (defaultValue != NULL) {
  ------------------
  |  Branch (1668:9): [True: 17.0k, False: 56.1k]
  ------------------
 1669|  17.0k|	ret->defaultValue = xmlStrdup(defaultValue);
 1670|  17.0k|        if (ret->defaultValue == NULL)
  ------------------
  |  Branch (1670:13): [True: 3, False: 17.0k]
  ------------------
 1671|      3|            goto mem_error;
 1672|  17.0k|    }
 1673|       |
 1674|  73.2k|    elemDef = xmlGetDtdElementDesc2(ctxt, dtd, elem);
 1675|  73.2k|    if (elemDef == NULL)
  ------------------
  |  Branch (1675:9): [True: 13, False: 73.2k]
  ------------------
 1676|     13|        goto mem_error;
 1677|       |
 1678|       |    /*
 1679|       |     * Validity Check:
 1680|       |     * Search the DTD for previous declarations of the ATTLIST
 1681|       |     */
 1682|  73.2k|    res = xmlHashAdd3(table, ret->name, ret->prefix, ret->elem, ret);
 1683|  73.2k|    if (res <= 0) {
  ------------------
  |  Branch (1683:9): [True: 41.8k, False: 31.3k]
  ------------------
 1684|  41.8k|        if (res < 0)
  ------------------
  |  Branch (1684:13): [True: 4, False: 41.8k]
  ------------------
 1685|      4|            goto mem_error;
 1686|  41.8k|#ifdef LIBXML_VALID_ENABLED
 1687|       |        /*
 1688|       |         * The attribute is already defined in this DTD.
 1689|       |         */
 1690|  41.8k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  41.8k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1690:13): [True: 41.8k, False: 0]
  |  Branch (1690:31): [True: 36.4k, False: 5.40k]
  ------------------
 1691|  36.4k|            xmlErrValidWarning(ctxt, (xmlNodePtr) dtd,
 1692|  36.4k|                    XML_DTD_ATTRIBUTE_REDEFINED,
 1693|  36.4k|                    "Attribute %s of element %s: already defined\n",
 1694|  36.4k|                    name, elem, NULL);
 1695|  41.8k|#endif /* LIBXML_VALID_ENABLED */
 1696|  41.8k|	xmlFreeAttribute(ret);
 1697|  41.8k|	return(NULL);
 1698|  41.8k|    }
 1699|       |
 1700|       |    /*
 1701|       |     * Insert namespace default def first they need to be
 1702|       |     * processed first.
 1703|       |     */
 1704|  31.3k|    if ((xmlStrEqual(ret->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  31.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1704:9): [True: 628, False: 30.7k]
  ------------------
 1705|  30.7k|        ((ret->prefix != NULL &&
  ------------------
  |  Branch (1705:11): [True: 4.38k, False: 26.3k]
  ------------------
 1706|  4.38k|         (xmlStrEqual(ret->prefix, BAD_CAST "xmlns"))))) {
  ------------------
  |  |   34|  4.38k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1706:10): [True: 2.04k, False: 2.34k]
  ------------------
 1707|  2.66k|        ret->nexth = elemDef->attributes;
 1708|  2.66k|        elemDef->attributes = ret;
 1709|  28.7k|    } else {
 1710|  28.7k|        xmlAttributePtr tmp = elemDef->attributes;
 1711|       |
 1712|  29.4k|        while ((tmp != NULL) &&
  ------------------
  |  Branch (1712:16): [True: 19.6k, False: 9.78k]
  ------------------
 1713|  19.6k|               ((xmlStrEqual(tmp->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  19.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1713:17): [True: 782, False: 18.8k]
  ------------------
 1714|  18.8k|                ((ret->prefix != NULL &&
  ------------------
  |  Branch (1714:19): [True: 1.34k, False: 17.5k]
  ------------------
 1715|  1.34k|                 (xmlStrEqual(ret->prefix, BAD_CAST "xmlns")))))) {
  ------------------
  |  |   34|  1.34k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1715:18): [True: 0, False: 1.34k]
  ------------------
 1716|    782|            if (tmp->nexth == NULL)
  ------------------
  |  Branch (1716:17): [True: 32, False: 750]
  ------------------
 1717|     32|                break;
 1718|    750|            tmp = tmp->nexth;
 1719|    750|        }
 1720|  28.7k|        if (tmp != NULL) {
  ------------------
  |  Branch (1720:13): [True: 18.9k, False: 9.78k]
  ------------------
 1721|  18.9k|            ret->nexth = tmp->nexth;
 1722|  18.9k|            tmp->nexth = ret;
 1723|  18.9k|        } else {
 1724|  9.78k|            ret->nexth = elemDef->attributes;
 1725|  9.78k|            elemDef->attributes = ret;
 1726|  9.78k|        }
 1727|  28.7k|    }
 1728|       |
 1729|       |    /*
 1730|       |     * Link it to the DTD
 1731|       |     */
 1732|  31.3k|    ret->parent = dtd;
 1733|  31.3k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1733:9): [True: 3.83k, False: 27.5k]
  ------------------
 1734|  3.83k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1735|  27.5k|    } else {
 1736|  27.5k|        dtd->last->next = (xmlNodePtr) ret;
 1737|  27.5k|	ret->prev = dtd->last;
 1738|  27.5k|	dtd->last = (xmlNodePtr) ret;
 1739|  27.5k|    }
 1740|  31.3k|    return(ret);
 1741|       |
 1742|     35|mem_error:
 1743|     35|    xmlVErrMemory(ctxt);
 1744|     35|    xmlFreeEnumeration(tree);
 1745|     35|    xmlFreeAttribute(ret);
 1746|       |    return(NULL);
 1747|  73.2k|}
xmlFreeAttributeTable:
 1762|  9.33k|xmlFreeAttributeTable(xmlAttributeTable *table) {
 1763|  9.33k|    xmlHashFree(table, xmlFreeAttributeTableEntry);
 1764|  9.33k|}
xmlCopyAttributeTable:
 1826|  3.79k|xmlCopyAttributeTable(xmlAttributeTable *table) {
 1827|  3.79k|    return(xmlHashCopySafe(table, xmlCopyAttribute,
 1828|  3.79k|                           xmlFreeAttributeTableEntry));
 1829|  3.79k|}
xmlAddNotationDecl:
 1926|  2.32k|                   const xmlChar *publicId, const xmlChar *systemId) {
 1927|  2.32k|    xmlNotationPtr ret = NULL;
 1928|  2.32k|    xmlNotationTablePtr table;
 1929|  2.32k|    int res;
 1930|       |
 1931|  2.32k|    if (dtd == NULL) {
  ------------------
  |  Branch (1931:9): [True: 0, False: 2.32k]
  ------------------
 1932|      0|	return(NULL);
 1933|      0|    }
 1934|  2.32k|    if (name == NULL) {
  ------------------
  |  Branch (1934:9): [True: 0, False: 2.32k]
  ------------------
 1935|      0|	return(NULL);
 1936|      0|    }
 1937|  2.32k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (1937:9): [True: 781, False: 1.54k]
  |  Branch (1937:31): [True: 0, False: 781]
  ------------------
 1938|      0|	return(NULL);
 1939|      0|    }
 1940|       |
 1941|       |    /*
 1942|       |     * Create the Notation table if needed.
 1943|       |     */
 1944|  2.32k|    table = (xmlNotationTablePtr) dtd->notations;
 1945|  2.32k|    if (table == NULL) {
  ------------------
  |  Branch (1945:9): [True: 269, False: 2.05k]
  ------------------
 1946|    269|	xmlDictPtr dict = NULL;
 1947|    269|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1947:6): [True: 269, False: 0]
  ------------------
 1948|    269|	    dict = dtd->doc->dict;
 1949|       |
 1950|    269|        dtd->notations = table = xmlHashCreateDict(0, dict);
 1951|    269|        if (table == NULL)
  ------------------
  |  Branch (1951:13): [True: 1, False: 268]
  ------------------
 1952|      1|            goto mem_error;
 1953|    269|    }
 1954|       |
 1955|  2.32k|    ret = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
 1956|  2.32k|    if (ret == NULL)
  ------------------
  |  Branch (1956:9): [True: 3, False: 2.31k]
  ------------------
 1957|      3|        goto mem_error;
 1958|  2.31k|    memset(ret, 0, sizeof(xmlNotation));
 1959|       |
 1960|       |    /*
 1961|       |     * fill the structure.
 1962|       |     */
 1963|  2.31k|    ret->name = xmlStrdup(name);
 1964|  2.31k|    if (ret->name == NULL)
  ------------------
  |  Branch (1964:9): [True: 1, False: 2.31k]
  ------------------
 1965|      1|        goto mem_error;
 1966|  2.31k|    if (systemId != NULL) {
  ------------------
  |  Branch (1966:9): [True: 807, False: 1.51k]
  ------------------
 1967|    807|        ret->SystemID = xmlStrdup(systemId);
 1968|    807|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (1968:13): [True: 1, False: 806]
  ------------------
 1969|      1|            goto mem_error;
 1970|    807|    }
 1971|  2.31k|    if (publicId != NULL) {
  ------------------
  |  Branch (1971:9): [True: 1.53k, False: 778]
  ------------------
 1972|  1.53k|        ret->PublicID = xmlStrdup(publicId);
 1973|  1.53k|        if (ret->PublicID == NULL)
  ------------------
  |  Branch (1973:13): [True: 1, False: 1.53k]
  ------------------
 1974|      1|            goto mem_error;
 1975|  1.53k|    }
 1976|       |
 1977|       |    /*
 1978|       |     * Validity Check:
 1979|       |     * Check the DTD for previous declarations of the ATTLIST
 1980|       |     */
 1981|  2.31k|    res = xmlHashAdd(table, name, ret);
 1982|  2.31k|    if (res <= 0) {
  ------------------
  |  Branch (1982:9): [True: 2.04k, False: 269]
  ------------------
 1983|  2.04k|        if (res < 0)
  ------------------
  |  Branch (1983:13): [True: 2, False: 2.04k]
  ------------------
 1984|      2|            goto mem_error;
 1985|  2.04k|#ifdef LIBXML_VALID_ENABLED
 1986|  2.04k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  2.04k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1986:13): [True: 2.04k, False: 0]
  |  Branch (1986:31): [True: 1.38k, False: 661]
  ------------------
 1987|  1.38k|            xmlErrValid(ctxt, XML_DTD_NOTATION_REDEFINED,
 1988|  1.38k|                        "xmlAddNotationDecl: %s already defined\n",
 1989|  1.38k|                        (const char *) name);
 1990|  2.04k|#endif /* LIBXML_VALID_ENABLED */
 1991|  2.04k|	xmlFreeNotation(ret);
 1992|  2.04k|	return(NULL);
 1993|  2.04k|    }
 1994|    269|    return(ret);
 1995|       |
 1996|      9|mem_error:
 1997|      9|    xmlVErrMemory(ctxt);
 1998|      9|    xmlFreeNotation(ret);
 1999|       |    return(NULL);
 2000|  2.31k|}
xmlFreeNotationTable:
 2015|  1.93k|xmlFreeNotationTable(xmlNotationTable *table) {
 2016|  1.93k|    xmlHashFree(table, xmlFreeNotationTableEntry);
 2017|  1.93k|}
xmlCopyNotationTable:
 2066|  1.69k|xmlCopyNotationTable(xmlNotationTable *table) {
 2067|  1.69k|    return(xmlHashCopySafe(table, xmlCopyNotation, xmlFreeNotationTableEntry));
 2068|  1.69k|}
xmlAddIDSafe:
 2259|  5.83k|xmlAddIDSafe(xmlAttr *attr, const xmlChar *value) {
 2260|       |    return(xmlAddIDInternal(attr, value, NULL));
 2261|  5.83k|}
xmlAddID:
 2274|  14.5k|         xmlAttr *attr) {
 2275|  14.5k|    xmlIDPtr id;
 2276|  14.5k|    int res;
 2277|       |
 2278|  14.5k|    if ((attr == NULL) || (doc != attr->doc))
  ------------------
  |  Branch (2278:9): [True: 0, False: 14.5k]
  |  Branch (2278:27): [True: 0, False: 14.5k]
  ------------------
 2279|      0|        return(NULL);
 2280|       |
 2281|  14.5k|    res = xmlAddIDInternal(attr, value, &id);
 2282|  14.5k|    if (res < 0) {
  ------------------
  |  Branch (2282:9): [True: 23, False: 14.5k]
  ------------------
 2283|     23|        xmlVErrMemory(ctxt);
 2284|     23|    }
 2285|  14.5k|    else if (res == 0) {
  ------------------
  |  Branch (2285:14): [True: 13.3k, False: 1.18k]
  ------------------
 2286|  13.3k|        if (ctxt != NULL) {
  ------------------
  |  Branch (2286:13): [True: 13.3k, False: 0]
  ------------------
 2287|       |            /*
 2288|       |             * The id is already defined in this DTD.
 2289|       |             */
 2290|  13.3k|            xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
 2291|  13.3k|                            "ID %s already defined\n", value, NULL, NULL);
 2292|  13.3k|        }
 2293|  13.3k|    }
 2294|       |
 2295|  14.5k|    return(id);
 2296|  14.5k|}
xmlFreeIDTable:
 2309|    824|xmlFreeIDTable(xmlIDTable *table) {
 2310|    824|    xmlHashFree(table, xmlFreeIDTableEntry);
 2311|    824|}
xmlIsID:
 2326|  1.67M|xmlIsID(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2327|  1.67M|    if ((attr == NULL) || (attr->name == NULL))
  ------------------
  |  Branch (2327:9): [True: 0, False: 1.67M]
  |  Branch (2327:27): [True: 35, False: 1.67M]
  ------------------
 2328|     35|        return(0);
 2329|       |
 2330|  1.67M|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (2330:9): [True: 1.67M, False: 0]
  |  Branch (2330:26): [True: 0, False: 1.67M]
  ------------------
 2331|      0|        if (xmlStrEqual(BAD_CAST "id", attr->name))
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2331:13): [True: 0, False: 0]
  ------------------
 2332|      0|            return(1);
 2333|       |
 2334|      0|        if ((elem == NULL) || (elem->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2334:13): [True: 0, False: 0]
  |  Branch (2334:31): [True: 0, False: 0]
  ------------------
 2335|      0|            return(0);
 2336|       |
 2337|      0|        if ((xmlStrEqual(BAD_CAST "name", attr->name)) &&
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2337:13): [True: 0, False: 0]
  ------------------
 2338|      0|	    (xmlStrEqual(elem->name, BAD_CAST "a")))
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2338:6): [True: 0, False: 0]
  ------------------
 2339|      0|	    return(1);
 2340|  1.67M|    } else {
 2341|  1.67M|	xmlAttributePtr attrDecl = NULL;
 2342|  1.67M|	xmlChar felem[50];
 2343|  1.67M|	xmlChar *fullelemname;
 2344|  1.67M|        const xmlChar *aprefix;
 2345|       |
 2346|  1.67M|        if ((attr->ns != NULL) && (attr->ns->prefix != NULL) &&
  ------------------
  |  Branch (2346:13): [True: 764k, False: 908k]
  |  Branch (2346:35): [True: 764k, False: 0]
  ------------------
 2347|   764k|            (!strcmp((char *) attr->name, "id")) &&
  ------------------
  |  Branch (2347:13): [True: 3.75k, False: 761k]
  ------------------
 2348|  3.75k|            (!strcmp((char *) attr->ns->prefix, "xml")))
  ------------------
  |  Branch (2348:13): [True: 3.54k, False: 213]
  ------------------
 2349|  3.54k|            return(1);
 2350|       |
 2351|  1.66M|        if ((doc == NULL) ||
  ------------------
  |  Branch (2351:13): [True: 0, False: 1.66M]
  ------------------
 2352|  1.66M|            ((doc->intSubset == NULL) && (doc->extSubset == NULL)))
  ------------------
  |  Branch (2352:14): [True: 1.19M, False: 474k]
  |  Branch (2352:42): [True: 1.19M, False: 0]
  ------------------
 2353|  1.19M|            return(0);
 2354|       |
 2355|   474k|        if ((elem == NULL) ||
  ------------------
  |  Branch (2355:13): [True: 0, False: 474k]
  ------------------
 2356|   474k|            (elem->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (2356:13): [True: 0, False: 474k]
  ------------------
 2357|   474k|            (elem->name == NULL))
  ------------------
  |  Branch (2357:13): [True: 0, False: 474k]
  ------------------
 2358|      0|            return(0);
 2359|       |
 2360|   474k|	fullelemname = (elem->ns != NULL && elem->ns->prefix != NULL) ?
  ------------------
  |  Branch (2360:18): [True: 121k, False: 352k]
  |  Branch (2360:38): [True: 10.8k, False: 110k]
  ------------------
 2361|  10.8k|	    xmlBuildQName(elem->name, elem->ns->prefix, felem, 50) :
 2362|   474k|	    (xmlChar *)elem->name;
 2363|   474k|        if (fullelemname == NULL)
  ------------------
  |  Branch (2363:13): [True: 7, False: 474k]
  ------------------
 2364|      7|            return(-1);
 2365|       |
 2366|   474k|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2366:19): [True: 19.9k, False: 454k]
  ------------------
 2367|       |
 2368|   474k|	if (fullelemname != NULL) {
  ------------------
  |  Branch (2368:6): [True: 474k, False: 0]
  ------------------
 2369|   474k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullelemname,
 2370|   474k|		                          attr->name, aprefix);
 2371|   474k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2371:10): [True: 208k, False: 265k]
  |  Branch (2371:32): [True: 2.14k, False: 206k]
  ------------------
 2372|  2.14k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullelemname,
 2373|  2.14k|					      attr->name, aprefix);
 2374|   474k|	}
 2375|       |
 2376|   474k|	if ((fullelemname != felem) && (fullelemname != elem->name))
  ------------------
  |  Branch (2376:6): [True: 471k, False: 2.64k]
  |  Branch (2376:33): [True: 8.22k, False: 463k]
  ------------------
 2377|  8.22k|	    xmlFree(fullelemname);
 2378|       |
 2379|   474k|        if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
  ------------------
  |  Branch (2379:13): [True: 266k, False: 207k]
  |  Branch (2379:35): [True: 9.04k, False: 257k]
  ------------------
 2380|  9.04k|	    return(1);
 2381|   474k|    }
 2382|       |
 2383|   465k|    return(0);
 2384|  1.67M|}
xmlRemoveID:
 2394|  2.89k|xmlRemoveID(xmlDoc *doc, xmlAttr *attr) {
 2395|  2.89k|    xmlIDTablePtr table;
 2396|       |
 2397|  2.89k|    if (doc == NULL) return(-1);
  ------------------
  |  Branch (2397:9): [True: 0, False: 2.89k]
  ------------------
 2398|  2.89k|    if ((attr == NULL) || (attr->id == NULL)) return(-1);
  ------------------
  |  Branch (2398:9): [True: 0, False: 2.89k]
  |  Branch (2398:27): [True: 0, False: 2.89k]
  ------------------
 2399|       |
 2400|  2.89k|    table = (xmlIDTablePtr) doc->ids;
 2401|  2.89k|    if (table == NULL)
  ------------------
  |  Branch (2401:9): [True: 0, False: 2.89k]
  ------------------
 2402|      0|        return(-1);
 2403|       |
 2404|  2.89k|    if (xmlHashRemoveEntry(table, attr->id->value, xmlFreeIDTableEntry) < 0)
  ------------------
  |  Branch (2404:9): [True: 0, False: 2.89k]
  ------------------
 2405|      0|        return(-1);
 2406|       |
 2407|  2.89k|    return(0);
 2408|  2.89k|}
xmlGetID:
 2419|  17.5k|xmlGetID(xmlDoc *doc, const xmlChar *ID) {
 2420|  17.5k|    xmlIDTablePtr table;
 2421|  17.5k|    xmlIDPtr id;
 2422|       |
 2423|  17.5k|    if (doc == NULL) {
  ------------------
  |  Branch (2423:9): [True: 0, False: 17.5k]
  ------------------
 2424|      0|	return(NULL);
 2425|      0|    }
 2426|       |
 2427|  17.5k|    if (ID == NULL) {
  ------------------
  |  Branch (2427:9): [True: 0, False: 17.5k]
  ------------------
 2428|      0|	return(NULL);
 2429|      0|    }
 2430|       |
 2431|  17.5k|    table = (xmlIDTablePtr) doc->ids;
 2432|  17.5k|    if (table == NULL)
  ------------------
  |  Branch (2432:9): [True: 9.57k, False: 7.94k]
  ------------------
 2433|  9.57k|        return(NULL);
 2434|       |
 2435|  7.94k|    id = xmlHashLookup(table, ID);
 2436|  7.94k|    if (id == NULL)
  ------------------
  |  Branch (2436:9): [True: 3.63k, False: 4.30k]
  ------------------
 2437|  3.63k|	return(NULL);
 2438|  4.30k|    if (id->attr == NULL) {
  ------------------
  |  Branch (2438:9): [True: 162, False: 4.14k]
  ------------------
 2439|       |	/*
 2440|       |	 * We are operating on a stream, return a well known reference
 2441|       |	 * since the attribute node doesn't exist anymore
 2442|       |	 */
 2443|    162|	return((xmlAttrPtr) doc);
 2444|    162|    }
 2445|  4.14k|    return(id->attr);
 2446|  4.30k|}
xmlAddRef:
 2545|  28.1k|    xmlAttr *attr) {
 2546|  28.1k|    xmlRefPtr ret = NULL;
 2547|  28.1k|    xmlRefTablePtr table;
 2548|  28.1k|    xmlListPtr ref_list;
 2549|       |
 2550|  28.1k|    if (doc == NULL) {
  ------------------
  |  Branch (2550:9): [True: 0, False: 28.1k]
  ------------------
 2551|      0|        return(NULL);
 2552|      0|    }
 2553|  28.1k|    if (value == NULL) {
  ------------------
  |  Branch (2553:9): [True: 2, False: 28.1k]
  ------------------
 2554|      2|        return(NULL);
 2555|      2|    }
 2556|  28.1k|    if (attr == NULL) {
  ------------------
  |  Branch (2556:9): [True: 0, False: 28.1k]
  ------------------
 2557|      0|        return(NULL);
 2558|      0|    }
 2559|       |
 2560|       |    /*
 2561|       |     * Create the Ref table if needed.
 2562|       |     */
 2563|  28.1k|    table = (xmlRefTablePtr) doc->refs;
 2564|  28.1k|    if (table == NULL) {
  ------------------
  |  Branch (2564:9): [True: 549, False: 27.6k]
  ------------------
 2565|    549|        doc->refs = table = xmlHashCreate(0);
 2566|    549|        if (table == NULL)
  ------------------
  |  Branch (2566:13): [True: 1, False: 548]
  ------------------
 2567|      1|            goto failed;
 2568|    549|    }
 2569|       |
 2570|  28.1k|    ret = (xmlRefPtr) xmlMalloc(sizeof(xmlRef));
 2571|  28.1k|    if (ret == NULL)
  ------------------
  |  Branch (2571:9): [True: 3, False: 28.1k]
  ------------------
 2572|      3|        goto failed;
 2573|  28.1k|    memset(ret, 0, sizeof(*ret));
 2574|       |
 2575|       |    /*
 2576|       |     * fill the structure.
 2577|       |     */
 2578|  28.1k|    ret->value = xmlStrdup(value);
 2579|  28.1k|    if (ret->value == NULL)
  ------------------
  |  Branch (2579:9): [True: 3, False: 28.1k]
  ------------------
 2580|      3|        goto failed;
 2581|  28.1k|    if (xmlIsStreaming(ctxt)) {
  ------------------
  |  Branch (2581:9): [True: 3.51k, False: 24.6k]
  ------------------
 2582|       |	/*
 2583|       |	 * Operating in streaming mode, attr is gonna disappear
 2584|       |	 */
 2585|  3.51k|	ret->name = xmlStrdup(attr->name);
 2586|  3.51k|        if (ret->name == NULL)
  ------------------
  |  Branch (2586:13): [True: 3, False: 3.51k]
  ------------------
 2587|      3|            goto failed;
 2588|  3.51k|	ret->attr = NULL;
 2589|  24.6k|    } else {
 2590|  24.6k|	ret->name = NULL;
 2591|  24.6k|	ret->attr = attr;
 2592|  24.6k|    }
 2593|  28.1k|    ret->lineno = xmlGetLineNo(attr->parent);
 2594|       |
 2595|       |    /* To add a reference :-
 2596|       |     * References are maintained as a list of references,
 2597|       |     * Lookup the entry, if no entry create new nodelist
 2598|       |     * Add the owning node to the NodeList
 2599|       |     * Return the ref
 2600|       |     */
 2601|       |
 2602|  28.1k|    ref_list = xmlHashLookup(table, value);
 2603|  28.1k|    if (ref_list == NULL) {
  ------------------
  |  Branch (2603:9): [True: 737, False: 27.4k]
  ------------------
 2604|    737|        int res;
 2605|       |
 2606|    737|        ref_list = xmlListCreate(xmlFreeRef, xmlDummyCompare);
 2607|    737|        if (ref_list == NULL)
  ------------------
  |  Branch (2607:13): [True: 2, False: 735]
  ------------------
 2608|      2|	    goto failed;
 2609|    735|        res = xmlHashAdd(table, value, ref_list);
 2610|    735|        if (res <= 0) {
  ------------------
  |  Branch (2610:13): [True: 3, False: 732]
  ------------------
 2611|      3|            xmlListDelete(ref_list);
 2612|      3|	    goto failed;
 2613|      3|        }
 2614|    735|    }
 2615|  28.1k|    if (xmlListAppend(ref_list, ret) != 0)
  ------------------
  |  Branch (2615:9): [True: 1, False: 28.1k]
  ------------------
 2616|      1|        goto failed;
 2617|  28.1k|    return(ret);
 2618|       |
 2619|     16|failed:
 2620|     16|    xmlVErrMemory(ctxt);
 2621|     16|    if (ret != NULL) {
  ------------------
  |  Branch (2621:9): [True: 12, False: 4]
  ------------------
 2622|     12|        if (ret->value != NULL)
  ------------------
  |  Branch (2622:13): [True: 9, False: 3]
  ------------------
 2623|      9|	    xmlFree((char *)ret->value);
 2624|     12|        if (ret->name != NULL)
  ------------------
  |  Branch (2624:13): [True: 6, False: 6]
  ------------------
 2625|      6|	    xmlFree((char *)ret->name);
 2626|     12|        xmlFree(ret);
 2627|     12|    }
 2628|       |    return(NULL);
 2629|  28.1k|}
xmlFreeRefTable:
 2640|    548|xmlFreeRefTable(xmlRefTable *table) {
 2641|    548|    xmlHashFree(table, xmlFreeRefTableEntry);
 2642|    548|}
xmlIsRef:
 2658|   113k|xmlIsRef(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2659|   113k|    if (attr == NULL)
  ------------------
  |  Branch (2659:9): [True: 0, False: 113k]
  ------------------
 2660|      0|        return(0);
 2661|   113k|    if (doc == NULL) {
  ------------------
  |  Branch (2661:9): [True: 0, False: 113k]
  ------------------
 2662|      0|        doc = attr->doc;
 2663|      0|	if (doc == NULL) return(0);
  ------------------
  |  Branch (2663:6): [True: 0, False: 0]
  ------------------
 2664|      0|    }
 2665|       |
 2666|   113k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
  ------------------
  |  Branch (2666:9): [True: 33.4k, False: 80.0k]
  |  Branch (2666:37): [True: 33.4k, False: 0]
  ------------------
 2667|  33.4k|        return(0);
 2668|  80.0k|    } else if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (2668:16): [True: 0, False: 80.0k]
  ------------------
 2669|       |        /* TODO @@@ */
 2670|      0|        return(0);
 2671|  80.0k|    } else {
 2672|  80.0k|        xmlAttributePtr attrDecl;
 2673|  80.0k|        const xmlChar *aprefix;
 2674|       |
 2675|  80.0k|        if (elem == NULL) return(0);
  ------------------
  |  Branch (2675:13): [True: 0, False: 80.0k]
  ------------------
 2676|  80.0k|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2676:19): [True: 13.8k, False: 66.1k]
  ------------------
 2677|  80.0k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name, attr->name,
 2678|  80.0k|                                      aprefix);
 2679|  80.0k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2679:13): [True: 31.4k, False: 48.5k]
  |  Branch (2679:35): [True: 1.38k, False: 30.1k]
  ------------------
 2680|  1.38k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name, attr->name,
 2681|  1.38k|                                          aprefix);
 2682|       |
 2683|  80.0k|	if ((attrDecl != NULL) &&
  ------------------
  |  Branch (2683:6): [True: 49.3k, False: 30.6k]
  ------------------
 2684|  49.3k|	    (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
  ------------------
  |  Branch (2684:7): [True: 361, False: 48.9k]
  ------------------
 2685|  48.9k|	     attrDecl->atype == XML_ATTRIBUTE_IDREFS))
  ------------------
  |  Branch (2685:7): [True: 22.1k, False: 26.8k]
  ------------------
 2686|  22.5k|	return(1);
 2687|  80.0k|    }
 2688|  57.5k|    return(0);
 2689|   113k|}
xmlGetDtdQElementDesc:
 2898|   606k|	              const xmlChar *prefix) {
 2899|   606k|    xmlElementTablePtr table;
 2900|       |
 2901|   606k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2901:9): [True: 149k, False: 457k]
  ------------------
 2902|   457k|    if (dtd->elements == NULL) return(NULL);
  ------------------
  |  Branch (2902:9): [True: 64.6k, False: 392k]
  ------------------
 2903|   392k|    table = (xmlElementTablePtr) dtd->elements;
 2904|       |
 2905|   392k|    return(xmlHashLookup2(table, name, prefix));
 2906|   457k|}
xmlGetDtdQAttrDesc:
 2955|   737k|	          const xmlChar *prefix) {
 2956|   737k|    xmlAttributeTablePtr table;
 2957|       |
 2958|   737k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2958:9): [True: 0, False: 737k]
  ------------------
 2959|   737k|    if (dtd->attributes == NULL) return(NULL);
  ------------------
  |  Branch (2959:9): [True: 53.3k, False: 684k]
  ------------------
 2960|   684k|    table = (xmlAttributeTablePtr) dtd->attributes;
 2961|       |
 2962|   684k|    return(xmlHashLookup3(table, name, prefix, elem));
 2963|   737k|}
xmlGetDtdNotationDesc:
 2974|  13.5k|xmlGetDtdNotationDesc(xmlDtd *dtd, const xmlChar *name) {
 2975|  13.5k|    xmlNotationTablePtr table;
 2976|       |
 2977|  13.5k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2977:9): [True: 3.25k, False: 10.3k]
  ------------------
 2978|  10.3k|    if (dtd->notations == NULL) return(NULL);
  ------------------
  |  Branch (2978:9): [True: 8.16k, False: 2.15k]
  ------------------
 2979|  2.15k|    table = (xmlNotationTablePtr) dtd->notations;
 2980|       |
 2981|  2.15k|    return(xmlHashLookup(table, name));
 2982|  10.3k|}
xmlValidateNotationUse:
 2999|    116|                       const xmlChar *notationName) {
 3000|    116|    xmlNotationPtr notaDecl;
 3001|    116|    if ((doc == NULL) || (doc->intSubset == NULL) ||
  ------------------
  |  Branch (3001:9): [True: 0, False: 116]
  |  Branch (3001:26): [True: 0, False: 116]
  ------------------
 3002|    116|        (notationName == NULL)) return(-1);
  ------------------
  |  Branch (3002:9): [True: 0, False: 116]
  ------------------
 3003|       |
 3004|    116|    notaDecl = xmlGetDtdNotationDesc(doc->intSubset, notationName);
 3005|    116|    if ((notaDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3005:9): [True: 106, False: 10]
  |  Branch (3005:31): [True: 16, False: 90]
  ------------------
 3006|     16|	notaDecl = xmlGetDtdNotationDesc(doc->extSubset, notationName);
 3007|       |
 3008|    116|    if (notaDecl == NULL) {
  ------------------
  |  Branch (3008:9): [True: 106, False: 10]
  ------------------
 3009|    106|	xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_NOTATION,
 3010|    106|	                "NOTATION %s is not declared\n",
 3011|    106|		        notationName, NULL, NULL);
 3012|    106|	return(0);
 3013|    106|    }
 3014|     10|    return(1);
 3015|    116|}
xmlValidateNotationDecl:
 3266|    336|                         xmlNotation *nota ATTRIBUTE_UNUSED) {
 3267|    336|    int ret = 1;
 3268|       |
 3269|    336|    return(ret);
 3270|    336|}
xmlValidCtxtNormalizeAttributeValue:
 3484|  6.51k|	     xmlNode *elem, const xmlChar *name, const xmlChar *value) {
 3485|  6.51k|    xmlChar *ret;
 3486|  6.51k|    xmlAttributePtr attrDecl = NULL;
 3487|  6.51k|    const xmlChar *localName;
 3488|  6.51k|    xmlChar *prefix = NULL;
 3489|  6.51k|    int extsubset = 0;
 3490|       |
 3491|  6.51k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (3491:9): [True: 0, False: 6.51k]
  ------------------
 3492|  6.51k|    if (elem == NULL) return(NULL);
  ------------------
  |  Branch (3492:9): [True: 0, False: 6.51k]
  ------------------
 3493|  6.51k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (3493:9): [True: 0, False: 6.51k]
  ------------------
 3494|  6.51k|    if (value == NULL) return(NULL);
  ------------------
  |  Branch (3494:9): [True: 0, False: 6.51k]
  ------------------
 3495|       |
 3496|  6.51k|    localName = xmlSplitQName4(name, &prefix);
 3497|  6.51k|    if (localName == NULL)
  ------------------
  |  Branch (3497:9): [True: 1, False: 6.50k]
  ------------------
 3498|      1|        goto mem_error;
 3499|       |
 3500|  6.50k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3500:9): [True: 1.88k, False: 4.62k]
  |  Branch (3500:31): [True: 1.35k, False: 531]
  ------------------
 3501|  1.35k|	xmlChar buf[50];
 3502|  1.35k|	xmlChar *elemname;
 3503|       |
 3504|  1.35k|	elemname = xmlBuildQName(elem->name, elem->ns->prefix, buf, 50);
 3505|  1.35k|	if (elemname == NULL)
  ------------------
  |  Branch (3505:6): [True: 1, False: 1.35k]
  ------------------
 3506|      1|	    goto mem_error;
 3507|  1.35k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3507:13): [True: 1.35k, False: 0]
  ------------------
 3508|  1.35k|            attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3509|  1.35k|                                      prefix, elemname);
 3510|  1.35k|	if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3510:6): [True: 1.11k, False: 240]
  |  Branch (3510:28): [True: 513, False: 599]
  ------------------
 3511|    513|	    attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3512|    513|                                      prefix, elemname);
 3513|    513|	    if (attrDecl != NULL)
  ------------------
  |  Branch (3513:10): [True: 236, False: 277]
  ------------------
 3514|    236|		extsubset = 1;
 3515|    513|	}
 3516|  1.35k|	if ((elemname != buf) && (elemname != elem->name))
  ------------------
  |  Branch (3516:6): [True: 783, False: 569]
  |  Branch (3516:27): [True: 783, False: 0]
  ------------------
 3517|    783|	    xmlFree(elemname);
 3518|  1.35k|    }
 3519|  6.50k|    if ((attrDecl == NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (3519:9): [True: 6.03k, False: 476]
  |  Branch (3519:31): [True: 6.03k, False: 0]
  ------------------
 3520|  6.03k|	attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3521|  6.03k|                                  prefix, elem->name);
 3522|  6.50k|    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3522:9): [True: 2.18k, False: 4.32k]
  |  Branch (3522:31): [True: 1.15k, False: 1.02k]
  ------------------
 3523|  1.15k|	attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3524|  1.15k|                                  prefix, elem->name);
 3525|  1.15k|	if (attrDecl != NULL)
  ------------------
  |  Branch (3525:6): [True: 758, False: 394]
  ------------------
 3526|    758|	    extsubset = 1;
 3527|  1.15k|    }
 3528|       |
 3529|  6.50k|    if (attrDecl == NULL)
  ------------------
  |  Branch (3529:9): [True: 1.42k, False: 5.08k]
  ------------------
 3530|  1.42k|	goto done;
 3531|  5.08k|    if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
  ------------------
  |  Branch (3531:9): [True: 579, False: 4.50k]
  ------------------
 3532|    579|	goto done;
 3533|       |
 3534|  4.50k|    ret = xmlStrdup(value);
 3535|  4.50k|    if (ret == NULL)
  ------------------
  |  Branch (3535:9): [True: 5, False: 4.50k]
  ------------------
 3536|      5|	goto mem_error;
 3537|  4.50k|    xmlValidNormalizeString(ret);
 3538|  4.50k|    if ((doc->standalone) && (extsubset == 1) && (!xmlStrEqual(value, ret))) {
  ------------------
  |  Branch (3538:9): [True: 4.24k, False: 258]
  |  Branch (3538:30): [True: 734, False: 3.50k]
  |  Branch (3538:50): [True: 242, False: 492]
  ------------------
 3539|    242|	xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE,
 3540|    242|"standalone: %s on %s value had to be normalized based on external subset declaration\n",
 3541|    242|	       name, elem->name, NULL);
 3542|    242|	ctxt->valid = 0;
 3543|    242|    }
 3544|       |
 3545|  4.50k|    xmlFree(prefix);
 3546|  4.50k|    return(ret);
 3547|       |
 3548|      7|mem_error:
 3549|      7|    xmlVErrMemory(ctxt);
 3550|       |
 3551|  2.00k|done:
 3552|  2.00k|    xmlFree(prefix);
 3553|       |    return(NULL);
 3554|      7|}
xmlValidateAttributeDecl:
 3641|  19.8k|                         xmlAttribute *attr) {
 3642|  19.8k|    int ret = 1;
 3643|  19.8k|    int val;
 3644|  19.8k|    CHECK_DTD;
  ------------------
  |  |  418|  19.8k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 19.8k]
  |  |  ------------------
  |  |  419|  19.8k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 19.8k]
  |  |  ------------------
  |  |  420|  19.8k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3645|  19.8k|    if(attr == NULL) return(1);
  ------------------
  |  Branch (3645:8): [True: 0, False: 19.8k]
  ------------------
 3646|       |
 3647|       |    /* Attribute Default Legal */
 3648|       |    /* Enumeration */
 3649|  19.8k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (3649:9): [True: 3.74k, False: 16.0k]
  ------------------
 3650|  3.74k|	val = xmlValidateAttributeValueInternal(doc, attr->atype,
 3651|  3.74k|	                                        attr->defaultValue);
 3652|  3.74k|	if (val == 0) {
  ------------------
  |  Branch (3652:6): [True: 0, False: 3.74k]
  ------------------
 3653|      0|	    xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
 3654|      0|	       "Syntax of default value for attribute %s of %s is not valid\n",
 3655|      0|	           attr->name, attr->elem, NULL);
 3656|      0|	}
 3657|  3.74k|        ret &= val;
 3658|  3.74k|    }
 3659|       |
 3660|       |    /* ID Attribute Default */
 3661|  19.8k|    if ((attr->atype == XML_ATTRIBUTE_ID)&&
  ------------------
  |  Branch (3661:9): [True: 4.59k, False: 15.2k]
  ------------------
 3662|  4.59k|        (attr->def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (3662:9): [True: 1.25k, False: 3.34k]
  ------------------
 3663|  1.25k|	(attr->def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (3663:2): [True: 1.21k, False: 39]
  ------------------
 3664|  1.21k|	xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
 3665|  1.21k|          "ID attribute %s of %s is not valid must be #IMPLIED or #REQUIRED\n",
 3666|  1.21k|	       attr->name, attr->elem, NULL);
 3667|  1.21k|	ret = 0;
 3668|  1.21k|    }
 3669|       |
 3670|       |    /* One ID per Element Type */
 3671|  19.8k|    if (attr->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (3671:9): [True: 4.59k, False: 15.2k]
  ------------------
 3672|  4.59k|        xmlElementPtr elem = NULL;
 3673|  4.59k|        const xmlChar *elemLocalName;
 3674|  4.59k|        xmlChar *elemPrefix;
 3675|  4.59k|        int nbId;
 3676|       |
 3677|  4.59k|        elemLocalName = xmlSplitQName4(attr->elem, &elemPrefix);
 3678|  4.59k|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (3678:13): [True: 1, False: 4.59k]
  ------------------
 3679|      1|            xmlVErrMemory(ctxt);
 3680|      1|            return(0);
 3681|      1|        }
 3682|       |
 3683|       |	/* the trick is that we parse DtD as their own internal subset */
 3684|  4.59k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3684:13): [True: 4.59k, False: 0]
  ------------------
 3685|  4.59k|            elem = xmlHashLookup2(doc->intSubset->elements,
 3686|  4.59k|                                  elemLocalName, elemPrefix);
 3687|  4.59k|	if (elem != NULL) {
  ------------------
  |  Branch (3687:6): [True: 3.36k, False: 1.23k]
  ------------------
 3688|  3.36k|	    nbId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3689|  3.36k|	} else {
 3690|  1.23k|	    xmlAttributeTablePtr table;
 3691|       |
 3692|       |	    /*
 3693|       |	     * The attribute may be declared in the internal subset and the
 3694|       |	     * element in the external subset.
 3695|       |	     */
 3696|  1.23k|	    nbId = 0;
 3697|  1.23k|	    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3697:10): [True: 1.23k, False: 0]
  ------------------
 3698|  1.23k|		table = (xmlAttributeTablePtr) doc->intSubset->attributes;
 3699|  1.23k|		xmlHashScan3(table, NULL, NULL, attr->elem,
 3700|  1.23k|			     xmlValidateAttributeIdCallback, &nbId);
 3701|  1.23k|	    }
 3702|  1.23k|	}
 3703|  4.59k|	if (nbId > 1) {
  ------------------
  |  Branch (3703:6): [True: 201, False: 4.39k]
  ------------------
 3704|       |
 3705|    201|	    xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3706|    201|       "Element %s has %d ID attribute defined in the internal subset : %s\n",
 3707|    201|		   attr->elem, nbId, attr->name);
 3708|    201|            ret = 0;
 3709|  4.39k|	} else if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3709:13): [True: 1.63k, False: 2.75k]
  ------------------
 3710|  1.63k|	    int extId = 0;
 3711|  1.63k|	    elem = xmlHashLookup2(doc->extSubset->elements,
 3712|  1.63k|                                  elemLocalName, elemPrefix);
 3713|  1.63k|	    if (elem != NULL) {
  ------------------
  |  Branch (3713:10): [True: 1.63k, False: 0]
  ------------------
 3714|  1.63k|		extId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3715|  1.63k|	    }
 3716|  1.63k|	    if (extId > 1) {
  ------------------
  |  Branch (3716:10): [True: 97, False: 1.54k]
  ------------------
 3717|     97|		xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3718|     97|       "Element %s has %d ID attribute defined in the external subset : %s\n",
 3719|     97|		       attr->elem, extId, attr->name);
 3720|     97|                ret = 0;
 3721|  1.54k|	    } else if (extId + nbId > 1) {
  ------------------
  |  Branch (3721:17): [True: 1, False: 1.53k]
  ------------------
 3722|      1|		xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3723|      1|"Element %s has ID attributes defined in the internal and external subset : %s\n",
 3724|      1|		       attr->elem, attr->name, NULL);
 3725|      1|                ret = 0;
 3726|      1|	    }
 3727|  1.63k|	}
 3728|       |
 3729|  4.59k|        xmlFree(elemPrefix);
 3730|  4.59k|    }
 3731|       |
 3732|       |    /* Validity Constraint: Enumeration */
 3733|  19.8k|    if ((attr->defaultValue != NULL) && (attr->tree != NULL)) {
  ------------------
  |  Branch (3733:9): [True: 3.74k, False: 16.0k]
  |  Branch (3733:41): [True: 1.66k, False: 2.07k]
  ------------------
 3734|  1.66k|        xmlEnumerationPtr tree = attr->tree;
 3735|  2.31k|	while (tree != NULL) {
  ------------------
  |  Branch (3735:9): [True: 1.93k, False: 381]
  ------------------
 3736|  1.93k|	    if (xmlStrEqual(tree->name, attr->defaultValue)) break;
  ------------------
  |  Branch (3736:10): [True: 1.28k, False: 656]
  ------------------
 3737|    656|	    tree = tree->next;
 3738|    656|	}
 3739|  1.66k|	if (tree == NULL) {
  ------------------
  |  Branch (3739:6): [True: 381, False: 1.28k]
  ------------------
 3740|    381|	    xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_VALUE,
 3741|    381|"Default value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 3742|    381|		   attr->defaultValue, attr->name, attr->elem);
 3743|    381|	    ret = 0;
 3744|    381|	}
 3745|  1.66k|    }
 3746|       |
 3747|  19.8k|    return(ret);
 3748|  19.8k|}
xmlValidateElementDecl:
 3769|  10.0k|                       xmlElement *elem) {
 3770|  10.0k|    int ret = 1;
 3771|  10.0k|    xmlElementPtr tst;
 3772|  10.0k|    const xmlChar *localName;
 3773|  10.0k|    xmlChar *prefix;
 3774|       |
 3775|  10.0k|    CHECK_DTD;
  ------------------
  |  |  418|  10.0k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 10.0k]
  |  |  ------------------
  |  |  419|  10.0k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 10.0k]
  |  |  ------------------
  |  |  420|  10.0k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3776|       |
 3777|  10.0k|    if (elem == NULL) return(1);
  ------------------
  |  Branch (3777:9): [True: 1.08k, False: 8.96k]
  ------------------
 3778|       |
 3779|       |    /* No Duplicate Types */
 3780|  8.96k|    if (elem->etype == XML_ELEMENT_TYPE_MIXED) {
  ------------------
  |  Branch (3780:9): [True: 3.36k, False: 5.60k]
  ------------------
 3781|  3.36k|	xmlElementContentPtr cur, next;
 3782|  3.36k|        const xmlChar *name;
 3783|       |
 3784|  3.36k|	cur = elem->content;
 3785|  19.4k|	while (cur != NULL) {
  ------------------
  |  Branch (3785:9): [True: 19.4k, False: 0]
  ------------------
 3786|  19.4k|	    if (cur->type != XML_ELEMENT_CONTENT_OR) break;
  ------------------
  |  Branch (3786:10): [True: 3.36k, False: 16.0k]
  ------------------
 3787|  16.0k|	    if (cur->c1 == NULL) break;
  ------------------
  |  Branch (3787:10): [True: 0, False: 16.0k]
  ------------------
 3788|  16.0k|	    if (cur->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3788:10): [True: 14.4k, False: 1.63k]
  ------------------
 3789|  14.4k|		name = cur->c1->name;
 3790|  14.4k|		next = cur->c2;
 3791|   280k|		while (next != NULL) {
  ------------------
  |  Branch (3791:10): [True: 280k, False: 0]
  ------------------
 3792|   280k|		    if (next->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3792:11): [True: 14.4k, False: 266k]
  ------------------
 3793|  14.4k|		        if ((xmlStrEqual(next->name, name)) &&
  ------------------
  |  Branch (3793:15): [True: 1.22k, False: 13.1k]
  ------------------
 3794|  1.22k|			    (xmlStrEqual(next->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3794:8): [True: 933, False: 290]
  ------------------
 3795|    933|			    if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3795:12): [True: 681, False: 252]
  ------------------
 3796|    681|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3797|    681|		   "Definition of %s has duplicate references of %s\n",
 3798|    681|				       elem->name, name, NULL);
 3799|    681|			    } else {
 3800|    252|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3801|    252|		   "Definition of %s has duplicate references of %s:%s\n",
 3802|    252|				       elem->name, cur->c1->prefix, name);
 3803|    252|			    }
 3804|    933|			    ret = 0;
 3805|    933|			}
 3806|  14.4k|			break;
 3807|  14.4k|		    }
 3808|   266k|		    if (next->c1 == NULL) break;
  ------------------
  |  Branch (3808:11): [True: 0, False: 266k]
  ------------------
 3809|   266k|		    if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break;
  ------------------
  |  Branch (3809:11): [True: 0, False: 266k]
  ------------------
 3810|   266k|		    if ((xmlStrEqual(next->c1->name, name)) &&
  ------------------
  |  Branch (3810:11): [True: 87.2k, False: 178k]
  ------------------
 3811|  87.2k|		        (xmlStrEqual(next->c1->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3811:11): [True: 56.9k, False: 30.2k]
  ------------------
 3812|  56.9k|			if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3812:8): [True: 29.6k, False: 27.3k]
  ------------------
 3813|  29.6k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3814|  29.6k|	       "Definition of %s has duplicate references to %s\n",
 3815|  29.6k|				   elem->name, name, NULL);
 3816|  29.6k|			} else {
 3817|  27.3k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3818|  27.3k|	       "Definition of %s has duplicate references to %s:%s\n",
 3819|  27.3k|				   elem->name, cur->c1->prefix, name);
 3820|  27.3k|			}
 3821|  56.9k|			ret = 0;
 3822|  56.9k|		    }
 3823|   266k|		    next = next->c2;
 3824|   266k|		}
 3825|  14.4k|	    }
 3826|  16.0k|	    cur = cur->c2;
 3827|  16.0k|	}
 3828|  3.36k|    }
 3829|       |
 3830|  8.96k|    localName = xmlSplitQName4(elem->name, &prefix);
 3831|  8.96k|    if (localName == NULL) {
  ------------------
  |  Branch (3831:9): [True: 1, False: 8.96k]
  ------------------
 3832|      1|        xmlVErrMemory(ctxt);
 3833|      1|        return(0);
 3834|      1|    }
 3835|       |
 3836|       |    /* VC: Unique Element Type Declaration */
 3837|  8.96k|    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3837:9): [True: 8.96k, False: 0]
  ------------------
 3838|  8.96k|        tst = xmlHashLookup2(doc->intSubset->elements, localName, prefix);
 3839|       |
 3840|  8.96k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3840:13): [True: 7.09k, False: 1.87k]
  |  Branch (3840:31): [True: 834, False: 6.26k]
  ------------------
 3841|    834|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3841:14): [True: 827, False: 7]
  ------------------
 3842|      7|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3842:14): [True: 1, False: 6]
  ------------------
 3843|    828|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3843:13): [True: 827, False: 1]
  ------------------
 3844|    827|            xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
 3845|    827|                            "Redefinition of element %s\n",
 3846|    827|                           elem->name, NULL, NULL);
 3847|    827|            ret = 0;
 3848|    827|        }
 3849|  8.96k|    }
 3850|  8.96k|    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3850:9): [True: 2.28k, False: 6.68k]
  ------------------
 3851|  2.28k|        tst = xmlHashLookup2(doc->extSubset->elements, localName, prefix);
 3852|       |
 3853|  2.28k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3853:13): [True: 2.25k, False: 32]
  |  Branch (3853:31): [True: 2, False: 2.25k]
  ------------------
 3854|      2|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3854:14): [True: 0, False: 2]
  ------------------
 3855|      2|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3855:14): [True: 1, False: 1]
  ------------------
 3856|      1|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3856:13): [True: 0, False: 1]
  ------------------
 3857|      0|            xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
 3858|      0|                            "Redefinition of element %s\n",
 3859|      0|                           elem->name, NULL, NULL);
 3860|      0|            ret = 0;
 3861|      0|        }
 3862|  2.28k|    }
 3863|       |
 3864|  8.96k|    xmlFree(prefix);
 3865|  8.96k|    return(ret);
 3866|  8.96k|}
xmlValidateOneAttribute:
 3897|   102k|{
 3898|   102k|    xmlAttributePtr attrDecl =  NULL;
 3899|   102k|    const xmlChar *aprefix;
 3900|   102k|    int val;
 3901|   102k|    int ret = 1;
 3902|       |
 3903|   102k|    CHECK_DTD;
  ------------------
  |  |  418|   102k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 102k]
  |  |  ------------------
  |  |  419|   102k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 102k]
  |  |  ------------------
  |  |  420|   102k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3904|   102k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (3904:9): [True: 0, False: 102k]
  |  Branch (3904:27): [True: 0, False: 102k]
  ------------------
 3905|   102k|    if ((attr == NULL) || (attr->name == NULL)) return(0);
  ------------------
  |  Branch (3905:9): [True: 0, False: 102k]
  |  Branch (3905:27): [True: 0, False: 102k]
  ------------------
 3906|       |
 3907|   102k|    aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (3907:15): [True: 9.32k, False: 92.7k]
  ------------------
 3908|       |
 3909|   102k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3909:9): [True: 7.43k, False: 94.6k]
  |  Branch (3909:31): [True: 2.84k, False: 4.58k]
  ------------------
 3910|  2.84k|	xmlChar fn[50];
 3911|  2.84k|	xmlChar *fullname;
 3912|       |
 3913|  2.84k|	fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
 3914|  2.84k|	if (fullname == NULL) {
  ------------------
  |  Branch (3914:6): [True: 1, False: 2.84k]
  ------------------
 3915|      1|            xmlVErrMemory(ctxt);
 3916|      1|	    return(0);
 3917|      1|        }
 3918|  2.84k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 3919|  2.84k|                                      attr->name, aprefix);
 3920|  2.84k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3920:13): [True: 2.31k, False: 526]
  |  Branch (3920:35): [True: 858, False: 1.45k]
  ------------------
 3921|    858|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 3922|    858|                                          attr->name, aprefix);
 3923|  2.84k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (3923:6): [True: 1.63k, False: 1.20k]
  |  Branch (3923:26): [True: 1.63k, False: 0]
  ------------------
 3924|  1.63k|	    xmlFree(fullname);
 3925|  2.84k|    }
 3926|   102k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3926:9): [True: 101k, False: 904]
  ------------------
 3927|   101k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 3928|   101k|                                      attr->name, aprefix);
 3929|   101k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3929:13): [True: 13.6k, False: 87.5k]
  |  Branch (3929:35): [True: 1.95k, False: 11.6k]
  ------------------
 3930|  1.95k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 3931|  1.95k|                                          attr->name, aprefix);
 3932|   101k|    }
 3933|       |
 3934|       |
 3935|       |    /* Validity Constraint: Attribute Value Type */
 3936|   102k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3936:9): [True: 12.3k, False: 89.7k]
  ------------------
 3937|  12.3k|	xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 3938|  12.3k|	       "No declaration for attribute %s of element %s\n",
 3939|  12.3k|	       attr->name, elem->name, NULL);
 3940|  12.3k|	return(0);
 3941|  12.3k|    }
 3942|  89.7k|    if (attr->id != NULL)
  ------------------
  |  Branch (3942:9): [True: 0, False: 89.7k]
  ------------------
 3943|      0|        xmlRemoveID(doc, attr);
 3944|  89.7k|    attr->atype = attrDecl->atype;
 3945|       |
 3946|  89.7k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 3947|  89.7k|    if (val == 0) {
  ------------------
  |  Branch (3947:9): [True: 8.78k, False: 80.9k]
  ------------------
 3948|  8.78k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 3949|  8.78k|	   "Syntax of value for attribute %s of %s is not valid\n",
 3950|  8.78k|	       attr->name, elem->name, NULL);
 3951|  8.78k|        ret = 0;
 3952|  8.78k|    }
 3953|       |
 3954|       |    /* Validity constraint: Fixed Attribute Default */
 3955|  89.7k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (3955:9): [True: 3.30k, False: 86.4k]
  ------------------
 3956|  3.30k|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (3956:6): [True: 928, False: 2.37k]
  ------------------
 3957|    928|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 3958|    928|	   "Value for attribute %s of %s is different from default \"%s\"\n",
 3959|    928|		   attr->name, elem->name, attrDecl->defaultValue);
 3960|    928|	    ret = 0;
 3961|    928|	}
 3962|  3.30k|    }
 3963|       |
 3964|       |    /* Validity Constraint: ID uniqueness */
 3965|  89.7k|    if (attrDecl->atype == XML_ATTRIBUTE_ID &&
  ------------------
  |  Branch (3965:9): [True: 3.97k, False: 85.7k]
  ------------------
 3966|  3.97k|        (ctxt == NULL || (ctxt->flags & XML_VCTXT_IN_ENTITY) == 0)) {
  ------------------
  |  |   28|  3.97k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
  |  Branch (3966:10): [True: 0, False: 3.97k]
  |  Branch (3966:26): [True: 3.69k, False: 281]
  ------------------
 3967|  3.69k|        if (xmlAddID(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3967:13): [True: 3.30k, False: 393]
  ------------------
 3968|  3.30k|	    ret = 0;
 3969|  3.69k|    }
 3970|       |
 3971|  89.7k|    if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
  ------------------
  |  Branch (3971:9): [True: 3.75k, False: 86.0k]
  ------------------
 3972|  86.0k|	(attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
  ------------------
  |  Branch (3972:2): [True: 1.91k, False: 84.0k]
  ------------------
 3973|  5.66k|        if (xmlAddRef(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3973:13): [True: 12, False: 5.65k]
  ------------------
 3974|     12|	    ret = 0;
 3975|  5.66k|    }
 3976|       |
 3977|       |    /* Validity Constraint: Notation Attributes */
 3978|  89.7k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (3978:9): [True: 3.01k, False: 86.7k]
  ------------------
 3979|  3.01k|        xmlEnumerationPtr tree = attrDecl->tree;
 3980|  3.01k|        xmlNotationPtr nota;
 3981|       |
 3982|       |        /* First check that the given NOTATION was declared */
 3983|  3.01k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3984|  3.01k|	if (nota == NULL)
  ------------------
  |  Branch (3984:6): [True: 2.81k, False: 199]
  ------------------
 3985|  2.81k|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3986|       |
 3987|  3.01k|	if (nota == NULL) {
  ------------------
  |  Branch (3987:6): [True: 2.75k, False: 256]
  ------------------
 3988|  2.75k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 3989|  2.75k|       "Value \"%s\" for attribute %s of %s is not a declared Notation\n",
 3990|  2.75k|		   value, attr->name, elem->name);
 3991|  2.75k|	    ret = 0;
 3992|  2.75k|        }
 3993|       |
 3994|       |	/* Second, verify that it's among the list */
 3995|  3.80k|	while (tree != NULL) {
  ------------------
  |  Branch (3995:9): [True: 3.28k, False: 526]
  ------------------
 3996|  3.28k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (3996:10): [True: 2.48k, False: 794]
  ------------------
 3997|    794|	    tree = tree->next;
 3998|    794|	}
 3999|  3.01k|	if (tree == NULL) {
  ------------------
  |  Branch (3999:6): [True: 526, False: 2.48k]
  ------------------
 4000|    526|	    xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4001|    526|"Value \"%s\" for attribute %s of %s is not among the enumerated notations\n",
 4002|    526|		   value, attr->name, elem->name);
 4003|    526|	    ret = 0;
 4004|    526|	}
 4005|  3.01k|    }
 4006|       |
 4007|       |    /* Validity Constraint: Enumeration */
 4008|  89.7k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4008:9): [True: 71.7k, False: 18.0k]
  ------------------
 4009|  71.7k|        xmlEnumerationPtr tree = attrDecl->tree;
 4010|  92.7k|	while (tree != NULL) {
  ------------------
  |  Branch (4010:9): [True: 71.8k, False: 20.8k]
  ------------------
 4011|  71.8k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4011:10): [True: 50.8k, False: 21.0k]
  ------------------
 4012|  21.0k|	    tree = tree->next;
 4013|  21.0k|	}
 4014|  71.7k|	if (tree == NULL) {
  ------------------
  |  Branch (4014:6): [True: 20.8k, False: 50.8k]
  ------------------
 4015|  20.8k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4016|  20.8k|       "Value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 4017|  20.8k|		   value, attr->name, elem->name);
 4018|  20.8k|	    ret = 0;
 4019|  20.8k|	}
 4020|  71.7k|    }
 4021|       |
 4022|       |    /* Fixed Attribute Default */
 4023|  89.7k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4023:9): [True: 3.30k, False: 86.4k]
  ------------------
 4024|  3.30k|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4024:9): [True: 928, False: 2.37k]
  ------------------
 4025|    928|	xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4026|    928|	   "Value for attribute %s of %s must be \"%s\"\n",
 4027|    928|	       attr->name, elem->name, attrDecl->defaultValue);
 4028|    928|        ret = 0;
 4029|    928|    }
 4030|       |
 4031|       |    /* Extra check for the attribute value */
 4032|  89.7k|    ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
 4033|  89.7k|				      attrDecl->atype, value);
 4034|       |
 4035|  89.7k|    return(ret);
 4036|   102k|}
xmlValidateOneNamespace:
 4067|  13.3k|xmlNode *elem, const xmlChar *prefix, xmlNs *ns, const xmlChar *value) {
 4068|       |    /* xmlElementPtr elemDecl; */
 4069|  13.3k|    xmlAttributePtr attrDecl =  NULL;
 4070|  13.3k|    int val;
 4071|  13.3k|    int ret = 1;
 4072|       |
 4073|  13.3k|    CHECK_DTD;
  ------------------
  |  |  418|  13.3k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 13.3k]
  |  |  ------------------
  |  |  419|  13.3k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 13.3k]
  |  |  ------------------
  |  |  420|  13.3k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4074|  13.3k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (4074:9): [True: 0, False: 13.3k]
  |  Branch (4074:27): [True: 0, False: 13.3k]
  ------------------
 4075|  13.3k|    if ((ns == NULL) || (ns->href == NULL)) return(0);
  ------------------
  |  Branch (4075:9): [True: 0, False: 13.3k]
  |  Branch (4075:25): [True: 0, False: 13.3k]
  ------------------
 4076|       |
 4077|  13.3k|    if (prefix != NULL) {
  ------------------
  |  Branch (4077:9): [True: 4.36k, False: 9.02k]
  ------------------
 4078|  4.36k|	xmlChar fn[50];
 4079|  4.36k|	xmlChar *fullname;
 4080|       |
 4081|  4.36k|	fullname = xmlBuildQName(elem->name, prefix, fn, 50);
 4082|  4.36k|	if (fullname == NULL) {
  ------------------
  |  Branch (4082:6): [True: 1, False: 4.36k]
  ------------------
 4083|      1|	    xmlVErrMemory(ctxt);
 4084|      1|	    return(0);
 4085|      1|	}
 4086|  4.36k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4086:6): [True: 3.32k, False: 1.03k]
  ------------------
 4087|  3.32k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4088|  3.32k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  3.32k|#define BAD_CAST (xmlChar *)
  ------------------
 4089|  3.32k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4089:10): [True: 2.01k, False: 1.30k]
  |  Branch (4089:32): [True: 759, False: 1.26k]
  ------------------
 4090|    759|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4091|    759|					  ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|    759|#define BAD_CAST (xmlChar *)
  ------------------
 4092|  3.32k|	} else {
 4093|  1.03k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4094|  1.03k|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  1.03k|#define BAD_CAST (xmlChar *)
  ------------------
 4095|  1.03k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4095:10): [True: 834, False: 201]
  |  Branch (4095:32): [True: 491, False: 343]
  ------------------
 4096|    491|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4097|    491|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|    491|#define BAD_CAST (xmlChar *)
  ------------------
 4098|  1.03k|	}
 4099|  4.36k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (4099:6): [True: 1.11k, False: 3.25k]
  |  Branch (4099:26): [True: 1.11k, False: 0]
  ------------------
 4100|  1.11k|	    xmlFree(fullname);
 4101|  4.36k|    }
 4102|  13.3k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4102:9): [True: 11.8k, False: 1.50k]
  ------------------
 4103|  11.8k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4103:6): [True: 8.06k, False: 3.81k]
  ------------------
 4104|  8.06k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4105|  8.06k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  8.06k|#define BAD_CAST (xmlChar *)
  ------------------
 4106|  8.06k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4106:10): [True: 2.56k, False: 5.49k]
  |  Branch (4106:32): [True: 1.41k, False: 1.15k]
  ------------------
 4107|  1.41k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4108|  1.41k|					      ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  1.41k|#define BAD_CAST (xmlChar *)
  ------------------
 4109|  8.06k|	} else {
 4110|  3.81k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4111|  3.81k|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  3.81k|#define BAD_CAST (xmlChar *)
  ------------------
 4112|  3.81k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4112:10): [True: 1.27k, False: 2.54k]
  |  Branch (4112:32): [True: 783, False: 488]
  ------------------
 4113|    783|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4114|    783|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|    783|#define BAD_CAST (xmlChar *)
  ------------------
 4115|  3.81k|	}
 4116|  11.8k|    }
 4117|       |
 4118|       |
 4119|       |    /* Validity Constraint: Attribute Value Type */
 4120|  13.3k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4120:9): [True: 3.17k, False: 10.2k]
  ------------------
 4121|  3.17k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4121:6): [True: 1.97k, False: 1.20k]
  ------------------
 4122|  1.97k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4123|  1.97k|		   "No declaration for attribute xmlns:%s of element %s\n",
 4124|  1.97k|		   ns->prefix, elem->name, NULL);
 4125|  1.97k|	} else {
 4126|  1.20k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4127|  1.20k|		   "No declaration for attribute xmlns of element %s\n",
 4128|  1.20k|		   elem->name, NULL, NULL);
 4129|  1.20k|	}
 4130|  3.17k|	return(0);
 4131|  3.17k|    }
 4132|       |
 4133|  10.2k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 4134|  10.2k|    if (val == 0) {
  ------------------
  |  Branch (4134:9): [True: 6.03k, False: 4.17k]
  ------------------
 4135|  6.03k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4135:6): [True: 4.81k, False: 1.22k]
  ------------------
 4136|  4.81k|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4137|  4.81k|	       "Syntax of value for attribute xmlns:%s of %s is not valid\n",
 4138|  4.81k|		   ns->prefix, elem->name, NULL);
 4139|  4.81k|	} else {
 4140|  1.22k|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4141|  1.22k|	       "Syntax of value for attribute xmlns of %s is not valid\n",
 4142|  1.22k|		   elem->name, NULL, NULL);
 4143|  1.22k|	}
 4144|  6.03k|        ret = 0;
 4145|  6.03k|    }
 4146|       |
 4147|       |    /* Validity constraint: Fixed Attribute Default */
 4148|  10.2k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (4148:9): [True: 1.03k, False: 9.18k]
  ------------------
 4149|  1.03k|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (4149:6): [True: 500, False: 531]
  ------------------
 4150|    500|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4150:10): [True: 203, False: 297]
  ------------------
 4151|    203|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4152|    203|       "Value for attribute xmlns:%s of %s is different from default \"%s\"\n",
 4153|    203|		       ns->prefix, elem->name, attrDecl->defaultValue);
 4154|    297|	    } else {
 4155|    297|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4156|    297|       "Value for attribute xmlns of %s is different from default \"%s\"\n",
 4157|    297|		       elem->name, attrDecl->defaultValue, NULL);
 4158|    297|	    }
 4159|    500|	    ret = 0;
 4160|    500|	}
 4161|  1.03k|    }
 4162|       |
 4163|       |    /* Validity Constraint: Notation Attributes */
 4164|  10.2k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (4164:9): [True: 1.35k, False: 8.85k]
  ------------------
 4165|  1.35k|        xmlEnumerationPtr tree = attrDecl->tree;
 4166|  1.35k|        xmlNotationPtr nota;
 4167|       |
 4168|       |        /* First check that the given NOTATION was declared */
 4169|  1.35k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 4170|  1.35k|	if (nota == NULL)
  ------------------
  |  Branch (4170:6): [True: 1.16k, False: 197]
  ------------------
 4171|  1.16k|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 4172|       |
 4173|  1.35k|	if (nota == NULL) {
  ------------------
  |  Branch (4173:6): [True: 1.10k, False: 254]
  ------------------
 4174|  1.10k|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4174:10): [True: 712, False: 392]
  ------------------
 4175|    712|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4176|    712|       "Value \"%s\" for attribute xmlns:%s of %s is not a declared Notation\n",
 4177|    712|		       value, ns->prefix, elem->name);
 4178|    712|	    } else {
 4179|    392|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4180|    392|       "Value \"%s\" for attribute xmlns of %s is not a declared Notation\n",
 4181|    392|		       value, elem->name, NULL);
 4182|    392|	    }
 4183|  1.10k|	    ret = 0;
 4184|  1.10k|        }
 4185|       |
 4186|       |	/* Second, verify that it's among the list */
 4187|  3.63k|	while (tree != NULL) {
  ------------------
  |  Branch (4187:9): [True: 2.76k, False: 870]
  ------------------
 4188|  2.76k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4188:10): [True: 488, False: 2.27k]
  ------------------
 4189|  2.27k|	    tree = tree->next;
 4190|  2.27k|	}
 4191|  1.35k|	if (tree == NULL) {
  ------------------
  |  Branch (4191:6): [True: 870, False: 488]
  ------------------
 4192|    870|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4192:10): [True: 478, False: 392]
  ------------------
 4193|    478|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4194|    478|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated notations\n",
 4195|    478|		       value, ns->prefix, elem->name);
 4196|    478|	    } else {
 4197|    392|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4198|    392|"Value \"%s\" for attribute xmlns of %s is not among the enumerated notations\n",
 4199|    392|		       value, elem->name, NULL);
 4200|    392|	    }
 4201|    870|	    ret = 0;
 4202|    870|	}
 4203|  1.35k|    }
 4204|       |
 4205|       |    /* Validity Constraint: Enumeration */
 4206|  10.2k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4206:9): [True: 4.66k, False: 5.54k]
  ------------------
 4207|  4.66k|        xmlEnumerationPtr tree = attrDecl->tree;
 4208|  9.48k|	while (tree != NULL) {
  ------------------
  |  Branch (4208:9): [True: 5.32k, False: 4.16k]
  ------------------
 4209|  5.32k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4209:10): [True: 499, False: 4.82k]
  ------------------
 4210|  4.82k|	    tree = tree->next;
 4211|  4.82k|	}
 4212|  4.66k|	if (tree == NULL) {
  ------------------
  |  Branch (4212:6): [True: 4.16k, False: 499]
  ------------------
 4213|  4.16k|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4213:10): [True: 3.18k, False: 982]
  ------------------
 4214|  3.18k|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4215|  3.18k|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated set\n",
 4216|  3.18k|		       value, ns->prefix, elem->name);
 4217|  3.18k|	    } else {
 4218|    982|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4219|    982|"Value \"%s\" for attribute xmlns of %s is not among the enumerated set\n",
 4220|    982|		       value, elem->name, NULL);
 4221|    982|	    }
 4222|  4.16k|	    ret = 0;
 4223|  4.16k|	}
 4224|  4.66k|    }
 4225|       |
 4226|       |    /* Fixed Attribute Default */
 4227|  10.2k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4227:9): [True: 1.03k, False: 9.18k]
  ------------------
 4228|  1.03k|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4228:9): [True: 500, False: 531]
  ------------------
 4229|    500|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4229:6): [True: 203, False: 297]
  ------------------
 4230|    203|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4231|    203|		   "Value for attribute xmlns:%s of %s must be \"%s\"\n",
 4232|    203|		   ns->prefix, elem->name, attrDecl->defaultValue);
 4233|    297|	} else {
 4234|    297|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4235|    297|		   "Value for attribute xmlns of %s must be \"%s\"\n",
 4236|    297|		   elem->name, attrDecl->defaultValue, NULL);
 4237|    297|	}
 4238|    500|        ret = 0;
 4239|    500|    }
 4240|       |
 4241|       |    /* Extra check for the attribute value */
 4242|  10.2k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4242:9): [True: 7.39k, False: 2.81k]
  ------------------
 4243|  7.39k|	ret &= xmlValidateAttributeValue2(ctxt, doc, ns->prefix,
 4244|  7.39k|					  attrDecl->atype, value);
 4245|  7.39k|    } else {
 4246|  2.81k|	ret &= xmlValidateAttributeValue2(ctxt, doc, BAD_CAST "xmlns",
  ------------------
  |  |   34|  2.81k|#define BAD_CAST (xmlChar *)
  ------------------
 4247|  2.81k|					  attrDecl->atype, value);
 4248|  2.81k|    }
 4249|       |
 4250|  10.2k|    return(ret);
 4251|  13.3k|}
xmlValidatePushElement:
 5222|   134k|                       xmlNode *elem, const xmlChar *qname) {
 5223|   134k|    int ret = 1;
 5224|   134k|    xmlElementPtr eDecl;
 5225|   134k|    int extsubset = 0;
 5226|       |
 5227|   134k|    if (ctxt == NULL)
  ------------------
  |  Branch (5227:9): [True: 0, False: 134k]
  ------------------
 5228|      0|        return(0);
 5229|       |
 5230|   134k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5230:9): [True: 131k, False: 3.22k]
  |  Branch (5230:33): [True: 131k, False: 0]
  ------------------
 5231|   131k|	xmlValidStatePtr state = ctxt->vstate;
 5232|   131k|	xmlElementPtr elemDecl;
 5233|       |
 5234|       |	/*
 5235|       |	 * Check the new element against the content model of the new elem.
 5236|       |	 */
 5237|   131k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5237:6): [True: 94.3k, False: 37.0k]
  ------------------
 5238|  94.3k|	    elemDecl = state->elemDecl;
 5239|       |
 5240|  94.3k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5240:13): [True: 94.3k, False: 0]
  ------------------
 5241|  6.48k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5241:3): [True: 6.48k, False: 87.8k]
  ------------------
 5242|  6.48k|		    ret = 0;
 5243|  6.48k|		    break;
 5244|    319|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5244:3): [True: 319, False: 93.9k]
  ------------------
 5245|    319|		    xmlErrValidNode(ctxt, state->node,
 5246|    319|				    XML_DTD_NOT_EMPTY,
 5247|    319|	       "Element %s was declared EMPTY this one has content\n",
 5248|    319|			   state->node->name, NULL, NULL);
 5249|    319|		    ret = 0;
 5250|    319|		    break;
 5251|    386|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5251:3): [True: 386, False: 93.9k]
  ------------------
 5252|       |		    /* I don't think anything is required then */
 5253|    386|		    break;
 5254|  35.0k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5254:3): [True: 35.0k, False: 59.2k]
  ------------------
 5255|       |		    /* simple case of declared as #PCDATA */
 5256|  35.0k|		    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5256:11): [True: 35.0k, False: 0]
  ------------------
 5257|  35.0k|			(elemDecl->content->type ==
  ------------------
  |  Branch (5257:4): [True: 1.28k, False: 33.7k]
  ------------------
 5258|  35.0k|			 XML_ELEMENT_CONTENT_PCDATA)) {
 5259|  1.28k|			xmlErrValidNode(ctxt, state->node,
 5260|  1.28k|					XML_DTD_NOT_PCDATA,
 5261|  1.28k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5262|  1.28k|				state->node->name, NULL, NULL);
 5263|  1.28k|			ret = 0;
 5264|  33.7k|		    } else {
 5265|  33.7k|			ret = xmlValidateCheckMixed(ctxt, elemDecl->content,
 5266|  33.7k|				                    qname);
 5267|  33.7k|			if (ret != 1) {
  ------------------
  |  Branch (5267:8): [True: 32.7k, False: 999]
  ------------------
 5268|  32.7k|			    xmlErrValidNode(ctxt, state->node,
 5269|  32.7k|					    XML_DTD_INVALID_CHILD,
 5270|  32.7k|	       "Element %s is not declared in %s list of possible children\n",
 5271|  32.7k|				    qname, state->node->name, NULL);
 5272|  32.7k|			}
 5273|  33.7k|		    }
 5274|  35.0k|		    break;
 5275|  52.0k|		case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5275:3): [True: 52.0k, False: 42.2k]
  ------------------
 5276|       |		    /*
 5277|       |		     * TODO:
 5278|       |		     * VC: Standalone Document Declaration
 5279|       |		     *     - element types with element content, if white space
 5280|       |		     *       occurs directly within any instance of those types.
 5281|       |		     */
 5282|  52.0k|		    if (state->exec != NULL) {
  ------------------
  |  Branch (5282:11): [True: 51.5k, False: 516]
  ------------------
 5283|  51.5k|			ret = xmlRegExecPushString(state->exec, qname, NULL);
 5284|  51.5k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY) {
  ------------------
  |  |   14|  51.5k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5284:29): [True: 395, False: 51.1k]
  ------------------
 5285|    395|                            xmlVErrMemory(ctxt);
 5286|    395|                            return(0);
 5287|    395|                        }
 5288|  51.1k|			if (ret < 0) {
  ------------------
  |  Branch (5288:8): [True: 10.4k, False: 40.7k]
  ------------------
 5289|  10.4k|			    xmlErrValidNode(ctxt, state->node,
 5290|  10.4k|					    XML_DTD_CONTENT_MODEL,
 5291|  10.4k|	       "Element %s content does not follow the DTD, Misplaced %s\n",
 5292|  10.4k|				   state->node->name, qname, NULL);
 5293|  10.4k|			    ret = 0;
 5294|  40.7k|			} else {
 5295|  40.7k|			    ret = 1;
 5296|  40.7k|			}
 5297|  51.1k|		    }
 5298|  51.6k|		    break;
 5299|  94.3k|	    }
 5300|  94.3k|	}
 5301|   131k|    }
 5302|   134k|    eDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5303|   134k|    vstateVPush(ctxt, eDecl, elem);
 5304|   134k|    return(ret);
 5305|   134k|}
xmlValidatePushCData:
 5318|  74.1k|xmlValidatePushCData(xmlValidCtxt *ctxt, const xmlChar *data, int len) {
 5319|  74.1k|    int ret = 1;
 5320|       |
 5321|  74.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (5321:9): [True: 0, False: 74.1k]
  ------------------
 5322|      0|        return(0);
 5323|  74.1k|    if (len <= 0)
  ------------------
  |  Branch (5323:9): [True: 235, False: 73.9k]
  ------------------
 5324|    235|	return(ret);
 5325|  73.9k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5325:9): [True: 73.5k, False: 410]
  |  Branch (5325:33): [True: 73.5k, False: 0]
  ------------------
 5326|  73.5k|	xmlValidStatePtr state = ctxt->vstate;
 5327|  73.5k|	xmlElementPtr elemDecl;
 5328|       |
 5329|       |	/*
 5330|       |	 * Check the new element against the content model of the new elem.
 5331|       |	 */
 5332|  73.5k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5332:6): [True: 38.0k, False: 35.4k]
  ------------------
 5333|  38.0k|	    elemDecl = state->elemDecl;
 5334|       |
 5335|  38.0k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5335:13): [True: 38.0k, False: 0]
  ------------------
 5336|  2.70k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5336:3): [True: 2.70k, False: 35.3k]
  ------------------
 5337|  2.70k|		    ret = 0;
 5338|  2.70k|		    break;
 5339|    567|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5339:3): [True: 567, False: 37.5k]
  ------------------
 5340|    567|		    xmlErrValidNode(ctxt, state->node,
 5341|    567|				    XML_DTD_NOT_EMPTY,
 5342|    567|	       "Element %s was declared EMPTY this one has content\n",
 5343|    567|			   state->node->name, NULL, NULL);
 5344|    567|		    ret = 0;
 5345|    567|		    break;
 5346|    474|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5346:3): [True: 474, False: 37.6k]
  ------------------
 5347|    474|		    break;
 5348|  30.4k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5348:3): [True: 30.4k, False: 7.59k]
  ------------------
 5349|  30.4k|		    break;
 5350|  3.84k|		case XML_ELEMENT_TYPE_ELEMENT: {
  ------------------
  |  Branch (5350:3): [True: 3.84k, False: 34.2k]
  ------------------
 5351|  3.84k|                    int i;
 5352|       |
 5353|  6.46k|                    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (5353:32): [True: 5.63k, False: 830]
  ------------------
 5354|  5.63k|                        if (!IS_BLANK_CH(data[i])) {
  ------------------
  |  |  137|  5.63k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  5.63k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.25k, False: 4.37k]
  |  |  |  |  ------------------
  |  |  |  |   91|  5.63k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 4.37k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 1.08k, False: 3.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|  5.63k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 283, False: 3.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5355|  3.01k|                            xmlErrValidNode(ctxt, state->node,
 5356|  3.01k|                                            XML_DTD_CONTENT_MODEL,
 5357|  3.01k|       "Element %s content does not follow the DTD, Text not allowed\n",
 5358|  3.01k|                                   state->node->name, NULL, NULL);
 5359|  3.01k|                            ret = 0;
 5360|  3.01k|                            goto done;
 5361|  3.01k|                        }
 5362|  5.63k|                    }
 5363|       |                    /*
 5364|       |                     * TODO:
 5365|       |                     * VC: Standalone Document Declaration
 5366|       |                     *  element types with element content, if white space
 5367|       |                     *  occurs directly within any instance of those types.
 5368|       |                     */
 5369|    830|                    break;
 5370|  3.84k|                }
 5371|  38.0k|	    }
 5372|  38.0k|	}
 5373|  73.5k|    }
 5374|  73.9k|done:
 5375|  73.9k|    return(ret);
 5376|  73.9k|}
xmlValidatePopElement:
 5392|   134k|		      const xmlChar *qname ATTRIBUTE_UNUSED) {
 5393|   134k|    int ret = 1;
 5394|       |
 5395|   134k|    if (ctxt == NULL)
  ------------------
  |  Branch (5395:9): [True: 0, False: 134k]
  ------------------
 5396|      0|        return(0);
 5397|       |
 5398|   134k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5398:9): [True: 134k, False: 436]
  |  Branch (5398:33): [True: 134k, False: 0]
  ------------------
 5399|   134k|	xmlValidStatePtr state = ctxt->vstate;
 5400|   134k|	xmlElementPtr elemDecl;
 5401|       |
 5402|       |	/*
 5403|       |	 * Check the new element against the content model of the new elem.
 5404|       |	 */
 5405|   134k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5405:6): [True: 48.3k, False: 85.6k]
  ------------------
 5406|  48.3k|	    elemDecl = state->elemDecl;
 5407|       |
 5408|  48.3k|	    if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
  ------------------
  |  Branch (5408:10): [True: 8.73k, False: 39.6k]
  ------------------
 5409|  8.73k|		if (state->exec != NULL) {
  ------------------
  |  Branch (5409:7): [True: 8.17k, False: 555]
  ------------------
 5410|  8.17k|		    ret = xmlRegExecPushString(state->exec, NULL, NULL);
 5411|  8.17k|		    if (ret <= 0) {
  ------------------
  |  Branch (5411:11): [True: 6.01k, False: 2.15k]
  ------------------
 5412|  6.01k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  6.01k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5412:29): [True: 24, False: 5.99k]
  ------------------
 5413|     24|                            xmlVErrMemory(ctxt);
 5414|  5.99k|                        else
 5415|  5.99k|			    xmlErrValidNode(ctxt, state->node,
 5416|  5.99k|			                    XML_DTD_CONTENT_MODEL,
 5417|  5.99k|	   "Element %s content does not follow the DTD, Expecting more children\n",
 5418|  5.99k|			       state->node->name, NULL,NULL);
 5419|  6.01k|			ret = 0;
 5420|  6.01k|		    } else {
 5421|       |			/*
 5422|       |			 * previous validation errors should not generate
 5423|       |			 * a new one here
 5424|       |			 */
 5425|  2.15k|			ret = 1;
 5426|  2.15k|		    }
 5427|  8.17k|		}
 5428|  8.73k|	    }
 5429|  48.3k|	}
 5430|   134k|	vstateVPop(ctxt);
 5431|   134k|    }
 5432|   134k|    return(ret);
 5433|   134k|}
xmlValidateOneElement:
 5458|   111k|                      xmlNode *elem) {
 5459|   111k|    xmlElementPtr elemDecl = NULL;
 5460|   111k|    xmlElementContentPtr cont;
 5461|   111k|    xmlAttributePtr attr;
 5462|   111k|    xmlNodePtr child;
 5463|   111k|    int ret = 1, tmp;
 5464|   111k|    const xmlChar *name;
 5465|   111k|    int extsubset = 0;
 5466|       |
 5467|   111k|    CHECK_DTD;
  ------------------
  |  |  418|   111k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 111k]
  |  |  ------------------
  |  |  419|   111k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 111k]
  |  |  ------------------
  |  |  420|   111k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5468|       |
 5469|   111k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (5469:9): [True: 0, False: 111k]
  ------------------
 5470|   111k|    switch (elem->type) {
 5471|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5471:9): [True: 0, False: 111k]
  ------------------
 5472|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5472:9): [True: 0, False: 111k]
  ------------------
 5473|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5473:9): [True: 0, False: 111k]
  ------------------
 5474|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5474:9): [True: 0, False: 111k]
  ------------------
 5475|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5475:9): [True: 0, False: 111k]
  ------------------
 5476|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (5476:9): [True: 0, False: 111k]
  ------------------
 5477|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (5477:9): [True: 0, False: 111k]
  ------------------
 5478|      0|	    return(1);
 5479|   111k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5479:9): [True: 111k, False: 0]
  ------------------
 5480|   111k|	    break;
 5481|      0|	default:
  ------------------
  |  Branch (5481:2): [True: 0, False: 111k]
  ------------------
 5482|      0|	    xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
 5483|      0|		   "unexpected element type\n", NULL, NULL ,NULL);
 5484|      0|	    return(0);
 5485|   111k|    }
 5486|       |
 5487|       |    /*
 5488|       |     * Fetch the declaration
 5489|       |     */
 5490|   111k|    elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5491|   111k|    if (elemDecl == NULL)
  ------------------
  |  Branch (5491:9): [True: 72.7k, False: 38.6k]
  ------------------
 5492|  72.7k|	return(0);
 5493|       |
 5494|       |    /*
 5495|       |     * If vstateNr is not zero that means continuous validation is
 5496|       |     * activated, do not try to check the content model at that level.
 5497|       |     */
 5498|  38.6k|    if (ctxt->vstateNr == 0) {
  ------------------
  |  Branch (5498:9): [True: 14.0k, False: 24.6k]
  ------------------
 5499|       |    /* Check that the element content matches the definition */
 5500|  14.0k|    switch (elemDecl->etype) {
  ------------------
  |  Branch (5500:13): [True: 14.0k, False: 0]
  ------------------
 5501|  4.54k|        case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5501:9): [True: 4.54k, False: 9.52k]
  ------------------
 5502|  4.54k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ELEM,
 5503|  4.54k|	                    "No declaration for element %s\n",
 5504|  4.54k|		   elem->name, NULL, NULL);
 5505|  4.54k|	    return(0);
 5506|  1.11k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5506:9): [True: 1.11k, False: 12.9k]
  ------------------
 5507|  1.11k|	    if (elem->children != NULL) {
  ------------------
  |  Branch (5507:10): [True: 223, False: 889]
  ------------------
 5508|    223|		xmlErrValidNode(ctxt, elem, XML_DTD_NOT_EMPTY,
 5509|    223|	       "Element %s was declared EMPTY this one has content\n",
 5510|    223|	               elem->name, NULL, NULL);
 5511|    223|		ret = 0;
 5512|    223|	    }
 5513|  1.11k|	    break;
 5514|    104|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5514:9): [True: 104, False: 13.9k]
  ------------------
 5515|       |	    /* I don't think anything is required then */
 5516|    104|	    break;
 5517|  2.73k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5517:9): [True: 2.73k, False: 11.3k]
  ------------------
 5518|       |
 5519|       |	    /* simple case of declared as #PCDATA */
 5520|  2.73k|	    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5520:10): [True: 2.73k, False: 0]
  ------------------
 5521|  2.73k|		(elemDecl->content->type == XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5521:3): [True: 2.10k, False: 630]
  ------------------
 5522|  2.10k|		ret = xmlValidateOneCdataElement(ctxt, doc, elem);
 5523|  2.10k|		if (!ret) {
  ------------------
  |  Branch (5523:7): [True: 1.14k, False: 958]
  ------------------
 5524|  1.14k|		    xmlErrValidNode(ctxt, elem, XML_DTD_NOT_PCDATA,
 5525|  1.14k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5526|  1.14k|			   elem->name, NULL, NULL);
 5527|  1.14k|		}
 5528|  2.10k|		break;
 5529|  2.10k|	    }
 5530|    630|	    child = elem->children;
 5531|       |	    /* Hum, this start to get messy */
 5532|  2.20k|	    while (child != NULL) {
  ------------------
  |  Branch (5532:13): [True: 1.57k, False: 629]
  ------------------
 5533|  1.57k|	        if (child->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5533:14): [True: 1.00k, False: 571]
  ------------------
 5534|  1.00k|		    name = child->name;
 5535|  1.00k|		    if ((child->ns != NULL) && (child->ns->prefix != NULL)) {
  ------------------
  |  Branch (5535:11): [True: 480, False: 520]
  |  Branch (5535:34): [True: 374, False: 106]
  ------------------
 5536|    374|			xmlChar fn[50];
 5537|    374|			xmlChar *fullname;
 5538|       |
 5539|    374|			fullname = xmlBuildQName(child->name, child->ns->prefix,
 5540|    374|				                 fn, 50);
 5541|    374|			if (fullname == NULL) {
  ------------------
  |  Branch (5541:8): [True: 1, False: 373]
  ------------------
 5542|      1|                            xmlVErrMemory(ctxt);
 5543|      1|			    return(0);
 5544|      1|                        }
 5545|    373|			cont = elemDecl->content;
 5546|  1.94k|			while (cont != NULL) {
  ------------------
  |  Branch (5546:11): [True: 1.69k, False: 253]
  ------------------
 5547|  1.69k|			    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5547:12): [True: 323, False: 1.37k]
  ------------------
 5548|    323|				if (xmlStrEqual(cont->name, fullname))
  ------------------
  |  Branch (5548:9): [True: 70, False: 253]
  ------------------
 5549|     70|				    break;
 5550|  1.37k|			    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5550:19): [True: 1.37k, False: 0]
  ------------------
 5551|  1.37k|			       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5551:11): [True: 1.37k, False: 0]
  ------------------
 5552|  1.37k|			       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5552:11): [True: 999, False: 373]
  ------------------
 5553|    999|				if (xmlStrEqual(cont->c1->name, fullname))
  ------------------
  |  Branch (5553:9): [True: 50, False: 949]
  ------------------
 5554|     50|				    break;
 5555|    999|			    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5555:19): [True: 0, False: 373]
  ------------------
 5556|    373|				(cont->c1 == NULL) ||
  ------------------
  |  Branch (5556:5): [True: 0, False: 373]
  ------------------
 5557|    373|				(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5557:5): [True: 0, False: 373]
  ------------------
 5558|      0|				xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5559|      0|					"Internal: MIXED struct corrupted\n",
 5560|      0|					NULL);
 5561|      0|				break;
 5562|      0|			    }
 5563|  1.57k|			    cont = cont->c2;
 5564|  1.57k|			}
 5565|    373|			if ((fullname != fn) && (fullname != child->name))
  ------------------
  |  Branch (5565:8): [True: 40, False: 333]
  |  Branch (5565:28): [True: 40, False: 0]
  ------------------
 5566|     40|			    xmlFree(fullname);
 5567|    373|			if (cont != NULL)
  ------------------
  |  Branch (5567:8): [True: 120, False: 253]
  ------------------
 5568|    120|			    goto child_ok;
 5569|    373|		    }
 5570|    879|		    cont = elemDecl->content;
 5571|  4.49k|		    while (cont != NULL) {
  ------------------
  |  Branch (5571:14): [True: 3.91k, False: 577]
  ------------------
 5572|  3.91k|		        if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5572:15): [True: 808, False: 3.10k]
  ------------------
 5573|    808|			    if (xmlStrEqual(cont->name, name)) break;
  ------------------
  |  Branch (5573:12): [True: 231, False: 577]
  ------------------
 5574|  3.10k|			} else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5574:15): [True: 3.10k, False: 0]
  ------------------
 5575|  3.10k|			   (cont->c1 != NULL) &&
  ------------------
  |  Branch (5575:7): [True: 3.10k, False: 0]
  ------------------
 5576|  3.10k|			   (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) {
  ------------------
  |  Branch (5576:7): [True: 2.23k, False: 879]
  ------------------
 5577|  2.23k|			    if (xmlStrEqual(cont->c1->name, name)) break;
  ------------------
  |  Branch (5577:12): [True: 71, False: 2.15k]
  ------------------
 5578|  2.23k|			} else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5578:15): [True: 0, False: 879]
  ------------------
 5579|    879|			    (cont->c1 == NULL) ||
  ------------------
  |  Branch (5579:8): [True: 0, False: 879]
  ------------------
 5580|    879|			    (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5580:8): [True: 0, False: 879]
  ------------------
 5581|      0|			    xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5582|      0|				    "Internal: MIXED struct corrupted\n",
 5583|      0|				    NULL);
 5584|      0|			    break;
 5585|      0|			}
 5586|  3.61k|			cont = cont->c2;
 5587|  3.61k|		    }
 5588|    879|		    if (cont == NULL) {
  ------------------
  |  Branch (5588:11): [True: 577, False: 302]
  ------------------
 5589|    577|			xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_CHILD,
 5590|    577|	       "Element %s is not declared in %s list of possible children\n",
 5591|    577|			       name, elem->name, NULL);
 5592|    577|			ret = 0;
 5593|    577|		    }
 5594|    879|		}
 5595|  1.57k|child_ok:
 5596|  1.57k|	        child = child->next;
 5597|  1.57k|	    }
 5598|    629|	    break;
 5599|  5.57k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5599:9): [True: 5.57k, False: 8.49k]
  ------------------
 5600|  5.57k|	    if ((doc->standalone == 1) && (extsubset == 1)) {
  ------------------
  |  Branch (5600:10): [True: 357, False: 5.21k]
  |  Branch (5600:36): [True: 288, False: 69]
  ------------------
 5601|       |		/*
 5602|       |		 * VC: Standalone Document Declaration
 5603|       |		 *     - element types with element content, if white space
 5604|       |		 *       occurs directly within any instance of those types.
 5605|       |		 */
 5606|    288|		child = elem->children;
 5607|    668|		while (child != NULL) {
  ------------------
  |  Branch (5607:10): [True: 420, False: 248]
  ------------------
 5608|    420|		    if ((child->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (5608:11): [True: 202, False: 218]
  ------------------
 5609|    202|                        (child->content != NULL)) {
  ------------------
  |  Branch (5609:25): [True: 202, False: 0]
  ------------------
 5610|    202|			const xmlChar *content = child->content;
 5611|       |
 5612|    202|			while (IS_BLANK_CH(*content))
 5613|    850|			    content++;
 5614|    202|			if (*content == 0) {
  ------------------
  |  Branch (5614:8): [True: 40, False: 162]
  ------------------
 5615|     40|			    xmlErrValidNode(ctxt, elem,
 5616|     40|			                    XML_DTD_STANDALONE_WHITE_SPACE,
 5617|     40|"standalone: %s declared in the external subset contains white spaces nodes\n",
 5618|     40|				   elem->name, NULL, NULL);
 5619|     40|			    ret = 0;
 5620|     40|			    break;
 5621|     40|			}
 5622|    202|		    }
 5623|    380|		    child =child->next;
 5624|    380|		}
 5625|    288|	    }
 5626|  5.57k|	    child = elem->children;
 5627|  5.57k|	    cont = elemDecl->content;
 5628|  5.57k|	    tmp = xmlValidateElementContent(ctxt, child, elemDecl, 1, elem);
 5629|  5.57k|	    if (tmp <= 0)
  ------------------
  |  Branch (5629:10): [True: 4.62k, False: 956]
  ------------------
 5630|  4.62k|		ret = 0;
 5631|  5.57k|	    break;
 5632|  14.0k|    }
 5633|  14.0k|    } /* not continuous */
 5634|       |
 5635|       |    /* [ VC: Required Attribute ] */
 5636|  34.1k|    attr = elemDecl->attributes;
 5637|   128k|    while (attr != NULL) {
  ------------------
  |  Branch (5637:12): [True: 94.4k, False: 34.1k]
  ------------------
 5638|  94.4k|	if (attr->def == XML_ATTRIBUTE_REQUIRED) {
  ------------------
  |  Branch (5638:6): [True: 3.43k, False: 91.0k]
  ------------------
 5639|  3.43k|	    int qualified = -1;
 5640|       |
 5641|  3.43k|	    if ((attr->prefix == NULL) &&
  ------------------
  |  Branch (5641:10): [True: 1.48k, False: 1.95k]
  ------------------
 5642|  1.48k|		(xmlStrEqual(attr->name, BAD_CAST "xmlns"))) {
  ------------------
  |  |   34|  1.48k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5642:3): [True: 362, False: 1.12k]
  ------------------
 5643|    362|		xmlNsPtr ns;
 5644|       |
 5645|    362|		ns = elem->nsDef;
 5646|    598|		while (ns != NULL) {
  ------------------
  |  Branch (5646:10): [True: 303, False: 295]
  ------------------
 5647|    303|		    if (ns->prefix == NULL)
  ------------------
  |  Branch (5647:11): [True: 67, False: 236]
  ------------------
 5648|     67|			goto found;
 5649|    236|		    ns = ns->next;
 5650|    236|		}
 5651|  3.07k|	    } else if (xmlStrEqual(attr->prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.07k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5651:17): [True: 1.29k, False: 1.78k]
  ------------------
 5652|  1.29k|		xmlNsPtr ns;
 5653|       |
 5654|  1.29k|		ns = elem->nsDef;
 5655|  1.36k|		while (ns != NULL) {
  ------------------
  |  Branch (5655:10): [True: 76, False: 1.29k]
  ------------------
 5656|     76|		    if (xmlStrEqual(attr->name, ns->prefix))
  ------------------
  |  Branch (5656:11): [True: 1, False: 75]
  ------------------
 5657|      1|			goto found;
 5658|     75|		    ns = ns->next;
 5659|     75|		}
 5660|  1.78k|	    } else {
 5661|  1.78k|		xmlAttrPtr attrib;
 5662|       |
 5663|  1.78k|		attrib = elem->properties;
 5664|  3.26k|		while (attrib != NULL) {
  ------------------
  |  Branch (5664:10): [True: 1.78k, False: 1.48k]
  ------------------
 5665|  1.78k|		    if (xmlStrEqual(attrib->name, attr->name)) {
  ------------------
  |  Branch (5665:11): [True: 790, False: 997]
  ------------------
 5666|    790|			if (attr->prefix != NULL) {
  ------------------
  |  Branch (5666:8): [True: 589, False: 201]
  ------------------
 5667|    589|			    xmlNsPtr nameSpace = attrib->ns;
 5668|       |
 5669|       |			    /*
 5670|       |			     * qualified names handling is problematic, having a
 5671|       |			     * different prefix should be possible but DTDs don't
 5672|       |			     * allow to define the URI instead of the prefix :-(
 5673|       |			     */
 5674|    589|			    if (nameSpace == NULL) {
  ------------------
  |  Branch (5674:12): [True: 230, False: 359]
  ------------------
 5675|    230|				if (qualified < 0)
  ------------------
  |  Branch (5675:9): [True: 220, False: 10]
  ------------------
 5676|    220|				    qualified = 0;
 5677|    359|			    } else if (!xmlStrEqual(nameSpace->prefix,
  ------------------
  |  Branch (5677:19): [True: 258, False: 101]
  ------------------
 5678|    359|						    attr->prefix)) {
 5679|    258|				if (qualified < 1)
  ------------------
  |  Branch (5679:9): [True: 258, False: 0]
  ------------------
 5680|    258|				    qualified = 1;
 5681|    258|			    } else
 5682|    101|				goto found;
 5683|    589|			} else {
 5684|       |			    /*
 5685|       |			     * We should allow applications to define namespaces
 5686|       |			     * for their application even if the DTD doesn't
 5687|       |			     * carry one, otherwise, basically we would always
 5688|       |			     * break.
 5689|       |			     */
 5690|    201|			    goto found;
 5691|    201|			}
 5692|    790|		    }
 5693|  1.48k|		    attrib = attrib->next;
 5694|  1.48k|		}
 5695|  1.78k|	    }
 5696|  3.06k|	    if (qualified == -1) {
  ------------------
  |  Branch (5696:10): [True: 2.58k, False: 478]
  ------------------
 5697|  2.58k|		if (attr->prefix == NULL) {
  ------------------
  |  Branch (5697:7): [True: 1.21k, False: 1.37k]
  ------------------
 5698|  1.21k|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5699|  1.21k|		       "Element %s does not carry attribute %s\n",
 5700|  1.21k|			   elem->name, attr->name, NULL);
 5701|  1.21k|		    ret = 0;
 5702|  1.37k|	        } else {
 5703|  1.37k|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5704|  1.37k|		       "Element %s does not carry attribute %s:%s\n",
 5705|  1.37k|			   elem->name, attr->prefix,attr->name);
 5706|  1.37k|		    ret = 0;
 5707|  1.37k|		}
 5708|  2.58k|	    } else if (qualified == 0) {
  ------------------
  |  Branch (5708:17): [True: 220, False: 258]
  ------------------
 5709|    220|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_NO_PREFIX,
  ------------------
  |  Branch (5709:7): [True: 12, False: 208]
  ------------------
 5710|    220|		                       "Element %s required attribute %s:%s "
 5711|    220|                                       "has no prefix\n",
 5712|    220|		                       elem->name, attr->prefix,
 5713|    220|                                       attr->name) < 0)
 5714|     12|                    ret = 0;
 5715|    258|	    } else if (qualified == 1) {
  ------------------
  |  Branch (5715:17): [True: 258, False: 0]
  ------------------
 5716|    258|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_DIFFERENT_PREFIX,
  ------------------
  |  Branch (5716:7): [True: 10, False: 248]
  ------------------
 5717|    258|		                       "Element %s required attribute %s:%s "
 5718|    258|                                       "has different prefix\n",
 5719|    258|		                       elem->name, attr->prefix,
 5720|    258|                                       attr->name) < 0)
 5721|     10|                    ret = 0;
 5722|    258|	    }
 5723|  3.06k|	}
 5724|  94.4k|found:
 5725|  94.4k|        attr = attr->nexth;
 5726|  94.4k|    }
 5727|  34.1k|    return(ret);
 5728|  34.1k|}
xmlValidateRoot:
 5747|  7.17k|xmlValidateRoot(xmlValidCtxt *ctxt, xmlDoc *doc) {
 5748|  7.17k|    xmlNodePtr root;
 5749|  7.17k|    int ret;
 5750|       |
 5751|  7.17k|    if (doc == NULL) return(0);
  ------------------
  |  Branch (5751:9): [True: 0, False: 7.17k]
  ------------------
 5752|       |
 5753|  7.17k|    root = xmlDocGetRootElement(doc);
 5754|  7.17k|    if ((root == NULL) || (root->name == NULL)) {
  ------------------
  |  Branch (5754:9): [True: 0, False: 7.17k]
  |  Branch (5754:27): [True: 0, False: 7.17k]
  ------------------
 5755|      0|	xmlErrValid(ctxt, XML_DTD_NO_ROOT,
 5756|      0|	            "no root element\n", NULL);
 5757|      0|        return(0);
 5758|      0|    }
 5759|       |
 5760|       |    /*
 5761|       |     * When doing post validation against a separate DTD, those may
 5762|       |     * no internal subset has been generated
 5763|       |     */
 5764|  7.17k|    if ((doc->intSubset != NULL) &&
  ------------------
  |  Branch (5764:9): [True: 7.17k, False: 0]
  ------------------
 5765|  7.17k|	(doc->intSubset->name != NULL)) {
  ------------------
  |  Branch (5765:2): [True: 6.87k, False: 300]
  ------------------
 5766|       |	/*
 5767|       |	 * Check first the document root against the NQName
 5768|       |	 */
 5769|  6.87k|	if (!xmlStrEqual(doc->intSubset->name, root->name)) {
  ------------------
  |  Branch (5769:6): [True: 4.89k, False: 1.98k]
  ------------------
 5770|  4.89k|	    if ((root->ns != NULL) && (root->ns->prefix != NULL)) {
  ------------------
  |  Branch (5770:10): [True: 264, False: 4.62k]
  |  Branch (5770:32): [True: 78, False: 186]
  ------------------
 5771|     78|		xmlChar fn[50];
 5772|     78|		xmlChar *fullname;
 5773|       |
 5774|     78|		fullname = xmlBuildQName(root->name, root->ns->prefix, fn, 50);
 5775|     78|		if (fullname == NULL) {
  ------------------
  |  Branch (5775:7): [True: 1, False: 77]
  ------------------
 5776|      1|		    xmlVErrMemory(ctxt);
 5777|      1|		    return(0);
 5778|      1|		}
 5779|     77|		ret = xmlStrEqual(doc->intSubset->name, fullname);
 5780|     77|		if ((fullname != fn) && (fullname != root->name))
  ------------------
  |  Branch (5780:7): [True: 51, False: 26]
  |  Branch (5780:27): [True: 51, False: 0]
  ------------------
 5781|     51|		    xmlFree(fullname);
 5782|     77|		if (ret == 1)
  ------------------
  |  Branch (5782:7): [True: 20, False: 57]
  ------------------
 5783|     20|		    goto name_ok;
 5784|     77|	    }
 5785|  4.87k|	    if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) &&
  ------------------
  |  |   34|  4.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5785:10): [True: 8, False: 4.86k]
  ------------------
 5786|      8|		(xmlStrEqual(root->name, BAD_CAST "html")))
  ------------------
  |  |   34|      8|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5786:3): [True: 3, False: 5]
  ------------------
 5787|      3|		goto name_ok;
 5788|  4.86k|	    xmlErrValidNode(ctxt, root, XML_DTD_ROOT_NAME,
 5789|  4.86k|		   "root and DTD name do not match '%s' and '%s'\n",
 5790|  4.86k|		   root->name, doc->intSubset->name, NULL);
 5791|  4.86k|	    return(0);
 5792|  4.87k|	}
 5793|  6.87k|    }
 5794|  2.30k|name_ok:
 5795|  2.30k|    return(1);
 5796|  7.17k|}
xmlValidateDocumentFinal:
 6004|    666|xmlValidateDocumentFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6005|    666|    xmlRefTablePtr table;
 6006|    666|    xmlParserCtxtPtr pctxt = NULL;
 6007|    666|    xmlParserInputPtr oldInput = NULL;
 6008|       |
 6009|    666|    if (ctxt == NULL)
  ------------------
  |  Branch (6009:9): [True: 0, False: 666]
  ------------------
 6010|      0|        return(0);
 6011|    666|    if (doc == NULL) {
  ------------------
  |  Branch (6011:9): [True: 0, False: 666]
  ------------------
 6012|      0|        xmlErrValid(ctxt, XML_DTD_NO_DOC,
 6013|      0|		"xmlValidateDocumentFinal: doc == NULL\n", NULL);
 6014|      0|	return(0);
 6015|      0|    }
 6016|       |
 6017|       |    /*
 6018|       |     * Check all the NOTATION/NOTATIONS attributes
 6019|       |     */
 6020|       |    /*
 6021|       |     * Check all the ENTITY/ENTITIES attributes definition for validity
 6022|       |     */
 6023|       |    /*
 6024|       |     * Check all the IDREF/IDREFS attributes definition for validity
 6025|       |     */
 6026|       |
 6027|       |    /*
 6028|       |     * Don't print line numbers.
 6029|       |     */
 6030|    666|    if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|    666|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6030:9): [True: 666, False: 0]
  ------------------
 6031|    666|        pctxt = ctxt->userData;
 6032|    666|        oldInput = pctxt->input;
 6033|    666|        pctxt->input = NULL;
 6034|    666|    }
 6035|       |
 6036|    666|    table = (xmlRefTablePtr) doc->refs;
 6037|    666|    ctxt->doc = doc;
 6038|    666|    ctxt->valid = 1;
 6039|    666|    xmlHashScan(table, xmlValidateCheckRefCallback, ctxt);
 6040|       |
 6041|    666|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|    666|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6041:9): [True: 666, False: 0]
  ------------------
 6042|    666|        pctxt->input = oldInput;
 6043|       |
 6044|    666|    return(ctxt->valid);
 6045|    666|}
xmlValidateDtdFinal:
 6223|  7.17k|xmlValidateDtdFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6224|  7.17k|    xmlDtdPtr dtd;
 6225|  7.17k|    xmlAttributeTablePtr table;
 6226|  7.17k|    xmlEntitiesTablePtr entities;
 6227|       |
 6228|  7.17k|    if ((doc == NULL) || (ctxt == NULL)) return(0);
  ------------------
  |  Branch (6228:9): [True: 0, False: 7.17k]
  |  Branch (6228:26): [True: 0, False: 7.17k]
  ------------------
 6229|  7.17k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL))
  ------------------
  |  Branch (6229:9): [True: 0, False: 7.17k]
  |  Branch (6229:37): [True: 0, False: 0]
  ------------------
 6230|      0|	return(0);
 6231|  7.17k|    ctxt->doc = doc;
 6232|  7.17k|    ctxt->valid = 1;
 6233|  7.17k|    dtd = doc->intSubset;
 6234|  7.17k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6234:9): [True: 7.17k, False: 0]
  |  Branch (6234:26): [True: 2.94k, False: 4.22k]
  ------------------
 6235|  2.94k|	table = (xmlAttributeTablePtr) dtd->attributes;
 6236|  2.94k|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6237|  2.94k|    }
 6238|  7.17k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6238:9): [True: 7.17k, False: 0]
  |  Branch (6238:26): [True: 2.57k, False: 4.60k]
  ------------------
 6239|  2.57k|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6240|  2.57k|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6241|  2.57k|    }
 6242|  7.17k|    dtd = doc->extSubset;
 6243|  7.17k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6243:9): [True: 792, False: 6.38k]
  |  Branch (6243:26): [True: 349, False: 443]
  ------------------
 6244|    349|	table = (xmlAttributeTablePtr) dtd->attributes;
 6245|    349|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6246|    349|    }
 6247|  7.17k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6247:9): [True: 792, False: 6.38k]
  |  Branch (6247:26): [True: 69, False: 723]
  ------------------
 6248|     69|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6249|     69|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6250|     69|    }
 6251|  7.17k|    return(ctxt->valid);
 6252|  7.17k|}
valid.c:xmlVErrMemory:
   54|  1.31k|{
   55|  1.31k|    if (ctxt != NULL) {
  ------------------
  |  Branch (55:9): [True: 1.31k, False: 0]
  ------------------
   56|  1.31k|        if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|  1.31k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (56:13): [True: 1.31k, False: 0]
  ------------------
   57|  1.31k|            xmlCtxtErrMemory(ctxt->userData);
   58|  1.31k|        } else {
   59|      0|            xmlRaiseMemoryError(NULL, ctxt->error, ctxt->userData,
   60|      0|                                XML_FROM_VALID, NULL);
   61|      0|        }
   62|  1.31k|    } else {
   63|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_VALID, NULL);
   64|      0|    }
   65|  1.31k|}
valid.c:xmlValidBuildAContentModel:
  441|   576k|		           const xmlChar *name) {
  442|   576k|    if (content == NULL) {
  ------------------
  |  Branch (442:9): [True: 0, False: 576k]
  ------------------
  443|      0|	xmlErrValidNode(ctxt, NULL, XML_ERR_INTERNAL_ERROR,
  444|      0|			"Found NULL content in content model of %s\n",
  445|      0|			name, NULL, NULL);
  446|      0|	return(0);
  447|      0|    }
  448|   576k|    switch (content->type) {
  449|      0|	case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (449:2): [True: 0, False: 576k]
  ------------------
  450|      0|	    xmlErrValidNode(ctxt, NULL, XML_ERR_INTERNAL_ERROR,
  451|      0|			    "Found PCDATA in content model of %s\n",
  452|      0|		            name, NULL, NULL);
  453|      0|	    return(0);
  454|      0|	    break;
  455|   472k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (455:2): [True: 472k, False: 103k]
  ------------------
  456|   472k|	    xmlAutomataStatePtr oldstate = ctxt->state;
  457|   472k|	    xmlChar fn[50];
  458|   472k|	    xmlChar *fullname;
  459|       |
  460|   472k|	    fullname = xmlBuildQName(content->name, content->prefix, fn, 50);
  461|   472k|	    if (fullname == NULL) {
  ------------------
  |  Branch (461:10): [True: 14, False: 472k]
  ------------------
  462|     14|	        xmlVErrMemory(ctxt);
  463|     14|		return(0);
  464|     14|	    }
  465|       |
  466|   472k|	    switch (content->ocur) {
  ------------------
  |  Branch (466:14): [True: 472k, False: 0]
  ------------------
  467|   364k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (467:3): [True: 364k, False: 108k]
  ------------------
  468|   364k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  469|   364k|			    ctxt->state, NULL, fullname, NULL);
  470|   364k|		    break;
  471|  44.0k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (471:3): [True: 44.0k, False: 428k]
  ------------------
  472|  44.0k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  473|  44.0k|			    ctxt->state, NULL, fullname, NULL);
  474|  44.0k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  475|  44.0k|		    break;
  476|  35.9k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (476:3): [True: 35.9k, False: 436k]
  ------------------
  477|  35.9k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  478|  35.9k|			    ctxt->state, NULL, fullname, NULL);
  479|  35.9k|		    xmlAutomataNewTransition(ctxt->am, ctxt->state,
  480|  35.9k|			                     ctxt->state, fullname, NULL);
  481|  35.9k|		    break;
  482|  28.4k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (482:3): [True: 28.4k, False: 444k]
  ------------------
  483|  28.4k|		    ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  484|  28.4k|					    ctxt->state, NULL);
  485|  28.4k|		    xmlAutomataNewTransition(ctxt->am,
  486|  28.4k|			    ctxt->state, ctxt->state, fullname, NULL);
  487|  28.4k|		    break;
  488|   472k|	    }
  489|   472k|	    if ((fullname != fn) && (fullname != content->name))
  ------------------
  |  Branch (489:10): [True: 469k, False: 2.82k]
  |  Branch (489:30): [True: 2.86k, False: 466k]
  ------------------
  490|  2.86k|		xmlFree(fullname);
  491|   472k|	    break;
  492|   472k|	}
  493|  22.5k|	case XML_ELEMENT_CONTENT_SEQ: {
  ------------------
  |  Branch (493:2): [True: 22.5k, False: 554k]
  ------------------
  494|  22.5k|	    xmlAutomataStatePtr oldstate, oldend;
  495|  22.5k|	    xmlElementContentOccur ocur;
  496|       |
  497|       |	    /*
  498|       |	     * Simply iterate over the content
  499|       |	     */
  500|  22.5k|	    oldstate = ctxt->state;
  501|  22.5k|	    ocur = content->ocur;
  502|  22.5k|	    if (ocur != XML_ELEMENT_CONTENT_ONCE) {
  ------------------
  |  Branch (502:10): [True: 20.7k, False: 1.82k]
  ------------------
  503|  20.7k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldstate, NULL);
  504|  20.7k|		oldstate = ctxt->state;
  505|  20.7k|	    }
  506|   308k|	    do {
  507|   308k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (507:7): [True: 18, False: 308k]
  ------------------
  508|     18|                    return(0);
  509|   308k|		content = content->c2;
  510|   308k|	    } while ((content->type == XML_ELEMENT_CONTENT_SEQ) &&
  ------------------
  |  Branch (510:15): [True: 285k, False: 22.4k]
  ------------------
  511|   285k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (511:8): [True: 285k, False: 35]
  ------------------
  512|  22.5k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (512:10): [True: 3, False: 22.5k]
  ------------------
  513|      3|                return(0);
  514|  22.5k|	    oldend = ctxt->state;
  515|  22.5k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  516|  22.5k|	    switch (ocur) {
  ------------------
  |  Branch (516:14): [True: 22.5k, False: 0]
  ------------------
  517|  1.81k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (517:3): [True: 1.81k, False: 20.6k]
  ------------------
  518|  1.81k|		    break;
  519|  18.8k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (519:3): [True: 18.8k, False: 3.67k]
  ------------------
  520|  18.8k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  521|  18.8k|		    break;
  522|  1.51k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (522:3): [True: 1.51k, False: 20.9k]
  ------------------
  523|  1.51k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  524|  1.51k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  525|  1.51k|		    break;
  526|    342|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (526:3): [True: 342, False: 22.1k]
  ------------------
  527|    342|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  528|    342|		    break;
  529|  22.5k|	    }
  530|  22.5k|	    break;
  531|  22.5k|	}
  532|  81.4k|	case XML_ELEMENT_CONTENT_OR: {
  ------------------
  |  Branch (532:2): [True: 81.4k, False: 495k]
  ------------------
  533|  81.4k|	    xmlAutomataStatePtr oldstate, oldend;
  534|  81.4k|	    xmlElementContentOccur ocur;
  535|       |
  536|  81.4k|	    ocur = content->ocur;
  537|  81.4k|	    if ((ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (537:10): [True: 15.1k, False: 66.3k]
  ------------------
  538|  66.3k|		(ocur == XML_ELEMENT_CONTENT_MULT)) {
  ------------------
  |  Branch (538:3): [True: 45.0k, False: 21.2k]
  ------------------
  539|  60.2k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  540|  60.2k|			ctxt->state, NULL);
  541|  60.2k|	    }
  542|  81.4k|	    oldstate = ctxt->state;
  543|  81.4k|	    oldend = xmlAutomataNewState(ctxt->am);
  544|       |
  545|       |	    /*
  546|       |	     * iterate over the subtypes and remerge the end with an
  547|       |	     * epsilon transition
  548|       |	     */
  549|   162k|	    do {
  550|   162k|		ctxt->state = oldstate;
  551|   162k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (551:7): [True: 13, False: 162k]
  ------------------
  552|     13|                    return(0);
  553|   162k|		xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  554|   162k|		content = content->c2;
  555|   162k|	    } while ((content->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (555:15): [True: 81.0k, False: 81.4k]
  ------------------
  556|  81.0k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (556:8): [True: 81.0k, False: 12]
  ------------------
  557|  81.4k|	    ctxt->state = oldstate;
  558|  81.4k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (558:10): [True: 2, False: 81.4k]
  ------------------
  559|      2|                return(0);
  560|  81.4k|	    xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  561|  81.4k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  562|  81.4k|	    switch (ocur) {
  ------------------
  |  Branch (562:14): [True: 81.4k, False: 0]
  ------------------
  563|  17.9k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (563:3): [True: 17.9k, False: 63.4k]
  ------------------
  564|  17.9k|		    break;
  565|  3.27k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (565:3): [True: 3.27k, False: 78.1k]
  ------------------
  566|  3.27k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  567|  3.27k|		    break;
  568|  45.0k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (568:3): [True: 45.0k, False: 36.3k]
  ------------------
  569|  45.0k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  570|  45.0k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  571|  45.0k|		    break;
  572|  15.1k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (572:3): [True: 15.1k, False: 66.3k]
  ------------------
  573|  15.1k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  574|  15.1k|		    break;
  575|  81.4k|	    }
  576|  81.4k|	    break;
  577|  81.4k|	}
  578|  81.4k|	default:
  ------------------
  |  Branch (578:2): [True: 0, False: 576k]
  ------------------
  579|      0|	    xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR,
  580|      0|	                "ContentModel broken for element %s\n",
  581|      0|			(const char *) name);
  582|      0|	    return(0);
  583|   576k|    }
  584|   576k|    return(1);
  585|   576k|}
valid.c:xmlErrValidNode:
  131|   399k|{
  132|   399k|    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str2, str3, 0,
  133|   399k|                  msg, str1, str2, str3);
  134|   399k|}
valid.c:xmlDoErrValid:
   75|   439k|              const char *msg, ...) {
   76|   439k|    xmlParserCtxtPtr pctxt = NULL;
   77|   439k|    va_list ap;
   78|   439k|    int ret = 0;
   79|       |
   80|   439k|    if (ctxt == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 439k]
  ------------------
   81|      0|        return -1;
   82|   439k|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|   439k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (82:9): [True: 439k, False: 0]
  ------------------
   83|   439k|        pctxt = ctxt->userData;
   84|       |
   85|   439k|    va_start(ap, msg);
   86|   439k|    if (pctxt != NULL) {
  ------------------
  |  Branch (86:9): [True: 439k, False: 0]
  ------------------
   87|   439k|        xmlCtxtVErr(pctxt, node, XML_FROM_VALID, code, level,
   88|   439k|                    str1, str2, str3, int1, msg, ap);
   89|   439k|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (89:13): [True: 27.7k, False: 412k]
  ------------------
   90|  27.7k|            ret = -1;
   91|   439k|    } else {
   92|      0|        xmlGenericErrorFunc channel = NULL;
   93|      0|        void *data = NULL;
   94|      0|        int res;
   95|       |
   96|      0|        if (ctxt != NULL) {
  ------------------
  |  Branch (96:13): [True: 0, False: 0]
  ------------------
   97|      0|            channel = ctxt->error;
   98|      0|            data = ctxt->userData;
   99|      0|        }
  100|      0|        res = xmlVRaiseError(NULL, channel, data, NULL, node,
  101|      0|                             XML_FROM_VALID, code, level, NULL, 0,
  102|      0|                             (const char *) str1, (const char *) str2,
  103|      0|                             (const char *) str2, int1, 0,
  104|      0|                             msg, ap);
  105|      0|        if (res < 0) {
  ------------------
  |  Branch (105:13): [True: 0, False: 0]
  ------------------
  106|      0|            xmlVErrMemory(ctxt);
  107|      0|            ret = -1;
  108|      0|        }
  109|      0|    }
  110|   439k|    va_end(ap);
  111|       |
  112|   439k|    return ret;
  113|   439k|}
valid.c:xmlFreeElement:
 1076|  27.2k|xmlFreeElement(xmlElementPtr elem) {
 1077|  27.2k|    if (elem == NULL) return;
  ------------------
  |  Branch (1077:9): [True: 6, False: 27.2k]
  ------------------
 1078|  27.2k|    xmlUnlinkNode((xmlNodePtr) elem);
 1079|  27.2k|    xmlFreeDocElementContent(elem->doc, elem->content);
 1080|  27.2k|    if (elem->name != NULL)
  ------------------
  |  Branch (1080:9): [True: 27.2k, False: 14]
  ------------------
 1081|  27.2k|	xmlFree((xmlChar *) elem->name);
 1082|  27.2k|    if (elem->prefix != NULL)
  ------------------
  |  Branch (1082:9): [True: 2.87k, False: 24.3k]
  ------------------
 1083|  2.87k|	xmlFree((xmlChar *) elem->prefix);
 1084|  27.2k|#ifdef LIBXML_REGEXP_ENABLED
 1085|  27.2k|    if (elem->contModel != NULL)
  ------------------
  |  Branch (1085:9): [True: 1.45k, False: 25.8k]
  ------------------
 1086|  1.45k|	xmlRegFreeRegexp(elem->contModel);
 1087|  27.2k|#endif
 1088|  27.2k|    xmlFree(elem);
 1089|  27.2k|}
valid.c:xmlFreeElementTableEntry:
 1272|  26.9k|xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) {
 1273|  26.9k|    xmlFreeElement((xmlElementPtr) elem);
 1274|  26.9k|}
valid.c:xmlCopyElement:
 1296|  9.40k|xmlCopyElement(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 1297|  9.40k|    xmlElementPtr elem = (xmlElementPtr) payload;
 1298|  9.40k|    xmlElementPtr cur;
 1299|       |
 1300|  9.40k|    cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 1301|  9.40k|    if (cur == NULL)
  ------------------
  |  Branch (1301:9): [True: 11, False: 9.38k]
  ------------------
 1302|     11|	return(NULL);
 1303|  9.38k|    memset(cur, 0, sizeof(xmlElement));
 1304|  9.38k|    cur->type = XML_ELEMENT_DECL;
 1305|  9.38k|    cur->etype = elem->etype;
 1306|  9.38k|    if (elem->name != NULL) {
  ------------------
  |  Branch (1306:9): [True: 9.38k, False: 0]
  ------------------
 1307|  9.38k|	cur->name = xmlStrdup(elem->name);
 1308|  9.38k|        if (cur->name == NULL)
  ------------------
  |  Branch (1308:13): [True: 12, False: 9.37k]
  ------------------
 1309|     12|            goto error;
 1310|  9.38k|    }
 1311|  9.37k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (1311:9): [True: 1.70k, False: 7.67k]
  ------------------
 1312|  1.70k|	cur->prefix = xmlStrdup(elem->prefix);
 1313|  1.70k|        if (cur->prefix == NULL)
  ------------------
  |  Branch (1313:13): [True: 3, False: 1.69k]
  ------------------
 1314|      3|            goto error;
 1315|  1.70k|    }
 1316|  9.37k|    if (elem->content != NULL) {
  ------------------
  |  Branch (1316:9): [True: 3.18k, False: 6.18k]
  ------------------
 1317|  3.18k|        cur->content = xmlCopyElementContent(elem->content);
 1318|  3.18k|        if (cur->content == NULL)
  ------------------
  |  Branch (1318:13): [True: 73, False: 3.11k]
  ------------------
 1319|     73|            goto error;
 1320|  3.18k|    }
 1321|       |    /* TODO : rebuild the attribute list on the copy */
 1322|  9.30k|    cur->attributes = NULL;
 1323|  9.30k|    return(cur);
 1324|       |
 1325|     88|error:
 1326|     88|    xmlFreeElement(cur);
 1327|       |    return(NULL);
 1328|  9.37k|}
valid.c:xmlErrValidWarning:
  191|  36.9k|{
  192|  36.9k|    return xmlDoErrValid(ctxt, node, error, XML_ERR_WARNING, str1, str2, str3,
  193|  36.9k|                         0, msg, str1, str2, str3);
  194|  36.9k|}
valid.c:xmlFreeAttribute:
 1521|  82.3k|xmlFreeAttribute(xmlAttributePtr attr) {
 1522|  82.3k|    xmlDictPtr dict;
 1523|       |
 1524|  82.3k|    if (attr == NULL) return;
  ------------------
  |  Branch (1524:9): [True: 6, False: 82.3k]
  ------------------
 1525|  82.3k|    if (attr->doc != NULL)
  ------------------
  |  Branch (1525:9): [True: 73.2k, False: 9.06k]
  ------------------
 1526|  73.2k|	dict = attr->doc->dict;
 1527|  9.06k|    else
 1528|  9.06k|	dict = NULL;
 1529|  82.3k|    xmlUnlinkNode((xmlNodePtr) attr);
 1530|  82.3k|    if (attr->tree != NULL)
  ------------------
  |  Branch (1530:9): [True: 37.0k, False: 45.2k]
  ------------------
 1531|  37.0k|        xmlFreeEnumeration(attr->tree);
 1532|  82.3k|    if (dict) {
  ------------------
  |  Branch (1532:9): [True: 50.6k, False: 31.6k]
  ------------------
 1533|  50.6k|        if ((attr->elem != NULL) && (!xmlDictOwns(dict, attr->elem)))
  ------------------
  |  Branch (1533:13): [True: 50.6k, False: 0]
  |  Branch (1533:37): [True: 0, False: 50.6k]
  ------------------
 1534|      0|	    xmlFree((xmlChar *) attr->elem);
 1535|  50.6k|        if ((attr->name != NULL) && (!xmlDictOwns(dict, attr->name)))
  ------------------
  |  Branch (1535:13): [True: 50.6k, False: 1]
  |  Branch (1535:37): [True: 0, False: 50.6k]
  ------------------
 1536|      0|	    xmlFree((xmlChar *) attr->name);
 1537|  50.6k|        if ((attr->prefix != NULL) && (!xmlDictOwns(dict, attr->prefix)))
  ------------------
  |  Branch (1537:13): [True: 3.48k, False: 47.2k]
  |  Branch (1537:39): [True: 0, False: 3.48k]
  ------------------
 1538|      0|	    xmlFree((xmlChar *) attr->prefix);
 1539|  50.6k|    } else {
 1540|  31.6k|	if (attr->elem != NULL)
  ------------------
  |  Branch (1540:6): [True: 31.5k, False: 38]
  ------------------
 1541|  31.5k|	    xmlFree((xmlChar *) attr->elem);
 1542|  31.6k|	if (attr->name != NULL)
  ------------------
  |  Branch (1542:6): [True: 31.5k, False: 53]
  ------------------
 1543|  31.5k|	    xmlFree((xmlChar *) attr->name);
 1544|  31.6k|	if (attr->prefix != NULL)
  ------------------
  |  Branch (1544:6): [True: 5.60k, False: 26.0k]
  ------------------
 1545|  5.60k|	    xmlFree((xmlChar *) attr->prefix);
 1546|  31.6k|    }
 1547|  82.3k|    if (attr->defaultValue != NULL)
  ------------------
  |  Branch (1547:9): [True: 21.6k, False: 60.6k]
  ------------------
 1548|  21.6k|        xmlFree(attr->defaultValue);
 1549|  82.3k|    xmlFree(attr);
 1550|  82.3k|}
valid.c:xmlFreeAttributeTableEntry:
 1750|  40.3k|xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) {
 1751|  40.3k|    xmlFreeAttribute((xmlAttributePtr) attr);
 1752|  40.3k|}
valid.c:xmlCopyAttribute:
 1774|  9.08k|xmlCopyAttribute(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 1775|  9.08k|    xmlAttributePtr attr = (xmlAttributePtr) payload;
 1776|  9.08k|    xmlAttributePtr cur;
 1777|       |
 1778|  9.08k|    cur = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
 1779|  9.08k|    if (cur == NULL)
  ------------------
  |  Branch (1779:9): [True: 15, False: 9.06k]
  ------------------
 1780|     15|	return(NULL);
 1781|  9.06k|    memset(cur, 0, sizeof(xmlAttribute));
 1782|  9.06k|    cur->type = XML_ATTRIBUTE_DECL;
 1783|  9.06k|    cur->atype = attr->atype;
 1784|  9.06k|    cur->def = attr->def;
 1785|  9.06k|    if (attr->tree != NULL) {
  ------------------
  |  Branch (1785:9): [True: 5.33k, False: 3.73k]
  ------------------
 1786|  5.33k|        cur->tree = xmlCopyEnumeration(attr->tree);
 1787|  5.33k|        if (cur->tree == NULL)
  ------------------
  |  Branch (1787:13): [True: 24, False: 5.31k]
  ------------------
 1788|     24|            goto error;
 1789|  5.33k|    }
 1790|  9.04k|    if (attr->elem != NULL) {
  ------------------
  |  Branch (1790:9): [True: 9.04k, False: 0]
  ------------------
 1791|  9.04k|	cur->elem = xmlStrdup(attr->elem);
 1792|  9.04k|        if (cur->elem == NULL)
  ------------------
  |  Branch (1792:13): [True: 12, False: 9.03k]
  ------------------
 1793|     12|            goto error;
 1794|  9.04k|    }
 1795|  9.03k|    if (attr->name != NULL) {
  ------------------
  |  Branch (1795:9): [True: 9.03k, False: 0]
  ------------------
 1796|  9.03k|	cur->name = xmlStrdup(attr->name);
 1797|  9.03k|        if (cur->name == NULL)
  ------------------
  |  Branch (1797:13): [True: 12, False: 9.01k]
  ------------------
 1798|     12|            goto error;
 1799|  9.03k|    }
 1800|  9.01k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1800:9): [True: 3.05k, False: 5.96k]
  ------------------
 1801|  3.05k|	cur->prefix = xmlStrdup(attr->prefix);
 1802|  3.05k|        if (cur->prefix == NULL)
  ------------------
  |  Branch (1802:13): [True: 4, False: 3.04k]
  ------------------
 1803|      4|            goto error;
 1804|  3.05k|    }
 1805|  9.01k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1805:9): [True: 4.58k, False: 4.42k]
  ------------------
 1806|  4.58k|	cur->defaultValue = xmlStrdup(attr->defaultValue);
 1807|  4.58k|        if (cur->defaultValue == NULL)
  ------------------
  |  Branch (1807:13): [True: 8, False: 4.57k]
  ------------------
 1808|      8|            goto error;
 1809|  4.58k|    }
 1810|  9.00k|    return(cur);
 1811|       |
 1812|     60|error:
 1813|     60|    xmlFreeAttribute(cur);
 1814|       |    return(NULL);
 1815|  9.01k|}
valid.c:xmlErrValid:
  148|  1.38k|{
  149|  1.38k|    xmlDoErrValid(ctxt, NULL, error, XML_ERR_ERROR, (const xmlChar *) extra,
  150|  1.38k|                  NULL, NULL, 0, msg, extra);
  151|  1.38k|}
valid.c:xmlFreeNotation:
 1902|  4.00k|xmlFreeNotation(xmlNotationPtr nota) {
 1903|  4.00k|    if (nota == NULL) return;
  ------------------
  |  Branch (1903:9): [True: 4, False: 4.00k]
  ------------------
 1904|  4.00k|    if (nota->name != NULL)
  ------------------
  |  Branch (1904:9): [True: 4.00k, False: 2]
  ------------------
 1905|  4.00k|	xmlFree((xmlChar *) nota->name);
 1906|  4.00k|    if (nota->PublicID != NULL)
  ------------------
  |  Branch (1906:9): [True: 2.41k, False: 1.58k]
  ------------------
 1907|  2.41k|	xmlFree((xmlChar *) nota->PublicID);
 1908|  4.00k|    if (nota->SystemID != NULL)
  ------------------
  |  Branch (1908:9): [True: 2.10k, False: 1.89k]
  ------------------
 1909|  2.10k|	xmlFree((xmlChar *) nota->SystemID);
 1910|  4.00k|    xmlFree(nota);
 1911|  4.00k|}
valid.c:xmlFreeNotationTableEntry:
 2003|  1.94k|xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) {
 2004|  1.94k|    xmlFreeNotation((xmlNotationPtr) nota);
 2005|  1.94k|}
valid.c:xmlCopyNotation:
 2027|  1.68k|xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 2028|  1.68k|    xmlNotationPtr nota = (xmlNotationPtr) payload;
 2029|  1.68k|    xmlNotationPtr cur;
 2030|       |
 2031|  1.68k|    cur = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
 2032|  1.68k|    if (cur == NULL)
  ------------------
  |  Branch (2032:9): [True: 6, False: 1.68k]
  ------------------
 2033|      6|	return(NULL);
 2034|  1.68k|    memset(cur, 0, sizeof(*cur));
 2035|  1.68k|    if (nota->name != NULL) {
  ------------------
  |  Branch (2035:9): [True: 1.68k, False: 0]
  ------------------
 2036|  1.68k|	cur->name = xmlStrdup(nota->name);
 2037|  1.68k|        if (cur->name == NULL)
  ------------------
  |  Branch (2037:13): [True: 1, False: 1.68k]
  ------------------
 2038|      1|            goto error;
 2039|  1.68k|    }
 2040|  1.68k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (2040:9): [True: 882, False: 800]
  ------------------
 2041|    882|	cur->PublicID = xmlStrdup(nota->PublicID);
 2042|    882|        if (cur->PublicID == NULL)
  ------------------
  |  Branch (2042:13): [True: 1, False: 881]
  ------------------
 2043|      1|            goto error;
 2044|    882|    }
 2045|  1.68k|    if (nota->SystemID != NULL) {
  ------------------
  |  Branch (2045:9): [True: 1.30k, False: 377]
  ------------------
 2046|  1.30k|	cur->SystemID = xmlStrdup(nota->SystemID);
 2047|  1.30k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (2047:13): [True: 7, False: 1.29k]
  ------------------
 2048|      7|            goto error;
 2049|  1.30k|    }
 2050|  1.67k|    return(cur);
 2051|       |
 2052|      9|error:
 2053|      9|    xmlFreeNotation(cur);
 2054|       |    return(NULL);
 2055|  1.68k|}
valid.c:xmlAddIDInternal:
 2182|  20.3k|xmlAddIDInternal(xmlAttrPtr attr, const xmlChar *value, xmlIDPtr *idPtr) {
 2183|  20.3k|    xmlDocPtr doc;
 2184|  20.3k|    xmlIDPtr id;
 2185|  20.3k|    xmlIDTablePtr table;
 2186|  20.3k|    int ret;
 2187|       |
 2188|  20.3k|    if (idPtr != NULL)
  ------------------
  |  Branch (2188:9): [True: 14.5k, False: 5.83k]
  ------------------
 2189|  14.5k|        *idPtr = NULL;
 2190|  20.3k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (2190:9): [True: 1, False: 20.3k]
  |  Branch (2190:28): [True: 1.49k, False: 18.8k]
  ------------------
 2191|  1.50k|	return(0);
 2192|  18.8k|    if (attr == NULL)
  ------------------
  |  Branch (2192:9): [True: 0, False: 18.8k]
  ------------------
 2193|      0|	return(0);
 2194|       |
 2195|  18.8k|    doc = attr->doc;
 2196|  18.8k|    if (doc == NULL)
  ------------------
  |  Branch (2196:9): [True: 0, False: 18.8k]
  ------------------
 2197|      0|        return(0);
 2198|       |
 2199|       |    /*
 2200|       |     * Create the ID table if needed.
 2201|       |     */
 2202|  18.8k|    table = (xmlIDTablePtr) doc->ids;
 2203|  18.8k|    if (table == NULL)  {
  ------------------
  |  Branch (2203:9): [True: 827, False: 18.0k]
  ------------------
 2204|    827|        doc->ids = table = xmlHashCreate(0);
 2205|    827|        if (table == NULL)
  ------------------
  |  Branch (2205:13): [True: 3, False: 824]
  ------------------
 2206|      3|            return(-1);
 2207|  18.0k|    } else {
 2208|  18.0k|        id = xmlHashLookup(table, value);
 2209|  18.0k|        if (id != NULL)
  ------------------
  |  Branch (2209:13): [True: 14.6k, False: 3.39k]
  ------------------
 2210|  14.6k|            return(0);
 2211|  18.0k|    }
 2212|       |
 2213|  4.22k|    id = (xmlIDPtr) xmlMalloc(sizeof(xmlID));
 2214|  4.22k|    if (id == NULL)
  ------------------
  |  Branch (2214:9): [True: 6, False: 4.21k]
  ------------------
 2215|      6|	return(-1);
 2216|  4.21k|    memset(id, 0, sizeof(*id));
 2217|       |
 2218|       |    /*
 2219|       |     * fill the structure.
 2220|       |     */
 2221|  4.21k|    id->doc = doc;
 2222|  4.21k|    id->value = xmlStrdup(value);
 2223|  4.21k|    if (id->value == NULL) {
  ------------------
  |  Branch (2223:9): [True: 8, False: 4.20k]
  ------------------
 2224|      8|        xmlFreeID(id);
 2225|      8|        return(-1);
 2226|      8|    }
 2227|       |
 2228|  4.20k|    if (attr->id != NULL)
  ------------------
  |  Branch (2228:9): [True: 0, False: 4.20k]
  ------------------
 2229|      0|        xmlRemoveID(doc, attr);
 2230|       |
 2231|  4.20k|    if (xmlHashAddEntry(table, value, id) < 0) {
  ------------------
  |  Branch (2231:9): [True: 12, False: 4.19k]
  ------------------
 2232|     12|	xmlFreeID(id);
 2233|     12|	return(-1);
 2234|     12|    }
 2235|       |
 2236|  4.19k|    ret = 1;
 2237|  4.19k|    if (idPtr != NULL)
  ------------------
  |  Branch (2237:9): [True: 1.18k, False: 3.01k]
  ------------------
 2238|  1.18k|        *idPtr = id;
 2239|       |
 2240|  4.19k|    id->attr = attr;
 2241|  4.19k|    id->lineno = xmlGetLineNo(attr->parent);
 2242|  4.19k|    attr->atype = XML_ATTRIBUTE_ID;
 2243|  4.19k|    attr->id = id;
 2244|       |
 2245|  4.19k|    return(ret);
 2246|  4.20k|}
valid.c:xmlFreeID:
 2151|  4.21k|xmlFreeID(xmlIDPtr id) {
 2152|  4.21k|    xmlDictPtr dict = NULL;
 2153|       |
 2154|  4.21k|    if (id == NULL) return;
  ------------------
  |  Branch (2154:9): [True: 0, False: 4.21k]
  ------------------
 2155|       |
 2156|  4.21k|    if (id->doc != NULL)
  ------------------
  |  Branch (2156:9): [True: 4.21k, False: 0]
  ------------------
 2157|  4.21k|        dict = id->doc->dict;
 2158|       |
 2159|  4.21k|    if (id->value != NULL)
  ------------------
  |  Branch (2159:9): [True: 4.20k, False: 8]
  ------------------
 2160|  4.20k|	xmlFree(id->value);
 2161|  4.21k|    if (id->name != NULL)
  ------------------
  |  Branch (2161:9): [True: 120, False: 4.09k]
  ------------------
 2162|    120|	DICT_FREE(id->name)
  ------------------
  |  | 2129|    120|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (2129:6): [True: 120, False: 0]
  |  |  |  Branch (2129:16): [True: 64, False: 56]
  |  |  ------------------
  |  | 2130|    120|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (2130:6): [True: 0, False: 56]
  |  |  ------------------
  |  | 2131|    120|	    xmlFree((char *)(str));
  ------------------
 2163|  4.21k|    if (id->attr != NULL) {
  ------------------
  |  Branch (2163:9): [True: 4.07k, False: 140]
  ------------------
 2164|  4.07k|        id->attr->id = NULL;
 2165|  4.07k|        id->attr->atype = 0;
 2166|  4.07k|    }
 2167|       |
 2168|  4.21k|    xmlFree(id);
 2169|  4.21k|}
valid.c:xmlFreeIDTableEntry:
 2299|  4.19k|xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) {
 2300|  4.19k|    xmlFreeID((xmlIDPtr) id);
 2301|  4.19k|}
valid.c:xmlIsStreaming:
 2134|  28.1k|xmlIsStreaming(xmlValidCtxtPtr ctxt) {
 2135|  28.1k|    xmlParserCtxtPtr pctxt;
 2136|       |
 2137|  28.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (2137:9): [True: 0, False: 28.1k]
  ------------------
 2138|      0|        return(0);
 2139|  28.1k|    if ((ctxt->flags & XML_VCTXT_USE_PCTXT) == 0)
  ------------------
  |  |   20|  28.1k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (2139:9): [True: 0, False: 28.1k]
  ------------------
 2140|      0|        return(0);
 2141|  28.1k|    pctxt = ctxt->userData;
 2142|  28.1k|    return(pctxt->parseMode == XML_PARSE_READER);
 2143|  28.1k|}
valid.c:xmlFreeRef:
 2475|  28.1k|xmlFreeRef(xmlLinkPtr lk) {
 2476|  28.1k|    xmlRefPtr ref = (xmlRefPtr)xmlLinkGetData(lk);
 2477|  28.1k|    if (ref == NULL) return;
  ------------------
  |  Branch (2477:9): [True: 0, False: 28.1k]
  ------------------
 2478|  28.1k|    if (ref->value != NULL)
  ------------------
  |  Branch (2478:9): [True: 28.1k, False: 0]
  ------------------
 2479|  28.1k|        xmlFree((xmlChar *)ref->value);
 2480|  28.1k|    if (ref->name != NULL)
  ------------------
  |  Branch (2480:9): [True: 3.51k, False: 24.6k]
  ------------------
 2481|  3.51k|        xmlFree((xmlChar *)ref->name);
 2482|  28.1k|    xmlFree(ref);
 2483|  28.1k|}
valid.c:xmlDummyCompare:
 2527|  27.4k|{
 2528|  27.4k|    return (0);
 2529|  27.4k|}
valid.c:xmlFreeRefTableEntry:
 2492|    732|xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 2493|    732|    xmlListPtr list_ref = (xmlListPtr) payload;
 2494|    732|    if (list_ref == NULL) return;
  ------------------
  |  Branch (2494:9): [True: 0, False: 732]
  ------------------
 2495|    732|    xmlListDelete(list_ref);
 2496|    732|}
valid.c:xmlGetDtdElementDesc2:
 2827|  73.2k|xmlGetDtdElementDesc2(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name) {
 2828|  73.2k|    xmlElementTablePtr table;
 2829|  73.2k|    xmlElementPtr cur = NULL;
 2830|  73.2k|    const xmlChar *localName;
 2831|  73.2k|    xmlChar *prefix = NULL;
 2832|       |
 2833|  73.2k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2833:9): [True: 0, False: 73.2k]
  ------------------
 2834|       |
 2835|       |    /*
 2836|       |     * Create the Element table if needed.
 2837|       |     */
 2838|  73.2k|    if (dtd->elements == NULL) {
  ------------------
  |  Branch (2838:9): [True: 4.26k, False: 68.9k]
  ------------------
 2839|  4.26k|	xmlDictPtr dict = NULL;
 2840|       |
 2841|  4.26k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (2841:6): [True: 4.26k, False: 0]
  ------------------
 2842|  4.26k|	    dict = dtd->doc->dict;
 2843|       |
 2844|  4.26k|	dtd->elements = xmlHashCreateDict(0, dict);
 2845|  4.26k|	if (dtd->elements == NULL)
  ------------------
  |  Branch (2845:6): [True: 2, False: 4.26k]
  ------------------
 2846|      2|            goto mem_error;
 2847|  4.26k|    }
 2848|  73.2k|    table = (xmlElementTablePtr) dtd->elements;
 2849|       |
 2850|  73.2k|    localName = xmlSplitQName4(name, &prefix);
 2851|  73.2k|    if (localName == NULL)
  ------------------
  |  Branch (2851:9): [True: 2, False: 73.2k]
  ------------------
 2852|      2|        goto mem_error;
 2853|  73.2k|    cur = xmlHashLookup2(table, localName, prefix);
 2854|  73.2k|    if (cur == NULL) {
  ------------------
  |  Branch (2854:9): [True: 5.75k, False: 67.4k]
  ------------------
 2855|  5.75k|	cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 2856|  5.75k|	if (cur == NULL)
  ------------------
  |  Branch (2856:6): [True: 2, False: 5.75k]
  ------------------
 2857|      2|            goto mem_error;
 2858|  5.75k|	memset(cur, 0, sizeof(xmlElement));
 2859|  5.75k|	cur->type = XML_ELEMENT_DECL;
 2860|  5.75k|        cur->doc = dtd->doc;
 2861|       |
 2862|       |	/*
 2863|       |	 * fill the structure.
 2864|       |	 */
 2865|  5.75k|	cur->name = xmlStrdup(localName);
 2866|  5.75k|        if (cur->name == NULL)
  ------------------
  |  Branch (2866:13): [True: 2, False: 5.75k]
  ------------------
 2867|      2|            goto mem_error;
 2868|  5.75k|	cur->prefix = prefix;
 2869|  5.75k|        prefix = NULL;
 2870|  5.75k|	cur->etype = XML_ELEMENT_TYPE_UNDEFINED;
 2871|       |
 2872|  5.75k|	if (xmlHashAdd2(table, localName, cur->prefix, cur) <= 0)
  ------------------
  |  Branch (2872:6): [True: 5, False: 5.74k]
  ------------------
 2873|      5|            goto mem_error;
 2874|  5.75k|    }
 2875|       |
 2876|  73.2k|    if (prefix != NULL)
  ------------------
  |  Branch (2876:9): [True: 1.64k, False: 71.5k]
  ------------------
 2877|  1.64k|        xmlFree(prefix);
 2878|  73.2k|    return(cur);
 2879|       |
 2880|     13|mem_error:
 2881|     13|    xmlVErrMemory(ctxt);
 2882|     13|    xmlFree(prefix);
 2883|     13|    xmlFreeElement(cur);
 2884|       |    return(NULL);
 2885|  73.2k|}
valid.c:xmlValidateNameValueInternal:
 3096|  28.0k|xmlValidateNameValueInternal(const xmlChar *value, int flags) {
 3097|  28.0k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3097:9): [True: 6, False: 28.0k]
  |  Branch (3097:28): [True: 1.13k, False: 26.9k]
  ------------------
 3098|  1.13k|        return(0);
 3099|       |
 3100|  26.9k|    value = xmlScanName(value, SIZE_MAX, flags);
 3101|  26.9k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3101:12): [True: 26.9k, False: 0]
  |  Branch (3101:31): [True: 15.7k, False: 11.1k]
  ------------------
 3102|  28.0k|}
valid.c:xmlValidateNamesValueInternal:
 3125|  5.92k|xmlValidateNamesValueInternal(const xmlChar *value, int flags) {
 3126|  5.92k|    const xmlChar *cur;
 3127|       |
 3128|  5.92k|    if (value == NULL)
  ------------------
  |  Branch (3128:9): [True: 2, False: 5.92k]
  ------------------
 3129|      2|        return(0);
 3130|       |
 3131|  5.92k|    cur = xmlScanName(value, SIZE_MAX, flags);
 3132|  5.92k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3132:9): [True: 0, False: 5.92k]
  |  Branch (3132:26): [True: 1.35k, False: 4.57k]
  ------------------
 3133|  1.35k|        return(0);
 3134|       |
 3135|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3136|  7.20k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3136:12): [True: 3.20k, False: 4.00k]
  ------------------
 3137|  6.40k|	while (*cur == 0x20)
  ------------------
  |  Branch (3137:9): [True: 3.20k, False: 3.20k]
  ------------------
 3138|  3.20k|	    cur += 1;
 3139|       |
 3140|  3.20k|        value = cur;
 3141|  3.20k|        cur = xmlScanName(value, SIZE_MAX, flags);
 3142|  3.20k|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3142:13): [True: 0, False: 3.20k]
  |  Branch (3142:30): [True: 567, False: 2.63k]
  ------------------
 3143|    567|            return(0);
 3144|  3.20k|    }
 3145|       |
 3146|  4.00k|    return(*cur == 0);
 3147|  4.57k|}
valid.c:xmlValidateNmtokenValueInternal:
 3172|  1.41k|xmlValidateNmtokenValueInternal(const xmlChar *value, int flags) {
 3173|  1.41k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3173:9): [True: 1, False: 1.41k]
  |  Branch (3173:28): [True: 68, False: 1.34k]
  ------------------
 3174|     69|        return(0);
 3175|       |
 3176|  1.34k|    value = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  1.34k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3177|  1.34k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3177:12): [True: 1.34k, False: 0]
  |  Branch (3177:31): [True: 1.04k, False: 301]
  ------------------
 3178|  1.41k|}
valid.c:xmlValidateNmtokensValueInternal:
 3205|  85.3k|xmlValidateNmtokensValueInternal(const xmlChar *value, int flags) {
 3206|  85.3k|    const xmlChar *cur;
 3207|       |
 3208|  85.3k|    if (value == NULL)
  ------------------
  |  Branch (3208:9): [True: 1, False: 85.3k]
  ------------------
 3209|      1|        return(0);
 3210|       |
 3211|  85.3k|    cur = value;
 3212|  85.3k|    while (IS_BLANK_CH(*cur))
 3213|    476|	cur += 1;
 3214|       |
 3215|  85.3k|    value = cur;
 3216|  85.3k|    cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  85.3k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3217|  85.3k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3217:9): [True: 0, False: 85.3k]
  |  Branch (3217:26): [True: 5.53k, False: 79.8k]
  ------------------
 3218|  5.53k|        return(0);
 3219|       |
 3220|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3221|  80.3k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3221:12): [True: 774, False: 79.5k]
  ------------------
 3222|  1.55k|	while (*cur == 0x20)
  ------------------
  |  Branch (3222:9): [True: 778, False: 774]
  ------------------
 3223|    778|	    cur += 1;
 3224|    774|        if (*cur == 0)
  ------------------
  |  Branch (3224:13): [True: 72, False: 702]
  ------------------
 3225|     72|            return(1);
 3226|       |
 3227|    702|        value = cur;
 3228|    702|        cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|    702|#define XML_SCAN_NMTOKEN    2
  ------------------
 3229|    702|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3229:13): [True: 0, False: 702]
  |  Branch (3229:30): [True: 250, False: 452]
  ------------------
 3230|    250|            return(0);
 3231|    702|    }
 3232|       |
 3233|  79.5k|    return(*cur == 0);
 3234|  79.8k|}
valid.c:xmlValidateAttributeValueInternal:
 3283|   123k|                                  const xmlChar *value) {
 3284|   123k|    int flags = 0;
 3285|       |
 3286|   123k|    if ((doc != NULL) && (doc->properties & XML_DOC_OLD10))
  ------------------
  |  Branch (3286:9): [True: 123k, False: 0]
  |  Branch (3286:26): [True: 61.2k, False: 62.7k]
  ------------------
 3287|  61.2k|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  61.2k|#define XML_SCAN_OLD10      4
  ------------------
 3288|       |
 3289|   123k|    switch (type) {
  ------------------
  |  Branch (3289:13): [True: 123k, False: 0]
  ------------------
 3290|  2.85k|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (3290:2): [True: 2.85k, False: 121k]
  ------------------
 3291|  5.92k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3291:2): [True: 3.06k, False: 120k]
  ------------------
 3292|  5.92k|	    return(xmlValidateNamesValueInternal(value, flags));
 3293|  5.96k|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (3293:2): [True: 5.96k, False: 117k]
  ------------------
 3294|  12.5k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3294:2): [True: 6.61k, False: 117k]
  ------------------
 3295|  23.0k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3295:2): [True: 10.4k, False: 113k]
  ------------------
 3296|  28.0k|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (3296:2): [True: 5.02k, False: 118k]
  ------------------
 3297|  28.0k|	    return(xmlValidateNameValueInternal(value, flags));
 3298|    951|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3298:2): [True: 951, False: 122k]
  ------------------
 3299|  85.3k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3299:2): [True: 84.4k, False: 39.4k]
  ------------------
 3300|  85.3k|	    return(xmlValidateNmtokensValueInternal(value, flags));
 3301|  1.41k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3301:2): [True: 1.41k, False: 122k]
  ------------------
 3302|  1.41k|	    return(xmlValidateNmtokenValueInternal(value, flags));
 3303|  3.14k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3303:9): [True: 3.14k, False: 120k]
  ------------------
 3304|  3.14k|	    break;
 3305|   123k|    }
 3306|  3.14k|    return(1);
 3307|   123k|}
valid.c:xmlValidNormalizeString:
 3065|  4.50k|xmlValidNormalizeString(xmlChar *str) {
 3066|  4.50k|    xmlChar *dst;
 3067|  4.50k|    const xmlChar *src;
 3068|       |
 3069|  4.50k|    if (str == NULL)
  ------------------
  |  Branch (3069:9): [True: 0, False: 4.50k]
  ------------------
 3070|      0|        return;
 3071|  4.50k|    src = str;
 3072|  4.50k|    dst = str;
 3073|       |
 3074|  4.74k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (3074:12): [True: 247, False: 4.50k]
  ------------------
 3075|  52.2k|    while (*src != 0) {
  ------------------
  |  Branch (3075:12): [True: 47.7k, False: 4.50k]
  ------------------
 3076|  47.7k|	if (*src == 0x20) {
  ------------------
  |  Branch (3076:6): [True: 2.81k, False: 44.9k]
  ------------------
 3077|  6.23k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (3077:13): [True: 3.41k, False: 2.81k]
  ------------------
 3078|  2.81k|	    if (*src != 0)
  ------------------
  |  Branch (3078:10): [True: 2.38k, False: 427]
  ------------------
 3079|  2.38k|		*dst++ = 0x20;
 3080|  44.9k|	} else {
 3081|  44.9k|	    *dst++ = *src++;
 3082|  44.9k|	}
 3083|  47.7k|    }
 3084|  4.50k|    *dst = 0;
 3085|  4.50k|}
valid.c:xmlScanIDAttributeDecl:
 1495|  4.99k|xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
 1496|  4.99k|    xmlAttributePtr cur;
 1497|  4.99k|    int ret = 0;
 1498|       |
 1499|  4.99k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (1499:9): [True: 0, False: 4.99k]
  ------------------
 1500|  4.99k|    cur = elem->attributes;
 1501|  11.5k|    while (cur != NULL) {
  ------------------
  |  Branch (1501:12): [True: 6.52k, False: 4.99k]
  ------------------
 1502|  6.52k|        if (cur->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (1502:13): [True: 5.28k, False: 1.24k]
  ------------------
 1503|  5.28k|	    ret ++;
 1504|  5.28k|	    if ((ret > 1) && (err))
  ------------------
  |  Branch (1504:10): [True: 704, False: 4.58k]
  |  Branch (1504:23): [True: 0, False: 704]
  ------------------
 1505|      0|		xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_MULTIPLE_ID,
 1506|      0|	       "Element %s has too many ID attributes defined : %s\n",
 1507|       |		       elem->name, cur->name, NULL);
 1508|  5.28k|	}
 1509|  6.52k|	cur = cur->nexth;
 1510|  6.52k|    }
 1511|  4.99k|    return(ret);
 1512|  4.99k|}
valid.c:xmlValidateAttributeIdCallback:
 3614|    106|	                       const xmlChar *name ATTRIBUTE_UNUSED) {
 3615|    106|    xmlAttributePtr attr = (xmlAttributePtr) payload;
 3616|    106|    int *count = (int *) data;
 3617|    106|    if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
  ------------------
  |  Branch (3617:9): [True: 65, False: 41]
  ------------------
 3618|    106|}
valid.c:xmlErrValidNodeNr:
  169|  2.32k|{
  170|       |    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str3, NULL, int2,
  171|  2.32k|                  msg, str1, int2, str3);
  172|  2.32k|}
valid.c:xmlValidateAttributeValue2:
 3367|  99.9k|      const xmlChar *name, xmlAttributeType type, const xmlChar *value) {
 3368|  99.9k|    int ret = 1;
 3369|  99.9k|    switch (type) {
  ------------------
  |  Branch (3369:13): [True: 99.9k, False: 0]
  ------------------
 3370|  1.91k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3370:2): [True: 1.91k, False: 98.0k]
  ------------------
 3371|  5.73k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3371:2): [True: 3.81k, False: 96.1k]
  ------------------
 3372|  10.8k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3372:2): [True: 5.09k, False: 94.8k]
  ------------------
 3373|  11.4k|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3373:2): [True: 654, False: 99.3k]
  ------------------
 3374|  87.8k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3374:2): [True: 76.3k, False: 23.5k]
  ------------------
 3375|  88.1k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3375:2): [True: 286, False: 99.6k]
  ------------------
 3376|  89.5k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3376:9): [True: 1.36k, False: 98.5k]
  ------------------
 3377|  89.5k|	    break;
 3378|  4.22k|	case XML_ATTRIBUTE_ENTITY: {
  ------------------
  |  Branch (3378:2): [True: 4.22k, False: 95.7k]
  ------------------
 3379|  4.22k|	    xmlEntityPtr ent;
 3380|       |
 3381|  4.22k|	    ent = xmlGetDocEntity(doc, value);
 3382|       |	    /* yeah it's a bit messy... */
 3383|  4.22k|	    if ((ent == NULL) && (doc->standalone == 1)) {
  ------------------
  |  Branch (3383:10): [True: 3.69k, False: 532]
  |  Branch (3383:27): [True: 22, False: 3.66k]
  ------------------
 3384|     22|		doc->standalone = 0;
 3385|     22|		ent = xmlGetDocEntity(doc, value);
 3386|     22|	    }
 3387|  4.22k|	    if (ent == NULL) {
  ------------------
  |  Branch (3387:10): [True: 3.69k, False: 532]
  ------------------
 3388|  3.69k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3389|  3.69k|				XML_DTD_UNKNOWN_ENTITY,
 3390|  3.69k|   "ENTITY attribute %s reference an unknown entity \"%s\"\n",
 3391|  3.69k|		       name, value, NULL);
 3392|  3.69k|		ret = 0;
 3393|  3.69k|	    } else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3393:17): [True: 209, False: 323]
  ------------------
 3394|    209|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3395|    209|				XML_DTD_ENTITY_TYPE,
 3396|    209|   "ENTITY attribute %s reference an entity \"%s\" of wrong type\n",
 3397|    209|		       name, value, NULL);
 3398|    209|		ret = 0;
 3399|    209|	    }
 3400|  4.22k|	    break;
 3401|  88.1k|        }
 3402|  1.84k|	case XML_ATTRIBUTE_ENTITIES: {
  ------------------
  |  Branch (3402:2): [True: 1.84k, False: 98.1k]
  ------------------
 3403|  1.84k|	    xmlChar *dup, *nam = NULL, *cur, save;
 3404|  1.84k|	    xmlEntityPtr ent;
 3405|       |
 3406|  1.84k|	    dup = xmlStrdup(value);
 3407|  1.84k|	    if (dup == NULL) {
  ------------------
  |  Branch (3407:10): [True: 1, False: 1.84k]
  ------------------
 3408|      1|                xmlVErrMemory(ctxt);
 3409|      1|		return(0);
 3410|      1|            }
 3411|  1.84k|	    cur = dup;
 3412|  6.70k|	    while (*cur != 0) {
  ------------------
  |  Branch (3412:13): [True: 6.15k, False: 551]
  ------------------
 3413|  6.15k|		nam = cur;
 3414|  37.7k|		while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  36.4k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  36.4k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 4.00k, False: 32.4k]
  |  |  |  |  ------------------
  |  |  |  |   91|  36.4k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 32.4k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 456, False: 31.9k]
  |  |  |  |  ------------------
  |  |  |  |   92|  36.4k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 396, False: 31.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3414:10): [True: 36.4k, False: 1.29k]
  ------------------
 3415|  6.15k|		save = *cur;
 3416|  6.15k|		*cur = 0;
 3417|  6.15k|		ent = xmlGetDocEntity(doc, nam);
 3418|  6.15k|		if (ent == NULL) {
  ------------------
  |  Branch (3418:7): [True: 5.72k, False: 426]
  ------------------
 3419|  5.72k|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3420|  5.72k|				    XML_DTD_UNKNOWN_ENTITY,
 3421|  5.72k|       "ENTITIES attribute %s reference an unknown entity \"%s\"\n",
 3422|  5.72k|			   name, nam, NULL);
 3423|  5.72k|		    ret = 0;
 3424|  5.72k|		} else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3424:14): [True: 218, False: 208]
  ------------------
 3425|    218|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3426|    218|				    XML_DTD_ENTITY_TYPE,
 3427|    218|       "ENTITIES attribute %s reference an entity \"%s\" of wrong type\n",
 3428|    218|			   name, nam, NULL);
 3429|    218|		    ret = 0;
 3430|    218|		}
 3431|  6.15k|		if (save == 0)
  ------------------
  |  Branch (3431:7): [True: 1.29k, False: 4.85k]
  ------------------
 3432|  1.29k|		    break;
 3433|  4.85k|		*cur = save;
 3434|  5.05k|		while (IS_BLANK_CH(*cur)) cur++;
 3435|  4.85k|	    }
 3436|  1.84k|	    xmlFree(dup);
 3437|  1.84k|	    break;
 3438|  1.84k|	}
 3439|  4.37k|	case XML_ATTRIBUTE_NOTATION: {
  ------------------
  |  Branch (3439:2): [True: 4.37k, False: 95.5k]
  ------------------
 3440|  4.37k|	    xmlNotationPtr nota;
 3441|       |
 3442|  4.37k|	    nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3443|  4.37k|	    if ((nota == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3443:10): [True: 3.97k, False: 396]
  |  Branch (3443:28): [True: 722, False: 3.25k]
  ------------------
 3444|    722|		nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3445|       |
 3446|  4.37k|	    if (nota == NULL) {
  ------------------
  |  Branch (3446:10): [True: 3.86k, False: 510]
  ------------------
 3447|  3.86k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3448|  3.86k|		                XML_DTD_UNKNOWN_NOTATION,
 3449|  3.86k|       "NOTATION attribute %s reference an unknown notation \"%s\"\n",
 3450|  3.86k|		       name, value, NULL);
 3451|  3.86k|		ret = 0;
 3452|  3.86k|	    }
 3453|  4.37k|	    break;
 3454|  1.84k|        }
 3455|  99.9k|    }
 3456|  99.9k|    return(ret);
 3457|  99.9k|}
valid.c:xmlValidateCheckMixed:
 5092|  33.7k|	              xmlElementContentPtr cont, const xmlChar *qname) {
 5093|  33.7k|    const xmlChar *name;
 5094|  33.7k|    int plen;
 5095|  33.7k|    name = xmlSplitQName3(qname, &plen);
 5096|       |
 5097|  33.7k|    if (name == NULL) {
  ------------------
  |  Branch (5097:9): [True: 19.4k, False: 14.2k]
  ------------------
 5098|  97.2k|	while (cont != NULL) {
  ------------------
  |  Branch (5098:9): [True: 78.3k, False: 18.9k]
  ------------------
 5099|  78.3k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5099:10): [True: 19.2k, False: 59.0k]
  ------------------
 5100|  19.2k|		if ((cont->prefix == NULL) && (xmlStrEqual(cont->name, qname)))
  ------------------
  |  Branch (5100:7): [True: 18.4k, False: 821]
  |  Branch (5100:33): [True: 327, False: 18.0k]
  ------------------
 5101|    327|		    return(1);
 5102|  59.0k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5102:17): [True: 59.0k, False: 0]
  ------------------
 5103|  59.0k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5103:9): [True: 59.0k, False: 0]
  ------------------
 5104|  59.0k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5104:9): [True: 39.6k, False: 19.4k]
  ------------------
 5105|  39.6k|		if ((cont->c1->prefix == NULL) &&
  ------------------
  |  Branch (5105:7): [True: 19.6k, False: 19.9k]
  ------------------
 5106|  19.6k|		    (xmlStrEqual(cont->c1->name, qname)))
  ------------------
  |  Branch (5106:7): [True: 218, False: 19.4k]
  ------------------
 5107|    218|		    return(1);
 5108|  39.6k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5108:17): [True: 0, False: 19.4k]
  ------------------
 5109|  19.4k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5109:3): [True: 0, False: 19.4k]
  ------------------
 5110|  19.4k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5110:3): [True: 0, False: 19.4k]
  ------------------
 5111|      0|		xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5112|      0|			"Internal: MIXED struct corrupted\n",
 5113|      0|			NULL);
 5114|      0|		break;
 5115|      0|	    }
 5116|  77.7k|	    cont = cont->c2;
 5117|  77.7k|	}
 5118|  19.4k|    } else {
 5119|  73.1k|	while (cont != NULL) {
  ------------------
  |  Branch (5119:9): [True: 59.3k, False: 13.8k]
  ------------------
 5120|  59.3k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5120:10): [True: 14.0k, False: 45.2k]
  ------------------
 5121|  14.0k|		if ((cont->prefix != NULL) &&
  ------------------
  |  Branch (5121:7): [True: 946, False: 13.1k]
  ------------------
 5122|    946|		    (xmlStrncmp(cont->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5122:7): [True: 508, False: 438]
  ------------------
 5123|    508|		    (xmlStrEqual(cont->name, name)))
  ------------------
  |  Branch (5123:7): [True: 256, False: 252]
  ------------------
 5124|    256|		    return(1);
 5125|  45.2k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5125:17): [True: 45.2k, False: 0]
  ------------------
 5126|  45.2k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5126:9): [True: 45.2k, False: 0]
  ------------------
 5127|  45.2k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5127:9): [True: 30.9k, False: 14.2k]
  ------------------
 5128|  30.9k|		if ((cont->c1->prefix != NULL) &&
  ------------------
  |  Branch (5128:7): [True: 16.7k, False: 14.1k]
  ------------------
 5129|  16.7k|		    (xmlStrncmp(cont->c1->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5129:7): [True: 2.51k, False: 14.2k]
  ------------------
 5130|  2.51k|		    (xmlStrEqual(cont->c1->name, name)))
  ------------------
  |  Branch (5130:7): [True: 198, False: 2.31k]
  ------------------
 5131|    198|		    return(1);
 5132|  30.9k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5132:17): [True: 0, False: 14.2k]
  ------------------
 5133|  14.2k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5133:3): [True: 0, False: 14.2k]
  ------------------
 5134|  14.2k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5134:3): [True: 0, False: 14.2k]
  ------------------
 5135|      0|		xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5136|      0|			"Internal: MIXED struct corrupted\n",
 5137|      0|			NULL);
 5138|      0|		break;
 5139|      0|	    }
 5140|  58.8k|	    cont = cont->c2;
 5141|  58.8k|	}
 5142|  14.2k|    }
 5143|  32.7k|    return(0);
 5144|  33.7k|}
valid.c:xmlValidGetElemDecl:
 5159|   245k|	            xmlNodePtr elem, int *extsubset) {
 5160|   245k|    xmlElementPtr elemDecl = NULL;
 5161|   245k|    const xmlChar *prefix = NULL;
 5162|       |
 5163|   245k|    if ((ctxt == NULL) || (doc == NULL) ||
  ------------------
  |  Branch (5163:9): [True: 0, False: 245k]
  |  Branch (5163:27): [True: 0, False: 245k]
  ------------------
 5164|   245k|        (elem == NULL) || (elem->name == NULL))
  ------------------
  |  Branch (5164:9): [True: 0, False: 245k]
  |  Branch (5164:27): [True: 0, False: 245k]
  ------------------
 5165|      0|        return(NULL);
 5166|   245k|    if (extsubset != NULL)
  ------------------
  |  Branch (5166:9): [True: 245k, False: 0]
  ------------------
 5167|   245k|	*extsubset = 0;
 5168|       |
 5169|       |    /*
 5170|       |     * Fetch the declaration for the qualified name
 5171|       |     */
 5172|   245k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL))
  ------------------
  |  Branch (5172:9): [True: 42.3k, False: 203k]
  |  Branch (5172:31): [True: 36.6k, False: 5.74k]
  ------------------
 5173|  36.6k|	prefix = elem->ns->prefix;
 5174|       |
 5175|   245k|    if (prefix != NULL) {
  ------------------
  |  Branch (5175:9): [True: 36.6k, False: 208k]
  ------------------
 5176|  36.6k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset,
 5177|  36.6k|		                         elem->name, prefix);
 5178|  36.6k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5178:6): [True: 33.5k, False: 3.09k]
  |  Branch (5178:28): [True: 2.61k, False: 30.9k]
  ------------------
 5179|  2.61k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset,
 5180|  2.61k|		                             elem->name, prefix);
 5181|  2.61k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5181:10): [True: 1.45k, False: 1.16k]
  |  Branch (5181:32): [True: 1.45k, False: 0]
  ------------------
 5182|  1.45k|		*extsubset = 1;
 5183|  2.61k|	}
 5184|  36.6k|    }
 5185|       |
 5186|       |    /*
 5187|       |     * Fetch the declaration for the non qualified name
 5188|       |     * This is "non-strict" validation should be done on the
 5189|       |     * full QName but in that case being flexible makes sense.
 5190|       |     */
 5191|   245k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5191:9): [True: 241k, False: 4.54k]
  ------------------
 5192|   241k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset, elem->name, NULL);
 5193|   241k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5193:6): [True: 160k, False: 80.8k]
  |  Branch (5193:28): [True: 6.10k, False: 154k]
  ------------------
 5194|  6.10k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset, elem->name, NULL);
 5195|  6.10k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5195:10): [True: 1.67k, False: 4.43k]
  |  Branch (5195:32): [True: 1.67k, False: 0]
  ------------------
 5196|  1.67k|		*extsubset = 1;
 5197|  6.10k|	}
 5198|   241k|    }
 5199|   245k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5199:9): [True: 158k, False: 87.1k]
  ------------------
 5200|   158k|	xmlErrValidNode(ctxt, elem,
 5201|   158k|			XML_DTD_UNKNOWN_ELEM,
 5202|   158k|	       "No declaration for element %s\n",
 5203|   158k|	       elem->name, NULL, NULL);
 5204|   158k|    }
 5205|   245k|    return(elemDecl);
 5206|   245k|}
valid.c:vstateVPush:
  216|   134k|vstateVPush(xmlValidCtxtPtr ctxt, xmlElementPtr elemDecl, xmlNodePtr node) {
  217|   134k|    if (ctxt->vstateNr >= ctxt->vstateMax) {
  ------------------
  |  Branch (217:9): [True: 8.50k, False: 125k]
  ------------------
  218|  8.50k|        xmlValidState *tmp;
  219|  8.50k|        int newSize;
  220|       |
  221|  8.50k|        newSize = xmlGrowCapacity(ctxt->vstateMax, sizeof(tmp[0]),
  222|  8.50k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  8.50k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  223|  8.50k|        if (newSize < 0) {
  ------------------
  |  Branch (223:13): [True: 0, False: 8.50k]
  ------------------
  224|      0|	    xmlVErrMemory(ctxt);
  225|      0|	    return(-1);
  226|      0|	}
  227|  8.50k|	tmp = xmlRealloc(ctxt->vstateTab, newSize * sizeof(tmp[0]));
  228|  8.50k|        if (tmp == NULL) {
  ------------------
  |  Branch (228:13): [True: 92, False: 8.41k]
  ------------------
  229|     92|	    xmlVErrMemory(ctxt);
  230|     92|	    return(-1);
  231|     92|	}
  232|  8.41k|	ctxt->vstateTab = tmp;
  233|  8.41k|	ctxt->vstateMax = newSize;
  234|  8.41k|    }
  235|   134k|    ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr];
  236|   134k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = elemDecl;
  237|   134k|    ctxt->vstateTab[ctxt->vstateNr].node = node;
  238|   134k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (238:9): [True: 48.3k, False: 85.6k]
  |  Branch (238:31): [True: 8.75k, False: 39.6k]
  ------------------
  239|  8.75k|	if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (239:6): [True: 1.46k, False: 7.29k]
  ------------------
  240|  1.46k|	    xmlValidBuildContentModel(ctxt, elemDecl);
  241|  8.75k|	if (elemDecl->contModel != NULL) {
  ------------------
  |  Branch (241:6): [True: 8.20k, False: 551]
  ------------------
  242|  8.20k|	    ctxt->vstateTab[ctxt->vstateNr].exec =
  243|  8.20k|		xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
  244|  8.20k|            if (ctxt->vstateTab[ctxt->vstateNr].exec == NULL) {
  ------------------
  |  Branch (244:17): [True: 20, False: 8.18k]
  ------------------
  245|     20|                xmlVErrMemory(ctxt);
  246|     20|                return(-1);
  247|     20|            }
  248|  8.20k|	} else {
  249|    551|	    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  250|    551|	    xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
  251|    551|	                    XML_ERR_INTERNAL_ERROR,
  252|    551|			    "Failed to build content model regexp for %s\n",
  253|    551|			    node->name, NULL, NULL);
  254|    551|	}
  255|  8.75k|    }
  256|   134k|    return(ctxt->vstateNr++);
  257|   134k|}
valid.c:vstateVPop:
  260|   134k|vstateVPop(xmlValidCtxtPtr ctxt) {
  261|   134k|    xmlElementPtr elemDecl;
  262|       |
  263|   134k|    if (ctxt->vstateNr < 1) return(-1);
  ------------------
  |  Branch (263:9): [True: 0, False: 134k]
  ------------------
  264|   134k|    ctxt->vstateNr--;
  265|   134k|    elemDecl = ctxt->vstateTab[ctxt->vstateNr].elemDecl;
  266|   134k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = NULL;
  267|   134k|    ctxt->vstateTab[ctxt->vstateNr].node = NULL;
  268|   134k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (268:9): [True: 48.3k, False: 85.6k]
  |  Branch (268:31): [True: 8.73k, False: 39.6k]
  ------------------
  269|  8.73k|	xmlRegFreeExecCtxt(ctxt->vstateTab[ctxt->vstateNr].exec);
  270|  8.73k|    }
  271|   134k|    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  272|   134k|    if (ctxt->vstateNr >= 1)
  ------------------
  |  Branch (272:9): [True: 130k, False: 3.17k]
  ------------------
  273|   130k|	ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr - 1];
  274|  3.17k|    else
  275|  3.17k|	ctxt->vstate = NULL;
  276|   134k|    return(ctxt->vstateNr);
  277|   134k|}
valid.c:xmlValidateOneCdataElement:
 5023|  2.10k|                           xmlNodePtr elem) {
 5024|  2.10k|    int ret = 1;
 5025|  2.10k|    xmlNodePtr cur, child;
 5026|       |
 5027|  2.10k|    if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) ||
  ------------------
  |  Branch (5027:9): [True: 0, False: 2.10k]
  |  Branch (5027:27): [True: 0, False: 2.10k]
  |  Branch (5027:44): [True: 0, False: 2.10k]
  ------------------
 5028|  2.10k|        (elem->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (5028:9): [True: 0, False: 2.10k]
  ------------------
 5029|      0|	return(0);
 5030|       |
 5031|  2.10k|    child = elem->children;
 5032|       |
 5033|  2.10k|    cur = child;
 5034|  30.4k|    while (cur != NULL) {
  ------------------
  |  Branch (5034:12): [True: 29.4k, False: 958]
  ------------------
 5035|  29.4k|	switch (cur->type) {
 5036|  11.6k|	    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5036:6): [True: 11.6k, False: 17.8k]
  ------------------
 5037|       |		/*
 5038|       |		 * Push the current node to be able to roll back
 5039|       |		 * and process within the entity
 5040|       |		 */
 5041|  11.6k|		if ((cur->children != NULL) &&
  ------------------
  |  Branch (5041:7): [True: 11.5k, False: 68]
  ------------------
 5042|  11.5k|		    (cur->children->children != NULL)) {
  ------------------
  |  Branch (5042:7): [True: 9.59k, False: 1.98k]
  ------------------
 5043|  9.59k|		    if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (5043:11): [True: 1, False: 9.59k]
  ------------------
 5044|      1|                        ret = 0;
 5045|      1|                        goto done;
 5046|      1|                    }
 5047|  9.59k|		    cur = cur->children->children;
 5048|  9.59k|		    continue;
 5049|  9.59k|		}
 5050|  2.04k|		break;
 5051|  2.04k|	    case XML_COMMENT_NODE:
  ------------------
  |  Branch (5051:6): [True: 412, False: 29.0k]
  ------------------
 5052|    946|	    case XML_PI_NODE:
  ------------------
  |  Branch (5052:6): [True: 534, False: 28.9k]
  ------------------
 5053|  14.4k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (5053:6): [True: 13.5k, False: 15.9k]
  ------------------
 5054|  16.6k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5054:6): [True: 2.21k, False: 27.2k]
  ------------------
 5055|  16.6k|		break;
 5056|  1.14k|	    default:
  ------------------
  |  Branch (5056:6): [True: 1.14k, False: 28.3k]
  ------------------
 5057|  1.14k|		ret = 0;
 5058|  1.14k|		goto done;
 5059|  29.4k|	}
 5060|       |	/*
 5061|       |	 * Switch to next element
 5062|       |	 */
 5063|  18.7k|	cur = cur->next;
 5064|  28.2k|	while (cur == NULL) {
  ------------------
  |  Branch (5064:9): [True: 10.0k, False: 18.2k]
  ------------------
 5065|  10.0k|	    cur = nodeVPop(ctxt);
 5066|  10.0k|	    if (cur == NULL)
  ------------------
  |  Branch (5066:10): [True: 510, False: 9.57k]
  ------------------
 5067|    510|		break;
 5068|  9.57k|	    cur = cur->next;
 5069|  9.57k|	}
 5070|  18.7k|    }
 5071|  2.10k|done:
 5072|  2.10k|    ctxt->nodeMax = 0;
 5073|  2.10k|    ctxt->nodeNr = 0;
 5074|  2.10k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5074:9): [True: 239, False: 1.86k]
  ------------------
 5075|    239|	xmlFree(ctxt->nodeTab);
 5076|       |	ctxt->nodeTab = NULL;
 5077|    239|    }
 5078|  2.10k|    return(ret);
 5079|  2.10k|}
valid.c:nodeVPush:
  374|  10.5k|{
  375|  10.5k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (375:9): [True: 861, False: 9.72k]
  ------------------
  376|    861|        xmlNodePtr *tmp;
  377|    861|        int newSize;
  378|       |
  379|    861|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
  380|    861|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    861|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  381|    861|        if (newSize < 0) {
  ------------------
  |  Branch (381:13): [True: 0, False: 861]
  ------------------
  382|      0|	    xmlVErrMemory(ctxt);
  383|      0|            return (-1);
  384|      0|        }
  385|    861|        tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
  386|    861|        if (tmp == NULL) {
  ------------------
  |  Branch (386:13): [True: 2, False: 859]
  ------------------
  387|      2|	    xmlVErrMemory(ctxt);
  388|      2|            return (-1);
  389|      2|        }
  390|    859|	ctxt->nodeTab = tmp;
  391|    859|        ctxt->nodeMax = newSize;
  392|    859|    }
  393|  10.5k|    ctxt->nodeTab[ctxt->nodeNr] = value;
  394|  10.5k|    ctxt->node = value;
  395|  10.5k|    return (ctxt->nodeNr++);
  396|  10.5k|}
valid.c:nodeVPop:
  399|  13.3k|{
  400|  13.3k|    xmlNodePtr ret;
  401|       |
  402|  13.3k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (402:9): [True: 2.83k, False: 10.4k]
  ------------------
  403|  2.83k|        return (NULL);
  404|  10.4k|    ctxt->nodeNr--;
  405|  10.4k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (405:9): [True: 9.75k, False: 719]
  ------------------
  406|  9.75k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
  407|    719|    else
  408|    719|        ctxt->node = NULL;
  409|  10.4k|    ret = ctxt->nodeTab[ctxt->nodeNr];
  410|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
  411|  10.4k|    return (ret);
  412|  13.3k|}
valid.c:xmlValidateElementContent:
 4720|  5.57k|       xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
 4721|  5.57k|    int ret = 1;
 4722|       |#ifndef  LIBXML_REGEXP_ENABLED
 4723|       |    xmlNodePtr repl = NULL, last = NULL, tmp;
 4724|       |#endif
 4725|  5.57k|    xmlNodePtr cur;
 4726|  5.57k|    xmlElementContentPtr cont;
 4727|  5.57k|    const xmlChar *name;
 4728|       |
 4729|  5.57k|    if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (4729:9): [True: 0, False: 5.57k]
  |  Branch (4729:31): [True: 0, False: 5.57k]
  |  Branch (4729:51): [True: 0, False: 5.57k]
  ------------------
 4730|      0|	return(-1);
 4731|  5.57k|    cont = elemDecl->content;
 4732|  5.57k|    name = elemDecl->name;
 4733|       |
 4734|  5.57k|#ifdef LIBXML_REGEXP_ENABLED
 4735|       |    /* Build the regexp associated to the content model */
 4736|  5.57k|    if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (4736:9): [True: 549, False: 5.02k]
  ------------------
 4737|    549|	ret = xmlValidBuildContentModel(ctxt, elemDecl);
 4738|  5.57k|    if (elemDecl->contModel == NULL) {
  ------------------
  |  Branch (4738:9): [True: 7, False: 5.56k]
  ------------------
 4739|      7|	return(-1);
 4740|  5.56k|    } else {
 4741|  5.56k|	xmlRegExecCtxtPtr exec;
 4742|       |
 4743|  5.56k|	if (!xmlRegexpIsDeterminist(elemDecl->contModel)) {
  ------------------
  |  Branch (4743:6): [True: 174, False: 5.39k]
  ------------------
 4744|    174|	    return(-1);
 4745|    174|	}
 4746|  5.39k|	ctxt->nodeMax = 0;
 4747|  5.39k|	ctxt->nodeNr = 0;
 4748|  5.39k|	ctxt->nodeTab = NULL;
 4749|  5.39k|	exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
 4750|  5.39k|	if (exec == NULL) {
  ------------------
  |  Branch (4750:6): [True: 4, False: 5.39k]
  ------------------
 4751|      4|            xmlVErrMemory(ctxt);
 4752|      4|            return(-1);
 4753|      4|        }
 4754|  5.39k|        cur = child;
 4755|  15.8k|        while (cur != NULL) {
  ------------------
  |  Branch (4755:16): [True: 11.5k, False: 4.29k]
  ------------------
 4756|  11.5k|            switch (cur->type) {
 4757|  4.65k|                case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4757:17): [True: 4.65k, False: 6.86k]
  ------------------
 4758|       |                    /*
 4759|       |                     * Push the current node to be able to roll back
 4760|       |                     * and process within the entity
 4761|       |                     */
 4762|  4.65k|                    if ((cur->children != NULL) &&
  ------------------
  |  Branch (4762:25): [True: 4.57k, False: 80]
  ------------------
 4763|  4.57k|                        (cur->children->children != NULL)) {
  ------------------
  |  Branch (4763:25): [True: 994, False: 3.58k]
  ------------------
 4764|    994|                        if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (4764:29): [True: 1, False: 993]
  ------------------
 4765|      1|                            ret = -1;
 4766|      1|                            goto fail;
 4767|      1|                        }
 4768|    993|                        cur = cur->children->children;
 4769|    993|                        continue;
 4770|    994|                    }
 4771|  3.66k|                    break;
 4772|  3.66k|                case XML_TEXT_NODE:
  ------------------
  |  Branch (4772:17): [True: 2.38k, False: 9.14k]
  ------------------
 4773|  2.38k|                    if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4773:25): [True: 1.32k, False: 1.05k]
  ------------------
 4774|  1.32k|                        break;
 4775|  1.05k|                    ret = 0;
 4776|  1.05k|                    goto fail;
 4777|     38|                case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4777:17): [True: 38, False: 11.4k]
  ------------------
 4778|       |                    /* TODO */
 4779|     38|                    ret = 0;
 4780|     38|                    goto fail;
 4781|  3.97k|                case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4781:17): [True: 3.97k, False: 7.54k]
  ------------------
 4782|  3.97k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4782:25): [True: 814, False: 3.16k]
  |  Branch (4782:46): [True: 379, False: 435]
  ------------------
 4783|    379|                        xmlChar fn[50];
 4784|    379|                        xmlChar *fullname;
 4785|       |
 4786|    379|                        fullname = xmlBuildQName(cur->name,
 4787|    379|                                                 cur->ns->prefix, fn, 50);
 4788|    379|                        if (fullname == NULL) {
  ------------------
  |  Branch (4788:29): [True: 1, False: 378]
  ------------------
 4789|      1|                            xmlVErrMemory(ctxt);
 4790|      1|                            ret = -1;
 4791|      1|                            goto fail;
 4792|      1|                        }
 4793|    378|                        ret = xmlRegExecPushString(exec, fullname, NULL);
 4794|    378|                        if ((fullname != fn) && (fullname != cur->name))
  ------------------
  |  Branch (4794:29): [True: 116, False: 262]
  |  Branch (4794:49): [True: 116, False: 0]
  ------------------
 4795|    116|                            xmlFree(fullname);
 4796|  3.59k|                    } else {
 4797|  3.59k|                        ret = xmlRegExecPushString(exec, cur->name, NULL);
 4798|  3.59k|                    }
 4799|  3.97k|                    break;
 4800|  3.97k|                default:
  ------------------
  |  Branch (4800:17): [True: 469, False: 11.0k]
  ------------------
 4801|    469|                    break;
 4802|  11.5k|            }
 4803|  9.43k|            if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  9.43k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4803:17): [True: 89, False: 9.34k]
  ------------------
 4804|     89|                xmlVErrMemory(ctxt);
 4805|       |            /*
 4806|       |             * Switch to next element
 4807|       |             */
 4808|  9.43k|            cur = cur->next;
 4809|  10.3k|            while (cur == NULL) {
  ------------------
  |  Branch (4809:20): [True: 3.22k, False: 7.11k]
  ------------------
 4810|  3.22k|                cur = nodeVPop(ctxt);
 4811|  3.22k|                if (cur == NULL)
  ------------------
  |  Branch (4811:21): [True: 2.32k, False: 905]
  ------------------
 4812|  2.32k|                    break;
 4813|    905|                cur = cur->next;
 4814|    905|            }
 4815|  9.43k|        }
 4816|  4.29k|        ret = xmlRegExecPushString(exec, NULL, NULL);
 4817|  4.29k|        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  4.29k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4817:13): [True: 3, False: 4.29k]
  ------------------
 4818|      3|            xmlVErrMemory(ctxt);
 4819|  5.39k|fail:
 4820|  5.39k|        xmlRegFreeExecCtxt(exec);
 4821|  5.39k|    }
 4822|       |#else  /* LIBXML_REGEXP_ENABLED */
 4823|       |    /*
 4824|       |     * Allocate the stack
 4825|       |     */
 4826|       |#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 4827|       |    ctxt->vstateMax = 8;
 4828|       |#else
 4829|       |    ctxt->vstateMax = 1;
 4830|       |#endif
 4831|       |    ctxt->vstateTab = xmlMalloc(ctxt->vstateMax * sizeof(ctxt->vstateTab[0]));
 4832|       |    if (ctxt->vstateTab == NULL) {
 4833|       |	xmlVErrMemory(ctxt);
 4834|       |	return(-1);
 4835|       |    }
 4836|       |    /*
 4837|       |     * The first entry in the stack is reserved to the current state
 4838|       |     */
 4839|       |    ctxt->nodeMax = 0;
 4840|       |    ctxt->nodeNr = 0;
 4841|       |    ctxt->nodeTab = NULL;
 4842|       |    ctxt->vstate = &ctxt->vstateTab[0];
 4843|       |    ctxt->vstateNr = 1;
 4844|       |    CONT = cont;
 4845|       |    NODE = child;
 4846|       |    DEPTH = 0;
 4847|       |    OCCURS = 0;
 4848|       |    STATE = 0;
 4849|       |    ret = xmlValidateElementType(ctxt);
 4850|       |    if ((ret == -3) && (warn)) {
 4851|       |	char expr[5000];
 4852|       |	expr[0] = 0;
 4853|       |	xmlSnprintfElementContent(expr, 5000, elemDecl->content, 1);
 4854|       |	xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
 4855|       |                XML_DTD_CONTENT_NOT_DETERMINIST,
 4856|       |	        "Content model of %s is not deterministic: %s\n",
 4857|       |	        name, BAD_CAST expr, NULL);
 4858|       |    } else if (ret == -2) {
 4859|       |	/*
 4860|       |	 * An entities reference appeared at this level.
 4861|       |	 * Build a minimal representation of this node content
 4862|       |	 * sufficient to run the validation process on it
 4863|       |	 */
 4864|       |	cur = child;
 4865|       |	while (cur != NULL) {
 4866|       |	    switch (cur->type) {
 4867|       |		case XML_ENTITY_REF_NODE:
 4868|       |		    /*
 4869|       |		     * Push the current node to be able to roll back
 4870|       |		     * and process within the entity
 4871|       |		     */
 4872|       |		    if ((cur->children != NULL) &&
 4873|       |			(cur->children->children != NULL)) {
 4874|       |			if (nodeVPush(ctxt, cur) < 0) {
 4875|       |                            xmlFreeNodeList(repl);
 4876|       |                            ret = -1;
 4877|       |                            goto done;
 4878|       |                        }
 4879|       |			cur = cur->children->children;
 4880|       |			continue;
 4881|       |		    }
 4882|       |		    break;
 4883|       |		case XML_TEXT_NODE:
 4884|       |		    if (xmlIsBlankNode(cur))
 4885|       |			break;
 4886|       |		    /* falls through */
 4887|       |		case XML_CDATA_SECTION_NODE:
 4888|       |		case XML_ELEMENT_NODE:
 4889|       |		    /*
 4890|       |		     * Allocate a new node and minimally fills in
 4891|       |		     * what's required
 4892|       |		     */
 4893|       |		    tmp = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 4894|       |		    if (tmp == NULL) {
 4895|       |			xmlVErrMemory(ctxt);
 4896|       |			xmlFreeNodeList(repl);
 4897|       |			ret = -1;
 4898|       |			goto done;
 4899|       |		    }
 4900|       |		    tmp->type = cur->type;
 4901|       |		    tmp->name = cur->name;
 4902|       |		    tmp->ns = cur->ns;
 4903|       |		    tmp->next = NULL;
 4904|       |		    tmp->content = NULL;
 4905|       |		    if (repl == NULL)
 4906|       |			repl = last = tmp;
 4907|       |		    else {
 4908|       |			last->next = tmp;
 4909|       |			last = tmp;
 4910|       |		    }
 4911|       |		    if (cur->type == XML_CDATA_SECTION_NODE) {
 4912|       |			/*
 4913|       |			 * E59 spaces in CDATA does not match the
 4914|       |			 * nonterminal S
 4915|       |			 */
 4916|       |			tmp->content = xmlStrdup(BAD_CAST "CDATA");
 4917|       |		    }
 4918|       |		    break;
 4919|       |		default:
 4920|       |		    break;
 4921|       |	    }
 4922|       |	    /*
 4923|       |	     * Switch to next element
 4924|       |	     */
 4925|       |	    cur = cur->next;
 4926|       |	    while (cur == NULL) {
 4927|       |		cur = nodeVPop(ctxt);
 4928|       |		if (cur == NULL)
 4929|       |		    break;
 4930|       |		cur = cur->next;
 4931|       |	    }
 4932|       |	}
 4933|       |
 4934|       |	/*
 4935|       |	 * Relaunch the validation
 4936|       |	 */
 4937|       |	ctxt->vstate = &ctxt->vstateTab[0];
 4938|       |	ctxt->vstateNr = 1;
 4939|       |	CONT = cont;
 4940|       |	NODE = repl;
 4941|       |	DEPTH = 0;
 4942|       |	OCCURS = 0;
 4943|       |	STATE = 0;
 4944|       |	ret = xmlValidateElementType(ctxt);
 4945|       |    }
 4946|       |#endif /* LIBXML_REGEXP_ENABLED */
 4947|  5.39k|    if ((warn) && ((ret != 1) && (ret != -3))) {
  ------------------
  |  Branch (4947:9): [True: 5.39k, False: 0]
  |  Branch (4947:20): [True: 4.43k, False: 956]
  |  Branch (4947:34): [True: 4.43k, False: 0]
  ------------------
 4948|  4.43k|	if (ctxt != NULL) {
  ------------------
  |  Branch (4948:6): [True: 4.43k, False: 0]
  ------------------
 4949|  4.43k|	    char expr[5000];
 4950|  4.43k|	    char list[5000];
 4951|       |
 4952|  4.43k|	    expr[0] = 0;
 4953|  4.43k|	    xmlSnprintfElementContent(&expr[0], 5000, cont, 1);
 4954|  4.43k|	    list[0] = 0;
 4955|       |#ifndef LIBXML_REGEXP_ENABLED
 4956|       |	    if (repl != NULL)
 4957|       |		xmlSnprintfElements(&list[0], 5000, repl, 1);
 4958|       |	    else
 4959|       |#endif /* LIBXML_REGEXP_ENABLED */
 4960|  4.43k|		xmlSnprintfElements(&list[0], 5000, child, 1);
 4961|       |
 4962|  4.43k|	    if (name != NULL) {
  ------------------
  |  Branch (4962:10): [True: 4.43k, False: 0]
  ------------------
 4963|  4.43k|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4964|  4.43k|	   "Element %s content does not follow the DTD, expecting %s, got %s\n",
 4965|  4.43k|		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  4.43k|#define BAD_CAST (xmlChar *)
  ------------------
              		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  4.43k|#define BAD_CAST (xmlChar *)
  ------------------
 4966|  4.43k|	    } else {
 4967|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4968|      0|	   "Element content does not follow the DTD, expecting %s, got %s\n",
 4969|      0|		       BAD_CAST expr, BAD_CAST list, NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
              		       BAD_CAST expr, BAD_CAST list, NULL);
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 4970|      0|	    }
 4971|  4.43k|	} else {
 4972|      0|	    if (name != NULL) {
  ------------------
  |  Branch (4972:10): [True: 0, False: 0]
  ------------------
 4973|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4974|      0|		       "Element %s content does not follow the DTD\n",
 4975|      0|		       name, NULL, NULL);
 4976|      0|	    } else {
 4977|      0|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4978|      0|		       "Element content does not follow the DTD\n",
 4979|      0|		                NULL, NULL, NULL);
 4980|      0|	    }
 4981|      0|	}
 4982|  4.43k|	ret = 0;
 4983|  4.43k|    }
 4984|  5.39k|    if (ret == -3)
  ------------------
  |  Branch (4984:9): [True: 0, False: 5.39k]
  ------------------
 4985|      0|	ret = 1;
 4986|       |
 4987|       |#ifndef  LIBXML_REGEXP_ENABLED
 4988|       |done:
 4989|       |    /*
 4990|       |     * Deallocate the copy if done, and free up the validation stack
 4991|       |     */
 4992|       |    while (repl != NULL) {
 4993|       |	tmp = repl->next;
 4994|       |	xmlFree(repl);
 4995|       |	repl = tmp;
 4996|       |    }
 4997|       |    ctxt->vstateMax = 0;
 4998|       |    if (ctxt->vstateTab != NULL) {
 4999|       |	xmlFree(ctxt->vstateTab);
 5000|       |	ctxt->vstateTab = NULL;
 5001|       |    }
 5002|       |#endif
 5003|  5.39k|    ctxt->nodeMax = 0;
 5004|  5.39k|    ctxt->nodeNr = 0;
 5005|  5.39k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5005:9): [True: 453, False: 4.93k]
  ------------------
 5006|    453|	xmlFree(ctxt->nodeTab);
 5007|    453|	ctxt->nodeTab = NULL;
 5008|    453|    }
 5009|  5.39k|    return(ret);
 5010|       |
 5011|  5.57k|}
valid.c:xmlSnprintfElements:
 4623|  4.43k|xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
 4624|  4.43k|    xmlNodePtr cur;
 4625|  4.43k|    int len;
 4626|       |
 4627|  4.43k|    if (node == NULL) return;
  ------------------
  |  Branch (4627:9): [True: 1.29k, False: 3.14k]
  ------------------
 4628|  3.14k|    len = strlen(buf);
 4629|  3.14k|    if (glob) {
  ------------------
  |  Branch (4629:9): [True: 3.14k, False: 0]
  ------------------
 4630|  3.14k|        if (size - len < 50) {
  ------------------
  |  Branch (4630:13): [True: 0, False: 3.14k]
  ------------------
 4631|      0|            if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4631:17): [True: 0, False: 0]
  |  Branch (4631:37): [True: 0, False: 0]
  ------------------
 4632|      0|                strcat(buf, " ...");
 4633|      0|            return;
 4634|      0|        }
 4635|  3.14k|        strcat(buf, "(");
 4636|  3.14k|    }
 4637|  3.14k|    cur = node;
 4638|  47.8k|    while (cur != NULL) {
  ------------------
  |  Branch (4638:12): [True: 44.7k, False: 3.06k]
  ------------------
 4639|  44.7k|	len = strlen(buf);
 4640|  44.7k|	if (size - len < 50) {
  ------------------
  |  Branch (4640:6): [True: 39, False: 44.7k]
  ------------------
 4641|     39|	    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4641:10): [True: 39, False: 0]
  |  Branch (4641:30): [True: 39, False: 0]
  ------------------
 4642|     39|		strcat(buf, " ...");
 4643|     39|	    return;
 4644|     39|	}
 4645|  44.7k|        switch (cur->type) {
  ------------------
  |  Branch (4645:17): [True: 44.7k, False: 0]
  ------------------
 4646|  5.20k|            case XML_ELEMENT_NODE: {
  ------------------
  |  Branch (4646:13): [True: 5.20k, False: 39.5k]
  ------------------
 4647|  5.20k|                int qnameLen = xmlStrlen(cur->name);
 4648|       |
 4649|  5.20k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL))
  ------------------
  |  Branch (4649:21): [True: 1.16k, False: 4.03k]
  |  Branch (4649:42): [True: 682, False: 487]
  ------------------
 4650|    682|                    qnameLen += xmlStrlen(cur->ns->prefix) + 1;
 4651|  5.20k|                if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (4651:21): [True: 35, False: 5.16k]
  ------------------
 4652|     35|                    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4652:25): [True: 35, False: 0]
  |  Branch (4652:45): [True: 35, False: 0]
  ------------------
 4653|     35|                        strcat(buf, " ...");
 4654|     35|                    return;
 4655|     35|                }
 4656|  5.16k|		if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4656:7): [True: 1.16k, False: 4.00k]
  |  Branch (4656:28): [True: 682, False: 487]
  ------------------
 4657|    682|		    strcat(buf, (char *) cur->ns->prefix);
 4658|    682|		    strcat(buf, ":");
 4659|    682|		}
 4660|  5.16k|                if (cur->name != NULL)
  ------------------
  |  Branch (4660:21): [True: 5.16k, False: 0]
  ------------------
 4661|  5.16k|	            strcat(buf, (char *) cur->name);
 4662|  5.16k|		if (cur->next != NULL)
  ------------------
  |  Branch (4662:7): [True: 3.64k, False: 1.52k]
  ------------------
 4663|  3.64k|		    strcat(buf, " ");
 4664|  5.16k|		break;
 4665|  5.20k|            }
 4666|  19.4k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (4666:13): [True: 19.4k, False: 25.2k]
  ------------------
 4667|  19.4k|		if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4667:7): [True: 1.00k, False: 18.4k]
  ------------------
 4668|  1.00k|		    break;
 4669|       |                /* Falls through. */
 4670|  25.3k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4670:13): [True: 6.86k, False: 37.8k]
  ------------------
 4671|  26.0k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4671:13): [True: 679, False: 44.0k]
  ------------------
 4672|  26.0k|	        strcat(buf, "CDATA");
 4673|  26.0k|		if (cur->next != NULL)
  ------------------
  |  Branch (4673:7): [True: 24.7k, False: 1.29k]
  ------------------
 4674|  24.7k|		    strcat(buf, " ");
 4675|  26.0k|		break;
 4676|      0|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4676:13): [True: 0, False: 44.7k]
  ------------------
 4677|      0|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4677:13): [True: 0, False: 44.7k]
  ------------------
 4678|      0|	    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (4678:6): [True: 0, False: 44.7k]
  ------------------
 4679|      0|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (4679:13): [True: 0, False: 44.7k]
  ------------------
 4680|      0|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (4680:13): [True: 0, False: 44.7k]
  ------------------
 4681|      0|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (4681:13): [True: 0, False: 44.7k]
  ------------------
 4682|      0|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4682:6): [True: 0, False: 44.7k]
  ------------------
 4683|      0|	        strcat(buf, "???");
 4684|      0|		if (cur->next != NULL)
  ------------------
  |  Branch (4684:7): [True: 0, False: 0]
  ------------------
 4685|      0|		    strcat(buf, " ");
 4686|      0|		break;
 4687|      0|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (4687:13): [True: 0, False: 44.7k]
  ------------------
 4688|    471|            case XML_PI_NODE:
  ------------------
  |  Branch (4688:13): [True: 471, False: 44.2k]
  ------------------
 4689|    471|            case XML_DTD_NODE:
  ------------------
  |  Branch (4689:13): [True: 0, False: 44.7k]
  ------------------
 4690|  12.5k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (4690:13): [True: 12.0k, False: 32.7k]
  ------------------
 4691|  12.5k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (4691:6): [True: 0, False: 44.7k]
  ------------------
 4692|  12.5k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (4692:6): [True: 0, False: 44.7k]
  ------------------
 4693|  12.5k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (4693:6): [True: 0, False: 44.7k]
  ------------------
 4694|  12.5k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (4694:6): [True: 0, False: 44.7k]
  ------------------
 4695|  12.5k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (4695:6): [True: 0, False: 44.7k]
  ------------------
 4696|  12.5k|		break;
 4697|  44.7k|	}
 4698|  44.7k|	cur = cur->next;
 4699|  44.7k|    }
 4700|  3.06k|    if (glob) {
  ------------------
  |  Branch (4700:9): [True: 3.06k, False: 0]
  ------------------
 4701|  3.06k|        len = strlen(buf);
 4702|  3.06k|        if (size - len > 1)
  ------------------
  |  Branch (4702:13): [True: 3.06k, False: 0]
  ------------------
 4703|  3.06k|            strcat(buf, ")");
 4704|  3.06k|    }
 4705|  3.06k|}
valid.c:xmlValidateCheckRefCallback:
 5974|    254|xmlValidateCheckRefCallback(void *payload, void *data, const xmlChar *name) {
 5975|    254|    xmlListPtr ref_list = (xmlListPtr) payload;
 5976|    254|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 5977|    254|    xmlValidateMemo memo;
 5978|       |
 5979|    254|    if (ref_list == NULL)
  ------------------
  |  Branch (5979:9): [True: 0, False: 254]
  ------------------
 5980|      0|	return;
 5981|    254|    memo.ctxt = ctxt;
 5982|    254|    memo.name = name;
 5983|       |
 5984|    254|    xmlListWalk(ref_list, xmlWalkValidateList, &memo);
 5985|       |
 5986|    254|}
valid.c:xmlWalkValidateList:
 5962|  4.03k|{
 5963|  4.03k|	xmlValidateMemoPtr memo = (xmlValidateMemoPtr)user;
 5964|  4.03k|	xmlValidateRef((xmlRefPtr)data, memo->ctxt, memo->name);
 5965|  4.03k|	return 1;
 5966|  4.03k|}
valid.c:xmlValidateRef:
 5880|  4.03k|	                   const xmlChar *name) {
 5881|  4.03k|    xmlAttrPtr id;
 5882|  4.03k|    xmlAttrPtr attr;
 5883|       |
 5884|  4.03k|    if (ref == NULL)
  ------------------
  |  Branch (5884:9): [True: 0, False: 4.03k]
  ------------------
 5885|      0|	return;
 5886|  4.03k|    if ((ref->attr == NULL) && (ref->name == NULL))
  ------------------
  |  Branch (5886:9): [True: 1.09k, False: 2.94k]
  |  Branch (5886:32): [True: 0, False: 1.09k]
  ------------------
 5887|      0|	return;
 5888|  4.03k|    attr = ref->attr;
 5889|  4.03k|    if (attr == NULL) {
  ------------------
  |  Branch (5889:9): [True: 1.09k, False: 2.94k]
  ------------------
 5890|  1.09k|	xmlChar *dup, *str = NULL, *cur, save;
 5891|       |
 5892|  1.09k|	dup = xmlStrdup(name);
 5893|  1.09k|	if (dup == NULL) {
  ------------------
  |  Branch (5893:6): [True: 3, False: 1.08k]
  ------------------
 5894|      3|            xmlVErrMemory(ctxt);
 5895|      3|	    return;
 5896|      3|	}
 5897|  1.08k|	cur = dup;
 5898|  2.76k|	while (*cur != 0) {
  ------------------
  |  Branch (5898:9): [True: 2.39k, False: 369]
  ------------------
 5899|  2.39k|	    str = cur;
 5900|  12.8k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  12.1k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  12.1k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.37k, False: 10.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|  12.1k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 10.7k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 220, False: 10.5k]
  |  |  |  |  ------------------
  |  |  |  |   92|  12.1k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 83, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5900:13): [True: 12.1k, False: 719]
  ------------------
 5901|  2.39k|	    save = *cur;
 5902|  2.39k|	    *cur = 0;
 5903|  2.39k|	    id = xmlGetID(ctxt->doc, str);
 5904|  2.39k|	    if (id == NULL) {
  ------------------
  |  Branch (5904:10): [True: 2.02k, False: 368]
  ------------------
 5905|  2.02k|		xmlErrValidNodeNr(ctxt, NULL, XML_DTD_UNKNOWN_ID,
 5906|  2.02k|	   "attribute %s line %d references an unknown ID \"%s\"\n",
 5907|  2.02k|		       ref->name, ref->lineno, str);
 5908|  2.02k|		ctxt->valid = 0;
 5909|  2.02k|	    }
 5910|  2.39k|	    if (save == 0)
  ------------------
  |  Branch (5910:10): [True: 719, False: 1.67k]
  ------------------
 5911|    719|		break;
 5912|  1.67k|	    *cur = save;
 5913|  2.22k|	    while (IS_BLANK_CH(*cur)) cur++;
 5914|  1.67k|	}
 5915|  1.08k|	xmlFree(dup);
 5916|  2.94k|    } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
  ------------------
  |  Branch (5916:16): [True: 2.61k, False: 324]
  ------------------
 5917|  2.61k|	id = xmlGetID(ctxt->doc, name);
 5918|  2.61k|	if (id == NULL) {
  ------------------
  |  Branch (5918:6): [True: 503, False: 2.11k]
  ------------------
 5919|    503|	    xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5920|    503|	   "IDREF attribute %s references an unknown ID \"%s\"\n",
 5921|    503|		   attr->name, name, NULL);
 5922|    503|	    ctxt->valid = 0;
 5923|    503|	}
 5924|  2.61k|    } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
  ------------------
  |  Branch (5924:16): [True: 324, False: 0]
  ------------------
 5925|    324|	xmlChar *dup, *str = NULL, *cur, save;
 5926|       |
 5927|    324|	dup = xmlStrdup(name);
 5928|    324|	if (dup == NULL) {
  ------------------
  |  Branch (5928:6): [True: 1, False: 323]
  ------------------
 5929|      1|	    xmlVErrMemory(ctxt);
 5930|      1|	    ctxt->valid = 0;
 5931|      1|	    return;
 5932|      1|	}
 5933|    323|	cur = dup;
 5934|  1.50k|	while (*cur != 0) {
  ------------------
  |  Branch (5934:9): [True: 1.46k, False: 48]
  ------------------
 5935|  1.46k|	    str = cur;
 5936|  8.86k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  8.59k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  8.59k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 923, False: 7.67k]
  |  |  |  |  ------------------
  |  |  |  |   91|  8.59k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 7.67k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 200, False: 7.47k]
  |  |  |  |  ------------------
  |  |  |  |   92|  8.59k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 63, False: 7.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5936:13): [True: 8.59k, False: 275]
  ------------------
 5937|  1.46k|	    save = *cur;
 5938|  1.46k|	    *cur = 0;
 5939|  1.46k|	    id = xmlGetID(ctxt->doc, str);
 5940|  1.46k|	    if (id == NULL) {
  ------------------
  |  Branch (5940:10): [True: 1.46k, False: 0]
  ------------------
 5941|  1.46k|		xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5942|  1.46k|	   "IDREFS attribute %s references an unknown ID \"%s\"\n",
 5943|  1.46k|			     attr->name, str, NULL);
 5944|  1.46k|		ctxt->valid = 0;
 5945|  1.46k|	    }
 5946|  1.46k|	    if (save == 0)
  ------------------
  |  Branch (5946:10): [True: 275, False: 1.18k]
  ------------------
 5947|    275|		break;
 5948|  1.18k|	    *cur = save;
 5949|  1.73k|	    while (IS_BLANK_CH(*cur)) cur++;
 5950|  1.18k|	}
 5951|    323|	xmlFree(dup);
 5952|    323|    }
 5953|  4.03k|}
valid.c:xmlValidateAttributeCallback:
 6150|  13.0k|	                     const xmlChar *name ATTRIBUTE_UNUSED) {
 6151|  13.0k|    xmlAttributePtr cur = (xmlAttributePtr) payload;
 6152|  13.0k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6153|  13.0k|    xmlDocPtr doc;
 6154|  13.0k|    xmlElementPtr elem = NULL;
 6155|       |
 6156|  13.0k|    if (cur == NULL)
  ------------------
  |  Branch (6156:9): [True: 0, False: 13.0k]
  ------------------
 6157|      0|	return;
 6158|  13.0k|    if (cur->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (6158:9): [True: 210, False: 12.8k]
  ------------------
 6159|    210|        const xmlChar *elemLocalName;
 6160|    210|        xmlChar *elemPrefix;
 6161|       |
 6162|    210|	doc = cur->doc;
 6163|    210|	if (cur->elem == NULL) {
  ------------------
  |  Branch (6163:6): [True: 0, False: 210]
  ------------------
 6164|      0|	    xmlErrValid(ctxt, XML_ERR_INTERNAL_ERROR,
 6165|      0|		   "xmlValidateAttributeCallback(%s): internal error\n",
 6166|      0|		   (const char *) cur->name);
 6167|      0|	    return;
 6168|      0|	}
 6169|       |
 6170|    210|        elemLocalName = xmlSplitQName4(cur->elem, &elemPrefix);
 6171|    210|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (6171:13): [True: 1, False: 209]
  ------------------
 6172|      1|            xmlVErrMemory(ctxt);
 6173|      1|            return;
 6174|      1|        }
 6175|       |
 6176|    209|	if ((doc != NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (6176:6): [True: 209, False: 0]
  |  Branch (6176:23): [True: 209, False: 0]
  ------------------
 6177|    209|	    elem = xmlHashLookup2(doc->intSubset->elements,
 6178|    209|                                  elemLocalName, elemPrefix);
 6179|    209|	if ((elem == NULL) && (doc != NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (6179:6): [True: 59, False: 150]
  |  Branch (6179:24): [True: 59, False: 0]
  |  Branch (6179:41): [True: 59, False: 0]
  ------------------
 6180|     59|	    elem = xmlHashLookup2(doc->extSubset->elements,
 6181|     59|                                  elemLocalName, elemPrefix);
 6182|    209|	if ((elem == NULL) && (cur->parent != NULL) &&
  ------------------
  |  Branch (6182:6): [True: 0, False: 209]
  |  Branch (6182:24): [True: 0, False: 0]
  ------------------
 6183|      0|	    (cur->parent->type == XML_DTD_NODE))
  ------------------
  |  Branch (6183:6): [True: 0, False: 0]
  ------------------
 6184|      0|	    elem = xmlHashLookup2(((xmlDtdPtr) cur->parent)->elements,
 6185|      0|                                  elemLocalName, elemPrefix);
 6186|       |
 6187|    209|        xmlFree(elemPrefix);
 6188|       |
 6189|    209|	if (elem == NULL) {
  ------------------
  |  Branch (6189:6): [True: 0, False: 209]
  ------------------
 6190|      0|	    xmlErrValidNode(ctxt, NULL, XML_DTD_UNKNOWN_ELEM,
 6191|      0|		   "attribute %s: could not find decl for element %s\n",
 6192|      0|		   cur->name, cur->elem, NULL);
 6193|      0|	    return;
 6194|      0|	}
 6195|    209|	if (elem->etype == XML_ELEMENT_TYPE_EMPTY) {
  ------------------
  |  Branch (6195:6): [True: 18, False: 191]
  ------------------
 6196|     18|	    xmlErrValidNode(ctxt, NULL, XML_DTD_EMPTY_NOTATION,
 6197|     18|		   "NOTATION attribute %s declared for EMPTY element %s\n",
 6198|       |		   cur->name, cur->elem, NULL);
 6199|     18|	    ctxt->valid = 0;
 6200|     18|	}
 6201|    209|    }
 6202|  13.0k|}
valid.c:xmlValidateNotationCallback:
 6129|  4.73k|	                    const xmlChar *name ATTRIBUTE_UNUSED) {
 6130|  4.73k|    xmlEntityPtr cur = (xmlEntityPtr) payload;
 6131|  4.73k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6132|  4.73k|    if (cur == NULL)
  ------------------
  |  Branch (6132:9): [True: 0, False: 4.73k]
  ------------------
 6133|      0|	return;
 6134|  4.73k|    if (cur->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (6134:9): [True: 138, False: 4.59k]
  ------------------
 6135|    138|	xmlChar *notation = cur->content;
 6136|       |
 6137|    138|	if (notation != NULL) {
  ------------------
  |  Branch (6137:6): [True: 116, False: 22]
  ------------------
 6138|    116|	    int ret;
 6139|       |
 6140|    116|	    ret = xmlValidateNotationUse(ctxt, cur->doc, notation);
 6141|    116|	    if (ret != 1) {
  ------------------
  |  Branch (6141:10): [True: 106, False: 10]
  ------------------
 6142|    106|		ctxt->valid = 0;
 6143|    106|	    }
 6144|    116|	}
 6145|    138|    }
 6146|  4.73k|}

xmlXIncludeNewContext:
  258|  9.66k|xmlXIncludeNewContext(xmlDoc *doc) {
  259|  9.66k|    xmlXIncludeCtxtPtr ret;
  260|       |
  261|  9.66k|    if (doc == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 9.66k]
  ------------------
  262|      0|	return(NULL);
  263|  9.66k|    ret = (xmlXIncludeCtxtPtr) xmlMalloc(sizeof(xmlXIncludeCtxt));
  264|  9.66k|    if (ret == NULL)
  ------------------
  |  Branch (264:9): [True: 1, False: 9.66k]
  ------------------
  265|      1|	return(NULL);
  266|  9.66k|    memset(ret, 0, sizeof(xmlXIncludeCtxt));
  267|  9.66k|    ret->doc = doc;
  268|  9.66k|    ret->incNr = 0;
  269|  9.66k|    ret->incMax = 0;
  270|       |    ret->incTab = NULL;
  271|  9.66k|    ret->nbErrors = 0;
  272|  9.66k|    return(ret);
  273|  9.66k|}
xmlXIncludeFreeContext:
  281|  9.66k|xmlXIncludeFreeContext(xmlXIncludeCtxt *ctxt) {
  282|  9.66k|    int i;
  283|       |
  284|  9.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (284:9): [True: 0, False: 9.66k]
  ------------------
  285|      0|	return;
  286|  9.66k|    if (ctxt->urlTab != NULL) {
  ------------------
  |  Branch (286:9): [True: 9.24k, False: 416]
  ------------------
  287|  20.0k|	for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (287:14): [True: 10.7k, False: 9.24k]
  ------------------
  288|  10.7k|	    xmlFreeDoc(ctxt->urlTab[i].doc);
  289|  10.7k|	    xmlFree(ctxt->urlTab[i].url);
  290|  10.7k|	}
  291|  9.24k|	xmlFree(ctxt->urlTab);
  292|  9.24k|    }
  293|  9.66k|    for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (293:16): [True: 0, False: 9.66k]
  ------------------
  294|      0|	if (ctxt->incTab[i] != NULL)
  ------------------
  |  Branch (294:6): [True: 0, False: 0]
  ------------------
  295|      0|	    xmlXIncludeFreeRef(ctxt->incTab[i]);
  296|      0|    }
  297|  9.66k|    if (ctxt->incTab != NULL)
  ------------------
  |  Branch (297:9): [True: 9.57k, False: 87]
  ------------------
  298|  9.57k|	xmlFree(ctxt->incTab);
  299|  9.66k|    if (ctxt->txtTab != NULL) {
  ------------------
  |  Branch (299:9): [True: 80, False: 9.58k]
  ------------------
  300|    158|	for (i = 0;i < ctxt->txtNr;i++) {
  ------------------
  |  Branch (300:13): [True: 78, False: 80]
  ------------------
  301|     78|	    xmlFree(ctxt->txtTab[i].text);
  302|     78|	    xmlFree(ctxt->txtTab[i].url);
  303|     78|	}
  304|     80|	xmlFree(ctxt->txtTab);
  305|     80|    }
  306|  9.66k|#ifdef LIBXML_XPTR_ENABLED
  307|  9.66k|    if (ctxt->xpctxt != NULL)
  ------------------
  |  Branch (307:9): [True: 7.74k, False: 1.92k]
  ------------------
  308|  7.74k|	xmlXPathFreeContext(ctxt->xpctxt);
  309|  9.66k|#endif
  310|  9.66k|    xmlFree(ctxt);
  311|  9.66k|}
xmlXIncludeGetLastError:
 1978|  14.0k|xmlXIncludeGetLastError(xmlXIncludeCtxt *ctxt) {
 1979|  14.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 14.0k]
  ------------------
 1980|      0|        return(XML_ERR_ARGUMENT);
 1981|  14.0k|    return(ctxt->errNo);
 1982|  14.0k|}
xmlXIncludeSetErrorHandler:
 1995|  9.66k|                           xmlStructuredErrorFunc handler, void *data) {
 1996|  9.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (1996:9): [True: 0, False: 9.66k]
  ------------------
 1997|      0|        return;
 1998|  9.66k|    ctxt->errorHandler = handler;
 1999|  9.66k|    ctxt->errorCtxt = data;
 2000|  9.66k|}
xmlXIncludeSetResourceLoader:
 2013|  9.66k|                             xmlResourceLoader loader, void *data) {
 2014|  9.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (2014:9): [True: 0, False: 9.66k]
  ------------------
 2015|      0|        return;
 2016|  9.66k|    ctxt->resourceLoader = loader;
 2017|  9.66k|    ctxt->resourceCtxt = data;
 2018|  9.66k|}
xmlXIncludeSetFlags:
 2028|  9.66k|xmlXIncludeSetFlags(xmlXIncludeCtxt *ctxt, int flags) {
 2029|  9.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (2029:9): [True: 0, False: 9.66k]
  ------------------
 2030|      0|        return(-1);
 2031|  9.66k|    ctxt->parseFlags = flags;
 2032|  9.66k|    return(0);
 2033|  9.66k|}
xmlXIncludeSetStreamingMode:
 2043|  9.66k|xmlXIncludeSetStreamingMode(xmlXIncludeCtxt *ctxt, int mode) {
 2044|  9.66k|    if (ctxt == NULL)
  ------------------
  |  Branch (2044:9): [True: 0, False: 9.66k]
  ------------------
 2045|      0|        return(-1);
 2046|  9.66k|    ctxt->isStream = !!mode;
 2047|  9.66k|    return(0);
 2048|  9.66k|}
xmlXIncludeProcessNode:
 2180|  16.8k|xmlXIncludeProcessNode(xmlXIncludeCtxt *ctxt, xmlNode *node) {
 2181|  16.8k|    int ret = 0;
 2182|       |
 2183|  16.8k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2183:9): [True: 0, False: 16.8k]
  |  Branch (2183:27): [True: 0, False: 16.8k]
  ------------------
 2184|  16.8k|        (node->doc == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (2184:9): [True: 0, False: 16.8k]
  |  Branch (2184:32): [True: 0, False: 16.8k]
  ------------------
 2185|      0|	return(-1);
 2186|  16.8k|    ret = xmlXIncludeDoProcessRoot(ctxt, node);
 2187|  16.8k|    if ((ret >= 0) && (ctxt->nbErrors > 0))
  ------------------
  |  Branch (2187:9): [True: 16.8k, False: 0]
  |  Branch (2187:23): [True: 14.0k, False: 2.74k]
  ------------------
 2188|  14.0k|	ret = -1;
 2189|  16.8k|    return(ret);
 2190|  16.8k|}
xinclude.c:xmlXIncludeFreeRef:
  239|  44.3k|xmlXIncludeFreeRef(xmlXIncludeRefPtr ref) {
  240|  44.3k|    if (ref == NULL)
  ------------------
  |  Branch (240:9): [True: 22.8k, False: 21.4k]
  ------------------
  241|  22.8k|	return;
  242|  21.4k|    if (ref->URI != NULL)
  ------------------
  |  Branch (242:9): [True: 21.4k, False: 0]
  ------------------
  243|  21.4k|	xmlFree(ref->URI);
  244|  21.4k|    if (ref->fragment != NULL)
  ------------------
  |  Branch (244:9): [True: 13.6k, False: 7.83k]
  ------------------
  245|  13.6k|	xmlFree(ref->fragment);
  246|  21.4k|    if (ref->base != NULL)
  ------------------
  |  Branch (246:9): [True: 11.3k, False: 10.1k]
  ------------------
  247|  11.3k|	xmlFree(ref->base);
  248|  21.4k|    xmlFree(ref);
  249|  21.4k|}
xinclude.c:xmlXIncludeDoProcessRoot:
 1962|  16.8k|xmlXIncludeDoProcessRoot(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1963|  16.8k|    if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1963:9): [True: 0, False: 16.8k]
  |  Branch (1963:27): [True: 0, False: 16.8k]
  ------------------
 1964|      0|	return(-1);
 1965|  16.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (1965:9): [True: 0, False: 16.8k]
  ------------------
 1966|      0|	return(-1);
 1967|       |
 1968|  16.8k|    return(xmlXIncludeDoProcess(ctxt, tree));
 1969|  16.8k|}
xinclude.c:xmlXIncludeDoProcess:
 1881|  25.3k|xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1882|  25.3k|    xmlXIncludeRefPtr ref;
 1883|  25.3k|    xmlNodePtr cur;
 1884|  25.3k|    int ret = 0;
 1885|  25.3k|    int i, start;
 1886|       |
 1887|       |    /*
 1888|       |     * First phase: lookup the elements in the document
 1889|       |     */
 1890|  25.3k|    start = ctxt->incNr;
 1891|  25.3k|    cur = tree;
 1892|   915k|    do {
 1893|       |	/* TODO: need to work on entities -> stack */
 1894|   915k|        if (xmlXIncludeTestNode(ctxt, cur) == 1) {
  ------------------
  |  Branch (1894:13): [True: 24.4k, False: 891k]
  ------------------
 1895|  24.4k|            ref = xmlXIncludeExpandNode(ctxt, cur);
 1896|       |            /*
 1897|       |             * Mark direct includes.
 1898|       |             */
 1899|  24.4k|            if (ref != NULL)
  ------------------
  |  Branch (1899:17): [True: 21.0k, False: 3.45k]
  ------------------
 1900|  21.0k|                ref->replace = 1;
 1901|   891k|        } else if ((cur->children != NULL) &&
  ------------------
  |  Branch (1901:20): [True: 109k, False: 782k]
  ------------------
 1902|   109k|                   ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1902:21): [True: 0, False: 109k]
  ------------------
 1903|   109k|                    (cur->type == XML_ELEMENT_NODE))) {
  ------------------
  |  Branch (1903:21): [True: 108k, False: 277]
  ------------------
 1904|   108k|            cur = cur->children;
 1905|   108k|            continue;
 1906|   108k|        }
 1907|   915k|        do {
 1908|   915k|            if (cur == tree)
  ------------------
  |  Branch (1908:17): [True: 25.3k, False: 890k]
  ------------------
 1909|  25.3k|                break;
 1910|   890k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1910:17): [True: 781k, False: 108k]
  ------------------
 1911|   781k|                cur = cur->next;
 1912|   781k|                break;
 1913|   781k|            }
 1914|   108k|            cur = cur->parent;
 1915|   108k|        } while (cur != NULL);
  ------------------
  |  Branch (1915:18): [True: 108k, False: 0]
  ------------------
 1916|   915k|    } while ((cur != NULL) && (cur != tree));
  ------------------
  |  Branch (1916:14): [True: 915k, False: 0]
  |  Branch (1916:31): [True: 890k, False: 25.3k]
  ------------------
 1917|       |
 1918|       |    /*
 1919|       |     * Second phase: extend the original document infoset.
 1920|       |     */
 1921|  46.8k|    for (i = start; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1921:21): [True: 21.4k, False: 25.3k]
  ------------------
 1922|  21.4k|	if (ctxt->incTab[i]->replace != 0) {
  ------------------
  |  Branch (1922:6): [True: 21.0k, False: 446]
  ------------------
 1923|  21.0k|            xmlXIncludeIncludeNode(ctxt, ctxt->incTab[i]);
 1924|  21.0k|            ctxt->incTab[i]->replace = 0;
 1925|  21.0k|        } else {
 1926|       |            /*
 1927|       |             * Ignore includes which were added indirectly, for example
 1928|       |             * inside xi:fallback elements.
 1929|       |             */
 1930|    446|            if (ctxt->incTab[i]->inc != NULL) {
  ------------------
  |  Branch (1930:17): [True: 281, False: 165]
  ------------------
 1931|    281|                xmlFreeNodeList(ctxt->incTab[i]->inc);
 1932|    281|                ctxt->incTab[i]->inc = NULL;
 1933|    281|            }
 1934|    446|        }
 1935|  21.4k|	ret++;
 1936|  21.4k|    }
 1937|       |
 1938|  25.3k|    if (ctxt->isStream) {
  ------------------
  |  Branch (1938:9): [True: 16.8k, False: 8.55k]
  ------------------
 1939|       |        /*
 1940|       |         * incTab references nodes which will eventually be deleted in
 1941|       |         * streaming mode. The table is only required for XPointer
 1942|       |         * expressions which aren't allowed in streaming mode.
 1943|       |         */
 1944|  32.4k|        for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (1944:20): [True: 15.6k, False: 16.8k]
  ------------------
 1945|  15.6k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
 1946|  15.6k|        }
 1947|  16.8k|        ctxt->incNr = 0;
 1948|  16.8k|    }
 1949|       |
 1950|  25.3k|    return(ret);
 1951|  25.3k|}
xinclude.c:xmlXIncludeTestNode:
 1811|   915k|xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1812|   915k|    if (node == NULL)
  ------------------
  |  Branch (1812:9): [True: 0, False: 915k]
  ------------------
 1813|      0|	return(0);
 1814|   915k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1814:9): [True: 515k, False: 399k]
  ------------------
 1815|   515k|	return(0);
 1816|   399k|    if (node->ns == NULL)
  ------------------
  |  Branch (1816:9): [True: 305k, False: 94.2k]
  ------------------
 1817|   305k|	return(0);
 1818|  94.2k|    if ((xmlStrEqual(node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  94.2k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1818:9): [True: 10.9k, False: 83.3k]
  ------------------
 1819|  83.3k|        (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS))) {
  ------------------
  |  |   34|  83.3k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1819:9): [True: 19.8k, False: 63.4k]
  ------------------
 1820|  30.8k|	if (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS)) {
  ------------------
  |  |   34|  30.8k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1820:6): [True: 19.8k, False: 10.9k]
  ------------------
 1821|  19.8k|	    if (ctxt->legacy == 0) {
  ------------------
  |  Branch (1821:10): [True: 6.04k, False: 13.7k]
  ------------------
 1822|  6.04k|	        ctxt->legacy = 1;
 1823|  6.04k|	    }
 1824|  19.8k|	}
 1825|  30.8k|	if (xmlStrEqual(node->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  30.8k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1825:6): [True: 25.4k, False: 5.32k]
  ------------------
 1826|  25.4k|	    xmlNodePtr child = node->children;
 1827|  25.4k|	    int nb_fallback = 0;
 1828|       |
 1829|  55.6k|	    while (child != NULL) {
  ------------------
  |  Branch (1829:13): [True: 30.7k, False: 24.9k]
  ------------------
 1830|  30.7k|		if ((child->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1830:7): [True: 14.1k, False: 16.6k]
  ------------------
 1831|  14.1k|		    (child->ns != NULL) &&
  ------------------
  |  Branch (1831:7): [True: 12.4k, False: 1.71k]
  ------------------
 1832|  12.4k|		    ((xmlStrEqual(child->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  12.4k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1832:8): [True: 4.27k, False: 8.15k]
  ------------------
 1833|  12.0k|		     (xmlStrEqual(child->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  8.15k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1833:8): [True: 7.80k, False: 351]
  ------------------
 1834|  12.0k|		    if (xmlStrEqual(child->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  12.0k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1834:11): [True: 562, False: 11.5k]
  ------------------
 1835|    562|			xmlXIncludeErr(ctxt, node,
 1836|    562|			               XML_XINCLUDE_INCLUDE_IN_INCLUDE,
 1837|    562|				       "%s has an 'include' child\n",
 1838|    562|				       XINCLUDE_NODE);
  ------------------
  |  |   38|    562|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1839|    562|			return(0);
 1840|    562|		    }
 1841|  11.5k|		    if (xmlStrEqual(child->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  11.5k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1841:11): [True: 1.37k, False: 10.1k]
  ------------------
 1842|  1.37k|			nb_fallback++;
 1843|  1.37k|		    }
 1844|  11.5k|		}
 1845|  30.2k|		child = child->next;
 1846|  30.2k|	    }
 1847|  24.9k|	    if (nb_fallback > 1) {
  ------------------
  |  Branch (1847:10): [True: 436, False: 24.4k]
  ------------------
 1848|    436|		xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE,
 1849|    436|			       "%s has multiple fallback children\n",
 1850|    436|		               XINCLUDE_NODE);
  ------------------
  |  |   38|    436|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1851|    436|		return(0);
 1852|    436|	    }
 1853|  24.4k|	    return(1);
 1854|  24.9k|	}
 1855|  5.32k|	if (xmlStrEqual(node->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  5.32k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1855:6): [True: 2.02k, False: 3.29k]
  ------------------
 1856|  2.02k|	    if ((node->parent == NULL) ||
  ------------------
  |  Branch (1856:10): [True: 0, False: 2.02k]
  ------------------
 1857|  2.02k|		(node->parent->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (1857:3): [True: 6, False: 2.02k]
  ------------------
 1858|  2.02k|		(node->parent->ns == NULL) ||
  ------------------
  |  Branch (1858:3): [True: 292, False: 1.73k]
  ------------------
 1859|  1.73k|		((!xmlStrEqual(node->parent->ns->href, XINCLUDE_NS)) &&
  ------------------
  |  |   30|  1.73k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1859:4): [True: 1.32k, False: 411]
  ------------------
 1860|  1.32k|		 (!xmlStrEqual(node->parent->ns->href, XINCLUDE_OLD_NS))) ||
  ------------------
  |  |   34|  1.32k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1860:4): [True: 203, False: 1.11k]
  ------------------
 1861|  1.52k|		(!xmlStrEqual(node->parent->name, XINCLUDE_NODE))) {
  ------------------
  |  |   38|  1.52k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1861:3): [True: 404, False: 1.12k]
  ------------------
 1862|    905|		xmlXIncludeErr(ctxt, node,
 1863|    905|		               XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE,
 1864|    905|			       "%s is not the child of an 'include'\n",
 1865|    905|			       XINCLUDE_FALLBACK);
  ------------------
  |  |   42|    905|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
 1866|    905|	    }
 1867|  2.02k|	}
 1868|  5.32k|    }
 1869|  68.8k|    return(0);
 1870|  94.2k|}
xinclude.c:xmlXIncludeErr:
  161|  28.2k|{
  162|  28.2k|    xmlStructuredErrorFunc schannel = NULL;
  163|  28.2k|    xmlGenericErrorFunc channel = NULL;
  164|  28.2k|    void *data = NULL;
  165|  28.2k|    int res;
  166|       |
  167|  28.2k|    if (error == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (167:9): [True: 159, False: 28.1k]
  ------------------
  168|    159|        xmlXIncludeErrMemory(ctxt);
  169|    159|        return;
  170|    159|    }
  171|       |
  172|  28.1k|    if (ctxt->fatalErr != 0)
  ------------------
  |  Branch (172:9): [True: 7.26k, False: 20.8k]
  ------------------
  173|  7.26k|        return;
  174|  20.8k|    ctxt->nbErrors++;
  175|       |
  176|  20.8k|    schannel = ctxt->errorHandler;
  177|  20.8k|    data = ctxt->errorCtxt;
  178|       |
  179|  20.8k|    if (schannel == NULL) {
  ------------------
  |  Branch (179:9): [True: 0, False: 20.8k]
  ------------------
  180|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  181|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  182|      0|    }
  183|       |
  184|  20.8k|    res = xmlRaiseError(schannel, channel, data, ctxt, node,
  185|  20.8k|                        XML_FROM_XINCLUDE, error, XML_ERR_ERROR,
  186|  20.8k|                        NULL, 0, (const char *) extra, NULL, NULL, 0, 0,
  187|  20.8k|                        msg, (const char *) extra);
  188|  20.8k|    if (res < 0) {
  ------------------
  |  Branch (188:9): [True: 175, False: 20.6k]
  ------------------
  189|    175|        ctxt->errNo = XML_ERR_NO_MEMORY;
  190|    175|        ctxt->fatalErr = 1;
  191|  20.6k|    } else {
  192|  20.6k|        ctxt->errNo = error;
  193|       |        /*
  194|       |         * Note that we treat IO errors except ENOENT as fatal
  195|       |         * although the XInclude spec could be interpreted in a
  196|       |         * way that at least some IO errors should be handled
  197|       |         * gracefully.
  198|       |         */
  199|  20.6k|        if (xmlIsCatastrophicError(XML_ERR_FATAL, error))
  ------------------
  |  Branch (199:13): [True: 2, False: 20.6k]
  ------------------
  200|      2|            ctxt->fatalErr = 1;
  201|  20.6k|    }
  202|  20.8k|}
xinclude.c:xmlXIncludeErrMemory:
  140|  3.40k|{
  141|  3.40k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  142|  3.40k|    ctxt->fatalErr = 1;
  143|  3.40k|    ctxt->nbErrors++;
  144|       |
  145|  3.40k|    xmlRaiseMemoryError(ctxt->errorHandler, NULL, ctxt->errorCtxt,
  146|       |                        XML_FROM_XINCLUDE, NULL);
  147|  3.40k|}
xinclude.c:xmlXIncludeExpandNode:
 1575|  25.2k|xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1576|  25.2k|    xmlXIncludeRefPtr ref;
 1577|  25.2k|    int i;
 1578|       |
 1579|  25.2k|    if (ctxt->fatalErr)
  ------------------
  |  Branch (1579:9): [True: 366, False: 24.8k]
  ------------------
 1580|    366|        return(NULL);
 1581|  24.8k|    if (ctxt->depth >= XINCLUDE_MAX_DEPTH) {
  ------------------
  |  |   36|  24.8k|#define XINCLUDE_MAX_DEPTH 40
  ------------------
  |  Branch (1581:9): [True: 0, False: 24.8k]
  ------------------
 1582|      0|        xmlXIncludeErr(ctxt, node, XML_XINCLUDE_RECURSION,
 1583|      0|                       "maximum recursion depth exceeded\n", NULL);
 1584|      0|        ctxt->fatalErr = 1;
 1585|      0|        return(NULL);
 1586|      0|    }
 1587|       |
 1588|  24.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1589|       |    /*
 1590|       |     * The XInclude engine offers no protection against exponential
 1591|       |     * expansion attacks similar to "billion laughs". Avoid timeouts by
 1592|       |     * limiting the total number of replacements when fuzzing.
 1593|       |     *
 1594|       |     * Unfortuately, a single XInclude can already result in quadratic
 1595|       |     * behavior:
 1596|       |     *
 1597|       |     *     <doc xmlns:xi="http://www.w3.org/2001/XInclude">
 1598|       |     *       <xi:include xpointer="xpointer(//e)"/>
 1599|       |     *       <e>
 1600|       |     *         <e>
 1601|       |     *           <e>
 1602|       |     *             <!-- more nested elements -->
 1603|       |     *           </e>
 1604|       |     *         </e>
 1605|       |     *       </e>
 1606|       |     *     </doc>
 1607|       |     */
 1608|  24.8k|    if (ctxt->incTotal >= 20)
  ------------------
  |  Branch (1608:9): [True: 1.76k, False: 23.0k]
  ------------------
 1609|  1.76k|        return(NULL);
 1610|  23.0k|    ctxt->incTotal++;
 1611|  23.0k|#endif
 1612|       |
 1613|  35.9k|    for (i = 0; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1613:17): [True: 13.1k, False: 22.8k]
  ------------------
 1614|  13.1k|        if (ctxt->incTab[i]->elem == node) {
  ------------------
  |  Branch (1614:13): [True: 237, False: 12.8k]
  ------------------
 1615|    237|            if (ctxt->incTab[i]->expanding) {
  ------------------
  |  Branch (1615:17): [True: 159, False: 78]
  ------------------
 1616|    159|                xmlXIncludeErr(ctxt, node, XML_XINCLUDE_RECURSION,
 1617|    159|                               "inclusion loop detected\n", NULL);
 1618|    159|                return(NULL);
 1619|    159|            }
 1620|     78|            return(ctxt->incTab[i]);
 1621|    237|        }
 1622|  13.1k|    }
 1623|       |
 1624|  22.8k|    ref = xmlXIncludeAddNode(ctxt, node);
 1625|  22.8k|    if (ref == NULL)
  ------------------
  |  Branch (1625:9): [True: 1.37k, False: 21.4k]
  ------------------
 1626|  1.37k|        return(NULL);
 1627|  21.4k|    ref->expanding = 1;
 1628|  21.4k|    ctxt->depth++;
 1629|  21.4k|    xmlXIncludeLoadNode(ctxt, ref);
 1630|  21.4k|    ctxt->depth--;
 1631|  21.4k|    ref->expanding = 0;
 1632|       |
 1633|  21.4k|    return(ref);
 1634|  22.8k|}
xinclude.c:xmlXIncludeAddNode:
  396|  22.8k|xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
  397|  22.8k|    xmlXIncludeRefPtr ref = NULL;
  398|  22.8k|    xmlXIncludeRefPtr ret = NULL;
  399|  22.8k|    xmlURIPtr uri = NULL;
  400|  22.8k|    xmlChar *href = NULL;
  401|  22.8k|    xmlChar *parse = NULL;
  402|  22.8k|    xmlChar *fragment = NULL;
  403|  22.8k|    xmlChar *base = NULL;
  404|  22.8k|    xmlChar *tmp;
  405|  22.8k|    int xml = 1;
  406|  22.8k|    int local = 0;
  407|  22.8k|    int res;
  408|       |
  409|  22.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 22.8k]
  ------------------
  410|      0|	return(NULL);
  411|  22.8k|    if (cur == NULL)
  ------------------
  |  Branch (411:9): [True: 0, False: 22.8k]
  ------------------
  412|      0|	return(NULL);
  413|       |
  414|       |    /*
  415|       |     * read the attributes
  416|       |     */
  417|       |
  418|  22.8k|    fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER);
  ------------------
  |  |   66|  22.8k|#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
  ------------------
  419|       |
  420|  22.8k|    href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF);
  ------------------
  |  |   46|  22.8k|#define XINCLUDE_HREF (const xmlChar *) "href"
  ------------------
  421|  22.8k|    if (href == NULL) {
  ------------------
  |  Branch (421:9): [True: 545, False: 22.2k]
  ------------------
  422|    545|        if (fragment == NULL) {
  ------------------
  |  Branch (422:13): [True: 398, False: 147]
  ------------------
  423|    398|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_HREF,
  424|    398|	                   "href or xpointer must be present\n", parse);
  425|    398|	    goto error;
  426|    398|        }
  427|       |
  428|    147|	href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */
  ------------------
  |  |   34|    147|#define BAD_CAST (xmlChar *)
  ------------------
  429|    147|	if (href == NULL) {
  ------------------
  |  Branch (429:6): [True: 2, False: 145]
  ------------------
  430|      2|            xmlXIncludeErrMemory(ctxt);
  431|      2|	    goto error;
  432|      2|        }
  433|  22.2k|    } else if (xmlStrlen(href) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  22.2k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (433:16): [True: 22, False: 22.2k]
  ------------------
  434|     22|        xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, "URI too long\n",
  435|     22|                       NULL);
  436|     22|        goto error;
  437|     22|    }
  438|       |
  439|  22.4k|    parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE);
  ------------------
  |  |   50|  22.4k|#define XINCLUDE_PARSE (const xmlChar *) "parse"
  ------------------
  440|  22.4k|    if (parse != NULL) {
  ------------------
  |  Branch (440:9): [True: 493, False: 21.9k]
  ------------------
  441|    493|	if (xmlStrEqual(parse, XINCLUDE_PARSE_XML))
  ------------------
  |  |   54|    493|#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
  ------------------
  |  Branch (441:6): [True: 187, False: 306]
  ------------------
  442|    187|	    xml = 1;
  443|    306|	else if (xmlStrEqual(parse, XINCLUDE_PARSE_TEXT))
  ------------------
  |  |   58|    306|#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
  ------------------
  |  Branch (443:11): [True: 269, False: 37]
  ------------------
  444|    269|	    xml = 0;
  445|     37|	else {
  446|     37|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE,
  447|     37|	                   "invalid value %s for 'parse'\n", parse);
  448|     37|	    goto error;
  449|     37|	}
  450|    493|    }
  451|       |
  452|       |    /*
  453|       |     * Check the URL and remove any fragment identifier
  454|       |     */
  455|  22.3k|    res = xmlParseURISafe((const char *)href, &uri);
  456|  22.3k|    if (uri == NULL) {
  ------------------
  |  Branch (456:9): [True: 173, False: 22.2k]
  ------------------
  457|    173|        if (res < 0)
  ------------------
  |  Branch (457:13): [True: 56, False: 117]
  ------------------
  458|     56|            xmlXIncludeErrMemory(ctxt);
  459|    117|        else
  460|    117|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  461|    117|                           "invalid value href %s\n", href);
  462|    173|        goto error;
  463|    173|    }
  464|       |
  465|  22.2k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (465:9): [True: 1.89k, False: 20.3k]
  ------------------
  466|  1.89k|        if (ctxt->legacy != 0) {
  ------------------
  |  Branch (466:13): [True: 1.85k, False: 43]
  ------------------
  467|  1.85k|	    if (fragment == NULL) {
  ------------------
  |  Branch (467:10): [True: 1.65k, False: 196]
  ------------------
  468|  1.65k|		fragment = (xmlChar *) uri->fragment;
  469|  1.65k|	    } else {
  470|    196|		xmlFree(uri->fragment);
  471|    196|	    }
  472|  1.85k|	} else {
  473|     43|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID,
  474|     43|       "Invalid fragment identifier in URI %s use the xpointer attribute\n",
  475|     43|                           href);
  476|     43|	    goto error;
  477|     43|	}
  478|  1.85k|	uri->fragment = NULL;
  479|  1.85k|    }
  480|  22.1k|    tmp = xmlSaveUri(uri);
  481|  22.1k|    if (tmp == NULL) {
  ------------------
  |  Branch (481:9): [True: 18, False: 22.1k]
  ------------------
  482|     18|	xmlXIncludeErrMemory(ctxt);
  483|     18|	goto error;
  484|     18|    }
  485|  22.1k|    xmlFree(href);
  486|  22.1k|    href = tmp;
  487|       |
  488|       |    /*
  489|       |     * Resolve URI
  490|       |     */
  491|       |
  492|  22.1k|    if (xmlNodeGetBaseSafe(ctxt->doc, cur, &base) < 0) {
  ------------------
  |  Branch (492:9): [True: 20, False: 22.1k]
  ------------------
  493|     20|        xmlXIncludeErrMemory(ctxt);
  494|     20|        goto error;
  495|     20|    }
  496|       |
  497|  22.1k|    if (href[0] != 0) {
  ------------------
  |  Branch (497:9): [True: 21.1k, False: 957]
  ------------------
  498|  21.1k|        if (xmlBuildURISafe(href, base, &tmp) < 0) {
  ------------------
  |  Branch (498:13): [True: 65, False: 21.1k]
  ------------------
  499|     65|            xmlXIncludeErrMemory(ctxt);
  500|     65|            goto error;
  501|     65|        }
  502|  21.1k|        if (tmp == NULL) {
  ------------------
  |  Branch (502:13): [True: 1, False: 21.1k]
  ------------------
  503|      1|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  504|      1|                           "failed build URL\n", NULL);
  505|      1|            goto error;
  506|      1|        }
  507|  21.1k|        xmlFree(href);
  508|  21.1k|        href = tmp;
  509|       |
  510|  21.1k|        if (xmlStrEqual(href, ctxt->doc->URL))
  ------------------
  |  Branch (510:13): [True: 3.98k, False: 17.1k]
  ------------------
  511|  3.98k|            local = 1;
  512|  21.1k|    } else {
  513|    957|        local = 1;
  514|    957|    }
  515|       |
  516|       |    /*
  517|       |     * If local and xml then we need a fragment
  518|       |     */
  519|  22.0k|    if ((local == 1) && (xml == 1) &&
  ------------------
  |  Branch (519:9): [True: 4.93k, False: 17.1k]
  |  Branch (519:25): [True: 4.92k, False: 13]
  ------------------
  520|  4.92k|        ((fragment == NULL) || (fragment[0] == 0))) {
  ------------------
  |  Branch (520:10): [True: 546, False: 4.38k]
  |  Branch (520:32): [True: 20, False: 4.36k]
  ------------------
  521|    566|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
  522|    566|	               "detected a local recursion with no xpointer in %s\n",
  523|    566|		       href);
  524|    566|	goto error;
  525|    566|    }
  526|       |
  527|  21.4k|    ref = (xmlXIncludeRefPtr) xmlMalloc(sizeof(xmlXIncludeRef));
  528|  21.4k|    if (ref == NULL) {
  ------------------
  |  Branch (528:9): [True: 10, False: 21.4k]
  ------------------
  529|     10|        xmlXIncludeErrMemory(ctxt);
  530|     10|        goto error;
  531|     10|    }
  532|  21.4k|    memset(ref, 0, sizeof(xmlXIncludeRef));
  533|       |
  534|  21.4k|    ref->elem = cur;
  535|  21.4k|    ref->xml = xml;
  536|  21.4k|    ref->URI = href;
  537|  21.4k|    href = NULL;
  538|  21.4k|    ref->fragment = fragment;
  539|  21.4k|    fragment = NULL;
  540|       |
  541|       |    /*
  542|       |     * xml:base fixup
  543|       |     */
  544|  21.4k|    if (((ctxt->parseFlags & XML_PARSE_NOBASEFIX) == 0) &&
  ------------------
  |  Branch (544:9): [True: 11.3k, False: 10.1k]
  ------------------
  545|  11.3k|        (cur->doc != NULL) &&
  ------------------
  |  Branch (545:9): [True: 11.3k, False: 0]
  ------------------
  546|  11.3k|        ((cur->doc->parseFlags & XML_PARSE_NOBASEFIX) == 0)) {
  ------------------
  |  Branch (546:9): [True: 11.3k, False: 0]
  ------------------
  547|  11.3k|        if (base != NULL) {
  ------------------
  |  Branch (547:13): [True: 6.16k, False: 5.15k]
  ------------------
  548|  6.16k|            ref->base = base;
  549|  6.16k|            base = NULL;
  550|  6.16k|        } else {
  551|  5.15k|            ref->base = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|  5.15k|#define BAD_CAST (xmlChar *)
  ------------------
  552|  5.15k|            if (ref->base == NULL) {
  ------------------
  |  Branch (552:17): [True: 1, False: 5.15k]
  ------------------
  553|      1|	        xmlXIncludeErrMemory(ctxt);
  554|      1|                goto error;
  555|      1|            }
  556|  5.15k|        }
  557|  11.3k|    }
  558|       |
  559|  21.4k|    if (ctxt->incNr >= ctxt->incMax) {
  ------------------
  |  Branch (559:9): [True: 15.2k, False: 6.26k]
  ------------------
  560|  15.2k|        xmlXIncludeRefPtr *table;
  561|  15.2k|        int newSize;
  562|       |
  563|  15.2k|        newSize = xmlGrowCapacity(ctxt->incMax, sizeof(table[0]),
  564|  15.2k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  15.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  565|  15.2k|        if (newSize < 0) {
  ------------------
  |  Branch (565:13): [True: 0, False: 15.2k]
  ------------------
  566|      0|	    xmlXIncludeErrMemory(ctxt);
  567|      0|	    goto error;
  568|      0|	}
  569|  15.2k|        table = xmlRealloc(ctxt->incTab, newSize * sizeof(table[0]));
  570|  15.2k|        if (table == NULL) {
  ------------------
  |  Branch (570:13): [True: 20, False: 15.2k]
  ------------------
  571|     20|	    xmlXIncludeErrMemory(ctxt);
  572|     20|	    goto error;
  573|     20|	}
  574|  15.2k|        ctxt->incTab = table;
  575|  15.2k|        ctxt->incMax = newSize;
  576|  15.2k|    }
  577|  21.4k|    ctxt->incTab[ctxt->incNr++] = ref;
  578|       |
  579|  21.4k|    ret = ref;
  580|  21.4k|    ref = NULL;
  581|       |
  582|  22.8k|error:
  583|  22.8k|    xmlXIncludeFreeRef(ref);
  584|  22.8k|    xmlFreeURI(uri);
  585|  22.8k|    xmlFree(href);
  586|  22.8k|    xmlFree(parse);
  587|  22.8k|    xmlFree(fragment);
  588|  22.8k|    xmlFree(base);
  589|  22.8k|    return(ret);
  590|  21.4k|}
xinclude.c:xmlXIncludeGetProp:
  214|  68.3k|                   const xmlChar *name) {
  215|  68.3k|    xmlChar *ret;
  216|       |
  217|  68.3k|    if (xmlNodeGetAttrValue(cur, name, XINCLUDE_NS, &ret) < 0)
  ------------------
  |  |   30|  68.3k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (217:9): [True: 2, False: 68.3k]
  ------------------
  218|      2|        xmlXIncludeErrMemory(ctxt);
  219|  68.3k|    if (ret != NULL)
  ------------------
  |  Branch (219:9): [True: 41, False: 68.3k]
  ------------------
  220|     41|        return(ret);
  221|       |
  222|  68.3k|    if (ctxt->legacy != 0) {
  ------------------
  |  Branch (222:9): [True: 38.5k, False: 29.7k]
  ------------------
  223|  38.5k|        if (xmlNodeGetAttrValue(cur, name, XINCLUDE_OLD_NS, &ret) < 0)
  ------------------
  |  |   34|  38.5k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (223:13): [True: 1, False: 38.5k]
  ------------------
  224|      1|            xmlXIncludeErrMemory(ctxt);
  225|  38.5k|        if (ret != NULL)
  ------------------
  |  Branch (225:13): [True: 41, False: 38.5k]
  ------------------
  226|     41|            return(ret);
  227|  38.5k|    }
  228|       |
  229|  68.2k|    if (xmlNodeGetAttrValue(cur, name, NULL, &ret) < 0)
  ------------------
  |  Branch (229:9): [True: 54, False: 68.2k]
  ------------------
  230|     54|        xmlXIncludeErrMemory(ctxt);
  231|  68.2k|    return(ret);
  232|  68.3k|}
xinclude.c:xmlXIncludeLoadNode:
 1644|  21.4k|xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1645|  21.4k|    xmlNodePtr cur;
 1646|  21.4k|    int ret;
 1647|       |
 1648|  21.4k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1648:9): [True: 0, False: 21.4k]
  |  Branch (1648:27): [True: 0, False: 21.4k]
  ------------------
 1649|      0|	return(-1);
 1650|  21.4k|    cur = ref->elem;
 1651|  21.4k|    if (cur == NULL)
  ------------------
  |  Branch (1651:9): [True: 0, False: 21.4k]
  ------------------
 1652|      0|	return(-1);
 1653|       |
 1654|  21.4k|    if (ref->xml) {
  ------------------
  |  Branch (1654:9): [True: 21.1k, False: 269]
  ------------------
 1655|  21.1k|	ret = xmlXIncludeLoadDoc(ctxt, ref);
 1656|       |	/* xmlXIncludeGetFragment(ctxt, cur, URI); */
 1657|  21.1k|    } else {
 1658|    269|	ret = xmlXIncludeLoadTxt(ctxt, ref);
 1659|    269|    }
 1660|       |
 1661|  21.4k|    if (ret < 0) {
  ------------------
  |  Branch (1661:9): [True: 11.6k, False: 9.86k]
  ------------------
 1662|  11.6k|	xmlNodePtr children;
 1663|       |
 1664|       |	/*
 1665|       |	 * Time to try a fallback if available
 1666|       |	 */
 1667|  11.6k|	children = cur->children;
 1668|  15.2k|	while (children != NULL) {
  ------------------
  |  Branch (1668:9): [True: 4.23k, False: 11.0k]
  ------------------
 1669|  4.23k|	    if ((children->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1669:10): [True: 1.77k, False: 2.46k]
  ------------------
 1670|  1.77k|		(children->ns != NULL) &&
  ------------------
  |  Branch (1670:3): [True: 1.06k, False: 701]
  ------------------
 1671|  1.06k|		(xmlStrEqual(children->name, XINCLUDE_FALLBACK)) &&
  ------------------
  |  |   42|  1.06k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1671:3): [True: 580, False: 489]
  ------------------
 1672|    580|		((xmlStrEqual(children->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    580|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1672:4): [True: 294, False: 286]
  ------------------
 1673|    580|		 (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    286|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1673:4): [True: 286, False: 0]
  ------------------
 1674|    580|		ret = xmlXIncludeLoadFallback(ctxt, children, ref);
 1675|    580|		break;
 1676|    580|	    }
 1677|  3.65k|	    children = children->next;
 1678|  3.65k|	}
 1679|  11.6k|    }
 1680|  21.4k|    if (ret < 0) {
  ------------------
  |  Branch (1680:9): [True: 11.1k, False: 10.2k]
  ------------------
 1681|  11.1k|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_FALLBACK,
 1682|  11.1k|		       "could not load %s, and no fallback was found\n",
 1683|  11.1k|		       ref->URI);
 1684|  11.1k|    }
 1685|       |
 1686|  21.4k|    return(0);
 1687|  21.4k|}
xinclude.c:xmlXIncludeLoadDoc:
 1061|  21.1k|xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1062|  21.1k|    xmlXIncludeDocPtr cache;
 1063|  21.1k|    xmlDocPtr doc;
 1064|  21.1k|    const xmlChar *url = ref->URI;
 1065|  21.1k|    const xmlChar *fragment = ref->fragment;
 1066|  21.1k|    int i = 0;
 1067|  21.1k|    int ret = -1;
 1068|  21.1k|    int cacheNr;
 1069|  21.1k|#ifdef LIBXML_XPTR_ENABLED
 1070|  21.1k|    int saveFlags;
 1071|  21.1k|#endif
 1072|       |
 1073|       |    /*
 1074|       |     * Handling of references to the local document are done
 1075|       |     * directly through ctxt->doc.
 1076|       |     */
 1077|  21.1k|    if ((url[0] == 0) || (url[0] == '#') ||
  ------------------
  |  Branch (1077:9): [True: 920, False: 20.2k]
  |  Branch (1077:26): [True: 1.38k, False: 18.8k]
  ------------------
 1078|  18.8k|	((ctxt->doc != NULL) && (xmlStrEqual(url, ctxt->doc->URL)))) {
  ------------------
  |  Branch (1078:3): [True: 18.8k, False: 0]
  |  Branch (1078:26): [True: 3.41k, False: 15.4k]
  ------------------
 1079|  5.72k|	doc = ctxt->doc;
 1080|  5.72k|        goto loaded;
 1081|  5.72k|    }
 1082|       |
 1083|       |    /*
 1084|       |     * Prevent reloading the document twice.
 1085|       |     */
 1086|  20.3k|    for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (1086:17): [True: 9.59k, False: 10.7k]
  ------------------
 1087|  9.59k|	if (xmlStrEqual(url, ctxt->urlTab[i].url)) {
  ------------------
  |  Branch (1087:6): [True: 4.68k, False: 4.91k]
  ------------------
 1088|  4.68k|            if (ctxt->urlTab[i].expanding) {
  ------------------
  |  Branch (1088:17): [True: 66, False: 4.61k]
  ------------------
 1089|     66|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_RECURSION,
 1090|     66|                               "inclusion loop detected\n", NULL);
 1091|     66|                goto error;
 1092|     66|            }
 1093|  4.61k|	    doc = ctxt->urlTab[i].doc;
 1094|  4.61k|            if (doc == NULL)
  ------------------
  |  Branch (1094:17): [True: 451, False: 4.16k]
  ------------------
 1095|    451|                goto error;
 1096|  4.16k|	    goto loaded;
 1097|  4.61k|	}
 1098|  9.59k|    }
 1099|       |
 1100|       |    /*
 1101|       |     * Load it.
 1102|       |     */
 1103|  10.7k|#ifdef LIBXML_XPTR_ENABLED
 1104|       |    /*
 1105|       |     * If this is an XPointer evaluation, we want to assure that
 1106|       |     * all entities have been resolved prior to processing the
 1107|       |     * referenced document
 1108|       |     */
 1109|  10.7k|    saveFlags = ctxt->parseFlags;
 1110|  10.7k|    if (fragment != NULL) {	/* if this is an XPointer eval */
  ------------------
  |  Branch (1110:9): [True: 8.17k, False: 2.61k]
  ------------------
 1111|  8.17k|	ctxt->parseFlags |= XML_PARSE_NOENT;
 1112|  8.17k|    }
 1113|  10.7k|#endif
 1114|       |
 1115|  10.7k|    doc = xmlXIncludeParseFile(ctxt, (const char *)url);
 1116|  10.7k|#ifdef LIBXML_XPTR_ENABLED
 1117|  10.7k|    ctxt->parseFlags = saveFlags;
 1118|  10.7k|#endif
 1119|       |
 1120|       |    /* Also cache NULL docs */
 1121|  10.7k|    if (ctxt->urlNr >= ctxt->urlMax) {
  ------------------
  |  Branch (1121:9): [True: 10.5k, False: 197]
  ------------------
 1122|  10.5k|        xmlXIncludeDoc *tmp;
 1123|  10.5k|        int newSize;
 1124|       |
 1125|  10.5k|        newSize = xmlGrowCapacity(ctxt->urlMax, sizeof(tmp[0]),
 1126|  10.5k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|  10.5k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1127|  10.5k|        if (newSize < 0) {
  ------------------
  |  Branch (1127:13): [True: 0, False: 10.5k]
  ------------------
 1128|      0|            xmlXIncludeErrMemory(ctxt);
 1129|      0|            xmlFreeDoc(doc);
 1130|      0|            goto error;
 1131|      0|        }
 1132|  10.5k|        tmp = xmlRealloc(ctxt->urlTab, newSize * sizeof(tmp[0]));
 1133|  10.5k|        if (tmp == NULL) {
  ------------------
  |  Branch (1133:13): [True: 4, False: 10.5k]
  ------------------
 1134|      4|            xmlXIncludeErrMemory(ctxt);
 1135|      4|            xmlFreeDoc(doc);
 1136|      4|            goto error;
 1137|      4|        }
 1138|  10.5k|        ctxt->urlMax = newSize;
 1139|  10.5k|        ctxt->urlTab = tmp;
 1140|  10.5k|    }
 1141|  10.7k|    cache = &ctxt->urlTab[ctxt->urlNr];
 1142|  10.7k|    cache->doc = doc;
 1143|  10.7k|    cache->url = xmlStrdup(url);
 1144|  10.7k|    if (cache->url == NULL) {
  ------------------
  |  Branch (1144:9): [True: 2, False: 10.7k]
  ------------------
 1145|      2|        xmlXIncludeErrMemory(ctxt);
 1146|      2|        xmlFreeDoc(doc);
 1147|      2|        goto error;
 1148|      2|    }
 1149|  10.7k|    cache->expanding = 0;
 1150|  10.7k|    cacheNr = ctxt->urlNr++;
 1151|       |
 1152|  10.7k|    if (doc == NULL)
  ------------------
  |  Branch (1152:9): [True: 2.22k, False: 8.55k]
  ------------------
 1153|  2.22k|        goto error;
 1154|       |    /*
 1155|       |     * It's possible that the requested URL has been mapped to a
 1156|       |     * completely different location (e.g. through a catalog entry).
 1157|       |     * To check for this, we compare the URL with that of the doc
 1158|       |     * and change it if they disagree (bug 146988).
 1159|       |     */
 1160|  8.55k|    if ((doc->URL != NULL) && (!xmlStrEqual(url, doc->URL)))
  ------------------
  |  Branch (1160:9): [True: 8.55k, False: 0]
  |  Branch (1160:31): [True: 0, False: 8.55k]
  ------------------
 1161|      0|        url = doc->URL;
 1162|       |
 1163|       |    /*
 1164|       |     * Make sure we have all entities fixed up
 1165|       |     */
 1166|  8.55k|    xmlXIncludeMergeEntities(ctxt, ctxt->doc, doc);
 1167|       |
 1168|       |    /*
 1169|       |     * We don't need the DTD anymore, free up space
 1170|       |    if (doc->intSubset != NULL) {
 1171|       |	xmlUnlinkNode((xmlNodePtr) doc->intSubset);
 1172|       |	xmlFreeNode((xmlNodePtr) doc->intSubset);
 1173|       |	doc->intSubset = NULL;
 1174|       |    }
 1175|       |    if (doc->extSubset != NULL) {
 1176|       |	xmlUnlinkNode((xmlNodePtr) doc->extSubset);
 1177|       |	xmlFreeNode((xmlNodePtr) doc->extSubset);
 1178|       |	doc->extSubset = NULL;
 1179|       |    }
 1180|       |     */
 1181|  8.55k|    cache->expanding = 1;
 1182|  8.55k|    xmlXIncludeRecurseDoc(ctxt, doc);
 1183|       |    /* urlTab might be reallocated. */
 1184|  8.55k|    cache = &ctxt->urlTab[cacheNr];
 1185|  8.55k|    cache->expanding = 0;
 1186|       |
 1187|  18.4k|loaded:
 1188|  18.4k|    if (fragment == NULL) {
  ------------------
  |  Branch (1188:9): [True: 5.40k, False: 13.0k]
  ------------------
 1189|  5.40k|        xmlNodePtr root;
 1190|       |
 1191|  5.40k|        root = xmlDocGetRootElement(doc);
 1192|  5.40k|        if (root == NULL) {
  ------------------
  |  Branch (1192:13): [True: 1, False: 5.40k]
  ------------------
 1193|      1|            xmlXIncludeErr(ctxt, ref->elem, XML_ERR_INTERNAL_ERROR,
 1194|      1|                           "document without root\n", NULL);
 1195|      1|            goto error;
 1196|      1|        }
 1197|       |
 1198|  5.40k|        ref->inc = xmlDocCopyNode(root, ctxt->doc, 1);
 1199|  5.40k|        if (ref->inc == NULL) {
  ------------------
  |  Branch (1199:13): [True: 92, False: 5.31k]
  ------------------
 1200|     92|            xmlXIncludeErrMemory(ctxt);
 1201|     92|            goto error;
 1202|     92|        }
 1203|       |
 1204|  5.31k|        if (ref->base != NULL)
  ------------------
  |  Branch (1204:13): [True: 4.36k, False: 951]
  ------------------
 1205|  4.36k|            xmlXIncludeBaseFixup(ctxt, root, ref->inc, ref->base);
 1206|  5.31k|    }
 1207|  13.0k|#ifdef LIBXML_XPTR_ENABLED
 1208|  13.0k|    else {
 1209|       |	/*
 1210|       |	 * Computes the XPointer expression and make a copy used
 1211|       |	 * as the replacement copy.
 1212|       |	 */
 1213|  13.0k|	xmlXPathObjectPtr xptr;
 1214|  13.0k|	xmlNodeSetPtr set;
 1215|       |
 1216|  13.0k|        if (ctxt->isStream && doc == ctxt->doc) {
  ------------------
  |  Branch (1216:13): [True: 8.80k, False: 4.24k]
  |  Branch (1216:31): [True: 138, False: 8.66k]
  ------------------
 1217|    138|	    xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1218|    138|			   "XPointer expressions not allowed in streaming"
 1219|    138|                           " mode\n", NULL);
 1220|    138|            goto error;
 1221|    138|        }
 1222|       |
 1223|  12.9k|        if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1223:13): [True: 7.76k, False: 5.13k]
  ------------------
 1224|  7.76k|            ctxt->xpctxt = xmlXPathNewContext(doc);
 1225|  7.76k|            if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1225:17): [True: 20, False: 7.74k]
  ------------------
 1226|     20|                xmlXIncludeErrMemory(ctxt);
 1227|     20|                goto error;
 1228|     20|            }
 1229|  7.74k|            if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1229:17): [True: 7.74k, False: 0]
  ------------------
 1230|  7.74k|                xmlXPathSetErrorHandler(ctxt->xpctxt, ctxt->errorHandler,
 1231|  7.74k|                                        ctxt->errorCtxt);
 1232|  7.74k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1233|  7.74k|            ctxt->xpctxt->opLimit = 100000;
 1234|  7.74k|#endif
 1235|  7.74k|        } else {
 1236|  5.13k|            ctxt->xpctxt->doc = doc;
 1237|  5.13k|        }
 1238|  12.8k|	xptr = xmlXPtrEval(fragment, ctxt->xpctxt);
 1239|  12.8k|	if (ctxt->xpctxt->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (1239:6): [True: 8.43k, False: 4.44k]
  ------------------
 1240|  8.43k|            if (ctxt->xpctxt->lastError.code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1240:17): [True: 2.48k, False: 5.94k]
  ------------------
 1241|  2.48k|                xmlXIncludeErrMemory(ctxt);
 1242|  5.94k|            else
 1243|  5.94k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1244|  5.94k|                               "XPointer evaluation failed: #%s\n",
 1245|  5.94k|                               fragment);
 1246|  8.43k|            goto error;
 1247|  8.43k|	}
 1248|  4.44k|        if (xptr == NULL)
  ------------------
  |  Branch (1248:13): [True: 3.00k, False: 1.44k]
  ------------------
 1249|  3.00k|            goto done;
 1250|  1.44k|	switch (xptr->type) {
  ------------------
  |  Branch (1250:10): [True: 1.44k, False: 0]
  ------------------
 1251|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1251:6): [True: 0, False: 1.44k]
  ------------------
 1252|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1252:6): [True: 0, False: 1.44k]
  ------------------
 1253|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (1253:6): [True: 0, False: 1.44k]
  ------------------
 1254|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (1254:6): [True: 0, False: 1.44k]
  ------------------
 1255|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (1255:6): [True: 0, False: 1.44k]
  ------------------
 1256|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (1256:6): [True: 0, False: 1.44k]
  ------------------
 1257|      0|		xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_RESULT,
 1258|      0|			       "XPointer is not a range: #%s\n",
 1259|      0|			       fragment);
 1260|      0|                xmlXPathFreeObject(xptr);
 1261|      0|                goto error;
 1262|  1.44k|	    case XPATH_NODESET:
  ------------------
  |  Branch (1262:6): [True: 1.44k, False: 0]
  ------------------
 1263|  1.44k|                break;
 1264|       |
 1265|  1.44k|	}
 1266|  1.44k|	set = xptr->nodesetval;
 1267|  1.44k|	if (set != NULL) {
  ------------------
  |  Branch (1267:6): [True: 1.44k, False: 0]
  ------------------
 1268|   580k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (1268:17): [True: 578k, False: 1.39k]
  ------------------
 1269|   578k|		if (set->nodeTab[i] == NULL) /* shouldn't happen */
  ------------------
  |  Branch (1269:7): [True: 0, False: 578k]
  ------------------
 1270|      0|		    continue;
 1271|   578k|		switch (set->nodeTab[i]->type) {
  ------------------
  |  Branch (1271:11): [True: 578k, False: 0]
  ------------------
 1272|   271k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1272:7): [True: 271k, False: 307k]
  ------------------
 1273|   458k|		    case XML_TEXT_NODE:
  ------------------
  |  Branch (1273:7): [True: 186k, False: 391k]
  ------------------
 1274|   504k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1274:7): [True: 45.7k, False: 532k]
  ------------------
 1275|   504k|		    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1275:7): [True: 0, False: 578k]
  ------------------
 1276|   504k|		    case XML_ENTITY_NODE:
  ------------------
  |  Branch (1276:7): [True: 0, False: 578k]
  ------------------
 1277|   575k|		    case XML_PI_NODE:
  ------------------
  |  Branch (1277:7): [True: 71.1k, False: 507k]
  ------------------
 1278|   578k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (1278:7): [True: 2.96k, False: 575k]
  ------------------
 1279|   578k|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1279:7): [True: 399, False: 578k]
  ------------------
 1280|   578k|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1280:7): [True: 0, False: 578k]
  ------------------
 1281|   578k|			continue;
 1282|       |
 1283|     30|		    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1283:7): [True: 30, False: 578k]
  ------------------
 1284|     30|			xmlXIncludeErr(ctxt, ref->elem,
 1285|     30|			               XML_XINCLUDE_XPTR_RESULT,
 1286|     30|				       "XPointer selects an attribute: #%s\n",
 1287|     30|				       fragment);
 1288|     30|			goto xptr_error;
 1289|     21|		    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1289:7): [True: 21, False: 578k]
  ------------------
 1290|     21|			xmlXIncludeErr(ctxt, ref->elem,
 1291|     21|			               XML_XINCLUDE_XPTR_RESULT,
 1292|     21|				       "XPointer selects a namespace: #%s\n",
 1293|     21|				       fragment);
 1294|     21|			goto xptr_error;
 1295|      0|		    case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (1295:7): [True: 0, False: 578k]
  ------------------
 1296|      0|		    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1296:7): [True: 0, False: 578k]
  ------------------
 1297|      0|		    case XML_NOTATION_NODE:
  ------------------
  |  Branch (1297:7): [True: 0, False: 578k]
  ------------------
 1298|      0|		    case XML_DTD_NODE:
  ------------------
  |  Branch (1298:7): [True: 0, False: 578k]
  ------------------
 1299|      0|		    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1299:7): [True: 0, False: 578k]
  ------------------
 1300|      0|		    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1300:7): [True: 0, False: 578k]
  ------------------
 1301|      0|		    case XML_ENTITY_DECL:
  ------------------
  |  Branch (1301:7): [True: 0, False: 578k]
  ------------------
 1302|      0|		    case XML_XINCLUDE_START:
  ------------------
  |  Branch (1302:7): [True: 0, False: 578k]
  ------------------
 1303|      0|		    case XML_XINCLUDE_END:
  ------------------
  |  Branch (1303:7): [True: 0, False: 578k]
  ------------------
 1304|       |                        /* shouldn't happen */
 1305|      0|			xmlXIncludeErr(ctxt, ref->elem,
 1306|      0|			               XML_XINCLUDE_XPTR_RESULT,
 1307|      0|				   "XPointer selects unexpected nodes: #%s\n",
 1308|      0|				       fragment);
 1309|      0|			goto xptr_error;
 1310|   578k|		}
 1311|   578k|	    }
 1312|  1.44k|	}
 1313|  1.39k|        ref->inc = xmlXIncludeCopyXPointer(ctxt, xptr, ref->base);
 1314|  1.44k|xptr_error:
 1315|  1.44k|        xmlXPathFreeObject(xptr);
 1316|  1.44k|    }
 1317|       |
 1318|  9.76k|done:
 1319|  9.76k|#endif
 1320|       |
 1321|  9.76k|    ret = 0;
 1322|       |
 1323|  21.1k|error:
 1324|  21.1k|    return(ret);
 1325|  9.76k|}
xinclude.c:xmlXIncludeParseFile:
  320|  10.7k|xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) {
  321|  10.7k|    xmlDocPtr ret = NULL;
  322|  10.7k|    xmlParserCtxtPtr pctxt;
  323|  10.7k|    xmlParserInputPtr inputStream;
  324|       |
  325|  10.7k|    xmlInitParser();
  326|       |
  327|  10.7k|    pctxt = xmlNewParserCtxt();
  328|  10.7k|    if (pctxt == NULL) {
  ------------------
  |  Branch (328:9): [True: 13, False: 10.7k]
  ------------------
  329|     13|	xmlXIncludeErrMemory(ctxt);
  330|     13|	return(NULL);
  331|     13|    }
  332|  10.7k|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (332:9): [True: 10.7k, False: 0]
  ------------------
  333|  10.7k|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
  334|  10.7k|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (334:9): [True: 10.7k, False: 0]
  ------------------
  335|  10.7k|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
  336|  10.7k|                                 ctxt->resourceCtxt);
  337|       |
  338|       |    /*
  339|       |     * pass in the application data to the parser context.
  340|       |     */
  341|  10.7k|    pctxt->_private = ctxt->_private;
  342|       |
  343|       |    /*
  344|       |     * try to ensure that new documents included are actually
  345|       |     * built with the same dictionary as the including document.
  346|       |     */
  347|  10.7k|    if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) {
  ------------------
  |  Branch (347:9): [True: 10.7k, False: 0]
  |  Branch (347:32): [True: 5.92k, False: 4.85k]
  ------------------
  348|  5.92k|       if (pctxt->dict != NULL)
  ------------------
  |  Branch (348:12): [True: 5.92k, False: 0]
  ------------------
  349|  5.92k|            xmlDictFree(pctxt->dict);
  350|  5.92k|	pctxt->dict = ctxt->doc->dict;
  351|  5.92k|	xmlDictReference(pctxt->dict);
  352|  5.92k|    }
  353|       |
  354|       |    /*
  355|       |     * We set DTDLOAD to make sure that ID attributes declared in
  356|       |     * external DTDs are detected.
  357|       |     */
  358|  10.7k|    xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD);
  359|       |
  360|  10.7k|    inputStream = xmlLoadResource(pctxt, URL, NULL, XML_RESOURCE_XINCLUDE);
  361|  10.7k|    if (inputStream == NULL)
  ------------------
  |  Branch (361:9): [True: 964, False: 9.81k]
  ------------------
  362|    964|        goto error;
  363|       |
  364|  9.81k|    if (xmlCtxtPushInput(pctxt, inputStream) < 0) {
  ------------------
  |  Branch (364:9): [True: 1, False: 9.81k]
  ------------------
  365|      1|        xmlFreeInputStream(inputStream);
  366|      1|        goto error;
  367|      1|    }
  368|       |
  369|  9.81k|    xmlParseDocument(pctxt);
  370|       |
  371|  9.81k|    if (pctxt->wellFormed) {
  ------------------
  |  Branch (371:9): [True: 8.55k, False: 1.25k]
  ------------------
  372|  8.55k|        ret = pctxt->myDoc;
  373|  8.55k|    }
  374|  1.25k|    else {
  375|  1.25k|        ret = NULL;
  376|  1.25k|	if (pctxt->myDoc != NULL)
  ------------------
  |  Branch (376:6): [True: 1.18k, False: 68]
  ------------------
  377|  1.18k|	    xmlFreeDoc(pctxt->myDoc);
  378|  1.25k|        pctxt->myDoc = NULL;
  379|  1.25k|    }
  380|       |
  381|  10.7k|error:
  382|  10.7k|    if (xmlCtxtIsCatastrophicError(pctxt))
  ------------------
  |  Branch (382:9): [True: 160, False: 10.6k]
  ------------------
  383|    160|        xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "parser error", NULL);
  384|  10.7k|    xmlFreeParserCtxt(pctxt);
  385|       |
  386|  10.7k|    return(ret);
  387|  9.81k|}
xinclude.c:xmlXIncludeMergeEntities:
 1002|  8.55k|	                 xmlDocPtr from) {
 1003|  8.55k|    xmlNodePtr cur;
 1004|  8.55k|    xmlDtdPtr target, source;
 1005|       |
 1006|  8.55k|    if (ctxt == NULL)
  ------------------
  |  Branch (1006:9): [True: 0, False: 8.55k]
  ------------------
 1007|      0|	return(-1);
 1008|       |
 1009|  8.55k|    if ((from == NULL) || (from->intSubset == NULL))
  ------------------
  |  Branch (1009:9): [True: 0, False: 8.55k]
  |  Branch (1009:27): [True: 6.62k, False: 1.93k]
  ------------------
 1010|  6.62k|	return(0);
 1011|       |
 1012|  1.93k|    target = doc->intSubset;
 1013|  1.93k|    if (target == NULL) {
  ------------------
  |  Branch (1013:9): [True: 172, False: 1.76k]
  ------------------
 1014|    172|	cur = xmlDocGetRootElement(doc);
 1015|    172|	if (cur == NULL)
  ------------------
  |  Branch (1015:6): [True: 0, False: 172]
  ------------------
 1016|      0|	    return(-1);
 1017|    172|        target = xmlCreateIntSubset(doc, cur->name, NULL, NULL);
 1018|    172|	if (target == NULL) {
  ------------------
  |  Branch (1018:6): [True: 2, False: 170]
  ------------------
 1019|      2|            xmlXIncludeErrMemory(ctxt);
 1020|      2|	    return(-1);
 1021|      2|        }
 1022|    172|    }
 1023|       |
 1024|  1.93k|    source = from->intSubset;
 1025|  1.93k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1025:9): [True: 1.93k, False: 0]
  |  Branch (1025:29): [True: 119, False: 1.81k]
  ------------------
 1026|    119|	xmlXIncludeMergeData data;
 1027|       |
 1028|    119|	data.ctxt = ctxt;
 1029|    119|	data.doc = doc;
 1030|       |
 1031|    119|	xmlHashScan((xmlHashTablePtr) source->entities,
 1032|    119|		    xmlXIncludeMergeEntity, &data);
 1033|    119|    }
 1034|  1.93k|    source = from->extSubset;
 1035|  1.93k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1035:9): [True: 45, False: 1.89k]
  |  Branch (1035:29): [True: 7, False: 38]
  ------------------
 1036|      7|	xmlXIncludeMergeData data;
 1037|       |
 1038|      7|	data.ctxt = ctxt;
 1039|      7|	data.doc = doc;
 1040|       |
 1041|       |	/*
 1042|       |	 * don't duplicate existing stuff when external subsets are the same
 1043|       |	 */
 1044|      7|	if ((!xmlStrEqual(target->ExternalID, source->ExternalID)) &&
  ------------------
  |  Branch (1044:6): [True: 0, False: 7]
  ------------------
 1045|      0|	    (!xmlStrEqual(target->SystemID, source->SystemID))) {
  ------------------
  |  Branch (1045:6): [True: 0, False: 0]
  ------------------
 1046|      0|	    xmlHashScan((xmlHashTablePtr) source->entities,
 1047|      0|			xmlXIncludeMergeEntity, &data);
 1048|      0|	}
 1049|      7|    }
 1050|  1.93k|    return(0);
 1051|  1.93k|}
xinclude.c:xmlXIncludeMergeEntity:
  921|    344|	               const xmlChar *name ATTRIBUTE_UNUSED) {
  922|    344|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  923|    344|    xmlXIncludeMergeDataPtr data = (xmlXIncludeMergeDataPtr) vdata;
  924|    344|    xmlEntityPtr ret, prev;
  925|    344|    xmlDocPtr doc;
  926|    344|    xmlXIncludeCtxtPtr ctxt;
  927|       |
  928|    344|    if ((ent == NULL) || (data == NULL))
  ------------------
  |  Branch (928:9): [True: 0, False: 344]
  |  Branch (928:26): [True: 0, False: 344]
  ------------------
  929|      0|	return;
  930|    344|    ctxt = data->ctxt;
  931|    344|    doc = data->doc;
  932|    344|    if ((ctxt == NULL) || (doc == NULL))
  ------------------
  |  Branch (932:9): [True: 0, False: 344]
  |  Branch (932:27): [True: 0, False: 344]
  ------------------
  933|      0|	return;
  934|    344|    switch (ent->etype) {
  ------------------
  |  Branch (934:13): [True: 344, False: 0]
  ------------------
  935|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (935:9): [True: 0, False: 344]
  ------------------
  936|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (936:9): [True: 0, False: 344]
  ------------------
  937|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (937:9): [True: 0, False: 344]
  ------------------
  938|      0|	    return;
  939|     78|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (939:9): [True: 78, False: 266]
  ------------------
  940|    341|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (940:9): [True: 263, False: 81]
  ------------------
  941|    344|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (941:9): [True: 3, False: 341]
  ------------------
  942|    344|	    break;
  943|    344|    }
  944|    344|    prev = xmlGetDocEntity(doc, ent->name);
  945|    344|    if (prev == NULL) {
  ------------------
  |  Branch (945:9): [True: 181, False: 163]
  ------------------
  946|    181|        ret = xmlAddDocEntity(doc, ent->name, ent->etype, ent->ExternalID,
  947|    181|                              ent->SystemID, ent->content);
  948|    181|        if (ret == NULL) {
  ------------------
  |  Branch (948:13): [True: 6, False: 175]
  ------------------
  949|      6|            xmlXIncludeErrMemory(ctxt);
  950|      6|            return;
  951|      6|        }
  952|    175|	if (ent->URI != NULL) {
  ------------------
  |  Branch (952:6): [True: 115, False: 60]
  ------------------
  953|    115|	    ret->URI = xmlStrdup(ent->URI);
  954|    115|            if (ret->URI == 0)
  ------------------
  |  Branch (954:17): [True: 1, False: 114]
  ------------------
  955|      1|                xmlXIncludeErrMemory(ctxt);
  956|    115|        }
  957|    175|    } else {
  958|    163|        if (ent->etype != prev->etype)
  ------------------
  |  Branch (958:13): [True: 22, False: 141]
  ------------------
  959|     22|            goto error;
  960|       |
  961|    141|        if ((ent->SystemID != NULL) && (prev->SystemID != NULL)) {
  ------------------
  |  Branch (961:13): [True: 126, False: 15]
  |  Branch (961:40): [True: 126, False: 0]
  ------------------
  962|    126|            if (!xmlStrEqual(ent->SystemID, prev->SystemID))
  ------------------
  |  Branch (962:17): [True: 7, False: 119]
  ------------------
  963|      7|                goto error;
  964|    126|        } else if ((ent->ExternalID != NULL) &&
  ------------------
  |  Branch (964:20): [True: 0, False: 15]
  ------------------
  965|      0|                   (prev->ExternalID != NULL)) {
  ------------------
  |  Branch (965:20): [True: 0, False: 0]
  ------------------
  966|      0|            if (!xmlStrEqual(ent->ExternalID, prev->ExternalID))
  ------------------
  |  Branch (966:17): [True: 0, False: 0]
  ------------------
  967|      0|                goto error;
  968|     15|        } else if ((ent->content != NULL) && (prev->content != NULL)) {
  ------------------
  |  Branch (968:20): [True: 15, False: 0]
  |  Branch (968:46): [True: 15, False: 0]
  ------------------
  969|     15|            if (!xmlStrEqual(ent->content, prev->content))
  ------------------
  |  Branch (969:17): [True: 6, False: 9]
  ------------------
  970|      6|                goto error;
  971|     15|        } else {
  972|      0|            goto error;
  973|      0|        }
  974|    141|    }
  975|    303|    return;
  976|    303|error:
  977|     35|    switch (ent->etype) {
  ------------------
  |  Branch (977:13): [True: 35, False: 0]
  ------------------
  978|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (978:9): [True: 0, False: 35]
  ------------------
  979|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (979:9): [True: 0, False: 35]
  ------------------
  980|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (980:9): [True: 0, False: 35]
  ------------------
  981|     25|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (981:9): [True: 25, False: 10]
  ------------------
  982|     35|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (982:9): [True: 10, False: 25]
  ------------------
  983|     35|	    return;
  984|      0|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (984:9): [True: 0, False: 35]
  ------------------
  985|      0|	    break;
  986|     35|    }
  987|      0|    xmlXIncludeErr(ctxt, (xmlNodePtr) ent, XML_XINCLUDE_ENTITY_DEF_MISMATCH,
  988|      0|                   "mismatch in redefinition of entity %s\n",
  989|      0|		   ent->name);
  990|      0|}
xinclude.c:xmlXIncludeRecurseDoc:
  599|  8.55k|xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc) {
  600|  8.55k|    xmlDocPtr oldDoc;
  601|  8.55k|    xmlXIncludeRefPtr *oldIncTab;
  602|  8.55k|    int oldIncMax, oldIncNr, oldIsStream;
  603|  8.55k|    int i;
  604|       |
  605|  8.55k|    oldDoc = ctxt->doc;
  606|  8.55k|    oldIncMax = ctxt->incMax;
  607|  8.55k|    oldIncNr = ctxt->incNr;
  608|  8.55k|    oldIncTab = ctxt->incTab;
  609|  8.55k|    oldIsStream = ctxt->isStream;
  610|  8.55k|    ctxt->doc = doc;
  611|  8.55k|    ctxt->incMax = 0;
  612|  8.55k|    ctxt->incNr = 0;
  613|  8.55k|    ctxt->incTab = NULL;
  614|  8.55k|    ctxt->isStream = 0;
  615|       |
  616|  8.55k|    xmlXIncludeDoProcess(ctxt, xmlDocGetRootElement(doc));
  617|       |
  618|  8.55k|    if (ctxt->incTab != NULL) {
  ------------------
  |  Branch (618:9): [True: 3.81k, False: 4.74k]
  ------------------
  619|  9.66k|        for (i = 0; i < ctxt->incNr; i++)
  ------------------
  |  Branch (619:21): [True: 5.85k, False: 3.81k]
  ------------------
  620|  5.85k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
  621|  3.81k|        xmlFree(ctxt->incTab);
  622|  3.81k|    }
  623|       |
  624|  8.55k|    ctxt->doc = oldDoc;
  625|  8.55k|    ctxt->incMax = oldIncMax;
  626|  8.55k|    ctxt->incNr = oldIncNr;
  627|  8.55k|    ctxt->incTab = oldIncTab;
  628|  8.55k|    ctxt->isStream = oldIsStream;
  629|  8.55k|}
xinclude.c:xmlXIncludeBaseFixup:
  639|   250k|                     const xmlChar *targetBase) {
  640|   250k|    xmlChar *base = NULL;
  641|   250k|    xmlChar *relBase = NULL;
  642|   250k|    xmlNs ns;
  643|   250k|    int res;
  644|       |
  645|   250k|    if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (645:9): [True: 152k, False: 98.5k]
  ------------------
  646|   152k|        return;
  647|       |
  648|  98.5k|    if (xmlNodeGetBaseSafe(cur->doc, cur, &base) < 0)
  ------------------
  |  Branch (648:9): [True: 20, False: 98.4k]
  ------------------
  649|     20|        xmlXIncludeErrMemory(ctxt);
  650|       |
  651|  98.5k|    if ((base != NULL) && !xmlStrEqual(base, targetBase)) {
  ------------------
  |  Branch (651:9): [True: 96.6k, False: 1.90k]
  |  Branch (651:27): [True: 95.2k, False: 1.37k]
  ------------------
  652|  95.2k|        if ((xmlStrlen(base) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  95.2k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (652:13): [True: 148, False: 95.0k]
  ------------------
  653|  95.0k|            (xmlStrlen(targetBase) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  95.0k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (653:13): [True: 65, False: 95.0k]
  ------------------
  654|    213|            relBase = xmlStrdup(base);
  655|    213|            if (relBase == NULL) {
  ------------------
  |  Branch (655:17): [True: 1, False: 212]
  ------------------
  656|      1|                xmlXIncludeErrMemory(ctxt);
  657|      1|                goto done;
  658|      1|            }
  659|  95.0k|        } else if (xmlBuildRelativeURISafe(base, targetBase, &relBase) < 0) {
  ------------------
  |  Branch (659:20): [True: 73, False: 94.9k]
  ------------------
  660|     73|            xmlXIncludeErrMemory(ctxt);
  661|     73|            goto done;
  662|     73|        }
  663|  95.1k|        if (relBase == NULL) {
  ------------------
  |  Branch (663:13): [True: 629, False: 94.5k]
  ------------------
  664|    629|            xmlXIncludeErr(ctxt, cur,
  665|    629|                    XML_XINCLUDE_HREF_URI,
  666|    629|                    "Building relative URI failed: %s\n",
  667|    629|                    base);
  668|    629|            goto done;
  669|    629|        }
  670|       |
  671|       |        /*
  672|       |         * If the new base doesn't contain a slash, it can be omitted.
  673|       |         */
  674|  94.5k|        if (xmlStrchr(relBase, '/') != NULL) {
  ------------------
  |  Branch (674:13): [True: 2.93k, False: 91.6k]
  ------------------
  675|  2.93k|            res = xmlNodeSetBase(copy, relBase);
  676|  2.93k|            if (res < 0)
  ------------------
  |  Branch (676:17): [True: 25, False: 2.90k]
  ------------------
  677|     25|                xmlXIncludeErrMemory(ctxt);
  678|  2.93k|            goto done;
  679|  2.93k|        }
  680|  94.5k|    }
  681|       |
  682|       |    /*
  683|       |     * Delete existing xml:base if bases are equal
  684|       |     */
  685|  94.8k|    memset(&ns, 0, sizeof(ns));
  686|  94.8k|    ns.href = XML_XML_NAMESPACE;
  ------------------
  |  |  146|  94.8k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  687|  94.8k|    xmlUnsetNsProp(copy, &ns, BAD_CAST "base");
  ------------------
  |  |   34|  94.8k|#define BAD_CAST (xmlChar *)
  ------------------
  688|       |
  689|  98.5k|done:
  690|  98.5k|    xmlFree(base);
  691|  98.5k|    xmlFree(relBase);
  692|  98.5k|}
xinclude.c:xmlXIncludeCopyXPointer:
  827|  1.39k|                        const xmlChar *targetBase) {
  828|  1.39k|    xmlNodePtr list = NULL, last = NULL, copy;
  829|  1.39k|    int i;
  830|       |
  831|  1.39k|    if ((ctxt == NULL) || (obj == NULL))
  ------------------
  |  Branch (831:9): [True: 0, False: 1.39k]
  |  Branch (831:27): [True: 0, False: 1.39k]
  ------------------
  832|      0|	return(NULL);
  833|  1.39k|    switch (obj->type) {
  834|  1.39k|        case XPATH_NODESET: {
  ------------------
  |  Branch (834:9): [True: 1.39k, False: 0]
  ------------------
  835|  1.39k|	    xmlNodeSetPtr set = obj->nodesetval;
  836|  1.39k|	    if (set == NULL)
  ------------------
  |  Branch (836:10): [True: 0, False: 1.39k]
  ------------------
  837|      0|		break;
  838|   324k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (838:17): [True: 323k, False: 936]
  ------------------
  839|   323k|                xmlNodePtr node;
  840|       |
  841|   323k|		if (set->nodeTab[i] == NULL)
  ------------------
  |  Branch (841:7): [True: 0, False: 323k]
  ------------------
  842|      0|		    continue;
  843|   323k|		switch (set->nodeTab[i]->type) {
  844|    399|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (844:7): [True: 399, False: 322k]
  ------------------
  845|    399|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (845:7): [True: 0, False: 323k]
  ------------------
  846|    399|                        node = xmlDocGetRootElement(
  847|    399|                                (xmlDocPtr) set->nodeTab[i]);
  848|    399|                        if (node == NULL) {
  ------------------
  |  Branch (848:29): [True: 0, False: 399]
  ------------------
  849|      0|                            xmlXIncludeErr(ctxt, set->nodeTab[i],
  850|      0|                                           XML_ERR_INTERNAL_ERROR,
  851|      0|                                          "document without root\n", NULL);
  852|      0|                            continue;
  853|      0|                        }
  854|    399|                        break;
  855|   125k|                    case XML_TEXT_NODE:
  ------------------
  |  Branch (855:21): [True: 125k, False: 197k]
  ------------------
  856|   156k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (856:7): [True: 30.6k, False: 292k]
  ------------------
  857|   273k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (857:7): [True: 116k, False: 206k]
  ------------------
  858|   320k|		    case XML_PI_NODE:
  ------------------
  |  Branch (858:7): [True: 47.5k, False: 275k]
  ------------------
  859|   322k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (859:7): [True: 2.28k, False: 321k]
  ------------------
  860|   322k|                        node = set->nodeTab[i];
  861|   322k|			break;
  862|      0|                    default:
  ------------------
  |  Branch (862:21): [True: 0, False: 323k]
  ------------------
  863|      0|                        xmlXIncludeErr(ctxt, set->nodeTab[i],
  864|      0|                                       XML_XINCLUDE_XPTR_RESULT,
  865|      0|                                       "invalid node type in XPtr result\n",
  866|      0|                                       NULL);
  867|      0|			continue; /* for */
  868|   323k|		}
  869|       |                /*
  870|       |                 * OPTIMIZE TODO: External documents should already be
  871|       |                 * expanded, so xmlDocCopyNode should work as well.
  872|       |                 * xmlXIncludeCopyNode is only required for the initial
  873|       |                 * document.
  874|       |                 */
  875|   323k|		copy = xmlXIncludeCopyNode(ctxt, node, 0, targetBase);
  876|   323k|                if (copy == NULL) {
  ------------------
  |  Branch (876:21): [True: 454, False: 322k]
  ------------------
  877|    454|                    xmlFreeNodeList(list);
  878|    454|                    return(NULL);
  879|    454|                }
  880|   322k|		if (last == NULL) {
  ------------------
  |  Branch (880:7): [True: 808, False: 322k]
  ------------------
  881|    808|                    list = copy;
  882|   322k|                } else {
  883|   322k|                    while (last->next != NULL)
  ------------------
  |  Branch (883:28): [True: 0, False: 322k]
  ------------------
  884|      0|                        last = last->next;
  885|   322k|                    copy->prev = last;
  886|   322k|                    last->next = copy;
  887|   322k|		}
  888|   322k|                last = copy;
  889|   322k|	    }
  890|    936|	    break;
  891|  1.39k|	}
  892|    936|	default:
  ------------------
  |  Branch (892:2): [True: 0, False: 1.39k]
  ------------------
  893|      0|	    break;
  894|  1.39k|    }
  895|    936|    return(list);
  896|  1.39k|}
xinclude.c:xmlXIncludeCopyNode:
  705|   323k|                    int copyChildren, const xmlChar *targetBase) {
  706|   323k|    xmlNodePtr result = NULL;
  707|   323k|    xmlNodePtr insertParent = NULL;
  708|   323k|    xmlNodePtr insertLast = NULL;
  709|   323k|    xmlNodePtr cur;
  710|   323k|    xmlNodePtr item;
  711|   323k|    int depth = 0;
  712|       |
  713|   323k|    if (copyChildren) {
  ------------------
  |  Branch (713:9): [True: 542, False: 323k]
  ------------------
  714|    542|        cur = elem->children;
  715|    542|        if (cur == NULL)
  ------------------
  |  Branch (715:13): [True: 0, False: 542]
  ------------------
  716|      0|            return(NULL);
  717|   323k|    } else {
  718|   323k|        cur = elem;
  719|   323k|    }
  720|       |
  721|  1.66M|    while (1) {
  ------------------
  |  Branch (721:12): [True: 1.66M, Folded]
  ------------------
  722|  1.66M|        xmlNodePtr copy = NULL;
  723|  1.66M|        int recurse = 0;
  724|       |
  725|  1.66M|        if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (725:13): [True: 0, False: 1.66M]
  ------------------
  726|  1.66M|            (cur->type == XML_DTD_NODE)) {
  ------------------
  |  Branch (726:13): [True: 0, False: 1.66M]
  ------------------
  727|      0|            ;
  728|  1.66M|        } else if ((cur->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (728:20): [True: 765k, False: 896k]
  ------------------
  729|   765k|                   (cur->ns != NULL) &&
  ------------------
  |  Branch (729:20): [True: 114k, False: 651k]
  ------------------
  730|   114k|                   (xmlStrEqual(cur->name, XINCLUDE_NODE)) &&
  ------------------
  |  |   38|   114k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (730:20): [True: 973, False: 113k]
  ------------------
  731|    973|                   ((xmlStrEqual(cur->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    973|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (731:21): [True: 386, False: 587]
  ------------------
  732|    735|                    (xmlStrEqual(cur->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    587|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (732:21): [True: 349, False: 238]
  ------------------
  733|    735|            xmlXIncludeRefPtr ref = xmlXIncludeExpandNode(ctxt, cur);
  734|       |
  735|    735|            if (ref == NULL)
  ------------------
  |  Branch (735:17): [True: 211, False: 524]
  ------------------
  736|    211|                goto error;
  737|       |            /*
  738|       |             * TODO: Insert XML_XINCLUDE_START and XML_XINCLUDE_END nodes
  739|       |             */
  740|  3.65k|            for (item = ref->inc; item != NULL; item = item->next) {
  ------------------
  |  Branch (740:35): [True: 3.13k, False: 518]
  ------------------
  741|  3.13k|                copy = xmlStaticCopyNode(item, ctxt->doc, insertParent, 1);
  742|  3.13k|                if (copy == NULL) {
  ------------------
  |  Branch (742:21): [True: 6, False: 3.12k]
  ------------------
  743|      6|                    xmlXIncludeErrMemory(ctxt);
  744|      6|                    goto error;
  745|      6|                }
  746|       |
  747|  3.12k|                if (result == NULL)
  ------------------
  |  Branch (747:21): [True: 38, False: 3.08k]
  ------------------
  748|     38|                    result = copy;
  749|  3.12k|                if (insertLast != NULL) {
  ------------------
  |  Branch (749:21): [True: 3.04k, False: 86]
  ------------------
  750|  3.04k|                    insertLast->next = copy;
  751|  3.04k|                    copy->prev = insertLast;
  752|  3.04k|                } else if (insertParent != NULL) {
  ------------------
  |  Branch (752:28): [True: 48, False: 38]
  ------------------
  753|     48|                    insertParent->children = copy;
  754|     48|                }
  755|  3.12k|                insertLast = copy;
  756|       |
  757|  3.12k|                if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (757:21): [True: 2.09k, False: 1.03k]
  |  Branch (757:37): [True: 1.31k, False: 781]
  ------------------
  758|  1.31k|                    xmlXIncludeBaseFixup(ctxt, item, copy, targetBase);
  759|  3.12k|            }
  760|  1.66M|        } else {
  761|  1.66M|            copy = xmlStaticCopyNode(cur, ctxt->doc, insertParent, 2);
  762|  1.66M|            if (copy == NULL) {
  ------------------
  |  Branch (762:17): [True: 192, False: 1.66M]
  ------------------
  763|    192|                xmlXIncludeErrMemory(ctxt);
  764|    192|                goto error;
  765|    192|            }
  766|       |
  767|  1.66M|            if (result == NULL)
  ------------------
  |  Branch (767:17): [True: 323k, False: 1.33M]
  ------------------
  768|   323k|                result = copy;
  769|  1.66M|            if (insertLast != NULL) {
  ------------------
  |  Branch (769:17): [True: 1.17M, False: 483k]
  ------------------
  770|  1.17M|                insertLast->next = copy;
  771|  1.17M|                copy->prev = insertLast;
  772|  1.17M|            } else if (insertParent != NULL) {
  ------------------
  |  Branch (772:24): [True: 160k, False: 323k]
  ------------------
  773|   160k|                insertParent->children = copy;
  774|   160k|            }
  775|  1.66M|            insertLast = copy;
  776|       |
  777|  1.66M|            if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (777:17): [True: 326k, False: 1.33M]
  |  Branch (777:33): [True: 244k, False: 81.6k]
  ------------------
  778|   244k|                xmlXIncludeBaseFixup(ctxt, cur, copy, targetBase);
  779|       |
  780|  1.66M|            recurse = (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (780:23): [True: 1.66M, False: 219]
  ------------------
  781|  1.66M|                      (cur->children != NULL);
  ------------------
  |  Branch (781:23): [True: 160k, False: 1.50M]
  ------------------
  782|  1.66M|        }
  783|       |
  784|  1.66M|        if (recurse) {
  ------------------
  |  Branch (784:13): [True: 160k, False: 1.50M]
  ------------------
  785|   160k|            cur = cur->children;
  786|   160k|            insertParent = insertLast;
  787|   160k|            insertLast = NULL;
  788|   160k|            depth += 1;
  789|   160k|            continue;
  790|   160k|        }
  791|       |
  792|  1.50M|        if (cur == elem)
  ------------------
  |  Branch (792:13): [True: 315k, False: 1.18M]
  ------------------
  793|   315k|            return(result);
  794|       |
  795|  1.33M|        while (cur->next == NULL) {
  ------------------
  |  Branch (795:16): [True: 158k, False: 1.17M]
  ------------------
  796|   158k|            if (insertParent != NULL)
  ------------------
  |  Branch (796:17): [True: 158k, False: 522]
  ------------------
  797|   158k|                insertParent->last = insertLast;
  798|   158k|            cur = cur->parent;
  799|   158k|            if (cur == elem)
  ------------------
  |  Branch (799:17): [True: 8.11k, False: 150k]
  ------------------
  800|  8.11k|                return(result);
  801|   150k|            insertLast = insertParent;
  802|   150k|            insertParent = insertParent->parent;
  803|   150k|            depth -= 1;
  804|   150k|        }
  805|       |
  806|  1.17M|        cur = cur->next;
  807|  1.17M|    }
  808|       |
  809|    409|error:
  810|    409|    xmlFreeNodeList(result);
  811|       |    return(NULL);
  812|   323k|}
xinclude.c:xmlXIncludeLoadTxt:
 1335|    269|xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1336|    269|    xmlParserInputBufferPtr buf;
 1337|    269|    xmlNodePtr node = NULL;
 1338|    269|    const xmlChar *url = ref->URI;
 1339|    269|    int i;
 1340|    269|    int ret = -1;
 1341|    269|    xmlChar *encoding = NULL;
 1342|    269|    xmlCharEncodingHandlerPtr handler = NULL;
 1343|    269|    xmlParserCtxtPtr pctxt = NULL;
 1344|    269|    xmlParserInputPtr inputStream = NULL;
 1345|    269|    int len;
 1346|    269|    int res;
 1347|    269|    const xmlChar *content;
 1348|       |
 1349|       |    /*
 1350|       |     * Handling of references to the local document are done
 1351|       |     * directly through ctxt->doc.
 1352|       |     */
 1353|    269|    if (url[0] == 0) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 263]
  ------------------
 1354|      6|	xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_TEXT_DOCUMENT,
 1355|      6|		       "text serialization of document not available\n", NULL);
 1356|      6|	goto error;
 1357|      6|    }
 1358|       |
 1359|       |    /*
 1360|       |     * Prevent reloading the document twice.
 1361|       |     */
 1362|    265|    for (i = 0; i < ctxt->txtNr; i++) {
  ------------------
  |  Branch (1362:17): [True: 24, False: 241]
  ------------------
 1363|     24|	if (xmlStrEqual(url, ctxt->txtTab[i].url)) {
  ------------------
  |  Branch (1363:6): [True: 22, False: 2]
  ------------------
 1364|     22|            node = xmlNewDocText(ctxt->doc, ctxt->txtTab[i].text);
 1365|     22|            if (node == NULL)
  ------------------
  |  Branch (1365:17): [True: 1, False: 21]
  ------------------
 1366|      1|                xmlXIncludeErrMemory(ctxt);
 1367|     22|	    goto loaded;
 1368|     22|	}
 1369|     24|    }
 1370|       |
 1371|       |    /*
 1372|       |     * Try to get the encoding if available
 1373|       |     */
 1374|    241|    if (ref->elem != NULL) {
  ------------------
  |  Branch (1374:9): [True: 241, False: 0]
  ------------------
 1375|    241|	encoding = xmlXIncludeGetProp(ctxt, ref->elem, XINCLUDE_PARSE_ENCODING);
  ------------------
  |  |   62|    241|#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
  ------------------
 1376|    241|    }
 1377|    241|    if (encoding != NULL) {
  ------------------
  |  Branch (1377:9): [True: 40, False: 201]
  ------------------
 1378|     40|        xmlParserErrors code;
 1379|       |
 1380|     40|        code = xmlOpenCharEncodingHandler((const char *) encoding,
 1381|     40|                                          /* output */ 0, &handler);
 1382|       |
 1383|     40|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1383:13): [True: 22, False: 18]
  ------------------
 1384|     22|            if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (1384:17): [True: 3, False: 19]
  ------------------
 1385|      3|                xmlXIncludeErrMemory(ctxt);
 1386|     19|            } else if (code == XML_ERR_UNSUPPORTED_ENCODING) {
  ------------------
  |  Branch (1386:24): [True: 19, False: 0]
  ------------------
 1387|     19|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_UNKNOWN_ENCODING,
 1388|     19|                               "encoding %s not supported\n", encoding);
 1389|     19|                goto error;
 1390|     19|            } else {
 1391|      0|                xmlXIncludeErr(ctxt, ref->elem, code,
 1392|      0|                               "unexpected error from iconv or ICU\n", NULL);
 1393|      0|                goto error;
 1394|      0|            }
 1395|     22|        }
 1396|     40|    }
 1397|       |
 1398|       |    /*
 1399|       |     * Load it.
 1400|       |     */
 1401|    222|    pctxt = xmlNewParserCtxt();
 1402|    222|    if (pctxt == NULL) {
  ------------------
  |  Branch (1402:9): [True: 3, False: 219]
  ------------------
 1403|      3|        xmlXIncludeErrMemory(ctxt);
 1404|      3|        goto error;
 1405|      3|    }
 1406|    219|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1406:9): [True: 219, False: 0]
  ------------------
 1407|    219|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
 1408|    219|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (1408:9): [True: 219, False: 0]
  ------------------
 1409|    219|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
 1410|    219|                                 ctxt->resourceCtxt);
 1411|       |
 1412|    219|    xmlCtxtUseOptions(pctxt, ctxt->parseFlags);
 1413|       |
 1414|    219|    inputStream = xmlLoadResource(pctxt, (const char*) url, NULL,
 1415|    219|                                  XML_RESOURCE_XINCLUDE_TEXT);
 1416|    219|    if (inputStream == NULL) {
  ------------------
  |  Branch (1416:9): [True: 84, False: 135]
  ------------------
 1417|       |        /*
 1418|       |         * ENOENT only produces a warning which isn't reflected in errNo.
 1419|       |         */
 1420|     84|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1420:13): [True: 1, False: 83]
  ------------------
 1421|      1|            xmlXIncludeErrMemory(ctxt);
 1422|     83|        else if ((pctxt->errNo != XML_ERR_OK) &&
  ------------------
  |  Branch (1422:18): [True: 42, False: 41]
  ------------------
 1423|     42|                 (pctxt->errNo != XML_IO_ENOENT) &&
  ------------------
  |  Branch (1423:18): [True: 1, False: 41]
  ------------------
 1424|      1|                 (pctxt->errNo != XML_IO_UNKNOWN) &&
  ------------------
  |  Branch (1424:18): [True: 1, False: 0]
  ------------------
 1425|      1|                 (pctxt->errNo != XML_IO_NETWORK_ATTEMPT))
  ------------------
  |  Branch (1425:18): [True: 1, False: 0]
  ------------------
 1426|      1|            xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "load error", NULL);
 1427|     84|	goto error;
 1428|     84|    }
 1429|    135|    buf = inputStream->buf;
 1430|    135|    if (buf == NULL)
  ------------------
  |  Branch (1430:9): [True: 0, False: 135]
  ------------------
 1431|      0|	goto error;
 1432|    135|    if (buf->encoder)
  ------------------
  |  Branch (1432:9): [True: 0, False: 135]
  ------------------
 1433|      0|	xmlCharEncCloseFunc(buf->encoder);
 1434|    135|    buf->encoder = handler;
 1435|    135|    handler = NULL;
 1436|       |
 1437|    135|    node = xmlNewDocText(ctxt->doc, NULL);
 1438|    135|    if (node == NULL) {
  ------------------
  |  Branch (1438:9): [True: 1, False: 134]
  ------------------
 1439|      1|        xmlXIncludeErrMemory(ctxt);
 1440|      1|	goto error;
 1441|      1|    }
 1442|       |
 1443|       |    /*
 1444|       |     * Scan all chars from the resource and add the to the node
 1445|       |     */
 1446|    134|    do {
 1447|    134|        res = xmlParserInputBufferRead(buf, 4096);
 1448|    134|    } while (res > 0);
  ------------------
  |  Branch (1448:14): [True: 0, False: 134]
  ------------------
 1449|    134|    if (res < 0) {
  ------------------
  |  Branch (1449:9): [True: 0, False: 134]
  ------------------
 1450|      0|        if (buf->error == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1450:13): [True: 0, False: 0]
  ------------------
 1451|      0|            xmlXIncludeErrMemory(ctxt);
 1452|      0|        else
 1453|      0|            xmlXIncludeErr(ctxt, NULL, buf->error, "read error", NULL);
 1454|      0|        goto error;
 1455|      0|    }
 1456|       |
 1457|    134|    content = xmlBufContent(buf->buffer);
 1458|    134|    len = xmlBufUse(buf->buffer);
 1459|   904k|    for (i = 0; i < len;) {
  ------------------
  |  Branch (1459:17): [True: 904k, False: 83]
  ------------------
 1460|   904k|        int cur;
 1461|   904k|        int l;
 1462|       |
 1463|   904k|        l = len - i;
 1464|   904k|        cur = xmlGetUTF8Char(&content[i], &l);
 1465|   904k|        if ((cur < 0) || (!IS_CHAR(cur))) {
  ------------------
  |  |  115|   904k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   904k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 903k, False: 1.27k]
  |  |  |  |  ------------------
  |  |  |  |  118|   904k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   903k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 903k, False: 15]
  |  |  |  |  |  |  |  Branch (108:44): [True: 829k, False: 74.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   903k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 705, False: 73.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   903k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 73.6k, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   904k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.27k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 86, False: 1.18k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.27k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 14, False: 1.17k]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.27k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.17k, False: 1]
  |  |  |  |  |  Branch (121:27): [True: 1.17k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1465:13): [True: 30, False: 904k]
  |  Branch (1465:26): [True: 21, False: 904k]
  ------------------
 1466|     51|            xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_INVALID_CHAR,
 1467|     51|                           "%s contains invalid char\n", url);
 1468|     51|            goto error;
 1469|     51|        }
 1470|       |
 1471|   904k|        i += l;
 1472|   904k|    }
 1473|       |
 1474|     83|    if (xmlNodeAddContentLen(node, content, len) < 0)
  ------------------
  |  Branch (1474:9): [True: 2, False: 81]
  ------------------
 1475|      2|        xmlXIncludeErrMemory(ctxt);
 1476|       |
 1477|     83|    if (ctxt->txtNr >= ctxt->txtMax) {
  ------------------
  |  Branch (1477:9): [True: 83, False: 0]
  ------------------
 1478|     83|        xmlXIncludeTxt *tmp;
 1479|     83|        int newSize;
 1480|       |
 1481|     83|        newSize = xmlGrowCapacity(ctxt->txtMax, sizeof(tmp[0]),
 1482|     83|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|     83|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1483|     83|        if (newSize < 0) {
  ------------------
  |  Branch (1483:13): [True: 0, False: 83]
  ------------------
 1484|      0|            xmlXIncludeErrMemory(ctxt);
 1485|      0|	    goto error;
 1486|      0|        }
 1487|     83|        tmp = xmlRealloc(ctxt->txtTab, newSize * sizeof(tmp[0]));
 1488|     83|        if (tmp == NULL) {
  ------------------
  |  Branch (1488:13): [True: 3, False: 80]
  ------------------
 1489|      3|            xmlXIncludeErrMemory(ctxt);
 1490|      3|	    goto error;
 1491|      3|        }
 1492|     80|        ctxt->txtMax = newSize;
 1493|     80|        ctxt->txtTab = tmp;
 1494|     80|    }
 1495|     80|    ctxt->txtTab[ctxt->txtNr].text = xmlStrdup(node->content);
 1496|     80|    if ((node->content != NULL) &&
  ------------------
  |  Branch (1496:9): [True: 58, False: 22]
  ------------------
 1497|     58|        (ctxt->txtTab[ctxt->txtNr].text == NULL)) {
  ------------------
  |  Branch (1497:9): [True: 1, False: 57]
  ------------------
 1498|      1|        xmlXIncludeErrMemory(ctxt);
 1499|      1|        goto error;
 1500|      1|    }
 1501|     79|    ctxt->txtTab[ctxt->txtNr].url = xmlStrdup(url);
 1502|     79|    if (ctxt->txtTab[ctxt->txtNr].url == NULL) {
  ------------------
  |  Branch (1502:9): [True: 1, False: 78]
  ------------------
 1503|      1|        xmlXIncludeErrMemory(ctxt);
 1504|      1|        xmlFree(ctxt->txtTab[ctxt->txtNr].text);
 1505|      1|        goto error;
 1506|      1|    }
 1507|     78|    ctxt->txtNr++;
 1508|       |
 1509|    100|loaded:
 1510|       |    /*
 1511|       |     * Add the element as the replacement copy.
 1512|       |     */
 1513|    100|    ref->inc = node;
 1514|    100|    node = NULL;
 1515|    100|    ret = 0;
 1516|       |
 1517|    269|error:
 1518|    269|    xmlFreeNode(node);
 1519|    269|    xmlFreeInputStream(inputStream);
 1520|    269|    xmlFreeParserCtxt(pctxt);
 1521|    269|    xmlCharEncCloseFunc(handler);
 1522|    269|    xmlFree(encoding);
 1523|    269|    return(ret);
 1524|    100|}
xinclude.c:xmlXIncludeLoadFallback:
 1537|    580|                        xmlXIncludeRefPtr ref) {
 1538|    580|    int ret = 0;
 1539|    580|    int oldNbErrors;
 1540|       |
 1541|    580|    if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (1541:9): [True: 0, False: 580]
  |  Branch (1541:31): [True: 0, False: 580]
  ------------------
 1542|    580|        (ctxt == NULL))
  ------------------
  |  Branch (1542:9): [True: 0, False: 580]
  ------------------
 1543|      0|	return(-1);
 1544|    580|    if (fallback->children != NULL) {
  ------------------
  |  Branch (1544:9): [True: 542, False: 38]
  ------------------
 1545|       |	/*
 1546|       |	 * It's possible that the fallback also has 'includes'
 1547|       |	 * (Bug 129969), so we re-process the fallback just in case
 1548|       |	 */
 1549|    542|        oldNbErrors = ctxt->nbErrors;
 1550|    542|	ref->inc = xmlXIncludeCopyNode(ctxt, fallback, 1, ref->base);
 1551|    542|	if (ctxt->nbErrors > oldNbErrors)
  ------------------
  |  Branch (1551:6): [True: 170, False: 372]
  ------------------
 1552|    170|	    ret = -1;
 1553|    542|    } else {
 1554|       |        ref->inc = NULL;
 1555|     38|    }
 1556|    580|    ref->fallback = 1;
 1557|    580|    return(ret);
 1558|    580|}
xinclude.c:xmlXIncludeIncludeNode:
 1697|  21.0k|xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1698|  21.0k|    xmlNodePtr cur, end, list, tmp;
 1699|       |
 1700|  21.0k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1700:9): [True: 0, False: 21.0k]
  |  Branch (1700:27): [True: 0, False: 21.0k]
  ------------------
 1701|      0|	return(-1);
 1702|  21.0k|    cur = ref->elem;
 1703|  21.0k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1703:9): [True: 0, False: 21.0k]
  |  Branch (1703:26): [True: 0, False: 21.0k]
  ------------------
 1704|      0|	return(-1);
 1705|       |
 1706|  21.0k|    list = ref->inc;
 1707|  21.0k|    ref->inc = NULL;
 1708|       |
 1709|       |    /*
 1710|       |     * Check against the risk of generating a multi-rooted document
 1711|       |     */
 1712|  21.0k|    if ((cur->parent != NULL) &&
  ------------------
  |  Branch (1712:9): [True: 21.0k, False: 0]
  ------------------
 1713|  21.0k|	(cur->parent->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1713:2): [True: 9.88k, False: 11.1k]
  ------------------
 1714|  9.88k|	int nb_elem = 0;
 1715|       |
 1716|  9.88k|	tmp = list;
 1717|  14.4k|	while (tmp != NULL) {
  ------------------
  |  Branch (1717:9): [True: 4.52k, False: 9.88k]
  ------------------
 1718|  4.52k|	    if (tmp->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (1718:10): [True: 3.57k, False: 946]
  ------------------
 1719|  3.57k|		nb_elem++;
 1720|  4.52k|	    tmp = tmp->next;
 1721|  4.52k|	}
 1722|  9.88k|        if (nb_elem != 1) {
  ------------------
  |  Branch (1722:13): [True: 6.77k, False: 3.10k]
  ------------------
 1723|  6.77k|            if (nb_elem > 1)
  ------------------
  |  Branch (1723:17): [True: 75, False: 6.70k]
  ------------------
 1724|     75|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1725|     75|                               "XInclude error: would result in multiple root "
 1726|     75|                               "nodes\n", NULL);
 1727|  6.70k|            else
 1728|  6.70k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1729|  6.70k|                               "XInclude error: would result in no root "
 1730|  6.70k|                               "node\n", NULL);
 1731|  6.77k|            xmlFreeNodeList(list);
 1732|  6.77k|	    return(-1);
 1733|  6.77k|	}
 1734|  9.88k|    }
 1735|       |
 1736|  14.2k|    if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) {
  ------------------
  |  Branch (1736:9): [True: 0, False: 14.2k]
  ------------------
 1737|       |	/*
 1738|       |	 * Add the list of nodes
 1739|       |         *
 1740|       |         * TODO: Coalesce text nodes unless we are streaming mode.
 1741|       |	 */
 1742|      0|	while (list != NULL) {
  ------------------
  |  Branch (1742:9): [True: 0, False: 0]
  ------------------
 1743|      0|	    end = list;
 1744|      0|	    list = list->next;
 1745|       |
 1746|      0|	    if (xmlAddPrevSibling(cur, end) == NULL) {
  ------------------
  |  Branch (1746:10): [True: 0, False: 0]
  ------------------
 1747|      0|                xmlUnlinkNode(end);
 1748|      0|                xmlFreeNode(end);
 1749|      0|                goto err_memory;
 1750|      0|            }
 1751|      0|	}
 1752|      0|	xmlUnlinkNode(cur);
 1753|      0|	xmlFreeNode(cur);
 1754|  14.2k|    } else {
 1755|  14.2k|        xmlNodePtr child, next;
 1756|       |
 1757|       |	/*
 1758|       |	 * Change the current node as an XInclude start one, and add an
 1759|       |	 * XInclude end one
 1760|       |	 */
 1761|  14.2k|        if (ref->fallback)
  ------------------
  |  Branch (1761:13): [True: 201, False: 14.0k]
  ------------------
 1762|    201|            xmlUnsetProp(cur, BAD_CAST "href");
  ------------------
  |  |   34|    201|#define BAD_CAST (xmlChar *)
  ------------------
 1763|  14.2k|	cur->type = XML_XINCLUDE_START;
 1764|       |        /* Remove fallback children */
 1765|  34.2k|        for (child = cur->children; child != NULL; child = next) {
  ------------------
  |  Branch (1765:37): [True: 20.0k, False: 14.2k]
  ------------------
 1766|  20.0k|            next = child->next;
 1767|  20.0k|            xmlUnlinkNode(child);
 1768|  20.0k|            xmlFreeNode(child);
 1769|  20.0k|        }
 1770|  14.2k|	end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
 1771|  14.2k|	if (end == NULL)
  ------------------
  |  Branch (1771:6): [True: 39, False: 14.2k]
  ------------------
 1772|     39|            goto err_memory;
 1773|  14.2k|	end->type = XML_XINCLUDE_END;
 1774|  14.2k|	if (xmlAddNextSibling(cur, end) == NULL) {
  ------------------
  |  Branch (1774:6): [True: 0, False: 14.2k]
  ------------------
 1775|      0|            xmlFreeNode(end);
 1776|      0|            goto err_memory;
 1777|      0|        }
 1778|       |
 1779|       |	/*
 1780|       |	 * Add the list of nodes
 1781|       |	 */
 1782|   229k|	while (list != NULL) {
  ------------------
  |  Branch (1782:9): [True: 214k, False: 14.2k]
  ------------------
 1783|   214k|	    cur = list;
 1784|   214k|	    list = list->next;
 1785|       |
 1786|   214k|	    if (xmlAddPrevSibling(end, cur) == NULL) {
  ------------------
  |  Branch (1786:10): [True: 0, False: 214k]
  ------------------
 1787|      0|                xmlUnlinkNode(cur);
 1788|      0|                xmlFreeNode(cur);
 1789|      0|                goto err_memory;
 1790|      0|            }
 1791|   214k|	}
 1792|  14.2k|    }
 1793|       |
 1794|       |
 1795|  14.2k|    return(0);
 1796|       |
 1797|     39|err_memory:
 1798|     39|    xmlXIncludeErrMemory(ctxt);
 1799|     39|    xmlFreeNodeList(list);
 1800|     39|    return(-1);
 1801|  14.2k|}

xmlSerializeText:
  306|  1.00M|                 unsigned flags) {
  307|  1.00M|    const xmlChar *cur;
  308|  1.00M|    const signed char *tab;
  309|       |
  310|  1.00M|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 1.00M]
  ------------------
  311|      0|        return;
  312|       |
  313|  1.00M|#ifdef LIBXML_HTML_ENABLED
  314|  1.00M|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|  1.00M|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 1.00M]
  ------------------
  315|      0|        if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|      0|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            tab = htmlEscapeTabAttr;
  317|      0|        else
  318|      0|            tab = htmlEscapeTab;
  319|      0|    }
  320|  1.00M|    else
  321|  1.00M|#endif
  322|  1.00M|    {
  323|  1.00M|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|  1.00M|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 1.00M]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|  1.00M|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|  1.00M|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 573k, False: 432k]
  ------------------
  326|   573k|            tab = xmlEscapeTabAttr;
  327|   432k|        else
  328|   432k|            tab = xmlEscapeTab;
  329|  1.00M|    }
  330|       |
  331|  1.00M|    cur = string;
  332|       |
  333|  1.32M|    while (1) {
  ------------------
  |  Branch (333:12): [True: 1.32M, Folded]
  ------------------
  334|  1.32M|        const xmlChar *base;
  335|  1.32M|        int c;
  336|  1.32M|        int offset;
  337|       |
  338|  1.32M|        base = cur;
  339|  1.32M|        offset = -1;
  340|       |
  341|  83.7M|        while (1) {
  ------------------
  |  Branch (341:16): [True: 83.7M, Folded]
  ------------------
  342|  83.7M|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 83.7M]
  ------------------
  343|      0|                break;
  344|       |
  345|  83.7M|            c = (unsigned char) *cur;
  346|       |
  347|  83.7M|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 76.9M, False: 6.81M]
  ------------------
  348|  76.9M|                offset = tab[c];
  349|  76.9M|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 1.32M, False: 75.6M]
  ------------------
  350|  1.32M|                    break;
  351|  76.9M|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|  6.81M|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 6.81M]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|  82.4M|            cur += 1;
  356|  82.4M|        }
  357|       |
  358|  1.32M|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 1.29M, False: 24.8k]
  ------------------
  359|  1.29M|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|  1.32M|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.32M]
  ------------------
  362|      0|            break;
  363|       |
  364|  1.32M|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 1.32M, False: 0]
  ------------------
  365|  1.32M|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 1.00M, False: 315k]
  ------------------
  366|  1.00M|                break;
  367|       |
  368|   315k|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|   315k|                                 &xmlEscapeContent[offset+1]);
  370|   315k|            cur += 1;
  371|   315k|        } else {
  372|      0|            char tempBuf[12];
  373|      0|            int tempSize;
  374|      0|            int val = 0, len = 4;
  375|       |
  376|      0|            val = xmlGetUTF8Char(cur, &len);
  377|      0|            if (val < 0) {
  ------------------
  |  Branch (377:17): [True: 0, False: 0]
  ------------------
  378|      0|                val = 0xFFFD;
  379|      0|                cur += 1;
  380|      0|            } else {
  381|      0|                if ((val == 0xFFFE) || (val == 0xFFFF))
  ------------------
  |  Branch (381:21): [True: 0, False: 0]
  |  Branch (381:40): [True: 0, False: 0]
  ------------------
  382|      0|                    val = 0xFFFD;
  383|      0|                cur += len;
  384|      0|            }
  385|       |
  386|      0|            tempSize = xmlSerializeHexCharRef(tempBuf, val);
  387|      0|            xmlOutputBufferWrite(buf, tempSize, tempBuf);
  388|      0|        }
  389|  1.32M|    }
  390|  1.00M|}
xmlAllocParserInputBuffer:
 1332|  43.2k|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|  43.2k|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|  43.2k|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|  43.2k|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 4, False: 43.2k]
  ------------------
 1337|      4|	return(NULL);
 1338|      4|    }
 1339|  43.2k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|  43.2k|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  43.2k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|  43.2k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 7, False: 43.1k]
  ------------------
 1342|      7|        xmlFree(ret);
 1343|      7|	return(NULL);
 1344|      7|    }
 1345|  43.1k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 43.1k]
  ------------------
 1346|      0|        if (xmlLookupCharEncodingHandler(enc, &ret->encoder) != XML_ERR_OK) {
  ------------------
  |  Branch (1346:13): [True: 0, False: 0]
  ------------------
 1347|       |            /* We can't handle errors properly here. */
 1348|      0|            xmlFreeParserInputBuffer(ret);
 1349|      0|            return(NULL);
 1350|      0|        }
 1351|      0|    }
 1352|  43.1k|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 43.1k]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|  43.1k|    else
 1355|  43.1k|        ret->raw = NULL;
 1356|  43.1k|    ret->readcallback = NULL;
 1357|  43.1k|    ret->closecallback = NULL;
 1358|  43.1k|    ret->context = NULL;
 1359|  43.1k|    ret->compressed = -1;
 1360|  43.1k|    ret->rawconsumed = 0;
 1361|       |
 1362|  43.1k|    return(ret);
 1363|  43.1k|}
xmlAllocOutputBuffer:
 1375|  38.6k|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|  38.6k|    xmlOutputBufferPtr ret;
 1377|       |
 1378|  38.6k|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|  38.6k|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 40, False: 38.6k]
  ------------------
 1380|     40|	return(NULL);
 1381|     40|    }
 1382|  38.6k|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|  38.6k|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|  38.6k|#define MINLEN 4000
  ------------------
 1384|  38.6k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 81, False: 38.5k]
  ------------------
 1385|     81|        xmlFree(ret);
 1386|     81|	return(NULL);
 1387|     81|    }
 1388|       |
 1389|  38.5k|    ret->encoder = encoder;
 1390|  38.5k|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 38.5k]
  ------------------
 1391|      0|        ret->conv = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
 1392|      0|	if (ret->conv == NULL) {
  ------------------
  |  Branch (1392:6): [True: 0, False: 0]
  ------------------
 1393|      0|            xmlBufFree(ret->buffer);
 1394|      0|            xmlFree(ret);
 1395|      0|	    return(NULL);
 1396|      0|	}
 1397|       |
 1398|       |	/*
 1399|       |	 * This call is designed to initiate the encoder state
 1400|       |	 */
 1401|      0|	xmlCharEncOutput(ret, 1);
 1402|      0|    } else
 1403|  38.5k|        ret->conv = NULL;
 1404|  38.5k|    ret->writecallback = NULL;
 1405|  38.5k|    ret->closecallback = NULL;
 1406|  38.5k|    ret->context = NULL;
 1407|  38.5k|    ret->written = 0;
 1408|       |
 1409|  38.5k|    return(ret);
 1410|  38.5k|}
xmlFreeParserInputBuffer:
 1419|   426k|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|   426k|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 2.39k, False: 424k]
  ------------------
 1421|       |
 1422|   424k|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 14.8k, False: 409k]
  ------------------
 1423|  14.8k|        xmlBufFree(in->raw);
 1424|  14.8k|	in->raw = NULL;
 1425|  14.8k|    }
 1426|   424k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 14.8k, False: 409k]
  ------------------
 1427|  14.8k|        xmlCharEncCloseFunc(in->encoder);
 1428|  14.8k|    }
 1429|   424k|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 424k]
  ------------------
 1430|      0|	in->closecallback(in->context);
 1431|      0|    }
 1432|   424k|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 424k, False: 0]
  ------------------
 1433|   424k|        xmlBufFree(in->buffer);
 1434|   424k|	in->buffer = NULL;
 1435|   424k|    }
 1436|       |
 1437|   424k|    xmlFree(in);
 1438|   424k|}
xmlOutputBufferClose:
 1451|  38.5k|{
 1452|  38.5k|    int ret;
 1453|       |
 1454|  38.5k|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 38.5k]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|  38.5k|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 0, False: 38.5k]
  ------------------
 1458|      0|        xmlOutputBufferFlush(out);
 1459|       |
 1460|  38.5k|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 38.5k]
  ------------------
 1461|      0|        int code = out->closecallback(out->context);
 1462|       |
 1463|      0|        if ((code != XML_ERR_OK) &&
  ------------------
  |  Branch (1463:13): [True: 0, False: 0]
  ------------------
 1464|      0|            (!xmlIsCatastrophicError(XML_ERR_FATAL, out->error))) {
  ------------------
  |  Branch (1464:13): [True: 0, False: 0]
  ------------------
 1465|      0|            if (code < 0)
  ------------------
  |  Branch (1465:17): [True: 0, False: 0]
  ------------------
 1466|      0|                out->error = XML_IO_UNKNOWN;
 1467|      0|            else
 1468|      0|                out->error = code;
 1469|      0|        }
 1470|      0|    }
 1471|       |
 1472|  38.5k|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 28, False: 38.5k]
  ------------------
 1473|     28|        ret = -out->error;
 1474|  38.5k|    else
 1475|  38.5k|        ret = out->written;
 1476|       |
 1477|  38.5k|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 38.5k]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|  38.5k|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 38.5k]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|  38.5k|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 38.5k, False: 0]
  ------------------
 1485|  38.5k|        xmlBufFree(out->buffer);
 1486|  38.5k|        out->buffer = NULL;
 1487|  38.5k|    }
 1488|       |
 1489|  38.5k|    xmlFree(out);
 1490|       |
 1491|  38.5k|    return(ret);
 1492|  38.5k|}
xmlNewInputBufferMemory:
 1940|   366k|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|   366k|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|   366k|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 323k, False: 43.2k]
  ------------------
 1944|   323k|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 323k]
  ------------------
 1945|      0|        xmlMemIOCtxt *ctxt;
 1946|       |
 1947|       |        /*
 1948|       |         * Static buffer without zero terminator.
 1949|       |         * Stream memory to avoid a copy.
 1950|       |         */
 1951|      0|        ret = xmlAllocParserInputBuffer(enc);
 1952|      0|        if (ret == NULL)
  ------------------
  |  Branch (1952:13): [True: 0, False: 0]
  ------------------
 1953|      0|            return(NULL);
 1954|       |
 1955|      0|        ctxt = xmlMalloc(sizeof(*ctxt));
 1956|      0|        if (ctxt == NULL) {
  ------------------
  |  Branch (1956:13): [True: 0, False: 0]
  ------------------
 1957|      0|            xmlFreeParserInputBuffer(ret);
 1958|      0|            return(NULL);
 1959|      0|        }
 1960|       |
 1961|      0|        ctxt->cur = mem;
 1962|      0|        ctxt->size = size;
 1963|       |
 1964|      0|        ret->context = ctxt;
 1965|      0|        ret->readcallback = xmlMemRead;
 1966|      0|        ret->closecallback = xmlMemClose;
 1967|   366k|    } else {
 1968|   366k|        ret = xmlMalloc(sizeof(*ret));
 1969|   366k|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 15, False: 366k]
  ------------------
 1970|     15|            return(NULL);
 1971|   366k|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|   366k|        ret->compressed = -1;
 1973|       |
 1974|   366k|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|   366k|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 323k, False: 43.2k]
  ------------------
 1976|   366k|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 19, False: 366k]
  ------------------
 1977|     19|            xmlFree(ret);
 1978|     19|            return(NULL);
 1979|     19|        }
 1980|   366k|    }
 1981|       |
 1982|   366k|    return(ret);
 1983|   366k|}
xmlParserInputBufferCreateMem:
 2005|  43.2k|xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
 2006|  43.2k|    if ((mem == NULL) || (size < 0))
  ------------------
  |  Branch (2006:9): [True: 0, False: 43.2k]
  |  Branch (2006:26): [True: 0, False: 43.2k]
  ------------------
 2007|      0|        return(NULL);
 2008|       |
 2009|  43.2k|    return(xmlNewInputBufferMemory(mem, size, 0, enc));
 2010|  43.2k|}
xmlNewInputBufferString:
 2049|  14.3k|xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) {
 2050|  14.3k|    xmlParserInputBufferPtr ret;
 2051|       |
 2052|  14.3k|    ret = xmlMalloc(sizeof(*ret));
 2053|  14.3k|    if (ret == NULL)
  ------------------
  |  Branch (2053:9): [True: 2, False: 14.3k]
  ------------------
 2054|      2|	return(NULL);
 2055|  14.3k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 2056|  14.3k|    ret->compressed = -1;
 2057|       |
 2058|  14.3k|    ret->buffer = xmlBufCreateMem((const xmlChar *) str, strlen(str),
 2059|  14.3k|                                  (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (2059:36): [True: 14.3k, False: 0]
  ------------------
 2060|  14.3k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2060:9): [True: 2, False: 14.3k]
  ------------------
 2061|      2|        xmlFree(ret);
 2062|      2|	return(NULL);
 2063|      2|    }
 2064|       |
 2065|  14.3k|    return(ret);
 2066|  14.3k|}
xmlParserInputBufferPush:
 2231|   488k|	                 int len, const char *buf) {
 2232|   488k|    size_t nbchars = 0;
 2233|   488k|    int ret;
 2234|       |
 2235|   488k|    if (len < 0) return(0);
  ------------------
  |  Branch (2235:9): [True: 0, False: 488k]
  ------------------
 2236|   488k|    if ((in == NULL) || (in->error)) return(-1);
  ------------------
  |  Branch (2236:9): [True: 0, False: 488k]
  |  Branch (2236:25): [True: 244, False: 487k]
  ------------------
 2237|   487k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2237:9): [True: 33.9k, False: 454k]
  ------------------
 2238|       |        /*
 2239|       |	 * Store the data in the incoming raw buffer
 2240|       |	 */
 2241|  33.9k|        if (in->raw == NULL) {
  ------------------
  |  Branch (2241:13): [True: 0, False: 33.9k]
  ------------------
 2242|      0|	    in->raw = xmlBufCreate(50);
 2243|      0|            if (in->raw == NULL) {
  ------------------
  |  Branch (2243:17): [True: 0, False: 0]
  ------------------
 2244|      0|                in->error = XML_ERR_NO_MEMORY;
 2245|      0|                return(-1);
 2246|      0|            }
 2247|      0|	}
 2248|  33.9k|	ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
 2249|  33.9k|	if (ret != 0) {
  ------------------
  |  Branch (2249:6): [True: 0, False: 33.9k]
  ------------------
 2250|      0|            in->error = XML_ERR_NO_MEMORY;
 2251|      0|	    return(-1);
 2252|      0|        }
 2253|       |
 2254|       |	/*
 2255|       |	 * convert as much as possible to the parser reading buffer.
 2256|       |	 */
 2257|  33.9k|        nbchars = SIZE_MAX;
 2258|  33.9k|	if (xmlCharEncInput(in, &nbchars, /* flush */ 0) !=
  ------------------
  |  Branch (2258:6): [True: 13, False: 33.9k]
  ------------------
 2259|  33.9k|            XML_ENC_ERR_SUCCESS)
 2260|     13|            return(-1);
 2261|  33.9k|        if (nbchars > INT_MAX)
  ------------------
  |  Branch (2261:13): [True: 0, False: 33.9k]
  ------------------
 2262|      0|            nbchars = INT_MAX;
 2263|   454k|    } else {
 2264|   454k|	nbchars = len;
 2265|   454k|        ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
 2266|   454k|	if (ret != 0) {
  ------------------
  |  Branch (2266:6): [True: 1, False: 454k]
  ------------------
 2267|      1|            in->error = XML_ERR_NO_MEMORY;
 2268|      1|	    return(-1);
 2269|      1|        }
 2270|   454k|    }
 2271|   487k|    return(nbchars);
 2272|   487k|}
xmlParserInputBufferGrow:
 2298|   611k|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|   611k|    int res = 0;
 2300|       |
 2301|   611k|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 611k]
  |  Branch (2301:25): [True: 706, False: 610k]
  ------------------
 2302|    706|        return(-1);
 2303|       |
 2304|   610k|    if (len < MINLEN)
  ------------------
  |  |   52|   610k|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 334k, False: 275k]
  ------------------
 2305|   334k|        len = MINLEN;
  ------------------
  |  |   52|   334k|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|   610k|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 610k]
  ------------------
 2311|      0|        xmlBufPtr buf;
 2312|       |
 2313|      0|        if (in->encoder == NULL) {
  ------------------
  |  Branch (2313:13): [True: 0, False: 0]
  ------------------
 2314|      0|            buf = in->buffer;
 2315|      0|        } else {
 2316|       |            /*
 2317|       |             * Some users only set 'encoder' and expect us to create
 2318|       |             * the raw buffer lazily.
 2319|       |             */
 2320|      0|            if (in->raw == NULL) {
  ------------------
  |  Branch (2320:17): [True: 0, False: 0]
  ------------------
 2321|      0|                in->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 2322|      0|                if (in->raw == NULL) {
  ------------------
  |  Branch (2322:21): [True: 0, False: 0]
  ------------------
 2323|      0|                    in->error = XML_ERR_NO_MEMORY;
 2324|      0|                    return(-1);
 2325|      0|                }
 2326|      0|            }
 2327|      0|            buf = in->raw;
 2328|      0|        }
 2329|       |
 2330|      0|        if (xmlBufGrow(buf, len) < 0) {
  ------------------
  |  Branch (2330:13): [True: 0, False: 0]
  ------------------
 2331|      0|            in->error = XML_ERR_NO_MEMORY;
 2332|      0|            return(-1);
 2333|      0|        }
 2334|       |
 2335|      0|	res = in->readcallback(in->context, (char *)xmlBufEnd(buf), len);
 2336|      0|	if (res <= 0)
  ------------------
  |  Branch (2336:6): [True: 0, False: 0]
  ------------------
 2337|      0|	    in->readcallback = endOfInput;
 2338|      0|        if (res < 0) {
  ------------------
  |  Branch (2338:13): [True: 0, False: 0]
  ------------------
 2339|      0|            if (res == -1)
  ------------------
  |  Branch (2339:17): [True: 0, False: 0]
  ------------------
 2340|      0|                in->error = XML_IO_UNKNOWN;
 2341|      0|            else
 2342|      0|                in->error = -res;
 2343|      0|            return(-1);
 2344|      0|        }
 2345|       |
 2346|      0|        if (xmlBufAddLen(buf, res) < 0) {
  ------------------
  |  Branch (2346:13): [True: 0, False: 0]
  ------------------
 2347|      0|            in->error = XML_ERR_NO_MEMORY;
 2348|      0|            return(-1);
 2349|      0|        }
 2350|      0|    }
 2351|       |
 2352|       |    /*
 2353|       |     * Handle encoding.
 2354|       |     */
 2355|   610k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 352k, False: 257k]
  ------------------
 2356|   352k|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|   352k|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 352k, False: 0]
  ------------------
 2362|   352k|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|   352k|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 766, False: 351k]
  ------------------
 2367|   352k|            XML_ENC_ERR_SUCCESS)
 2368|    766|	    return(-1);
 2369|   351k|        res = sizeOut;
 2370|   351k|    }
 2371|   609k|    return(res);
 2372|   610k|}
xmlParserInputBufferRead:
 2385|  77.7k|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|  77.7k|    return(xmlParserInputBufferGrow(in, len));
 2387|  77.7k|}
xmlOutputBufferWrite:
 2403|  10.7M|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|  10.7M|    xmlBufPtr buf = NULL;
 2405|  10.7M|    size_t written = 0;
 2406|  10.7M|    int ret;
 2407|       |
 2408|  10.7M|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 10.7M]
  |  Branch (2408:26): [True: 5.09k, False: 10.7M]
  ------------------
 2409|  5.09k|        return(-1);
 2410|  10.7M|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 10.7M]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|  10.7M|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|  10.7M|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 28, False: 10.7M]
  ------------------
 2415|     28|        out->error = XML_ERR_NO_MEMORY;
 2416|     28|        return(-1);
 2417|     28|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|  10.7M|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 10.7M]
  ------------------
 2423|       |        /*
 2424|       |         * Store the data in the incoming raw buffer
 2425|       |         */
 2426|      0|        if (out->conv == NULL) {
  ------------------
  |  Branch (2426:13): [True: 0, False: 0]
  ------------------
 2427|      0|            out->conv = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
 2428|      0|            if (out->conv == NULL) {
  ------------------
  |  Branch (2428:17): [True: 0, False: 0]
  ------------------
 2429|      0|                out->error = XML_ERR_NO_MEMORY;
 2430|      0|                return(-1);
 2431|      0|            }
 2432|      0|        }
 2433|       |
 2434|       |        /*
 2435|       |         * convert as much as possible to the parser reading buffer.
 2436|       |         */
 2437|      0|        if (xmlBufUse(out->buffer) < 256) {
  ------------------
  |  Branch (2437:13): [True: 0, False: 0]
  ------------------
 2438|      0|            ret = 0;
 2439|      0|        } else {
 2440|      0|            ret = xmlCharEncOutput(out, 0);
 2441|      0|            if (ret < 0)
  ------------------
  |  Branch (2441:17): [True: 0, False: 0]
  ------------------
 2442|      0|                return(-1);
 2443|      0|        }
 2444|       |
 2445|      0|        if (out->writecallback)
  ------------------
  |  Branch (2445:13): [True: 0, False: 0]
  ------------------
 2446|      0|            buf = out->conv;
 2447|      0|        else
 2448|      0|            written = ret;
 2449|  10.7M|    } else {
 2450|  10.7M|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 0, False: 10.7M]
  ------------------
 2451|      0|            buf = out->buffer;
 2452|  10.7M|        else
 2453|  10.7M|            written = len;
 2454|  10.7M|    }
 2455|       |
 2456|  10.7M|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 10.7M]
  |  Branch (2456:26): [True: 0, False: 0]
  ------------------
 2457|       |        /*
 2458|       |         * second write the stuff to the I/O channel
 2459|       |         */
 2460|      0|        while (1) {
  ------------------
  |  Branch (2460:16): [True: 0, Folded]
  ------------------
 2461|      0|            size_t nbchars = xmlBufUse(buf);
 2462|       |
 2463|      0|            if (nbchars < MINLEN)
  ------------------
  |  |   52|      0|#define MINLEN 4000
  ------------------
  |  Branch (2463:17): [True: 0, False: 0]
  ------------------
 2464|      0|                break;
 2465|       |
 2466|      0|            if (nbchars >= INT_MAX) {
  ------------------
  |  Branch (2466:17): [True: 0, False: 0]
  ------------------
 2467|      0|                out->error = XML_ERR_INTERNAL_ERROR;
 2468|      0|                return(-1);
 2469|      0|            }
 2470|       |
 2471|      0|            ret = out->writecallback(out->context,
 2472|      0|                       (const char *)xmlBufContent(buf), nbchars);
 2473|      0|            if (ret < 0) {
  ------------------
  |  Branch (2473:17): [True: 0, False: 0]
  ------------------
 2474|      0|                out->error = (ret == -1) ? XML_IO_WRITE : -ret;
  ------------------
  |  Branch (2474:30): [True: 0, False: 0]
  ------------------
 2475|      0|                return(-1);
 2476|      0|            }
 2477|      0|            if ((ret == 0) || ((size_t) ret > nbchars)) {
  ------------------
  |  Branch (2477:17): [True: 0, False: 0]
  |  Branch (2477:31): [True: 0, False: 0]
  ------------------
 2478|      0|                out->error = XML_ERR_INTERNAL_ERROR;
 2479|      0|                return(-1);
 2480|      0|            }
 2481|       |
 2482|      0|            xmlBufShrink(buf, ret);
 2483|      0|            written += ret;
 2484|      0|            if (out->written > INT_MAX - ret)
  ------------------
  |  Branch (2484:17): [True: 0, False: 0]
  ------------------
 2485|      0|                out->written = INT_MAX;
 2486|      0|            else
 2487|      0|                out->written += ret;
 2488|      0|        }
 2489|      0|    }
 2490|       |
 2491|  10.7M|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 10.7M, False: 0]
  ------------------
 2492|  10.7M|}
xmlOutputBufferWriteString:
 2580|  2.75M|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|  2.75M|    int len;
 2582|       |
 2583|  2.75M|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 2.75M]
  |  Branch (2583:26): [True: 910, False: 2.75M]
  ------------------
 2584|  2.75M|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 2.75M]
  ------------------
 2585|      0|        return(-1);
 2586|  2.75M|    len = strlen(str);
 2587|       |
 2588|  2.75M|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 2.74M, False: 2.72k]
  ------------------
 2589|  2.74M|	return(xmlOutputBufferWrite(out, len, str));
 2590|  2.72k|    return(len);
 2591|  2.75M|}
xmlOutputBufferWriteQuotedString:
 2609|  9.39k|                                 const xmlChar *string) {
 2610|  9.39k|    const xmlChar *cur, *base;
 2611|       |
 2612|  9.39k|    if ((buf == NULL) || (buf->error))
  ------------------
  |  Branch (2612:9): [True: 0, False: 9.39k]
  |  Branch (2612:26): [True: 0, False: 9.39k]
  ------------------
 2613|      0|        return;
 2614|       |
 2615|  9.39k|    if (xmlStrchr(string, '\"')) {
  ------------------
  |  Branch (2615:9): [True: 203, False: 9.19k]
  ------------------
 2616|    203|        if (xmlStrchr(string, '\'')) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 203]
  ------------------
 2617|      0|	    xmlOutputBufferWrite(buf, 1, "\"");
 2618|      0|            base = cur = string;
 2619|      0|            while(*cur != 0){
  ------------------
  |  Branch (2619:19): [True: 0, False: 0]
  ------------------
 2620|      0|                if(*cur == '"'){
  ------------------
  |  Branch (2620:20): [True: 0, False: 0]
  ------------------
 2621|      0|                    if (base != cur)
  ------------------
  |  Branch (2621:25): [True: 0, False: 0]
  ------------------
 2622|      0|                        xmlOutputBufferWrite(buf, cur - base,
 2623|      0|                                             (const char *) base);
 2624|      0|                    xmlOutputBufferWrite(buf, 6, "&quot;");
 2625|      0|                    cur++;
 2626|      0|                    base = cur;
 2627|      0|                }
 2628|      0|                else {
 2629|      0|                    cur++;
 2630|      0|                }
 2631|      0|            }
 2632|      0|            if (base != cur)
  ------------------
  |  Branch (2632:17): [True: 0, False: 0]
  ------------------
 2633|      0|                xmlOutputBufferWrite(buf, cur - base, (const char *) base);
 2634|      0|	    xmlOutputBufferWrite(buf, 1, "\"");
 2635|      0|	}
 2636|    203|        else{
 2637|    203|	    xmlOutputBufferWrite(buf, 1, "'");
 2638|    203|            xmlOutputBufferWriteString(buf, (const char *) string);
 2639|    203|	    xmlOutputBufferWrite(buf, 1, "'");
 2640|    203|        }
 2641|  9.19k|    } else {
 2642|  9.19k|        xmlOutputBufferWrite(buf, 1, "\"");
 2643|  9.19k|        xmlOutputBufferWriteString(buf, (const char *) string);
 2644|  9.19k|        xmlOutputBufferWrite(buf, 1, "\"");
 2645|  9.19k|    }
 2646|  9.39k|}
xmlParserGetDirectory:
 2720|   196k|xmlParserGetDirectory(const char *filename) {
 2721|   196k|    char *ret = NULL;
 2722|   196k|    char dir[1024];
 2723|   196k|    char *cur;
 2724|       |
 2725|   196k|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 196k]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|   196k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|   196k|#endif
 2732|       |
 2733|   196k|    strncpy(dir, filename, 1023);
 2734|   196k|    dir[1023] = 0;
 2735|   196k|    cur = &dir[strlen(dir)];
 2736|  1.40M|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 1.22M, False: 185k]
  ------------------
 2737|  1.22M|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|  1.22M|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 10.6k, False: 1.20M]
  |  |  ------------------
  ------------------
 2738|  1.20M|	 cur --;
 2739|  1.20M|    }
 2740|   196k|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|   196k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 10.8k, False: 185k]
  |  |  ------------------
  ------------------
 2741|  10.8k|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 174, False: 10.6k]
  ------------------
 2742|  10.6k|	else *cur = 0;
 2743|  10.8k|	ret = xmlMemStrdup(dir);
 2744|   185k|    } else {
 2745|   185k|        ret = xmlMemStrdup(".");
 2746|   185k|    }
 2747|   196k|    return(ret);
 2748|   196k|#undef IS_XMLPGD_SEP
 2749|   196k|}
xmlInitIOCallbacks:
 2790|      2|{
 2791|      2|    xmlInputCallbackNr = 1;
 2792|      2|    xmlInputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2793|       |
 2794|      2|#ifdef LIBXML_OUTPUT_ENABLED
 2795|      2|    xmlOutputCallbackNr = 1;
 2796|      2|    xmlOutputCallbackTable[0].matchcallback = xmlIODefaultMatch;
 2797|      2|#endif
 2798|      2|}

xmlInitMemoryInternal:
  406|      2|xmlInitMemoryInternal(void) {
  407|      2|    xmlInitMutex(&xmlMemMutex);
  408|      2|}
xmlMemSetup:
  453|      2|            xmlReallocFunc reallocFunc, xmlStrdupFunc strdupFunc) {
  454|      2|    if (freeFunc == NULL)
  ------------------
  |  Branch (454:9): [True: 0, False: 2]
  ------------------
  455|      0|	return(-1);
  456|      2|    if (mallocFunc == NULL)
  ------------------
  |  Branch (456:9): [True: 0, False: 2]
  ------------------
  457|      0|	return(-1);
  458|      2|    if (reallocFunc == NULL)
  ------------------
  |  Branch (458:9): [True: 0, False: 2]
  ------------------
  459|      0|	return(-1);
  460|      2|    if (strdupFunc == NULL)
  ------------------
  |  Branch (460:9): [True: 0, False: 2]
  ------------------
  461|      0|	return(-1);
  462|      2|    xmlFree = freeFunc;
  463|      2|    xmlMalloc = mallocFunc;
  464|      2|    xmlMallocAtomic = mallocFunc;
  465|      2|    xmlRealloc = reallocFunc;
  466|      2|    xmlMemStrdup = strdupFunc;
  467|      2|    return(0);
  468|      2|}

xmlTextReaderRead:
 1200|  8.29M|xmlTextReaderRead(xmlTextReader *reader) {
 1201|  8.29M|    int val, olddepth = 0;
 1202|  8.29M|    xmlTextReaderState oldstate = XML_TEXTREADER_START;
 1203|  8.29M|    xmlNodePtr oldnode = NULL;
 1204|       |
 1205|  8.29M|    if (reader == NULL)
  ------------------
  |  Branch (1205:9): [True: 0, False: 8.29M]
  ------------------
 1206|      0|	return(-1);
 1207|  8.29M|    if (reader->state == XML_TEXTREADER_ERROR)
  ------------------
  |  Branch (1207:9): [True: 148k, False: 8.14M]
  ------------------
 1208|   148k|        return(-1);
 1209|       |
 1210|  8.14M|    reader->curnode = NULL;
 1211|  8.14M|    if (reader->doc != NULL)
  ------------------
  |  Branch (1211:9): [True: 0, False: 8.14M]
  ------------------
 1212|      0|        return(xmlTextReaderReadTree(reader));
 1213|  8.14M|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1213:9): [True: 0, False: 8.14M]
  ------------------
 1214|      0|	return(-1);
 1215|       |
 1216|  8.14M|    if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
  ------------------
  |  Branch (1216:9): [True: 42.5k, False: 8.10M]
  ------------------
 1217|  42.5k|	reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
 1218|       |	/*
 1219|       |	 * Initial state
 1220|       |	 */
 1221|  60.8k|	do {
 1222|  60.8k|	    val = xmlTextReaderPushData(reader);
 1223|  60.8k|            if (val < 0) {
  ------------------
  |  Branch (1223:17): [True: 20.2k, False: 40.6k]
  ------------------
 1224|  20.2k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1225|  20.2k|                reader->state = XML_TEXTREADER_ERROR;
 1226|  20.2k|                return(-1);
 1227|  20.2k|            }
 1228|  60.8k|	} while ((reader->ctxt->node == NULL) &&
  ------------------
  |  Branch (1228:11): [True: 23.6k, False: 17.0k]
  ------------------
 1229|  23.6k|		 ((reader->mode != XML_TEXTREADER_MODE_EOF) &&
  ------------------
  |  Branch (1229:5): [True: 18.3k, False: 5.29k]
  ------------------
 1230|  18.3k|		  (reader->state != XML_TEXTREADER_DONE)));
  ------------------
  |  Branch (1230:5): [True: 18.3k, False: 0]
  ------------------
 1231|  22.3k|	if (reader->ctxt->node == NULL) {
  ------------------
  |  Branch (1231:6): [True: 5.29k, False: 17.0k]
  ------------------
 1232|  5.29k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1232:10): [True: 5.29k, False: 0]
  ------------------
 1233|  5.29k|		reader->node = reader->ctxt->myDoc->children;
 1234|  5.29k|	    }
 1235|  5.29k|	    if (reader->node == NULL) {
  ------------------
  |  Branch (1235:10): [True: 0, False: 5.29k]
  ------------------
 1236|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1237|      0|                reader->state = XML_TEXTREADER_ERROR;
 1238|      0|		return(-1);
 1239|      0|	    }
 1240|  5.29k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1241|  17.0k|	} else {
 1242|  17.0k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1242:10): [True: 17.0k, False: 0]
  ------------------
 1243|  17.0k|		reader->node = reader->ctxt->myDoc->children;
 1244|  17.0k|	    }
 1245|  17.0k|	    if (reader->node == NULL)
  ------------------
  |  Branch (1245:10): [True: 0, False: 17.0k]
  ------------------
 1246|      0|		reader->node = reader->ctxt->nodeTab[0];
 1247|  17.0k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1248|  17.0k|	}
 1249|  22.3k|	reader->depth = 0;
 1250|  22.3k|	reader->ctxt->parseMode = XML_PARSE_READER;
 1251|  22.3k|	goto node_found;
 1252|  22.3k|    }
 1253|  8.10M|    oldstate = reader->state;
 1254|  8.10M|    olddepth = reader->ctxt->nodeNr;
 1255|  8.10M|    oldnode = reader->node;
 1256|       |
 1257|  8.87M|get_next_node:
 1258|  8.87M|    if (reader->node == NULL) {
  ------------------
  |  Branch (1258:9): [True: 8.05k, False: 8.86M]
  ------------------
 1259|  8.05k|	if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1259:6): [True: 7.97k, False: 83]
  ------------------
 1260|  7.97k|	    return(0);
 1261|  7.97k|        } else {
 1262|     83|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1263|     83|            reader->state = XML_TEXTREADER_ERROR;
 1264|     83|	    return(-1);
 1265|     83|        }
 1266|  8.05k|    }
 1267|       |
 1268|       |    /*
 1269|       |     * If we are not backtracking on ancestors or examined nodes,
 1270|       |     * that the parser didn't finished or that we aren't at the end
 1271|       |     * of stream, continue processing.
 1272|       |     */
 1273|  8.87M|    while ((reader->node != NULL) && (reader->node->next == NULL) &&
  ------------------
  |  Branch (1273:12): [True: 8.87M, False: 0]
  |  Branch (1273:38): [True: 3.85M, False: 5.01M]
  ------------------
 1274|  3.85M|	   (reader->ctxt->nodeNr == olddepth) &&
  ------------------
  |  Branch (1274:5): [True: 3.85M, False: 1.63k]
  ------------------
 1275|  3.85M|           ((oldstate == XML_TEXTREADER_BACKTRACK) ||
  ------------------
  |  Branch (1275:13): [True: 778k, False: 3.07M]
  ------------------
 1276|  3.07M|            (reader->node->children == NULL) ||
  ------------------
  |  Branch (1276:13): [True: 1.34M, False: 1.73M]
  ------------------
 1277|  1.73M|	    (reader->node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (1277:6): [True: 608, False: 1.73M]
  ------------------
 1278|  1.73M|	    ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1278:7): [True: 1.73M, False: 0]
  ------------------
 1279|  1.73M|	     (reader->node->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1279:7): [True: 23.1k, False: 1.71M]
  ------------------
 1280|  23.1k|	     (reader->node->children->next == NULL)) ||
  ------------------
  |  Branch (1280:7): [True: 5.35k, False: 17.8k]
  ------------------
 1281|  1.73M|	    (reader->node->type == XML_DTD_NODE) ||
  ------------------
  |  Branch (1281:6): [True: 0, False: 1.73M]
  ------------------
 1282|  1.73M|	    (reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1282:6): [True: 0, False: 1.73M]
  ------------------
 1283|  1.73M|	    (reader->node->type == XML_HTML_DOCUMENT_NODE)) &&
  ------------------
  |  Branch (1283:6): [True: 0, False: 1.73M]
  ------------------
 1284|  2.12M|	   ((reader->ctxt->node == NULL) ||
  ------------------
  |  Branch (1284:6): [True: 5.01k, False: 2.12M]
  ------------------
 1285|  2.12M|	    (reader->ctxt->node == reader->node) ||
  ------------------
  |  Branch (1285:6): [True: 7.40k, False: 2.11M]
  ------------------
 1286|  2.11M|	    (reader->ctxt->node == reader->node->parent)) &&
  ------------------
  |  Branch (1286:6): [True: 2.24k, False: 2.11M]
  ------------------
 1287|  14.6k|	   (reader->ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (1287:5): [True: 8.32k, False: 6.34k]
  ------------------
 1288|  8.32k|	   (PARSER_STOPPED(reader->ctxt) == 0)) {
  ------------------
  |  |   44|  8.32k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (1288:5): [True: 8.32k, False: 0]
  ------------------
 1289|  8.32k|	val = xmlTextReaderPushData(reader);
 1290|  8.32k|	if (val < 0) {
  ------------------
  |  Branch (1290:6): [True: 4.25k, False: 4.06k]
  ------------------
 1291|  4.25k|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1292|  4.25k|            reader->state = XML_TEXTREADER_ERROR;
 1293|  4.25k|	    return(-1);
 1294|  4.25k|        }
 1295|  4.06k|	if (reader->node == NULL)
  ------------------
  |  Branch (1295:6): [True: 0, False: 4.06k]
  ------------------
 1296|      0|	    goto node_end;
 1297|  4.06k|    }
 1298|  8.86M|    if (oldstate != XML_TEXTREADER_BACKTRACK) {
  ------------------
  |  Branch (1298:9): [True: 6.55M, False: 2.30M]
  ------------------
 1299|  6.55M|	if ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1299:6): [True: 4.05M, False: 2.50M]
  ------------------
 1300|  4.05M|	    (reader->node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1300:6): [True: 4.04M, False: 2.46k]
  ------------------
 1301|  4.04M|	    (reader->node->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1301:6): [True: 4.04M, False: 0]
  ------------------
 1302|  4.04M|	    (reader->node->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1302:6): [True: 4.04M, False: 3.14k]
  ------------------
 1303|  4.04M|	    reader->node = reader->node->children;
 1304|  4.04M|	    reader->depth++;
 1305|  4.04M|	    reader->state = XML_TEXTREADER_ELEMENT;
 1306|  4.04M|	    goto node_found;
 1307|  4.04M|	}
 1308|  6.55M|    }
 1309|  4.82M|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1309:9): [True: 2.70M, False: 2.11M]
  ------------------
 1310|  2.70M|	if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1310:6): [True: 1.17M, False: 1.53M]
  ------------------
 1311|  1.17M|            (reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1311:13): [True: 169k, False: 1.00M]
  ------------------
 1312|   169k|	    (reader->node->children == NULL) &&
  ------------------
  |  Branch (1312:6): [True: 169k, False: 0]
  ------------------
 1313|   169k|	    ((reader->node->extra & NODE_IS_EMPTY) == 0)
  ------------------
  |  |  169|   169k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1313:6): [True: 85.6k, False: 83.5k]
  ------------------
 1314|  85.6k|#ifdef LIBXML_XINCLUDE_ENABLED
 1315|  85.6k|	    && (reader->in_xinclude <= 0)
  ------------------
  |  Branch (1315:9): [True: 4.61k, False: 81.0k]
  ------------------
 1316|  2.70M|#endif
 1317|  2.70M|	    ) {
 1318|  4.61k|	    reader->state = XML_TEXTREADER_END;
 1319|  4.61k|	    goto node_found;
 1320|  4.61k|	}
 1321|  2.70M|#ifdef LIBXML_REGEXP_ENABLED
 1322|  2.70M|	if ((reader->validate) &&
  ------------------
  |  Branch (1322:6): [True: 1.54M, False: 1.15M]
  ------------------
 1323|  1.54M|	    (reader->node->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (1323:6): [True: 554k, False: 995k]
  ------------------
 1324|   554k|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1324:10): [True: 1, False: 554k]
  ------------------
 1325|      1|                return(-1);
 1326|  2.70M|#endif /* LIBXML_REGEXP_ENABLED */
 1327|  2.70M|        if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1327:13): [True: 1.38M, False: 1.31M]
  ------------------
 1328|  1.38M|	    (reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|  1.38M|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1328:6): [True: 680, False: 1.38M]
  ------------------
 1329|    680|	    reader->preserves--;
 1330|  2.70M|	reader->node = reader->node->next;
 1331|  2.70M|	reader->state = XML_TEXTREADER_ELEMENT;
 1332|       |
 1333|       |	/*
 1334|       |	 * Cleanup of the old node
 1335|       |	 */
 1336|  2.70M|	if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1336:6): [True: 1.31M, False: 1.38M]
  ------------------
 1337|  1.31M|#ifdef LIBXML_XINCLUDE_ENABLED
 1338|  1.31M|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1338:6): [True: 158k, False: 1.15M]
  ------------------
 1339|   158k|#endif
 1340|   158k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1340:6): [True: 158k, False: 0]
  ------------------
 1341|   158k|	    (reader->node->prev != NULL) &&
  ------------------
  |  Branch (1341:6): [True: 158k, False: 0]
  ------------------
 1342|   158k|            (reader->node->prev->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1342:13): [True: 153k, False: 5.66k]
  ------------------
 1343|   153k|	    xmlNodePtr tmp = reader->node->prev;
 1344|   153k|	    if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
  ------------------
  |  |  170|   153k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1344:10): [True: 152k, False: 542]
  ------------------
 1345|   152k|                if (oldnode == tmp)
  ------------------
  |  Branch (1345:21): [True: 150k, False: 2.40k]
  ------------------
 1346|   150k|                    oldnode = NULL;
 1347|   152k|		xmlUnlinkNode(tmp);
 1348|   152k|		xmlTextReaderFreeNode(reader, tmp);
 1349|   152k|	    }
 1350|   153k|	}
 1351|       |
 1352|  2.70M|	goto node_found;
 1353|  2.70M|    }
 1354|  2.11M|    if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1354:9): [True: 774k, False: 1.33M]
  ------------------
 1355|   774k|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1355:2): [True: 563k, False: 211k]
  ------------------
 1356|   563k|	(reader->node->children == NULL) &&
  ------------------
  |  Branch (1356:2): [True: 563k, False: 0]
  ------------------
 1357|   563k|	((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
  ------------------
  |  |  169|   563k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1357:2): [True: 561k, False: 1.54k]
  ------------------
 1358|   561k|	reader->state = XML_TEXTREADER_END;
 1359|   561k|	goto node_found;
 1360|   561k|    }
 1361|  1.55M|#ifdef LIBXML_REGEXP_ENABLED
 1362|  1.55M|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) &&
  ------------------
  |  Branch (1362:9): [True: 875k, False: 677k]
  ------------------
 1363|   875k|        (reader->node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1363:9): [True: 797k, False: 77.2k]
  ------------------
 1364|   797k|        if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1364:13): [True: 1, False: 797k]
  ------------------
 1365|      1|            return(-1);
 1366|   797k|    }
 1367|  1.55M|#endif /* LIBXML_REGEXP_ENABLED */
 1368|  1.55M|    if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1368:9): [True: 712k, False: 840k]
  ------------------
 1369|   712k|	(reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|   712k|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1369:2): [True: 206, False: 711k]
  ------------------
 1370|    206|	reader->preserves--;
 1371|  1.55M|    reader->node = reader->node->parent;
 1372|  1.55M|    if ((reader->node == NULL) ||
  ------------------
  |  Branch (1372:9): [True: 0, False: 1.55M]
  ------------------
 1373|  1.55M|	(reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1373:2): [True: 2.14k, False: 1.55M]
  ------------------
 1374|  1.55M|	(reader->node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1374:2): [True: 0, False: 1.55M]
  ------------------
 1375|  2.14k|	if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1375:6): [True: 515, False: 1.62k]
  ------------------
 1376|    515|	    val = xmlParseChunk(reader->ctxt, "", 0, 1);
 1377|    515|	    reader->state = XML_TEXTREADER_DONE;
 1378|    515|	    if (val != 0) {
  ------------------
  |  Branch (1378:10): [True: 506, False: 9]
  ------------------
 1379|    506|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1380|    506|                reader->state = XML_TEXTREADER_ERROR;
 1381|    506|	        return(-1);
 1382|    506|            }
 1383|    515|	}
 1384|  1.63k|	reader->node = NULL;
 1385|  1.63k|	reader->depth = -1;
 1386|       |
 1387|       |	/*
 1388|       |	 * Cleanup of the old node
 1389|       |	 */
 1390|  1.63k|	if ((oldnode != NULL) && (reader->preserves == 0) &&
  ------------------
  |  Branch (1390:6): [True: 1.57k, False: 65]
  |  Branch (1390:27): [True: 1.55k, False: 20]
  ------------------
 1391|  1.55k|#ifdef LIBXML_XINCLUDE_ENABLED
 1392|  1.55k|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1392:6): [True: 1.42k, False: 131]
  ------------------
 1393|  1.42k|#endif
 1394|  1.42k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1394:6): [True: 1.42k, False: 0]
  ------------------
 1395|  1.42k|	    (oldnode->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (1395:6): [True: 1.42k, False: 0]
  ------------------
 1396|  1.42k|	    ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  1.42k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1396:6): [True: 1.38k, False: 39]
  ------------------
 1397|  1.38k|	    xmlUnlinkNode(oldnode);
 1398|  1.38k|	    xmlTextReaderFreeNode(reader, oldnode);
 1399|  1.38k|	}
 1400|       |
 1401|  1.63k|	goto node_end;
 1402|  2.14k|    }
 1403|  1.55M|    if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1403:9): [True: 838k, False: 712k]
  ------------------
 1404|   838k|#ifdef LIBXML_XINCLUDE_ENABLED
 1405|   838k|        (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1405:9): [True: 27.7k, False: 810k]
  ------------------
 1406|  27.7k|#endif
 1407|  27.7k|	(reader->entNr == 0) &&
  ------------------
  |  Branch (1407:2): [True: 27.7k, False: 0]
  ------------------
 1408|  27.7k|        (reader->node->last != NULL) &&
  ------------------
  |  Branch (1408:9): [True: 27.7k, False: 0]
  ------------------
 1409|  27.7k|        ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  27.7k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1409:9): [True: 27.4k, False: 274]
  ------------------
 1410|  27.4k|	xmlNodePtr tmp = reader->node->last;
 1411|  27.4k|	xmlUnlinkNode(tmp);
 1412|  27.4k|	xmlTextReaderFreeNode(reader, tmp);
 1413|  27.4k|    }
 1414|  1.55M|    reader->depth--;
 1415|  1.55M|    reader->state = XML_TEXTREADER_BACKTRACK;
 1416|       |
 1417|  8.88M|node_found:
 1418|       |    /*
 1419|       |     * If we are in the middle of a piece of CDATA make sure it's finished
 1420|       |     */
 1421|  8.88M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1421:9): [True: 8.88M, False: 0]
  ------------------
 1422|  8.88M|        (reader->node->next == NULL) &&
  ------------------
  |  Branch (1422:9): [True: 3.86M, False: 5.01M]
  ------------------
 1423|  3.86M|        ((reader->node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1423:10): [True: 213k, False: 3.65M]
  ------------------
 1424|  3.65M|	 (reader->node->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (1424:3): [True: 361, False: 3.65M]
  ------------------
 1425|   214k|            if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1425:17): [True: 2.84k, False: 211k]
  ------------------
 1426|  2.84k|	        return -1;
 1427|   214k|    }
 1428|       |
 1429|  8.88M|#ifdef LIBXML_XINCLUDE_ENABLED
 1430|       |    /*
 1431|       |     * Handle XInclude if asked for
 1432|       |     */
 1433|  8.88M|    if ((reader->xinclude) && (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1433:9): [True: 8.75M, False: 130k]
  |  Branch (1433:31): [True: 2.84M, False: 5.90M]
  ------------------
 1434|  2.84M|        (reader->state != XML_TEXTREADER_BACKTRACK) &&
  ------------------
  |  Branch (1434:9): [True: 2.83M, False: 9.96k]
  ------------------
 1435|  2.83M|        (reader->node != NULL) &&
  ------------------
  |  Branch (1435:9): [True: 2.83M, False: 0]
  ------------------
 1436|  2.83M|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1436:2): [True: 2.80M, False: 37.4k]
  ------------------
 1437|  2.80M|	(reader->node->ns != NULL) &&
  ------------------
  |  Branch (1437:2): [True: 23.6k, False: 2.77M]
  ------------------
 1438|  23.6k|	((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  23.6k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1438:3): [True: 6.99k, False: 16.6k]
  ------------------
 1439|  16.8k|	 (xmlStrEqual(reader->node->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  16.6k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1439:3): [True: 9.85k, False: 6.76k]
  ------------------
 1440|  16.8k|	if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1440:6): [True: 9.66k, False: 7.18k]
  ------------------
 1441|  9.66k|	    reader->xincctxt = xmlXIncludeNewContext(reader->ctxt->myDoc);
 1442|  9.66k|            if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1442:17): [True: 1, False: 9.66k]
  ------------------
 1443|      1|                xmlTextReaderErrMemory(reader);
 1444|      1|                return(-1);
 1445|      1|            }
 1446|  9.66k|	    xmlXIncludeSetFlags(reader->xincctxt,
 1447|  9.66k|	                        reader->parserFlags & (~XML_PARSE_NOXINCNODE));
 1448|  9.66k|            xmlXIncludeSetStreamingMode(reader->xincctxt, 1);
 1449|  9.66k|            if ((reader->errorFunc != NULL) || (reader->sErrorFunc != NULL))
  ------------------
  |  Branch (1449:17): [True: 0, False: 9.66k]
  |  Branch (1449:48): [True: 9.66k, False: 0]
  ------------------
 1450|  9.66k|                xmlXIncludeSetErrorHandler(reader->xincctxt,
 1451|  9.66k|                        xmlTextReaderStructuredRelay, reader);
 1452|  9.66k|            if (reader->resourceLoader != NULL)
  ------------------
  |  Branch (1452:17): [True: 9.66k, False: 0]
  ------------------
 1453|  9.66k|                xmlXIncludeSetResourceLoader(reader->xincctxt,
 1454|  9.66k|                        reader->resourceLoader, reader->resourceCtxt);
 1455|  9.66k|	}
 1456|       |	/*
 1457|       |	 * expand that node and process it
 1458|       |	 */
 1459|  16.8k|	if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1459:6): [True: 19, False: 16.8k]
  ------------------
 1460|     19|	    return(-1);
 1461|  16.8k|        if (xmlXIncludeProcessNode(reader->xincctxt, reader->node) < 0) {
  ------------------
  |  Branch (1461:13): [True: 14.0k, False: 2.74k]
  ------------------
 1462|  14.0k|            int err = xmlXIncludeGetLastError(reader->xincctxt);
 1463|       |
 1464|  14.0k|            if (xmlIsCatastrophicError(XML_ERR_FATAL, err)) {
  ------------------
  |  Branch (1464:17): [True: 3.58k, False: 10.5k]
  ------------------
 1465|  3.58k|                xmlFatalErr(reader->ctxt, err, NULL);
 1466|  3.58k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1467|  3.58k|                reader->state = XML_TEXTREADER_ERROR;
 1468|  3.58k|            }
 1469|  14.0k|            return(-1);
 1470|  14.0k|        }
 1471|  16.8k|    }
 1472|  8.86M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_START)) {
  ------------------
  |  Branch (1472:9): [True: 8.86M, False: 0]
  |  Branch (1472:35): [True: 9.73k, False: 8.85M]
  ------------------
 1473|  9.73k|        reader->in_xinclude++;
 1474|  9.73k|	goto get_next_node;
 1475|  9.73k|    }
 1476|  8.85M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (1476:9): [True: 8.85M, False: 0]
  |  Branch (1476:35): [True: 763k, False: 8.09M]
  ------------------
 1477|   763k|        reader->in_xinclude--;
 1478|   763k|	goto get_next_node;
 1479|   763k|    }
 1480|  8.09M|#endif
 1481|       |    /*
 1482|       |     * Handle entities enter and exit when in entity replacement mode
 1483|       |     */
 1484|  8.09M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1484:9): [True: 8.09M, False: 0]
  ------------------
 1485|  8.09M|	(reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1485:2): [True: 2.82k, False: 8.09M]
  ------------------
 1486|  2.82k|	(reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
  ------------------
  |  Branch (1486:2): [True: 2.82k, False: 0]
  |  Branch (1486:28): [True: 0, False: 2.82k]
  ------------------
 1487|      0|	if ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1487:6): [True: 0, False: 0]
  ------------------
 1488|      0|	    (reader->node->children->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1488:6): [True: 0, False: 0]
  ------------------
 1489|      0|	    (reader->node->children->children != NULL)) {
  ------------------
  |  Branch (1489:6): [True: 0, False: 0]
  ------------------
 1490|      0|	    if (xmlTextReaderEntPush(reader, reader->node) < 0)
  ------------------
  |  Branch (1490:10): [True: 0, False: 0]
  ------------------
 1491|      0|                goto get_next_node;
 1492|      0|	    reader->node = reader->node->children->children;
 1493|      0|	}
 1494|      0|#ifdef LIBXML_REGEXP_ENABLED
 1495|  8.09M|    } else if ((reader->node != NULL) &&
  ------------------
  |  Branch (1495:16): [True: 8.09M, False: 0]
  ------------------
 1496|  8.09M|	       (reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1496:9): [True: 2.82k, False: 8.09M]
  ------------------
 1497|  2.82k|	       (reader->ctxt != NULL) && (reader->validate)) {
  ------------------
  |  Branch (1497:9): [True: 2.82k, False: 0]
  |  Branch (1497:35): [True: 1.68k, False: 1.14k]
  ------------------
 1498|  1.68k|	if (xmlTextReaderValidateEntity(reader) < 0)
  ------------------
  |  Branch (1498:6): [True: 19, False: 1.66k]
  ------------------
 1499|     19|            return(-1);
 1500|  1.68k|#endif /* LIBXML_REGEXP_ENABLED */
 1501|  1.68k|    }
 1502|  8.09M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1502:9): [True: 8.09M, False: 0]
  ------------------
 1503|  8.09M|	(reader->node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1503:2): [True: 0, False: 8.09M]
  ------------------
 1504|      0|	(reader->ent != NULL) && (reader->ent->children == reader->node)) {
  ------------------
  |  Branch (1504:2): [True: 0, False: 0]
  |  Branch (1504:27): [True: 0, False: 0]
  ------------------
 1505|      0|	reader->node = xmlTextReaderEntPop(reader);
 1506|      0|	reader->depth++;
 1507|      0|        goto get_next_node;
 1508|      0|    }
 1509|  8.09M|#ifdef LIBXML_REGEXP_ENABLED
 1510|  8.09M|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node != NULL)) {
  ------------------
  |  Branch (1510:9): [True: 4.70M, False: 3.39M]
  |  Branch (1510:62): [True: 4.70M, False: 0]
  ------------------
 1511|  4.70M|	xmlNodePtr node = reader->node;
 1512|       |
 1513|  4.70M|	if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1513:6): [True: 4.05M, False: 642k]
  ------------------
 1514|  4.05M|            ((reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1514:14): [True: 3.69M, False: 359k]
  ------------------
 1515|  3.69M|	     (reader->state != XML_TEXTREADER_BACKTRACK))) {
  ------------------
  |  Branch (1515:7): [True: 2.82M, False: 873k]
  ------------------
 1516|  2.82M|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1516:10): [True: 3, False: 2.82M]
  ------------------
 1517|      3|                return(-1);
 1518|  2.82M|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1518:13): [True: 567k, False: 1.30M]
  ------------------
 1519|  1.30M|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1519:6): [True: 25.3k, False: 1.28M]
  ------------------
 1520|   593k|            xmlTextReaderValidateCData(reader, node->content,
 1521|   593k|	                               xmlStrlen(node->content));
 1522|   593k|	}
 1523|  4.70M|    }
 1524|  8.09M|#endif /* LIBXML_REGEXP_ENABLED */
 1525|  8.09M|#ifdef LIBXML_PATTERN_ENABLED
 1526|  8.09M|    if ((reader->patternNr > 0) && (reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1526:9): [True: 0, False: 8.09M]
  |  Branch (1526:36): [True: 0, False: 0]
  ------------------
 1527|      0|        (reader->state != XML_TEXTREADER_BACKTRACK)) {
  ------------------
  |  Branch (1527:9): [True: 0, False: 0]
  ------------------
 1528|      0|        int i;
 1529|      0|	for (i = 0;i < reader->patternNr;i++) {
  ------------------
  |  Branch (1529:13): [True: 0, False: 0]
  ------------------
 1530|      0|	     if (xmlPatternMatch(reader->patternTab[i], reader->node) == 1) {
  ------------------
  |  Branch (1530:11): [True: 0, False: 0]
  ------------------
 1531|      0|	         xmlTextReaderPreserve(reader);
 1532|      0|		 break;
 1533|      0|             }
 1534|      0|	}
 1535|      0|    }
 1536|  8.09M|#endif /* LIBXML_PATTERN_ENABLED */
 1537|  8.09M|#ifdef LIBXML_SCHEMAS_ENABLED
 1538|  8.09M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_XSD) &&
  ------------------
  |  Branch (1538:9): [True: 0, False: 8.09M]
  ------------------
 1539|      0|        (reader->xsdValidErrors == 0) &&
  ------------------
  |  Branch (1539:9): [True: 0, False: 0]
  ------------------
 1540|      0|	(reader->xsdValidCtxt != NULL)) {
  ------------------
  |  Branch (1540:2): [True: 0, False: 0]
  ------------------
 1541|      0|	reader->xsdValidErrors = !xmlSchemaIsValid(reader->xsdValidCtxt);
 1542|      0|    }
 1543|  8.09M|#endif /* LIBXML_PATTERN_ENABLED */
 1544|  8.09M|    return(1);
 1545|  1.63k|node_end:
 1546|  1.63k|    reader->state = XML_TEXTREADER_DONE;
 1547|  1.63k|    return(0);
 1548|  8.09M|}
xmlTextReaderReadState:
 1557|  4.67k|xmlTextReaderReadState(xmlTextReader *reader) {
 1558|  4.67k|    if (reader == NULL)
  ------------------
  |  Branch (1558:9): [True: 0, False: 4.67k]
  ------------------
 1559|      0|	return(-1);
 1560|  4.67k|    return(reader->mode);
 1561|  4.67k|}
xmlTextReaderExpand:
 1572|   289k|xmlTextReaderExpand(xmlTextReader *reader) {
 1573|   289k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1573:9): [True: 0, False: 289k]
  |  Branch (1573:29): [True: 7.18k, False: 282k]
  ------------------
 1574|  7.18k|        return(NULL);
 1575|   282k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1575:9): [True: 0, False: 282k]
  ------------------
 1576|      0|        return(reader->node);
 1577|   282k|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1577:9): [True: 0, False: 282k]
  ------------------
 1578|      0|        return(NULL);
 1579|   282k|    if (xmlTextReaderDoExpand(reader) < 0)
  ------------------
  |  Branch (1579:9): [True: 12.4k, False: 270k]
  ------------------
 1580|  12.4k|        return(NULL);
 1581|   270k|    return(reader->node);
 1582|   282k|}
xmlTextReaderNext:
 1593|  18.6k|xmlTextReaderNext(xmlTextReader *reader) {
 1594|  18.6k|    int ret;
 1595|  18.6k|    xmlNodePtr cur;
 1596|       |
 1597|  18.6k|    if (reader == NULL)
  ------------------
  |  Branch (1597:9): [True: 0, False: 18.6k]
  ------------------
 1598|      0|	return(-1);
 1599|  18.6k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1599:9): [True: 0, False: 18.6k]
  ------------------
 1600|      0|        return(xmlTextReaderNextTree(reader));
 1601|  18.6k|    cur = reader->node;
 1602|  18.6k|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (1602:9): [True: 5.38k, False: 13.2k]
  |  Branch (1602:26): [True: 3.92k, False: 9.31k]
  ------------------
 1603|  9.30k|        return(xmlTextReaderRead(reader));
 1604|  9.31k|    if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK)
  ------------------
  |  Branch (1604:9): [True: 158, False: 9.15k]
  |  Branch (1604:48): [True: 569, False: 8.58k]
  ------------------
 1605|    727|        return(xmlTextReaderRead(reader));
 1606|  8.58k|    if (cur->extra & NODE_IS_EMPTY)
  ------------------
  |  |  169|  8.58k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1606:9): [True: 947, False: 7.63k]
  ------------------
 1607|    947|        return(xmlTextReaderRead(reader));
 1608|  8.03M|    do {
 1609|  8.03M|        ret = xmlTextReaderRead(reader);
 1610|  8.03M|	if (ret != 1)
  ------------------
  |  Branch (1610:6): [True: 7.07k, False: 8.02M]
  ------------------
 1611|  7.07k|	    return(ret);
 1612|  8.03M|    } while (reader->node != cur);
  ------------------
  |  Branch (1612:14): [True: 8.02M, False: 558]
  ------------------
 1613|    558|    return(xmlTextReaderRead(reader));
 1614|  7.63k|}
xmlTextReaderReadInnerXml:
 1657|  13.4k|{
 1658|  13.4k|    xmlOutputBufferPtr output;
 1659|  13.4k|    xmlNodePtr cur;
 1660|  13.4k|    xmlChar *ret;
 1661|       |
 1662|  13.4k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1662:9): [True: 4.40k, False: 9.00k]
  ------------------
 1663|  4.40k|        return(NULL);
 1664|       |
 1665|  9.00k|    if (reader->node == NULL)
  ------------------
  |  Branch (1665:9): [True: 0, False: 9.00k]
  ------------------
 1666|      0|        return(NULL);
 1667|       |
 1668|  9.00k|    output = xmlAllocOutputBuffer(NULL);
 1669|  9.00k|    if (output == NULL) {
  ------------------
  |  Branch (1669:9): [True: 34, False: 8.97k]
  ------------------
 1670|     34|        xmlTextReaderErrMemory(reader);
 1671|     34|        return(NULL);
 1672|     34|    }
 1673|       |
 1674|  28.5k|    for (cur = reader->node->children; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (1674:40): [True: 19.5k, False: 8.97k]
  ------------------
 1675|  19.5k|        xmlTextReaderDumpCopy(reader, output, cur);
 1676|       |
 1677|  8.97k|    if (output->error)
  ------------------
  |  Branch (1677:9): [True: 3, False: 8.96k]
  ------------------
 1678|      3|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1679|       |
 1680|  8.97k|    ret = xmlBufDetach(output->buffer);
 1681|  8.97k|    xmlOutputBufferClose(output);
 1682|       |
 1683|  8.97k|    return(ret);
 1684|  9.00k|}
xmlTextReaderReadOuterXml:
 1696|  37.5k|{
 1697|  37.5k|    xmlOutputBufferPtr output;
 1698|  37.5k|    xmlNodePtr node;
 1699|  37.5k|    xmlChar *ret;
 1700|       |
 1701|  37.5k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1701:9): [True: 7.85k, False: 29.6k]
  ------------------
 1702|  7.85k|        return(NULL);
 1703|       |
 1704|  29.6k|    node = reader->node;
 1705|  29.6k|    if (node == NULL)
  ------------------
  |  Branch (1705:9): [True: 0, False: 29.6k]
  ------------------
 1706|      0|        return(NULL);
 1707|       |
 1708|  29.6k|    output = xmlAllocOutputBuffer(NULL);
 1709|  29.6k|    if (output == NULL) {
  ------------------
  |  Branch (1709:9): [True: 87, False: 29.5k]
  ------------------
 1710|     87|        xmlTextReaderErrMemory(reader);
 1711|     87|        return(NULL);
 1712|     87|    }
 1713|       |
 1714|  29.5k|    xmlTextReaderDumpCopy(reader, output, node);
 1715|  29.5k|    if (output->error)
  ------------------
  |  Branch (1715:9): [True: 25, False: 29.5k]
  ------------------
 1716|     25|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1717|       |
 1718|  29.5k|    ret = xmlBufDetach(output->buffer);
 1719|  29.5k|    xmlOutputBufferClose(output);
 1720|       |
 1721|  29.5k|    return(ret);
 1722|  29.6k|}
xmlTextReaderReadString:
 1736|  9.81k|{
 1737|  9.81k|    xmlNodePtr node, cur;
 1738|  9.81k|    xmlBufPtr buf;
 1739|  9.81k|    xmlChar *ret;
 1740|       |
 1741|  9.81k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1741:9): [True: 0, False: 9.81k]
  |  Branch (1741:29): [True: 2.44k, False: 7.36k]
  ------------------
 1742|  2.44k|       return(NULL);
 1743|       |
 1744|  7.36k|    node = (reader->curnode != NULL) ? reader->curnode : reader->node;
  ------------------
  |  Branch (1744:12): [True: 879, False: 6.48k]
  ------------------
 1745|  7.36k|    switch (node->type) {
 1746|  1.18k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1746:9): [True: 1.18k, False: 6.18k]
  ------------------
 1747|  1.43k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1747:9): [True: 251, False: 7.11k]
  ------------------
 1748|  1.43k|            break;
 1749|  4.42k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1749:9): [True: 4.42k, False: 2.94k]
  ------------------
 1750|  4.42k|            if ((xmlTextReaderDoExpand(reader) == -1) ||
  ------------------
  |  Branch (1750:17): [True: 1.73k, False: 2.68k]
  ------------------
 1751|  2.68k|                (node->children == NULL))
  ------------------
  |  Branch (1751:17): [True: 1.52k, False: 1.16k]
  ------------------
 1752|  3.25k|                return(NULL);
 1753|  1.16k|            break;
 1754|  1.50k|        default:
  ------------------
  |  Branch (1754:9): [True: 1.50k, False: 5.85k]
  ------------------
 1755|  1.50k|            return(NULL);
 1756|  7.36k|    }
 1757|       |
 1758|  2.60k|    buf = xmlBufCreate(50);
 1759|  2.60k|    if (buf == NULL) {
  ------------------
  |  Branch (1759:9): [True: 15, False: 2.58k]
  ------------------
 1760|     15|        xmlTextReaderErrMemory(reader);
 1761|     15|        return(NULL);
 1762|     15|    }
 1763|       |
 1764|  2.58k|    cur = node;
 1765|  2.00M|    while (cur != NULL) {
  ------------------
  |  Branch (1765:12): [True: 2.00M, False: 0]
  ------------------
 1766|  2.00M|        switch (cur->type) {
 1767|   501k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (1767:13): [True: 501k, False: 1.50M]
  ------------------
 1768|   501k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1768:13): [True: 403, False: 2.00M]
  ------------------
 1769|   501k|                xmlBufCat(buf, cur->content);
 1770|   501k|                break;
 1771|       |
 1772|  1.00M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1772:13): [True: 1.00M, False: 999k]
  ------------------
 1773|  1.00M|                if (cur->children != NULL) {
  ------------------
  |  Branch (1773:21): [True: 1.00M, False: 4.80k]
  ------------------
 1774|  1.00M|                    cur = cur->children;
 1775|  1.00M|                    continue;
 1776|  1.00M|                }
 1777|  4.80k|                break;
 1778|       |
 1779|   498k|            default:
  ------------------
  |  Branch (1779:13): [True: 498k, False: 1.50M]
  ------------------
 1780|   498k|                break;
 1781|  2.00M|        }
 1782|       |
 1783|  1.00M|        if (cur == node)
  ------------------
  |  Branch (1783:13): [True: 1.42k, False: 1.00M]
  ------------------
 1784|  1.42k|            goto done;
 1785|       |
 1786|  2.00M|        while (cur->next == NULL) {
  ------------------
  |  Branch (1786:16): [True: 1.00M, False: 1.00M]
  ------------------
 1787|  1.00M|            cur = cur->parent;
 1788|  1.00M|            if (cur == node)
  ------------------
  |  Branch (1788:17): [True: 1.16k, False: 999k]
  ------------------
 1789|  1.16k|                goto done;
 1790|  1.00M|        }
 1791|  1.00M|        cur = cur->next;
 1792|  1.00M|    }
 1793|       |
 1794|  2.58k|done:
 1795|  2.58k|    ret = xmlBufDetach(buf);
 1796|  2.58k|    if (ret == NULL)
  ------------------
  |  Branch (1796:9): [True: 2, False: 2.58k]
  ------------------
 1797|      2|        xmlTextReaderErrMemory(reader);
 1798|       |
 1799|  2.58k|    xmlBufFree(buf);
 1800|  2.58k|    return(ret);
 1801|  2.58k|}
xmlTextReaderNextSibling:
 1950|  7.48k|xmlTextReaderNextSibling(xmlTextReader *reader) {
 1951|  7.48k|    if (reader == NULL)
  ------------------
  |  Branch (1951:9): [True: 0, False: 7.48k]
  ------------------
 1952|      0|        return(-1);
 1953|  7.48k|    if (reader->doc == NULL) {
  ------------------
  |  Branch (1953:9): [True: 7.48k, False: 0]
  ------------------
 1954|       |        /* TODO */
 1955|  7.48k|	return(-1);
 1956|  7.48k|    }
 1957|       |
 1958|      0|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (1958:9): [True: 0, False: 0]
  ------------------
 1959|      0|        return(0);
 1960|       |
 1961|      0|    if (reader->node == NULL)
  ------------------
  |  Branch (1961:9): [True: 0, False: 0]
  ------------------
 1962|      0|        return(xmlTextReaderNextTree(reader));
 1963|       |
 1964|      0|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1964:9): [True: 0, False: 0]
  ------------------
 1965|      0|        reader->node = reader->node->next;
 1966|      0|        reader->state = XML_TEXTREADER_START;
 1967|      0|        return(1);
 1968|      0|    }
 1969|       |
 1970|      0|    return(0);
 1971|      0|}
xmlNewTextReader:
 1986|  43.2k|xmlNewTextReader(xmlParserInputBuffer *input, const char *URI) {
 1987|  43.2k|    xmlTextReaderPtr ret;
 1988|       |
 1989|  43.2k|    if (input == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 43.2k]
  ------------------
 1990|      0|	return(NULL);
 1991|  43.2k|    ret = xmlMalloc(sizeof(xmlTextReader));
 1992|  43.2k|    if (ret == NULL)
  ------------------
  |  Branch (1992:9): [True: 6, False: 43.2k]
  ------------------
 1993|      6|	return(NULL);
 1994|  43.2k|    memset(ret, 0, sizeof(xmlTextReader));
 1995|  43.2k|    ret->doc = NULL;
 1996|  43.2k|    ret->entTab = NULL;
 1997|  43.2k|    ret->entMax = 0;
 1998|  43.2k|    ret->entNr = 0;
 1999|  43.2k|    ret->input = input;
 2000|  43.2k|    ret->buffer = xmlBufCreate(50);
 2001|  43.2k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2001:9): [True: 6, False: 43.2k]
  ------------------
 2002|      6|        xmlFree(ret);
 2003|      6|	return(NULL);
 2004|      6|    }
 2005|  43.2k|    ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2006|  43.2k|    if (ret->sax == NULL) {
  ------------------
  |  Branch (2006:9): [True: 4, False: 43.2k]
  ------------------
 2007|      4|	xmlBufFree(ret->buffer);
 2008|      4|	xmlFree(ret);
 2009|      4|	return(NULL);
 2010|      4|    }
 2011|  43.2k|    xmlSAXVersion(ret->sax, 2);
 2012|  43.2k|    ret->startElement = ret->sax->startElement;
 2013|  43.2k|    ret->sax->startElement = xmlTextReaderStartElement;
 2014|  43.2k|    ret->endElement = ret->sax->endElement;
 2015|  43.2k|    ret->sax->endElement = xmlTextReaderEndElement;
 2016|  43.2k|#ifdef LIBXML_SAX1_ENABLED
 2017|  43.2k|    if (ret->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  43.2k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2017:9): [True: 43.2k, False: 0]
  ------------------
 2018|  43.2k|#endif /* LIBXML_SAX1_ENABLED */
 2019|  43.2k|	ret->startElementNs = ret->sax->startElementNs;
 2020|  43.2k|	ret->sax->startElementNs = xmlTextReaderStartElementNs;
 2021|  43.2k|	ret->endElementNs = ret->sax->endElementNs;
 2022|  43.2k|	ret->sax->endElementNs = xmlTextReaderEndElementNs;
 2023|  43.2k|#ifdef LIBXML_SAX1_ENABLED
 2024|  43.2k|    } else {
 2025|      0|	ret->startElementNs = NULL;
 2026|      0|	ret->endElementNs = NULL;
 2027|      0|    }
 2028|  43.2k|#endif /* LIBXML_SAX1_ENABLED */
 2029|  43.2k|    ret->characters = ret->sax->characters;
 2030|  43.2k|    ret->sax->characters = xmlTextReaderCharacters;
 2031|  43.2k|    ret->sax->ignorableWhitespace = xmlTextReaderCharacters;
 2032|  43.2k|    ret->cdataBlock = ret->sax->cdataBlock;
 2033|  43.2k|    ret->sax->cdataBlock = xmlTextReaderCDataBlock;
 2034|       |
 2035|  43.2k|    ret->mode = XML_TEXTREADER_MODE_INITIAL;
 2036|  43.2k|    ret->node = NULL;
 2037|  43.2k|    ret->curnode = NULL;
 2038|  43.2k|    if (xmlBufUse(ret->input->buffer) < 4) {
  ------------------
  |  Branch (2038:9): [True: 1.22k, False: 42.0k]
  ------------------
 2039|  1.22k|	xmlParserInputBufferRead(input, 4);
 2040|  1.22k|    }
 2041|  43.2k|    if (xmlBufUse(ret->input->buffer) >= 4) {
  ------------------
  |  Branch (2041:9): [True: 42.0k, False: 1.22k]
  ------------------
 2042|  42.0k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
 2043|  42.0k|			     (const char *) xmlBufContent(ret->input->buffer),
 2044|  42.0k|                                            4, URI);
 2045|  42.0k|	ret->base = 0;
 2046|  42.0k|	ret->cur = 4;
 2047|  42.0k|    } else {
 2048|  1.22k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL, NULL, 0, URI);
 2049|  1.22k|	ret->base = 0;
 2050|  1.22k|	ret->cur = 0;
 2051|  1.22k|    }
 2052|       |
 2053|  43.2k|    if (ret->ctxt == NULL) {
  ------------------
  |  Branch (2053:9): [True: 44, False: 43.1k]
  ------------------
 2054|     44|	xmlBufFree(ret->buffer);
 2055|     44|	xmlFree(ret->sax);
 2056|     44|	xmlFree(ret);
 2057|     44|	return(NULL);
 2058|     44|    }
 2059|  43.1k|    ret->ctxt->parseMode = XML_PARSE_READER;
 2060|  43.1k|    ret->ctxt->_private = ret;
 2061|  43.1k|    ret->ctxt->dictNames = 1;
 2062|  43.1k|    ret->allocs = XML_TEXTREADER_CTXT;
  ------------------
  |  |   78|  43.1k|#define XML_TEXTREADER_CTXT	2
  ------------------
 2063|       |    /*
 2064|       |     * use the parser dictionary to allocate all elements and attributes names
 2065|       |     */
 2066|  43.1k|    ret->dict = ret->ctxt->dict;
 2067|  43.1k|#ifdef LIBXML_XINCLUDE_ENABLED
 2068|  43.1k|    ret->xinclude = 0;
 2069|  43.1k|#endif
 2070|  43.1k|#ifdef LIBXML_PATTERN_ENABLED
 2071|  43.1k|    ret->patternMax = 0;
 2072|       |    ret->patternTab = NULL;
 2073|  43.1k|#endif
 2074|  43.1k|    return(ret);
 2075|  43.2k|}
xmlFreeTextReader:
 2125|  43.1k|xmlFreeTextReader(xmlTextReader *reader) {
 2126|  43.1k|    if (reader == NULL)
  ------------------
  |  Branch (2126:9): [True: 0, False: 43.1k]
  ------------------
 2127|      0|	return;
 2128|  43.1k|#ifdef LIBXML_RELAXNG_ENABLED
 2129|  43.1k|    if (reader->rngSchemas != NULL) {
  ------------------
  |  Branch (2129:9): [True: 0, False: 43.1k]
  ------------------
 2130|      0|	xmlRelaxNGFree(reader->rngSchemas);
 2131|      0|	reader->rngSchemas = NULL;
 2132|      0|    }
 2133|  43.1k|    if (reader->rngValidCtxt != NULL) {
  ------------------
  |  Branch (2133:9): [True: 0, False: 43.1k]
  ------------------
 2134|      0|	if (! reader->rngPreserveCtxt)
  ------------------
  |  Branch (2134:6): [True: 0, False: 0]
  ------------------
 2135|      0|	    xmlRelaxNGFreeValidCtxt(reader->rngValidCtxt);
 2136|      0|	reader->rngValidCtxt = NULL;
 2137|      0|    }
 2138|  43.1k|#endif
 2139|  43.1k|#ifdef LIBXML_SCHEMAS_ENABLED
 2140|  43.1k|    if (reader->xsdPlug != NULL) {
  ------------------
  |  Branch (2140:9): [True: 0, False: 43.1k]
  ------------------
 2141|      0|	xmlSchemaSAXUnplug(reader->xsdPlug);
 2142|      0|	reader->xsdPlug = NULL;
 2143|      0|    }
 2144|  43.1k|    if (reader->xsdValidCtxt != NULL) {
  ------------------
  |  Branch (2144:9): [True: 0, False: 43.1k]
  ------------------
 2145|      0|	if (! reader->xsdPreserveCtxt)
  ------------------
  |  Branch (2145:6): [True: 0, False: 0]
  ------------------
 2146|      0|	    xmlSchemaFreeValidCtxt(reader->xsdValidCtxt);
 2147|      0|	reader->xsdValidCtxt = NULL;
 2148|      0|    }
 2149|  43.1k|    if (reader->xsdSchemas != NULL) {
  ------------------
  |  Branch (2149:9): [True: 0, False: 43.1k]
  ------------------
 2150|      0|	xmlSchemaFree(reader->xsdSchemas);
 2151|      0|	reader->xsdSchemas = NULL;
 2152|      0|    }
 2153|  43.1k|#endif
 2154|  43.1k|#ifdef LIBXML_XINCLUDE_ENABLED
 2155|  43.1k|    if (reader->xincctxt != NULL)
  ------------------
  |  Branch (2155:9): [True: 9.66k, False: 33.5k]
  ------------------
 2156|  9.66k|	xmlXIncludeFreeContext(reader->xincctxt);
 2157|  43.1k|#endif
 2158|  43.1k|#ifdef LIBXML_PATTERN_ENABLED
 2159|  43.1k|    if (reader->patternTab != NULL) {
  ------------------
  |  Branch (2159:9): [True: 0, False: 43.1k]
  ------------------
 2160|      0|        int i;
 2161|      0|	for (i = 0;i < reader->patternNr;i++) {
  ------------------
  |  Branch (2161:13): [True: 0, False: 0]
  ------------------
 2162|      0|	    if (reader->patternTab[i] != NULL)
  ------------------
  |  Branch (2162:10): [True: 0, False: 0]
  ------------------
 2163|      0|	        xmlFreePattern(reader->patternTab[i]);
 2164|      0|	}
 2165|      0|	xmlFree(reader->patternTab);
 2166|      0|    }
 2167|  43.1k|#endif
 2168|  43.1k|    if (reader->mode != XML_TEXTREADER_MODE_CLOSED)
  ------------------
  |  Branch (2168:9): [True: 42.6k, False: 495]
  ------------------
 2169|  42.6k|        xmlTextReaderClose(reader);
 2170|  43.1k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2170:9): [True: 43.1k, False: 0]
  ------------------
 2171|  43.1k|        if (reader->dict == reader->ctxt->dict)
  ------------------
  |  Branch (2171:13): [True: 43.1k, False: 0]
  ------------------
 2172|  43.1k|	    reader->dict = NULL;
 2173|  43.1k|	if (reader->allocs & XML_TEXTREADER_CTXT)
  ------------------
  |  |   78|  43.1k|#define XML_TEXTREADER_CTXT	2
  ------------------
  |  Branch (2173:6): [True: 43.1k, False: 0]
  ------------------
 2174|  43.1k|	    xmlFreeParserCtxt(reader->ctxt);
 2175|  43.1k|    }
 2176|  43.1k|    if (reader->sax != NULL)
  ------------------
  |  Branch (2176:9): [True: 43.1k, False: 0]
  ------------------
 2177|  43.1k|	xmlFree(reader->sax);
 2178|  43.1k|    if (reader->buffer != NULL)
  ------------------
  |  Branch (2178:9): [True: 43.1k, False: 0]
  ------------------
 2179|  43.1k|        xmlBufFree(reader->buffer);
 2180|  43.1k|    if (reader->entTab != NULL)
  ------------------
  |  Branch (2180:9): [True: 233, False: 42.9k]
  ------------------
 2181|    233|	xmlFree(reader->entTab);
 2182|  43.1k|    if (reader->dict != NULL)
  ------------------
  |  Branch (2182:9): [True: 0, False: 43.1k]
  ------------------
 2183|      0|        xmlDictFree(reader->dict);
 2184|  43.1k|    xmlFree(reader);
 2185|  43.1k|}
xmlTextReaderClose:
 2201|  44.2k|xmlTextReaderClose(xmlTextReader *reader) {
 2202|  44.2k|    if (reader == NULL)
  ------------------
  |  Branch (2202:9): [True: 0, False: 44.2k]
  ------------------
 2203|      0|	return(-1);
 2204|  44.2k|    reader->node = NULL;
 2205|  44.2k|    reader->curnode = NULL;
 2206|  44.2k|    reader->mode = XML_TEXTREADER_MODE_CLOSED;
 2207|  44.2k|    if (reader->faketext != NULL) {
  ------------------
  |  Branch (2207:9): [True: 208, False: 44.0k]
  ------------------
 2208|    208|        xmlFreeNode(reader->faketext);
 2209|    208|        reader->faketext = NULL;
 2210|    208|    }
 2211|  44.2k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2211:9): [True: 44.2k, False: 0]
  ------------------
 2212|  44.2k|#ifdef LIBXML_VALID_ENABLED
 2213|  44.2k|	if ((reader->ctxt->vctxt.vstateTab != NULL) &&
  ------------------
  |  Branch (2213:6): [True: 2.89k, False: 41.3k]
  ------------------
 2214|  2.89k|	    (reader->ctxt->vctxt.vstateMax > 0)){
  ------------------
  |  Branch (2214:6): [True: 2.89k, False: 0]
  ------------------
 2215|  2.89k|#ifdef LIBXML_REGEXP_ENABLED
 2216|  25.4k|            while (reader->ctxt->vctxt.vstateNr > 0)
  ------------------
  |  Branch (2216:20): [True: 22.5k, False: 2.89k]
  ------------------
 2217|  22.5k|                xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
 2218|  2.89k|#endif /* LIBXML_REGEXP_ENABLED */
 2219|  2.89k|	    xmlFree(reader->ctxt->vctxt.vstateTab);
 2220|  2.89k|	    reader->ctxt->vctxt.vstateTab = NULL;
 2221|  2.89k|	    reader->ctxt->vctxt.vstateMax = 0;
 2222|  2.89k|	}
 2223|  44.2k|#endif /* LIBXML_VALID_ENABLED */
 2224|  44.2k|	xmlStopParser(reader->ctxt);
 2225|  44.2k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2225:6): [True: 40.9k, False: 3.27k]
  ------------------
 2226|  40.9k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2226:10): [True: 38.3k, False: 2.62k]
  ------------------
 2227|  38.3k|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2228|  40.9k|	    reader->ctxt->myDoc = NULL;
 2229|  40.9k|	}
 2230|  44.2k|    }
 2231|  44.2k|    if ((reader->input != NULL)  && (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|  42.9k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2231:9): [True: 42.9k, False: 1.28k]
  |  Branch (2231:37): [True: 42.1k, False: 840]
  ------------------
 2232|  42.1k|	xmlFreeParserInputBuffer(reader->input);
 2233|  42.1k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  42.1k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2234|  42.1k|    }
 2235|  44.2k|    return(0);
 2236|  44.2k|}
xmlTextReaderGetAttributeNo:
 2248|  7.60k|xmlTextReaderGetAttributeNo(xmlTextReader *reader, int no) {
 2249|  7.60k|    xmlChar *ret;
 2250|  7.60k|    int i;
 2251|  7.60k|    xmlAttrPtr cur;
 2252|  7.60k|    xmlNsPtr ns;
 2253|       |
 2254|  7.60k|    if (reader == NULL)
  ------------------
  |  Branch (2254:9): [True: 0, False: 7.60k]
  ------------------
 2255|      0|	return(NULL);
 2256|  7.60k|    if (reader->node == NULL)
  ------------------
  |  Branch (2256:9): [True: 933, False: 6.67k]
  ------------------
 2257|    933|	return(NULL);
 2258|  6.67k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2258:9): [True: 282, False: 6.38k]
  ------------------
 2259|    282|	return(NULL);
 2260|       |    /* TODO: handle the xmlDecl */
 2261|  6.38k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2261:9): [True: 3.66k, False: 2.72k]
  ------------------
 2262|  3.66k|	return(NULL);
 2263|       |
 2264|  2.72k|    ns = reader->node->nsDef;
 2265|  3.26k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2265:16): [True: 2.19k, False: 1.06k]
  |  Branch (2265:28): [True: 541, False: 1.65k]
  ------------------
 2266|    541|	ns = ns->next;
 2267|    541|    }
 2268|  2.72k|    if (ns != NULL)
  ------------------
  |  Branch (2268:9): [True: 556, False: 2.16k]
  ------------------
 2269|    556|	return(readerStrdup(reader, ns->href));
 2270|       |
 2271|  2.16k|    cur = reader->node->properties;
 2272|  2.16k|    if (cur == NULL)
  ------------------
  |  Branch (2272:9): [True: 1.06k, False: 1.10k]
  ------------------
 2273|  1.06k|	return(NULL);
 2274|  1.68k|    for (;i < no;i++) {
  ------------------
  |  Branch (2274:11): [True: 1.08k, False: 602]
  ------------------
 2275|  1.08k|	cur = cur->next;
 2276|  1.08k|	if (cur == NULL)
  ------------------
  |  Branch (2276:6): [True: 502, False: 583]
  ------------------
 2277|    502|	    return(NULL);
 2278|  1.08k|    }
 2279|       |    /* TODO walk the DTD if present */
 2280|       |
 2281|    602|    if (cur->children == NULL)
  ------------------
  |  Branch (2281:9): [True: 216, False: 386]
  ------------------
 2282|    216|        return(NULL);
 2283|    386|    ret = xmlNodeListGetString(reader->node->doc, cur->children, 1);
 2284|    386|    if (ret == NULL)
  ------------------
  |  Branch (2284:9): [True: 2, False: 384]
  ------------------
 2285|      2|        xmlTextReaderErrMemory(reader);
 2286|    386|    return(ret);
 2287|    602|}
xmlTextReaderGetAttribute:
 2298|  27.9k|xmlTextReaderGetAttribute(xmlTextReader *reader, const xmlChar *name) {
 2299|  27.9k|    xmlChar *prefix = NULL;
 2300|  27.9k|    const xmlChar *localname;
 2301|  27.9k|    xmlNsPtr ns;
 2302|  27.9k|    xmlChar *ret = NULL;
 2303|  27.9k|    int result;
 2304|       |
 2305|  27.9k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2305:9): [True: 0, False: 27.9k]
  |  Branch (2305:29): [True: 12.5k, False: 15.4k]
  ------------------
 2306|  12.5k|	return(NULL);
 2307|  15.4k|    if (reader->node == NULL)
  ------------------
  |  Branch (2307:9): [True: 0, False: 15.4k]
  ------------------
 2308|      0|	return(NULL);
 2309|  15.4k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2309:9): [True: 929, False: 14.5k]
  ------------------
 2310|    929|	return(NULL);
 2311|       |
 2312|       |    /* TODO: handle the xmlDecl */
 2313|  14.5k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2313:9): [True: 5.74k, False: 8.77k]
  ------------------
 2314|  5.74k|	return(NULL);
 2315|       |
 2316|  8.77k|    localname = xmlSplitQName4(name, &prefix);
 2317|  8.77k|    if (localname == NULL) {
  ------------------
  |  Branch (2317:9): [True: 8, False: 8.76k]
  ------------------
 2318|      8|        xmlTextReaderErrMemory(reader);
 2319|      8|        return(NULL);
 2320|      8|    }
 2321|  8.76k|    if (prefix == NULL) {
  ------------------
  |  Branch (2321:9): [True: 5.64k, False: 3.12k]
  ------------------
 2322|       |        /*
 2323|       |         * Namespace default decl
 2324|       |         */
 2325|  5.64k|        if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  5.64k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2325:13): [True: 534, False: 5.10k]
  ------------------
 2326|    534|            ns = reader->node->nsDef;
 2327|    736|            while (ns != NULL) {
  ------------------
  |  Branch (2327:20): [True: 405, False: 331]
  ------------------
 2328|    405|                if (ns->prefix == NULL) {
  ------------------
  |  Branch (2328:21): [True: 203, False: 202]
  ------------------
 2329|    203|                    return(readerStrdup(reader, ns->href));
 2330|    203|                }
 2331|    202|                ns = ns->next;
 2332|    202|            }
 2333|    331|            return NULL;
 2334|    534|        }
 2335|       |
 2336|  5.10k|        result = xmlNodeGetAttrValue(reader->node, name, NULL, &ret);
 2337|  5.10k|        if (result < 0)
  ------------------
  |  Branch (2337:13): [True: 9, False: 5.09k]
  ------------------
 2338|      9|            xmlTextReaderErrMemory(reader);
 2339|  5.10k|        return(ret);
 2340|  5.64k|    }
 2341|       |
 2342|       |    /*
 2343|       |     * Namespace default decl
 2344|       |     */
 2345|  3.12k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.12k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2345:9): [True: 797, False: 2.33k]
  ------------------
 2346|    797|        ns = reader->node->nsDef;
 2347|  1.37k|        while (ns != NULL) {
  ------------------
  |  Branch (2347:16): [True: 804, False: 571]
  ------------------
 2348|    804|            if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2348:17): [True: 597, False: 207]
  |  Branch (2348:41): [True: 226, False: 371]
  ------------------
 2349|    226|                ret = readerStrdup(reader, ns->href);
 2350|    226|                break;
 2351|    226|            }
 2352|    578|            ns = ns->next;
 2353|    578|        }
 2354|  2.33k|    } else {
 2355|  2.33k|        result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2356|  2.33k|        if (result < 0)
  ------------------
  |  Branch (2356:13): [True: 1, False: 2.33k]
  ------------------
 2357|      1|            xmlTextReaderErrMemory(reader);
 2358|  2.33k|        if (ns != NULL) {
  ------------------
  |  Branch (2358:13): [True: 1.32k, False: 1.00k]
  ------------------
 2359|  1.32k|            result = xmlNodeGetAttrValue(reader->node, localname, ns->href,
 2360|  1.32k|                                         &ret);
 2361|  1.32k|            if (result < 0)
  ------------------
  |  Branch (2361:17): [True: 3, False: 1.32k]
  ------------------
 2362|      3|                xmlTextReaderErrMemory(reader);
 2363|  1.32k|        }
 2364|  2.33k|    }
 2365|       |
 2366|  3.12k|    if (prefix != NULL)
  ------------------
  |  Branch (2366:9): [True: 3.12k, False: 0]
  ------------------
 2367|  3.12k|        xmlFree(prefix);
 2368|  3.12k|    return(ret);
 2369|  8.76k|}
xmlTextReaderGetAttributeNs:
 2383|  22.6k|			    const xmlChar *namespaceURI) {
 2384|  22.6k|    xmlChar *ret = NULL;
 2385|  22.6k|    xmlChar *prefix = NULL;
 2386|  22.6k|    xmlNsPtr ns;
 2387|  22.6k|    int result;
 2388|       |
 2389|  22.6k|    if ((reader == NULL) || (localName == NULL))
  ------------------
  |  Branch (2389:9): [True: 0, False: 22.6k]
  |  Branch (2389:29): [True: 8.39k, False: 14.2k]
  ------------------
 2390|  8.39k|	return(NULL);
 2391|  14.2k|    if (reader->node == NULL)
  ------------------
  |  Branch (2391:9): [True: 0, False: 14.2k]
  ------------------
 2392|      0|	return(NULL);
 2393|  14.2k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2393:9): [True: 1.56k, False: 12.7k]
  ------------------
 2394|  1.56k|	return(NULL);
 2395|       |
 2396|       |    /* TODO: handle the xmlDecl */
 2397|  12.7k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2397:9): [True: 4.94k, False: 7.78k]
  ------------------
 2398|  4.94k|	return(NULL);
 2399|       |
 2400|  7.78k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  7.78k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2400:9): [True: 1.03k, False: 6.74k]
  ------------------
 2401|  1.03k|        if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  1.03k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2401:13): [True: 777, False: 259]
  ------------------
 2402|    777|            prefix = BAD_CAST localName;
  ------------------
  |  |   34|    777|#define BAD_CAST (xmlChar *)
  ------------------
 2403|    777|        }
 2404|  1.03k|        ns = reader->node->nsDef;
 2405|  2.01k|        while (ns != NULL) {
  ------------------
  |  Branch (2405:16): [True: 1.11k, False: 903]
  ------------------
 2406|  1.11k|            if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2406:18): [True: 269, False: 845]
  |  Branch (2406:36): [True: 66, False: 203]
  ------------------
 2407|  1.04k|                ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2407:18): [True: 556, False: 492]
  |  Branch (2407:42): [True: 67, False: 489]
  ------------------
 2408|    133|                return readerStrdup(reader, ns->href);
 2409|    133|            }
 2410|    981|            ns = ns->next;
 2411|    981|        }
 2412|    903|        return NULL;
 2413|  1.03k|    }
 2414|       |
 2415|  6.74k|    result = xmlNodeGetAttrValue(reader->node, localName, namespaceURI, &ret);
 2416|  6.74k|    if (result < 0)
  ------------------
  |  Branch (2416:9): [True: 5, False: 6.74k]
  ------------------
 2417|      5|        xmlTextReaderErrMemory(reader);
 2418|       |
 2419|  6.74k|    return(ret);
 2420|  7.78k|}
xmlTextReaderGetRemainder:
 2436|  3.45k|xmlTextReaderGetRemainder(xmlTextReader *reader) {
 2437|  3.45k|    xmlParserInputBufferPtr ret = NULL;
 2438|       |
 2439|  3.45k|    if (reader == NULL)
  ------------------
  |  Branch (2439:9): [True: 0, False: 3.45k]
  ------------------
 2440|      0|	return(NULL);
 2441|  3.45k|    if (reader->node == NULL)
  ------------------
  |  Branch (2441:9): [True: 2.39k, False: 1.06k]
  ------------------
 2442|  2.39k|	return(NULL);
 2443|       |
 2444|  1.06k|    reader->node = NULL;
 2445|  1.06k|    reader->curnode = NULL;
 2446|  1.06k|    reader->mode = XML_TEXTREADER_MODE_EOF;
 2447|  1.06k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2447:9): [True: 1.06k, False: 0]
  ------------------
 2448|  1.06k|	xmlStopParser(reader->ctxt);
 2449|  1.06k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2449:6): [True: 1.06k, False: 0]
  ------------------
 2450|  1.06k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2450:10): [True: 0, False: 1.06k]
  ------------------
 2451|      0|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2452|  1.06k|	    reader->ctxt->myDoc = NULL;
 2453|  1.06k|	}
 2454|  1.06k|    }
 2455|  1.06k|    if (reader->allocs & XML_TEXTREADER_INPUT) {
  ------------------
  |  |   77|  1.06k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2455:9): [True: 1.06k, False: 0]
  ------------------
 2456|  1.06k|	ret = reader->input;
 2457|  1.06k|	reader->input = NULL;
 2458|  1.06k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  1.06k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2459|  1.06k|    } else {
 2460|       |	/*
 2461|       |	 * Hum, one may need to duplicate the data structure because
 2462|       |	 * without reference counting the input may be freed twice:
 2463|       |	 *   - by the layer which allocated it.
 2464|       |	 *   - by the layer to which would have been returned to.
 2465|       |	 */
 2466|      0|	return(NULL);
 2467|      0|    }
 2468|  1.06k|    return(ret);
 2469|  1.06k|}
xmlTextReaderLookupNamespace:
 2481|  7.71k|xmlTextReaderLookupNamespace(xmlTextReader *reader, const xmlChar *prefix) {
 2482|  7.71k|    xmlNsPtr ns;
 2483|  7.71k|    int result;
 2484|       |
 2485|  7.71k|    if (reader == NULL)
  ------------------
  |  Branch (2485:9): [True: 0, False: 7.71k]
  ------------------
 2486|      0|	return(NULL);
 2487|  7.71k|    if (reader->node == NULL)
  ------------------
  |  Branch (2487:9): [True: 2.47k, False: 5.24k]
  ------------------
 2488|  2.47k|	return(NULL);
 2489|       |
 2490|  5.24k|    result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2491|  5.24k|    if (result < 0) {
  ------------------
  |  Branch (2491:9): [True: 0, False: 5.24k]
  ------------------
 2492|      0|        xmlTextReaderErrMemory(reader);
 2493|      0|        return(NULL);
 2494|      0|    }
 2495|  5.24k|    if (ns == NULL)
  ------------------
  |  Branch (2495:9): [True: 4.56k, False: 685]
  ------------------
 2496|  4.56k|	return(NULL);
 2497|    685|    return(readerStrdup(reader, ns->href));
 2498|  5.24k|}
xmlTextReaderMoveToAttributeNo:
 2510|  7.78k|xmlTextReaderMoveToAttributeNo(xmlTextReader *reader, int no) {
 2511|  7.78k|    int i;
 2512|  7.78k|    xmlAttrPtr cur;
 2513|  7.78k|    xmlNsPtr ns;
 2514|       |
 2515|  7.78k|    if (reader == NULL)
  ------------------
  |  Branch (2515:9): [True: 0, False: 7.78k]
  ------------------
 2516|      0|	return(-1);
 2517|  7.78k|    if (reader->node == NULL)
  ------------------
  |  Branch (2517:9): [True: 2.65k, False: 5.12k]
  ------------------
 2518|  2.65k|	return(-1);
 2519|       |    /* TODO: handle the xmlDecl */
 2520|  5.12k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2520:9): [True: 1.81k, False: 3.31k]
  ------------------
 2521|  1.81k|	return(-1);
 2522|       |
 2523|  3.31k|    reader->curnode = NULL;
 2524|       |
 2525|  3.31k|    ns = reader->node->nsDef;
 2526|  4.96k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2526:16): [True: 4.43k, False: 527]
  |  Branch (2526:28): [True: 1.64k, False: 2.78k]
  ------------------
 2527|  1.64k|	ns = ns->next;
 2528|  1.64k|    }
 2529|  3.31k|    if (ns != NULL) {
  ------------------
  |  Branch (2529:9): [True: 247, False: 3.06k]
  ------------------
 2530|    247|	reader->curnode = (xmlNodePtr) ns;
 2531|    247|	return(1);
 2532|    247|    }
 2533|       |
 2534|  3.06k|    cur = reader->node->properties;
 2535|  3.06k|    if (cur == NULL)
  ------------------
  |  Branch (2535:9): [True: 1.19k, False: 1.86k]
  ------------------
 2536|  1.19k|	return(0);
 2537|  2.80k|    for (;i < no;i++) {
  ------------------
  |  Branch (2537:11): [True: 2.37k, False: 434]
  ------------------
 2538|  2.37k|	cur = cur->next;
 2539|  2.37k|	if (cur == NULL)
  ------------------
  |  Branch (2539:6): [True: 1.43k, False: 938]
  ------------------
 2540|  1.43k|	    return(0);
 2541|  2.37k|    }
 2542|       |    /* TODO walk the DTD if present */
 2543|       |
 2544|    434|    reader->curnode = (xmlNodePtr) cur;
 2545|    434|    return(1);
 2546|  1.86k|}
xmlTextReaderMoveToAttribute:
 2557|  12.7k|xmlTextReaderMoveToAttribute(xmlTextReader *reader, const xmlChar *name) {
 2558|  12.7k|    xmlChar *prefix = NULL;
 2559|  12.7k|    const xmlChar *localname;
 2560|  12.7k|    xmlNsPtr ns;
 2561|  12.7k|    xmlAttrPtr prop;
 2562|       |
 2563|  12.7k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2563:9): [True: 0, False: 12.7k]
  |  Branch (2563:29): [True: 3.93k, False: 8.83k]
  ------------------
 2564|  3.93k|	return(-1);
 2565|  8.83k|    if (reader->node == NULL)
  ------------------
  |  Branch (2565:9): [True: 0, False: 8.83k]
  ------------------
 2566|      0|	return(-1);
 2567|       |
 2568|       |    /* TODO: handle the xmlDecl */
 2569|  8.83k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2569:9): [True: 2.37k, False: 6.46k]
  ------------------
 2570|  2.37k|	return(0);
 2571|       |
 2572|  6.46k|    localname = xmlSplitQName4(name, &prefix);
 2573|  6.46k|    if (localname == NULL) {
  ------------------
  |  Branch (2573:9): [True: 9, False: 6.45k]
  ------------------
 2574|      9|        xmlTextReaderErrMemory(reader);
 2575|      9|        return(-1);
 2576|      9|    }
 2577|  6.45k|    if (prefix == NULL) {
  ------------------
  |  Branch (2577:9): [True: 3.81k, False: 2.63k]
  ------------------
 2578|       |	/*
 2579|       |	 * Namespace default decl
 2580|       |	 */
 2581|  3.81k|	if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.81k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2581:6): [True: 636, False: 3.17k]
  ------------------
 2582|    636|	    ns = reader->node->nsDef;
 2583|    845|	    while (ns != NULL) {
  ------------------
  |  Branch (2583:13): [True: 441, False: 404]
  ------------------
 2584|    441|		if (ns->prefix == NULL) {
  ------------------
  |  Branch (2584:7): [True: 232, False: 209]
  ------------------
 2585|    232|		    reader->curnode = (xmlNodePtr) ns;
 2586|    232|		    return(1);
 2587|    232|		}
 2588|    209|		ns = ns->next;
 2589|    209|	    }
 2590|    404|	    return(0);
 2591|    636|	}
 2592|       |
 2593|  3.17k|	prop = reader->node->properties;
 2594|  5.05k|	while (prop != NULL) {
  ------------------
  |  Branch (2594:9): [True: 2.28k, False: 2.76k]
  ------------------
 2595|       |	    /*
 2596|       |	     * One need to have
 2597|       |	     *   - same attribute names
 2598|       |	     *   - and the attribute carrying that namespace
 2599|       |	     */
 2600|  2.28k|	    if ((xmlStrEqual(prop->name, name)) &&
  ------------------
  |  Branch (2600:10): [True: 611, False: 1.67k]
  ------------------
 2601|    611|		((prop->ns == NULL) || (prop->ns->prefix == NULL))) {
  ------------------
  |  Branch (2601:4): [True: 409, False: 202]
  |  Branch (2601:26): [True: 0, False: 202]
  ------------------
 2602|    409|		reader->curnode = (xmlNodePtr) prop;
 2603|    409|		return(1);
 2604|    409|	    }
 2605|  1.87k|	    prop = prop->next;
 2606|  1.87k|	}
 2607|  2.76k|	return(0);
 2608|  3.17k|    }
 2609|       |
 2610|       |    /*
 2611|       |     * Namespace default decl
 2612|       |     */
 2613|  2.63k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.63k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2613:9): [True: 994, False: 1.64k]
  ------------------
 2614|    994|	ns = reader->node->nsDef;
 2615|  1.46k|	while (ns != NULL) {
  ------------------
  |  Branch (2615:9): [True: 1.00k, False: 456]
  ------------------
 2616|  1.00k|	    if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2616:10): [True: 800, False: 209]
  |  Branch (2616:34): [True: 538, False: 262]
  ------------------
 2617|    538|		reader->curnode = (xmlNodePtr) ns;
 2618|    538|		goto found;
 2619|    538|	    }
 2620|    471|	    ns = ns->next;
 2621|    471|	}
 2622|    456|	goto not_found;
 2623|    994|    }
 2624|  1.64k|    prop = reader->node->properties;
 2625|  3.01k|    while (prop != NULL) {
  ------------------
  |  Branch (2625:12): [True: 1.61k, False: 1.40k]
  ------------------
 2626|       |	/*
 2627|       |	 * One need to have
 2628|       |	 *   - same attribute names
 2629|       |	 *   - and the attribute carrying that namespace
 2630|       |	 */
 2631|  1.61k|	if ((xmlStrEqual(prop->name, localname)) &&
  ------------------
  |  Branch (2631:6): [True: 678, False: 932]
  ------------------
 2632|    678|	    (prop->ns != NULL) && (xmlStrEqual(prop->ns->prefix, prefix))) {
  ------------------
  |  Branch (2632:6): [True: 435, False: 243]
  |  Branch (2632:28): [True: 237, False: 198]
  ------------------
 2633|    237|	    reader->curnode = (xmlNodePtr) prop;
 2634|    237|	    goto found;
 2635|    237|	}
 2636|  1.37k|	prop = prop->next;
 2637|  1.37k|    }
 2638|  1.86k|not_found:
 2639|  1.86k|    if (prefix != NULL)
  ------------------
  |  Branch (2639:9): [True: 1.86k, False: 0]
  ------------------
 2640|  1.86k|        xmlFree(prefix);
 2641|  1.86k|    return(0);
 2642|       |
 2643|    775|found:
 2644|    775|    if (prefix != NULL)
  ------------------
  |  Branch (2644:9): [True: 775, False: 0]
  ------------------
 2645|    775|        xmlFree(prefix);
 2646|    775|    return(1);
 2647|  1.64k|}
xmlTextReaderMoveToAttributeNs:
 2660|  10.0k|	const xmlChar *localName, const xmlChar *namespaceURI) {
 2661|  10.0k|    xmlAttrPtr prop;
 2662|  10.0k|    xmlNodePtr node;
 2663|  10.0k|    xmlNsPtr ns;
 2664|  10.0k|    xmlChar *prefix = NULL;
 2665|       |
 2666|  10.0k|    if ((reader == NULL) || (localName == NULL) || (namespaceURI == NULL))
  ------------------
  |  Branch (2666:9): [True: 0, False: 10.0k]
  |  Branch (2666:29): [True: 3.25k, False: 6.81k]
  |  Branch (2666:52): [True: 3.27k, False: 3.53k]
  ------------------
 2667|  6.52k|	return(-1);
 2668|  3.53k|    if (reader->node == NULL)
  ------------------
  |  Branch (2668:9): [True: 0, False: 3.53k]
  ------------------
 2669|      0|	return(-1);
 2670|  3.53k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2670:9): [True: 0, False: 3.53k]
  ------------------
 2671|      0|	return(0);
 2672|  3.53k|    node = reader->node;
 2673|       |
 2674|  3.53k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  3.53k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2674:9): [True: 2.19k, False: 1.34k]
  ------------------
 2675|  2.19k|		if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.19k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2675:7): [True: 1.25k, False: 933]
  ------------------
 2676|  1.25k|			prefix = BAD_CAST localName;
  ------------------
  |  |   34|  1.25k|#define BAD_CAST (xmlChar *)
  ------------------
 2677|  1.25k|		}
 2678|  2.19k|		ns = reader->node->nsDef;
 2679|  2.90k|		while (ns != NULL) {
  ------------------
  |  Branch (2679:10): [True: 2.50k, False: 408]
  ------------------
 2680|  2.50k|			if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2680:9): [True: 933, False: 1.56k]
  |  Branch (2680:27): [True: 736, False: 197]
  ------------------
 2681|  1.78k|				((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2681:6): [True: 1.31k, False: 445]
  |  Branch (2681:30): [True: 1.04k, False: 273]
  ------------------
 2682|  1.78k|				reader->curnode = (xmlNodePtr) ns;
 2683|  1.78k|				return(1);
 2684|  1.78k|			}
 2685|    718|			ns = ns->next;
 2686|    718|		}
 2687|    408|		return(0);
 2688|  2.19k|    }
 2689|       |
 2690|  1.34k|    prop = node->properties;
 2691|  2.67k|    while (prop != NULL) {
  ------------------
  |  Branch (2691:12): [True: 1.54k, False: 1.12k]
  ------------------
 2692|       |	/*
 2693|       |	 * One need to have
 2694|       |	 *   - same attribute names
 2695|       |	 *   - and the attribute carrying that namespace
 2696|       |	 */
 2697|  1.54k|        if (xmlStrEqual(prop->name, localName) &&
  ------------------
  |  Branch (2697:13): [True: 1.04k, False: 500]
  ------------------
 2698|  1.04k|	    ((prop->ns != NULL) &&
  ------------------
  |  Branch (2698:7): [True: 430, False: 615]
  ------------------
 2699|    430|	     (xmlStrEqual(prop->ns->href, namespaceURI)))) {
  ------------------
  |  Branch (2699:7): [True: 219, False: 211]
  ------------------
 2700|    219|	    reader->curnode = (xmlNodePtr) prop;
 2701|    219|	    return(1);
 2702|    219|        }
 2703|  1.32k|	prop = prop->next;
 2704|  1.32k|    }
 2705|  1.12k|    return(0);
 2706|  1.34k|}
xmlTextReaderMoveToFirstAttribute:
 2716|  15.6k|xmlTextReaderMoveToFirstAttribute(xmlTextReader *reader) {
 2717|  15.6k|    if (reader == NULL)
  ------------------
  |  Branch (2717:9): [True: 0, False: 15.6k]
  ------------------
 2718|      0|	return(-1);
 2719|  15.6k|    if (reader->node == NULL)
  ------------------
  |  Branch (2719:9): [True: 5.03k, False: 10.6k]
  ------------------
 2720|  5.03k|	return(-1);
 2721|  10.6k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2721:9): [True: 3.05k, False: 7.59k]
  ------------------
 2722|  3.05k|	return(0);
 2723|       |
 2724|  7.59k|    if (reader->node->nsDef != NULL) {
  ------------------
  |  Branch (2724:9): [True: 3.56k, False: 4.02k]
  ------------------
 2725|  3.56k|	reader->curnode = (xmlNodePtr) reader->node->nsDef;
 2726|  3.56k|	return(1);
 2727|  3.56k|    }
 2728|  4.02k|    if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2728:9): [True: 1.97k, False: 2.05k]
  ------------------
 2729|  1.97k|	reader->curnode = (xmlNodePtr) reader->node->properties;
 2730|  1.97k|	return(1);
 2731|  1.97k|    }
 2732|  2.05k|    return(0);
 2733|  4.02k|}
xmlTextReaderMoveToNextAttribute:
 2743|  6.73k|xmlTextReaderMoveToNextAttribute(xmlTextReader *reader) {
 2744|  6.73k|    if (reader == NULL)
  ------------------
  |  Branch (2744:9): [True: 0, False: 6.73k]
  ------------------
 2745|      0|	return(-1);
 2746|  6.73k|    if (reader->node == NULL)
  ------------------
  |  Branch (2746:9): [True: 1.73k, False: 5.00k]
  ------------------
 2747|  1.73k|	return(-1);
 2748|  5.00k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2748:9): [True: 1.36k, False: 3.63k]
  ------------------
 2749|  1.36k|	return(0);
 2750|  3.63k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2750:9): [True: 1.85k, False: 1.78k]
  ------------------
 2751|  1.85k|	return(xmlTextReaderMoveToFirstAttribute(reader));
 2752|       |
 2753|  1.78k|    if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2753:9): [True: 900, False: 884]
  ------------------
 2754|    900|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2755|    900|	if (ns->next != NULL) {
  ------------------
  |  Branch (2755:6): [True: 234, False: 666]
  ------------------
 2756|    234|	    reader->curnode = (xmlNodePtr) ns->next;
 2757|    234|	    return(1);
 2758|    234|	}
 2759|    666|	if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2759:6): [True: 269, False: 397]
  ------------------
 2760|    269|	    reader->curnode = (xmlNodePtr) reader->node->properties;
 2761|    269|	    return(1);
 2762|    269|	}
 2763|    397|	return(0);
 2764|    884|    } else if ((reader->curnode->type == XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (2764:16): [True: 641, False: 243]
  ------------------
 2765|    641|	       (reader->curnode->next != NULL)) {
  ------------------
  |  Branch (2765:9): [True: 228, False: 413]
  ------------------
 2766|    228|	reader->curnode = reader->curnode->next;
 2767|    228|	return(1);
 2768|    228|    }
 2769|    656|    return(0);
 2770|  1.78k|}
xmlTextReaderMoveToElement:
 2780|  5.03k|xmlTextReaderMoveToElement(xmlTextReader *reader) {
 2781|  5.03k|    if (reader == NULL)
  ------------------
  |  Branch (2781:9): [True: 0, False: 5.03k]
  ------------------
 2782|      0|	return(-1);
 2783|  5.03k|    if (reader->node == NULL)
  ------------------
  |  Branch (2783:9): [True: 1.94k, False: 3.09k]
  ------------------
 2784|  1.94k|	return(-1);
 2785|  3.09k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2785:9): [True: 1.40k, False: 1.68k]
  ------------------
 2786|  1.40k|	return(0);
 2787|  1.68k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (2787:9): [True: 389, False: 1.30k]
  ------------------
 2788|    389|	reader->curnode = NULL;
 2789|    389|	return(1);
 2790|    389|    }
 2791|  1.30k|    return(0);
 2792|  1.68k|}
xmlTextReaderReadAttributeValue:
 2803|  10.4k|xmlTextReaderReadAttributeValue(xmlTextReader *reader) {
 2804|  10.4k|    if (reader == NULL)
  ------------------
  |  Branch (2804:9): [True: 0, False: 10.4k]
  ------------------
 2805|      0|	return(-1);
 2806|  10.4k|    if (reader->node == NULL)
  ------------------
  |  Branch (2806:9): [True: 3.55k, False: 6.91k]
  ------------------
 2807|  3.55k|	return(-1);
 2808|  6.91k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2808:9): [True: 4.97k, False: 1.93k]
  ------------------
 2809|  4.97k|	return(0);
 2810|  1.93k|    if (reader->curnode->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (2810:9): [True: 548, False: 1.39k]
  ------------------
 2811|    548|	if (reader->curnode->children == NULL)
  ------------------
  |  Branch (2811:6): [True: 246, False: 302]
  ------------------
 2812|    246|	    return(0);
 2813|    302|	reader->curnode = reader->curnode->children;
 2814|  1.39k|    } else if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2814:16): [True: 795, False: 596]
  ------------------
 2815|    795|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2816|       |
 2817|    795|	if (reader->faketext == NULL) {
  ------------------
  |  Branch (2817:6): [True: 211, False: 584]
  ------------------
 2818|    211|	    reader->faketext = xmlNewDocText(reader->node->doc,
 2819|    211|		                             ns->href);
 2820|    211|            if (reader->faketext == NULL) {
  ------------------
  |  Branch (2820:17): [True: 3, False: 208]
  ------------------
 2821|      3|                xmlTextReaderErrMemory(reader);
 2822|      3|                return(-1);
 2823|      3|            }
 2824|    584|	} else {
 2825|    584|            if ((reader->faketext->content != NULL) &&
  ------------------
  |  Branch (2825:17): [True: 355, False: 229]
  ------------------
 2826|    355|	        (reader->faketext->content !=
  ------------------
  |  Branch (2826:10): [True: 355, False: 0]
  ------------------
 2827|    355|		 (xmlChar *) &(reader->faketext->properties)))
 2828|    355|		xmlFree(reader->faketext->content);
 2829|    584|            if (ns->href == NULL) {
  ------------------
  |  Branch (2829:17): [True: 228, False: 356]
  ------------------
 2830|    228|                reader->faketext->content = NULL;
 2831|    356|            } else {
 2832|    356|                reader->faketext->content = xmlStrdup(ns->href);
 2833|    356|                if (reader->faketext->content == NULL) {
  ------------------
  |  Branch (2833:21): [True: 2, False: 354]
  ------------------
 2834|      2|                    xmlTextReaderErrMemory(reader);
 2835|      2|                    return(-1);
 2836|      2|                }
 2837|    356|            }
 2838|    584|	}
 2839|    790|	reader->curnode = reader->faketext;
 2840|    790|    } else {
 2841|    596|	if (reader->curnode->next == NULL)
  ------------------
  |  Branch (2841:6): [True: 397, False: 199]
  ------------------
 2842|    397|	    return(0);
 2843|    199|	reader->curnode = reader->curnode->next;
 2844|    199|    }
 2845|  1.29k|    return(1);
 2846|  1.93k|}
xmlTextReaderConstEncoding:
 2856|  3.41k|xmlTextReaderConstEncoding(xmlTextReader *reader) {
 2857|  3.41k|    const xmlChar *encoding = NULL;
 2858|       |
 2859|  3.41k|    if (reader == NULL)
  ------------------
  |  Branch (2859:9): [True: 0, False: 3.41k]
  ------------------
 2860|      0|        return(NULL);
 2861|       |
 2862|  3.41k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (2862:9): [True: 3.41k, False: 0]
  ------------------
 2863|  3.41k|        encoding = xmlGetActualEncoding(reader->ctxt);
 2864|      0|    else if (reader->doc != NULL)
  ------------------
  |  Branch (2864:14): [True: 0, False: 0]
  ------------------
 2865|      0|        encoding = reader->doc->encoding;
 2866|       |
 2867|  3.41k|    return(constString(reader, encoding));
 2868|  3.41k|}
xmlTextReaderAttributeCount:
 2883|  8.01k|xmlTextReaderAttributeCount(xmlTextReader *reader) {
 2884|  8.01k|    int ret;
 2885|  8.01k|    xmlAttrPtr attr;
 2886|  8.01k|    xmlNsPtr ns;
 2887|  8.01k|    xmlNodePtr node;
 2888|       |
 2889|  8.01k|    if (reader == NULL)
  ------------------
  |  Branch (2889:9): [True: 0, False: 8.01k]
  ------------------
 2890|      0|	return(-1);
 2891|  8.01k|    if (reader->node == NULL)
  ------------------
  |  Branch (2891:9): [True: 3.06k, False: 4.95k]
  ------------------
 2892|  3.06k|	return(0);
 2893|       |
 2894|  4.95k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2894:9): [True: 473, False: 4.47k]
  ------------------
 2895|    473|	node = reader->curnode;
 2896|  4.47k|    else
 2897|  4.47k|	node = reader->node;
 2898|       |
 2899|  4.95k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2899:9): [True: 1.60k, False: 3.34k]
  ------------------
 2900|  1.60k|	return(0);
 2901|  3.34k|    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2901:9): [True: 204, False: 3.14k]
  ------------------
 2902|  3.14k|	(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2902:2): [True: 227, False: 2.91k]
  ------------------
 2903|    431|	return(0);
 2904|  2.91k|    ret = 0;
 2905|  2.91k|    attr = node->properties;
 2906|  6.90k|    while (attr != NULL) {
  ------------------
  |  Branch (2906:12): [True: 3.98k, False: 2.91k]
  ------------------
 2907|  3.98k|	ret++;
 2908|  3.98k|	attr = attr->next;
 2909|  3.98k|    }
 2910|  2.91k|    ns = node->nsDef;
 2911|  4.72k|    while (ns != NULL) {
  ------------------
  |  Branch (2911:12): [True: 1.80k, False: 2.91k]
  ------------------
 2912|  1.80k|	ret++;
 2913|  1.80k|	ns = ns->next;
 2914|  1.80k|    }
 2915|  2.91k|    return(ret);
 2916|  3.34k|}
xmlTextReaderNodeType:
 2927|  11.0k|xmlTextReaderNodeType(xmlTextReader *reader) {
 2928|  11.0k|    xmlNodePtr node;
 2929|       |
 2930|  11.0k|    if (reader == NULL)
  ------------------
  |  Branch (2930:9): [True: 0, False: 11.0k]
  ------------------
 2931|      0|	return(-1);
 2932|  11.0k|    if (reader->node == NULL)
  ------------------
  |  Branch (2932:9): [True: 3.05k, False: 7.98k]
  ------------------
 2933|  3.05k|	return(XML_READER_TYPE_NONE);
 2934|  7.98k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2934:9): [True: 1.05k, False: 6.92k]
  ------------------
 2935|  1.05k|	node = reader->curnode;
 2936|  6.92k|    else
 2937|  6.92k|	node = reader->node;
 2938|  7.98k|    switch (node->type) {
  ------------------
  |  Branch (2938:13): [True: 7.98k, False: 0]
  ------------------
 2939|  2.32k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (2939:9): [True: 2.32k, False: 5.65k]
  ------------------
 2940|  2.32k|	    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2940:10): [True: 205, False: 2.11k]
  ------------------
 2941|  2.11k|		(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2941:3): [True: 335, False: 1.78k]
  ------------------
 2942|    540|		return(XML_READER_TYPE_END_ELEMENT);
 2943|  1.78k|	    return(XML_READER_TYPE_ELEMENT);
 2944|    386|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (2944:9): [True: 386, False: 7.59k]
  ------------------
 2945|    650|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (2945:9): [True: 264, False: 7.71k]
  ------------------
 2946|    650|	    return(XML_READER_TYPE_ATTRIBUTE);
 2947|  2.29k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (2947:9): [True: 2.29k, False: 5.69k]
  ------------------
 2948|  2.29k|	    if (xmlIsBlankNode(reader->node)) {
  ------------------
  |  Branch (2948:10): [True: 880, False: 1.41k]
  ------------------
 2949|    880|		if (xmlNodeGetSpacePreserve(reader->node))
  ------------------
  |  Branch (2949:7): [True: 880, False: 0]
  ------------------
 2950|    880|		    return(XML_READER_TYPE_SIGNIFICANT_WHITESPACE);
 2951|      0|		else
 2952|      0|		    return(XML_READER_TYPE_WHITESPACE);
 2953|  1.41k|	    } else {
 2954|  1.41k|		return(XML_READER_TYPE_TEXT);
 2955|  1.41k|	    }
 2956|    228|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (2956:9): [True: 228, False: 7.75k]
  ------------------
 2957|    228|	    return(XML_READER_TYPE_CDATA);
 2958|    215|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (2958:9): [True: 215, False: 7.76k]
  ------------------
 2959|    215|	    return(XML_READER_TYPE_ENTITY_REFERENCE);
 2960|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (2960:9): [True: 0, False: 7.98k]
  ------------------
 2961|      0|	    return(XML_READER_TYPE_ENTITY);
 2962|    359|        case XML_PI_NODE:
  ------------------
  |  Branch (2962:9): [True: 359, False: 7.62k]
  ------------------
 2963|    359|	    return(XML_READER_TYPE_PROCESSING_INSTRUCTION);
 2964|    254|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (2964:9): [True: 254, False: 7.72k]
  ------------------
 2965|    254|	    return(XML_READER_TYPE_COMMENT);
 2966|    298|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (2966:9): [True: 298, False: 7.68k]
  ------------------
 2967|    298|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (2967:9): [True: 0, False: 7.98k]
  ------------------
 2968|    298|	    return(XML_READER_TYPE_DOCUMENT);
 2969|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (2969:9): [True: 0, False: 7.98k]
  ------------------
 2970|      0|	    return(XML_READER_TYPE_DOCUMENT_FRAGMENT);
 2971|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (2971:9): [True: 0, False: 7.98k]
  ------------------
 2972|      0|	    return(XML_READER_TYPE_NOTATION);
 2973|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (2973:9): [True: 0, False: 7.98k]
  ------------------
 2974|    631|        case XML_DTD_NODE:
  ------------------
  |  Branch (2974:9): [True: 631, False: 7.35k]
  ------------------
 2975|    631|	    return(XML_READER_TYPE_DOCUMENT_TYPE);
 2976|       |
 2977|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (2977:9): [True: 0, False: 7.98k]
  ------------------
 2978|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (2978:9): [True: 0, False: 7.98k]
  ------------------
 2979|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (2979:9): [True: 0, False: 7.98k]
  ------------------
 2980|    731|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (2980:9): [True: 731, False: 7.25k]
  ------------------
 2981|    731|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (2981:9): [True: 0, False: 7.98k]
  ------------------
 2982|    731|	    return(XML_READER_TYPE_NONE);
 2983|  7.98k|    }
 2984|      0|    return(-1);
 2985|  7.98k|}
xmlTextReaderIsEmptyElement:
 2994|  9.20k|xmlTextReaderIsEmptyElement(xmlTextReader *reader) {
 2995|  9.20k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (2995:9): [True: 0, False: 9.20k]
  |  Branch (2995:29): [True: 2.62k, False: 6.57k]
  ------------------
 2996|  2.62k|	return(-1);
 2997|  6.57k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2997:9): [True: 3.45k, False: 3.12k]
  ------------------
 2998|  3.45k|	return(0);
 2999|  3.12k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2999:9): [True: 358, False: 2.76k]
  ------------------
 3000|    358|	return(0);
 3001|  2.76k|    if (reader->node->children != NULL)
  ------------------
  |  Branch (3001:9): [True: 1.74k, False: 1.01k]
  ------------------
 3002|  1.74k|	return(0);
 3003|  1.01k|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (3003:9): [True: 207, False: 810]
  ------------------
 3004|    207|	return(0);
 3005|    810|    if (reader->doc != NULL)
  ------------------
  |  Branch (3005:9): [True: 0, False: 810]
  ------------------
 3006|      0|        return(1);
 3007|    810|#ifdef LIBXML_XINCLUDE_ENABLED
 3008|    810|    if (reader->in_xinclude > 0)
  ------------------
  |  Branch (3008:9): [True: 344, False: 466]
  ------------------
 3009|    344|        return(1);
 3010|    466|#endif
 3011|    466|    return((reader->node->extra & NODE_IS_EMPTY) != 0);
  ------------------
  |  |  169|    466|#define NODE_IS_EMPTY		0x1
  ------------------
 3012|    810|}
xmlTextReaderLocalName:
 3022|  5.41k|xmlTextReaderLocalName(xmlTextReader *reader) {
 3023|  5.41k|    xmlNodePtr node;
 3024|  5.41k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3024:9): [True: 0, False: 5.41k]
  |  Branch (3024:29): [True: 1.74k, False: 3.67k]
  ------------------
 3025|  1.74k|	return(NULL);
 3026|  3.67k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3026:9): [True: 736, False: 2.93k]
  ------------------
 3027|    736|	node = reader->curnode;
 3028|  2.93k|    else
 3029|  2.93k|	node = reader->node;
 3030|  3.67k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3030:9): [True: 473, False: 3.19k]
  ------------------
 3031|    473|	xmlNsPtr ns = (xmlNsPtr) node;
 3032|    473|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3032:6): [True: 218, False: 255]
  ------------------
 3033|    218|	    return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    218|#define BAD_CAST (xmlChar *)
  ------------------
 3034|    255|	else
 3035|    255|	    return(readerStrdup(reader, ns->prefix));
 3036|    473|    }
 3037|  3.19k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3037:9): [True: 1.96k, False: 1.23k]
  ------------------
 3038|  1.96k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3038:2): [True: 1.73k, False: 229]
  ------------------
 3039|  1.73k|	return(xmlTextReaderName(reader));
 3040|  1.46k|    return(readerStrdup(reader, node->name));
 3041|  3.19k|}
xmlTextReaderConstLocalName:
 3051|  34.6k|xmlTextReaderConstLocalName(xmlTextReader *reader) {
 3052|  34.6k|    xmlNodePtr node;
 3053|  34.6k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3053:9): [True: 0, False: 34.6k]
  |  Branch (3053:29): [True: 10.1k, False: 24.5k]
  ------------------
 3054|  10.1k|	return(NULL);
 3055|  24.5k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3055:9): [True: 3.84k, False: 20.6k]
  ------------------
 3056|  3.84k|	node = reader->curnode;
 3057|  20.6k|    else
 3058|  20.6k|	node = reader->node;
 3059|  24.5k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3059:9): [True: 2.60k, False: 21.9k]
  ------------------
 3060|  2.60k|	xmlNsPtr ns = (xmlNsPtr) node;
 3061|  2.60k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3061:6): [True: 894, False: 1.71k]
  ------------------
 3062|    894|	    return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    894|#define BAD_CAST (xmlChar *)
  ------------------
 3063|  1.71k|	else
 3064|  1.71k|	    return(ns->prefix);
 3065|  2.60k|    }
 3066|  21.9k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3066:9): [True: 10.3k, False: 11.5k]
  ------------------
 3067|  10.3k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3067:2): [True: 9.31k, False: 1.06k]
  ------------------
 3068|  9.31k|	return(xmlTextReaderConstName(reader));
 3069|  12.6k|    return(node->name);
 3070|  21.9k|}
xmlTextReaderName:
 3080|  7.71k|xmlTextReaderName(xmlTextReader *reader) {
 3081|  7.71k|    xmlNodePtr node;
 3082|  7.71k|    xmlChar *ret;
 3083|       |
 3084|  7.71k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3084:9): [True: 0, False: 7.71k]
  |  Branch (3084:29): [True: 1.45k, False: 6.26k]
  ------------------
 3085|  1.45k|	return(NULL);
 3086|  6.26k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3086:9): [True: 799, False: 5.46k]
  ------------------
 3087|    799|	node = reader->curnode;
 3088|  5.46k|    else
 3089|  5.46k|	node = reader->node;
 3090|  6.26k|    switch (node->type) {
  ------------------
  |  Branch (3090:13): [True: 6.26k, False: 0]
  ------------------
 3091|  1.54k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3091:9): [True: 1.54k, False: 4.71k]
  ------------------
 3092|  1.81k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3092:9): [True: 265, False: 5.99k]
  ------------------
 3093|  1.81k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3093:10): [True: 1.21k, False: 593]
  ------------------
 3094|    593|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3094:3): [True: 316, False: 277]
  ------------------
 3095|  1.53k|		return(readerStrdup(reader, node->name));
 3096|       |
 3097|    277|            ret = xmlBuildQName(node->name, node->ns->prefix, NULL, 0);
 3098|    277|            if (ret == NULL)
  ------------------
  |  Branch (3098:17): [True: 1, False: 276]
  ------------------
 3099|      1|                xmlTextReaderErrMemory(reader);
 3100|    277|	    return(ret);
 3101|  1.05k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3101:9): [True: 1.05k, False: 5.20k]
  ------------------
 3102|  1.05k|	    return(readerStrdup(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
 3103|    210|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3103:9): [True: 210, False: 6.05k]
  ------------------
 3104|    210|	    return(readerStrdup(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    210|#define BAD_CAST (xmlChar *)
  ------------------
 3105|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3105:9): [True: 0, False: 6.26k]
  ------------------
 3106|    240|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3106:9): [True: 240, False: 6.02k]
  ------------------
 3107|    240|	    return(readerStrdup(reader, node->name));
 3108|    502|        case XML_PI_NODE:
  ------------------
  |  Branch (3108:9): [True: 502, False: 5.76k]
  ------------------
 3109|    502|	    return(readerStrdup(reader, node->name));
 3110|    262|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3110:9): [True: 262, False: 6.00k]
  ------------------
 3111|    262|	    return(readerStrdup(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    262|#define BAD_CAST (xmlChar *)
  ------------------
 3112|    284|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3112:9): [True: 284, False: 5.98k]
  ------------------
 3113|    284|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3113:9): [True: 0, False: 6.26k]
  ------------------
 3114|    284|	    return(readerStrdup(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|    284|#define BAD_CAST (xmlChar *)
  ------------------
 3115|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3115:9): [True: 0, False: 6.26k]
  ------------------
 3116|      0|	    return(readerStrdup(reader, BAD_CAST "#document-fragment"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3117|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (3117:9): [True: 0, False: 6.26k]
  ------------------
 3118|      0|	    return(readerStrdup(reader, node->name));
 3119|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3119:9): [True: 0, False: 6.26k]
  ------------------
 3120|    625|        case XML_DTD_NODE:
  ------------------
  |  Branch (3120:9): [True: 625, False: 5.63k]
  ------------------
 3121|    625|	    return(readerStrdup(reader, node->name));
 3122|    456|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3122:9): [True: 456, False: 5.80k]
  ------------------
 3123|    456|	    xmlNsPtr ns = (xmlNsPtr) node;
 3124|       |
 3125|    456|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3125:10): [True: 203, False: 253]
  ------------------
 3126|    203|		return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    203|#define BAD_CAST (xmlChar *)
  ------------------
 3127|    253|            ret = xmlBuildQName(ns->prefix, BAD_CAST "xmlns", NULL, 0);
  ------------------
  |  |   34|    253|#define BAD_CAST (xmlChar *)
  ------------------
 3128|    253|            if (ret == NULL)
  ------------------
  |  Branch (3128:17): [True: 1, False: 252]
  ------------------
 3129|      1|                xmlTextReaderErrMemory(reader);
 3130|    253|	    return(ret);
 3131|    456|	}
 3132|       |
 3133|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3133:9): [True: 0, False: 6.26k]
  ------------------
 3134|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3134:9): [True: 0, False: 6.26k]
  ------------------
 3135|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3135:9): [True: 0, False: 6.26k]
  ------------------
 3136|    818|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3136:9): [True: 818, False: 5.44k]
  ------------------
 3137|    818|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3137:9): [True: 0, False: 6.26k]
  ------------------
 3138|    818|	    return(NULL);
 3139|  6.26k|    }
 3140|      0|    return(NULL);
 3141|  6.26k|}
xmlTextReaderConstName:
 3151|  53.0k|xmlTextReaderConstName(xmlTextReader *reader) {
 3152|  53.0k|    xmlNodePtr node;
 3153|       |
 3154|  53.0k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3154:9): [True: 0, False: 53.0k]
  |  Branch (3154:29): [True: 14.4k, False: 38.5k]
  ------------------
 3155|  14.4k|	return(NULL);
 3156|  38.5k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3156:9): [True: 2.94k, False: 35.5k]
  ------------------
 3157|  2.94k|	node = reader->curnode;
 3158|  35.5k|    else
 3159|  35.5k|	node = reader->node;
 3160|  38.5k|    switch (node->type) {
  ------------------
  |  Branch (3160:13): [True: 38.5k, False: 0]
  ------------------
 3161|  14.6k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3161:9): [True: 14.6k, False: 23.8k]
  ------------------
 3162|  15.6k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3162:9): [True: 963, False: 37.5k]
  ------------------
 3163|  15.6k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3163:10): [True: 13.1k, False: 2.49k]
  ------------------
 3164|  2.49k|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3164:3): [True: 509, False: 1.98k]
  ------------------
 3165|  13.6k|		return(node->name);
 3166|  1.98k|	    return(constQString(reader, node->ns->prefix, node->name));
 3167|  7.44k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3167:9): [True: 7.44k, False: 31.0k]
  ------------------
 3168|  7.44k|	    return(constString(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|  7.44k|#define BAD_CAST (xmlChar *)
  ------------------
 3169|    443|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3169:9): [True: 443, False: 38.0k]
  ------------------
 3170|    443|	    return(constString(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    443|#define BAD_CAST (xmlChar *)
  ------------------
 3171|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3171:9): [True: 0, False: 38.5k]
  ------------------
 3172|    401|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3172:9): [True: 401, False: 38.1k]
  ------------------
 3173|    401|	    return(constString(reader, node->name));
 3174|  1.91k|        case XML_PI_NODE:
  ------------------
  |  Branch (3174:9): [True: 1.91k, False: 36.5k]
  ------------------
 3175|  1.91k|	    return(constString(reader, node->name));
 3176|    891|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3176:9): [True: 891, False: 37.6k]
  ------------------
 3177|    891|	    return(constString(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    891|#define BAD_CAST (xmlChar *)
  ------------------
 3178|  1.98k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3178:9): [True: 1.98k, False: 36.5k]
  ------------------
 3179|  1.98k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3179:9): [True: 0, False: 38.5k]
  ------------------
 3180|  1.98k|	    return(constString(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|  1.98k|#define BAD_CAST (xmlChar *)
  ------------------
 3181|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3181:9): [True: 0, False: 38.5k]
  ------------------
 3182|      0|	    return(constString(reader, BAD_CAST "#document-fragment"));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 3183|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (3183:9): [True: 0, False: 38.5k]
  ------------------
 3184|      0|	    return(constString(reader, node->name));
 3185|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3185:9): [True: 0, False: 38.5k]
  ------------------
 3186|  3.23k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3186:9): [True: 3.23k, False: 35.2k]
  ------------------
 3187|  3.23k|	    return(constString(reader, node->name));
 3188|  1.33k|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3188:9): [True: 1.33k, False: 37.1k]
  ------------------
 3189|  1.33k|	    xmlNsPtr ns = (xmlNsPtr) node;
 3190|       |
 3191|  1.33k|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3191:10): [True: 340, False: 998]
  ------------------
 3192|    340|		return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    340|#define BAD_CAST (xmlChar *)
  ------------------
 3193|    998|	    return(constQString(reader, BAD_CAST "xmlns", ns->prefix));
  ------------------
  |  |   34|    998|#define BAD_CAST (xmlChar *)
  ------------------
 3194|  1.33k|	}
 3195|       |
 3196|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3196:9): [True: 0, False: 38.5k]
  ------------------
 3197|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3197:9): [True: 0, False: 38.5k]
  ------------------
 3198|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3198:9): [True: 0, False: 38.5k]
  ------------------
 3199|  5.22k|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3199:9): [True: 5.22k, False: 33.2k]
  ------------------
 3200|  5.22k|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3200:9): [True: 0, False: 38.5k]
  ------------------
 3201|  5.22k|	    return(NULL);
 3202|  38.5k|    }
 3203|      0|    return(NULL);
 3204|  38.5k|}
xmlTextReaderPrefix:
 3214|  4.59k|xmlTextReaderPrefix(xmlTextReader *reader) {
 3215|  4.59k|    xmlNodePtr node;
 3216|  4.59k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3216:9): [True: 0, False: 4.59k]
  |  Branch (3216:29): [True: 1.27k, False: 3.32k]
  ------------------
 3217|  1.27k|	return(NULL);
 3218|  3.32k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3218:9): [True: 1.13k, False: 2.18k]
  ------------------
 3219|  1.13k|	node = reader->curnode;
 3220|  2.18k|    else
 3221|  2.18k|	node = reader->node;
 3222|  3.32k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3222:9): [True: 629, False: 2.69k]
  ------------------
 3223|    629|	xmlNsPtr ns = (xmlNsPtr) node;
 3224|    629|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3224:6): [True: 219, False: 410]
  ------------------
 3225|    219|	    return(NULL);
 3226|    410|	return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    410|#define BAD_CAST (xmlChar *)
  ------------------
 3227|    629|    }
 3228|  2.69k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3228:9): [True: 1.63k, False: 1.05k]
  ------------------
 3229|  1.63k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3229:2): [True: 1.32k, False: 316]
  ------------------
 3230|  1.32k|	return(NULL);
 3231|  1.37k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3231:9): [True: 599, False: 773]
  |  Branch (3231:31): [True: 363, False: 236]
  ------------------
 3232|    363|	return(readerStrdup(reader, node->ns->prefix));
 3233|  1.00k|    return(NULL);
 3234|  1.37k|}
xmlTextReaderConstPrefix:
 3244|  19.9k|xmlTextReaderConstPrefix(xmlTextReader *reader) {
 3245|  19.9k|    xmlNodePtr node;
 3246|  19.9k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3246:9): [True: 0, False: 19.9k]
  |  Branch (3246:29): [True: 6.64k, False: 13.3k]
  ------------------
 3247|  6.64k|	return(NULL);
 3248|  13.3k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3248:9): [True: 1.65k, False: 11.6k]
  ------------------
 3249|  1.65k|	node = reader->curnode;
 3250|  11.6k|    else
 3251|  11.6k|	node = reader->node;
 3252|  13.3k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3252:9): [True: 973, False: 12.3k]
  ------------------
 3253|    973|	xmlNsPtr ns = (xmlNsPtr) node;
 3254|    973|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3254:6): [True: 359, False: 614]
  ------------------
 3255|    359|	    return(NULL);
 3256|    614|	return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    614|#define BAD_CAST (xmlChar *)
  ------------------
 3257|    973|    }
 3258|  12.3k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3258:9): [True: 6.59k, False: 5.74k]
  ------------------
 3259|  6.59k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3259:2): [True: 6.08k, False: 507]
  ------------------
 3260|  6.08k|	return(NULL);
 3261|  6.25k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3261:9): [True: 1.30k, False: 4.95k]
  |  Branch (3261:31): [True: 961, False: 342]
  ------------------
 3262|    961|	return(constString(reader, node->ns->prefix));
 3263|  5.29k|    return(NULL);
 3264|  6.25k|}
xmlTextReaderNamespaceUri:
 3274|  3.89k|xmlTextReaderNamespaceUri(xmlTextReader *reader) {
 3275|  3.89k|    xmlNodePtr node;
 3276|  3.89k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3276:9): [True: 0, False: 3.89k]
  |  Branch (3276:29): [True: 1.96k, False: 1.92k]
  ------------------
 3277|  1.96k|	return(NULL);
 3278|  1.92k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3278:9): [True: 761, False: 1.16k]
  ------------------
 3279|    761|	node = reader->curnode;
 3280|  1.16k|    else
 3281|  1.16k|	node = reader->node;
 3282|  1.92k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3282:9): [True: 327, False: 1.59k]
  ------------------
 3283|    327|	return(readerStrdup(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|    327|#define BAD_CAST (xmlChar *)
  ------------------
 3284|  1.59k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3284:9): [True: 742, False: 853]
  ------------------
 3285|    742|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3285:2): [True: 502, False: 240]
  ------------------
 3286|    502|	return(NULL);
 3287|  1.09k|    if (node->ns != NULL)
  ------------------
  |  Branch (3287:9): [True: 253, False: 840]
  ------------------
 3288|    253|	return(readerStrdup(reader, node->ns->href));
 3289|    840|    return(NULL);
 3290|  1.09k|}
xmlTextReaderConstNamespaceUri:
 3300|  38.1k|xmlTextReaderConstNamespaceUri(xmlTextReader *reader) {
 3301|  38.1k|    xmlNodePtr node;
 3302|  38.1k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3302:9): [True: 0, False: 38.1k]
  |  Branch (3302:29): [True: 12.0k, False: 26.1k]
  ------------------
 3303|  12.0k|	return(NULL);
 3304|  26.1k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3304:9): [True: 3.96k, False: 22.1k]
  ------------------
 3305|  3.96k|	node = reader->curnode;
 3306|  22.1k|    else
 3307|  22.1k|	node = reader->node;
 3308|  26.1k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3308:9): [True: 2.61k, False: 23.5k]
  ------------------
 3309|  2.61k|	return(constString(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|  2.61k|#define BAD_CAST (xmlChar *)
  ------------------
 3310|  23.5k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3310:9): [True: 11.4k, False: 12.1k]
  ------------------
 3311|  11.4k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3311:2): [True: 10.3k, False: 1.12k]
  ------------------
 3312|  10.3k|	return(NULL);
 3313|  13.2k|    if (node->ns != NULL)
  ------------------
  |  Branch (3313:9): [True: 4.49k, False: 8.72k]
  ------------------
 3314|  4.49k|	return(constString(reader, node->ns->href));
 3315|  8.72k|    return(NULL);
 3316|  13.2k|}
xmlTextReaderBaseUri:
 3326|  7.22k|xmlTextReaderBaseUri(xmlTextReader *reader) {
 3327|  7.22k|    xmlChar *ret = NULL;
 3328|  7.22k|    int result;
 3329|       |
 3330|  7.22k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3330:9): [True: 0, False: 7.22k]
  |  Branch (3330:29): [True: 1.19k, False: 6.03k]
  ------------------
 3331|  1.19k|	return(NULL);
 3332|  6.03k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &ret);
 3333|  6.03k|    if (result < 0)
  ------------------
  |  Branch (3333:9): [True: 128, False: 5.90k]
  ------------------
 3334|    128|        xmlTextReaderErrMemory(reader);
 3335|       |
 3336|  6.03k|    return(ret);
 3337|  7.22k|}
xmlTextReaderConstBaseUri:
 3347|  42.6k|xmlTextReaderConstBaseUri(xmlTextReader *reader) {
 3348|  42.6k|    xmlChar *tmp;
 3349|  42.6k|    const xmlChar *ret;
 3350|  42.6k|    int result;
 3351|       |
 3352|  42.6k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3352:9): [True: 0, False: 42.6k]
  |  Branch (3352:29): [True: 3.26k, False: 39.4k]
  ------------------
 3353|  3.26k|	return(NULL);
 3354|  39.4k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &tmp);
 3355|  39.4k|    if (result < 0)
  ------------------
  |  Branch (3355:9): [True: 760, False: 38.6k]
  ------------------
 3356|    760|        xmlTextReaderErrMemory(reader);
 3357|  39.4k|    if (tmp == NULL)
  ------------------
  |  Branch (3357:9): [True: 11.3k, False: 28.0k]
  ------------------
 3358|  11.3k|        return(NULL);
 3359|  28.0k|    ret = constString(reader, tmp);
 3360|  28.0k|    xmlFree(tmp);
 3361|  28.0k|    return(ret);
 3362|  39.4k|}
xmlTextReaderDepth:
 3371|  3.30k|xmlTextReaderDepth(xmlTextReader *reader) {
 3372|  3.30k|    if (reader == NULL)
  ------------------
  |  Branch (3372:9): [True: 0, False: 3.30k]
  ------------------
 3373|      0|	return(-1);
 3374|  3.30k|    if (reader->node == NULL)
  ------------------
  |  Branch (3374:9): [True: 1.18k, False: 2.11k]
  ------------------
 3375|  1.18k|	return(0);
 3376|       |
 3377|  2.11k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (3377:9): [True: 714, False: 1.40k]
  ------------------
 3378|    714|	if ((reader->curnode->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (3378:6): [True: 218, False: 496]
  ------------------
 3379|    496|	    (reader->curnode->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3379:6): [True: 274, False: 222]
  ------------------
 3380|    492|	    return(reader->depth + 1);
 3381|    222|	return(reader->depth + 2);
 3382|    714|    }
 3383|  1.40k|    return(reader->depth);
 3384|  2.11k|}
xmlTextReaderHasAttributes:
 3393|  2.93k|xmlTextReaderHasAttributes(xmlTextReader *reader) {
 3394|  2.93k|    xmlNodePtr node;
 3395|  2.93k|    if (reader == NULL)
  ------------------
  |  Branch (3395:9): [True: 0, False: 2.93k]
  ------------------
 3396|      0|	return(-1);
 3397|  2.93k|    if (reader->node == NULL)
  ------------------
  |  Branch (3397:9): [True: 905, False: 2.02k]
  ------------------
 3398|    905|	return(0);
 3399|  2.02k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3399:9): [True: 259, False: 1.77k]
  ------------------
 3400|    259|	node = reader->curnode;
 3401|  1.77k|    else
 3402|  1.77k|	node = reader->node;
 3403|       |
 3404|  2.02k|    if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3404:9): [True: 1.17k, False: 857]
  ------------------
 3405|  1.17k|	((node->properties != NULL) || (node->nsDef != NULL)))
  ------------------
  |  Branch (3405:3): [True: 354, False: 818]
  |  Branch (3405:33): [True: 248, False: 570]
  ------------------
 3406|    602|	return(1);
 3407|       |    /* TODO: handle the xmlDecl */
 3408|  1.42k|    return(0);
 3409|  2.02k|}
xmlTextReaderHasValue:
 3418|  10.9k|xmlTextReaderHasValue(xmlTextReader *reader) {
 3419|  10.9k|    xmlNodePtr node;
 3420|  10.9k|    if (reader == NULL)
  ------------------
  |  Branch (3420:9): [True: 0, False: 10.9k]
  ------------------
 3421|      0|	return(-1);
 3422|  10.9k|    if (reader->node == NULL)
  ------------------
  |  Branch (3422:9): [True: 4.05k, False: 6.90k]
  ------------------
 3423|  4.05k|	return(0);
 3424|  6.90k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3424:9): [True: 799, False: 6.10k]
  ------------------
 3425|    799|	node = reader->curnode;
 3426|  6.10k|    else
 3427|  6.10k|	node = reader->node;
 3428|       |
 3429|  6.90k|    switch (node->type) {
 3430|    294|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3430:9): [True: 294, False: 6.61k]
  ------------------
 3431|  1.41k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3431:9): [True: 1.12k, False: 5.77k]
  ------------------
 3432|  1.65k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3432:9): [True: 239, False: 6.66k]
  ------------------
 3433|  1.96k|        case XML_PI_NODE:
  ------------------
  |  Branch (3433:9): [True: 310, False: 6.59k]
  ------------------
 3434|  2.27k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3434:9): [True: 303, False: 6.60k]
  ------------------
 3435|  2.60k|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3435:9): [True: 334, False: 6.57k]
  ------------------
 3436|  2.60k|	    return(1);
 3437|  4.29k|	default:
  ------------------
  |  Branch (3437:2): [True: 4.29k, False: 2.60k]
  ------------------
 3438|  4.29k|	    break;
 3439|  6.90k|    }
 3440|  4.29k|    return(0);
 3441|  6.90k|}
xmlTextReaderValue:
 3451|  9.26k|xmlTextReaderValue(xmlTextReader *reader) {
 3452|  9.26k|    xmlNodePtr node;
 3453|  9.26k|    if (reader == NULL)
  ------------------
  |  Branch (3453:9): [True: 0, False: 9.26k]
  ------------------
 3454|      0|	return(NULL);
 3455|  9.26k|    if (reader->node == NULL)
  ------------------
  |  Branch (3455:9): [True: 2.02k, False: 7.24k]
  ------------------
 3456|  2.02k|	return(NULL);
 3457|  7.24k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3457:9): [True: 1.75k, False: 5.48k]
  ------------------
 3458|  1.75k|	node = reader->curnode;
 3459|  5.48k|    else
 3460|  5.48k|	node = reader->node;
 3461|       |
 3462|  7.24k|    switch (node->type) {
 3463|    462|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3463:9): [True: 462, False: 6.77k]
  ------------------
 3464|    462|	    return(readerStrdup(reader, ((xmlNsPtr) node)->href));
 3465|  1.08k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3465:9): [True: 1.08k, False: 6.15k]
  ------------------
 3466|  1.08k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3467|  1.08k|            xmlDocPtr doc = NULL;
 3468|  1.08k|            xmlChar *ret;
 3469|       |
 3470|  1.08k|            if (attr->children == NULL)
  ------------------
  |  Branch (3470:17): [True: 211, False: 873]
  ------------------
 3471|    211|                return(NULL);
 3472|    873|	    if (attr->parent != NULL)
  ------------------
  |  Branch (3472:10): [True: 873, False: 0]
  ------------------
 3473|    873|                doc = attr->parent->doc;
 3474|    873|	    ret = xmlNodeListGetString(doc, attr->children, 1);
 3475|    873|            if (ret == NULL)
  ------------------
  |  Branch (3475:17): [True: 14, False: 859]
  ------------------
 3476|     14|                xmlTextReaderErrMemory(reader);
 3477|    873|	    return(ret);
 3478|  1.08k|	}
 3479|  1.10k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3479:9): [True: 1.10k, False: 6.13k]
  ------------------
 3480|  1.34k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3480:9): [True: 247, False: 6.99k]
  ------------------
 3481|  1.74k|        case XML_PI_NODE:
  ------------------
  |  Branch (3481:9): [True: 400, False: 6.84k]
  ------------------
 3482|  2.03k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3482:9): [True: 283, False: 6.95k]
  ------------------
 3483|  2.03k|            return(readerStrdup(reader, node->content));
 3484|  3.66k|	default:
  ------------------
  |  Branch (3484:2): [True: 3.66k, False: 3.57k]
  ------------------
 3485|  3.66k|	    break;
 3486|  7.24k|    }
 3487|  3.66k|    return(NULL);
 3488|  7.24k|}
xmlTextReaderConstValue:
 3498|  6.33k|xmlTextReaderConstValue(xmlTextReader *reader) {
 3499|  6.33k|    xmlNodePtr node;
 3500|  6.33k|    if (reader == NULL)
  ------------------
  |  Branch (3500:9): [True: 0, False: 6.33k]
  ------------------
 3501|      0|	return(NULL);
 3502|  6.33k|    if (reader->node == NULL)
  ------------------
  |  Branch (3502:9): [True: 1.84k, False: 4.49k]
  ------------------
 3503|  1.84k|	return(NULL);
 3504|  4.49k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3504:9): [True: 1.75k, False: 2.74k]
  ------------------
 3505|  1.75k|	node = reader->curnode;
 3506|  2.74k|    else
 3507|  2.74k|	node = reader->node;
 3508|       |
 3509|  4.49k|    switch (node->type) {
 3510|    307|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3510:9): [True: 307, False: 4.18k]
  ------------------
 3511|    307|	    return(((xmlNsPtr) node)->href);
 3512|  1.16k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3512:9): [True: 1.16k, False: 3.32k]
  ------------------
 3513|  1.16k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3514|  1.16k|	    const xmlChar *ret;
 3515|       |
 3516|  1.16k|	    if ((attr->children != NULL) &&
  ------------------
  |  Branch (3516:10): [True: 968, False: 201]
  ------------------
 3517|    968|	        (attr->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (3517:10): [True: 660, False: 308]
  ------------------
 3518|    660|		(attr->children->next == NULL))
  ------------------
  |  Branch (3518:3): [True: 279, False: 381]
  ------------------
 3519|    279|		return(attr->children->content);
 3520|    890|	    else {
 3521|    890|		if (reader->buffer == NULL) {
  ------------------
  |  Branch (3521:7): [True: 0, False: 890]
  ------------------
 3522|      0|		    reader->buffer = xmlBufCreate(50);
 3523|      0|                    if (reader->buffer == NULL)
  ------------------
  |  Branch (3523:25): [True: 0, False: 0]
  ------------------
 3524|      0|                        return (NULL);
 3525|      0|                } else
 3526|    890|                    xmlBufEmpty(reader->buffer);
 3527|    890|	        xmlBufGetNodeContent(reader->buffer, node);
 3528|    890|		ret = xmlBufContent(reader->buffer);
 3529|    890|		if (ret == NULL) {
  ------------------
  |  Branch (3529:7): [True: 1, False: 889]
  ------------------
 3530|      1|                    xmlTextReaderErrMemory(reader);
 3531|       |		    /* error on the buffer best to reallocate */
 3532|      1|		    xmlBufFree(reader->buffer);
 3533|      1|		    reader->buffer = xmlBufCreate(50);
 3534|      1|		}
 3535|    890|		return(ret);
 3536|    890|	    }
 3537|      0|	    break;
 3538|  1.16k|	}
 3539|    649|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3539:9): [True: 649, False: 3.84k]
  ------------------
 3540|    852|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3540:9): [True: 203, False: 4.29k]
  ------------------
 3541|  1.20k|        case XML_PI_NODE:
  ------------------
  |  Branch (3541:9): [True: 354, False: 4.14k]
  ------------------
 3542|  1.41k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3542:9): [True: 211, False: 4.28k]
  ------------------
 3543|  1.41k|	    return(node->content);
 3544|  1.60k|	default:
  ------------------
  |  Branch (3544:2): [True: 1.60k, False: 2.89k]
  ------------------
 3545|  1.60k|	    break;
 3546|  4.49k|    }
 3547|  1.60k|    return(NULL);
 3548|  4.49k|}
xmlTextReaderIsDefault:
 3558|  7.70k|xmlTextReaderIsDefault(xmlTextReader *reader) {
 3559|  7.70k|    if (reader == NULL)
  ------------------
  |  Branch (3559:9): [True: 0, False: 7.70k]
  ------------------
 3560|      0|	return(-1);
 3561|  7.70k|    return(0);
 3562|  7.70k|}
xmlTextReaderQuoteChar:
 3571|  3.12k|xmlTextReaderQuoteChar(xmlTextReader *reader) {
 3572|  3.12k|    if (reader == NULL)
  ------------------
  |  Branch (3572:9): [True: 0, False: 3.12k]
  ------------------
 3573|      0|	return(-1);
 3574|       |    /* TODO maybe lookup the attribute value for " first */
 3575|  3.12k|    return('"');
 3576|  3.12k|}
xmlTextReaderXmlLang:
 3586|  3.31k|xmlTextReaderXmlLang(xmlTextReader *reader) {
 3587|  3.31k|    if (reader == NULL)
  ------------------
  |  Branch (3587:9): [True: 0, False: 3.31k]
  ------------------
 3588|      0|	return(NULL);
 3589|  3.31k|    if (reader->node == NULL)
  ------------------
  |  Branch (3589:9): [True: 1.03k, False: 2.28k]
  ------------------
 3590|  1.03k|	return(NULL);
 3591|  2.28k|    return(xmlNodeGetLang(reader->node));
 3592|  3.31k|}
xmlTextReaderConstXmlLang:
 3601|  6.43k|xmlTextReaderConstXmlLang(xmlTextReader *reader) {
 3602|  6.43k|    xmlChar *tmp;
 3603|  6.43k|    const xmlChar *ret;
 3604|       |
 3605|  6.43k|    if (reader == NULL)
  ------------------
  |  Branch (3605:9): [True: 0, False: 6.43k]
  ------------------
 3606|      0|	return(NULL);
 3607|  6.43k|    if (reader->node == NULL)
  ------------------
  |  Branch (3607:9): [True: 1.92k, False: 4.50k]
  ------------------
 3608|  1.92k|	return(NULL);
 3609|  4.50k|    tmp = xmlNodeGetLang(reader->node);
 3610|  4.50k|    if (tmp == NULL)
  ------------------
  |  Branch (3610:9): [True: 4.25k, False: 253]
  ------------------
 3611|  4.25k|        return(NULL);
 3612|    253|    ret = constString(reader, tmp);
 3613|    253|    xmlFree(tmp);
 3614|    253|    return(ret);
 3615|  4.50k|}
xmlTextReaderNormalization:
 3644|  2.02k|xmlTextReaderNormalization(xmlTextReader *reader) {
 3645|  2.02k|    if (reader == NULL)
  ------------------
  |  Branch (3645:9): [True: 0, False: 2.02k]
  ------------------
 3646|      0|	return(-1);
 3647|  2.02k|    return(1);
 3648|  2.02k|}
xmlTextReaderGetParserProp:
 3729|  7.82k|xmlTextReaderGetParserProp(xmlTextReader *reader, int prop) {
 3730|  7.82k|    xmlParserProperties p = (xmlParserProperties) prop;
 3731|  7.82k|    xmlParserCtxtPtr ctxt;
 3732|       |
 3733|  7.82k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (3733:9): [True: 0, False: 7.82k]
  |  Branch (3733:29): [True: 0, False: 7.82k]
  ------------------
 3734|      0|	return(-1);
 3735|  7.82k|    ctxt = reader->ctxt;
 3736|       |
 3737|  7.82k|    switch (p) {
  ------------------
  |  Branch (3737:13): [True: 1.59k, False: 6.23k]
  ------------------
 3738|    750|        case XML_PARSER_LOADDTD:
  ------------------
  |  Branch (3738:9): [True: 750, False: 7.07k]
  ------------------
 3739|    750|	    if ((ctxt->loadsubset != 0) || (ctxt->validate != 0))
  ------------------
  |  Branch (3739:10): [True: 332, False: 418]
  |  Branch (3739:37): [True: 209, False: 209]
  ------------------
 3740|    541|		return(1);
 3741|    209|	    return(0);
 3742|    397|        case XML_PARSER_DEFAULTATTRS:
  ------------------
  |  Branch (3742:9): [True: 397, False: 7.43k]
  ------------------
 3743|    397|	    if (ctxt->loadsubset & XML_COMPLETE_ATTRS)
  ------------------
  |  |  209|    397|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (3743:10): [True: 195, False: 202]
  ------------------
 3744|    195|		return(1);
 3745|    202|	    return(0);
 3746|    224|        case XML_PARSER_VALIDATE:
  ------------------
  |  Branch (3746:9): [True: 224, False: 7.60k]
  ------------------
 3747|    224|	    return(reader->validate);
 3748|    225|	case XML_PARSER_SUBST_ENTITIES:
  ------------------
  |  Branch (3748:2): [True: 225, False: 7.60k]
  ------------------
 3749|    225|	    return(ctxt->replaceEntities);
 3750|  7.82k|    }
 3751|  6.23k|    return(-1);
 3752|  7.82k|}
xmlTextReaderGetParserLineNumber:
 3763|  5.59k|{
 3764|  5.59k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.59k]
  |  Branch (3764:29): [True: 0, False: 5.59k]
  ------------------
 3765|  5.59k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3765:9): [True: 0, False: 5.59k]
  ------------------
 3766|      0|        return (0);
 3767|      0|    }
 3768|  5.59k|    return (reader->ctxt->input->line);
 3769|  5.59k|}
xmlTextReaderGetParserColumnNumber:
 3779|  9.05k|{
 3780|  9.05k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3780:9): [True: 0, False: 9.05k]
  |  Branch (3780:29): [True: 0, False: 9.05k]
  ------------------
 3781|  9.05k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3781:9): [True: 0, False: 9.05k]
  ------------------
 3782|      0|        return (0);
 3783|      0|    }
 3784|  9.05k|    return (reader->ctxt->input->col);
 3785|  9.05k|}
xmlTextReaderCurrentNode:
 3796|  13.3k|xmlTextReaderCurrentNode(xmlTextReader *reader) {
 3797|  13.3k|    if (reader == NULL)
  ------------------
  |  Branch (3797:9): [True: 0, False: 13.3k]
  ------------------
 3798|      0|	return(NULL);
 3799|       |
 3800|  13.3k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3800:9): [True: 818, False: 12.5k]
  ------------------
 3801|    818|	return(reader->curnode);
 3802|  12.5k|    return(reader->node);
 3803|  13.3k|}
xmlTextReaderPreserve:
 3814|  8.60k|xmlTextReaderPreserve(xmlTextReader *reader) {
 3815|  8.60k|    xmlNodePtr cur, parent;
 3816|       |
 3817|  8.60k|    if (reader == NULL)
  ------------------
  |  Branch (3817:9): [True: 0, False: 8.60k]
  ------------------
 3818|      0|	return(NULL);
 3819|       |
 3820|  8.60k|    cur = reader->node;
 3821|  8.60k|    if (cur == NULL)
  ------------------
  |  Branch (3821:9): [True: 2.80k, False: 5.80k]
  ------------------
 3822|  2.80k|        return(NULL);
 3823|       |
 3824|  5.80k|    if ((cur->type != XML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (3824:9): [True: 5.48k, False: 319]
  |  Branch (3824:45): [True: 4.61k, False: 873]
  ------------------
 3825|  4.61k|	cur->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|  4.61k|#define NODE_IS_PRESERVED	0x2
  ------------------
 3826|  4.61k|	cur->extra |= NODE_IS_SPRESERVED;
  ------------------
  |  |  171|  4.61k|#define NODE_IS_SPRESERVED	0x4
  ------------------
 3827|  4.61k|    }
 3828|  5.80k|    reader->preserves++;
 3829|       |
 3830|  5.80k|    parent = cur->parent;;
 3831|   868k|    while (parent != NULL) {
  ------------------
  |  Branch (3831:12): [True: 863k, False: 5.80k]
  ------------------
 3832|   863k|        if (parent->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3832:13): [True: 857k, False: 5.50k]
  ------------------
 3833|   857k|	    parent->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|   857k|#define NODE_IS_PRESERVED	0x2
  ------------------
 3834|   863k|	parent = parent->parent;
 3835|   863k|    }
 3836|  5.80k|    return(cur);
 3837|  8.60k|}
xmlTextReaderCurrentDoc:
 3897|  9.37k|xmlTextReaderCurrentDoc(xmlTextReader *reader) {
 3898|  9.37k|    if (reader == NULL)
  ------------------
  |  Branch (3898:9): [True: 0, False: 9.37k]
  ------------------
 3899|      0|	return(NULL);
 3900|  9.37k|    if (reader->doc != NULL)
  ------------------
  |  Branch (3900:9): [True: 0, False: 9.37k]
  ------------------
 3901|      0|        return(reader->doc);
 3902|  9.37k|    if ((reader->ctxt == NULL) || (reader->ctxt->myDoc == NULL))
  ------------------
  |  Branch (3902:9): [True: 0, False: 9.37k]
  |  Branch (3902:35): [True: 2.05k, False: 7.32k]
  ------------------
 3903|  2.05k|	return(NULL);
 3904|       |
 3905|  7.32k|    reader->preserve = 1;
 3906|  7.32k|    return(reader->ctxt->myDoc);
 3907|  9.37k|}
xmlTextReaderIsNamespaceDecl:
 4380|  4.54k|xmlTextReaderIsNamespaceDecl(xmlTextReader *reader) {
 4381|  4.54k|    xmlNodePtr node;
 4382|  4.54k|    if (reader == NULL)
  ------------------
  |  Branch (4382:9): [True: 0, False: 4.54k]
  ------------------
 4383|      0|	return(-1);
 4384|  4.54k|    if (reader->node == NULL)
  ------------------
  |  Branch (4384:9): [True: 1.60k, False: 2.94k]
  ------------------
 4385|  1.60k|	return(-1);
 4386|  2.94k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (4386:9): [True: 322, False: 2.62k]
  ------------------
 4387|    322|	node = reader->curnode;
 4388|  2.62k|    else
 4389|  2.62k|	node = reader->node;
 4390|       |
 4391|  2.94k|    if (XML_NAMESPACE_DECL == node->type)
  ------------------
  |  Branch (4391:9): [True: 251, False: 2.69k]
  ------------------
 4392|    251|	return(1);
 4393|  2.69k|    else
 4394|  2.69k|	return(0);
 4395|  2.94k|}
xmlTextReaderConstXmlVersion:
 4405|  3.96k|xmlTextReaderConstXmlVersion(xmlTextReader *reader) {
 4406|  3.96k|    xmlDocPtr doc = NULL;
 4407|  3.96k|    if (reader == NULL)
  ------------------
  |  Branch (4407:9): [True: 0, False: 3.96k]
  ------------------
 4408|      0|	return(NULL);
 4409|  3.96k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4409:9): [True: 0, False: 3.96k]
  ------------------
 4410|      0|        doc = reader->doc;
 4411|  3.96k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4411:14): [True: 3.96k, False: 0]
  ------------------
 4412|  3.96k|	doc = reader->ctxt->myDoc;
 4413|  3.96k|    if (doc == NULL)
  ------------------
  |  Branch (4413:9): [True: 643, False: 3.32k]
  ------------------
 4414|    643|	return(NULL);
 4415|       |
 4416|  3.32k|    if (doc->version == NULL)
  ------------------
  |  Branch (4416:9): [True: 0, False: 3.32k]
  ------------------
 4417|      0|	return(NULL);
 4418|  3.32k|    else
 4419|  3.32k|      return(constString(reader, doc->version));
 4420|  3.32k|}
xmlTextReaderStandalone:
 4431|  3.98k|xmlTextReaderStandalone(xmlTextReader *reader) {
 4432|  3.98k|    xmlDocPtr doc = NULL;
 4433|  3.98k|    if (reader == NULL)
  ------------------
  |  Branch (4433:9): [True: 0, False: 3.98k]
  ------------------
 4434|      0|	return(-1);
 4435|  3.98k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4435:9): [True: 0, False: 3.98k]
  ------------------
 4436|      0|        doc = reader->doc;
 4437|  3.98k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4437:14): [True: 3.98k, False: 0]
  ------------------
 4438|  3.98k|	doc = reader->ctxt->myDoc;
 4439|  3.98k|    if (doc == NULL)
  ------------------
  |  Branch (4439:9): [True: 1.05k, False: 2.92k]
  ------------------
 4440|  1.05k|	return(-1);
 4441|       |
 4442|  2.92k|    return(doc->standalone);
 4443|  3.98k|}
xmlTextReaderSetStructuredErrorHandler:
 4591|  43.1k|{
 4592|  43.1k|    if (reader == NULL)
  ------------------
  |  Branch (4592:9): [True: 0, False: 43.1k]
  ------------------
 4593|      0|        return;
 4594|       |
 4595|  43.1k|    if (f != NULL) {
  ------------------
  |  Branch (4595:9): [True: 43.1k, False: 0]
  ------------------
 4596|  43.1k|        reader->sErrorFunc = f;
 4597|  43.1k|        reader->errorFunc = NULL;
 4598|  43.1k|        reader->errorFuncArg = arg;
 4599|  43.1k|        xmlCtxtSetErrorHandler(reader->ctxt,
 4600|  43.1k|                xmlTextReaderStructuredRelay, reader);
 4601|  43.1k|#ifdef LIBXML_RELAXNG_ENABLED
 4602|  43.1k|        if (reader->rngValidCtxt) {
  ------------------
  |  Branch (4602:13): [True: 0, False: 43.1k]
  ------------------
 4603|      0|            xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt,
 4604|      0|                    xmlTextReaderStructuredRelay, reader);
 4605|      0|        }
 4606|  43.1k|#endif
 4607|  43.1k|#ifdef LIBXML_SCHEMAS_ENABLED
 4608|  43.1k|        if (reader->xsdValidCtxt) {
  ------------------
  |  Branch (4608:13): [True: 0, False: 43.1k]
  ------------------
 4609|      0|            xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt,
 4610|      0|                    xmlTextReaderStructuredRelay, reader);
 4611|      0|        }
 4612|  43.1k|#endif
 4613|  43.1k|    } else {
 4614|       |        /* restore defaults */
 4615|      0|        reader->errorFunc = NULL;
 4616|      0|        reader->sErrorFunc = NULL;
 4617|      0|        reader->errorFuncArg = NULL;
 4618|      0|        xmlCtxtSetErrorHandler(reader->ctxt, NULL, NULL);
 4619|      0|#ifdef LIBXML_RELAXNG_ENABLED
 4620|      0|        if (reader->rngValidCtxt) {
  ------------------
  |  Branch (4620:13): [True: 0, False: 0]
  ------------------
 4621|      0|            xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt, NULL,
 4622|      0|                                               NULL);
 4623|      0|        }
 4624|      0|#endif
 4625|      0|#ifdef LIBXML_SCHEMAS_ENABLED
 4626|      0|        if (reader->xsdValidCtxt) {
  ------------------
  |  Branch (4626:13): [True: 0, False: 0]
  ------------------
 4627|      0|            xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt, NULL,
 4628|       |                                              NULL);
 4629|      0|        }
 4630|      0|#endif
 4631|      0|    }
 4632|  43.1k|}
xmlTextReaderSetResourceLoader:
 4662|  43.1k|                               xmlResourceLoader loader, void *data) {
 4663|  43.1k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4663:9): [True: 0, False: 43.1k]
  |  Branch (4663:29): [True: 0, False: 43.1k]
  ------------------
 4664|      0|        return;
 4665|       |
 4666|  43.1k|    reader->resourceLoader = loader;
 4667|  43.1k|    reader->resourceCtxt = data;
 4668|       |
 4669|  43.1k|    xmlCtxtSetResourceLoader(reader->ctxt, loader, data);
 4670|  43.1k|}
xmlTextReaderIsValid:
 4680|  3.43k|{
 4681|  3.43k|    if (reader == NULL)
  ------------------
  |  Branch (4681:9): [True: 0, False: 3.43k]
  ------------------
 4682|      0|        return (-1);
 4683|  3.43k|#ifdef LIBXML_RELAXNG_ENABLED
 4684|  3.43k|    if (reader->validate == XML_TEXTREADER_VALIDATE_RNG)
  ------------------
  |  Branch (4684:9): [True: 0, False: 3.43k]
  ------------------
 4685|      0|        return (reader->rngValidErrors == 0);
 4686|  3.43k|#endif
 4687|  3.43k|#ifdef LIBXML_SCHEMAS_ENABLED
 4688|  3.43k|    if (reader->validate == XML_TEXTREADER_VALIDATE_XSD)
  ------------------
  |  Branch (4688:9): [True: 0, False: 3.43k]
  ------------------
 4689|      0|        return (reader->xsdValidErrors == 0);
 4690|  3.43k|#endif
 4691|  3.43k|    if ((reader->ctxt != NULL) && (reader->ctxt->validate == 1))
  ------------------
  |  Branch (4691:9): [True: 3.43k, False: 0]
  |  Branch (4691:35): [True: 1.16k, False: 2.27k]
  ------------------
 4692|  1.16k|        return (reader->ctxt->valid);
 4693|  2.27k|    return (0);
 4694|  3.43k|}
xmlTextReaderSetup:
 4717|  43.1k|{
 4718|  43.1k|    if (reader == NULL) {
  ------------------
  |  Branch (4718:9): [True: 0, False: 43.1k]
  ------------------
 4719|      0|        if (input != NULL)
  ------------------
  |  Branch (4719:13): [True: 0, False: 0]
  ------------------
 4720|      0|	    xmlFreeParserInputBuffer(input);
 4721|      0|        return (-1);
 4722|      0|    }
 4723|       |
 4724|       |    /*
 4725|       |     * we force the generation of compact text nodes on the reader
 4726|       |     * since usr applications should never modify the tree
 4727|       |     */
 4728|  43.1k|    options |= XML_PARSE_COMPACT;
 4729|       |
 4730|  43.1k|    reader->doc = NULL;
 4731|  43.1k|    reader->entNr = 0;
 4732|  43.1k|    reader->parserFlags = options;
 4733|  43.1k|    reader->validate = XML_TEXTREADER_NOT_VALIDATE;
 4734|  43.1k|    if ((input != NULL) && (reader->input != NULL) &&
  ------------------
  |  Branch (4734:9): [True: 0, False: 43.1k]
  |  Branch (4734:28): [True: 0, False: 0]
  ------------------
 4735|      0|        (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (4735:9): [True: 0, False: 0]
  ------------------
 4736|      0|	xmlFreeParserInputBuffer(reader->input);
 4737|      0|	reader->input = NULL;
 4738|      0|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 4739|      0|    }
 4740|  43.1k|    if (input != NULL) {
  ------------------
  |  Branch (4740:9): [True: 0, False: 43.1k]
  ------------------
 4741|      0|	reader->input = input;
 4742|      0|	reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 4743|      0|    }
 4744|  43.1k|    if (reader->buffer == NULL)
  ------------------
  |  Branch (4744:9): [True: 0, False: 43.1k]
  ------------------
 4745|      0|        reader->buffer = xmlBufCreate(50);
 4746|  43.1k|    if (reader->buffer == NULL) {
  ------------------
  |  Branch (4746:9): [True: 0, False: 43.1k]
  ------------------
 4747|      0|        return (-1);
 4748|      0|    }
 4749|  43.1k|    if (reader->sax == NULL)
  ------------------
  |  Branch (4749:9): [True: 0, False: 43.1k]
  ------------------
 4750|      0|	reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 4751|  43.1k|    if (reader->sax == NULL) {
  ------------------
  |  Branch (4751:9): [True: 0, False: 43.1k]
  ------------------
 4752|      0|        return (-1);
 4753|      0|    }
 4754|  43.1k|    xmlSAXVersion(reader->sax, 2);
 4755|  43.1k|    reader->startElement = reader->sax->startElement;
 4756|  43.1k|    reader->sax->startElement = xmlTextReaderStartElement;
 4757|  43.1k|    reader->endElement = reader->sax->endElement;
 4758|  43.1k|    reader->sax->endElement = xmlTextReaderEndElement;
 4759|  43.1k|#ifdef LIBXML_SAX1_ENABLED
 4760|  43.1k|    if (reader->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  43.1k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (4760:9): [True: 43.1k, False: 0]
  ------------------
 4761|  43.1k|#endif /* LIBXML_SAX1_ENABLED */
 4762|  43.1k|        reader->startElementNs = reader->sax->startElementNs;
 4763|  43.1k|        reader->sax->startElementNs = xmlTextReaderStartElementNs;
 4764|  43.1k|        reader->endElementNs = reader->sax->endElementNs;
 4765|  43.1k|        reader->sax->endElementNs = xmlTextReaderEndElementNs;
 4766|  43.1k|#ifdef LIBXML_SAX1_ENABLED
 4767|  43.1k|    } else {
 4768|      0|        reader->startElementNs = NULL;
 4769|      0|        reader->endElementNs = NULL;
 4770|      0|    }
 4771|  43.1k|#endif /* LIBXML_SAX1_ENABLED */
 4772|  43.1k|    reader->characters = reader->sax->characters;
 4773|  43.1k|    reader->sax->characters = xmlTextReaderCharacters;
 4774|  43.1k|    reader->sax->ignorableWhitespace = xmlTextReaderCharacters;
 4775|  43.1k|    reader->cdataBlock = reader->sax->cdataBlock;
 4776|  43.1k|    reader->sax->cdataBlock = xmlTextReaderCDataBlock;
 4777|       |
 4778|  43.1k|    reader->mode = XML_TEXTREADER_MODE_INITIAL;
 4779|  43.1k|    reader->node = NULL;
 4780|  43.1k|    reader->curnode = NULL;
 4781|  43.1k|    if (input != NULL) {
  ------------------
  |  Branch (4781:9): [True: 0, False: 43.1k]
  ------------------
 4782|      0|        if (xmlBufUse(reader->input->buffer) < 4) {
  ------------------
  |  Branch (4782:13): [True: 0, False: 0]
  ------------------
 4783|      0|            xmlParserInputBufferRead(input, 4);
 4784|      0|        }
 4785|      0|        if (reader->ctxt == NULL) {
  ------------------
  |  Branch (4785:13): [True: 0, False: 0]
  ------------------
 4786|      0|            if (xmlBufUse(reader->input->buffer) >= 4) {
  ------------------
  |  Branch (4786:17): [True: 0, False: 0]
  ------------------
 4787|      0|                reader->ctxt = xmlCreatePushParserCtxt(reader->sax, NULL,
 4788|      0|		       (const char *) xmlBufContent(reader->input->buffer),
 4789|      0|                                      4, URL);
 4790|      0|                reader->base = 0;
 4791|      0|                reader->cur = 4;
 4792|      0|            } else {
 4793|      0|                reader->ctxt =
 4794|      0|                    xmlCreatePushParserCtxt(reader->sax, NULL, NULL, 0, URL);
 4795|      0|                reader->base = 0;
 4796|      0|                reader->cur = 0;
 4797|      0|            }
 4798|      0|            if (reader->ctxt == NULL) {
  ------------------
  |  Branch (4798:17): [True: 0, False: 0]
  ------------------
 4799|      0|                return (-1);
 4800|      0|            }
 4801|      0|        } else {
 4802|      0|	    xmlParserInputPtr inputStream;
 4803|      0|	    xmlParserInputBufferPtr buf;
 4804|       |
 4805|      0|	    xmlCtxtReset(reader->ctxt);
 4806|      0|	    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 4807|      0|	    if (buf == NULL) return(-1);
  ------------------
  |  Branch (4807:10): [True: 0, False: 0]
  ------------------
 4808|      0|	    inputStream = xmlNewInputStream(reader->ctxt);
 4809|      0|	    if (inputStream == NULL) {
  ------------------
  |  Branch (4809:10): [True: 0, False: 0]
  ------------------
 4810|      0|		xmlFreeParserInputBuffer(buf);
 4811|      0|		return(-1);
 4812|      0|	    }
 4813|       |
 4814|      0|	    if (URL == NULL)
  ------------------
  |  Branch (4814:10): [True: 0, False: 0]
  ------------------
 4815|      0|		inputStream->filename = NULL;
 4816|      0|	    else
 4817|      0|		inputStream->filename = (char *)
 4818|      0|		    xmlCanonicPath((const xmlChar *) URL);
 4819|      0|	    inputStream->buf = buf;
 4820|      0|            xmlBufResetInput(buf->buffer, inputStream);
 4821|       |
 4822|      0|            if (xmlCtxtPushInput(reader->ctxt, inputStream) < 0) {
  ------------------
  |  Branch (4822:17): [True: 0, False: 0]
  ------------------
 4823|      0|                xmlFreeInputStream(inputStream);
 4824|      0|                return(-1);
 4825|      0|            }
 4826|      0|	    reader->cur = 0;
 4827|      0|	}
 4828|      0|    }
 4829|  43.1k|    if (reader->dict != NULL) {
  ------------------
  |  Branch (4829:9): [True: 43.1k, False: 0]
  ------------------
 4830|  43.1k|        if (reader->ctxt->dict != NULL) {
  ------------------
  |  Branch (4830:13): [True: 43.1k, False: 0]
  ------------------
 4831|  43.1k|	    if (reader->dict != reader->ctxt->dict) {
  ------------------
  |  Branch (4831:10): [True: 0, False: 43.1k]
  ------------------
 4832|      0|		xmlDictFree(reader->dict);
 4833|      0|		reader->dict = reader->ctxt->dict;
 4834|      0|	    }
 4835|  43.1k|	} else {
 4836|      0|	    reader->ctxt->dict = reader->dict;
 4837|      0|	}
 4838|  43.1k|    } else {
 4839|      0|	if (reader->ctxt->dict == NULL)
  ------------------
  |  Branch (4839:6): [True: 0, False: 0]
  ------------------
 4840|      0|	    reader->ctxt->dict = xmlDictCreate();
 4841|      0|        reader->dict = reader->ctxt->dict;
 4842|      0|    }
 4843|  43.1k|    reader->ctxt->_private = reader;
 4844|  43.1k|    reader->ctxt->dictNames = 1;
 4845|       |    /*
 4846|       |     * use the parser dictionary to allocate all elements and attributes names
 4847|       |     */
 4848|  43.1k|    reader->ctxt->parseMode = XML_PARSE_READER;
 4849|       |
 4850|  43.1k|#ifdef LIBXML_XINCLUDE_ENABLED
 4851|  43.1k|    if (reader->xincctxt != NULL) {
  ------------------
  |  Branch (4851:9): [True: 0, False: 43.1k]
  ------------------
 4852|      0|	xmlXIncludeFreeContext(reader->xincctxt);
 4853|      0|	reader->xincctxt = NULL;
 4854|      0|    }
 4855|  43.1k|    if (options & XML_PARSE_XINCLUDE) {
  ------------------
  |  Branch (4855:9): [True: 24.9k, False: 18.2k]
  ------------------
 4856|  24.9k|        reader->xinclude = 1;
 4857|  24.9k|	options -= XML_PARSE_XINCLUDE;
 4858|  24.9k|    } else
 4859|  18.2k|        reader->xinclude = 0;
 4860|  43.1k|    reader->in_xinclude = 0;
 4861|  43.1k|#endif
 4862|  43.1k|#ifdef LIBXML_PATTERN_ENABLED
 4863|  43.1k|    if (reader->patternTab == NULL) {
  ------------------
  |  Branch (4863:9): [True: 43.1k, False: 0]
  ------------------
 4864|  43.1k|        reader->patternNr = 0;
 4865|  43.1k|	reader->patternMax = 0;
 4866|  43.1k|    }
 4867|  43.1k|    while (reader->patternNr > 0) {
  ------------------
  |  Branch (4867:12): [True: 0, False: 43.1k]
  ------------------
 4868|      0|        reader->patternNr--;
 4869|      0|	if (reader->patternTab[reader->patternNr] != NULL) {
  ------------------
  |  Branch (4869:6): [True: 0, False: 0]
  ------------------
 4870|      0|	    xmlFreePattern(reader->patternTab[reader->patternNr]);
 4871|      0|            reader->patternTab[reader->patternNr] = NULL;
 4872|      0|	}
 4873|      0|    }
 4874|  43.1k|#endif
 4875|       |
 4876|  43.1k|    if (options & XML_PARSE_DTDVALID)
  ------------------
  |  Branch (4876:9): [True: 20.6k, False: 22.5k]
  ------------------
 4877|  20.6k|        reader->validate = XML_TEXTREADER_VALIDATE_DTD;
 4878|       |
 4879|  43.1k|    xmlCtxtUseOptions(reader->ctxt, options);
 4880|  43.1k|    if (encoding != NULL)
  ------------------
  |  Branch (4880:9): [True: 0, False: 43.1k]
  ------------------
 4881|      0|        xmlSwitchEncodingName(reader->ctxt, encoding);
 4882|  43.1k|    if ((URL != NULL) && (reader->ctxt->input != NULL) &&
  ------------------
  |  Branch (4882:9): [True: 0, False: 43.1k]
  |  Branch (4882:26): [True: 0, False: 0]
  ------------------
 4883|      0|        (reader->ctxt->input->filename == NULL)) {
  ------------------
  |  Branch (4883:9): [True: 0, False: 0]
  ------------------
 4884|      0|        reader->ctxt->input->filename = (char *)
 4885|      0|            xmlStrdup((const xmlChar *) URL);
 4886|      0|        if (reader->ctxt->input->filename == NULL)
  ------------------
  |  Branch (4886:13): [True: 0, False: 0]
  ------------------
 4887|      0|            return(-1);
 4888|      0|    }
 4889|       |
 4890|  43.1k|    reader->doc = NULL;
 4891|       |
 4892|  43.1k|    return (0);
 4893|  43.1k|}
xmlTextReaderGetLastError:
 4917|  43.1k|{
 4918|  43.1k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4918:9): [True: 0, False: 43.1k]
  |  Branch (4918:29): [True: 0, False: 43.1k]
  ------------------
 4919|      0|        return(NULL);
 4920|  43.1k|    return(&reader->ctxt->lastError);
 4921|  43.1k|}
xmlTextReaderByteConsumed:
 4939|  6.17k|xmlTextReaderByteConsumed(xmlTextReader *reader) {
 4940|  6.17k|    xmlParserInputPtr in;
 4941|       |
 4942|  6.17k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4942:9): [True: 0, False: 6.17k]
  |  Branch (4942:29): [True: 0, False: 6.17k]
  ------------------
 4943|      0|        return(-1);
 4944|  6.17k|    in = reader->ctxt->input;
 4945|  6.17k|    if (in == NULL)
  ------------------
  |  Branch (4945:9): [True: 0, False: 6.17k]
  ------------------
 4946|      0|        return(-1);
 4947|  6.17k|    return(in->consumed + (in->cur - in->base));
 4948|  6.17k|}
xmlReaderForMemory:
 5046|  43.2k|{
 5047|  43.2k|    xmlTextReaderPtr reader;
 5048|  43.2k|    xmlParserInputBufferPtr buf;
 5049|       |
 5050|  43.2k|    buf = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
 5051|  43.2k|    if (buf == NULL) {
  ------------------
  |  Branch (5051:9): [True: 11, False: 43.2k]
  ------------------
 5052|     11|        return (NULL);
 5053|     11|    }
 5054|  43.2k|    reader = xmlNewTextReader(buf, URL);
 5055|  43.2k|    if (reader == NULL) {
  ------------------
  |  Branch (5055:9): [True: 60, False: 43.1k]
  ------------------
 5056|     60|        xmlFreeParserInputBuffer(buf);
 5057|     60|        return (NULL);
 5058|     60|    }
 5059|  43.1k|    reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  43.1k|#define XML_TEXTREADER_INPUT	1
  ------------------
 5060|  43.1k|    if (xmlTextReaderSetup(reader, NULL, URL, encoding, options) < 0) {
  ------------------
  |  Branch (5060:9): [True: 0, False: 43.1k]
  ------------------
 5061|      0|        xmlFreeTextReader(reader);
 5062|      0|        return (NULL);
 5063|      0|    }
 5064|  43.1k|    return (reader);
 5065|  43.1k|}
xmlreader.c:xmlTextReaderPushData:
  788|  86.5k|xmlTextReaderPushData(xmlTextReaderPtr reader) {
  789|  86.5k|    xmlBufPtr inbuf;
  790|  86.5k|    int val, s;
  791|  86.5k|    xmlTextReaderState oldstate;
  792|       |
  793|  86.5k|    if ((reader->input == NULL) || (reader->input->buffer == NULL))
  ------------------
  |  Branch (793:9): [True: 0, False: 86.5k]
  |  Branch (793:36): [True: 0, False: 86.5k]
  ------------------
  794|      0|	return(-1);
  795|       |
  796|  86.5k|    oldstate = reader->state;
  797|  86.5k|    reader->state = XML_TEXTREADER_NONE;
  798|  86.5k|    inbuf = reader->input->buffer;
  799|       |
  800|   454k|    while (reader->state == XML_TEXTREADER_NONE) {
  ------------------
  |  Branch (800:12): [True: 446k, False: 7.87k]
  ------------------
  801|   446k|	if (xmlBufUse(inbuf) < reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   446k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (801:6): [True: 76.3k, False: 370k]
  ------------------
  802|       |	    /*
  803|       |	     * Refill the buffer unless we are at the end of the stream
  804|       |	     */
  805|  76.3k|	    if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (805:10): [True: 76.3k, False: 0]
  ------------------
  806|  76.3k|		val = xmlParserInputBufferRead(reader->input, 4096);
  807|  76.3k|		if (val == 0) {
  ------------------
  |  Branch (807:7): [True: 76.3k, False: 0]
  ------------------
  808|  76.3k|		    if (xmlBufUse(inbuf) == reader->cur) {
  ------------------
  |  Branch (808:11): [True: 35.1k, False: 41.1k]
  ------------------
  809|  35.1k|			reader->mode = XML_TEXTREADER_MODE_EOF;
  810|  35.1k|                        break;
  811|  35.1k|		    }
  812|  76.3k|		} else if (val < 0) {
  ------------------
  |  Branch (812:14): [True: 0, False: 0]
  ------------------
  813|      0|                    xmlCtxtErrIO(reader->ctxt, reader->input->error, NULL);
  814|      0|                    reader->mode = XML_TEXTREADER_MODE_ERROR;
  815|      0|                    reader->state = XML_TEXTREADER_ERROR;
  816|      0|                    return(-1);
  817|      0|		}
  818|       |
  819|  76.3k|	    } else
  820|      0|		break;
  821|  76.3k|	}
  822|       |	/*
  823|       |	 * parse by block of CHUNK_SIZE bytes, various tests show that
  824|       |	 * it's the best tradeoff at least on a 1.2GH Duron
  825|       |	 */
  826|   411k|	if (xmlBufUse(inbuf) >= reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   411k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (826:6): [True: 370k, False: 41.1k]
  ------------------
  827|   370k|	    val = xmlParseChunk(reader->ctxt,
  828|   370k|                 (const char *) xmlBufContent(inbuf) + reader->cur,
  829|   370k|                                CHUNK_SIZE, 0);
  ------------------
  |  |   69|   370k|#define CHUNK_SIZE 512
  ------------------
  830|   370k|	    reader->cur += CHUNK_SIZE;
  ------------------
  |  |   69|   370k|#define CHUNK_SIZE 512
  ------------------
  831|   370k|	    if (val != 0)
  ------------------
  |  Branch (831:10): [True: 2.29k, False: 368k]
  ------------------
  832|  2.29k|		reader->ctxt->wellFormed = 0;
  833|   370k|	    if (reader->ctxt->wellFormed == 0)
  ------------------
  |  Branch (833:10): [True: 2.29k, False: 368k]
  ------------------
  834|  2.29k|		break;
  835|   370k|	} else {
  836|  41.1k|	    s = xmlBufUse(inbuf) - reader->cur;
  837|  41.1k|	    val = xmlParseChunk(reader->ctxt,
  838|  41.1k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  839|  41.1k|			        s, 0);
  840|  41.1k|	    reader->cur += s;
  841|  41.1k|	    if (val != 0)
  ------------------
  |  Branch (841:10): [True: 6.60k, False: 34.5k]
  ------------------
  842|  6.60k|		reader->ctxt->wellFormed = 0;
  843|  41.1k|	    break;
  844|  41.1k|	}
  845|   411k|    }
  846|  86.5k|    reader->state = oldstate;
  847|       |
  848|       |    /*
  849|       |     * Discard the consumed input when needed and possible
  850|       |     */
  851|  86.5k|    if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) {
  ------------------
  |  Branch (851:9): [True: 49.6k, False: 36.9k]
  ------------------
  852|  49.6k|        if (reader->cur > 80 /* LINE_LEN */) {
  ------------------
  |  Branch (852:13): [True: 30.9k, False: 18.7k]
  ------------------
  853|  30.9k|            val = xmlBufShrink(inbuf, reader->cur - 80);
  854|  30.9k|            if (val >= 0) {
  ------------------
  |  Branch (854:17): [True: 30.9k, False: 0]
  ------------------
  855|  30.9k|                reader->cur -= val;
  856|  30.9k|            }
  857|  30.9k|        }
  858|  49.6k|    }
  859|       |
  860|       |    /*
  861|       |     * At the end of the stream signal that the work is done to the Push
  862|       |     * parser.
  863|       |     */
  864|  36.9k|    else if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (864:14): [True: 35.1k, False: 1.75k]
  ------------------
  865|  35.1k|	if (reader->state != XML_TEXTREADER_DONE) {
  ------------------
  |  Branch (865:6): [True: 35.1k, False: 0]
  ------------------
  866|  35.1k|	    s = xmlBufUse(inbuf) - reader->cur;
  867|  35.1k|	    val = xmlParseChunk(reader->ctxt,
  868|  35.1k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  869|  35.1k|			        s, 1);
  870|  35.1k|	    reader->cur = xmlBufUse(inbuf);
  871|  35.1k|	    reader->state  = XML_TEXTREADER_DONE;
  872|  35.1k|	    if (val != 0) {
  ------------------
  |  Branch (872:10): [True: 29.7k, False: 5.38k]
  ------------------
  873|  29.7k|	        if (reader->ctxt->wellFormed)
  ------------------
  |  Branch (873:14): [True: 0, False: 29.7k]
  ------------------
  874|      0|		    reader->ctxt->wellFormed = 0;
  875|  29.7k|		else
  876|  29.7k|		    return(-1);
  877|  29.7k|	    }
  878|  35.1k|	}
  879|  35.1k|    }
  880|  56.7k|    if (reader->ctxt->wellFormed == 0) {
  ------------------
  |  Branch (880:9): [True: 8.89k, False: 47.8k]
  ------------------
  881|  8.89k|	reader->mode = XML_TEXTREADER_MODE_EOF;
  882|  8.89k|        return(-1);
  883|  8.89k|    }
  884|       |
  885|  47.8k|    return(0);
  886|  56.7k|}
xmlreader.c:xmlTextReaderValidatePop:
  992|  1.36M|xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
  993|  1.36M|    xmlNodePtr node = reader->node;
  994|       |
  995|  1.36M|#ifdef LIBXML_VALID_ENABLED
  996|  1.36M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (996:9): [True: 1.36M, False: 0]
  ------------------
  997|  1.36M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (997:9): [True: 1.36M, False: 0]
  |  Branch (997:35): [True: 111k, False: 1.24M]
  ------------------
  998|   111k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (998:6): [True: 93.7k, False: 18.1k]
  |  Branch (998:28): [True: 1.55k, False: 16.5k]
  ------------------
  999|  95.3k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1000|  95.3k|				    reader->ctxt->myDoc, node, node->name);
 1001|  95.3k|	} else {
 1002|  16.5k|            xmlChar buf[50];
 1003|  16.5k|	    xmlChar *qname;
 1004|       |
 1005|  16.5k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
 1006|  16.5k|            if (qname == NULL) {
  ------------------
  |  Branch (1006:17): [True: 12, False: 16.5k]
  ------------------
 1007|     12|                xmlTextReaderErrMemory(reader);
 1008|     12|                return(-1);
 1009|     12|            }
 1010|  16.5k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1011|  16.5k|				    reader->ctxt->myDoc, node, qname);
 1012|  16.5k|            if (qname != buf)
  ------------------
  |  Branch (1012:17): [True: 1.52k, False: 15.0k]
  ------------------
 1013|  1.52k|	        xmlFree(qname);
 1014|  16.5k|	}
 1015|       |        /*if (reader->ctxt->errNo == XML_ERR_NO_MEMORY) {
 1016|       |            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1017|       |            reader->state = XML_TEXTREADER_ERROR;
 1018|       |            return(-1);
 1019|       |        }*/
 1020|   111k|    }
 1021|  1.36M|#endif /* LIBXML_VALID_ENABLED */
 1022|  1.36M|#ifdef LIBXML_RELAXNG_ENABLED
 1023|  1.36M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (1023:9): [True: 0, False: 1.36M]
  ------------------
 1024|      0|               (reader->rngValidCtxt != NULL)) {
  ------------------
  |  Branch (1024:16): [True: 0, False: 0]
  ------------------
 1025|      0|	int ret;
 1026|       |
 1027|      0|	if (reader->rngFullNode != NULL) {
  ------------------
  |  Branch (1027:6): [True: 0, False: 0]
  ------------------
 1028|      0|	    if (node == reader->rngFullNode)
  ------------------
  |  Branch (1028:10): [True: 0, False: 0]
  ------------------
 1029|      0|	        reader->rngFullNode = NULL;
 1030|      0|	    return(0);
 1031|      0|	}
 1032|      0|	ret = xmlRelaxNGValidatePopElement(reader->rngValidCtxt,
 1033|      0|	                                   reader->ctxt->myDoc,
 1034|      0|					   node);
 1035|      0|	if (ret != 1)
  ------------------
  |  Branch (1035:6): [True: 0, False: 0]
  ------------------
 1036|      0|	    reader->rngValidErrors++;
 1037|      0|    }
 1038|  1.36M|#endif
 1039|       |
 1040|  1.36M|    return(0);
 1041|  1.36M|}
xmlreader.c:xmlTextReaderFreeNode:
  434|   181k|xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) {
  435|   181k|    xmlDictPtr dict;
  436|       |
  437|   181k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (437:9): [True: 181k, False: 0]
  |  Branch (437:29): [True: 181k, False: 0]
  ------------------
  438|   181k|	dict = reader->ctxt->dict;
  439|      0|    else
  440|      0|        dict = NULL;
  441|   181k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (441:9): [True: 0, False: 181k]
  ------------------
  442|      0|	xmlFreeDtd((xmlDtdPtr) cur);
  443|      0|	return;
  444|      0|    }
  445|   181k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (445:9): [True: 0, False: 181k]
  ------------------
  446|      0|	xmlFreeNs((xmlNsPtr) cur);
  447|      0|        return;
  448|      0|    }
  449|   181k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (449:9): [True: 0, False: 181k]
  ------------------
  450|      0|	xmlTextReaderFreeProp(reader, (xmlAttrPtr) cur);
  451|      0|	return;
  452|      0|    }
  453|       |
  454|   181k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (454:9): [True: 2.22k, False: 179k]
  ------------------
  455|  2.22k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (455:2): [True: 773, False: 1.45k]
  ------------------
  456|    773|	if (cur->children->parent == cur)
  ------------------
  |  Branch (456:6): [True: 773, False: 0]
  ------------------
  457|    773|	    xmlTextReaderFreeNodeList(reader, cur->children);
  458|    773|	cur->children = NULL;
  459|    773|    }
  460|       |
  461|   181k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (461:9): [True: 0, False: 181k]
  |  Branch (461:35): [True: 0, False: 0]
  ------------------
  462|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  463|       |
  464|   181k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (464:10): [True: 112k, False: 68.7k]
  ------------------
  465|  68.7k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (465:3): [True: 6.07k, False: 62.6k]
  ------------------
  466|  62.6k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (466:3): [True: 2.49k, False: 60.1k]
  ------------------
  467|   121k|	(cur->properties != NULL))
  ------------------
  |  Branch (467:2): [True: 19.7k, False: 101k]
  ------------------
  468|  19.7k|	xmlTextReaderFreePropList(reader, cur->properties);
  469|   181k|    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (469:9): [True: 172k, False: 9.49k]
  ------------------
  470|   172k|        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (470:9): [True: 59.2k, False: 112k]
  ------------------
  471|  59.2k|	(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (471:2): [True: 53.1k, False: 6.07k]
  ------------------
  472|  53.1k|	(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (472:2): [True: 50.6k, False: 2.49k]
  ------------------
  473|  50.6k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (473:2): [True: 49.0k, False: 1.59k]
  ------------------
  474|  49.0k|	DICT_FREE(cur->content);
  ------------------
  |  |  183|  49.0k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 47.3k, False: 1.69k]
  |  |  |  Branch (183:16): [True: 0, False: 47.3k]
  |  |  ------------------
  |  |  184|  47.3k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 47.0k, False: 327]
  |  |  ------------------
  |  |  185|  49.0k|	    xmlFree((char *)(str));
  ------------------
  475|  49.0k|    }
  476|   181k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (476:10): [True: 112k, False: 68.7k]
  ------------------
  477|  68.7k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (477:3): [True: 6.07k, False: 62.6k]
  ------------------
  478|  62.6k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (478:3): [True: 2.49k, False: 60.1k]
  ------------------
  479|   121k|	(cur->nsDef != NULL))
  ------------------
  |  Branch (479:2): [True: 5.08k, False: 116k]
  ------------------
  480|  5.08k|	xmlFreeNsList(cur->nsDef);
  481|       |
  482|       |    /*
  483|       |     * we don't free names here they are interned now
  484|       |     */
  485|   181k|    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (485:9): [True: 130k, False: 51.1k]
  ------------------
  486|   130k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (486:9): [True: 128k, False: 1.82k]
  ------------------
  487|   128k|	DICT_FREE(cur->name);
  ------------------
  |  |  183|   128k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 127k, False: 840]
  |  |  |  Branch (183:16): [True: 0, False: 127k]
  |  |  ------------------
  |  |  184|   127k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 55.6k, False: 72.0k]
  |  |  ------------------
  |  |  185|   128k|	    xmlFree((char *)(str));
  ------------------
  488|       |
  489|   181k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (489:10): [True: 112k, False: 68.7k]
  ------------------
  490|  68.7k|	 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (490:3): [True: 51.1k, False: 17.5k]
  ------------------
  491|   164k|	(reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (491:2): [True: 164k, False: 0]
  |  Branch (491:22): [True: 164k, False: 0]
  ------------------
  492|   164k|	(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   164k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (492:2): [True: 10.2k, False: 153k]
  ------------------
  493|  10.2k|	cur->next = reader->ctxt->freeElems;
  494|  10.2k|	reader->ctxt->freeElems = cur;
  495|  10.2k|	reader->ctxt->freeElemsNr++;
  496|   171k|    } else {
  497|   171k|	xmlFree(cur);
  498|   171k|    }
  499|   181k|}
xmlreader.c:xmlTextReaderFreeProp:
  277|   433k|xmlTextReaderFreeProp(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  278|   433k|    xmlDictPtr dict;
  279|       |
  280|   433k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (280:9): [True: 433k, False: 0]
  |  Branch (280:29): [True: 433k, False: 0]
  ------------------
  281|   433k|	dict = reader->ctxt->dict;
  282|      0|    else
  283|      0|        dict = NULL;
  284|   433k|    if (cur == NULL) return;
  ------------------
  |  Branch (284:9): [True: 0, False: 433k]
  ------------------
  285|       |
  286|   433k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (286:9): [True: 0, False: 433k]
  |  Branch (286:35): [True: 0, False: 0]
  ------------------
  287|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  288|       |
  289|   433k|    if (cur->children != NULL)
  ------------------
  |  Branch (289:9): [True: 359k, False: 73.3k]
  ------------------
  290|   359k|        xmlTextReaderFreeNodeList(reader, cur->children);
  291|       |
  292|   433k|    if (cur->id != NULL) {
  ------------------
  |  Branch (292:9): [True: 120, False: 433k]
  ------------------
  293|       |        /*
  294|       |         * Operating in streaming mode, attr is gonna disappear
  295|       |         */
  296|    120|        cur->id->attr = NULL;
  297|    120|        if (cur->id->name != NULL)
  ------------------
  |  Branch (297:13): [True: 0, False: 120]
  ------------------
  298|      0|            DICT_FREE(cur->id->name);
  ------------------
  |  |  183|      0|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 0, False: 0]
  |  |  |  Branch (183:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  184|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  185|      0|	    xmlFree((char *)(str));
  ------------------
  299|    120|        cur->id->name = cur->name;
  300|    120|        cur->name = NULL;
  301|   433k|    } else {
  302|   433k|        DICT_FREE(cur->name);
  ------------------
  |  |  183|   433k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 432k, False: 47]
  |  |  |  Branch (183:16): [True: 0, False: 432k]
  |  |  ------------------
  |  |  184|   432k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 94.9k, False: 337k]
  |  |  ------------------
  |  |  185|   433k|	    xmlFree((char *)(str));
  ------------------
  303|   433k|    }
  304|       |
  305|   433k|    if ((reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (305:9): [True: 433k, False: 0]
  |  Branch (305:29): [True: 433k, False: 0]
  ------------------
  306|   433k|        (reader->ctxt->freeAttrsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   433k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (306:9): [True: 17.5k, False: 415k]
  ------------------
  307|  17.5k|        cur->next = reader->ctxt->freeAttrs;
  308|  17.5k|	reader->ctxt->freeAttrs = cur;
  309|  17.5k|	reader->ctxt->freeAttrsNr++;
  310|   415k|    } else {
  311|   415k|	xmlFree(cur);
  312|   415k|    }
  313|   433k|}
xmlreader.c:xmlTextReaderFreeNodeList:
  340|   388k|xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) {
  341|   388k|    xmlNodePtr next;
  342|   388k|    xmlNodePtr parent;
  343|   388k|    xmlDictPtr dict;
  344|   388k|    size_t depth = 0;
  345|       |
  346|   388k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (346:9): [True: 388k, False: 0]
  |  Branch (346:29): [True: 388k, False: 0]
  ------------------
  347|   388k|	dict = reader->ctxt->dict;
  348|      0|    else
  349|      0|        dict = NULL;
  350|   388k|    if (cur == NULL) return;
  ------------------
  |  Branch (350:9): [True: 0, False: 388k]
  ------------------
  351|   388k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (351:9): [True: 0, False: 388k]
  ------------------
  352|      0|	xmlFreeNsList((xmlNsPtr) cur);
  353|      0|	return;
  354|      0|    }
  355|   388k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (355:9): [True: 0, False: 388k]
  ------------------
  356|   388k|	(cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (356:2): [True: 0, False: 388k]
  ------------------
  357|      0|	xmlFreeDoc((xmlDocPtr) cur);
  358|      0|	return;
  359|      0|    }
  360|  7.49M|    while (1) {
  ------------------
  |  Branch (360:12): [True: 7.49M, Folded]
  ------------------
  361|  10.7M|        while ((cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (361:16): [True: 10.7M, False: 0]
  ------------------
  362|  10.7M|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (362:16): [True: 10.6M, False: 22.4k]
  ------------------
  363|  10.6M|               (cur->children != NULL) &&
  ------------------
  |  Branch (363:16): [True: 3.21M, False: 7.47M]
  ------------------
  364|  3.21M|               (cur->children->parent == cur)) {
  ------------------
  |  Branch (364:16): [True: 3.21M, False: 0]
  ------------------
  365|  3.21M|            cur = cur->children;
  366|  3.21M|            depth += 1;
  367|  3.21M|        }
  368|       |
  369|  7.49M|        next = cur->next;
  370|  7.49M|        parent = cur->parent;
  371|       |
  372|       |	/* unroll to speed up freeing the document */
  373|  7.49M|	if (cur->type != XML_DTD_NODE) {
  ------------------
  |  Branch (373:6): [True: 7.49M, False: 0]
  ------------------
  374|       |
  375|  7.49M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (375:10): [True: 0, False: 7.49M]
  |  Branch (375:36): [True: 0, False: 0]
  ------------------
  376|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  377|       |
  378|  7.49M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (378:11): [True: 3.72M, False: 3.77M]
  ------------------
  379|  3.77M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (379:4): [True: 8.66k, False: 3.77M]
  ------------------
  380|  3.77M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (380:4): [True: 1.52M, False: 2.24M]
  ------------------
  381|  5.24M|		(cur->properties != NULL))
  ------------------
  |  Branch (381:3): [True: 279k, False: 4.97M]
  ------------------
  382|   279k|		xmlTextReaderFreePropList(reader, cur->properties);
  383|  7.49M|	    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (383:10): [True: 7.40M, False: 97.0k]
  ------------------
  384|  7.40M|	        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (384:10): [True: 3.68M, False: 3.72M]
  ------------------
  385|  3.68M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (385:3): [True: 3.67M, False: 8.66k]
  ------------------
  386|  3.67M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (386:3): [True: 2.15M, False: 1.52M]
  ------------------
  387|  2.15M|		(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (387:3): [True: 2.13M, False: 22.4k]
  ------------------
  388|  2.13M|		DICT_FREE(cur->content);
  ------------------
  |  |  183|  2.13M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 2.09M, False: 38.0k]
  |  |  |  Branch (183:16): [True: 0, False: 2.09M]
  |  |  ------------------
  |  |  184|  2.09M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 2.09M, False: 304]
  |  |  ------------------
  |  |  185|  2.13M|	    xmlFree((char *)(str));
  ------------------
  389|  2.13M|	    }
  390|  7.49M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (390:11): [True: 3.72M, False: 3.77M]
  ------------------
  391|  3.77M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (391:11): [True: 8.66k, False: 3.77M]
  ------------------
  392|  3.77M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (392:4): [True: 1.52M, False: 2.24M]
  ------------------
  393|  5.24M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (393:3): [True: 1.56M, False: 3.68M]
  ------------------
  394|  1.56M|		xmlFreeNsList(cur->nsDef);
  395|       |
  396|       |	    /*
  397|       |	     * we don't free element names here they are interned now
  398|       |	     */
  399|  7.49M|	    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (399:10): [True: 5.41M, False: 2.08M]
  ------------------
  400|  5.41M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (400:3): [True: 5.32M, False: 86.7k]
  ------------------
  401|  5.32M|		DICT_FREE(cur->name);
  ------------------
  |  |  183|  5.32M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 5.31M, False: 15.7k]
  |  |  |  Branch (183:16): [True: 0, False: 5.31M]
  |  |  ------------------
  |  |  184|  5.31M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 1.07M, False: 4.23M]
  |  |  ------------------
  |  |  185|  5.32M|	    xmlFree((char *)(str));
  ------------------
  402|  7.49M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (402:11): [True: 3.72M, False: 3.77M]
  ------------------
  403|  3.77M|		 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (403:4): [True: 2.08M, False: 1.69M]
  ------------------
  404|  5.80M|	        (reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (404:10): [True: 5.80M, False: 0]
  |  Branch (404:30): [True: 5.80M, False: 0]
  ------------------
  405|  5.80M|		(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|  5.80M|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (405:3): [True: 23.6k, False: 5.77M]
  ------------------
  406|  23.6k|	        cur->next = reader->ctxt->freeElems;
  407|  23.6k|		reader->ctxt->freeElems = cur;
  408|  23.6k|		reader->ctxt->freeElemsNr++;
  409|  7.47M|	    } else {
  410|  7.47M|		xmlFree(cur);
  411|  7.47M|	    }
  412|  7.49M|	}
  413|       |
  414|  7.49M|        if (next != NULL) {
  ------------------
  |  Branch (414:13): [True: 3.90M, False: 3.59M]
  ------------------
  415|  3.90M|	    cur = next;
  416|  3.90M|        } else {
  417|  3.59M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (417:17): [True: 388k, False: 3.21M]
  |  Branch (417:33): [True: 0, False: 3.21M]
  ------------------
  418|   388k|                break;
  419|  3.21M|            depth -= 1;
  420|  3.21M|            cur = parent;
  421|       |            cur->children = NULL;
  422|  3.21M|        }
  423|  7.49M|    }
  424|   388k|}
xmlreader.c:xmlTextReaderFreePropList:
  322|   298k|xmlTextReaderFreePropList(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  323|   298k|    xmlAttrPtr next;
  324|       |
  325|   732k|    while (cur != NULL) {
  ------------------
  |  Branch (325:12): [True: 433k, False: 298k]
  ------------------
  326|   433k|        next = cur->next;
  327|   433k|        xmlTextReaderFreeProp(reader, cur);
  328|   433k|	cur = next;
  329|   433k|    }
  330|   298k|}
xmlreader.c:xmlTextReaderErrMemory:
  206|  5.68k|xmlTextReaderErrMemory(xmlTextReaderPtr reader) {
  207|  5.68k|    if (reader == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 5.68k]
  ------------------
  208|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  209|      0|        return;
  210|      0|    }
  211|       |
  212|  5.68k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (212:9): [True: 5.68k, False: 0]
  ------------------
  213|  5.68k|        xmlCtxtErrMemory(reader->ctxt);
  214|      0|    else
  215|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  216|       |
  217|  5.68k|    reader->mode = XML_TEXTREADER_MODE_ERROR;
  218|  5.68k|    reader->state = XML_TEXTREADER_ERROR;
  219|  5.68k|}
xmlreader.c:xmlTextReaderStructuredRelay:
  558|   299k|{
  559|   299k|    xmlTextReaderPtr reader = (xmlTextReaderPtr) userData;
  560|       |
  561|   299k|    if (reader->sErrorFunc != NULL) {
  ------------------
  |  Branch (561:9): [True: 299k, False: 0]
  ------------------
  562|   299k|        reader->sErrorFunc(reader->errorFuncArg, error);
  563|   299k|    } else if (reader->errorFunc != NULL) {
  ------------------
  |  Branch (563:16): [True: 0, False: 0]
  ------------------
  564|      0|        xmlParserSeverities severity;
  565|       |
  566|      0|        if ((error->domain == XML_FROM_VALID) ||
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|      0|            (error->domain == XML_FROM_DTD)) {
  ------------------
  |  Branch (567:13): [True: 0, False: 0]
  ------------------
  568|      0|            if (error->level == XML_ERR_WARNING)
  ------------------
  |  Branch (568:17): [True: 0, False: 0]
  ------------------
  569|      0|                severity = XML_PARSER_SEVERITY_VALIDITY_WARNING;
  570|      0|            else
  571|      0|                severity = XML_PARSER_SEVERITY_VALIDITY_ERROR;
  572|      0|        } else {
  573|      0|            if (error->level == XML_ERR_WARNING)
  ------------------
  |  Branch (573:17): [True: 0, False: 0]
  ------------------
  574|      0|                severity = XML_PARSER_SEVERITY_WARNING;
  575|      0|            else
  576|      0|                severity = XML_PARSER_SEVERITY_ERROR;
  577|      0|        }
  578|       |
  579|      0|        reader->errorFunc(reader->errorFuncArg, error->message, severity,
  580|      0|                          reader->ctxt);
  581|      0|    }
  582|   299k|}
xmlreader.c:xmlTextReaderEntPush:
  593|  31.2k|{
  594|  31.2k|    if (reader->entNr >= reader->entMax) {
  ------------------
  |  Branch (594:9): [True: 497, False: 30.7k]
  ------------------
  595|    497|        xmlNodePtr *tmp;
  596|    497|        int newSize;
  597|       |
  598|    497|        newSize = xmlGrowCapacity(reader->entMax, sizeof(tmp[0]),
  599|    497|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|    497|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  600|    497|        if (newSize < 0) {
  ------------------
  |  Branch (600:13): [True: 0, False: 497]
  ------------------
  601|      0|            xmlTextReaderErrMemory(reader);
  602|      0|            return (-1);
  603|      0|        }
  604|    497|        tmp = xmlRealloc(reader->entTab, newSize * sizeof(tmp[0]));
  605|    497|        if (tmp == NULL) {
  ------------------
  |  Branch (605:13): [True: 2, False: 495]
  ------------------
  606|      2|            xmlTextReaderErrMemory(reader);
  607|      2|            return (-1);
  608|      2|        }
  609|    495|        reader->entTab = tmp;
  610|    495|        reader->entMax = newSize;
  611|    495|    }
  612|  31.2k|    reader->entTab[reader->entNr] = value;
  613|  31.2k|    reader->ent = value;
  614|  31.2k|    return (reader->entNr++);
  615|  31.2k|}
xmlreader.c:xmlTextReaderValidateEntity:
 1051|  1.68k|xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
 1052|  1.68k|    xmlNodePtr oldnode = reader->node;
 1053|  1.68k|    xmlNodePtr node = reader->node;
 1054|       |
 1055|   104k|    do {
 1056|   104k|	if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1056:6): [True: 56.4k, False: 48.1k]
  ------------------
 1057|  56.4k|	    if ((node->children != NULL) &&
  ------------------
  |  Branch (1057:10): [True: 45.5k, False: 10.8k]
  ------------------
 1058|  45.5k|		(node->children->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1058:3): [True: 45.5k, False: 0]
  ------------------
 1059|  45.5k|		(node->children->children != NULL)) {
  ------------------
  |  Branch (1059:3): [True: 31.2k, False: 14.3k]
  ------------------
 1060|  31.2k|		if (xmlTextReaderEntPush(reader, node) < 0) {
  ------------------
  |  Branch (1060:7): [True: 2, False: 31.2k]
  ------------------
 1061|      2|                    if (node == oldnode)
  ------------------
  |  Branch (1061:25): [True: 1, False: 1]
  ------------------
 1062|      1|                        break;
 1063|      1|                    goto skip_children;
 1064|      2|                }
 1065|  31.2k|		node = node->children->children;
 1066|  31.2k|		continue;
 1067|  31.2k|	    } else {
 1068|       |		/*
 1069|       |		 * The error has probably been raised already.
 1070|       |		 */
 1071|  25.2k|		if (node == oldnode)
  ------------------
  |  Branch (1071:7): [True: 353, False: 24.8k]
  ------------------
 1072|    353|		    break;
 1073|  24.8k|                goto skip_children;
 1074|  25.2k|	    }
 1075|  56.4k|#ifdef LIBXML_REGEXP_ENABLED
 1076|  56.4k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1076:13): [True: 8.66k, False: 39.4k]
  ------------------
 1077|  8.66k|	    reader->node = node;
 1078|  8.66k|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1078:10): [True: 9, False: 8.65k]
  ------------------
 1079|      9|                return(-1);
 1080|  39.4k|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1080:13): [True: 35.8k, False: 3.67k]
  ------------------
 1081|  38.1k|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1081:6): [True: 2.33k, False: 1.33k]
  ------------------
 1082|  38.1k|            xmlTextReaderValidateCData(reader, node->content,
 1083|  38.1k|	                               xmlStrlen(node->content));
 1084|  38.1k|#endif
 1085|  38.1k|	}
 1086|       |
 1087|       |	/*
 1088|       |	 * go to next node
 1089|       |	 */
 1090|  48.1k|	if (node->children != NULL) {
  ------------------
  |  Branch (1090:6): [True: 3.76k, False: 44.3k]
  ------------------
 1091|  3.76k|	    node = node->children;
 1092|  3.76k|	    continue;
 1093|  44.3k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1093:13): [True: 4.89k, False: 39.4k]
  ------------------
 1094|  4.89k|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1094:10): [True: 10, False: 4.88k]
  ------------------
 1095|     10|                return(-1);
 1096|  4.89k|	}
 1097|  69.2k|skip_children:
 1098|  69.2k|	if (node->next != NULL) {
  ------------------
  |  Branch (1098:6): [True: 48.8k, False: 20.4k]
  ------------------
 1099|  48.8k|	    node = node->next;
 1100|  48.8k|	    continue;
 1101|  48.8k|	}
 1102|  34.9k|	do {
 1103|  34.9k|	    node = node->parent;
 1104|  34.9k|	    if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1104:10): [True: 3.74k, False: 31.1k]
  ------------------
 1105|  3.74k|	        xmlNodePtr tmp;
 1106|  3.74k|		if (reader->entNr == 0) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 3.74k]
  ------------------
 1107|      0|		    while ((tmp = node->last) != NULL) {
  ------------------
  |  Branch (1107:14): [True: 0, False: 0]
  ------------------
 1108|      0|			if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
  ------------------
  |  |  170|      0|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1108:8): [True: 0, False: 0]
  ------------------
 1109|      0|			    xmlUnlinkNode(tmp);
 1110|      0|			    xmlTextReaderFreeNode(reader, tmp);
 1111|      0|			} else
 1112|      0|			    break;
 1113|      0|		    }
 1114|      0|		}
 1115|  3.74k|		reader->node = node;
 1116|  3.74k|		if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1116:7): [True: 0, False: 3.74k]
  ------------------
 1117|      0|                    return(-1);
 1118|  3.74k|	    }
 1119|  34.9k|	    if ((node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1119:10): [True: 31.1k, False: 3.74k]
  ------------------
 1120|  31.1k|		(reader->ent != NULL) && (reader->ent->children == node)) {
  ------------------
  |  Branch (1120:3): [True: 31.1k, False: 0]
  |  Branch (1120:28): [True: 31.1k, False: 0]
  ------------------
 1121|  31.1k|		node = xmlTextReaderEntPop(reader);
 1122|  31.1k|	    }
 1123|  34.9k|	    if (node == oldnode)
  ------------------
  |  Branch (1123:10): [True: 1.31k, False: 33.5k]
  ------------------
 1124|  1.31k|		break;
 1125|  33.5k|	    if (node->next != NULL) {
  ------------------
  |  Branch (1125:10): [True: 19.1k, False: 14.4k]
  ------------------
 1126|  19.1k|		node = node->next;
 1127|  19.1k|		break;
 1128|  19.1k|	    }
 1129|  33.5k|	} while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1129:11): [True: 14.4k, False: 0]
  |  Branch (1129:29): [True: 14.4k, False: 0]
  ------------------
 1130|   104k|    } while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1130:14): [True: 104k, False: 0]
  |  Branch (1130:32): [True: 102k, False: 1.31k]
  ------------------
 1131|  1.66k|    reader->node = oldnode;
 1132|       |
 1133|  1.66k|    return(0);
 1134|  1.68k|}
xmlreader.c:xmlTextReaderEntPop:
  625|  31.1k|{
  626|  31.1k|    xmlNodePtr ret;
  627|       |
  628|  31.1k|    if (reader->entNr <= 0)
  ------------------
  |  Branch (628:9): [True: 0, False: 31.1k]
  ------------------
  629|      0|        return (NULL);
  630|  31.1k|    reader->entNr--;
  631|  31.1k|    if (reader->entNr > 0)
  ------------------
  |  Branch (631:9): [True: 29.8k, False: 1.31k]
  ------------------
  632|  29.8k|        reader->ent = reader->entTab[reader->entNr - 1];
  633|  1.31k|    else
  634|  1.31k|        reader->ent = NULL;
  635|  31.1k|    ret = reader->entTab[reader->entNr];
  636|       |    reader->entTab[reader->entNr] = NULL;
  637|  31.1k|    return (ret);
  638|  31.1k|}
xmlreader.c:xmlTextReaderValidatePush:
  895|  2.83M|xmlTextReaderValidatePush(xmlTextReaderPtr reader) {
  896|  2.83M|    xmlNodePtr node = reader->node;
  897|       |
  898|  2.83M|#ifdef LIBXML_VALID_ENABLED
  899|  2.83M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (899:9): [True: 2.83M, False: 0]
  ------------------
  900|  2.83M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (900:9): [True: 2.83M, False: 0]
  |  Branch (900:35): [True: 134k, False: 2.69M]
  ------------------
  901|   134k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (901:6): [True: 110k, False: 24.2k]
  |  Branch (901:28): [True: 3.45k, False: 20.7k]
  ------------------
  902|   113k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  903|   113k|				    reader->ctxt->myDoc, node, node->name);
  904|   113k|	} else {
  905|  20.7k|            xmlChar buf[50];
  906|  20.7k|	    xmlChar *qname;
  907|       |
  908|  20.7k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
  909|  20.7k|            if (qname == NULL) {
  ------------------
  |  Branch (909:17): [True: 12, False: 20.7k]
  ------------------
  910|     12|                xmlTextReaderErrMemory(reader);
  911|     12|                return(-1);
  912|     12|            }
  913|  20.7k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  914|  20.7k|				    reader->ctxt->myDoc, node, qname);
  915|  20.7k|            if (qname != buf)
  ------------------
  |  Branch (915:17): [True: 2.09k, False: 18.6k]
  ------------------
  916|  2.09k|	        xmlFree(qname);
  917|  20.7k|	}
  918|       |        /*if (reader->ctxt->errNo == XML_ERR_NO_MEMORY) {
  919|       |            reader->mode = XML_TEXTREADER_MODE_ERROR;
  920|       |            reader->state = XML_TEXTREADER_ERROR;
  921|       |            return(-1);
  922|       |        }*/
  923|   134k|    }
  924|  2.83M|#endif /* LIBXML_VALID_ENABLED */
  925|  2.83M|#ifdef LIBXML_RELAXNG_ENABLED
  926|  2.83M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (926:9): [True: 0, False: 2.83M]
  ------------------
  927|      0|               (reader->rngValidCtxt != NULL)) {
  ------------------
  |  Branch (927:16): [True: 0, False: 0]
  ------------------
  928|      0|	int ret;
  929|       |
  930|      0|	if (reader->rngFullNode != NULL) return(0);
  ------------------
  |  Branch (930:6): [True: 0, False: 0]
  ------------------
  931|      0|	ret = xmlRelaxNGValidatePushElement(reader->rngValidCtxt,
  932|      0|	                                    reader->ctxt->myDoc,
  933|      0|					    node);
  934|      0|	if (ret == 0) {
  ------------------
  |  Branch (934:6): [True: 0, False: 0]
  ------------------
  935|       |	    /*
  936|       |	     * this element requires a full tree
  937|       |	     */
  938|      0|	    node = xmlTextReaderExpand(reader);
  939|      0|	    if (node == NULL) {
  ------------------
  |  Branch (939:10): [True: 0, False: 0]
  ------------------
  940|      0|	        ret = -1;
  941|      0|	    } else {
  942|      0|		ret = xmlRelaxNGValidateFullElement(reader->rngValidCtxt,
  943|      0|						    reader->ctxt->myDoc,
  944|      0|						    node);
  945|      0|		reader->rngFullNode = node;
  946|      0|	    }
  947|      0|	}
  948|      0|	if (ret != 1)
  ------------------
  |  Branch (948:6): [True: 0, False: 0]
  ------------------
  949|      0|	    reader->rngValidErrors++;
  950|      0|    }
  951|  2.83M|#endif
  952|       |
  953|  2.83M|    return(0);
  954|  2.83M|}
xmlreader.c:xmlTextReaderValidateCData:
  965|   631k|                           const xmlChar *data, int len) {
  966|   631k|#ifdef LIBXML_VALID_ENABLED
  967|   631k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (967:9): [True: 631k, False: 0]
  ------------------
  968|   631k|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (968:9): [True: 631k, False: 0]
  |  Branch (968:35): [True: 74.1k, False: 557k]
  ------------------
  969|  74.1k|	reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt,
  970|  74.1k|	                                            data, len);
  971|  74.1k|    }
  972|   631k|#endif /* LIBXML_VALID_ENABLED */
  973|   631k|#ifdef LIBXML_RELAXNG_ENABLED
  974|   631k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (974:9): [True: 0, False: 631k]
  ------------------
  975|      0|               (reader->rngValidCtxt != NULL)) {
  ------------------
  |  Branch (975:16): [True: 0, False: 0]
  ------------------
  976|      0|	int ret;
  977|       |
  978|      0|	if (reader->rngFullNode != NULL) return;
  ------------------
  |  Branch (978:6): [True: 0, False: 0]
  ------------------
  979|      0|	ret = xmlRelaxNGValidatePushCData(reader->rngValidCtxt, data, len);
  980|      0|	if (ret != 1)
  ------------------
  |  Branch (980:6): [True: 0, False: 0]
  ------------------
  981|      0|	    reader->rngValidErrors++;
  982|      0|    }
  983|   631k|#endif
  984|   631k|}
xmlreader.c:xmlTextReaderDoExpand:
 1166|   287k|xmlTextReaderDoExpand(xmlTextReaderPtr reader) {
 1167|   287k|    int val;
 1168|       |
 1169|   287k|    if ((reader == NULL) || (reader->node == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (1169:9): [True: 0, False: 287k]
  |  Branch (1169:29): [True: 0, False: 287k]
  |  Branch (1169:55): [True: 0, False: 287k]
  ------------------
 1170|      0|        return(-1);
 1171|   290k|    do {
 1172|   290k|	if (PARSER_STOPPED(reader->ctxt))
  ------------------
  |  |   44|   290k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 26.8k, False: 263k]
  |  |  ------------------
  ------------------
 1173|  26.8k|            return(1);
 1174|       |
 1175|   263k|        if (xmlTextReaderGetSuccessor(reader->node) != NULL)
  ------------------
  |  Branch (1175:13): [True: 237k, False: 25.8k]
  ------------------
 1176|   237k|	    return(1);
 1177|  25.8k|	if (reader->ctxt->nodeNr < reader->depth)
  ------------------
  |  Branch (1177:6): [True: 2.48k, False: 23.3k]
  ------------------
 1178|  2.48k|	    return(1);
 1179|  23.3k|	if (reader->mode == XML_TEXTREADER_MODE_EOF)
  ------------------
  |  Branch (1179:6): [True: 5.98k, False: 17.3k]
  ------------------
 1180|  5.98k|	    return(1);
 1181|  17.3k|	val = xmlTextReaderPushData(reader);
 1182|  17.3k|	if (val < 0){
  ------------------
  |  Branch (1182:6): [True: 14.1k, False: 3.14k]
  ------------------
 1183|  14.1k|	    reader->mode = XML_TEXTREADER_MODE_ERROR;
 1184|  14.1k|            reader->state = XML_TEXTREADER_ERROR;
 1185|  14.1k|	    return(-1);
 1186|  14.1k|	}
 1187|  17.3k|    } while(reader->mode != XML_TEXTREADER_MODE_EOF);
  ------------------
  |  Branch (1187:13): [True: 3.06k, False: 77]
  ------------------
 1188|     77|    return(1);
 1189|   287k|}
xmlreader.c:xmlTextReaderGetSuccessor:
 1145|   263k|xmlTextReaderGetSuccessor(xmlNodePtr cur) {
 1146|   263k|    if (cur == NULL) return(NULL) ; /* ERROR */
  ------------------
  |  Branch (1146:9): [True: 0, False: 263k]
  ------------------
 1147|   263k|    if (cur->next != NULL) return(cur->next) ;
  ------------------
  |  Branch (1147:9): [True: 26.1k, False: 237k]
  ------------------
 1148|   724k|    do {
 1149|   724k|        cur = cur->parent;
 1150|   724k|        if (cur == NULL) break;
  ------------------
  |  Branch (1150:13): [True: 25.8k, False: 698k]
  ------------------
 1151|   698k|        if (cur->next != NULL) return(cur->next);
  ------------------
  |  Branch (1151:13): [True: 211k, False: 487k]
  ------------------
 1152|   698k|    } while (cur != NULL);
  ------------------
  |  Branch (1152:14): [True: 487k, False: 0]
  ------------------
 1153|  25.8k|    return(cur);
 1154|   237k|}
xmlreader.c:xmlTextReaderDumpCopy:
 1619|  49.1k|                      xmlNodePtr node) {
 1620|  49.1k|    if ((node->type == XML_ELEMENT_DECL) ||
  ------------------
  |  Branch (1620:9): [True: 331, False: 48.8k]
  ------------------
 1621|  48.8k|        (node->type == XML_ATTRIBUTE_DECL) ||
  ------------------
  |  Branch (1621:9): [True: 592, False: 48.2k]
  ------------------
 1622|  48.2k|        (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (1622:9): [True: 568, False: 47.6k]
  ------------------
 1623|  1.49k|        return;
 1624|       |
 1625|  47.6k|    if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1625:9): [True: 1.12k, False: 46.5k]
  ------------------
 1626|  46.5k|        (node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1626:9): [True: 0, False: 46.5k]
  ------------------
 1627|  1.12k|        xmlNodeDumpOutput(output, node->doc, node, 0, 0, NULL);
 1628|  46.5k|    } else {
 1629|  46.5k|        xmlNodePtr copy;
 1630|       |
 1631|       |        /*
 1632|       |         * Create a copy to make sure that namespace declarations from
 1633|       |         * ancestors are added.
 1634|       |         */
 1635|  46.5k|        copy = xmlDocCopyNode(node, node->doc, 1);
 1636|  46.5k|        if (copy == NULL) {
  ------------------
  |  Branch (1636:13): [True: 4.48k, False: 42.0k]
  ------------------
 1637|  4.48k|            xmlTextReaderErrMemory(reader);
 1638|  4.48k|            return;
 1639|  4.48k|        }
 1640|       |
 1641|  42.0k|        xmlNodeDumpOutput(output, copy->doc, copy, 0, 0, NULL);
 1642|       |
 1643|  42.0k|        xmlFreeNode(copy);
 1644|  42.0k|    }
 1645|  47.6k|}
xmlreader.c:xmlTextReaderStartElement:
  649|   174k|	                  const xmlChar **atts) {
  650|   174k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  651|   174k|    xmlTextReaderPtr reader = ctxt->_private;
  652|       |
  653|   174k|    if ((reader != NULL) && (reader->startElement != NULL)) {
  ------------------
  |  Branch (653:9): [True: 174k, False: 0]
  |  Branch (653:29): [True: 174k, False: 0]
  ------------------
  654|   174k|	reader->startElement(ctx, fullname, atts);
  655|   174k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (655:6): [True: 174k, False: 12]
  |  Branch (655:30): [True: 174k, False: 0]
  ------------------
  656|   174k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (656:6): [True: 174k, False: 0]
  |  Branch (656:36): [True: 50.0k, False: 124k]
  ------------------
  657|  50.0k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (657:6): [True: 48.5k, False: 1.41k]
  ------------------
  658|  48.5k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|  48.5k|#define NODE_IS_EMPTY		0x1
  ------------------
  659|   174k|    }
  660|   174k|    if (reader != NULL)
  ------------------
  |  Branch (660:9): [True: 174k, False: 0]
  ------------------
  661|   174k|	reader->state = XML_TEXTREADER_ELEMENT;
  662|   174k|}
xmlreader.c:xmlTextReaderEndElement:
  671|  83.5k|xmlTextReaderEndElement(void *ctx, const xmlChar *fullname) {
  672|  83.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  673|  83.5k|    xmlTextReaderPtr reader = ctxt->_private;
  674|       |
  675|  83.5k|    if ((reader != NULL) && (reader->endElement != NULL)) {
  ------------------
  |  Branch (675:9): [True: 83.5k, False: 0]
  |  Branch (675:29): [True: 83.5k, False: 0]
  ------------------
  676|  83.5k|	reader->endElement(ctx, fullname);
  677|  83.5k|    }
  678|  83.5k|}
xmlreader.c:xmlTextReaderStartElementNs:
  704|   267k|{
  705|   267k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  706|   267k|    xmlTextReaderPtr reader = ctxt->_private;
  707|       |
  708|   267k|    if ((reader != NULL) && (reader->startElementNs != NULL)) {
  ------------------
  |  Branch (708:9): [True: 267k, False: 0]
  |  Branch (708:29): [True: 267k, False: 0]
  ------------------
  709|   267k|	reader->startElementNs(ctx, localname, prefix, URI, nb_namespaces,
  710|   267k|	                       namespaces, nb_attributes, nb_defaulted,
  711|   267k|			       attributes);
  712|   267k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (712:6): [True: 267k, False: 25]
  |  Branch (712:30): [True: 267k, False: 0]
  ------------------
  713|   267k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (713:6): [True: 267k, False: 0]
  |  Branch (713:36): [True: 79.1k, False: 188k]
  ------------------
  714|  79.1k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (714:6): [True: 76.7k, False: 2.38k]
  ------------------
  715|  76.7k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|  76.7k|#define NODE_IS_EMPTY		0x1
  ------------------
  716|   267k|    }
  717|   267k|    if (reader != NULL)
  ------------------
  |  Branch (717:9): [True: 267k, False: 0]
  ------------------
  718|   267k|	reader->state = XML_TEXTREADER_ELEMENT;
  719|   267k|}
xmlreader.c:xmlTextReaderEndElementNs:
  734|   120k|{
  735|   120k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  736|   120k|    xmlTextReaderPtr reader = ctxt->_private;
  737|       |
  738|   120k|    if ((reader != NULL) && (reader->endElementNs != NULL)) {
  ------------------
  |  Branch (738:9): [True: 120k, False: 0]
  |  Branch (738:29): [True: 120k, False: 0]
  ------------------
  739|   120k|	reader->endElementNs(ctx, localname, prefix, URI);
  740|   120k|    }
  741|   120k|}
xmlreader.c:xmlTextReaderCharacters:
  753|   352k|{
  754|   352k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  755|   352k|    xmlTextReaderPtr reader = ctxt->_private;
  756|       |
  757|   352k|    if ((reader != NULL) && (reader->characters != NULL)) {
  ------------------
  |  Branch (757:9): [True: 352k, False: 0]
  |  Branch (757:29): [True: 352k, False: 0]
  ------------------
  758|   352k|	reader->characters(ctx, ch, len);
  759|   352k|    }
  760|   352k|}
xmlreader.c:xmlTextReaderCDataBlock:
  771|  7.39k|{
  772|  7.39k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  773|  7.39k|    xmlTextReaderPtr reader = ctxt->_private;
  774|       |
  775|  7.39k|    if ((reader != NULL) && (reader->cdataBlock != NULL)) {
  ------------------
  |  Branch (775:9): [True: 7.39k, False: 0]
  |  Branch (775:29): [True: 7.39k, False: 0]
  ------------------
  776|  7.39k|	reader->cdataBlock(ctx, ch, len);
  777|  7.39k|    }
  778|  7.39k|}
xmlreader.c:xmlTextReaderFreeDoc:
  508|  38.3k|xmlTextReaderFreeDoc(xmlTextReaderPtr reader, xmlDocPtr cur) {
  509|  38.3k|    xmlDtdPtr extSubset, intSubset;
  510|       |
  511|  38.3k|    if (cur == NULL) return;
  ------------------
  |  Branch (511:9): [True: 0, False: 38.3k]
  ------------------
  512|       |
  513|  38.3k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (513:9): [True: 0, False: 38.3k]
  |  Branch (513:35): [True: 0, False: 0]
  ------------------
  514|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  515|       |
  516|       |    /*
  517|       |     * Do this before freeing the children list to avoid ID lookups
  518|       |     */
  519|  38.3k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (519:9): [True: 605, False: 37.7k]
  ------------------
  520|  38.3k|    cur->ids = NULL;
  521|  38.3k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (521:9): [True: 227, False: 38.1k]
  ------------------
  522|  38.3k|    cur->refs = NULL;
  523|  38.3k|    extSubset = cur->extSubset;
  524|  38.3k|    intSubset = cur->intSubset;
  525|  38.3k|    if (intSubset == extSubset)
  ------------------
  |  Branch (525:9): [True: 21.2k, False: 17.1k]
  ------------------
  526|  21.2k|	extSubset = NULL;
  527|  38.3k|    if (extSubset != NULL) {
  ------------------
  |  Branch (527:9): [True: 1.58k, False: 36.7k]
  ------------------
  528|  1.58k|	xmlUnlinkNode((xmlNodePtr) cur->extSubset);
  529|  1.58k|	cur->extSubset = NULL;
  530|  1.58k|	xmlFreeDtd(extSubset);
  531|  1.58k|    }
  532|  38.3k|    if (intSubset != NULL) {
  ------------------
  |  Branch (532:9): [True: 17.1k, False: 21.2k]
  ------------------
  533|  17.1k|	xmlUnlinkNode((xmlNodePtr) cur->intSubset);
  534|  17.1k|	cur->intSubset = NULL;
  535|  17.1k|	xmlFreeDtd(intSubset);
  536|  17.1k|    }
  537|       |
  538|  38.3k|    if (cur->children != NULL) xmlTextReaderFreeNodeList(reader, cur->children);
  ------------------
  |  Branch (538:9): [True: 27.5k, False: 10.8k]
  ------------------
  539|       |
  540|  38.3k|    if (cur->version != NULL) xmlFree(cur->version);
  ------------------
  |  Branch (540:9): [True: 38.3k, False: 0]
  ------------------
  541|  38.3k|    if (cur->name != NULL) xmlFree((char *) cur->name);
  ------------------
  |  Branch (541:9): [True: 0, False: 38.3k]
  ------------------
  542|  38.3k|    if (cur->encoding != NULL) xmlFree(cur->encoding);
  ------------------
  |  Branch (542:9): [True: 205, False: 38.1k]
  ------------------
  543|  38.3k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (543:9): [True: 4.26k, False: 34.0k]
  ------------------
  544|  38.3k|    if (cur->URL != NULL) xmlFree(cur->URL);
  ------------------
  |  Branch (544:9): [True: 0, False: 38.3k]
  ------------------
  545|  38.3k|    if (cur->dict != NULL) xmlDictFree(cur->dict);
  ------------------
  |  Branch (545:9): [True: 22.9k, False: 15.3k]
  ------------------
  546|       |
  547|  38.3k|    xmlFree(cur);
  548|  38.3k|}
xmlreader.c:readerStrdup:
  222|  12.5k|readerStrdup(xmlTextReaderPtr reader, const xmlChar *string) {
  223|  12.5k|    xmlChar *copy;
  224|       |
  225|  12.5k|    if (string == NULL)
  ------------------
  |  Branch (225:9): [True: 1.22k, False: 11.2k]
  ------------------
  226|  1.22k|        return(NULL);
  227|       |
  228|  11.2k|    copy = xmlStrdup(string);
  229|  11.2k|    if (copy == NULL)
  ------------------
  |  Branch (229:9): [True: 68, False: 11.2k]
  ------------------
  230|     68|        xmlTextReaderErrMemory(reader);
  231|       |
  232|  11.2k|    return(copy);
  233|  12.5k|}
xmlreader.c:constString:
  236|  61.2k|constString(xmlTextReaderPtr reader, const xmlChar *string) {
  237|  61.2k|    const xmlChar *dictString;
  238|       |
  239|  61.2k|    if (string == NULL)
  ------------------
  |  Branch (239:9): [True: 2.54k, False: 58.7k]
  ------------------
  240|  2.54k|        return(NULL);
  241|       |
  242|  58.7k|    dictString = xmlDictLookup(reader->dict, string, -1);
  243|  58.7k|    if (dictString == NULL)
  ------------------
  |  Branch (243:9): [True: 15, False: 58.7k]
  ------------------
  244|     15|        xmlTextReaderErrMemory(reader);
  245|       |
  246|  58.7k|    return(dictString);
  247|  61.2k|}
xmlreader.c:constQString:
  251|  2.97k|             const xmlChar *name) {
  252|  2.97k|    const xmlChar *dictString;
  253|       |
  254|  2.97k|    if (name == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 2.97k]
  ------------------
  255|      0|        return(NULL);
  256|       |
  257|  2.97k|    dictString = xmlDictQLookup(reader->dict, prefix, name);
  258|  2.97k|    if (dictString == NULL)
  ------------------
  |  Branch (258:9): [True: 5, False: 2.97k]
  ------------------
  259|      5|        xmlTextReaderErrMemory(reader);
  260|       |
  261|  2.97k|    return(dictString);
  262|  2.97k|}

xmlRegNewExecCtxt:
 3620|  13.5k|xmlRegNewExecCtxt(xmlRegexp *comp, xmlRegExecCallbacks callback, void *data) {
 3621|  13.5k|    xmlRegExecCtxtPtr exec;
 3622|       |
 3623|  13.5k|    if (comp == NULL)
  ------------------
  |  Branch (3623:9): [True: 0, False: 13.5k]
  ------------------
 3624|      0|	return(NULL);
 3625|  13.5k|    if ((comp->compact == NULL) && (comp->states == NULL))
  ------------------
  |  Branch (3625:9): [True: 3.02k, False: 10.5k]
  |  Branch (3625:36): [True: 0, False: 3.02k]
  ------------------
 3626|      0|        return(NULL);
 3627|  13.5k|    exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
 3628|  13.5k|    if (exec == NULL)
  ------------------
  |  Branch (3628:9): [True: 24, False: 13.5k]
  ------------------
 3629|     24|	return(NULL);
 3630|  13.5k|    memset(exec, 0, sizeof(xmlRegExecCtxt));
 3631|  13.5k|    exec->inputString = NULL;
 3632|  13.5k|    exec->index = 0;
 3633|  13.5k|    exec->determinist = 1;
 3634|  13.5k|    exec->maxRollbacks = 0;
 3635|  13.5k|    exec->nbRollbacks = 0;
 3636|  13.5k|    exec->rollbacks = NULL;
 3637|  13.5k|    exec->status = XML_REGEXP_OK;
  ------------------
  |  |   11|  13.5k|#define XML_REGEXP_OK               0
  ------------------
 3638|  13.5k|    exec->comp = comp;
 3639|  13.5k|    if (comp->compact == NULL)
  ------------------
  |  Branch (3639:9): [True: 3.01k, False: 10.5k]
  ------------------
 3640|  3.01k|	exec->state = comp->states[0];
 3641|  13.5k|    exec->transno = 0;
 3642|  13.5k|    exec->transcount = 0;
 3643|  13.5k|    exec->callback = callback;
 3644|  13.5k|    exec->data = data;
 3645|  13.5k|    if (comp->nbCounters > 0) {
  ------------------
  |  Branch (3645:9): [True: 0, False: 13.5k]
  ------------------
 3646|       |        /*
 3647|       |	 * For error handling, exec->counts is allocated twice the size
 3648|       |	 * the second half is used to store the data in case of rollback
 3649|       |	 */
 3650|      0|	exec->counts = (int *) xmlMalloc(comp->nbCounters * sizeof(int)
 3651|      0|	                                 * 2);
 3652|      0|	if (exec->counts == NULL) {
  ------------------
  |  Branch (3652:6): [True: 0, False: 0]
  ------------------
 3653|      0|	    xmlFree(exec);
 3654|      0|	    return(NULL);
 3655|      0|	}
 3656|      0|        memset(exec->counts, 0, comp->nbCounters * sizeof(int) * 2);
 3657|      0|	exec->errCounts = &exec->counts[comp->nbCounters];
 3658|  13.5k|    } else {
 3659|  13.5k|	exec->counts = NULL;
 3660|  13.5k|	exec->errCounts = NULL;
 3661|  13.5k|    }
 3662|  13.5k|    exec->inputStackMax = 0;
 3663|  13.5k|    exec->inputStackNr = 0;
 3664|  13.5k|    exec->inputStack = NULL;
 3665|  13.5k|    exec->errStateNo = -1;
 3666|       |    exec->errString = NULL;
 3667|  13.5k|    exec->nbPush = 0;
 3668|  13.5k|    return(exec);
 3669|  13.5k|}
xmlRegFreeExecCtxt:
 3679|  14.1k|xmlRegFreeExecCtxt(xmlRegExecCtxt *exec) {
 3680|  14.1k|    if (exec == NULL)
  ------------------
  |  Branch (3680:9): [True: 551, False: 13.5k]
  ------------------
 3681|    551|	return;
 3682|       |
 3683|  13.5k|    if (exec->rollbacks != NULL) {
  ------------------
  |  Branch (3683:9): [True: 989, False: 12.5k]
  ------------------
 3684|    989|	if (exec->counts != NULL) {
  ------------------
  |  Branch (3684:6): [True: 0, False: 989]
  ------------------
 3685|      0|	    int i;
 3686|       |
 3687|      0|	    for (i = 0;i < exec->maxRollbacks;i++)
  ------------------
  |  Branch (3687:17): [True: 0, False: 0]
  ------------------
 3688|      0|		if (exec->rollbacks[i].counts != NULL)
  ------------------
  |  Branch (3688:7): [True: 0, False: 0]
  ------------------
 3689|      0|		    xmlFree(exec->rollbacks[i].counts);
 3690|      0|	}
 3691|    989|	xmlFree(exec->rollbacks);
 3692|    989|    }
 3693|  13.5k|    if (exec->counts != NULL)
  ------------------
  |  Branch (3693:9): [True: 0, False: 13.5k]
  ------------------
 3694|      0|	xmlFree(exec->counts);
 3695|  13.5k|    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (3695:9): [True: 989, False: 12.5k]
  ------------------
 3696|    989|	int i;
 3697|       |
 3698|  40.8k|	for (i = 0;i < exec->inputStackNr;i++) {
  ------------------
  |  Branch (3698:13): [True: 39.8k, False: 989]
  ------------------
 3699|  39.8k|	    if (exec->inputStack[i].value != NULL)
  ------------------
  |  Branch (3699:10): [True: 39.8k, False: 0]
  ------------------
 3700|  39.8k|		xmlFree(exec->inputStack[i].value);
 3701|  39.8k|	}
 3702|    989|	xmlFree(exec->inputStack);
 3703|    989|    }
 3704|  13.5k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3704:9): [True: 5.88k, False: 7.68k]
  ------------------
 3705|  5.88k|        xmlFree(exec->errString);
 3706|  13.5k|    xmlFree(exec);
 3707|  13.5k|}
xmlRegExecPushString:
 4202|  68.0k|	             void *data) {
 4203|  68.0k|    return(xmlRegExecPushStringInternal(exec, value, data, 0));
 4204|  68.0k|}
xmlRegexpIsDeterminist:
 5567|  8.58k|xmlRegexpIsDeterminist(xmlRegexp *comp) {
 5568|  8.58k|    xmlAutomataPtr am;
 5569|  8.58k|    int ret;
 5570|       |
 5571|  8.58k|    if (comp == NULL)
  ------------------
  |  Branch (5571:9): [True: 0, False: 8.58k]
  ------------------
 5572|      0|	return(-1);
 5573|  8.58k|    if (comp->determinist != -1)
  ------------------
  |  Branch (5573:9): [True: 7.02k, False: 1.56k]
  ------------------
 5574|  7.02k|	return(comp->determinist);
 5575|       |
 5576|  1.56k|    am = xmlNewAutomata();
 5577|  1.56k|    if (am == NULL)
  ------------------
  |  Branch (5577:9): [True: 24, False: 1.53k]
  ------------------
 5578|     24|        return(-1);
 5579|  1.53k|    if (am->states != NULL) {
  ------------------
  |  Branch (5579:9): [True: 1.53k, False: 0]
  ------------------
 5580|  1.53k|	int i;
 5581|       |
 5582|  3.07k|	for (i = 0;i < am->nbStates;i++)
  ------------------
  |  Branch (5582:13): [True: 1.53k, False: 1.53k]
  ------------------
 5583|  1.53k|	    xmlRegFreeState(am->states[i]);
 5584|  1.53k|	xmlFree(am->states);
 5585|  1.53k|    }
 5586|  1.53k|    am->nbAtoms = comp->nbAtoms;
 5587|  1.53k|    am->atoms = comp->atoms;
 5588|  1.53k|    am->nbStates = comp->nbStates;
 5589|  1.53k|    am->states = comp->states;
 5590|  1.53k|    am->determinist = -1;
 5591|  1.53k|    am->flags = comp->flags;
 5592|  1.53k|    ret = xmlFAComputesDeterminism(am);
 5593|  1.53k|    am->atoms = NULL;
 5594|       |    am->states = NULL;
 5595|  1.53k|    xmlFreeAutomata(am);
 5596|  1.53k|    comp->determinist = ret;
 5597|  1.53k|    return(ret);
 5598|  1.56k|}
xmlRegFreeRegexp:
 5606|  1.45k|xmlRegFreeRegexp(xmlRegexp *regexp) {
 5607|  1.45k|    int i;
 5608|  1.45k|    if (regexp == NULL)
  ------------------
  |  Branch (5608:9): [True: 0, False: 1.45k]
  ------------------
 5609|      0|	return;
 5610|       |
 5611|  1.45k|    if (regexp->string != NULL)
  ------------------
  |  Branch (5611:9): [True: 0, False: 1.45k]
  ------------------
 5612|      0|	xmlFree(regexp->string);
 5613|  1.45k|    if (regexp->states != NULL) {
  ------------------
  |  Branch (5613:9): [True: 482, False: 970]
  ------------------
 5614|   420k|	for (i = 0;i < regexp->nbStates;i++)
  ------------------
  |  Branch (5614:13): [True: 420k, False: 482]
  ------------------
 5615|   420k|	    xmlRegFreeState(regexp->states[i]);
 5616|    482|	xmlFree(regexp->states);
 5617|    482|    }
 5618|  1.45k|    if (regexp->atoms != NULL) {
  ------------------
  |  Branch (5618:9): [True: 482, False: 970]
  ------------------
 5619|   302k|	for (i = 0;i < regexp->nbAtoms;i++)
  ------------------
  |  Branch (5619:13): [True: 301k, False: 482]
  ------------------
 5620|   301k|	    xmlRegFreeAtom(regexp->atoms[i]);
 5621|    482|	xmlFree(regexp->atoms);
 5622|    482|    }
 5623|  1.45k|    if (regexp->counters != NULL)
  ------------------
  |  Branch (5623:9): [True: 0, False: 1.45k]
  ------------------
 5624|      0|	xmlFree(regexp->counters);
 5625|  1.45k|    if (regexp->compact != NULL)
  ------------------
  |  Branch (5625:9): [True: 970, False: 482]
  ------------------
 5626|    970|	xmlFree(regexp->compact);
 5627|  1.45k|    if (regexp->transdata != NULL)
  ------------------
  |  Branch (5627:9): [True: 0, False: 1.45k]
  ------------------
 5628|      0|	xmlFree(regexp->transdata);
 5629|  1.45k|    if (regexp->stringMap != NULL) {
  ------------------
  |  Branch (5629:9): [True: 970, False: 482]
  ------------------
 5630|  4.38k|	for (i = 0; i < regexp->nbstrings;i++)
  ------------------
  |  Branch (5630:14): [True: 3.41k, False: 970]
  ------------------
 5631|  3.41k|	    xmlFree(regexp->stringMap[i]);
 5632|    970|	xmlFree(regexp->stringMap);
 5633|    970|    }
 5634|       |
 5635|  1.45k|    xmlFree(regexp);
 5636|  1.45k|}
xmlNewAutomata:
 5652|  3.57k|xmlNewAutomata(void) {
 5653|  3.57k|    xmlAutomataPtr ctxt;
 5654|       |
 5655|  3.57k|    ctxt = xmlRegNewParserCtxt(NULL);
 5656|  3.57k|    if (ctxt == NULL)
  ------------------
  |  Branch (5656:9): [True: 12, False: 3.56k]
  ------------------
 5657|     12|	return(NULL);
 5658|       |
 5659|       |    /* initialize the parser */
 5660|  3.56k|    ctxt->state = xmlRegStatePush(ctxt);
 5661|  3.56k|    if (ctxt->state == NULL) {
  ------------------
  |  Branch (5661:9): [True: 22, False: 3.53k]
  ------------------
 5662|     22|	xmlFreeAutomata(ctxt);
 5663|     22|	return(NULL);
 5664|     22|    }
 5665|  3.53k|    ctxt->start = ctxt->state;
 5666|  3.53k|    ctxt->end = NULL;
 5667|       |
 5668|  3.53k|    ctxt->start->type = XML_REGEXP_START_STATE;
 5669|  3.53k|    ctxt->flags = 0;
 5670|       |
 5671|  3.53k|    return(ctxt);
 5672|  3.56k|}
xmlFreeAutomata:
 5682|  3.56k|xmlFreeAutomata(xmlAutomata *am) {
 5683|  3.56k|    if (am == NULL)
  ------------------
  |  Branch (5683:9): [True: 0, False: 3.56k]
  ------------------
 5684|      0|	return;
 5685|  3.56k|    xmlRegFreeParserCtxt(am);
 5686|  3.56k|}
xmlAutomataGetInitState:
 5712|  2.00k|xmlAutomataGetInitState(xmlAutomata *am) {
 5713|  2.00k|    if (am == NULL)
  ------------------
  |  Branch (5713:9): [True: 0, False: 2.00k]
  ------------------
 5714|      0|	return(NULL);
 5715|  2.00k|    return(am->start);
 5716|  2.00k|}
xmlAutomataSetFinalState:
 5728|  1.98k|xmlAutomataSetFinalState(xmlAutomata *am, xmlAutomataState *state) {
 5729|  1.98k|    if ((am == NULL) || (state == NULL))
  ------------------
  |  Branch (5729:9): [True: 0, False: 1.98k]
  |  Branch (5729:25): [True: 79, False: 1.90k]
  ------------------
 5730|     79|	return(-1);
 5731|  1.90k|    state->type = XML_REGEXP_FINAL_STATE;
 5732|  1.90k|    return(0);
 5733|  1.98k|}
xmlAutomataNewTransition:
 5754|   508k|			 void *data) {
 5755|   508k|    xmlRegAtomPtr atom;
 5756|       |
 5757|   508k|    if ((am == NULL) || (from == NULL) || (token == NULL))
  ------------------
  |  Branch (5757:9): [True: 0, False: 508k]
  |  Branch (5757:25): [True: 33.2k, False: 475k]
  |  Branch (5757:43): [True: 0, False: 475k]
  ------------------
 5758|  33.2k|	return(NULL);
 5759|   475k|    atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
 5760|   475k|    if (atom == NULL)
  ------------------
  |  Branch (5760:9): [True: 34, False: 475k]
  ------------------
 5761|     34|        return(NULL);
 5762|   475k|    atom->data = data;
 5763|   475k|    atom->valuep = xmlStrdup(token);
 5764|   475k|    if (atom->valuep == NULL) {
  ------------------
  |  Branch (5764:9): [True: 32, False: 475k]
  ------------------
 5765|     32|        xmlRegFreeAtom(atom);
 5766|     32|        xmlRegexpErrMemory(am);
 5767|     32|        return(NULL);
 5768|     32|    }
 5769|       |
 5770|   475k|    if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
  ------------------
  |  Branch (5770:9): [True: 65, False: 475k]
  ------------------
 5771|     65|        xmlRegFreeAtom(atom);
 5772|     65|	return(NULL);
 5773|     65|    }
 5774|   475k|    if (to == NULL)
  ------------------
  |  Branch (5774:9): [True: 418k, False: 56.8k]
  ------------------
 5775|   418k|	return(am->state);
 5776|  56.8k|    return(to);
 5777|   475k|}
xmlAutomataNewState:
 6238|  81.4k|xmlAutomataNewState(xmlAutomata *am) {
 6239|  81.4k|    if (am == NULL)
  ------------------
  |  Branch (6239:9): [True: 0, False: 81.4k]
  ------------------
 6240|      0|	return(NULL);
 6241|  81.4k|    return(xmlRegStatePush(am));
 6242|  81.4k|}
xmlAutomataNewEpsilon:
 6258|   632k|		      xmlAutomataState *to) {
 6259|   632k|    if ((am == NULL) || (from == NULL))
  ------------------
  |  Branch (6259:9): [True: 0, False: 632k]
  |  Branch (6259:25): [True: 2.38k, False: 629k]
  ------------------
 6260|  2.38k|	return(NULL);
 6261|   629k|    xmlFAGenerateEpsilonTransition(am, from, to);
 6262|   629k|    if (to == NULL)
  ------------------
  |  Branch (6262:9): [True: 212k, False: 417k]
  ------------------
 6263|   212k|	return(am->state);
 6264|   417k|    return(to);
 6265|   629k|}
xmlAutomataCompile:
 6375|  1.98k|xmlAutomataCompile(xmlAutomata *am) {
 6376|  1.98k|    xmlRegexpPtr ret;
 6377|       |
 6378|  1.98k|    if ((am == NULL) || (am->error != 0)) return(NULL);
  ------------------
  |  Branch (6378:9): [True: 0, False: 1.98k]
  |  Branch (6378:25): [True: 317, False: 1.66k]
  ------------------
 6379|  1.66k|    xmlFAEliminateEpsilonTransitions(am);
 6380|  1.66k|    if (am->error != 0)
  ------------------
  |  Branch (6380:9): [True: 102, False: 1.56k]
  ------------------
 6381|    102|        return(NULL);
 6382|       |    /* xmlFAComputesDeterminism(am); */
 6383|  1.56k|    ret = xmlRegEpxFromParse(am);
 6384|       |
 6385|  1.56k|    return(ret);
 6386|  1.66k|}
xmlregexp.c:xmlRegExecPushStringInternal:
 3891|  68.0k|	                     void *data, int compound) {
 3892|  68.0k|    xmlRegTransPtr trans;
 3893|  68.0k|    xmlRegAtomPtr atom;
 3894|  68.0k|    int ret;
 3895|  68.0k|    int final = 0;
 3896|  68.0k|    int progress = 1;
 3897|       |
 3898|  68.0k|    if (exec == NULL)
  ------------------
  |  Branch (3898:9): [True: 0, False: 68.0k]
  ------------------
 3899|      0|	return(-1);
 3900|  68.0k|    if (exec->comp == NULL)
  ------------------
  |  Branch (3900:9): [True: 0, False: 68.0k]
  ------------------
 3901|      0|	return(-1);
 3902|  68.0k|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  68.0k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3902:9): [True: 14.2k, False: 53.7k]
  ------------------
 3903|  14.2k|	return(exec->status);
 3904|       |
 3905|  53.7k|    if (exec->comp->compact != NULL)
  ------------------
  |  Branch (3905:9): [True: 11.3k, False: 42.3k]
  ------------------
 3906|  11.3k|	return(xmlRegCompactPushString(exec, exec->comp, value, data));
 3907|       |
 3908|  42.3k|    if (value == NULL) {
  ------------------
  |  Branch (3908:9): [True: 1.00k, False: 41.3k]
  ------------------
 3909|  1.00k|        if (exec->state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (3909:13): [True: 536, False: 465]
  ------------------
 3910|    536|	    return(1);
 3911|    465|	final = 1;
 3912|    465|    }
 3913|       |
 3914|       |    /*
 3915|       |     * If we have an active rollback stack push the new value there
 3916|       |     * and get back to where we were left
 3917|       |     */
 3918|  41.8k|    if ((value != NULL) && (exec->inputStackNr > 0)) {
  ------------------
  |  Branch (3918:9): [True: 41.3k, False: 465]
  |  Branch (3918:28): [True: 38.8k, False: 2.52k]
  ------------------
 3919|  38.8k|	xmlFARegExecSaveInputString(exec, value, data);
 3920|  38.8k|	value = exec->inputStack[exec->index].value;
 3921|  38.8k|	data = exec->inputStack[exec->index].data;
 3922|  38.8k|    }
 3923|       |
 3924|  62.6M|    while ((exec->status == XML_REGEXP_OK) &&
  ------------------
  |  |   11|  62.6M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3924:12): [True: 62.6M, False: 2.43k]
  ------------------
 3925|  62.6M|	   ((value != NULL) ||
  ------------------
  |  Branch (3925:6): [True: 62.3M, False: 237k]
  ------------------
 3926|   237k|	    ((final == 1) &&
  ------------------
  |  Branch (3926:7): [True: 198k, False: 39.3k]
  ------------------
 3927|  62.5M|	     (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
  ------------------
  |  Branch (3927:7): [True: 198k, False: 39]
  ------------------
 3928|       |
 3929|       |	/*
 3930|       |	 * End of input on non-terminal state, rollback, however we may
 3931|       |	 * still have epsilon like transition for counted transitions
 3932|       |	 * on counters, in that case don't break too early.
 3933|       |	 */
 3934|  62.5M|	if ((value == NULL) && (exec->counts == NULL))
  ------------------
  |  Branch (3934:6): [True: 198k, False: 62.3M]
  |  Branch (3934:25): [True: 198k, False: 0]
  ------------------
 3935|   198k|	    goto rollback;
 3936|       |
 3937|  62.3M|	exec->transcount = 0;
 3938|   124M|	for (;exec->transno < exec->state->nbTrans;exec->transno++) {
  ------------------
  |  Branch (3938:8): [True: 93.5M, False: 31.0M]
  ------------------
 3939|  93.5M|	    trans = &exec->state->trans[exec->transno];
 3940|  93.5M|	    if (trans->to < 0)
  ------------------
  |  Branch (3940:10): [True: 31.1M, False: 62.4M]
  ------------------
 3941|  31.1M|		continue;
 3942|  62.4M|	    atom = trans->atom;
 3943|  62.4M|	    ret = 0;
 3944|  62.4M|	    if (trans->count == REGEXP_ALL_LAX_COUNTER) {
  ------------------
  |  |  408|  62.4M|#define REGEXP_ALL_LAX_COUNTER	0x123457
  ------------------
  |  Branch (3944:10): [True: 0, False: 62.4M]
  ------------------
 3945|      0|		int i;
 3946|      0|		int count;
 3947|      0|		xmlRegTransPtr t;
 3948|      0|		xmlRegCounterPtr counter;
 3949|       |
 3950|      0|		ret = 0;
 3951|       |
 3952|       |		/*
 3953|       |		 * Check all counted transitions from the current state
 3954|       |		 */
 3955|      0|		if ((value == NULL) && (final)) {
  ------------------
  |  Branch (3955:7): [True: 0, False: 0]
  |  Branch (3955:26): [True: 0, False: 0]
  ------------------
 3956|      0|		    ret = 1;
 3957|      0|		} else if (value != NULL) {
  ------------------
  |  Branch (3957:14): [True: 0, False: 0]
  ------------------
 3958|      0|		    for (i = 0;i < exec->state->nbTrans;i++) {
  ------------------
  |  Branch (3958:18): [True: 0, False: 0]
  ------------------
 3959|      0|			t = &exec->state->trans[i];
 3960|      0|			if ((t->counter < 0) || (t == trans))
  ------------------
  |  Branch (3960:8): [True: 0, False: 0]
  |  Branch (3960:28): [True: 0, False: 0]
  ------------------
 3961|      0|			    continue;
 3962|      0|			counter = &exec->comp->counters[t->counter];
 3963|      0|			count = exec->counts[t->counter];
 3964|      0|			if ((count < counter->max) &&
  ------------------
  |  Branch (3964:8): [True: 0, False: 0]
  ------------------
 3965|      0|		            (t->atom != NULL) &&
  ------------------
  |  Branch (3965:15): [True: 0, False: 0]
  ------------------
 3966|      0|			    (xmlStrEqual(value, t->atom->valuep))) {
  ------------------
  |  Branch (3966:8): [True: 0, False: 0]
  ------------------
 3967|      0|			    ret = 0;
 3968|      0|			    break;
 3969|      0|			}
 3970|      0|			if ((count >= counter->min) &&
  ------------------
  |  Branch (3970:8): [True: 0, False: 0]
  ------------------
 3971|      0|			    (count < counter->max) &&
  ------------------
  |  Branch (3971:8): [True: 0, False: 0]
  ------------------
 3972|      0|			    (t->atom != NULL) &&
  ------------------
  |  Branch (3972:8): [True: 0, False: 0]
  ------------------
 3973|      0|			    (xmlStrEqual(value, t->atom->valuep))) {
  ------------------
  |  Branch (3973:8): [True: 0, False: 0]
  ------------------
 3974|      0|			    ret = 1;
 3975|      0|			    break;
 3976|      0|			}
 3977|      0|		    }
 3978|      0|		}
 3979|  62.4M|	    } else if (trans->count == REGEXP_ALL_COUNTER) {
  ------------------
  |  |  407|  62.4M|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (3979:17): [True: 0, False: 62.4M]
  ------------------
 3980|      0|		int i;
 3981|      0|		int count;
 3982|      0|		xmlRegTransPtr t;
 3983|      0|		xmlRegCounterPtr counter;
 3984|       |
 3985|      0|		ret = 1;
 3986|       |
 3987|       |		/*
 3988|       |		 * Check all counted transitions from the current state
 3989|       |		 */
 3990|      0|		for (i = 0;i < exec->state->nbTrans;i++) {
  ------------------
  |  Branch (3990:14): [True: 0, False: 0]
  ------------------
 3991|      0|                    t = &exec->state->trans[i];
 3992|      0|		    if ((t->counter < 0) || (t == trans))
  ------------------
  |  Branch (3992:11): [True: 0, False: 0]
  |  Branch (3992:31): [True: 0, False: 0]
  ------------------
 3993|      0|			continue;
 3994|      0|                    counter = &exec->comp->counters[t->counter];
 3995|      0|		    count = exec->counts[t->counter];
 3996|      0|		    if ((count < counter->min) || (count > counter->max)) {
  ------------------
  |  Branch (3996:11): [True: 0, False: 0]
  |  Branch (3996:37): [True: 0, False: 0]
  ------------------
 3997|      0|			ret = 0;
 3998|      0|			break;
 3999|      0|		    }
 4000|      0|		}
 4001|  62.4M|	    } else if (trans->count >= 0) {
  ------------------
  |  Branch (4001:17): [True: 0, False: 62.4M]
  ------------------
 4002|      0|		int count;
 4003|      0|		xmlRegCounterPtr counter;
 4004|       |
 4005|       |		/*
 4006|       |		 * A counted transition.
 4007|       |		 */
 4008|       |
 4009|      0|		count = exec->counts[trans->count];
 4010|      0|		counter = &exec->comp->counters[trans->count];
 4011|      0|		ret = ((count >= counter->min) && (count <= counter->max));
  ------------------
  |  Branch (4011:10): [True: 0, False: 0]
  |  Branch (4011:37): [True: 0, False: 0]
  ------------------
 4012|  62.4M|	    } else if (atom == NULL) {
  ------------------
  |  Branch (4012:17): [True: 0, False: 62.4M]
  ------------------
 4013|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4014|      0|		break;
 4015|  62.4M|	    } else if (value != NULL) {
  ------------------
  |  Branch (4015:17): [True: 62.4M, False: 0]
  ------------------
 4016|  62.4M|		ret = xmlRegStrEqualWildcard(atom->valuep, value);
 4017|  62.4M|		if (atom->neg) {
  ------------------
  |  Branch (4017:7): [True: 0, False: 62.4M]
  ------------------
 4018|      0|		    ret = !ret;
 4019|      0|		    if (!compound)
  ------------------
  |  Branch (4019:11): [True: 0, False: 0]
  ------------------
 4020|      0|		        ret = 0;
 4021|      0|		}
 4022|  62.4M|		if ((ret == 1) && (trans->counter >= 0)) {
  ------------------
  |  Branch (4022:7): [True: 31.2M, False: 31.1M]
  |  Branch (4022:21): [True: 0, False: 31.2M]
  ------------------
 4023|      0|		    xmlRegCounterPtr counter;
 4024|      0|		    int count;
 4025|       |
 4026|      0|		    count = exec->counts[trans->counter];
 4027|      0|		    counter = &exec->comp->counters[trans->counter];
 4028|      0|		    if (count >= counter->max)
  ------------------
  |  Branch (4028:11): [True: 0, False: 0]
  ------------------
 4029|      0|			ret = 0;
 4030|      0|		}
 4031|       |
 4032|  62.4M|		if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
  ------------------
  |  Branch (4032:7): [True: 31.2M, False: 31.1M]
  |  Branch (4032:21): [True: 0, False: 31.2M]
  |  Branch (4032:40): [True: 0, False: 0]
  ------------------
 4033|      0|		    xmlRegStatePtr to = exec->comp->states[trans->to];
 4034|       |
 4035|       |		    /*
 4036|       |		     * this is a multiple input sequence
 4037|       |		     */
 4038|      0|		    if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4038:11): [True: 0, False: 0]
  ------------------
 4039|      0|			if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4039:8): [True: 0, False: 0]
  ------------------
 4040|      0|			    xmlFARegExecSaveInputString(exec, value, data);
 4041|      0|			}
 4042|      0|			xmlFARegExecSave(exec);
 4043|      0|		    }
 4044|      0|		    exec->transcount = 1;
 4045|      0|		    do {
 4046|       |			/*
 4047|       |			 * Try to progress as much as possible on the input
 4048|       |			 */
 4049|      0|			if (exec->transcount == atom->max) {
  ------------------
  |  Branch (4049:8): [True: 0, False: 0]
  ------------------
 4050|      0|			    break;
 4051|      0|			}
 4052|      0|			exec->index++;
 4053|      0|			value = exec->inputStack[exec->index].value;
 4054|      0|			data = exec->inputStack[exec->index].data;
 4055|       |
 4056|       |			/*
 4057|       |			 * End of input: stop here
 4058|       |			 */
 4059|      0|			if (value == NULL) {
  ------------------
  |  Branch (4059:8): [True: 0, False: 0]
  ------------------
 4060|      0|			    exec->index --;
 4061|      0|			    break;
 4062|      0|			}
 4063|      0|			if (exec->transcount >= atom->min) {
  ------------------
  |  Branch (4063:8): [True: 0, False: 0]
  ------------------
 4064|      0|			    int transno = exec->transno;
 4065|      0|			    xmlRegStatePtr state = exec->state;
 4066|       |
 4067|       |			    /*
 4068|       |			     * The transition is acceptable save it
 4069|       |			     */
 4070|      0|			    exec->transno = -1; /* trick */
 4071|      0|			    exec->state = to;
 4072|      0|			    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4072:12): [True: 0, False: 0]
  ------------------
 4073|      0|				xmlFARegExecSaveInputString(exec, value, data);
 4074|      0|			    }
 4075|      0|			    xmlFARegExecSave(exec);
 4076|      0|			    exec->transno = transno;
 4077|      0|			    exec->state = state;
 4078|      0|			}
 4079|      0|			ret = xmlStrEqual(value, atom->valuep);
 4080|      0|			exec->transcount++;
 4081|      0|		    } while (ret == 1);
  ------------------
  |  Branch (4081:16): [True: 0, False: 0]
  ------------------
 4082|      0|		    if (exec->transcount < atom->min)
  ------------------
  |  Branch (4082:11): [True: 0, False: 0]
  ------------------
 4083|      0|			ret = 0;
 4084|       |
 4085|       |		    /*
 4086|       |		     * If the last check failed but one transition was found
 4087|       |		     * possible, rollback
 4088|       |		     */
 4089|      0|		    if (ret < 0)
  ------------------
  |  Branch (4089:11): [True: 0, False: 0]
  ------------------
 4090|      0|			ret = 0;
 4091|      0|		    if (ret == 0) {
  ------------------
  |  Branch (4091:11): [True: 0, False: 0]
  ------------------
 4092|      0|			goto rollback;
 4093|      0|		    }
 4094|      0|		}
 4095|  62.4M|	    }
 4096|  62.4M|	    if (ret == 1) {
  ------------------
  |  Branch (4096:10): [True: 31.2M, False: 31.1M]
  ------------------
 4097|  31.2M|		if ((exec->callback != NULL) && (atom != NULL) &&
  ------------------
  |  Branch (4097:7): [True: 0, False: 31.2M]
  |  Branch (4097:35): [True: 0, False: 0]
  ------------------
 4098|      0|			(data != NULL)) {
  ------------------
  |  Branch (4098:4): [True: 0, False: 0]
  ------------------
 4099|      0|		    exec->callback(exec->data, atom->valuep,
 4100|      0|			           atom->data, data);
 4101|      0|		}
 4102|  31.2M|		if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4102:7): [True: 31.2M, False: 29.1k]
  ------------------
 4103|  31.2M|		    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4103:11): [True: 990, False: 31.2M]
  ------------------
 4104|    990|			xmlFARegExecSaveInputString(exec, value, data);
 4105|    990|		    }
 4106|  31.2M|		    xmlFARegExecSave(exec);
 4107|  31.2M|		}
 4108|  31.2M|		if (trans->counter >= 0) {
  ------------------
  |  Branch (4108:7): [True: 0, False: 31.2M]
  ------------------
 4109|      0|		    exec->counts[trans->counter]++;
 4110|      0|		}
 4111|  31.2M|		if ((trans->count >= 0) &&
  ------------------
  |  Branch (4111:7): [True: 0, False: 31.2M]
  ------------------
 4112|      0|		    (trans->count < REGEXP_ALL_COUNTER)) {
  ------------------
  |  |  407|      0|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (4112:7): [True: 0, False: 0]
  ------------------
 4113|      0|		    exec->counts[trans->count] = 0;
 4114|      0|		}
 4115|  31.2M|                if ((exec->comp->states[trans->to] != NULL) &&
  ------------------
  |  Branch (4115:21): [True: 31.2M, False: 0]
  ------------------
 4116|  31.2M|		    (exec->comp->states[trans->to]->type ==
  ------------------
  |  Branch (4116:7): [True: 0, False: 31.2M]
  ------------------
 4117|  31.2M|		     XML_REGEXP_SINK_STATE)) {
 4118|       |		    /*
 4119|       |		     * entering a sink state, save the current state as error
 4120|       |		     * state.
 4121|       |		     */
 4122|      0|                    if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4122:25): [True: 0, False: 0]
  ------------------
 4123|      0|                        break;
 4124|      0|		    exec->errState = exec->state;
 4125|      0|		    memcpy(exec->errCounts, exec->counts,
 4126|      0|			   exec->comp->nbCounters * sizeof(int));
 4127|      0|		}
 4128|  31.2M|		exec->state = exec->comp->states[trans->to];
 4129|  31.2M|		exec->transno = 0;
 4130|  31.2M|		if (trans->atom != NULL) {
  ------------------
  |  Branch (4130:7): [True: 31.2M, False: 0]
  ------------------
 4131|  31.2M|		    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (4131:11): [True: 31.2M, False: 159]
  ------------------
 4132|  31.2M|			exec->index++;
 4133|  31.2M|			if (exec->index < exec->inputStackNr) {
  ------------------
  |  Branch (4133:8): [True: 31.0M, False: 237k]
  ------------------
 4134|  31.0M|			    value = exec->inputStack[exec->index].value;
 4135|  31.0M|			    data = exec->inputStack[exec->index].data;
 4136|  31.0M|			} else {
 4137|   237k|			    value = NULL;
 4138|   237k|			    data = NULL;
 4139|   237k|			}
 4140|  31.2M|		    } else {
 4141|    159|			value = NULL;
 4142|    159|			data = NULL;
 4143|    159|		    }
 4144|  31.2M|		}
 4145|  31.2M|		goto progress;
 4146|  31.2M|	    } else if (ret < 0) {
  ------------------
  |  Branch (4146:17): [True: 0, False: 31.1M]
  ------------------
 4147|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4148|      0|		break;
 4149|      0|	    }
 4150|  62.4M|	}
 4151|  31.0M|	if ((exec->transno != 0) || (exec->state->nbTrans == 0)) {
  ------------------
  |  Branch (4151:6): [True: 31.0M, False: 339]
  |  Branch (4151:30): [True: 339, False: 0]
  ------------------
 4152|  31.2M|rollback:
 4153|       |            /*
 4154|       |	     * if we didn't yet rollback on the current input
 4155|       |	     * store the current state as the error state.
 4156|       |	     */
 4157|  31.2M|	    if ((progress) && (exec->state != NULL) &&
  ------------------
  |  Branch (4157:10): [True: 300k, False: 30.9M]
  |  Branch (4157:24): [True: 300k, False: 0]
  ------------------
 4158|   300k|	        (exec->state->type != XML_REGEXP_SINK_STATE)) {
  ------------------
  |  Branch (4158:10): [True: 300k, False: 0]
  ------------------
 4159|   300k|	        progress = 0;
 4160|   300k|                if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4160:21): [True: 4, False: 300k]
  ------------------
 4161|      4|                    break;
 4162|   300k|		exec->errState = exec->state;
 4163|   300k|                if (exec->comp->nbCounters)
  ------------------
  |  Branch (4163:21): [True: 0, False: 300k]
  ------------------
 4164|      0|                    memcpy(exec->errCounts, exec->counts,
 4165|      0|                           exec->comp->nbCounters * sizeof(int));
 4166|   300k|	    }
 4167|       |
 4168|       |	    /*
 4169|       |	     * Failed to find a way out
 4170|       |	     */
 4171|  31.2M|	    exec->determinist = 0;
 4172|  31.2M|	    xmlFARegExecRollBack(exec);
 4173|  31.2M|	    if ((exec->inputStack != NULL ) &&
  ------------------
  |  Branch (4173:10): [True: 31.2M, False: 1.60k]
  ------------------
 4174|  31.2M|                (exec->status == XML_REGEXP_OK)) {
  ------------------
  |  |   11|  31.2M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4174:17): [True: 31.2M, False: 822]
  ------------------
 4175|  31.2M|		value = exec->inputStack[exec->index].value;
 4176|  31.2M|		data = exec->inputStack[exec->index].data;
 4177|  31.2M|	    }
 4178|  31.2M|	}
 4179|  31.2M|	continue;
 4180|  31.2M|progress:
 4181|  31.2M|        progress = 1;
 4182|  31.2M|    }
 4183|  41.8k|    if (exec->status == XML_REGEXP_OK) {
  ------------------
  |  |   11|  41.8k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4183:9): [True: 39.3k, False: 2.44k]
  ------------------
 4184|  39.3k|        return(exec->state->type == XML_REGEXP_FINAL_STATE);
 4185|  39.3k|    }
 4186|  2.44k|    return(exec->status);
 4187|  41.8k|}
xmlregexp.c:xmlFARegExecSaveInputString:
 3727|  39.8k|	                    void *data) {
 3728|  39.8k|    if (exec->inputStackNr + 1 >= exec->inputStackMax) {
  ------------------
  |  Branch (3728:9): [True: 3.20k, False: 36.6k]
  ------------------
 3729|  3.20k|	xmlRegInputTokenPtr tmp;
 3730|  3.20k|        int newSize;
 3731|       |
 3732|  3.20k|        newSize = xmlGrowCapacity(exec->inputStackMax, sizeof(tmp[0]),
 3733|  3.20k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  3.20k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3734|  3.20k|	if (newSize < 0) {
  ------------------
  |  Branch (3734:6): [True: 0, False: 3.20k]
  ------------------
 3735|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3736|      0|	    return;
 3737|      0|	}
 3738|  3.20k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3739|  3.20k|        if (newSize < 2)
  ------------------
  |  Branch (3739:13): [True: 990, False: 2.21k]
  ------------------
 3740|    990|            newSize = 2;
 3741|  3.20k|#endif
 3742|  3.20k|	tmp = xmlRealloc(exec->inputStack, newSize * sizeof(tmp[0]));
 3743|  3.20k|	if (tmp == NULL) {
  ------------------
  |  Branch (3743:6): [True: 1, False: 3.20k]
  ------------------
 3744|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3745|      1|	    return;
 3746|      1|	}
 3747|  3.20k|	exec->inputStack = tmp;
 3748|  3.20k|	exec->inputStackMax = newSize;
 3749|  3.20k|    }
 3750|  39.8k|    if (value == NULL) {
  ------------------
  |  Branch (3750:9): [True: 0, False: 39.8k]
  ------------------
 3751|      0|        exec->inputStack[exec->inputStackNr].value = NULL;
 3752|  39.8k|    } else {
 3753|  39.8k|        exec->inputStack[exec->inputStackNr].value = xmlStrdup(value);
 3754|  39.8k|        if (exec->inputStack[exec->inputStackNr].value == NULL) {
  ------------------
  |  Branch (3754:13): [True: 2, False: 39.8k]
  ------------------
 3755|      2|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      2|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3756|      2|            return;
 3757|      2|        }
 3758|  39.8k|    }
 3759|  39.8k|    exec->inputStack[exec->inputStackNr].data = data;
 3760|  39.8k|    exec->inputStackNr++;
 3761|  39.8k|    exec->inputStack[exec->inputStackNr].value = NULL;
 3762|       |    exec->inputStack[exec->inputStackNr].data = NULL;
 3763|  39.8k|}
xmlregexp.c:xmlRegStrEqualWildcard:
 3777|   107M|xmlRegStrEqualWildcard(const xmlChar *expStr, const xmlChar *valStr) {
 3778|   107M|    if (expStr == valStr) return(1);
  ------------------
  |  Branch (3778:9): [True: 0, False: 107M]
  ------------------
 3779|   107M|    if (expStr == NULL) return(0);
  ------------------
  |  Branch (3779:9): [True: 0, False: 107M]
  ------------------
 3780|   107M|    if (valStr == NULL) return(0);
  ------------------
  |  Branch (3780:9): [True: 0, False: 107M]
  ------------------
 3781|   125M|    do {
 3782|       |	/*
 3783|       |	* Eval if we have a wildcard for the current item.
 3784|       |	*/
 3785|   125M|        if (*expStr != *valStr) {
  ------------------
  |  Branch (3785:13): [True: 65.7M, False: 59.7M]
  ------------------
 3786|       |	    /* if one of them starts with a wildcard make valStr be it */
 3787|  65.7M|	    if (*valStr == '*') {
  ------------------
  |  Branch (3787:10): [True: 0, False: 65.7M]
  ------------------
 3788|      0|	        const xmlChar *tmp;
 3789|       |
 3790|      0|		tmp = valStr;
 3791|      0|		valStr = expStr;
 3792|      0|		expStr = tmp;
 3793|      0|	    }
 3794|  65.7M|	    if ((*valStr != 0) && (*expStr != 0) && (*expStr++ == '*')) {
  ------------------
  |  Branch (3794:10): [True: 65.7M, False: 0]
  |  Branch (3794:28): [True: 64.6M, False: 1.10M]
  |  Branch (3794:46): [True: 0, False: 64.6M]
  ------------------
 3795|      0|		do {
 3796|      0|		    if (*valStr == XML_REG_STRING_SEPARATOR)
  ------------------
  |  |   58|      0|#define XML_REG_STRING_SEPARATOR '|'
  ------------------
  |  Branch (3796:11): [True: 0, False: 0]
  ------------------
 3797|      0|			break;
 3798|      0|		    valStr++;
 3799|      0|		} while (*valStr != 0);
  ------------------
  |  Branch (3799:12): [True: 0, False: 0]
  ------------------
 3800|      0|		continue;
 3801|      0|	    } else
 3802|  65.7M|		return(0);
 3803|  65.7M|	}
 3804|  59.7M|	expStr++;
 3805|  59.7M|	valStr++;
 3806|  59.7M|    } while (*valStr != 0);
  ------------------
  |  Branch (3806:14): [True: 17.8M, False: 41.9M]
  ------------------
 3807|  41.9M|    if (*expStr != 0)
  ------------------
  |  Branch (3807:9): [True: 1.26M, False: 40.6M]
  ------------------
 3808|  1.26M|	return (0);
 3809|  40.6M|    else
 3810|  40.6M|	return (1);
 3811|  41.9M|}
xmlregexp.c:xmlFARegExecSave:
 3246|  31.2M|xmlFARegExecSave(xmlRegExecCtxtPtr exec) {
 3247|  31.2M|#ifdef MAX_PUSH
 3248|  31.2M|    if (exec->nbPush > MAX_PUSH) {
  ------------------
  |  |   41|  31.2M|#define MAX_PUSH 10000000
  ------------------
  |  Branch (3248:9): [True: 2, False: 31.2M]
  ------------------
 3249|      2|        exec->status = XML_REGEXP_INTERNAL_LIMIT;
  ------------------
  |  |   15|      2|#define XML_REGEXP_INTERNAL_LIMIT   (-6)
  ------------------
 3250|      2|        return;
 3251|      2|    }
 3252|  31.2M|    exec->nbPush++;
 3253|  31.2M|#endif
 3254|       |
 3255|  31.2M|    if (exec->nbRollbacks >= exec->maxRollbacks) {
  ------------------
  |  Branch (3255:9): [True: 3.27k, False: 31.2M]
  ------------------
 3256|  3.27k|	xmlRegExecRollback *tmp;
 3257|  3.27k|        int newSize;
 3258|  3.27k|	int len = exec->nbRollbacks;
 3259|       |
 3260|  3.27k|        newSize = xmlGrowCapacity(exec->maxRollbacks, sizeof(tmp[0]),
 3261|  3.27k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  3.27k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3262|  3.27k|	if (newSize < 0) {
  ------------------
  |  Branch (3262:6): [True: 0, False: 3.27k]
  ------------------
 3263|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3264|      0|	    return;
 3265|      0|	}
 3266|  3.27k|	tmp = xmlRealloc(exec->rollbacks, newSize * sizeof(tmp[0]));
 3267|  3.27k|	if (tmp == NULL) {
  ------------------
  |  Branch (3267:6): [True: 1, False: 3.26k]
  ------------------
 3268|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3269|      1|	    return;
 3270|      1|	}
 3271|  3.26k|	exec->rollbacks = tmp;
 3272|  3.26k|	exec->maxRollbacks = newSize;
 3273|  3.26k|	tmp = &exec->rollbacks[len];
 3274|  3.26k|	memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback));
 3275|  3.26k|    }
 3276|  31.2M|    exec->rollbacks[exec->nbRollbacks].state = exec->state;
 3277|  31.2M|    exec->rollbacks[exec->nbRollbacks].index = exec->index;
 3278|  31.2M|    exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1;
 3279|  31.2M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3279:9): [True: 0, False: 31.2M]
  ------------------
 3280|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3280:6): [True: 0, False: 0]
  ------------------
 3281|      0|	    exec->rollbacks[exec->nbRollbacks].counts = (int *)
 3282|      0|		xmlMalloc(exec->comp->nbCounters * sizeof(int));
 3283|      0|	    if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3283:10): [True: 0, False: 0]
  ------------------
 3284|      0|		exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3285|      0|		return;
 3286|      0|	    }
 3287|      0|	}
 3288|      0|	memcpy(exec->rollbacks[exec->nbRollbacks].counts, exec->counts,
 3289|      0|	       exec->comp->nbCounters * sizeof(int));
 3290|      0|    }
 3291|  31.2M|    exec->nbRollbacks++;
 3292|  31.2M|}
xmlregexp.c:xmlRegExecSetErrString:
 3710|   304k|xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) {
 3711|   304k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3711:9): [True: 100k, False: 204k]
  ------------------
 3712|   100k|        xmlFree(exec->errString);
 3713|   304k|    if (value == NULL) {
  ------------------
  |  Branch (3713:9): [True: 198k, False: 106k]
  ------------------
 3714|   198k|        exec->errString = NULL;
 3715|   198k|    } else {
 3716|   106k|        exec->errString = xmlStrdup(value);
 3717|   106k|        if (exec->errString == NULL) {
  ------------------
  |  Branch (3717:13): [True: 29, False: 106k]
  ------------------
 3718|     29|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|     29|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3719|     29|            return(-1);
 3720|     29|        }
 3721|   106k|    }
 3722|   304k|    return(0);
 3723|   304k|}
xmlregexp.c:xmlFARegExecRollBack:
 3295|  31.2M|xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) {
 3296|  31.2M|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  31.2M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3296:9): [True: 0, False: 31.2M]
  ------------------
 3297|      0|        return;
 3298|  31.2M|    if (exec->nbRollbacks <= 0) {
  ------------------
  |  Branch (3298:9): [True: 2.43k, False: 31.2M]
  ------------------
 3299|  2.43k|	exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  2.43k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3300|  2.43k|	return;
 3301|  2.43k|    }
 3302|  31.2M|    exec->nbRollbacks--;
 3303|  31.2M|    exec->state = exec->rollbacks[exec->nbRollbacks].state;
 3304|  31.2M|    exec->index = exec->rollbacks[exec->nbRollbacks].index;
 3305|  31.2M|    exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch;
 3306|  31.2M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3306:9): [True: 0, False: 31.2M]
  ------------------
 3307|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3307:6): [True: 0, False: 0]
  ------------------
 3308|      0|	    exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 3309|      0|	    return;
 3310|      0|	}
 3311|      0|	if (exec->counts) {
  ------------------
  |  Branch (3311:6): [True: 0, False: 0]
  ------------------
 3312|      0|	    memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts,
 3313|      0|	       exec->comp->nbCounters * sizeof(int));
 3314|      0|	}
 3315|      0|    }
 3316|  31.2M|}
xmlregexp.c:xmlRegCompactPushString:
 3827|  11.3k|	                void *data) {
 3828|  11.3k|    int state = exec->index;
 3829|  11.3k|    int i, target;
 3830|       |
 3831|  11.3k|    if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL))
  ------------------
  |  Branch (3831:9): [True: 0, False: 11.3k]
  |  Branch (3831:27): [True: 0, False: 11.3k]
  |  Branch (3831:54): [True: 0, False: 11.3k]
  ------------------
 3832|      0|	return(-1);
 3833|       |
 3834|  11.3k|    if (value == NULL) {
  ------------------
  |  Branch (3834:9): [True: 5.80k, False: 5.55k]
  ------------------
 3835|       |	/*
 3836|       |	 * are we at a final state ?
 3837|       |	 */
 3838|  5.80k|	if (comp->compact[state * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3838:6): [True: 2.53k, False: 3.26k]
  ------------------
 3839|  5.80k|            XML_REGEXP_FINAL_STATE)
 3840|  2.53k|	    return(1);
 3841|  3.26k|	return(0);
 3842|  5.80k|    }
 3843|       |
 3844|       |    /*
 3845|       |     * Examine all outside transitions from current state
 3846|       |     */
 3847|  18.5k|    for (i = 0;i < comp->nbstrings;i++) {
  ------------------
  |  Branch (3847:16): [True: 14.6k, False: 3.88k]
  ------------------
 3848|  14.6k|	target = comp->compact[state * (comp->nbstrings + 1) + i + 1];
 3849|  14.6k|	if ((target > 0) && (target <= comp->nbstates)) {
  ------------------
  |  Branch (3849:6): [True: 9.29k, False: 5.38k]
  |  Branch (3849:22): [True: 9.29k, False: 0]
  ------------------
 3850|  9.29k|	    target--; /* to avoid 0 */
 3851|  9.29k|	    if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) {
  ------------------
  |  Branch (3851:10): [True: 1.66k, False: 7.62k]
  ------------------
 3852|  1.66k|		exec->index = target;
 3853|  1.66k|		if ((exec->callback != NULL) && (comp->transdata != NULL)) {
  ------------------
  |  Branch (3853:7): [True: 0, False: 1.66k]
  |  Branch (3853:35): [True: 0, False: 0]
  ------------------
 3854|      0|		    exec->callback(exec->data, value,
 3855|      0|			  comp->transdata[state * comp->nbstrings + i], data);
 3856|      0|		}
 3857|  1.66k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3857:7): [True: 0, False: 1.66k]
  ------------------
 3858|  1.66k|		    XML_REGEXP_SINK_STATE)
 3859|      0|		    goto error;
 3860|       |
 3861|  1.66k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3861:7): [True: 1.41k, False: 259]
  ------------------
 3862|  1.66k|		    XML_REGEXP_FINAL_STATE)
 3863|  1.41k|		    return(1);
 3864|    259|		return(0);
 3865|  1.66k|	    }
 3866|  9.29k|	}
 3867|  14.6k|    }
 3868|       |    /*
 3869|       |     * Failed to find an exit transition out from current state for the
 3870|       |     * current token
 3871|       |     */
 3872|  3.88k|error:
 3873|  3.88k|    exec->errStateNo = state;
 3874|  3.88k|    exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  3.88k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3875|  3.88k|    xmlRegExecSetErrString(exec, value);
 3876|  3.88k|    return(exec->status);
 3877|  5.55k|}
xmlregexp.c:xmlRegNewParserCtxt:
  734|  3.57k|xmlRegNewParserCtxt(const xmlChar *string) {
  735|  3.57k|    xmlRegParserCtxtPtr ret;
  736|       |
  737|  3.57k|    ret = (xmlRegParserCtxtPtr) xmlMalloc(sizeof(xmlRegParserCtxt));
  738|  3.57k|    if (ret == NULL)
  ------------------
  |  Branch (738:9): [True: 12, False: 3.56k]
  ------------------
  739|     12|	return(NULL);
  740|  3.56k|    memset(ret, 0, sizeof(xmlRegParserCtxt));
  741|  3.56k|    if (string != NULL) {
  ------------------
  |  Branch (741:9): [True: 0, False: 3.56k]
  ------------------
  742|      0|        ret->string = xmlStrdup(string);
  743|      0|        if (ret->string == NULL) {
  ------------------
  |  Branch (743:13): [True: 0, False: 0]
  ------------------
  744|      0|            xmlFree(ret);
  745|      0|            return(NULL);
  746|      0|        }
  747|      0|        ret->len = strlen((const char *) ret->string);
  748|      0|    }
  749|  3.56k|    ret->cur = ret->string;
  750|  3.56k|    ret->neg = 0;
  751|  3.56k|    ret->negs = 0;
  752|  3.56k|    ret->error = 0;
  753|  3.56k|    ret->determinist = -1;
  754|  3.56k|    return(ret);
  755|  3.56k|}
xmlregexp.c:xmlRegStatePush:
 1583|   716k|xmlRegStatePush(xmlRegParserCtxtPtr ctxt) {
 1584|   716k|    xmlRegStatePtr state;
 1585|       |
 1586|   716k|    if (ctxt->nbStates >= ctxt->maxStates) {
  ------------------
  |  Branch (1586:9): [True: 14.2k, False: 701k]
  ------------------
 1587|  14.2k|	xmlRegStatePtr *tmp;
 1588|  14.2k|        int newSize;
 1589|       |
 1590|  14.2k|        newSize = xmlGrowCapacity(ctxt->maxStates, sizeof(tmp[0]),
 1591|  14.2k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  14.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1592|  14.2k|	if (newSize < 0) {
  ------------------
  |  Branch (1592:6): [True: 0, False: 14.2k]
  ------------------
 1593|      0|	    xmlRegexpErrMemory(ctxt);
 1594|      0|	    return(NULL);
 1595|      0|	}
 1596|  14.2k|	tmp = xmlRealloc(ctxt->states, newSize * sizeof(tmp[0]));
 1597|  14.2k|	if (tmp == NULL) {
  ------------------
  |  Branch (1597:6): [True: 39, False: 14.2k]
  ------------------
 1598|     39|	    xmlRegexpErrMemory(ctxt);
 1599|     39|	    return(NULL);
 1600|     39|	}
 1601|  14.2k|	ctxt->states = tmp;
 1602|  14.2k|	ctxt->maxStates = newSize;
 1603|  14.2k|    }
 1604|       |
 1605|   716k|    state = xmlRegNewState(ctxt);
 1606|   716k|    if (state == NULL)
  ------------------
  |  Branch (1606:9): [True: 76, False: 716k]
  ------------------
 1607|     76|        return(NULL);
 1608|       |
 1609|   716k|    state->no = ctxt->nbStates;
 1610|   716k|    ctxt->states[ctxt->nbStates++] = state;
 1611|       |
 1612|   716k|    return(state);
 1613|   716k|}
xmlregexp.c:xmlRegNewState:
  924|   716k|xmlRegNewState(xmlRegParserCtxtPtr ctxt) {
  925|   716k|    xmlRegStatePtr ret;
  926|       |
  927|   716k|    ret = (xmlRegStatePtr) xmlMalloc(sizeof(xmlRegState));
  928|   716k|    if (ret == NULL) {
  ------------------
  |  Branch (928:9): [True: 76, False: 716k]
  ------------------
  929|     76|	xmlRegexpErrMemory(ctxt);
  930|     76|	return(NULL);
  931|     76|    }
  932|   716k|    memset(ret, 0, sizeof(xmlRegState));
  933|   716k|    ret->type = XML_REGEXP_TRANS_STATE;
  934|   716k|    ret->mark = XML_REGEXP_MARK_NORMAL;
  935|   716k|    return(ret);
  936|   716k|}
xmlregexp.c:xmlFAEliminateEpsilonTransitions:
 2081|  1.66k|xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2082|  1.66k|    int statenr, transnr;
 2083|  1.66k|    xmlRegStatePtr state;
 2084|  1.66k|    int has_epsilon;
 2085|       |
 2086|  1.66k|    if (ctxt->states == NULL) return;
  ------------------
  |  Branch (2086:9): [True: 0, False: 1.66k]
  ------------------
 2087|       |
 2088|       |    /*
 2089|       |     * Eliminate simple epsilon transition and the associated unreachable
 2090|       |     * states.
 2091|       |     */
 2092|  1.66k|    xmlFAEliminateSimpleEpsilonTransitions(ctxt);
 2093|   438k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2093:22): [True: 436k, False: 1.66k]
  ------------------
 2094|   436k|	state = ctxt->states[statenr];
 2095|   436k|	if ((state != NULL) && (state->type == XML_REGEXP_UNREACH_STATE)) {
  ------------------
  |  Branch (2095:6): [True: 436k, False: 0]
  |  Branch (2095:25): [True: 161k, False: 274k]
  ------------------
 2096|   161k|	    xmlRegFreeState(state);
 2097|   161k|	    ctxt->states[statenr] = NULL;
 2098|   161k|	}
 2099|   436k|    }
 2100|       |
 2101|  1.66k|    has_epsilon = 0;
 2102|       |
 2103|       |    /*
 2104|       |     * Build the completed transitions bypassing the epsilons
 2105|       |     * Use a marking algorithm to avoid loops
 2106|       |     * Mark sink states too.
 2107|       |     * Process from the latest states backward to the start when
 2108|       |     * there is long cascading epsilon chains this minimize the
 2109|       |     * recursions and transition compares when adding the new ones
 2110|       |     */
 2111|   438k|    for (statenr = ctxt->nbStates - 1;statenr >= 0;statenr--) {
  ------------------
  |  Branch (2111:39): [True: 436k, False: 1.66k]
  ------------------
 2112|   436k|	state = ctxt->states[statenr];
 2113|   436k|	if (state == NULL)
  ------------------
  |  Branch (2113:6): [True: 161k, False: 274k]
  ------------------
 2114|   161k|	    continue;
 2115|   274k|	if ((state->nbTrans == 0) &&
  ------------------
  |  Branch (2115:6): [True: 1.40k, False: 273k]
  ------------------
 2116|  1.40k|	    (state->type != XML_REGEXP_FINAL_STATE)) {
  ------------------
  |  Branch (2116:6): [True: 0, False: 1.40k]
  ------------------
 2117|      0|	    state->type = XML_REGEXP_SINK_STATE;
 2118|      0|	}
 2119|  2.76M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2119:19): [True: 2.49M, False: 274k]
  ------------------
 2120|  2.49M|	    if ((state->trans[transnr].atom == NULL) &&
  ------------------
  |  Branch (2120:10): [True: 323k, False: 2.16M]
  ------------------
 2121|   323k|		(state->trans[transnr].to >= 0)) {
  ------------------
  |  Branch (2121:3): [True: 190k, False: 132k]
  ------------------
 2122|   190k|		if (state->trans[transnr].to == statenr) {
  ------------------
  |  Branch (2122:7): [True: 0, False: 190k]
  ------------------
 2123|      0|		    state->trans[transnr].to = -1;
 2124|   190k|		} else if (state->trans[transnr].count < 0) {
  ------------------
  |  Branch (2124:14): [True: 190k, False: 0]
  ------------------
 2125|   190k|		    int newto = state->trans[transnr].to;
 2126|       |
 2127|   190k|		    has_epsilon = 1;
 2128|   190k|		    state->trans[transnr].to = -2;
 2129|   190k|		    state->mark = XML_REGEXP_MARK_START;
 2130|   190k|		    xmlFAReduceEpsilonTransitions(ctxt, statenr,
 2131|   190k|				      newto, state->trans[transnr].counter);
 2132|   190k|		    xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
 2133|   190k|		    state->mark = XML_REGEXP_MARK_NORMAL;
 2134|   190k|	        }
 2135|   190k|	    }
 2136|  2.49M|	}
 2137|   274k|    }
 2138|       |    /*
 2139|       |     * Eliminate the epsilon transitions
 2140|       |     */
 2141|  1.66k|    if (has_epsilon) {
  ------------------
  |  Branch (2141:9): [True: 1.28k, False: 387]
  ------------------
 2142|   436k|	for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2142:19): [True: 435k, False: 1.28k]
  ------------------
 2143|   435k|	    state = ctxt->states[statenr];
 2144|   435k|	    if (state == NULL)
  ------------------
  |  Branch (2144:10): [True: 161k, False: 273k]
  ------------------
 2145|   161k|		continue;
 2146|  2.76M|	    for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2146:23): [True: 2.49M, False: 273k]
  ------------------
 2147|  2.49M|		xmlRegTransPtr trans = &(state->trans[transnr]);
 2148|  2.49M|		if ((trans->atom == NULL) &&
  ------------------
  |  Branch (2148:7): [True: 323k, False: 2.16M]
  ------------------
 2149|   323k|		    (trans->count < 0) &&
  ------------------
  |  Branch (2149:7): [True: 323k, False: 0]
  ------------------
 2150|   323k|		    (trans->to >= 0)) {
  ------------------
  |  Branch (2150:7): [True: 0, False: 323k]
  ------------------
 2151|      0|		    trans->to = -1;
 2152|      0|		}
 2153|  2.49M|	    }
 2154|   273k|	}
 2155|  1.28k|    }
 2156|       |
 2157|       |    /*
 2158|       |     * Use this pass to detect unreachable states too
 2159|       |     */
 2160|   438k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2160:22): [True: 436k, False: 1.66k]
  ------------------
 2161|   436k|	state = ctxt->states[statenr];
 2162|   436k|	if (state != NULL)
  ------------------
  |  Branch (2162:6): [True: 274k, False: 161k]
  ------------------
 2163|   274k|	    state->reached = XML_REGEXP_MARK_NORMAL;
 2164|   436k|    }
 2165|  1.66k|    state = ctxt->states[0];
 2166|  1.66k|    if (state != NULL)
  ------------------
  |  Branch (2166:9): [True: 1.66k, False: 0]
  ------------------
 2167|  1.66k|	state->reached = XML_REGEXP_MARK_START;
 2168|   228k|    while (state != NULL) {
  ------------------
  |  Branch (2168:12): [True: 227k, False: 1.66k]
  ------------------
 2169|   227k|	xmlRegStatePtr target = NULL;
 2170|   227k|	state->reached = XML_REGEXP_MARK_VISITED;
 2171|       |	/*
 2172|       |	 * Mark all states reachable from the current reachable state
 2173|       |	 */
 2174|  2.28M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2174:19): [True: 2.06M, False: 227k]
  ------------------
 2175|  2.06M|	    if ((state->trans[transnr].to >= 0) &&
  ------------------
  |  Branch (2175:10): [True: 1.76M, False: 296k]
  ------------------
 2176|  1.76M|		((state->trans[transnr].atom != NULL) ||
  ------------------
  |  Branch (2176:4): [True: 1.76M, False: 0]
  ------------------
 2177|  1.76M|		 (state->trans[transnr].count >= 0))) {
  ------------------
  |  Branch (2177:4): [True: 0, False: 0]
  ------------------
 2178|  1.76M|		int newto = state->trans[transnr].to;
 2179|       |
 2180|  1.76M|		if (ctxt->states[newto] == NULL)
  ------------------
  |  Branch (2180:7): [True: 1, False: 1.76M]
  ------------------
 2181|      1|		    continue;
 2182|  1.76M|		if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
  ------------------
  |  Branch (2182:7): [True: 225k, False: 1.54M]
  ------------------
 2183|   225k|		    ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
 2184|   225k|		    target = ctxt->states[newto];
 2185|   225k|		}
 2186|  1.76M|	    }
 2187|  2.06M|	}
 2188|       |
 2189|       |	/*
 2190|       |	 * find the next accessible state not explored
 2191|       |	 */
 2192|   227k|	if (target == NULL) {
  ------------------
  |  Branch (2192:6): [True: 93.8k, False: 133k]
  ------------------
 2193|   630M|	    for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2193:23): [True: 630M, False: 1.66k]
  ------------------
 2194|   630M|		state = ctxt->states[statenr];
 2195|   630M|		if ((state != NULL) && (state->reached ==
  ------------------
  |  Branch (2195:7): [True: 331M, False: 298M]
  |  Branch (2195:26): [True: 92.1k, False: 331M]
  ------------------
 2196|   331M|			XML_REGEXP_MARK_START)) {
 2197|  92.1k|		    target = state;
 2198|  92.1k|		    break;
 2199|  92.1k|		}
 2200|   630M|	    }
 2201|  93.8k|	}
 2202|   227k|	state = target;
 2203|   227k|    }
 2204|   438k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2204:22): [True: 436k, False: 1.66k]
  ------------------
 2205|   436k|	state = ctxt->states[statenr];
 2206|   436k|	if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
  ------------------
  |  Branch (2206:6): [True: 274k, False: 161k]
  |  Branch (2206:25): [True: 47.5k, False: 227k]
  ------------------
 2207|  47.5k|	    xmlRegFreeState(state);
 2208|  47.5k|	    ctxt->states[statenr] = NULL;
 2209|  47.5k|	}
 2210|   436k|    }
 2211|       |
 2212|  1.66k|}
xmlregexp.c:xmlFAEliminateSimpleEpsilonTransitions:
 2030|  1.66k|xmlFAEliminateSimpleEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2031|  1.66k|    int statenr, i, j, newto;
 2032|  1.66k|    xmlRegStatePtr state, tmp;
 2033|       |
 2034|   438k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2034:22): [True: 436k, False: 1.66k]
  ------------------
 2035|   436k|	state = ctxt->states[statenr];
 2036|   436k|	if (state == NULL)
  ------------------
  |  Branch (2036:6): [True: 0, False: 436k]
  ------------------
 2037|      0|	    continue;
 2038|   436k|	if (state->nbTrans != 1)
  ------------------
  |  Branch (2038:6): [True: 184k, False: 251k]
  ------------------
 2039|   184k|	    continue;
 2040|   251k|       if (state->type == XML_REGEXP_UNREACH_STATE ||
  ------------------
  |  Branch (2040:12): [True: 0, False: 251k]
  ------------------
 2041|   251k|           state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2041:12): [True: 263, False: 251k]
  ------------------
 2042|    263|	    continue;
 2043|       |	/* is the only transition out a basic transition */
 2044|   251k|	if ((state->trans[0].atom == NULL) &&
  ------------------
  |  Branch (2044:6): [True: 162k, False: 88.4k]
  ------------------
 2045|   162k|	    (state->trans[0].to >= 0) &&
  ------------------
  |  Branch (2045:6): [True: 162k, False: 9]
  ------------------
 2046|   162k|	    (state->trans[0].to != statenr) &&
  ------------------
  |  Branch (2046:6): [True: 162k, False: 0]
  ------------------
 2047|   162k|	    (state->trans[0].counter < 0) &&
  ------------------
  |  Branch (2047:6): [True: 162k, False: 0]
  ------------------
 2048|   162k|	    (state->trans[0].count < 0)) {
  ------------------
  |  Branch (2048:6): [True: 162k, False: 0]
  ------------------
 2049|   162k|	    newto = state->trans[0].to;
 2050|       |
 2051|   162k|            if (state->type == XML_REGEXP_START_STATE) {
  ------------------
  |  Branch (2051:17): [True: 849, False: 161k]
  ------------------
 2052|   161k|            } else {
 2053|   424k|	        for (i = 0;i < state->nbTransTo;i++) {
  ------------------
  |  Branch (2053:21): [True: 262k, False: 161k]
  ------------------
 2054|   262k|		    tmp = ctxt->states[state->transTo[i]];
 2055|  30.6M|		    for (j = 0;j < tmp->nbTrans;j++) {
  ------------------
  |  Branch (2055:18): [True: 30.3M, False: 262k]
  ------------------
 2056|  30.3M|			if (tmp->trans[j].to == statenr) {
  ------------------
  |  Branch (2056:8): [True: 249k, False: 30.1M]
  ------------------
 2057|   249k|			    tmp->trans[j].to = -1;
 2058|   249k|			    xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom,
 2059|   249k|						ctxt->states[newto],
 2060|   249k|					        tmp->trans[j].counter,
 2061|   249k|						tmp->trans[j].count);
 2062|   249k|			}
 2063|  30.3M|		    }
 2064|   262k|		}
 2065|   161k|		if (state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2065:7): [True: 0, False: 161k]
  ------------------
 2066|      0|		    ctxt->states[newto]->type = XML_REGEXP_FINAL_STATE;
 2067|       |		/* eliminate the transition completely */
 2068|   161k|		state->nbTrans = 0;
 2069|       |
 2070|   161k|                state->type = XML_REGEXP_UNREACH_STATE;
 2071|       |
 2072|   161k|	    }
 2073|       |
 2074|   162k|	}
 2075|   251k|    }
 2076|  1.66k|}
xmlregexp.c:xmlFAReduceEpsilonTransitions:
 1933|   345k|	                      int tonr, int counter) {
 1934|   345k|    int transnr;
 1935|   345k|    xmlRegStatePtr from;
 1936|   345k|    xmlRegStatePtr to;
 1937|       |
 1938|   345k|    from = ctxt->states[fromnr];
 1939|   345k|    if (from == NULL)
  ------------------
  |  Branch (1939:9): [True: 0, False: 345k]
  ------------------
 1940|      0|	return;
 1941|   345k|    to = ctxt->states[tonr];
 1942|   345k|    if (to == NULL)
  ------------------
  |  Branch (1942:9): [True: 81, False: 345k]
  ------------------
 1943|     81|	return;
 1944|   345k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1944:9): [True: 0, False: 345k]
  ------------------
 1945|   345k|	(to->mark == XML_REGEXP_MARK_VISITED))
  ------------------
  |  Branch (1945:2): [True: 41.7k, False: 303k]
  ------------------
 1946|  41.7k|	return;
 1947|       |
 1948|   303k|    to->mark = XML_REGEXP_MARK_VISITED;
 1949|   303k|    if (to->type == XML_REGEXP_FINAL_STATE) {
  ------------------
  |  Branch (1949:9): [True: 89.7k, False: 214k]
  ------------------
 1950|  89.7k|	from->type = XML_REGEXP_FINAL_STATE;
 1951|  89.7k|    }
 1952|  9.54M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1952:22): [True: 9.23M, False: 303k]
  ------------------
 1953|  9.23M|        xmlRegTransPtr t1 = &to->trans[transnr];
 1954|  9.23M|        int tcounter;
 1955|       |
 1956|  9.23M|        if (t1->to < 0)
  ------------------
  |  Branch (1956:13): [True: 1.22M, False: 8.01M]
  ------------------
 1957|  1.22M|	    continue;
 1958|  8.01M|        if (t1->counter >= 0) {
  ------------------
  |  Branch (1958:13): [True: 0, False: 8.01M]
  ------------------
 1959|       |            /* assert(counter < 0); */
 1960|      0|            tcounter = t1->counter;
 1961|  8.01M|        } else {
 1962|  8.01M|            tcounter = counter;
 1963|  8.01M|        }
 1964|  8.01M|	if (t1->atom == NULL) {
  ------------------
  |  Branch (1964:6): [True: 156k, False: 7.86M]
  ------------------
 1965|       |	    /*
 1966|       |	     * Don't remove counted transitions
 1967|       |	     * Don't loop either
 1968|       |	     */
 1969|   156k|	    if (t1->to != fromnr) {
  ------------------
  |  Branch (1969:10): [True: 155k, False: 1.37k]
  ------------------
 1970|   155k|		if (t1->count >= 0) {
  ------------------
  |  Branch (1970:7): [True: 0, False: 155k]
  ------------------
 1971|      0|		    xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
 1972|      0|					-1, t1->count);
 1973|   155k|		} else {
 1974|   155k|                    xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
 1975|   155k|                                                  tcounter);
 1976|   155k|		}
 1977|   155k|	    }
 1978|  7.86M|	} else {
 1979|  7.86M|            xmlRegStateAddTrans(ctxt, from, t1->atom,
 1980|  7.86M|                                ctxt->states[t1->to], tcounter, -1);
 1981|  7.86M|	}
 1982|  8.01M|    }
 1983|   303k|}
xmlregexp.c:xmlFAFinishReduceEpsilonTransitions:
 1990|   347k|xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
 1991|   347k|    int transnr;
 1992|   347k|    xmlRegStatePtr to;
 1993|       |
 1994|   347k|    to = ctxt->states[tonr];
 1995|   347k|    if (to == NULL)
  ------------------
  |  Branch (1995:9): [True: 81, False: 346k]
  ------------------
 1996|     81|	return;
 1997|   346k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1997:9): [True: 1.37k, False: 345k]
  ------------------
 1998|   345k|	(to->mark == XML_REGEXP_MARK_NORMAL))
  ------------------
  |  Branch (1998:2): [True: 41.7k, False: 303k]
  ------------------
 1999|  43.0k|	return;
 2000|       |
 2001|   303k|    to->mark = XML_REGEXP_MARK_NORMAL;
 2002|  9.54M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (2002:22): [True: 9.23M, False: 303k]
  ------------------
 2003|  9.23M|	xmlRegTransPtr t1 = &to->trans[transnr];
 2004|  9.23M|	if ((t1->to >= 0) && (t1->atom == NULL))
  ------------------
  |  Branch (2004:6): [True: 8.01M, False: 1.22M]
  |  Branch (2004:23): [True: 156k, False: 7.86M]
  ------------------
 2005|   156k|            xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
 2006|  9.23M|    }
 2007|   303k|}
xmlregexp.c:xmlRegEpxFromParse:
  506|  1.56k|xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
  507|  1.56k|    xmlRegexpPtr ret;
  508|       |
  509|  1.56k|    ret = (xmlRegexpPtr) xmlMalloc(sizeof(xmlRegexp));
  510|  1.56k|    if (ret == NULL) {
  ------------------
  |  Branch (510:9): [True: 4, False: 1.56k]
  ------------------
  511|      4|	xmlRegexpErrMemory(ctxt);
  512|      4|	return(NULL);
  513|      4|    }
  514|  1.56k|    memset(ret, 0, sizeof(xmlRegexp));
  515|  1.56k|    ret->string = ctxt->string;
  516|  1.56k|    ret->nbStates = ctxt->nbStates;
  517|  1.56k|    ret->states = ctxt->states;
  518|  1.56k|    ret->nbAtoms = ctxt->nbAtoms;
  519|  1.56k|    ret->atoms = ctxt->atoms;
  520|  1.56k|    ret->nbCounters = ctxt->nbCounters;
  521|  1.56k|    ret->counters = ctxt->counters;
  522|  1.56k|    ret->determinist = ctxt->determinist;
  523|  1.56k|    ret->flags = ctxt->flags;
  524|  1.56k|    if (ret->determinist == -1) {
  ------------------
  |  Branch (524:9): [True: 1.56k, False: 0]
  ------------------
  525|  1.56k|        if (xmlRegexpIsDeterminist(ret) < 0) {
  ------------------
  |  Branch (525:13): [True: 24, False: 1.53k]
  ------------------
  526|     24|            xmlRegexpErrMemory(ctxt);
  527|     24|            xmlFree(ret);
  528|     24|            return(NULL);
  529|     24|        }
  530|  1.56k|    }
  531|       |
  532|  1.53k|    if ((ret->determinist != 0) &&
  ------------------
  |  Branch (532:9): [True: 1.05k, False: 482]
  ------------------
  533|  1.05k|	(ret->nbCounters == 0) &&
  ------------------
  |  Branch (533:2): [True: 1.05k, False: 0]
  ------------------
  534|  1.05k|	(ctxt->negs == 0) &&
  ------------------
  |  Branch (534:2): [True: 1.05k, False: 0]
  ------------------
  535|  1.05k|	(ret->atoms != NULL) &&
  ------------------
  |  Branch (535:2): [True: 1.05k, False: 0]
  ------------------
  536|  1.05k|	(ret->atoms[0] != NULL) &&
  ------------------
  |  Branch (536:2): [True: 1.05k, False: 0]
  ------------------
  537|  1.05k|	(ret->atoms[0]->type == XML_REGEXP_STRING)) {
  ------------------
  |  Branch (537:2): [True: 1.05k, False: 0]
  ------------------
  538|  1.05k|	int i, j, nbstates = 0, nbatoms = 0;
  539|  1.05k|	int *stateRemap;
  540|  1.05k|	int *stringRemap;
  541|  1.05k|	int *transitions;
  542|  1.05k|	void **transdata;
  543|  1.05k|	xmlChar **stringMap;
  544|  1.05k|        xmlChar *value;
  545|       |
  546|       |	/*
  547|       |	 * Switch to a compact representation
  548|       |	 * 1/ counting the effective number of states left
  549|       |	 * 2/ counting the unique number of atoms, and check that
  550|       |	 *    they are all of the string type
  551|       |	 * 3/ build a table state x atom for the transitions
  552|       |	 */
  553|       |
  554|  1.05k|	stateRemap = xmlMalloc(ret->nbStates * sizeof(int));
  555|  1.05k|	if (stateRemap == NULL) {
  ------------------
  |  Branch (555:6): [True: 9, False: 1.04k]
  ------------------
  556|      9|	    xmlRegexpErrMemory(ctxt);
  557|      9|	    xmlFree(ret);
  558|      9|	    return(NULL);
  559|      9|	}
  560|  14.7k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (560:13): [True: 13.6k, False: 1.04k]
  ------------------
  561|  13.6k|	    if (ret->states[i] != NULL) {
  ------------------
  |  Branch (561:10): [True: 9.54k, False: 4.12k]
  ------------------
  562|  9.54k|		stateRemap[i] = nbstates;
  563|  9.54k|		nbstates++;
  564|  9.54k|	    } else {
  565|  4.12k|		stateRemap[i] = -1;
  566|  4.12k|	    }
  567|  13.6k|	}
  568|  1.04k|	stringMap = xmlMalloc(ret->nbAtoms * sizeof(char *));
  569|  1.04k|	if (stringMap == NULL) {
  ------------------
  |  Branch (569:6): [True: 11, False: 1.03k]
  ------------------
  570|     11|	    xmlRegexpErrMemory(ctxt);
  571|     11|	    xmlFree(stateRemap);
  572|     11|	    xmlFree(ret);
  573|     11|	    return(NULL);
  574|     11|	}
  575|  1.03k|	stringRemap = xmlMalloc(ret->nbAtoms * sizeof(int));
  576|  1.03k|	if (stringRemap == NULL) {
  ------------------
  |  Branch (576:6): [True: 8, False: 1.02k]
  ------------------
  577|      8|	    xmlRegexpErrMemory(ctxt);
  578|      8|	    xmlFree(stringMap);
  579|      8|	    xmlFree(stateRemap);
  580|      8|	    xmlFree(ret);
  581|      8|	    return(NULL);
  582|      8|	}
  583|  13.4k|	for (i = 0;i < ret->nbAtoms;i++) {
  ------------------
  |  Branch (583:13): [True: 12.4k, False: 990]
  ------------------
  584|  12.4k|	    if ((ret->atoms[i]->type == XML_REGEXP_STRING) &&
  ------------------
  |  Branch (584:10): [True: 12.4k, False: 0]
  ------------------
  585|  12.4k|		(ret->atoms[i]->quant == XML_REGEXP_QUANT_ONCE)) {
  ------------------
  |  Branch (585:3): [True: 12.4k, False: 0]
  ------------------
  586|  12.4k|		value = ret->atoms[i]->valuep;
  587|   125k|                for (j = 0;j < nbatoms;j++) {
  ------------------
  |  Branch (587:28): [True: 121k, False: 3.72k]
  ------------------
  588|   121k|		    if (xmlStrEqual(stringMap[j], value)) {
  ------------------
  |  Branch (588:11): [True: 8.69k, False: 113k]
  ------------------
  589|  8.69k|			stringRemap[i] = j;
  590|  8.69k|			break;
  591|  8.69k|		    }
  592|   121k|		}
  593|  12.4k|		if (j >= nbatoms) {
  ------------------
  |  Branch (593:7): [True: 3.72k, False: 8.69k]
  ------------------
  594|  3.72k|		    stringRemap[i] = nbatoms;
  595|  3.72k|		    stringMap[nbatoms] = xmlStrdup(value);
  596|  3.72k|		    if (stringMap[nbatoms] == NULL) {
  ------------------
  |  Branch (596:11): [True: 39, False: 3.68k]
  ------------------
  597|    212|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (597:15): [True: 173, False: 39]
  ------------------
  598|    173|			    xmlFree(stringMap[i]);
  599|     39|			xmlFree(stringRemap);
  600|     39|			xmlFree(stringMap);
  601|     39|			xmlFree(stateRemap);
  602|     39|			xmlFree(ret);
  603|     39|			return(NULL);
  604|     39|		    }
  605|  3.68k|		    nbatoms++;
  606|  3.68k|		}
  607|  12.4k|	    } else {
  608|      0|		xmlFree(stateRemap);
  609|      0|		xmlFree(stringRemap);
  610|      0|		for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (610:14): [True: 0, False: 0]
  ------------------
  611|      0|		    xmlFree(stringMap[i]);
  612|      0|		xmlFree(stringMap);
  613|      0|		xmlFree(ret);
  614|      0|		return(NULL);
  615|      0|	    }
  616|  12.4k|	}
  617|    990|	transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
  618|    990|                                            sizeof(int));
  619|    990|	if (transitions == NULL) {
  ------------------
  |  Branch (619:6): [True: 20, False: 970]
  ------------------
  620|     20|	    xmlFree(stateRemap);
  621|     20|	    xmlFree(stringRemap);
  622|    120|            for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (622:24): [True: 100, False: 20]
  ------------------
  623|    100|		xmlFree(stringMap[i]);
  624|     20|	    xmlFree(stringMap);
  625|     20|	    xmlFree(ret);
  626|     20|	    return(NULL);
  627|     20|	}
  628|       |
  629|       |	/*
  630|       |	 * Allocate the transition table. The first entry for each
  631|       |	 * state corresponds to the state type.
  632|       |	 */
  633|    970|	transdata = NULL;
  634|       |
  635|  13.9k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (635:13): [True: 12.9k, False: 970]
  ------------------
  636|  12.9k|	    int stateno, atomno, targetno, prev;
  637|  12.9k|	    xmlRegStatePtr state;
  638|  12.9k|	    xmlRegTransPtr trans;
  639|       |
  640|  12.9k|	    stateno = stateRemap[i];
  641|  12.9k|	    if (stateno == -1)
  ------------------
  |  Branch (641:10): [True: 3.87k, False: 9.06k]
  ------------------
  642|  3.87k|		continue;
  643|  9.06k|	    state = ret->states[i];
  644|       |
  645|  9.06k|	    transitions[stateno * (nbatoms + 1)] = state->type;
  646|       |
  647|  31.4k|	    for (j = 0;j < state->nbTrans;j++) {
  ------------------
  |  Branch (647:17): [True: 22.3k, False: 9.06k]
  ------------------
  648|  22.3k|		trans = &(state->trans[j]);
  649|  22.3k|		if ((trans->to < 0) || (trans->atom == NULL))
  ------------------
  |  Branch (649:7): [True: 8.62k, False: 13.7k]
  |  Branch (649:26): [True: 0, False: 13.7k]
  ------------------
  650|  8.62k|		    continue;
  651|  13.7k|                atomno = stringRemap[trans->atom->no];
  652|  13.7k|		if ((trans->atom->data != NULL) && (transdata == NULL)) {
  ------------------
  |  Branch (652:7): [True: 0, False: 13.7k]
  |  Branch (652:38): [True: 0, False: 0]
  ------------------
  653|      0|		    transdata = (void **) xmlRegCalloc2(nbstates, nbatoms,
  654|      0|			                                sizeof(void *));
  655|      0|		    if (transdata == NULL) {
  ------------------
  |  Branch (655:11): [True: 0, False: 0]
  ------------------
  656|      0|			xmlRegexpErrMemory(ctxt);
  657|      0|			break;
  658|      0|		    }
  659|      0|		}
  660|  13.7k|		targetno = stateRemap[trans->to];
  661|       |		/*
  662|       |		 * if the same atom can generate transitions to 2 different
  663|       |		 * states then it means the automata is not deterministic and
  664|       |		 * the compact form can't be used !
  665|       |		 */
  666|  13.7k|		prev = transitions[stateno * (nbatoms + 1) + atomno + 1];
  667|  13.7k|		if (prev != 0) {
  ------------------
  |  Branch (667:7): [True: 0, False: 13.7k]
  ------------------
  668|      0|		    if (prev != targetno + 1) {
  ------------------
  |  Branch (668:11): [True: 0, False: 0]
  ------------------
  669|      0|			ret->determinist = 0;
  670|      0|			if (transdata != NULL)
  ------------------
  |  Branch (670:8): [True: 0, False: 0]
  ------------------
  671|      0|			    xmlFree(transdata);
  672|      0|			xmlFree(transitions);
  673|      0|			xmlFree(stateRemap);
  674|      0|			xmlFree(stringRemap);
  675|      0|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (675:15): [True: 0, False: 0]
  ------------------
  676|      0|			    xmlFree(stringMap[i]);
  677|      0|			xmlFree(stringMap);
  678|      0|			goto not_determ;
  679|      0|		    }
  680|  13.7k|		} else {
  681|  13.7k|		    transitions[stateno * (nbatoms + 1) + atomno + 1] =
  682|  13.7k|			targetno + 1; /* to avoid 0 */
  683|  13.7k|		    if (transdata != NULL)
  ------------------
  |  Branch (683:11): [True: 0, False: 13.7k]
  ------------------
  684|      0|			transdata[stateno * nbatoms + atomno] =
  685|      0|			    trans->atom->data;
  686|  13.7k|		}
  687|  13.7k|	    }
  688|  9.06k|	}
  689|    970|	ret->determinist = 1;
  690|       |	/*
  691|       |	 * Cleanup of the old data
  692|       |	 */
  693|    970|	if (ret->states != NULL) {
  ------------------
  |  Branch (693:6): [True: 970, False: 0]
  ------------------
  694|  13.9k|	    for (i = 0;i < ret->nbStates;i++)
  ------------------
  |  Branch (694:17): [True: 12.9k, False: 970]
  ------------------
  695|  12.9k|		xmlRegFreeState(ret->states[i]);
  696|    970|	    xmlFree(ret->states);
  697|    970|	}
  698|    970|	ret->states = NULL;
  699|    970|	ret->nbStates = 0;
  700|    970|	if (ret->atoms != NULL) {
  ------------------
  |  Branch (700:6): [True: 970, False: 0]
  ------------------
  701|  12.9k|	    for (i = 0;i < ret->nbAtoms;i++)
  ------------------
  |  Branch (701:17): [True: 12.0k, False: 970]
  ------------------
  702|  12.0k|		xmlRegFreeAtom(ret->atoms[i]);
  703|    970|	    xmlFree(ret->atoms);
  704|    970|	}
  705|    970|	ret->atoms = NULL;
  706|    970|	ret->nbAtoms = 0;
  707|       |
  708|    970|	ret->compact = transitions;
  709|    970|	ret->transdata = transdata;
  710|    970|	ret->stringMap = stringMap;
  711|    970|	ret->nbstrings = nbatoms;
  712|    970|	ret->nbstates = nbstates;
  713|    970|	xmlFree(stateRemap);
  714|    970|	xmlFree(stringRemap);
  715|    970|    }
  716|  1.45k|not_determ:
  717|  1.45k|    ctxt->string = NULL;
  718|  1.45k|    ctxt->nbStates = 0;
  719|  1.45k|    ctxt->states = NULL;
  720|  1.45k|    ctxt->nbAtoms = 0;
  721|  1.45k|    ctxt->atoms = NULL;
  722|  1.45k|    ctxt->nbCounters = 0;
  723|       |    ctxt->counters = NULL;
  724|  1.45k|    return(ret);
  725|  1.53k|}
xmlregexp.c:xmlRegCalloc2:
  481|    990|xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
  482|    990|    size_t numElems, totalSize;
  483|    990|    void *ret;
  484|       |
  485|       |    /* Check for overflow */
  486|    990|    if ((dim2 == 0) || (elemSize == 0) ||
  ------------------
  |  Branch (486:9): [True: 0, False: 990]
  |  Branch (486:24): [True: 0, False: 990]
  ------------------
  487|    990|        (dim1 > SIZE_MAX / dim2 / elemSize))
  ------------------
  |  Branch (487:9): [True: 0, False: 990]
  ------------------
  488|      0|        return (NULL);
  489|    990|    numElems = dim1 * dim2;
  490|    990|    if (numElems > XML_MAX_ITEMS)
  ------------------
  |  |   13|    990|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (490:9): [True: 0, False: 990]
  ------------------
  491|      0|        return NULL;
  492|    990|    totalSize = numElems * elemSize;
  493|    990|    ret = xmlMalloc(totalSize);
  494|    990|    if (ret != NULL)
  ------------------
  |  Branch (494:9): [True: 970, False: 20]
  ------------------
  495|    970|        memset(ret, 0, totalSize);
  496|    990|    return (ret);
  497|    990|}
xmlregexp.c:xmlRegFreeParserCtxt:
  961|  3.56k|xmlRegFreeParserCtxt(xmlRegParserCtxtPtr ctxt) {
  962|  3.56k|    int i;
  963|  3.56k|    if (ctxt == NULL)
  ------------------
  |  Branch (963:9): [True: 0, False: 3.56k]
  ------------------
  964|      0|	return;
  965|       |
  966|  3.56k|    if (ctxt->string != NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 3.56k]
  ------------------
  967|      0|	xmlFree(ctxt->string);
  968|  3.56k|    if (ctxt->states != NULL) {
  ------------------
  |  Branch (968:9): [True: 560, False: 3.00k]
  ------------------
  969|   282k|	for (i = 0;i < ctxt->nbStates;i++)
  ------------------
  |  Branch (969:13): [True: 281k, False: 560]
  ------------------
  970|   281k|	    xmlRegFreeState(ctxt->states[i]);
  971|    560|	xmlFree(ctxt->states);
  972|    560|    }
  973|  3.56k|    if (ctxt->atoms != NULL) {
  ------------------
  |  Branch (973:9): [True: 527, False: 3.03k]
  ------------------
  974|   162k|	for (i = 0;i < ctxt->nbAtoms;i++)
  ------------------
  |  Branch (974:13): [True: 161k, False: 527]
  ------------------
  975|   161k|	    xmlRegFreeAtom(ctxt->atoms[i]);
  976|    527|	xmlFree(ctxt->atoms);
  977|    527|    }
  978|  3.56k|    if (ctxt->counters != NULL)
  ------------------
  |  Branch (978:9): [True: 0, False: 3.56k]
  ------------------
  979|      0|	xmlFree(ctxt->counters);
  980|  3.56k|    xmlFree(ctxt);
  981|  3.56k|}
xmlregexp.c:xmlRegFreeState:
  944|   925k|xmlRegFreeState(xmlRegStatePtr state) {
  945|   925k|    if (state == NULL)
  ------------------
  |  Branch (945:9): [True: 209k, False: 716k]
  ------------------
  946|   209k|	return;
  947|       |
  948|   716k|    if (state->trans != NULL)
  ------------------
  |  Branch (948:9): [True: 711k, False: 4.67k]
  ------------------
  949|   711k|	xmlFree(state->trans);
  950|   716k|    if (state->transTo != NULL)
  ------------------
  |  Branch (950:9): [True: 712k, False: 3.59k]
  ------------------
  951|   712k|	xmlFree(state->transTo);
  952|   716k|    xmlFree(state);
  953|   716k|}
xmlregexp.c:xmlFAComputesDeterminism:
 2808|  1.53k|xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
 2809|  1.53k|    int statenr, transnr;
 2810|  1.53k|    xmlRegStatePtr state;
 2811|  1.53k|    xmlRegTransPtr t1, t2, last;
 2812|  1.53k|    int i;
 2813|  1.53k|    int ret = 1;
 2814|  1.53k|    int deep = 1;
 2815|       |
 2816|  1.53k|    if (ctxt->determinist != -1)
  ------------------
  |  Branch (2816:9): [True: 0, False: 1.53k]
  ------------------
 2817|      0|	return(ctxt->determinist);
 2818|       |
 2819|  1.53k|    if (ctxt->flags & AM_AUTOMATA_RNG)
  ------------------
  |  |  291|  1.53k|#define AM_AUTOMATA_RNG 1
  ------------------
  |  Branch (2819:9): [True: 0, False: 1.53k]
  ------------------
 2820|      0|        deep = 0;
 2821|       |
 2822|       |    /*
 2823|       |     * First cleanup the automata removing cancelled transitions
 2824|       |     */
 2825|   435k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2825:22): [True: 433k, False: 1.53k]
  ------------------
 2826|   433k|	state = ctxt->states[statenr];
 2827|   433k|	if (state == NULL)
  ------------------
  |  Branch (2827:6): [True: 207k, False: 225k]
  ------------------
 2828|   207k|	    continue;
 2829|   225k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2829:6): [True: 87.6k, False: 138k]
  ------------------
 2830|  87.6k|	    continue;
 2831|  2.08M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2831:19): [True: 1.94M, False: 138k]
  ------------------
 2832|  1.94M|	    t1 = &(state->trans[transnr]);
 2833|       |	    /*
 2834|       |	     * Determinism checks in case of counted or all transitions
 2835|       |	     * will have to be handled separately
 2836|       |	     */
 2837|  1.94M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2837:10): [True: 251k, False: 1.69M]
  ------------------
 2838|       |		/* t1->nd = 1; */
 2839|   251k|		continue;
 2840|   251k|	    }
 2841|  1.69M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2841:10): [True: 42.3k, False: 1.65M]
  ------------------
 2842|  42.3k|		continue;
 2843|   532M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2843:17): [True: 531M, False: 1.65M]
  ------------------
 2844|   531M|		t2 = &(state->trans[i]);
 2845|   531M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2845:7): [True: 433M, False: 97.6M]
  ------------------
 2846|   433M|		    continue;
 2847|  97.6M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2847:7): [True: 97.6M, False: 0]
  ------------------
 2848|  97.6M|		    if (t1->to == t2->to) {
  ------------------
  |  Branch (2848:11): [True: 14.7M, False: 82.9M]
  ------------------
 2849|       |                        /*
 2850|       |                         * Here we use deep because we want to keep the
 2851|       |                         * transitions which indicate a conflict
 2852|       |                         */
 2853|  14.7M|			if (xmlFAEqualAtoms(t1->atom, t2->atom, deep) &&
  ------------------
  |  Branch (2853:8): [True: 591k, False: 14.1M]
  ------------------
 2854|   591k|                            (t1->counter == t2->counter) &&
  ------------------
  |  Branch (2854:29): [True: 591k, False: 0]
  ------------------
 2855|   591k|                            (t1->count == t2->count))
  ------------------
  |  Branch (2855:29): [True: 591k, False: 0]
  ------------------
 2856|   591k|			    t2->to = -1; /* eliminated */
 2857|  14.7M|		    }
 2858|  97.6M|		}
 2859|  97.6M|	    }
 2860|  1.65M|	}
 2861|   138k|    }
 2862|       |
 2863|       |    /*
 2864|       |     * Check for all states that there aren't 2 transitions
 2865|       |     * with the same atom and a different target.
 2866|       |     */
 2867|   435k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2867:22): [True: 433k, False: 1.53k]
  ------------------
 2868|   433k|	state = ctxt->states[statenr];
 2869|   433k|	if (state == NULL)
  ------------------
  |  Branch (2869:6): [True: 207k, False: 225k]
  ------------------
 2870|   207k|	    continue;
 2871|   225k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2871:6): [True: 87.6k, False: 138k]
  ------------------
 2872|  87.6k|	    continue;
 2873|   138k|	last = NULL;
 2874|  2.08M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2874:19): [True: 1.94M, False: 138k]
  ------------------
 2875|  1.94M|	    t1 = &(state->trans[transnr]);
 2876|       |	    /*
 2877|       |	     * Determinism checks in case of counted or all transitions
 2878|       |	     * will have to be handled separately
 2879|       |	     */
 2880|  1.94M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2880:10): [True: 251k, False: 1.69M]
  ------------------
 2881|   251k|		continue;
 2882|   251k|	    }
 2883|  1.69M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2883:10): [True: 633k, False: 1.06M]
  ------------------
 2884|   633k|		continue;
 2885|  68.7M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2885:17): [True: 67.7M, False: 1.06M]
  ------------------
 2886|  67.7M|		t2 = &(state->trans[i]);
 2887|  67.7M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2887:7): [True: 22.5M, False: 45.1M]
  ------------------
 2888|  22.5M|		    continue;
 2889|  45.1M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2889:7): [True: 45.1M, False: 0]
  ------------------
 2890|       |                    /*
 2891|       |                     * But here we don't use deep because we want to
 2892|       |                     * find transitions which indicate a conflict
 2893|       |                     */
 2894|  45.1M|		    if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
  ------------------
  |  Branch (2894:11): [True: 9.34M, False: 35.8M]
  ------------------
 2895|       |                        /*
 2896|       |                         * Treat equal counter transitions that couldn't be
 2897|       |                         * eliminated as deterministic.
 2898|       |                         */
 2899|  9.34M|                        if ((t1->to != t2->to) ||
  ------------------
  |  Branch (2899:29): [True: 9.34M, False: 0]
  ------------------
 2900|      0|                            (t1->counter == t2->counter) ||
  ------------------
  |  Branch (2900:29): [True: 0, False: 0]
  ------------------
 2901|      0|                            (!xmlFAEqualAtoms(t1->atom, t2->atom, deep)))
  ------------------
  |  Branch (2901:29): [True: 0, False: 0]
  ------------------
 2902|  9.34M|                            ret = 0;
 2903|       |			/* mark the transitions as non-deterministic ones */
 2904|  9.34M|			t1->nd = 1;
 2905|  9.34M|			t2->nd = 1;
 2906|  9.34M|			last = t1;
 2907|  9.34M|		    }
 2908|  45.1M|		} else {
 2909|      0|                    int res;
 2910|       |
 2911|       |		    /*
 2912|       |		     * do the closure in case of remaining specific
 2913|       |		     * epsilon transitions like choices or all
 2914|       |		     */
 2915|      0|		    res = xmlFARecurseDeterminism(ctxt, ctxt->states[t2->to],
 2916|      0|						  statenr, t1->to, t1->atom);
 2917|      0|                    xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t2->to]);
 2918|       |		    /* don't shortcut the computation so all non deterministic
 2919|       |		       transition get marked down
 2920|       |		    if (ret == 0)
 2921|       |			return(0);
 2922|       |		     */
 2923|      0|		    if (res == 0) {
  ------------------
  |  Branch (2923:11): [True: 0, False: 0]
  ------------------
 2924|      0|			t1->nd = 1;
 2925|       |			/* t2->nd = 1; */
 2926|      0|			last = t1;
 2927|      0|                        ret = 0;
 2928|      0|		    }
 2929|      0|		}
 2930|  45.1M|	    }
 2931|       |	    /* don't shortcut the computation so all non deterministic
 2932|       |	       transition get marked down
 2933|       |	    if (ret == 0)
 2934|       |		break; */
 2935|  1.06M|	}
 2936|       |
 2937|       |	/*
 2938|       |	 * mark specifically the last non-deterministic transition
 2939|       |	 * from a state since there is no need to set-up rollback
 2940|       |	 * from it
 2941|       |	 */
 2942|   138k|	if (last != NULL) {
  ------------------
  |  Branch (2942:6): [True: 79.3k, False: 58.8k]
  ------------------
 2943|  79.3k|	    last->nd = 2;
 2944|  79.3k|	}
 2945|       |
 2946|       |	/* don't shortcut the computation so all non deterministic
 2947|       |	   transition get marked down
 2948|       |	if (ret == 0)
 2949|       |	    break; */
 2950|   138k|    }
 2951|       |
 2952|  1.53k|    ctxt->determinist = ret;
 2953|  1.53k|    return(ret);
 2954|  1.53k|}
xmlregexp.c:xmlFAEqualAtoms:
 2586|  14.7M|xmlFAEqualAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2587|  14.7M|    int ret = 0;
 2588|       |
 2589|  14.7M|    if (atom1 == atom2)
  ------------------
  |  Branch (2589:9): [True: 0, False: 14.7M]
  ------------------
 2590|      0|	return(1);
 2591|  14.7M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2591:9): [True: 0, False: 14.7M]
  |  Branch (2591:28): [True: 0, False: 14.7M]
  ------------------
 2592|      0|	return(0);
 2593|       |
 2594|  14.7M|    if (atom1->type != atom2->type)
  ------------------
  |  Branch (2594:9): [True: 0, False: 14.7M]
  ------------------
 2595|      0|        return(0);
 2596|  14.7M|    switch (atom1->type) {
 2597|      0|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2597:9): [True: 0, False: 14.7M]
  ------------------
 2598|      0|	    ret = 0;
 2599|      0|	    break;
 2600|  14.7M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2600:9): [True: 14.7M, False: 0]
  ------------------
 2601|  14.7M|            if (!deep)
  ------------------
  |  Branch (2601:17): [True: 0, False: 14.7M]
  ------------------
 2602|      0|                ret = (atom1->valuep == atom2->valuep);
 2603|  14.7M|            else
 2604|  14.7M|                ret = xmlStrEqual((xmlChar *)atom1->valuep,
 2605|  14.7M|                                  (xmlChar *)atom2->valuep);
 2606|  14.7M|	    break;
 2607|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2607:9): [True: 0, False: 14.7M]
  ------------------
 2608|      0|	    ret = (atom1->codepoint == atom2->codepoint);
 2609|      0|	    break;
 2610|      0|	case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2610:2): [True: 0, False: 14.7M]
  ------------------
 2611|       |	    /* too hard to do in the general case */
 2612|      0|	    ret = 0;
 2613|      0|	default:
  ------------------
  |  Branch (2613:2): [True: 0, False: 14.7M]
  ------------------
 2614|      0|	    break;
 2615|  14.7M|    }
 2616|  14.7M|    return(ret);
 2617|  14.7M|}
xmlregexp.c:xmlFACompareAtoms:
 2629|  45.1M|xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2630|  45.1M|    int ret = 1;
 2631|       |
 2632|  45.1M|    if (atom1 == atom2)
  ------------------
  |  Branch (2632:9): [True: 0, False: 45.1M]
  ------------------
 2633|      0|	return(1);
 2634|  45.1M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2634:9): [True: 0, False: 45.1M]
  |  Branch (2634:28): [True: 0, False: 45.1M]
  ------------------
 2635|      0|	return(0);
 2636|       |
 2637|  45.1M|    if ((atom1->type == XML_REGEXP_ANYCHAR) ||
  ------------------
  |  Branch (2637:9): [True: 0, False: 45.1M]
  ------------------
 2638|  45.1M|        (atom2->type == XML_REGEXP_ANYCHAR))
  ------------------
  |  Branch (2638:9): [True: 0, False: 45.1M]
  ------------------
 2639|      0|	return(1);
 2640|       |
 2641|  45.1M|    if (atom1->type > atom2->type) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 45.1M]
  ------------------
 2642|      0|	xmlRegAtomPtr tmp;
 2643|      0|	tmp = atom1;
 2644|      0|	atom1 = atom2;
 2645|      0|	atom2 = tmp;
 2646|      0|    }
 2647|  45.1M|    if (atom1->type != atom2->type) {
  ------------------
  |  Branch (2647:9): [True: 0, False: 45.1M]
  ------------------
 2648|      0|        ret = xmlFACompareAtomTypes(atom1->type, atom2->type);
 2649|       |	/* if they can't intersect at the type level break now */
 2650|      0|	if (ret == 0)
  ------------------
  |  Branch (2650:6): [True: 0, False: 0]
  ------------------
 2651|      0|	    return(0);
 2652|      0|    }
 2653|  45.1M|    switch (atom1->type) {
 2654|  45.1M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2654:9): [True: 45.1M, False: 0]
  ------------------
 2655|  45.1M|            if (!deep)
  ------------------
  |  Branch (2655:17): [True: 0, False: 45.1M]
  ------------------
 2656|      0|                ret = (atom1->valuep != atom2->valuep);
 2657|  45.1M|            else {
 2658|  45.1M|                xmlChar *val1 = (xmlChar *)atom1->valuep;
 2659|  45.1M|                xmlChar *val2 = (xmlChar *)atom2->valuep;
 2660|  45.1M|                int compound1 = (xmlStrchr(val1, '|') != NULL);
 2661|  45.1M|                int compound2 = (xmlStrchr(val2, '|') != NULL);
 2662|       |
 2663|       |                /* Ignore negative match flag for ##other namespaces */
 2664|  45.1M|                if (compound1 != compound2)
  ------------------
  |  Branch (2664:21): [True: 0, False: 45.1M]
  ------------------
 2665|      0|                    return(0);
 2666|       |
 2667|  45.1M|                ret = xmlRegStrEqualWildcard(val1, val2);
 2668|  45.1M|            }
 2669|  45.1M|	    break;
 2670|  45.1M|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2670:9): [True: 0, False: 45.1M]
  ------------------
 2671|      0|	    goto not_determinist;
 2672|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2672:9): [True: 0, False: 45.1M]
  ------------------
 2673|      0|	    if (atom2->type == XML_REGEXP_CHARVAL) {
  ------------------
  |  Branch (2673:10): [True: 0, False: 0]
  ------------------
 2674|      0|		ret = (atom1->codepoint == atom2->codepoint);
 2675|      0|	    } else {
 2676|      0|	        ret = xmlRegCheckCharacter(atom2, atom1->codepoint);
 2677|      0|		if (ret < 0)
  ------------------
  |  Branch (2677:7): [True: 0, False: 0]
  ------------------
 2678|      0|		    ret = 1;
 2679|      0|	    }
 2680|      0|	    break;
 2681|      0|        case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2681:9): [True: 0, False: 45.1M]
  ------------------
 2682|      0|	    if (atom2->type == XML_REGEXP_RANGES) {
  ------------------
  |  Branch (2682:10): [True: 0, False: 0]
  ------------------
 2683|      0|	        int i, j, res;
 2684|      0|		xmlRegRangePtr r1, r2;
 2685|       |
 2686|       |		/*
 2687|       |		 * need to check that none of the ranges eventually matches
 2688|       |		 */
 2689|      0|		for (i = 0;i < atom1->nbRanges;i++) {
  ------------------
  |  Branch (2689:14): [True: 0, False: 0]
  ------------------
 2690|      0|		    for (j = 0;j < atom2->nbRanges;j++) {
  ------------------
  |  Branch (2690:18): [True: 0, False: 0]
  ------------------
 2691|      0|			r1 = atom1->ranges[i];
 2692|      0|			r2 = atom2->ranges[j];
 2693|      0|			res = xmlFACompareRanges(r1, r2);
 2694|      0|			if (res == 1) {
  ------------------
  |  Branch (2694:8): [True: 0, False: 0]
  ------------------
 2695|      0|			    ret = 1;
 2696|      0|			    goto done;
 2697|      0|			}
 2698|      0|		    }
 2699|      0|		}
 2700|      0|		ret = 0;
 2701|      0|	    }
 2702|      0|	    break;
 2703|      0|	default:
  ------------------
  |  Branch (2703:2): [True: 0, False: 45.1M]
  ------------------
 2704|      0|	    goto not_determinist;
 2705|  45.1M|    }
 2706|  45.1M|done:
 2707|  45.1M|    if (atom1->neg != atom2->neg) {
  ------------------
  |  Branch (2707:9): [True: 0, False: 45.1M]
  ------------------
 2708|      0|        ret = !ret;
 2709|      0|    }
 2710|  45.1M|    if (ret == 0)
  ------------------
  |  Branch (2710:9): [True: 35.8M, False: 9.34M]
  ------------------
 2711|  35.8M|        return(0);
 2712|  9.34M|not_determinist:
 2713|  9.34M|    return(1);
 2714|  45.1M|}
xmlregexp.c:xmlRegFreeAtom:
  860|   475k|xmlRegFreeAtom(xmlRegAtomPtr atom) {
  861|   475k|    int i;
  862|       |
  863|   475k|    if (atom == NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 475k]
  ------------------
  864|      0|	return;
  865|       |
  866|   475k|    for (i = 0;i < atom->nbRanges;i++)
  ------------------
  |  Branch (866:16): [True: 0, False: 475k]
  ------------------
  867|      0|	xmlRegFreeRange(atom->ranges[i]);
  868|   475k|    if (atom->ranges != NULL)
  ------------------
  |  Branch (868:9): [True: 0, False: 475k]
  ------------------
  869|      0|	xmlFree(atom->ranges);
  870|   475k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
  ------------------
  |  Branch (870:9): [True: 475k, False: 0]
  |  Branch (870:46): [True: 475k, False: 32]
  ------------------
  871|   475k|	xmlFree(atom->valuep);
  872|   475k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
  ------------------
  |  Branch (872:9): [True: 475k, False: 0]
  |  Branch (872:46): [True: 0, False: 475k]
  ------------------
  873|      0|	xmlFree(atom->valuep2);
  874|   475k|    if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
  ------------------
  |  Branch (874:9): [True: 0, False: 475k]
  |  Branch (874:50): [True: 0, False: 0]
  ------------------
  875|      0|	xmlFree(atom->valuep);
  876|   475k|    xmlFree(atom);
  877|   475k|}
xmlregexp.c:xmlRegNewAtom:
  838|   475k|xmlRegNewAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomType type) {
  839|   475k|    xmlRegAtomPtr ret;
  840|       |
  841|   475k|    ret = (xmlRegAtomPtr) xmlMalloc(sizeof(xmlRegAtom));
  842|   475k|    if (ret == NULL) {
  ------------------
  |  Branch (842:9): [True: 34, False: 475k]
  ------------------
  843|     34|	xmlRegexpErrMemory(ctxt);
  844|     34|	return(NULL);
  845|     34|    }
  846|   475k|    memset(ret, 0, sizeof(xmlRegAtom));
  847|   475k|    ret->type = type;
  848|   475k|    ret->quant = XML_REGEXP_QUANT_ONCE;
  849|   475k|    ret->min = 0;
  850|   475k|    ret->max = 0;
  851|   475k|    return(ret);
  852|   475k|}
xmlregexp.c:xmlRegexpErrMemory:
  430|    497|{
  431|    497|    if (ctxt != NULL)
  ------------------
  |  Branch (431:9): [True: 497, False: 0]
  ------------------
  432|    497|        ctxt->error = XML_ERR_NO_MEMORY;
  433|       |
  434|    497|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_REGEXP, NULL);
  435|    497|}
xmlregexp.c:xmlFAGenerateTransitions:
 1703|   475k|	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
 1704|   475k|    xmlRegStatePtr end;
 1705|   475k|    int nullable = 0;
 1706|       |
 1707|   475k|    if (atom == NULL) {
  ------------------
  |  Branch (1707:9): [True: 0, False: 475k]
  ------------------
 1708|      0|	ERROR("generate transition: atom == NULL");
  ------------------
  |  |   47|      0|    if (ctxt->error == 0) {						\
  |  |  ------------------
  |  |  |  Branch (47:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   48|      0|        ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   49|      0|        xmlRegexpErrCompile(ctxt, str);					\
  |  |   50|      0|    }
  ------------------
 1709|      0|	return(-1);
 1710|      0|    }
 1711|   475k|    if (atom->type == XML_REGEXP_SUBREG) {
  ------------------
  |  Branch (1711:9): [True: 0, False: 475k]
  ------------------
 1712|       |	/*
 1713|       |	 * this is a subexpression handling one should not need to
 1714|       |	 * create a new node except for XML_REGEXP_QUANT_RANGE.
 1715|       |	 */
 1716|      0|	if ((to != NULL) && (atom->stop != to) &&
  ------------------
  |  Branch (1716:6): [True: 0, False: 0]
  |  Branch (1716:22): [True: 0, False: 0]
  ------------------
 1717|      0|	    (atom->quant != XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1717:6): [True: 0, False: 0]
  ------------------
 1718|       |	    /*
 1719|       |	     * Generate an epsilon transition to link to the target
 1720|       |	     */
 1721|      0|	    xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
 1722|       |#ifdef DV
 1723|       |	} else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) &&
 1724|       |		   (atom->quant != XML_REGEXP_QUANT_ONCE)) {
 1725|       |	    to = xmlRegStatePush(ctxt, to);
 1726|       |            if (to == NULL)
 1727|       |                return(-1);
 1728|       |	    ctxt->state = to;
 1729|       |	    xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
 1730|       |#endif
 1731|      0|	}
 1732|      0|	switch (atom->quant) {
 1733|      0|	    case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1733:6): [True: 0, False: 0]
  ------------------
 1734|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1735|       |		/*
 1736|       |		 * transition done to the state after end of atom.
 1737|       |		 *      1. set transition from atom start to new state
 1738|       |		 *      2. set transition from atom end to this state.
 1739|       |		 */
 1740|      0|                if (to == NULL) {
  ------------------
  |  Branch (1740:21): [True: 0, False: 0]
  ------------------
 1741|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->start, 0);
 1742|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->stop,
 1743|      0|                                                   ctxt->state);
 1744|      0|                } else {
 1745|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->start, to);
 1746|      0|                }
 1747|      0|		break;
 1748|      0|	    case XML_REGEXP_QUANT_MULT:
  ------------------
  |  Branch (1748:6): [True: 0, False: 0]
  ------------------
 1749|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1750|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->start, atom->stop);
 1751|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
 1752|      0|		break;
 1753|      0|	    case XML_REGEXP_QUANT_PLUS:
  ------------------
  |  Branch (1753:6): [True: 0, False: 0]
  ------------------
 1754|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1755|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
 1756|      0|		break;
 1757|      0|	    case XML_REGEXP_QUANT_RANGE: {
  ------------------
  |  Branch (1757:6): [True: 0, False: 0]
  ------------------
 1758|      0|		int counter;
 1759|      0|		xmlRegStatePtr inter, newstate;
 1760|       |
 1761|       |		/*
 1762|       |		 * create the final state now if needed
 1763|       |		 */
 1764|      0|		if (to != NULL) {
  ------------------
  |  Branch (1764:7): [True: 0, False: 0]
  ------------------
 1765|      0|		    newstate = to;
 1766|      0|		} else {
 1767|      0|		    newstate = xmlRegStatePush(ctxt);
 1768|      0|                    if (newstate == NULL)
  ------------------
  |  Branch (1768:25): [True: 0, False: 0]
  ------------------
 1769|      0|                        return(-1);
 1770|      0|		}
 1771|       |
 1772|       |		/*
 1773|       |		 * The principle here is to use counted transition
 1774|       |		 * to avoid explosion in the number of states in the
 1775|       |		 * graph. This is clearly more complex but should not
 1776|       |		 * be exploitable at runtime.
 1777|       |		 */
 1778|      0|		if ((atom->min == 0) && (atom->start0 == NULL)) {
  ------------------
  |  Branch (1778:7): [True: 0, False: 0]
  |  Branch (1778:27): [True: 0, False: 0]
  ------------------
 1779|      0|		    xmlRegAtomPtr copy;
 1780|       |		    /*
 1781|       |		     * duplicate a transition based on atom to count next
 1782|       |		     * occurrences after 1. We cannot loop to atom->start
 1783|       |		     * directly because we need an epsilon transition to
 1784|       |		     * newstate.
 1785|       |		     */
 1786|       |		     /* ???? For some reason it seems we never reach that
 1787|       |		        case, I suppose this got optimized out before when
 1788|       |			building the automata */
 1789|      0|		    copy = xmlRegCopyAtom(ctxt, atom);
 1790|      0|		    if (copy == NULL)
  ------------------
  |  Branch (1790:11): [True: 0, False: 0]
  ------------------
 1791|      0|		        return(-1);
 1792|      0|		    copy->quant = XML_REGEXP_QUANT_ONCE;
 1793|      0|		    copy->min = 0;
 1794|      0|		    copy->max = 0;
 1795|       |
 1796|      0|		    if (xmlFAGenerateTransitions(ctxt, atom->start, NULL, copy)
  ------------------
  |  Branch (1796:11): [True: 0, False: 0]
  ------------------
 1797|      0|		        < 0) {
 1798|      0|                        xmlRegFreeAtom(copy);
 1799|      0|			return(-1);
 1800|      0|                    }
 1801|      0|		    inter = ctxt->state;
 1802|      0|		    counter = xmlRegGetCounter(ctxt);
 1803|      0|                    if (counter < 0)
  ------------------
  |  Branch (1803:25): [True: 0, False: 0]
  ------------------
 1804|      0|                        return(-1);
 1805|      0|		    ctxt->counters[counter].min = atom->min - 1;
 1806|      0|		    ctxt->counters[counter].max = atom->max - 1;
 1807|       |		    /* count the number of times we see it again */
 1808|      0|		    xmlFAGenerateCountedEpsilonTransition(ctxt, inter,
 1809|      0|						   atom->stop, counter);
 1810|       |		    /* allow a way out based on the count */
 1811|      0|		    xmlFAGenerateCountedTransition(ctxt, inter,
 1812|      0|			                           newstate, counter);
 1813|       |		    /* and also allow a direct exit for 0 */
 1814|      0|		    xmlFAGenerateEpsilonTransition(ctxt, atom->start,
 1815|      0|		                                   newstate);
 1816|      0|		} else {
 1817|       |		    /*
 1818|       |		     * either we need the atom at least once or there
 1819|       |		     * is an atom->start0 allowing to easily plug the
 1820|       |		     * epsilon transition.
 1821|       |		     */
 1822|      0|		    counter = xmlRegGetCounter(ctxt);
 1823|      0|                    if (counter < 0)
  ------------------
  |  Branch (1823:25): [True: 0, False: 0]
  ------------------
 1824|      0|                        return(-1);
 1825|      0|		    ctxt->counters[counter].min = atom->min - 1;
 1826|      0|		    ctxt->counters[counter].max = atom->max - 1;
 1827|       |		    /* allow a way out based on the count */
 1828|      0|		    xmlFAGenerateCountedTransition(ctxt, atom->stop,
 1829|      0|			                           newstate, counter);
 1830|       |		    /* count the number of times we see it again */
 1831|      0|		    xmlFAGenerateCountedEpsilonTransition(ctxt, atom->stop,
 1832|      0|						   atom->start, counter);
 1833|       |		    /* and if needed allow a direct exit for 0 */
 1834|      0|		    if (atom->min == 0)
  ------------------
  |  Branch (1834:11): [True: 0, False: 0]
  ------------------
 1835|      0|			xmlFAGenerateEpsilonTransition(ctxt, atom->start0,
 1836|      0|						       newstate);
 1837|       |
 1838|      0|		}
 1839|      0|		atom->min = 0;
 1840|      0|		atom->max = 0;
 1841|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1842|      0|		ctxt->state = newstate;
 1843|      0|	    }
 1844|      0|	    default:
  ------------------
  |  Branch (1844:6): [True: 0, False: 0]
  ------------------
 1845|      0|		break;
 1846|      0|	}
 1847|      0|        atom->start = NULL;
 1848|      0|        atom->start0 = NULL;
 1849|      0|        atom->stop = NULL;
 1850|      0|	if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1850:6): [True: 0, False: 0]
  ------------------
 1851|      0|	    return(-1);
 1852|      0|	return(0);
 1853|      0|    }
 1854|   475k|    if ((atom->min == 0) && (atom->max == 0) &&
  ------------------
  |  Branch (1854:9): [True: 475k, False: 0]
  |  Branch (1854:29): [True: 475k, False: 0]
  ------------------
 1855|   475k|               (atom->quant == XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1855:16): [True: 0, False: 475k]
  ------------------
 1856|       |        /*
 1857|       |	 * we can discard the atom and generate an epsilon transition instead
 1858|       |	 */
 1859|      0|	if (to == NULL) {
  ------------------
  |  Branch (1859:6): [True: 0, False: 0]
  ------------------
 1860|      0|	    to = xmlRegStatePush(ctxt);
 1861|      0|	    if (to == NULL)
  ------------------
  |  Branch (1861:10): [True: 0, False: 0]
  ------------------
 1862|      0|		return(-1);
 1863|      0|	}
 1864|      0|	xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1865|      0|	ctxt->state = to;
 1866|      0|	xmlRegFreeAtom(atom);
 1867|      0|	return(0);
 1868|      0|    }
 1869|   475k|    if (to == NULL) {
  ------------------
  |  Branch (1869:9): [True: 418k, False: 56.8k]
  ------------------
 1870|   418k|	to = xmlRegStatePush(ctxt);
 1871|   418k|	if (to == NULL)
  ------------------
  |  Branch (1871:6): [True: 44, False: 418k]
  ------------------
 1872|     44|	    return(-1);
 1873|   418k|    }
 1874|   475k|    end = to;
 1875|   475k|    if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
  ------------------
  |  Branch (1875:9): [True: 0, False: 475k]
  ------------------
 1876|   475k|        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
  ------------------
  |  Branch (1876:9): [True: 0, False: 475k]
  ------------------
 1877|       |	/*
 1878|       |	 * Do not pollute the target state by adding transitions from
 1879|       |	 * it as it is likely to be the shared target of multiple branches.
 1880|       |	 * So isolate with an epsilon transition.
 1881|       |	 */
 1882|      0|        xmlRegStatePtr tmp;
 1883|       |
 1884|      0|	tmp = xmlRegStatePush(ctxt);
 1885|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1885:13): [True: 0, False: 0]
  ------------------
 1886|      0|	    return(-1);
 1887|      0|	xmlFAGenerateEpsilonTransition(ctxt, tmp, to);
 1888|      0|	to = tmp;
 1889|      0|    }
 1890|   475k|    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
  ------------------
  |  Branch (1890:9): [True: 0, False: 475k]
  ------------------
 1891|      0|        (atom->min == 0) && (atom->max > 0)) {
  ------------------
  |  Branch (1891:9): [True: 0, False: 0]
  |  Branch (1891:29): [True: 0, False: 0]
  ------------------
 1892|      0|	nullable = 1;
 1893|      0|	atom->min = 1;
 1894|      0|        if (atom->max == 1)
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      0|	    atom->quant = XML_REGEXP_QUANT_OPT;
 1896|      0|    }
 1897|   475k|    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
 1898|   475k|    ctxt->state = end;
 1899|   475k|    switch (atom->quant) {
 1900|      0|	case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1900:2): [True: 0, False: 475k]
  ------------------
 1901|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1902|      0|	    xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1903|      0|	    break;
 1904|      0|	case XML_REGEXP_QUANT_MULT:
  ------------------
  |  Branch (1904:2): [True: 0, False: 475k]
  ------------------
 1905|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1906|      0|	    xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1907|      0|	    xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
 1908|      0|	    break;
 1909|      0|	case XML_REGEXP_QUANT_PLUS:
  ------------------
  |  Branch (1909:2): [True: 0, False: 475k]
  ------------------
 1910|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1911|      0|	    xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
 1912|      0|	    break;
 1913|      0|	case XML_REGEXP_QUANT_RANGE:
  ------------------
  |  Branch (1913:2): [True: 0, False: 475k]
  ------------------
 1914|      0|	    if (nullable)
  ------------------
  |  Branch (1914:10): [True: 0, False: 0]
  ------------------
 1915|      0|		xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1916|      0|	    break;
 1917|   475k|	default:
  ------------------
  |  Branch (1917:2): [True: 475k, False: 0]
  ------------------
 1918|   475k|	    break;
 1919|   475k|    }
 1920|   475k|    if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1920:9): [True: 21, False: 475k]
  ------------------
 1921|     21|	return(-1);
 1922|   475k|    return(0);
 1923|   475k|}
xmlregexp.c:xmlRegStateAddTrans:
 1526|  9.21M|		    int counter, int count) {
 1527|       |
 1528|  9.21M|    int nrtrans;
 1529|       |
 1530|  9.21M|    if (state == NULL) {
  ------------------
  |  Branch (1530:9): [True: 0, False: 9.21M]
  ------------------
 1531|      0|	ERROR("add state: state is NULL");
  ------------------
  |  |   47|      0|    if (ctxt->error == 0) {						\
  |  |  ------------------
  |  |  |  Branch (47:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   48|      0|        ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   49|      0|        xmlRegexpErrCompile(ctxt, str);					\
  |  |   50|      0|    }
  ------------------
 1532|      0|	return;
 1533|      0|    }
 1534|  9.21M|    if (target == NULL) {
  ------------------
  |  Branch (1534:9): [True: 0, False: 9.21M]
  ------------------
 1535|      0|	ERROR("add state: target is NULL");
  ------------------
  |  |   47|      0|    if (ctxt->error == 0) {						\
  |  |  ------------------
  |  |  |  Branch (47:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   48|      0|        ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   49|      0|        xmlRegexpErrCompile(ctxt, str);					\
  |  |   50|      0|    }
  ------------------
 1536|      0|	return;
 1537|      0|    }
 1538|       |    /*
 1539|       |     * Other routines follow the philosophy 'When in doubt, add a transition'
 1540|       |     * so we check here whether such a transition is already present and, if
 1541|       |     * so, silently ignore this request.
 1542|       |     */
 1543|       |
 1544|  1.12G|    for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) {
  ------------------
  |  Branch (1544:40): [True: 1.12G, False: 3.09M]
  ------------------
 1545|  1.12G|	xmlRegTransPtr trans = &(state->trans[nrtrans]);
 1546|  1.12G|	if ((trans->atom == atom) &&
  ------------------
  |  Branch (1546:6): [True: 7.99M, False: 1.11G]
  ------------------
 1547|  7.99M|	    (trans->to == target->no) &&
  ------------------
  |  Branch (1547:6): [True: 6.12M, False: 1.87M]
  ------------------
 1548|  6.12M|	    (trans->counter == counter) &&
  ------------------
  |  Branch (1548:6): [True: 6.12M, False: 0]
  ------------------
 1549|  6.12M|	    (trans->count == count)) {
  ------------------
  |  Branch (1549:6): [True: 6.12M, False: 0]
  ------------------
 1550|  6.12M|	    return;
 1551|  6.12M|	}
 1552|  1.12G|    }
 1553|       |
 1554|  3.09M|    if (state->nbTrans >= state->maxTrans) {
  ------------------
  |  Branch (1554:9): [True: 1.52M, False: 1.56M]
  ------------------
 1555|  1.52M|	xmlRegTrans *tmp;
 1556|  1.52M|        int newSize;
 1557|       |
 1558|  1.52M|        newSize = xmlGrowCapacity(state->maxTrans, sizeof(tmp[0]),
 1559|  1.52M|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|  1.52M|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1560|  1.52M|	if (newSize < 0) {
  ------------------
  |  Branch (1560:6): [True: 0, False: 1.52M]
  ------------------
 1561|      0|	    xmlRegexpErrMemory(ctxt);
 1562|      0|	    return;
 1563|      0|	}
 1564|  1.52M|	tmp = xmlRealloc(state->trans, newSize * sizeof(tmp[0]));
 1565|  1.52M|	if (tmp == NULL) {
  ------------------
  |  Branch (1565:6): [True: 129, False: 1.52M]
  ------------------
 1566|    129|	    xmlRegexpErrMemory(ctxt);
 1567|    129|	    return;
 1568|    129|	}
 1569|  1.52M|	state->trans = tmp;
 1570|  1.52M|	state->maxTrans = newSize;
 1571|  1.52M|    }
 1572|       |
 1573|  3.09M|    state->trans[state->nbTrans].atom = atom;
 1574|  3.09M|    state->trans[state->nbTrans].to = target->no;
 1575|  3.09M|    state->trans[state->nbTrans].counter = counter;
 1576|  3.09M|    state->trans[state->nbTrans].count = count;
 1577|  3.09M|    state->trans[state->nbTrans].nd = 0;
 1578|  3.09M|    state->nbTrans++;
 1579|  3.09M|    xmlRegStateAddTransTo(ctxt, target, state->no);
 1580|  3.09M|}
xmlregexp.c:xmlRegStateAddTransTo:
 1500|  3.09M|                      int from) {
 1501|  3.09M|    if (target->nbTransTo >= target->maxTransTo) {
  ------------------
  |  Branch (1501:9): [True: 1.50M, False: 1.58M]
  ------------------
 1502|  1.50M|	int *tmp;
 1503|  1.50M|        int newSize;
 1504|       |
 1505|  1.50M|        newSize = xmlGrowCapacity(target->maxTransTo, sizeof(tmp[0]),
 1506|  1.50M|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|  1.50M|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1507|  1.50M|	if (newSize < 0) {
  ------------------
  |  Branch (1507:6): [True: 0, False: 1.50M]
  ------------------
 1508|      0|	    xmlRegexpErrMemory(ctxt);
 1509|      0|	    return;
 1510|      0|	}
 1511|  1.50M|	tmp = xmlRealloc(target->transTo, newSize * sizeof(tmp[0]));
 1512|  1.50M|	if (tmp == NULL) {
  ------------------
  |  Branch (1512:6): [True: 110, False: 1.50M]
  ------------------
 1513|    110|	    xmlRegexpErrMemory(ctxt);
 1514|    110|	    return;
 1515|    110|	}
 1516|  1.50M|	target->transTo = tmp;
 1517|  1.50M|	target->maxTransTo = newSize;
 1518|  1.50M|    }
 1519|  3.09M|    target->transTo[target->nbTransTo] = from;
 1520|  3.09M|    target->nbTransTo++;
 1521|  3.09M|}
xmlregexp.c:xmlRegAtomPush:
 1470|   475k|xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
 1471|   475k|    if (atom == NULL) {
  ------------------
  |  Branch (1471:9): [True: 0, False: 475k]
  ------------------
 1472|      0|	ERROR("atom push: atom is NULL");
  ------------------
  |  |   47|      0|    if (ctxt->error == 0) {						\
  |  |  ------------------
  |  |  |  Branch (47:9): [True: 0, False: 0]
  |  |  ------------------
  |  |   48|      0|        ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   49|      0|        xmlRegexpErrCompile(ctxt, str);					\
  |  |   50|      0|    }
  ------------------
 1473|      0|	return(-1);
 1474|      0|    }
 1475|   475k|    if (ctxt->nbAtoms >= ctxt->maxAtoms) {
  ------------------
  |  Branch (1475:9): [True: 10.5k, False: 464k]
  ------------------
 1476|  10.5k|	xmlRegAtomPtr *tmp;
 1477|  10.5k|        int newSize;
 1478|       |
 1479|  10.5k|        newSize = xmlGrowCapacity(ctxt->maxAtoms, sizeof(tmp[0]),
 1480|  10.5k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  10.5k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1481|  10.5k|	if (newSize < 0) {
  ------------------
  |  Branch (1481:6): [True: 0, False: 10.5k]
  ------------------
 1482|      0|	    xmlRegexpErrMemory(ctxt);
 1483|      0|	    return(-1);
 1484|      0|	}
 1485|  10.5k|	tmp = xmlRealloc(ctxt->atoms, newSize * sizeof(tmp[0]));
 1486|  10.5k|	if (tmp == NULL) {
  ------------------
  |  Branch (1486:6): [True: 21, False: 10.5k]
  ------------------
 1487|     21|	    xmlRegexpErrMemory(ctxt);
 1488|     21|	    return(-1);
 1489|     21|	}
 1490|  10.5k|	ctxt->atoms = tmp;
 1491|  10.5k|        ctxt->maxAtoms = newSize;
 1492|  10.5k|    }
 1493|   475k|    atom->no = ctxt->nbAtoms;
 1494|   475k|    ctxt->atoms[ctxt->nbAtoms++] = atom;
 1495|   475k|    return(0);
 1496|   475k|}
xmlregexp.c:xmlFAGenerateEpsilonTransition:
 1645|   629k|			       xmlRegStatePtr from, xmlRegStatePtr to) {
 1646|   629k|    if (to == NULL) {
  ------------------
  |  Branch (1646:9): [True: 212k, False: 417k]
  ------------------
 1647|   212k|	to = xmlRegStatePush(ctxt);
 1648|   212k|        if (to == NULL)
  ------------------
  |  Branch (1648:13): [True: 21, False: 212k]
  ------------------
 1649|     21|            return(-1);
 1650|   212k|	ctxt->state = to;
 1651|   212k|    }
 1652|   629k|    xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
 1653|   629k|    return(0);
 1654|   629k|}

xmlSaveSetIndentString:
  126|  43.2k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  43.2k|    size_t len;
  128|  43.2k|    int i;
  129|       |
  130|  43.2k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 43.2k]
  |  Branch (130:27): [True: 0, False: 43.2k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  43.2k|    len = strlen(indent);
  134|  43.2k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  43.2k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 43.2k]
  |  Branch (134:23): [True: 0, False: 43.2k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  43.2k|    ctxt->indent_size = len;
  138|  43.2k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  43.2k|#define MAX_INDENT 60
  ------------------
  139|  1.33M|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 1.29M, False: 43.2k]
  ------------------
  140|  1.29M|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  43.2k|    return(0);
  143|  43.2k|}
xmlNodeDumpOutput:
 2334|  43.2k|{
 2335|  43.2k|    xmlSaveCtxt ctxt;
 2336|  43.2k|    int options;
 2337|  43.2k|#ifdef LIBXML_HTML_ENABLED
 2338|  43.2k|    xmlDtdPtr dtd;
 2339|  43.2k|    int is_xhtml = 0;
 2340|  43.2k|#endif
 2341|       |
 2342|  43.2k|    (void) doc;
 2343|       |
 2344|  43.2k|    xmlInitParser();
 2345|       |
 2346|  43.2k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 43.2k]
  |  Branch (2346:26): [True: 0, False: 43.2k]
  ------------------
 2347|       |
 2348|  43.2k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 43.2k]
  ------------------
 2349|      0|        level = 0;
 2350|  43.2k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 43.2k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  43.2k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 43.2k, False: 0]
  ------------------
 2354|  43.2k|        encoding = "UTF-8";
 2355|       |
 2356|  43.2k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  43.2k|    ctxt.buf = buf;
 2358|  43.2k|    ctxt.level = level;
 2359|  43.2k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  43.2k|    options = XML_SAVE_AS_XML;
 2362|  43.2k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 43.2k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  43.2k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  43.2k|#ifdef LIBXML_HTML_ENABLED
 2367|  43.2k|    dtd = xmlGetIntSubset(doc);
 2368|  43.2k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 27.7k, False: 15.4k]
  ------------------
 2369|  27.7k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  27.7k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 8.65k, False: 19.0k]
  ------------------
 2371|  8.65k|	    is_xhtml = 0;
 2372|  27.7k|    }
 2373|       |
 2374|  43.2k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 17.3k, False: 25.8k]
  ------------------
 2375|  17.3k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  25.8k|    else
 2377|  25.8k|#endif
 2378|  25.8k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  43.2k|}
xmlsave.c:xmlNsDumpOutput:
  762|   419k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   419k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   419k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   419k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 419k]
  |  Branch (765:26): [True: 0, False: 419k]
  ------------------
  766|       |
  767|   419k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 419k]
  |  Branch (767:27): [True: 0, False: 419k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   419k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   419k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 419k, False: 0]
  |  Branch (770:47): [True: 417k, False: 2.55k]
  ------------------
  771|   417k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   417k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 213, False: 417k]
  ------------------
  772|    213|	    return;
  773|       |
  774|   417k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 417k, False: 0]
  |  Branch (774:22): [True: 0, False: 417k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   417k|	else
  777|   417k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   417k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 412k, False: 4.03k]
  ------------------
  781|   412k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   412k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   412k|	} else
  784|  4.03k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   417k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   417k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   417k|    }
  789|   419k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  1.12k|                   const xmlChar *encoding) {
 1227|  1.12k|#ifdef LIBXML_HTML_ENABLED
 1228|  1.12k|    xmlDtdPtr dtd;
 1229|  1.12k|    int is_xhtml = 0;
 1230|  1.12k|#endif
 1231|  1.12k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  1.12k|    int switched_encoding = 0;
 1233|       |
 1234|  1.12k|    xmlInitParser();
 1235|       |
 1236|  1.12k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1.12k, False: 0]
  ------------------
 1237|  1.12k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.12k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  1.12k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.12k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  1.12k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1.12k]
  ------------------
 1244|      0|         ((ctxt->options & XML_SAVE_AS_XML) == 0) &&
  ------------------
  |  Branch (1244:10): [True: 0, False: 0]
  ------------------
 1245|      0|         ((ctxt->options & XML_SAVE_XHTML) == 0)) ||
  ------------------
  |  Branch (1245:10): [True: 0, False: 0]
  ------------------
 1246|  1.12k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1.12k]
  ------------------
 1247|      0|#ifdef LIBXML_HTML_ENABLED
 1248|      0|        int format = 0;
 1249|       |
 1250|      0|	if (ctxt->encoding == NULL) {
  ------------------
  |  Branch (1250:6): [True: 0, False: 0]
  ------------------
 1251|      0|            if (encoding == NULL)
  ------------------
  |  Branch (1251:17): [True: 0, False: 0]
  ------------------
 1252|      0|                encoding = BAD_CAST "HTML";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1253|       |
 1254|      0|	    if (xmlSaveSwitchEncoding(ctxt, (const char*) encoding) < 0) {
  ------------------
  |  Branch (1254:10): [True: 0, False: 0]
  ------------------
 1255|      0|		return(-1);
 1256|      0|	    }
 1257|      0|            switched_encoding = 1;
 1258|      0|	}
 1259|       |
 1260|      0|        if (ctxt->options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (1260:13): [True: 0, False: 0]
  ------------------
 1261|      0|            format = 1;
 1262|      0|        htmlNodeDumpInternal(buf, (htmlNodePtr) cur, (char *) ctxt->encoding,
 1263|      0|                             format);
 1264|       |#else
 1265|       |        return(-1);
 1266|       |#endif
 1267|  1.12k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1.12k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  1.12k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  1.12k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 1.12k, False: 0]
  |  Branch (1270:28): [True: 0, False: 1.12k]
  ------------------
 1271|      0|            if (xmlSaveSwitchEncoding(ctxt, (const char *) encoding) < 0)
  ------------------
  |  Branch (1271:17): [True: 0, False: 0]
  ------------------
 1272|      0|                return(-1);
 1273|      0|            switched_encoding = 1;
 1274|      0|	}
 1275|       |
 1276|       |	/*
 1277|       |	 * Save the XML declaration
 1278|       |	 */
 1279|  1.12k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1.12k, False: 0]
  ------------------
 1280|  1.12k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  1.12k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1.12k, False: 0]
  ------------------
 1282|  1.12k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  1.12k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  1.12k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 1.12k, False: 0]
  ------------------
 1287|  1.12k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  1.12k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  1.12k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  1.12k|	    }
 1291|  1.12k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 134, False: 989]
  ------------------
 1292|     67|		case 0:
  ------------------
  |  Branch (1292:3): [True: 67, False: 1.05k]
  ------------------
 1293|     67|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     67|		    break;
 1295|     67|		case 1:
  ------------------
  |  Branch (1295:3): [True: 67, False: 1.05k]
  ------------------
 1296|     67|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     67|		    break;
 1298|  1.12k|	    }
 1299|  1.12k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  1.12k|	}
 1301|       |
 1302|  1.12k|#ifdef LIBXML_HTML_ENABLED
 1303|  1.12k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 203, False: 920]
  ------------------
 1304|    203|            is_xhtml = 1;
 1305|  1.12k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1.12k, False: 0]
  ------------------
 1306|  1.12k|	    dtd = xmlGetIntSubset(cur);
 1307|  1.12k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 1.04k, False: 81]
  ------------------
 1308|  1.04k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  1.04k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 733, False: 309]
  ------------------
 1310|  1.04k|	    }
 1311|  1.12k|	}
 1312|  1.12k|#endif
 1313|  1.12k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1.12k, False: 0]
  ------------------
 1314|  1.12k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  3.32k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 2.20k, False: 1.12k]
  ------------------
 1317|  2.20k|		ctxt->level = 0;
 1318|  2.20k|#ifdef LIBXML_HTML_ENABLED
 1319|  2.20k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 442, False: 1.76k]
  ------------------
 1320|    442|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  1.76k|		else
 1322|  1.76k|#endif
 1323|  1.76k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  2.20k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 2.20k, False: 0]
  ------------------
 1325|  2.20k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 2.20k, False: 0]
  ------------------
 1326|  2.20k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  2.20k|		child = child->next;
 1328|  2.20k|	    }
 1329|  1.12k|	}
 1330|  1.12k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  1.12k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1.12k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  1.12k|    return(0);
 1340|  1.12k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  17.7k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  17.7k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  17.7k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  17.7k|    xmlChar *start, *end;
 1493|  17.7k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  17.7k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 17.7k]
  ------------------
 1496|       |
 1497|  17.7k|    oldoptions = ctxt->options;
 1498|  17.7k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  17.7k|    root = cur;
 1501|  17.7k|    parent = cur->parent;
 1502|  41.4k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 41.4k, Folded]
  ------------------
 1503|  41.4k|        switch (cur->type) {
 1504|    203|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 203, False: 41.2k]
  ------------------
 1505|    203|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 41.4k]
  ------------------
 1506|    203|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    203|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 41.4k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    203|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 203, False: 41.2k]
  ------------------
 1514|    203|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    203|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 41.4k]
  ------------------
 1518|       |            /* Always validate cur->parent when descending. */
 1519|      0|            if ((cur->parent == parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1519:17): [True: 0, False: 0]
  |  Branch (1519:44): [True: 0, False: 0]
  ------------------
 1520|      0|                parent = cur;
 1521|      0|                cur = cur->children;
 1522|      0|                continue;
 1523|      0|            }
 1524|      0|            break;
 1525|       |
 1526|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1526:9): [True: 0, False: 41.4k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 41.4k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 41.4k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  28.7k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 28.7k, False: 12.7k]
  ------------------
 1539|  28.7k|            addmeta = 0;
 1540|       |
 1541|  28.7k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 16.9k, False: 11.7k]
  |  Branch (1541:27): [True: 0, False: 16.9k]
  ------------------
 1542|      0|                xmlSaveWriteIndent(ctxt, 0);
 1543|       |
 1544|       |            /*
 1545|       |             * Some users like lxml are known to pass nodes with a corrupted
 1546|       |             * tree structure. Fall back to a recursive call to handle this
 1547|       |             * case.
 1548|       |             */
 1549|  28.7k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 28.7k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  28.7k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  28.7k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 2.00k, False: 26.7k]
  |  Branch (1555:38): [True: 588, False: 1.41k]
  ------------------
 1556|    588|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|    588|                xmlOutputBufferWrite(buf, 1, ":");
 1558|    588|            }
 1559|       |
 1560|  28.7k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  28.7k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 2.65k, False: 26.1k]
  ------------------
 1562|  2.65k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  28.7k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  28.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.02k, False: 27.7k]
  ------------------
 1564|  1.02k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 644, False: 377]
  |  Branch (1564:38): [True: 337, False: 307]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    337|                xmlOutputBufferWriteString(buf,
 1569|    337|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    337|            }
 1571|  28.7k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 7.58k, False: 21.1k]
  ------------------
 1572|  7.58k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  28.7k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 17.1k, False: 11.5k]
  ------------------
 1575|  17.1k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 69, False: 17.1k]
  ------------------
 1576|     69|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     69|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 69]
  ------------------
 1577|      0|                xmlStrEqual(parent->name, BAD_CAST"html")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1577:17): [True: 0, False: 0]
  ------------------
 1578|       |
 1579|      0|                tmp = cur->children;
 1580|      0|                while (tmp != NULL) {
  ------------------
  |  Branch (1580:24): [True: 0, False: 0]
  ------------------
 1581|      0|                    if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1581:25): [True: 0, False: 0]
  ------------------
 1582|      0|                        int res;
 1583|      0|                        xmlChar *httpequiv;
 1584|       |
 1585|      0|                        res = xmlNodeGetAttrValue(tmp, BAD_CAST "http-equiv",
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1586|      0|                                                  NULL, &httpequiv);
 1587|      0|                        if (res < 0) {
  ------------------
  |  Branch (1587:29): [True: 0, False: 0]
  ------------------
 1588|      0|                            xmlSaveErrMemory(buf);
 1589|      0|                        } else if (res == 0) {
  ------------------
  |  Branch (1589:36): [True: 0, False: 0]
  ------------------
 1590|      0|                            if (xmlStrcasecmp(httpequiv,
  ------------------
  |  Branch (1590:33): [True: 0, False: 0]
  ------------------
 1591|      0|                                        BAD_CAST"Content-Type") == 0) {
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1592|      0|                                xmlFree(httpequiv);
 1593|      0|                                break;
 1594|      0|                            }
 1595|      0|                            xmlFree(httpequiv);
 1596|      0|                        }
 1597|      0|                    }
 1598|      0|                    tmp = tmp->next;
 1599|      0|                }
 1600|      0|                if (tmp == NULL)
  ------------------
  |  Branch (1600:21): [True: 0, False: 0]
  ------------------
 1601|      0|                    addmeta = 1;
 1602|      0|            }
 1603|       |
 1604|  28.7k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 12.7k, False: 16.0k]
  ------------------
 1605|  12.7k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 11.7k, False: 1.02k]
  |  Branch (1605:43): [True: 759, False: 268]
  ------------------
 1606|  12.4k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 3.65k, False: 8.80k]
  |  Branch (1606:50): [True: 3.65k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  3.65k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  9.07k|                } else {
 1612|  9.07k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 9.07k]
  ------------------
 1613|      0|                        xmlOutputBufferWrite(buf, 1, ">");
 1614|      0|                        if (ctxt->format == 1) {
  ------------------
  |  Branch (1614:29): [True: 0, False: 0]
  ------------------
 1615|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1616|      0|                            xmlSaveWriteIndent(ctxt, 1);
 1617|      0|                        }
 1618|      0|                        xmlOutputBufferWriteString(buf,
 1619|      0|                                "<meta http-equiv=\"Content-Type\" "
 1620|      0|                                "content=\"text/html; charset=");
 1621|      0|                        if (ctxt->encoding) {
  ------------------
  |  Branch (1621:29): [True: 0, False: 0]
  ------------------
 1622|      0|                            xmlOutputBufferWriteString(buf,
 1623|      0|                                    (const char *)ctxt->encoding);
 1624|      0|                        } else {
 1625|      0|                            xmlOutputBufferWrite(buf, 5, "UTF-8");
 1626|      0|                        }
 1627|      0|                        xmlOutputBufferWrite(buf, 4, "\" />");
 1628|      0|                        if (ctxt->format == 1)
  ------------------
  |  Branch (1628:29): [True: 0, False: 0]
  ------------------
 1629|      0|                            xmlOutputBufferWrite(buf, 1, "\n");
 1630|  9.07k|                    } else {
 1631|  9.07k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  9.07k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  9.07k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  9.07k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 1.02k, False: 8.04k]
  |  Branch (1637:46): [True: 268, False: 759]
  ------------------
 1638|    268|                        xmlOutputBufferWriteString(buf,
 1639|    268|                                (const char *)cur->ns->prefix);
 1640|    268|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|    268|                    }
 1642|  9.07k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  9.07k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  9.07k|                }
 1645|  16.0k|            } else {
 1646|  16.0k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  16.0k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 16.0k]
  ------------------
 1648|      0|                    if (ctxt->format == 1) {
  ------------------
  |  Branch (1648:25): [True: 0, False: 0]
  ------------------
 1649|      0|                        xmlOutputBufferWrite(buf, 1, "\n");
 1650|      0|                        xmlSaveWriteIndent(ctxt, 1);
 1651|      0|                    }
 1652|      0|                    xmlOutputBufferWriteString(buf,
 1653|      0|                            "<meta http-equiv=\"Content-Type\" "
 1654|      0|                            "content=\"text/html; charset=");
 1655|      0|                    if (ctxt->encoding) {
  ------------------
  |  Branch (1655:25): [True: 0, False: 0]
  ------------------
 1656|      0|                        xmlOutputBufferWriteString(buf,
 1657|      0|                                (const char *)ctxt->encoding);
 1658|      0|                    } else {
 1659|      0|                        xmlOutputBufferWrite(buf, 5, "UTF-8");
 1660|      0|                    }
 1661|      0|                    xmlOutputBufferWrite(buf, 4, "\" />");
 1662|      0|                }
 1663|       |
 1664|  16.0k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 16.0k]
  ------------------
 1665|      0|                    tmp = cur->children;
 1666|      0|                    while (tmp != NULL) {
  ------------------
  |  Branch (1666:28): [True: 0, False: 0]
  ------------------
 1667|      0|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1667:29): [True: 0, False: 0]
  ------------------
 1668|      0|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1668:29): [True: 0, False: 0]
  ------------------
 1669|      0|                            unformattedNode = cur;
 1670|      0|                            ctxt->format = 0;
 1671|      0|                            break;
 1672|      0|                        }
 1673|      0|                        tmp = tmp->next;
 1674|      0|                    }
 1675|      0|                }
 1676|       |
 1677|  16.0k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 16.0k]
  ------------------
 1678|  16.0k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 16.0k, False: 0]
  ------------------
 1679|  16.0k|                parent = cur;
 1680|  16.0k|                cur = cur->children;
 1681|  16.0k|                continue;
 1682|  16.0k|            }
 1683|       |
 1684|  12.7k|            break;
 1685|       |
 1686|  12.7k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 10.0k, False: 31.4k]
  ------------------
 1687|  10.0k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 10.0k]
  ------------------
 1688|      0|                break;
 1689|  10.0k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 10.0k, False: 0]
  ------------------
 1690|  10.0k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  10.0k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 10.0k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  10.0k|                else
 1695|  10.0k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  10.0k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  10.0k|	    break;
 1703|       |
 1704|    743|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 743, False: 40.7k]
  ------------------
 1705|    743|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 249, False: 494]
  ------------------
 1706|    249|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    249|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    249|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 249, False: 0]
  ------------------
 1709|    249|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    249|                    xmlOutputBufferWriteString(buf,
 1711|    249|                            (const char *)cur->content);
 1712|    249|                }
 1713|    249|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|    494|            } else {
 1715|    494|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    494|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    494|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    494|            }
 1719|    743|            break;
 1720|       |
 1721|    315|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 315, False: 41.1k]
  ------------------
 1722|    315|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 315, False: 0]
  ------------------
 1723|    315|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    315|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    315|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    315|            }
 1727|    315|            break;
 1728|       |
 1729|    517|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 517, False: 40.9k]
  ------------------
 1730|    517|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    517|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    517|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    517|            break;
 1734|       |
 1735|    457|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 457, False: 41.0k]
  ------------------
 1736|    457|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 457]
  |  Branch (1736:41): [True: 213, False: 244]
  ------------------
 1737|    213|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    244|            } else {
 1739|    244|                start = end = cur->content;
 1740|  4.40k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 4.16k, False: 244]
  ------------------
 1741|  4.16k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 693, False: 3.46k]
  |  Branch (1741:40): [True: 372, False: 321]
  ------------------
 1742|    372|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 372]
  ------------------
 1743|      0|                        end = end + 2;
 1744|      0|                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1745|      0|                        xmlOutputBufferWrite(buf, end - start,
 1746|      0|                                (const char *)start);
 1747|      0|                        xmlOutputBufferWrite(buf, 3, "]]>");
 1748|      0|                        start = end;
 1749|      0|                    }
 1750|  4.16k|                    end++;
 1751|  4.16k|                }
 1752|    244|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 244, False: 0]
  ------------------
 1753|    244|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    244|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    244|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    244|                }
 1757|    244|            }
 1758|    457|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 41.4k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|    223|        default:
  ------------------
  |  Branch (1764:9): [True: 223, False: 41.2k]
  ------------------
 1765|    223|            break;
 1766|  41.4k|        }
 1767|       |
 1768|  41.4k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 41.4k, Folded]
  ------------------
 1769|  41.4k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 17.7k, False: 23.7k]
  ------------------
 1770|  17.7k|                return;
 1771|  23.7k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 23.7k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  23.7k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 7.67k, False: 16.0k]
  ------------------
 1774|  7.67k|                cur = cur->next;
 1775|  7.67k|                break;
 1776|  7.67k|            }
 1777|       |
 1778|  16.0k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  16.0k|            parent = cur->parent;
 1781|       |
 1782|  16.0k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 16.0k, False: 0]
  ------------------
 1783|  16.0k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 16.0k, False: 0]
  ------------------
 1784|  16.0k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 16.0k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  16.0k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  16.0k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 978, False: 15.0k]
  |  Branch (1788:42): [True: 320, False: 658]
  ------------------
 1789|    320|                    xmlOutputBufferWriteString(buf,
 1790|    320|                            (const char *)cur->ns->prefix);
 1791|    320|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|    320|                }
 1793|       |
 1794|  16.0k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  16.0k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  16.0k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 16.0k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  16.0k|            }
 1802|  16.0k|        }
 1803|  25.4k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  10.9k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  10.9k|    xmlOutputBufferPtr buf;
  829|  10.9k|    xmlNodePtr cur;
  830|  10.9k|    int format, level;
  831|       |
  832|  10.9k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 10.9k]
  ------------------
  833|  10.9k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 10.9k]
  |  Branch (833:27): [True: 0, False: 10.9k]
  ------------------
  834|      0|        return;
  835|  10.9k|    buf = ctxt->buf;
  836|  10.9k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  10.9k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  10.9k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 572, False: 10.3k]
  ------------------
  839|    572|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    572|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    572|	xmlOutputBufferWrite(buf, 1, " ");
  842|    572|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  10.3k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 517, False: 9.83k]
  ------------------
  844|    517|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    517|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    517|    }
  847|  10.9k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 8.69k, False: 2.22k]
  |  Branch (847:36): [True: 3.09k, False: 5.59k]
  ------------------
  848|  3.09k|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 3.09k, False: 0]
  |  Branch (848:38): [True: 1.57k, False: 1.51k]
  ------------------
  849|  1.57k|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 1.30k, False: 277]
  ------------------
  850|  1.30k|	xmlOutputBufferWrite(buf, 1, ">");
  851|  1.30k|	return;
  852|  1.30k|    }
  853|  9.61k|    xmlOutputBufferWrite(buf, 3, " [\n");
  854|       |    /*
  855|       |     * Dump the notations first they are not in the DTD children list
  856|       |     * Do this only on a standalone DTD or on the internal subset though.
  857|       |     */
  858|  9.61k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.73k, False: 7.88k]
  |  Branch (858:38): [True: 1.65k, False: 75]
  ------------------
  859|  1.73k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 75, False: 0]
  ------------------
  860|  1.73k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.73k|    }
  862|  9.61k|    format = ctxt->format;
  863|  9.61k|    level = ctxt->level;
  864|  9.61k|    ctxt->format = 0;
  865|  9.61k|    ctxt->level = -1;
  866|  29.1k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 19.5k, False: 9.61k]
  ------------------
  867|  19.5k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  19.5k|    }
  869|  9.61k|    ctxt->format = format;
  870|  9.61k|    ctxt->level = level;
  871|  9.61k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  9.61k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  5.77k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  5.77k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  5.77k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 1.31k, False: 4.45k]
  ------------------
  420|  1.31k|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|  1.31k|        xmlOutputBufferWrite(buf, 1, ":");
  422|  1.31k|    }
  423|  5.77k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  5.77k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  5.77k|    switch (elem->etype) {
  427|  2.16k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 2.16k, False: 3.60k]
  ------------------
  428|  2.16k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  2.16k|	    break;
  430|    103|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 103, False: 5.66k]
  ------------------
  431|    103|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|    103|	    break;
  433|    363|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 363, False: 5.40k]
  ------------------
  434|  3.50k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 3.14k, False: 2.62k]
  ------------------
  435|  3.50k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  3.50k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 5.77k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  5.77k|    }
  441|       |
  442|  5.77k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  5.77k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  3.50k|                         xmlElementContentPtr content) {
  346|  3.50k|    xmlElementContentPtr cur;
  347|       |
  348|  3.50k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 3.50k]
  ------------------
  349|       |
  350|  3.50k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  3.50k|    cur = content;
  352|       |
  353|   232k|    do {
  354|   232k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 232k]
  ------------------
  355|       |
  356|   232k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 232k, False: 0]
  ------------------
  357|    363|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 363, False: 232k]
  ------------------
  358|    363|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    363|                break;
  360|   117k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 117k, False: 114k]
  ------------------
  361|   117k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 2.44k, False: 115k]
  ------------------
  362|  2.44k|                    xmlOutputBufferWriteString(buf,
  363|  2.44k|                            (const char *) cur->prefix);
  364|  2.44k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  2.44k|                }
  366|   117k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|   117k|                break;
  368|  65.0k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 65.0k, False: 167k]
  ------------------
  369|   114k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 49.4k, False: 183k]
  ------------------
  370|   114k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 113k, False: 1.03k]
  ------------------
  371|   113k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 113k, False: 0]
  ------------------
  372|   113k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 31.7k, False: 81.7k]
  ------------------
  373|  81.7k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 8.87k, False: 72.8k]
  ------------------
  374|  40.5k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|   114k|                cur = cur->c1;
  376|   114k|                continue;
  377|   232k|        }
  378|       |
  379|   232k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 228k, False: 3.50k]
  ------------------
  380|   228k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   228k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 228k]
  ------------------
  383|       |
  384|   228k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 48.8k, False: 180k]
  ------------------
  385|   180k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 64.5k, False: 115k]
  ------------------
  386|   113k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 31.7k, False: 81.7k]
  ------------------
  387|  81.7k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 8.87k, False: 72.8k]
  ------------------
  388|  40.5k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   228k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   228k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 114k, False: 114k]
  ------------------
  392|   114k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 65.0k, False: 49.4k]
  ------------------
  393|  65.0k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  49.4k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 49.4k, False: 0]
  ------------------
  395|  49.4k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|   114k|                cur = parent->c2;
  398|   114k|                break;
  399|   114k|            }
  400|       |
  401|   114k|            cur = parent;
  402|   114k|        }
  403|   232k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 228k, False: 3.50k]
  ------------------
  404|       |
  405|  3.50k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  3.50k|    xmlBufDumpElementOccur(buf, content);
  407|  3.50k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   232k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   232k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 232k, False: 0]
  ------------------
  323|   168k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 168k, False: 63.5k]
  ------------------
  324|   168k|            break;
  325|  29.1k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 29.1k, False: 203k]
  ------------------
  326|  29.1k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  29.1k|            break;
  328|  26.6k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 26.6k, False: 205k]
  ------------------
  329|  26.6k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  26.6k|            break;
  331|  7.70k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 7.70k, False: 224k]
  ------------------
  332|  7.70k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  7.70k|            break;
  334|   232k|    }
  335|   232k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  9.00k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  9.00k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  9.00k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  9.00k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  9.00k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  9.00k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 2.96k, False: 6.04k]
  ------------------
  478|  2.96k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  2.96k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  2.96k|    }
  481|  9.00k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  9.00k|    switch (attr->atype) {
  484|    580|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 580, False: 8.42k]
  ------------------
  485|    580|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|    580|	    break;
  487|  1.19k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 1.19k, False: 7.81k]
  ------------------
  488|  1.19k|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|  1.19k|	    break;
  490|    407|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 407, False: 8.60k]
  ------------------
  491|    407|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    407|	    break;
  493|    265|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 265, False: 8.74k]
  ------------------
  494|    265|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    265|	    break;
  496|    506|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 506, False: 8.50k]
  ------------------
  497|    506|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    506|	    break;
  499|    450|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 450, False: 8.55k]
  ------------------
  500|    450|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    450|	    break;
  502|    238|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 238, False: 8.76k]
  ------------------
  503|    238|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    238|	    break;
  505|    240|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 240, False: 8.76k]
  ------------------
  506|    240|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    240|	    break;
  508|  4.81k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 4.81k, False: 4.19k]
  ------------------
  509|  4.81k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  4.81k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  4.81k|	    break;
  512|    321|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 321, False: 8.68k]
  ------------------
  513|    321|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    321|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    321|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 9.00k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  9.00k|    }
  520|       |
  521|  9.00k|    switch (attr->def) {
  522|  7.24k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 7.24k, False: 1.75k]
  ------------------
  523|  7.24k|	    break;
  524|    509|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 509, False: 8.49k]
  ------------------
  525|    509|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    509|	    break;
  527|    598|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 598, False: 8.40k]
  ------------------
  528|    598|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    598|	    break;
  530|    652|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 652, False: 8.35k]
  ------------------
  531|    652|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|    652|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 9.00k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  9.00k|    }
  537|       |
  538|  9.00k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 4.49k, False: 4.51k]
  ------------------
  539|  4.49k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  4.49k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  4.49k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  4.49k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  4.49k|    }
  543|       |
  544|  9.00k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  9.00k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  5.13k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  11.8k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 6.74k, False: 5.13k]
  ------------------
  454|  6.74k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  6.74k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 1.61k, False: 5.13k]
  ------------------
  456|  1.61k|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  6.74k|        cur = cur->next;
  459|  6.74k|    }
  460|       |
  461|  5.13k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  5.13k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  4.66k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  4.66k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 475, False: 4.18k]
  ------------------
  594|  4.18k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 462, False: 3.72k]
  ------------------
  595|    937|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  3.72k|    else
  597|  3.72k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  4.66k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  4.66k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  4.66k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 1.13k, False: 3.53k]
  ------------------
  602|  3.53k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 814, False: 2.71k]
  ------------------
  603|  2.71k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 462, False: 2.25k]
  ------------------
  604|  2.40k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 880, False: 1.52k]
  ------------------
  605|    880|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    880|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    880|             xmlOutputBufferWrite(buf, 1, " ");
  608|  1.52k|        } else {
  609|  1.52k|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|  1.52k|        }
  611|  2.40k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  2.40k|    }
  613|       |
  614|  4.66k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 814, False: 3.84k]
  ------------------
  615|    814|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 586, False: 228]
  ------------------
  616|    586|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    586|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 66, False: 520]
  ------------------
  618|     66|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    520|            else
  620|    520|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    586|        }
  622|    814|    }
  623|       |
  624|  4.66k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 1.77k, False: 2.88k]
  ------------------
  625|  2.88k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 475, False: 2.40k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.25k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.21k, False: 37]
  ------------------
  631|  2.21k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     37|        else
  633|     37|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.25k|    }
  635|       |
  636|  4.66k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  4.66k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     37|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     37|    const char * base, *cur;
  557|       |
  558|     37|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 37]
  ------------------
  559|      0|        return;
  560|       |
  561|     37|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     37|    base = cur = (const char *) content;
  563|    487|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 450, False: 37]
  ------------------
  564|    450|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 450]
  ------------------
  565|      0|            if (base != cur)
  ------------------
  |  Branch (565:17): [True: 0, False: 0]
  ------------------
  566|      0|                xmlOutputBufferWrite(buf, cur - base, base);
  567|      0|            xmlOutputBufferWrite(buf, 6, "&quot;");
  568|      0|            cur++;
  569|      0|            base = cur;
  570|    450|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 450]
  ------------------
  571|      0|            if (base != cur)
  ------------------
  |  Branch (571:17): [True: 0, False: 0]
  ------------------
  572|      0|                xmlOutputBufferWrite(buf, cur - base, base);
  573|      0|            xmlOutputBufferWrite(buf, 6, "&#x25;");
  574|      0|            cur++;
  575|      0|            base = cur;
  576|    450|        } else {
  577|    450|            cur++;
  578|    450|        }
  579|    450|    }
  580|     37|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 37, False: 0]
  ------------------
  581|     37|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     37|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     37|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   411k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|   830k|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 419k, False: 411k]
  ------------------
  801|   419k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   419k|	cur = cur->next;
  803|   419k|    }
  804|   411k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  7.58k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  7.58k|    xmlAttrPtr xml_lang = NULL;
 1423|  7.58k|    xmlAttrPtr lang = NULL;
 1424|  7.58k|    xmlAttrPtr name = NULL;
 1425|  7.58k|    xmlAttrPtr id = NULL;
 1426|  7.58k|    xmlNodePtr parent;
 1427|  7.58k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  7.58k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 7.58k]
  ------------------
 1430|  7.58k|    buf = ctxt->buf;
 1431|  7.58k|    parent = cur->parent;
 1432|  23.5k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 15.9k, False: 7.58k]
  ------------------
 1433|  15.9k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  15.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 15.0k, False: 914]
  |  Branch (1433:27): [True: 401, False: 14.6k]
  ------------------
 1434|    401|	    id = cur;
 1435|  15.5k|	else
 1436|  15.5k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  14.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 14.6k, False: 914]
  |  Branch (1436:27): [True: 1.98k, False: 12.6k]
  ------------------
 1437|  1.98k|	    name = cur;
 1438|  13.6k|	else
 1439|  13.6k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  12.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 12.6k, False: 914]
  |  Branch (1439:27): [True: 547, False: 12.1k]
  ------------------
 1440|    547|	    lang = cur;
 1441|  13.0k|	else
 1442|  13.0k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|    914|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 914, False: 12.1k]
  |  Branch (1442:27): [True: 673, False: 241]
  ------------------
 1443|    673|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    673|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 607, False: 66]
  ------------------
 1444|    607|	    xml_lang = cur;
 1445|  15.9k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  15.9k|	cur = cur->next;
 1447|  15.9k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  7.58k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 1.98k, False: 5.60k]
  |  Branch (1451:27): [True: 1.77k, False: 204]
  ------------------
 1452|  1.77k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 1.77k, False: 0]
  |  Branch (1452:26): [True: 1.77k, False: 0]
  ------------------
 1453|  1.77k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  1.77k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 201, False: 1.57k]
  ------------------
 1454|  1.57k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.57k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 72, False: 1.50k]
  ------------------
 1455|  1.50k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.50k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 218, False: 1.28k]
  ------------------
 1456|  1.28k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.28k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 228, False: 1.05k]
  ------------------
 1457|  1.05k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 198, False: 860]
  ------------------
 1458|    860|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|    860|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 201, False: 659]
  ------------------
 1459|    659|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|    659|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 205, False: 454]
  ------------------
 1460|    454|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    454|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 46, False: 408]
  ------------------
 1461|  1.57k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    408|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 208, False: 200]
  ------------------
 1462|  1.57k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  1.57k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  1.57k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  1.57k|	}
 1466|  1.77k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  7.58k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 545, False: 7.03k]
  |  Branch (1470:27): [True: 341, False: 204]
  ------------------
 1471|    341|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    341|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    341|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    341|    } else
 1475|  7.24k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 427, False: 6.81k]
  |  Branch (1475:31): [True: 223, False: 204]
  ------------------
 1476|    223|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    223|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    223|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    223|    }
 1480|  7.58k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|   173k|{
  242|   173k|    xmlNodePtr children;
  243|   173k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|   173k|    children = attr->children;
  246|   325k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 152k, False: 173k]
  ------------------
  247|   152k|        switch (children->type) {
  248|   151k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 151k, False: 382]
  ------------------
  249|   151k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|   151k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|   151k|		break;
  251|    382|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 382, False: 151k]
  ------------------
  252|    382|                xmlOutputBufferWrite(buf, 1, "&");
  253|    382|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    382|                xmlOutputBufferWrite(buf, 1, ";");
  255|    382|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 152k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|   152k|        }
  260|   152k|        children = children->next;
  261|   152k|    }
  262|   173k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  12.4k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  12.4k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 12.4k]
  ------------------
 1358|      0|	return(-1);
 1359|  12.4k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 12.4k]
  ------------------
 1360|      0|	return(0);
 1361|  12.4k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|    759|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|    759|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 759, False: 11.7k]
  |  Branch (1361:31): [True: 542, False: 217]
  ------------------
 1362|    542|	return(0);
 1363|  11.9k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 11.9k]
  ------------------
 1364|      0|	return(0);
 1365|  11.9k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 11.9k, False: 0]
  |  Branch (1365:13): [True: 9.43k, False: 2.48k]
  ------------------
 1366|  1.81k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 1.81k, False: 10.0k]
  ------------------
 1367|  1.81k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  1.81k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 209, False: 1.61k]
  ------------------
 1368|    209|		return(1);
 1369|  1.61k|	    return(0);
 1370|    904|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 904, False: 11.0k]
  ------------------
 1371|    904|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|    904|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 69, False: 835]
  ------------------
 1372|     69|		return(1);
 1373|    835|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    835|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 293, False: 542]
  ------------------
 1374|    293|		return(1);
 1375|    542|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    542|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 211, False: 331]
  ------------------
 1376|    211|		return(1);
 1377|    331|	    return(0);
 1378|    647|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 647, False: 11.2k]
  ------------------
 1379|    647|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    647|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 220, False: 427]
  ------------------
 1380|    220|		return(1);
 1381|    427|	    return(0);
 1382|    732|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 732, False: 11.1k]
  ------------------
 1383|    732|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|    732|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 207, False: 525]
  ------------------
 1384|    207|		return(1);
 1385|    525|	    return(0);
 1386|    801|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 801, False: 11.1k]
  ------------------
 1387|    801|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    801|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 205, False: 596]
  ------------------
 1388|    205|		return(1);
 1389|    596|	    return(0);
 1390|  1.97k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.97k, False: 9.93k]
  ------------------
 1391|  1.97k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.97k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 1.21k, False: 762]
  ------------------
 1392|  1.21k|		return(1);
 1393|    762|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    762|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 220, False: 542]
  ------------------
 1394|    220|		return(1);
 1395|    542|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    542|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 234, False: 308]
  ------------------
 1396|    234|		return(1);
 1397|    308|	    return(0);
 1398|    317|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 317, False: 11.6k]
  ------------------
 1399|    317|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    317|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 77, False: 240]
  ------------------
 1400|     77|		return(1);
 1401|    240|	    return(0);
 1402|  1.24k|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 1.24k, False: 10.6k]
  ------------------
 1403|  1.24k|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|  1.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 285, False: 957]
  ------------------
 1404|    285|		return(1);
 1405|    957|	    return(0);
 1406|    989|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 989, False: 10.9k]
  ------------------
 1407|    989|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    989|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 209, False: 780]
  ------------------
 1408|    209|		return(1);
 1409|    780|	    return(0);
 1410|  11.9k|    }
 1411|  2.48k|    return(0);
 1412|  11.9k|}
xmlsave.c:xmlSaveWriteText:
  226|   589k|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|   589k|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 589k]
  ------------------
  228|      0|        flags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  229|       |
  230|       |    xmlSerializeText(ctxt->buf, text, SIZE_MAX, flags);
  231|   589k|}
xmlsave.c:xmlAttrDumpOutput:
  881|   171k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|   171k|    xmlOutputBufferPtr buf;
  883|       |
  884|   171k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 171k]
  ------------------
  885|   171k|    buf = ctxt->buf;
  886|   171k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 171k]
  ------------------
  887|   171k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 171k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|   171k|    else
  890|   171k|        xmlOutputBufferWrite(buf, 1, " ");
  891|   171k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 18.9k, False: 152k]
  |  Branch (891:30): [True: 18.5k, False: 384]
  ------------------
  892|  18.5k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|  18.5k|	xmlOutputBufferWrite(buf, 1, ":");
  894|  18.5k|    }
  895|   171k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|   171k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|   171k|#ifdef LIBXML_HTML_ENABLED
  898|   171k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 15.9k, False: 155k]
  ------------------
  899|  15.9k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 15.0k, False: 914]
  ------------------
  900|  15.0k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 7.87k, False: 7.20k]
  ------------------
  901|  7.20k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 7.20k]
  ------------------
  902|  7.20k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 4.95k, False: 2.24k]
  ------------------
  903|  12.8k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 232, False: 12.5k]
  ------------------
  904|    232|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    232|    } else
  906|   170k|#endif
  907|   170k|    {
  908|   170k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|   170k|    }
  910|   171k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|   171k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  47.1k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  47.1k|    int format = ctxt->format;
  963|  47.1k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  47.1k|    xmlAttrPtr attr;
  965|  47.1k|    xmlChar *start, *end;
  966|  47.1k|    xmlOutputBufferPtr buf;
  967|       |
  968|  47.1k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 47.1k]
  ------------------
  969|  47.1k|    buf = ctxt->buf;
  970|       |
  971|  47.1k|    root = cur;
  972|  47.1k|    parent = cur->parent;
  973|  1.81M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 1.81M, Folded]
  ------------------
  974|  1.81M|        switch (cur->type) {
  975|    920|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 920, False: 1.81M]
  ------------------
  976|    920|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 1.81M]
  ------------------
  977|    920|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|    920|	    break;
  979|       |
  980|  10.7k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 10.7k, False: 1.80M]
  ------------------
  981|  10.7k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  10.7k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 1.81M]
  ------------------
  985|       |            /* Always validate cur->parent when descending. */
  986|      0|            if ((cur->parent == parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (986:17): [True: 0, False: 0]
  |  Branch (986:44): [True: 0, False: 0]
  ------------------
  987|      0|                parent = cur;
  988|      0|                cur = cur->children;
  989|      0|                continue;
  990|      0|            }
  991|      0|	    break;
  992|       |
  993|  5.77k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 5.77k, False: 1.80M]
  ------------------
  994|  5.77k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  5.77k|            break;
  996|       |
  997|  9.00k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 9.00k, False: 1.80M]
  ------------------
  998|  9.00k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  9.00k|            break;
 1000|       |
 1001|  4.66k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 4.66k, False: 1.80M]
  ------------------
 1002|  4.66k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  4.66k|            break;
 1004|       |
 1005|   940k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 940k, False: 872k]
  ------------------
 1006|   940k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 935k, False: 4.99k]
  |  Branch (1006:27): [True: 0, False: 935k]
  ------------------
 1007|      0|                xmlSaveWriteIndent(ctxt, 0);
 1008|       |
 1009|       |            /*
 1010|       |             * Some users like lxml are known to pass nodes with a corrupted
 1011|       |             * tree structure. Fall back to a recursive call to handle this
 1012|       |             * case.
 1013|       |             */
 1014|   940k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 940k]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|   940k|            xmlOutputBufferWrite(buf, 1, "<");
 1020|   940k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 141k, False: 798k]
  |  Branch (1020:38): [True: 137k, False: 4.77k]
  ------------------
 1021|   137k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|   137k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|   137k|            }
 1024|   940k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|   940k|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 408k, False: 531k]
  ------------------
 1026|   408k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  1.09M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 155k, False: 940k]
  ------------------
 1028|   155k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|   940k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 131k, False: 808k]
  ------------------
 1031|   131k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 131k, False: 0]
  ------------------
 1032|   131k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 131k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|   131k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|   131k|                } else {
 1036|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1036:25): [True: 0, False: 0]
  ------------------
 1037|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1038|      0|                    xmlOutputBufferWrite(buf, 3, "></");
 1039|      0|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1039:25): [True: 0, False: 0]
  |  Branch (1039:46): [True: 0, False: 0]
  ------------------
 1040|      0|                        xmlOutputBufferWriteString(buf,
 1041|      0|                                (const char *)cur->ns->prefix);
 1042|      0|                        xmlOutputBufferWrite(buf, 1, ":");
 1043|      0|                    }
 1044|      0|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1045|      0|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1045:25): [True: 0, False: 0]
  ------------------
 1046|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1047|      0|                    xmlOutputBufferWrite(buf, 1, ">");
 1048|      0|                }
 1049|   808k|            } else {
 1050|   808k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 808k]
  ------------------
 1051|      0|                    tmp = cur->children;
 1052|      0|                    while (tmp != NULL) {
  ------------------
  |  Branch (1052:28): [True: 0, False: 0]
  ------------------
 1053|      0|                        if ((tmp->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1053:29): [True: 0, False: 0]
  ------------------
 1054|      0|                            (tmp->type == XML_CDATA_SECTION_NODE) ||
  ------------------
  |  Branch (1054:29): [True: 0, False: 0]
  ------------------
 1055|      0|                            (tmp->type == XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (1055:29): [True: 0, False: 0]
  ------------------
 1056|      0|                            ctxt->format = 0;
 1057|      0|                            unformattedNode = cur;
 1058|      0|                            break;
 1059|      0|                        }
 1060|      0|                        tmp = tmp->next;
 1061|      0|                    }
 1062|      0|                }
 1063|   808k|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 808k]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|   808k|                xmlOutputBufferWrite(buf, 1, ">");
 1066|   808k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 808k]
  ------------------
 1067|   808k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 808k, False: 0]
  ------------------
 1068|   808k|                parent = cur;
 1069|   808k|                cur = cur->children;
 1070|   808k|                continue;
 1071|   808k|            }
 1072|       |
 1073|   131k|            break;
 1074|       |
 1075|   423k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 423k, False: 1.38M]
  ------------------
 1076|   423k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 235, False: 422k]
  ------------------
 1077|    235|                break;
 1078|   422k|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 422k, False: 0]
  ------------------
 1079|   422k|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 422k]
  ------------------
 1080|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1081|      0|                                               ctxt->escape);
 1082|       |#ifdef TEST_OUTPUT_BUFFER_WRITE_ESCAPE
 1083|       |                else if (ctxt->encoding)
 1084|       |                    xmlOutputBufferWriteEscape(buf, cur->content, NULL);
 1085|       |#endif
 1086|   422k|                else
 1087|   422k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|   422k|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|   422k|	    break;
 1095|       |
 1096|    891|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 891, False: 1.81M]
  ------------------
 1097|    891|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 297, False: 594]
  |  Branch (1097:27): [True: 0, False: 297]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|    891|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 215, False: 676]
  ------------------
 1101|    215|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    215|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    215|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 215, False: 0]
  ------------------
 1104|    215|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 215]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    215|                    else
 1107|    215|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    215|                    xmlOutputBufferWriteString(buf,
 1109|    215|                            (const char *)cur->content);
 1110|    215|                }
 1111|    215|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|    676|            } else {
 1113|    676|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    676|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    676|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 676]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    676|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    676|            }
 1119|    891|            break;
 1120|       |
 1121|  7.54k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 7.54k, False: 1.80M]
  ------------------
 1122|  7.54k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 4.57k, False: 2.97k]
  |  Branch (1122:27): [True: 0, False: 4.57k]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|  7.54k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 7.54k, False: 0]
  ------------------
 1126|  7.54k|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|  7.54k|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|  7.54k|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|  7.54k|            }
 1130|  7.54k|            break;
 1131|       |
 1132|    596|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 596, False: 1.81M]
  ------------------
 1133|    596|            xmlOutputBufferWrite(buf, 1, "&");
 1134|    596|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|    596|            xmlOutputBufferWrite(buf, 1, ";");
 1136|    596|            break;
 1137|       |
 1138|    964|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 964, False: 1.81M]
  ------------------
 1139|    964|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 964]
  |  Branch (1139:41): [True: 256, False: 708]
  ------------------
 1140|    256|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    708|            } else {
 1142|    708|                start = end = cur->content;
 1143|  2.79k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 2.08k, False: 708]
  ------------------
 1144|  2.08k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 557, False: 1.52k]
  |  Branch (1144:42): [True: 289, False: 268]
  ------------------
 1145|    289|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 289]
  ------------------
 1146|      0|                        end = end + 2;
 1147|      0|                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1148|      0|                        xmlOutputBufferWrite(buf, end - start,
 1149|      0|                                (const char *)start);
 1150|      0|                        xmlOutputBufferWrite(buf, 3, "]]>");
 1151|      0|                        start = end;
 1152|      0|                    }
 1153|  2.08k|                    end++;
 1154|  2.08k|                }
 1155|    708|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 708, False: 0]
  ------------------
 1156|    708|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    708|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    708|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    708|                }
 1160|    708|            }
 1161|    964|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 1.81M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 1.81M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   408k|        default:
  ------------------
  |  Branch (1171:9): [True: 408k, False: 1.40M]
  ------------------
 1172|   408k|            break;
 1173|  1.81M|        }
 1174|       |
 1175|  1.81M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 1.81M, Folded]
  ------------------
 1176|  1.81M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 47.1k, False: 1.76M]
  ------------------
 1177|  47.1k|                return;
 1178|  1.76M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 1.76M]
  ------------------
 1179|      0|                (cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1179:17): [True: 0, False: 0]
  ------------------
 1180|      0|                (cur->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1180:17): [True: 0, False: 0]
  ------------------
 1181|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1182|  1.76M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 957k, False: 808k]
  ------------------
 1183|   957k|                cur = cur->next;
 1184|   957k|                break;
 1185|   957k|            }
 1186|       |
 1187|   808k|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|   808k|            parent = cur->parent;
 1190|       |
 1191|   808k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 808k, False: 0]
  ------------------
 1192|   808k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 808k, False: 0]
  ------------------
 1193|   808k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 808k]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|   808k|                xmlOutputBufferWrite(buf, 2, "</");
 1197|   808k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 14.3k, False: 794k]
  |  Branch (1197:42): [True: 10.1k, False: 4.18k]
  ------------------
 1198|  10.1k|                    xmlOutputBufferWriteString(buf,
 1199|  10.1k|                            (const char *)cur->ns->prefix);
 1200|  10.1k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  10.1k|                }
 1202|       |
 1203|   808k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|   808k|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 808k]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|   808k|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|   808k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 808k]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|   808k|            }
 1213|   808k|        }
 1214|  1.00M|    }
 1215|  47.1k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.73k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.73k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.73k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.73k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 877, False: 856]
  ------------------
  276|    877|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    877|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    877|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 498, False: 379]
  ------------------
  279|    498|	    xmlOutputBufferWrite(buf, 1, " ");
  280|    498|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|    498|	}
  282|    877|    } else {
  283|    856|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    856|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    856|    }
  286|       |
  287|  1.73k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.73k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.73k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.73k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.73k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.73k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.73k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.73k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  43.2k|{
  154|  43.2k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 43.2k]
  ------------------
  155|       |
  156|  43.2k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  43.2k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  43.2k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 43.2k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  43.2k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 43.2k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  43.2k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 43.2k, False: 0]
  ------------------
  164|  43.2k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  43.2k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 43.2k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  43.2k|    ctxt->options = options;
  168|  43.2k|}

xmlInitSchemasTypesInternal:
  522|      2|{
  523|      2|    xmlInitMutex(&xmlSchemasTypesMutex);
  524|      2|}

xmlStrndup:
   50|  28.4M|xmlStrndup(const xmlChar *cur, int len) {
   51|  28.4M|    xmlChar *ret;
   52|       |
   53|  28.4M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 28.4M]
  |  Branch (53:26): [True: 0, False: 28.4M]
  ------------------
   54|  28.4M|    ret = xmlMalloc((size_t) len + 1);
   55|  28.4M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 3.16k, False: 28.4M]
  ------------------
   56|  3.16k|        return(NULL);
   57|  3.16k|    }
   58|  28.4M|    memcpy(ret, cur, len);
   59|  28.4M|    ret[len] = 0;
   60|  28.4M|    return(ret);
   61|  28.4M|}
xmlStrdup:
   72|  22.5M|xmlStrdup(const xmlChar *cur) {
   73|  22.5M|    const xmlChar *p = cur;
   74|       |
   75|  22.5M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 53, False: 22.5M]
  ------------------
   76|   983M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 960M, False: 22.5M]
  ------------------
   77|  22.5M|    return(xmlStrndup(cur, p - cur));
   78|  22.5M|}
xmlCharStrndup:
   89|   942k|xmlCharStrndup(const char *cur, int len) {
   90|   942k|    int i;
   91|   942k|    xmlChar *ret;
   92|       |
   93|   942k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 942k]
  |  Branch (93:26): [True: 0, False: 942k]
  ------------------
   94|   942k|    ret = xmlMalloc((size_t) len + 1);
   95|   942k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 152, False: 942k]
  ------------------
   96|    152|        return(NULL);
   97|    152|    }
   98|  86.3M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 85.3M, False: 942k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  85.3M|        ret[i] = (xmlChar) cur[i];
  101|  85.3M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 85.3M]
  ------------------
  102|  85.3M|    }
  103|   942k|    ret[len] = 0;
  104|   942k|    return(ret);
  105|   942k|}
xmlCharStrdup:
  115|   942k|xmlCharStrdup(const char *cur) {
  116|   942k|    const char *p = cur;
  117|       |
  118|   942k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 942k]
  ------------------
  119|  86.5M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 85.5M, False: 942k]
  ------------------
  120|   942k|    return(xmlCharStrndup(cur, p - cur));
  121|   942k|}
xmlStrcmp:
  132|  4.37k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  4.37k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 4.10k, False: 273]
  ------------------
  134|    273|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 273, False: 0]
  ------------------
  135|      0|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (135:9): [True: 0, False: 0]
  ------------------
  136|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  137|      0|    return(strcmp((const char *)str1, (const char *)str2));
  138|       |#else
  139|       |    do {
  140|       |        int tmp = *str1++ - *str2;
  141|       |        if (tmp != 0) return(tmp);
  142|       |    } while (*str2++ != 0);
  143|       |    return 0;
  144|       |#endif
  145|      0|}
xmlStrEqual:
  157|  29.9M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  29.9M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 1.43M, False: 28.4M]
  ------------------
  159|  28.4M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 439k, False: 28.0M]
  ------------------
  160|  28.0M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 2.86M, False: 25.1M]
  ------------------
  161|  25.1M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  25.1M|    return(strcmp((const char *)str1, (const char *)str2) == 0);
  163|       |#else
  164|       |    do {
  165|       |        if (*str1++ != *str2) return(0);
  166|       |    } while (*str2++);
  167|       |    return(1);
  168|       |#endif
  169|  28.0M|}
xmlStrQEqual:
  181|  44.3k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  44.3k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 17.7k, False: 26.5k]
  ------------------
  183|  26.5k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 26.5k]
  ------------------
  184|  26.5k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 26.5k]
  ------------------
  185|       |
  186|   112k|    do {
  187|   112k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 112k]
  ------------------
  188|   112k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 112k, False: 0]
  |  Branch (188:26): [True: 86.3k, False: 26.5k]
  ------------------
  189|  26.5k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 26.5k]
  ------------------
  190|   321k|    do {
  191|   321k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 321k]
  ------------------
  192|   321k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 295k, False: 26.5k]
  ------------------
  193|  26.5k|    return(1);
  194|  26.5k|}
xmlStrncmp:
  206|  25.4M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  25.4M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 38, False: 25.4M]
  ------------------
  208|  25.4M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 25.4M]
  ------------------
  209|  25.4M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 1, False: 25.4M]
  ------------------
  210|  25.4M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 25.4M]
  ------------------
  211|  25.4M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  25.4M|    return(strncmp((const char *)str1, (const char *)str2, len));
  213|       |#else
  214|       |    do {
  215|       |        int tmp = *str1++ - *str2;
  216|       |        if (tmp != 0 || --len == 0) return(tmp);
  217|       |    } while (*str2++ != 0);
  218|       |    return 0;
  219|       |#endif
  220|  25.4M|}
xmlStrcasecmp:
  266|   107k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|   107k|    register int tmp;
  268|       |
  269|   107k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 107k]
  ------------------
  270|   107k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 107k]
  ------------------
  271|   107k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 107k]
  ------------------
  272|   259k|    do {
  273|   259k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   259k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 103k, False: 155k]
  ------------------
  275|   259k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 151k, False: 4.43k]
  ------------------
  276|  4.43k|    return 0;
  277|   107k|}
xmlStrchr:
  312|  93.7M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  93.7M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 93.7M]
  ------------------
  314|   385M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 293M, False: 92.3M]
  ------------------
  315|   293M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 1.37M, False: 291M]
  ------------------
  316|   291M|        str++;
  317|   291M|    }
  318|  92.3M|    return(NULL);
  319|  93.7M|}
xmlStrstr:
  330|  1.47M|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|  1.47M|    int n;
  332|       |
  333|  1.47M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 1.47M]
  ------------------
  334|  1.47M|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 1.47M]
  ------------------
  335|  1.47M|    n = xmlStrlen(val);
  336|       |
  337|  1.47M|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 338, False: 1.47M]
  ------------------
  338|  4.50M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 3.06M, False: 1.44M]
  ------------------
  339|  3.06M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 37.6k, False: 3.02M]
  ------------------
  340|  37.6k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 28.7k, False: 8.96k]
  ------------------
  341|  37.6k|        }
  342|  3.03M|        str++;
  343|  3.03M|    }
  344|  1.44M|    return(NULL);
  345|  1.47M|}
xmlStrlen:
  405|  3.99M|xmlStrlen(const xmlChar *str) {
  406|  3.99M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 3.99M, False: 2.44k]
  ------------------
  407|  3.99M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 3.99M]
  ------------------
  408|  3.99M|}
xmlStrncat:
  423|  1.25M|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|  1.25M|    int size;
  425|  1.25M|    xmlChar *ret;
  426|       |
  427|  1.25M|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 1.25M]
  |  Branch (427:26): [True: 660, False: 1.25M]
  ------------------
  428|    660|        return(cur);
  429|       |
  430|  1.25M|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 1.25M]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|  1.25M|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 1.25M]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|  1.25M|    size = xmlStrlen(cur);
  440|  1.25M|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 1.25M]
  |  Branch (440:23): [True: 0, False: 1.25M]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|  1.25M|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|  1.25M|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 14, False: 1.25M]
  ------------------
  446|     14|        xmlFree(cur);
  447|     14|        return(NULL);
  448|     14|    }
  449|  1.25M|    memcpy(&ret[size], add, len);
  450|  1.25M|    ret[size + len] = 0;
  451|  1.25M|    return(ret);
  452|  1.25M|}
xmlStrncatNew:
  465|     63|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     63|    int size;
  467|     63|    xmlChar *ret;
  468|       |
  469|     63|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 63]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     63|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 63, False: 0]
  ------------------
  475|     63|        return(xmlStrndup(str2, len));
  476|      0|    if ((str2 == NULL) || (len == 0))
  ------------------
  |  Branch (476:9): [True: 0, False: 0]
  |  Branch (476:27): [True: 0, False: 0]
  ------------------
  477|      0|        return(xmlStrdup(str1));
  478|       |
  479|      0|    size = xmlStrlen(str1);
  480|      0|    if ((size < 0) || (size > INT_MAX - len))
  ------------------
  |  Branch (480:9): [True: 0, False: 0]
  |  Branch (480:23): [True: 0, False: 0]
  ------------------
  481|      0|        return(NULL);
  482|      0|    ret = (xmlChar *) xmlMalloc((size_t) size + len + 1);
  483|      0|    if (ret == NULL)
  ------------------
  |  Branch (483:9): [True: 0, False: 0]
  ------------------
  484|      0|        return(NULL);
  485|      0|    memcpy(ret, str1, size);
  486|      0|    memcpy(&ret[size], str2, len);
  487|      0|    ret[size + len] = 0;
  488|      0|    return(ret);
  489|      0|}
xmlStrcat:
  502|  1.25M|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|  1.25M|    const xmlChar *p = add;
  504|       |
  505|  1.25M|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 3, False: 1.25M]
  ------------------
  506|  1.25M|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 3, False: 1.25M]
  ------------------
  507|      3|        return(xmlStrdup(add));
  508|       |
  509|  16.3M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 15.0M, False: 1.25M]
  ------------------
  510|  1.25M|    return(xmlStrncat(cur, add, p - add));
  511|  1.25M|}
xmlStrVASPrintf:
  573|  1.40M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.40M|    char empty[1];
  575|  1.40M|    va_list copy;
  576|  1.40M|    xmlChar *buf;
  577|  1.40M|    int res, size;
  578|  1.40M|    int truncated = 0;
  579|       |
  580|  1.40M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.40M]
  ------------------
  581|      0|        return(1);
  582|  1.40M|    *out = NULL;
  583|  1.40M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.40M]
  ------------------
  584|      0|        return(1);
  585|  1.40M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.40M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.40M|    va_copy(copy, ap);
  589|  1.40M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.40M|    va_end(copy);
  591|       |
  592|  1.40M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.40M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.40M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.40M, False: 411]
  ------------------
  596|  1.40M|            size = res + 1;
  597|  1.40M|        } else {
  598|    411|            size = maxSize;
  599|    411|            truncated = 1;
  600|    411|        }
  601|  1.40M|        buf = xmlMalloc(size);
  602|  1.40M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.57k, False: 1.40M]
  ------------------
  603|  1.57k|            return(-1);
  604|  1.40M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.40M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.40M|    } else {
  609|       |        /*
  610|       |         * Unfortunately, older snprintf implementations don't follow the
  611|       |         * C99 spec. If the output exceeds the size of the buffer, they can
  612|       |         * return -1, 0 or the number of characters written instead of the
  613|       |         * needed size. Older MSCVRT also won't write a terminating null
  614|       |         * byte if the buffer is too small.
  615|       |         *
  616|       |         * If the value returned is non-negative and strictly less than
  617|       |         * the buffer size (without terminating null), the result should
  618|       |         * have been written completely, so we double the buffer size
  619|       |         * until this condition is true. This assumes that snprintf will
  620|       |         * eventually return a non-negative value. Otherwise, we will
  621|       |         * allocate more and more memory until we run out.
  622|       |         *
  623|       |         * Note that this code path is also executed on conforming
  624|       |         * platforms if the output is the empty string.
  625|       |         */
  626|       |
  627|      0|        buf = NULL;
  628|      0|        size = 32;
  629|      0|        while (1) {
  ------------------
  |  Branch (629:16): [True: 0, Folded]
  ------------------
  630|      0|            buf = xmlMalloc(size);
  631|      0|            if (buf == NULL)
  ------------------
  |  Branch (631:17): [True: 0, False: 0]
  ------------------
  632|      0|                return(-1);
  633|       |
  634|      0|            va_copy(copy, ap);
  635|      0|            res = vsnprintf((char *) buf, size, msg, copy);
  636|      0|            va_end(copy);
  637|      0|            if ((res >= 0) && (res < size - 1))
  ------------------
  |  Branch (637:17): [True: 0, False: 0]
  |  Branch (637:31): [True: 0, False: 0]
  ------------------
  638|      0|                break;
  639|       |
  640|      0|            if (size >= maxSize) {
  ------------------
  |  Branch (640:17): [True: 0, False: 0]
  ------------------
  641|      0|                truncated = 1;
  642|      0|                break;
  643|      0|            }
  644|       |
  645|      0|            xmlFree(buf);
  646|       |
  647|      0|            if (size > maxSize / 2)
  ------------------
  |  Branch (647:17): [True: 0, False: 0]
  ------------------
  648|      0|                size = maxSize;
  649|      0|            else
  650|      0|                size *= 2;
  651|      0|        }
  652|      0|    }
  653|       |
  654|       |    /*
  655|       |     * If the output was truncated, make sure that the buffer doesn't
  656|       |     * end with a truncated UTF-8 sequence.
  657|       |     */
  658|  1.40M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 411, False: 1.40M]
  ------------------
  659|    411|        int i = size - 1;
  660|       |
  661|    703|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 703, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    703|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 171, False: 532]
  ------------------
  664|    171|                break;
  665|    532|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    532|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 240, False: 292]
  ------------------
  668|    240|                break;
  669|    532|        }
  670|       |
  671|    411|        buf[i] = 0;
  672|    411|    }
  673|       |
  674|  1.40M|    *out = (xmlChar *) buf;
  675|  1.40M|    return(truncated);
  676|  1.40M|}
xmlUTF8Strlen:
  770|  19.4k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  19.4k|    size_t ret = 0;
  772|       |
  773|  19.4k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 22, False: 19.4k]
  ------------------
  774|     22|        return(-1);
  775|       |
  776|  3.16M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 3.14M, False: 19.4k]
  ------------------
  777|  3.14M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 6.69k, False: 3.14M]
  ------------------
  778|  6.69k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 6.69k]
  ------------------
  779|      0|                return(-1);
  780|  6.69k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 1.88k, False: 4.80k]
  ------------------
  781|  1.88k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 1.88k]
  ------------------
  782|      0|                    return(-1);
  783|  1.88k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 1.48k, False: 400]
  ------------------
  784|  1.48k|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 1.48k]
  |  Branch (784:52): [True: 0, False: 1.48k]
  ------------------
  785|      0|                        return(-1);
  786|  1.48k|                    utf += 4;
  787|  1.48k|                } else {
  788|    400|                    utf += 3;
  789|    400|                }
  790|  4.80k|            } else {
  791|  4.80k|                utf += 2;
  792|  4.80k|            }
  793|  3.14M|        } else {
  794|  3.14M|            utf++;
  795|  3.14M|        }
  796|  3.14M|        ret++;
  797|  3.14M|    }
  798|  19.4k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 19.4k]
  ------------------
  799|  19.4k|}
xmlGetUTF8Char:
  812|  28.0M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  28.0M|    unsigned int c;
  814|       |
  815|  28.0M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 28.0M]
  ------------------
  816|      0|        goto error;
  817|  28.0M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 28.0M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  28.0M|    c = utf[0];
  821|  28.0M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 17.9M, False: 10.0M]
  ------------------
  822|  17.9M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 17.9M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  17.9M|        *len = 1;
  826|  17.9M|    } else {
  827|  10.0M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 255, False: 10.0M]
  |  Branch (827:27): [True: 130k, False: 9.94M]
  ------------------
  828|   130k|            goto error;
  829|  9.94M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 189k, False: 9.75M]
  ------------------
  830|   189k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 33.9k, False: 155k]
  ------------------
  831|  33.9k|                goto error;
  832|       |            /* 2-byte code */
  833|   155k|            *len = 2;
  834|   155k|            c = (c & 0x1f) << 6;
  835|   155k|            c |= utf[1] & 0x3f;
  836|  9.75M|        } else {
  837|  9.75M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 79, False: 9.75M]
  |  Branch (837:31): [True: 404, False: 9.75M]
  ------------------
  838|    483|                goto error;
  839|  9.75M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 9.75M, False: 5.11k]
  ------------------
  840|       |                /* 3-byte code */
  841|  9.75M|                *len = 3;
  842|  9.75M|                c = (c & 0xf) << 12;
  843|  9.75M|                c |= (utf[1] & 0x3f) << 6;
  844|  9.75M|                c |= utf[2] & 0x3f;
  845|  9.75M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 334, False: 9.75M]
  |  Branch (845:37): [True: 3.28M, False: 6.46M]
  |  Branch (845:54): [True: 214, False: 3.28M]
  ------------------
  846|    548|                    goto error;
  847|  9.75M|            } else {
  848|  5.11k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 76, False: 5.03k]
  |  Branch (848:35): [True: 422, False: 4.61k]
  ------------------
  849|    498|                    goto error;
  850|  4.61k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  4.61k|                c = (c & 0x7) << 18;
  853|  4.61k|                c |= (utf[1] & 0x3f) << 12;
  854|  4.61k|                c |= (utf[2] & 0x3f) << 6;
  855|  4.61k|                c |= utf[3] & 0x3f;
  856|  4.61k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 236, False: 4.37k]
  |  Branch (856:38): [True: 359, False: 4.01k]
  ------------------
  857|    595|                    goto error;
  858|  4.61k|            }
  859|  9.75M|        }
  860|  9.94M|    }
  861|  27.8M|    return(c);
  862|       |
  863|   166k|error:
  864|   166k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 166k, False: 0]
  ------------------
  865|   166k|	*len = 0;
  866|   166k|    return(-1);
  867|  28.0M|}
xmlUTF8Strsize:
  933|   107k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   107k|    const xmlChar *ptr=utf;
  935|   107k|    int ch;
  936|   107k|    size_t ret;
  937|       |
  938|   107k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 107k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   107k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 107k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   241k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 142k, False: 99.5k]
  ------------------
  945|   142k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 7.64k, False: 134k]
  ------------------
  946|  7.64k|            break;
  947|   134k|        ch = *ptr++;
  948|   134k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 422, False: 133k]
  ------------------
  949|  1.19k|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 772, False: 422]
  ------------------
  950|    772|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 772]
  ------------------
  951|    772|                ptr++;
  952|    772|	    }
  953|   134k|    }
  954|   107k|    ret = ptr - utf;
  955|   107k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 107k]
  ------------------
  956|   107k|}
xmlUTF8Strndup:
  967|  13.0k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|  13.0k|    xmlChar *ret;
  969|  13.0k|    int i;
  970|       |
  971|  13.0k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 13.0k]
  |  Branch (971:26): [True: 0, False: 13.0k]
  ------------------
  972|  13.0k|    i = xmlUTF8Strsize(utf, len);
  973|  13.0k|    ret = xmlMalloc((size_t) i + 1);
  974|  13.0k|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 5, False: 13.0k]
  ------------------
  975|      5|        return(NULL);
  976|      5|    }
  977|  13.0k|    memcpy(ret, utf, i);
  978|  13.0k|    ret[i] = 0;
  979|  13.0k|    return(ret);
  980|  13.0k|}
xmlUTF8Strpos:
  991|  12.9k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  12.9k|    int ch;
  993|       |
  994|  12.9k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 12.9k]
  ------------------
  995|  12.9k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 12.9k]
  ------------------
  996|      0|        return(NULL);
  997|  9.32M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 9.31M, False: 12.9k]
  ------------------
  998|  9.31M|        ch = *utf++;
  999|  9.31M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 9.31M]
  ------------------
 1000|      0|            return(NULL);
 1001|  9.31M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 9.77k, False: 9.30M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  9.77k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 9.77k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|  30.0k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 20.2k, False: 9.77k]
  ------------------
 1007|  20.2k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 20.2k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  9.77k|        }
 1010|  9.31M|    }
 1011|  12.9k|    return((xmlChar *)utf);
 1012|  12.9k|}
xmlUTF8Strloc:
 1023|  56.2k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|  56.2k|    size_t i;
 1025|  56.2k|    int size;
 1026|  56.2k|    int ch;
 1027|       |
 1028|  56.2k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 56.2k]
  |  Branch (1028:22): [True: 0, False: 56.2k]
  ------------------
 1029|  56.2k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  21.4M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 21.4M, False: 24.8k]
  ------------------
 1031|  21.4M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 31.4k, False: 21.3M]
  ------------------
 1032|  31.4k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 31.4k]
  ------------------
 1033|  21.3M|            utf++;
 1034|  21.3M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 29.2k, False: 21.3M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|  29.2k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 29.2k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|  96.8k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 67.5k, False: 29.2k]
  ------------------
 1040|  67.5k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 67.5k]
  ------------------
 1041|      0|                        return(-1);
 1042|  29.2k|            }
 1043|  21.3M|        }
 1044|       |
 1045|  24.8k|    return(-1);
 1046|  56.2k|}
xmlUTF8Strsub:
 1060|  13.0k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|  13.0k|    int i;
 1062|  13.0k|    int ch;
 1063|       |
 1064|  13.0k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 13.0k]
  ------------------
 1065|  13.0k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 13.0k]
  ------------------
 1066|  13.0k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 13.0k]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  21.4k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 8.36k, False: 13.0k]
  ------------------
 1072|  8.36k|        ch = *utf++;
 1073|  8.36k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 8.36k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  8.36k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 8.36k]
  ------------------
 1077|      0|            ch <<= 1;
 1078|      0|            while (ch & 0x80) {
  ------------------
  |  Branch (1078:20): [True: 0, False: 0]
  ------------------
 1079|      0|                if (*utf++ == 0)
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    return(NULL);
 1081|      0|                ch <<= 1;
 1082|      0|            }
 1083|      0|        }
 1084|  8.36k|    }
 1085|       |
 1086|  13.0k|    return(xmlUTF8Strndup(utf, len));
 1087|  13.0k|}

xmlInitXPathInternal:
  201|      2|xmlInitXPathInternal(void) {
  202|      2|    size_t i;
  203|       |
  204|      2|#if defined(NAN) && defined(INFINITY)
  205|      2|    xmlXPathNAN = NAN;
  206|      2|    xmlXPathPINF = INFINITY;
  207|      2|    xmlXPathNINF = -INFINITY;
  208|       |#else
  209|       |    /* MSVC doesn't allow division by zero in constant expressions. */
  210|       |    double zero = 0.0;
  211|       |    xmlXPathNAN = 0.0 / zero;
  212|       |    xmlXPathPINF = 1.0 / zero;
  213|       |    xmlXPathNINF = -xmlXPathPINF;
  214|       |#endif
  215|       |
  216|       |    /*
  217|       |     * Initialize hash table for standard functions
  218|       |     */
  219|       |
  220|    130|    for (i = 0; i < SF_HASH_SIZE; i++)
  ------------------
  |  |  168|    130|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (220:17): [True: 128, False: 2]
  ------------------
  221|    128|        xmlXPathSFHash[i] = UCHAR_MAX;
  222|       |
  223|     56|    for (i = 0; i < NUM_STANDARD_FUNCTIONS; i++) {
  ------------------
  |  |  166|     56|    (sizeof(xmlXPathStandardFunctions) / sizeof(xmlXPathStandardFunctions[0]))
  ------------------
  |  Branch (223:17): [True: 54, False: 2]
  ------------------
  224|     54|        const char *name = xmlXPathStandardFunctions[i].name;
  225|     54|        int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE;
  ------------------
  |  |   34|     54|#define BAD_CAST (xmlChar *)
  ------------------
                      int bucketIndex = xmlXPathSFComputeHash(BAD_CAST name) % SF_HASH_SIZE;
  ------------------
  |  |  168|     54|#define SF_HASH_SIZE 64
  ------------------
  226|       |
  227|     68|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (227:16): [True: 14, False: 54]
  ------------------
  228|     14|            bucketIndex += 1;
  229|     14|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|     14|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (229:17): [True: 0, False: 14]
  ------------------
  230|      0|                bucketIndex = 0;
  231|     14|        }
  232|       |
  233|     54|        xmlXPathSFHash[bucketIndex] = i;
  234|     54|    }
  235|      2|}
xmlXPathIsNaN:
  250|   521k|xmlXPathIsNaN(double val) {
  251|   521k|#ifdef isnan
  252|   521k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   521k|}
xmlXPathIsInf:
  265|   406k|xmlXPathIsInf(double val) {
  266|   406k|#ifdef isinf
  267|   406k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 21.3k, False: 385k]
  |  Branch (267:26): [True: 14.4k, False: 6.92k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   406k|}
xmlXPathErrMemory:
  677|  3.68k|{
  678|  3.68k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.68k]
  ------------------
  679|      0|        return;
  680|  3.68k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  3.68k|                        &ctxt->lastError);
  682|  3.68k|}
xmlXPathPErrMemory:
  691|  3.47k|{
  692|  3.47k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 3.47k]
  ------------------
  693|      0|        return;
  694|  3.47k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  3.47k|    xmlXPathErrMemory(ctxt->context);
  696|  3.47k|}
xmlXPathErr:
  777|  8.40k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  8.40k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  8.40k|}
xmlXPathFreeCompExpr:
  971|  12.7k|{
  972|  12.7k|    xmlXPathStepOpPtr op;
  973|  12.7k|    int i;
  974|       |
  975|  12.7k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 12.7k]
  ------------------
  976|      0|        return;
  977|  12.7k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 12.7k, False: 0]
  ------------------
  978|  3.83M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 3.82M, False: 12.7k]
  ------------------
  979|  3.82M|	    op = &comp->steps[i];
  980|  3.82M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 75.3k, False: 3.75M]
  ------------------
  981|  75.3k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 59.9k, False: 15.3k]
  ------------------
  982|  59.9k|		    xmlXPathFreeObject(op->value4);
  983|  15.3k|		else
  984|  15.3k|		    xmlFree(op->value4);
  985|  75.3k|	    }
  986|  3.82M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 76.3k, False: 3.75M]
  ------------------
  987|  76.3k|		xmlFree(op->value5);
  988|  3.82M|	}
  989|  12.7k|    } else {
  990|      0|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (990:14): [True: 0, False: 0]
  ------------------
  991|      0|	    op = &comp->steps[i];
  992|      0|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (992:10): [True: 0, False: 0]
  ------------------
  993|      0|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (993:7): [True: 0, False: 0]
  ------------------
  994|      0|		    xmlXPathFreeObject(op->value4);
  995|      0|	    }
  996|      0|	}
  997|      0|        xmlDictFree(comp->dict);
  998|      0|    }
  999|  12.7k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 12.7k, False: 0]
  ------------------
 1000|  12.7k|        xmlFree(comp->steps);
 1001|  12.7k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  12.7k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 12.7k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  12.7k|    xmlFree(comp);
 1012|  12.7k|}
xmlXPathValuePop:
 1979|  3.91M|{
 1980|  3.91M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  3.91M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 3.91M]
  |  Branch (1982:27): [True: 16.5k, False: 3.90M]
  ------------------
 1983|  16.5k|        return (NULL);
 1984|       |
 1985|  3.90M|    ctxt->valueNr--;
 1986|  3.90M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.16M, False: 737k]
  ------------------
 1987|  3.16M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   737k|    else
 1989|   737k|        ctxt->value = NULL;
 1990|  3.90M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  3.90M|    return (ret);
 1993|  3.91M|}
xmlXPathValuePush:
 2007|  3.91M|{
 2008|  3.91M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 3.91M]
  ------------------
 2009|  3.91M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 1.08k, False: 3.91M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|  1.08k|        xmlXPathPErrMemory(ctxt);
 2014|  1.08k|        return(-1);
 2015|  1.08k|    }
 2016|  3.91M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 339, False: 3.91M]
  ------------------
 2017|    339|        xmlXPathObjectPtr *tmp;
 2018|    339|        int newSize;
 2019|       |
 2020|    339|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    339|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    339|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    339|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 339]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    339|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    339|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 1, False: 338]
  ------------------
 2029|      1|            xmlXPathPErrMemory(ctxt);
 2030|      1|            xmlXPathFreeObject(value);
 2031|      1|            return (-1);
 2032|      1|        }
 2033|    338|	ctxt->valueTab = tmp;
 2034|    338|        ctxt->valueMax = newSize;
 2035|    338|    }
 2036|  3.91M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  3.91M|    ctxt->value = value;
 2038|  3.91M|    return (ctxt->valueNr++);
 2039|  3.91M|}
xmlXPathNodeSetSort:
 2552|  39.6k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  39.6k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 39.6k]
  ------------------
 2559|      0|	return;
 2560|       |
 2561|       |#ifndef WITH_TIM_SORT
 2562|       |    /*
 2563|       |     * Use the old Shell's sort implementation to sort the node-set
 2564|       |     * Timsort ought to be quite faster
 2565|       |     */
 2566|       |    len = set->nodeNr;
 2567|       |    for (incr = len / 2; incr > 0; incr /= 2) {
 2568|       |	for (i = incr; i < len; i++) {
 2569|       |	    j = i - incr;
 2570|       |	    while (j >= 0) {
 2571|       |#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
 2572|       |		if (xmlXPathCmpNodesExt(set->nodeTab[j],
 2573|       |			set->nodeTab[j + incr]) == -1)
 2574|       |#else
 2575|       |		if (xmlXPathCmpNodes(set->nodeTab[j],
 2576|       |			set->nodeTab[j + incr]) == -1)
 2577|       |#endif
 2578|       |		{
 2579|       |		    tmp = set->nodeTab[j];
 2580|       |		    set->nodeTab[j] = set->nodeTab[j + incr];
 2581|       |		    set->nodeTab[j + incr] = tmp;
 2582|       |		    j -= incr;
 2583|       |		} else
 2584|       |		    break;
 2585|       |	    }
 2586|       |	}
 2587|       |    }
 2588|       |#else /* WITH_TIM_SORT */
 2589|  39.6k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  39.6k|#endif /* WITH_TIM_SORT */
 2591|  39.6k|}
xmlXPathNodeSetFreeNs:
 2647|   181k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|   181k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 181k]
  |  Branch (2648:25): [True: 0, False: 181k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|   181k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 181k, False: 0]
  |  Branch (2651:31): [True: 181k, False: 0]
  ------------------
 2652|   181k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 128k, False: 53.0k]
  ------------------
 2653|   128k|	    xmlFree((xmlChar *)ns->href);
 2654|   181k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 133k, False: 48.4k]
  ------------------
 2655|   133k|	    xmlFree((xmlChar *)ns->prefix);
 2656|   181k|	xmlFree(ns);
 2657|   181k|    }
 2658|   181k|}
xmlXPathNodeSetCreate:
 2667|  2.24M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.24M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.24M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.24M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 305, False: 2.24M]
  ------------------
 2672|    305|	return(NULL);
 2673|  2.24M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.24M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.14M, False: 1.10M]
  ------------------
 2675|  1.14M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.14M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.14M|					     sizeof(xmlNodePtr));
 2677|  1.14M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 178, False: 1.14M]
  ------------------
 2678|    178|	    xmlFree(ret);
 2679|    178|	    return(NULL);
 2680|    178|	}
 2681|  1.14M|	memset(ret->nodeTab, 0 ,
 2682|  1.14M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.14M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.14M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.14M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.14M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 2.72k, False: 1.14M]
  ------------------
 2685|  2.72k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  2.72k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  2.72k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 4, False: 2.72k]
  ------------------
 2689|      4|                xmlXPathFreeNodeSet(ret);
 2690|      4|                return(NULL);
 2691|      4|            }
 2692|  2.72k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  2.72k|	} else
 2694|  1.14M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.14M|    }
 2696|  2.24M|    return(ret);
 2697|  2.24M|}
xmlXPathNodeSetAddNs:
 2761|   167k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|   167k|    int i;
 2763|   167k|    xmlNodePtr nsNode;
 2764|       |
 2765|   167k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 167k]
  |  Branch (2765:26): [True: 0, False: 167k]
  |  Branch (2765:42): [True: 0, False: 167k]
  ------------------
 2766|   167k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 167k]
  ------------------
 2767|   167k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 167k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   301k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 133k, False: 167k]
  ------------------
 2775|   133k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 133k, False: 0]
  ------------------
 2776|   133k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 133k, False: 0]
  ------------------
 2777|   133k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 133k, False: 0]
  ------------------
 2778|   133k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 133k]
  ------------------
 2779|      0|	    return(0);
 2780|   133k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|   167k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 9.88k, False: 157k]
  ------------------
 2786|  9.88k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 9, False: 9.87k]
  ------------------
 2787|      9|            return(-1);
 2788|  9.88k|    }
 2789|   167k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|   167k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 24, False: 167k]
  ------------------
 2791|     24|        return(-1);
 2792|   167k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|   167k|    return(0);
 2794|   167k|}
xmlXPathNodeSetAdd:
 2804|  1.82k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  1.82k|    int i;
 2806|       |
 2807|  1.82k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 1.82k]
  |  Branch (2807:26): [True: 0, False: 1.82k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  1.82k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 1.18k, False: 639]
  ------------------
 2814|  1.18k|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 1.18k, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    639|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 639, False: 0]
  ------------------
 2820|    639|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 2, False: 637]
  ------------------
 2821|      2|            return(-1);
 2822|    639|    }
 2823|       |
 2824|    637|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 637]
  ------------------
 2825|      0|	xmlNsPtr ns = (xmlNsPtr) val;
 2826|      0|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2827|       |
 2828|      0|        if (nsNode == NULL)
  ------------------
  |  Branch (2828:13): [True: 0, False: 0]
  ------------------
 2829|      0|            return(-1);
 2830|      0|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2831|      0|    } else
 2832|    637|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    637|    return(0);
 2834|    637|}
xmlXPathNodeSetAddUnique:
 2845|  5.48M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  5.48M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 5.48M]
  |  Branch (2846:26): [True: 0, False: 5.48M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  5.48M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.33M, False: 4.15M]
  ------------------
 2853|  1.33M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 165, False: 1.33M]
  ------------------
 2854|    165|            return(-1);
 2855|  1.33M|    }
 2856|       |
 2857|  5.48M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 4.83k, False: 5.48M]
  ------------------
 2858|  4.83k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  4.83k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  4.83k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 8, False: 4.82k]
  ------------------
 2862|      8|            return(-1);
 2863|  4.82k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  4.82k|    } else
 2865|  5.48M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  5.48M|    return(0);
 2867|  5.48M|}
xmlXPathNodeSetMerge:
 2880|  59.4k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  59.4k|    int i, j, initNr, skip;
 2882|  59.4k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  59.4k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 5, False: 59.4k]
  ------------------
 2885|      5|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      5|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 5]
  ------------------
 2887|      0|            return (NULL);
 2888|      5|    }
 2889|  59.4k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 25, False: 59.3k]
  ------------------
 2890|     25|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  59.3k|    initNr = val1->nodeNr;
 2894|       |
 2895|   863k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 804k, False: 59.3k]
  ------------------
 2896|   804k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   804k|	skip = 0;
 2901|  15.0M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 14.3M, False: 693k]
  ------------------
 2902|  14.3M|	    n1 = val1->nodeTab[j];
 2903|  14.3M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 110k, False: 14.2M]
  ------------------
 2904|   110k|		skip = 1;
 2905|   110k|		break;
 2906|  14.2M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 353, False: 14.2M]
  ------------------
 2907|    353|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 39, False: 314]
  ------------------
 2908|     39|		if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2908:7): [True: 39, False: 0]
  ------------------
 2909|     39|		    (xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2909:7): [True: 23, False: 16]
  ------------------
 2910|     39|			((xmlNsPtr) n2)->prefix)))
 2911|     23|		{
 2912|     23|		    skip = 1;
 2913|     23|		    break;
 2914|     23|		}
 2915|     39|	    }
 2916|  14.3M|	}
 2917|   804k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 110k, False: 693k]
  ------------------
 2918|   110k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   693k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 61.4k, False: 632k]
  ------------------
 2924|  61.4k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 24, False: 61.4k]
  ------------------
 2925|     24|                goto error;
 2926|  61.4k|        }
 2927|   693k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 6.62k, False: 686k]
  ------------------
 2928|  6.62k|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|  6.62k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|  6.62k|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 25, False: 6.60k]
  ------------------
 2932|     25|                goto error;
 2933|  6.60k|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|  6.60k|	} else
 2935|   686k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   693k|    }
 2937|       |
 2938|  59.3k|    return(val1);
 2939|       |
 2940|     49|error:
 2941|     49|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  59.3k|}
xmlXPathFreeNodeSet:
 3101|  2.24M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.24M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 25, False: 2.24M]
  ------------------
 3103|  2.24M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.64M, False: 603k]
  ------------------
 3104|  1.64M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  8.45M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 6.81M, False: 1.64M]
  ------------------
 3108|  6.81M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 6.81M, False: 0]
  ------------------
 3109|  6.81M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 179k, False: 6.63M]
  ------------------
 3110|   179k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.64M|	xmlFree(obj->nodeTab);
 3112|  1.64M|    }
 3113|  2.24M|    xmlFree(obj);
 3114|  2.24M|}
xmlXPathNewNodeSet:
 3191|  1.14M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.14M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.14M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.14M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 155, False: 1.14M]
  ------------------
 3196|    155|	return(NULL);
 3197|  1.14M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.14M|    ret->type = XPATH_NODESET;
 3199|  1.14M|    ret->boolval = 0;
 3200|  1.14M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.14M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 341, False: 1.14M]
  ------------------
 3202|    341|        xmlFree(ret);
 3203|    341|        return(NULL);
 3204|    341|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.14M|    return(ret);
 3207|  1.14M|}
xmlXPathWrapNodeSet:
 3267|  1.06M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.06M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.06M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.06M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 181, False: 1.06M]
  ------------------
 3272|    181|        xmlXPathFreeNodeSet(val);
 3273|    181|	return(NULL);
 3274|    181|    }
 3275|  1.06M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.06M|    ret->type = XPATH_NODESET;
 3277|  1.06M|    ret->nodesetval = val;
 3278|  1.06M|    return(ret);
 3279|  1.06M|}
xmlXPathFunctionLookup:
 3743|  7.52k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  7.52k|}
xmlXPathFunctionLookupNS:
 3758|  7.52k|			 const xmlChar *ns_uri) {
 3759|  7.52k|    xmlXPathFunction ret;
 3760|  7.52k|    void *payload;
 3761|       |
 3762|  7.52k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 7.52k]
  ------------------
 3763|      0|	return(NULL);
 3764|  7.52k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 7.52k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  7.52k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 7.52k, False: 8]
  ------------------
 3768|  7.52k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  7.52k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  10.3k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 9.82k, False: 537]
  ------------------
 3771|  9.82k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  9.82k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 6.98k, False: 2.83k]
  ------------------
 3774|  9.82k|                       (char *) name) == 0)
 3775|  6.98k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.83k|            bucketIndex += 1;
 3778|  2.83k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.83k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.83k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.83k|        }
 3781|  7.52k|    }
 3782|       |
 3783|    545|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 545]
  ------------------
 3784|      0|	xmlXPathFuncLookupFunc f;
 3785|       |
 3786|      0|	f = ctxt->funcLookupFunc;
 3787|      0|	ret = f(ctxt->funcLookupData, name, ns_uri);
 3788|      0|	if (ret != NULL)
  ------------------
  |  Branch (3788:6): [True: 0, False: 0]
  ------------------
 3789|      0|	    return(ret);
 3790|      0|    }
 3791|       |
 3792|    545|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 545, False: 0]
  ------------------
 3793|    545|	return(NULL);
 3794|       |
 3795|      0|    payload = xmlHashLookup2(ctxt->funcHash, name, ns_uri);
 3796|      0|    memcpy(&ret, &payload, sizeof(payload));
 3797|       |
 3798|      0|    return(ret);
 3799|    545|}
xmlXPathRegisteredFuncsCleanup:
 3807|  7.74k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  7.74k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 7.74k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  7.74k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  7.74k|}
xmlXPathVariableLookup:
 3891|     74|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     74|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 74]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     74|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 74]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     74|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     74|}
xmlXPathVariableLookupNS:
 3916|     92|			 const xmlChar *ns_uri) {
 3917|     92|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 92]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     92|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 92]
  ------------------
 3921|      0|	xmlXPathObjectPtr ret;
 3922|       |
 3923|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3924|      0|	        (ctxt->varLookupData, name, ns_uri);
 3925|      0|	if (ret != NULL) return(ret);
  ------------------
  |  Branch (3925:6): [True: 0, False: 0]
  ------------------
 3926|      0|    }
 3927|       |
 3928|     92|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 92, False: 0]
  ------------------
 3929|     92|	return(NULL);
 3930|      0|    if (name == NULL)
  ------------------
  |  Branch (3930:9): [True: 0, False: 0]
  ------------------
 3931|      0|	return(NULL);
 3932|       |
 3933|      0|    return(xmlXPathObjectCopy(xmlHashLookup2(ctxt->varHash, name, ns_uri)));
 3934|      0|}
xmlXPathRegisteredVariablesCleanup:
 3942|  7.74k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  7.74k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 7.74k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  7.74k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  7.74k|}
xmlXPathRegisterNs:
 3961|    572|			   const xmlChar *ns_uri) {
 3962|    572|    xmlChar *copy;
 3963|       |
 3964|    572|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 572]
  ------------------
 3965|      0|	return(-1);
 3966|    572|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 572]
  ------------------
 3967|      0|	return(-1);
 3968|    572|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 572]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    572|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 43, False: 529]
  ------------------
 3972|     43|	ctxt->nsHash = xmlHashCreate(10);
 3973|    572|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 570]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    570|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 570]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    570|    copy = xmlStrdup(ns_uri);
 3982|    570|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 2, False: 568]
  ------------------
 3983|      2|        xmlXPathErrMemory(ctxt);
 3984|      2|        return(-1);
 3985|      2|    }
 3986|    568|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 2, False: 566]
  ------------------
 3987|    568|                           xmlHashDefaultDeallocator) < 0) {
 3988|      2|        xmlXPathErrMemory(ctxt);
 3989|      2|        xmlFree(copy);
 3990|      2|        return(-1);
 3991|      2|    }
 3992|       |
 3993|    566|    return(0);
 3994|    568|}
xmlXPathNsLookup:
 4005|  7.08k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  7.08k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 7.08k]
  ------------------
 4007|      0|	return(NULL);
 4008|  7.08k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 7.08k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  7.08k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 6.83k, False: 249]
  ------------------
 4012|  6.83k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  6.83k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    249|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 249]
  ------------------
 4015|      0|	int i;
 4016|       |
 4017|      0|	for (i = 0;i < ctxt->nsNr;i++) {
  ------------------
  |  Branch (4017:13): [True: 0, False: 0]
  ------------------
 4018|      0|	    if ((ctxt->namespaces[i] != NULL) &&
  ------------------
  |  Branch (4018:10): [True: 0, False: 0]
  ------------------
 4019|      0|		(xmlStrEqual(ctxt->namespaces[i]->prefix, prefix)))
  ------------------
  |  Branch (4019:3): [True: 0, False: 0]
  ------------------
 4020|      0|		return(ctxt->namespaces[i]->href);
 4021|      0|	}
 4022|      0|    }
 4023|       |
 4024|    249|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    249|}
xmlXPathRegisteredNsCleanup:
 4033|  7.74k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  7.74k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 7.74k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  7.74k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  7.74k|}
xmlXPathNewFloat:
 4056|   432k|xmlXPathNewFloat(double val) {
 4057|   432k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   432k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   432k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 157, False: 431k]
  ------------------
 4061|    157|	return(NULL);
 4062|   431k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   431k|    ret->type = XPATH_NUMBER;
 4064|   431k|    ret->floatval = val;
 4065|   431k|    return(ret);
 4066|   432k|}
xmlXPathNewBoolean:
 4075|   523k|xmlXPathNewBoolean(int val) {
 4076|   523k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   523k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   523k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 96, False: 523k]
  ------------------
 4080|     96|	return(NULL);
 4081|   523k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   523k|    ret->type = XPATH_BOOLEAN;
 4083|   523k|    ret->boolval = (val != 0);
 4084|   523k|    return(ret);
 4085|   523k|}
xmlXPathNewString:
 4094|   119k|xmlXPathNewString(const xmlChar *val) {
 4095|   119k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   119k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   119k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 20, False: 119k]
  ------------------
 4099|     20|	return(NULL);
 4100|   119k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   119k|    ret->type = XPATH_STRING;
 4102|   119k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 5, False: 119k]
  ------------------
 4103|      5|        val = BAD_CAST "";
  ------------------
  |  |   34|      5|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   119k|    ret->stringval = xmlStrdup(val);
 4105|   119k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 31, False: 119k]
  ------------------
 4106|     31|        xmlFree(ret);
 4107|     31|        return(NULL);
 4108|     31|    }
 4109|   119k|    return(ret);
 4110|   119k|}
xmlXPathWrapString:
 4121|  58.8k|xmlXPathWrapString (xmlChar *val) {
 4122|  58.8k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  58.8k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  58.8k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 51, False: 58.7k]
  ------------------
 4126|     51|        xmlFree(val);
 4127|     51|	return(NULL);
 4128|     51|    }
 4129|  58.7k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  58.7k|    ret->type = XPATH_STRING;
 4131|  58.7k|    ret->stringval = val;
 4132|  58.7k|    return(ret);
 4133|  58.8k|}
xmlXPathObjectCopy:
 4183|   347k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   347k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   347k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 347k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   347k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   347k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 98, False: 347k]
  ------------------
 4191|     98|	return(NULL);
 4192|   347k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   347k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 347k]
  ------------------
 4195|   333k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 333k, False: 14.4k]
  ------------------
 4196|   333k|	    break;
 4197|  14.4k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 14.4k, False: 333k]
  ------------------
 4198|  14.4k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  14.4k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 13, False: 14.4k]
  ------------------
 4200|     13|                xmlFree(ret);
 4201|     13|                return(NULL);
 4202|     13|            }
 4203|  14.4k|	    break;
 4204|  14.4k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 347k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 347k]
  ------------------
 4206|      0|	    ret->nodesetval = xmlXPathNodeSetMerge(NULL, val->nodesetval);
 4207|      0|            if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (4207:17): [True: 0, False: 0]
  ------------------
 4208|      0|                xmlFree(ret);
 4209|      0|                return(NULL);
 4210|      0|            }
 4211|       |	    /* Do not deallocate the copied tree value */
 4212|      0|	    ret->boolval = 0;
 4213|      0|	    break;
 4214|      0|        case XPATH_USERS:
  ------------------
  |  Branch (4214:9): [True: 0, False: 347k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 347k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   347k|    }
 4222|   347k|    return(ret);
 4223|   347k|}
xmlXPathFreeObject:
 4231|  3.69M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.69M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.69M]
  ------------------
 4233|  3.69M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.21M, False: 1.48M]
  |  Branch (4233:41): [True: 0, False: 1.48M]
  ------------------
 4234|  2.21M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.21M, False: 57]
  ------------------
 4235|  2.21M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.21M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 192k, False: 1.28M]
  ------------------
 4237|   192k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 192k, False: 47]
  ------------------
 4238|   192k|	    xmlFree(obj->stringval);
 4239|   192k|    }
 4240|  3.69M|    xmlFree(obj);
 4241|  3.69M|}
xmlXPathCastBooleanToString:
 4354|  12.7k|xmlXPathCastBooleanToString (int val) {
 4355|  12.7k|    xmlChar *ret;
 4356|  12.7k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 7.17k, False: 5.59k]
  ------------------
 4357|  7.17k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  5.59k|    else
 4359|  5.59k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  12.7k|    return(ret);
 4361|  12.7k|}
xmlXPathCastNumberToString:
 4370|  18.3k|xmlXPathCastNumberToString (double val) {
 4371|  18.3k|    xmlChar *ret;
 4372|  18.3k|    switch (xmlXPathIsInf(val)) {
 4373|    511|    case 1:
  ------------------
  |  Branch (4373:5): [True: 511, False: 17.8k]
  ------------------
 4374|    511|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    511|	break;
 4376|    327|    case -1:
  ------------------
  |  Branch (4376:5): [True: 327, False: 18.0k]
  ------------------
 4377|    327|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    327|	break;
 4379|  17.4k|    default:
  ------------------
  |  Branch (4379:5): [True: 17.4k, False: 838]
  ------------------
 4380|  17.4k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 1.70k, False: 15.7k]
  ------------------
 4381|  1.70k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  15.7k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 554, False: 15.2k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    554|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  15.2k|	} else {
 4386|       |	    /* could be improved */
 4387|  15.2k|	    char buf[100];
 4388|  15.2k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  15.2k|	    buf[99] = 0;
 4390|  15.2k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  15.2k|	}
 4392|  18.3k|    }
 4393|  18.3k|    return(ret);
 4394|  18.3k|}
xmlXPathCastNodeToString:
 4403|   438k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   438k|    return(xmlNodeGetContent(node));
 4405|   438k|}
xmlXPathCastNodeSetToString:
 4414|   518k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   518k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 518k]
  |  Branch (4415:25): [True: 257k, False: 260k]
  |  Branch (4415:46): [True: 0, False: 260k]
  ------------------
 4416|   257k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   260k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 29.2k, False: 231k]
  ------------------
 4419|  29.2k|	xmlXPathNodeSetSort(ns);
 4420|   260k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   518k|}
xmlXPathCastToString:
 4431|  53.1k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  53.1k|    xmlChar *ret = NULL;
 4433|       |
 4434|  53.1k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 53.1k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  53.1k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 53.1k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 53.1k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  21.5k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 21.5k, False: 31.6k]
  ------------------
 4441|  21.5k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 53.1k]
  ------------------
 4442|  21.5k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  21.5k|	    break;
 4444|    502|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 502, False: 52.6k]
  ------------------
 4445|    502|	    return(xmlStrdup(val->stringval));
 4446|  12.7k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 12.7k, False: 40.4k]
  ------------------
 4447|  12.7k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  12.7k|	    break;
 4449|  18.3k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 18.3k, False: 34.8k]
  ------------------
 4450|  18.3k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  18.3k|	    break;
 4452|  21.5k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 53.1k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  53.1k|    }
 4458|  52.6k|    return(ret);
 4459|  53.1k|}
xmlXPathCastBooleanToNumber:
 4507|  44.2k|xmlXPathCastBooleanToNumber(int val) {
 4508|  44.2k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 3.42k, False: 40.8k]
  ------------------
 4509|  3.42k|	return(1.0);
 4510|  40.8k|    return(0.0);
 4511|  44.2k|}
xmlXPathCastStringToNumber:
 4520|   699k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   699k|    return(xmlXPathStringEvalNumber(val));
 4522|   699k|}
xmlXPathCastNumberToBoolean:
 4617|  65.5k|xmlXPathCastNumberToBoolean (double val) {
 4618|  65.5k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 50.1k, False: 15.4k]
  |  Branch (4618:32): [True: 4.97k, False: 10.4k]
  ------------------
 4619|  55.1k|	 return(0);
 4620|  10.4k|     return(1);
 4621|  65.5k|}
xmlXPathCastStringToBoolean:
 4630|    274|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|    274|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 274]
  |  Branch (4631:26): [True: 34, False: 240]
  ------------------
 4632|     34|	return(0);
 4633|    240|    return(1);
 4634|    274|}
xmlXPathCastNodeSetToBoolean:
 4643|  10.7k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  10.7k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 10.7k]
  |  Branch (4644:25): [True: 9.52k, False: 1.18k]
  ------------------
 4645|  9.52k|	return(0);
 4646|  1.18k|    return(1);
 4647|  10.7k|}
xmlXPathCastToBoolean:
 4656|  14.3k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  14.3k|    int ret = 0;
 4658|       |
 4659|  14.3k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 14.3k]
  ------------------
 4660|      0|	return(0);
 4661|  14.3k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 14.3k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 14.3k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  10.7k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 10.7k, False: 3.60k]
  ------------------
 4666|  10.7k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 14.3k]
  ------------------
 4667|  10.7k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  10.7k|	break;
 4669|    274|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 274, False: 14.0k]
  ------------------
 4670|    274|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|    274|	break;
 4672|  3.32k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 3.32k, False: 10.9k]
  ------------------
 4673|  3.32k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  3.32k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 14.3k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 14.3k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  14.3k|    }
 4683|  14.3k|    return(ret);
 4684|  14.3k|}
xmlXPathNewContext:
 4720|  7.76k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  7.76k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  7.76k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  7.76k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 20, False: 7.74k]
  ------------------
 4725|     20|	return(NULL);
 4726|  7.74k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  7.74k|    ret->doc = doc;
 4728|  7.74k|    ret->node = NULL;
 4729|       |
 4730|  7.74k|    ret->varHash = NULL;
 4731|       |
 4732|  7.74k|    ret->nb_types = 0;
 4733|  7.74k|    ret->max_types = 0;
 4734|  7.74k|    ret->types = NULL;
 4735|       |
 4736|  7.74k|    ret->nb_axis = 0;
 4737|  7.74k|    ret->max_axis = 0;
 4738|  7.74k|    ret->axis = NULL;
 4739|       |
 4740|  7.74k|    ret->nsHash = NULL;
 4741|  7.74k|    ret->user = NULL;
 4742|       |
 4743|  7.74k|    ret->contextSize = -1;
 4744|  7.74k|    ret->proximityPosition = -1;
 4745|       |
 4746|       |#ifdef XP_DEFAULT_CACHE_ON
 4747|       |    if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
 4748|       |	xmlXPathFreeContext(ret);
 4749|       |	return(NULL);
 4750|       |    }
 4751|       |#endif
 4752|       |
 4753|  7.74k|    return(ret);
 4754|  7.76k|}
xmlXPathFreeContext:
 4762|  7.74k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  7.74k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 7.74k]
  ------------------
 4764|       |
 4765|  7.74k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 7.74k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  7.74k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  7.74k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  7.74k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  7.74k|    xmlResetError(&ctxt->lastError);
 4771|  7.74k|    xmlFree(ctxt);
 4772|  7.74k|}
xmlXPathSetErrorHandler:
 4785|  7.74k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  7.74k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 7.74k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  7.74k|    ctxt->error = handler;
 4790|  7.74k|    ctxt->userData = data;
 4791|  7.74k|}
xmlXPathNewParserContext:
 4807|  12.8k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  12.8k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  12.8k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  12.8k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 38, False: 12.8k]
  ------------------
 4812|     38|        xmlXPathErrMemory(ctxt);
 4813|     38|	return(NULL);
 4814|     38|    }
 4815|  12.8k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  12.8k|    ret->cur = ret->base = str;
 4817|  12.8k|    ret->context = ctxt;
 4818|       |
 4819|  12.8k|    ret->comp = xmlXPathNewCompExpr();
 4820|  12.8k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 64, False: 12.7k]
  ------------------
 4821|     64|        xmlXPathErrMemory(ctxt);
 4822|     64|	xmlFree(ret->valueTab);
 4823|     64|	xmlFree(ret);
 4824|     64|	return(NULL);
 4825|     64|    }
 4826|  12.7k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 12.7k, False: 0]
  |  Branch (4826:27): [True: 0, False: 12.7k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  12.7k|    return(ret);
 4832|  12.8k|}
xmlXPathFreeParserContext:
 4879|  12.7k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  12.7k|    int i;
 4881|       |
 4882|  12.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 12.7k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  12.7k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 12.7k, False: 35]
  ------------------
 4886|  21.1k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 8.41k, False: 12.7k]
  ------------------
 4887|  8.41k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 8.41k, False: 0]
  ------------------
 4888|  8.41k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  8.41k|        }
 4892|  12.7k|        xmlFree(ctxt->valueTab);
 4893|  12.7k|    }
 4894|  12.7k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 12.7k, False: 0]
  ------------------
 4895|       |#ifdef XPATH_STREAMING
 4896|       |	if (ctxt->comp->stream != NULL) {
 4897|       |	    xmlFreePatternList(ctxt->comp->stream);
 4898|       |	    ctxt->comp->stream = NULL;
 4899|       |	}
 4900|       |#endif
 4901|  12.7k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  12.7k|    }
 4903|  12.7k|    xmlFree(ctxt);
 4904|  12.7k|}
xmlXPathEqualValues:
 5702|   330k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   330k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   330k|    int ret = 0;
 5705|       |
 5706|   330k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 330k]
  |  Branch (5706:27): [True: 0, False: 330k]
  ------------------
 5707|   330k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   330k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   330k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 330k]
  |  Branch (5709:27): [True: 0, False: 330k]
  ------------------
 5710|      0|	if (arg1 != NULL)
  ------------------
  |  Branch (5710:6): [True: 0, False: 0]
  ------------------
 5711|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5712|      0|	else
 5713|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5714|      0|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5715|      0|    }
 5716|       |
 5717|   330k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 330k]
  ------------------
 5718|      0|	xmlXPathFreeObject(arg1);
 5719|      0|        return(1);
 5720|      0|    }
 5721|       |
 5722|       |    /*
 5723|       |     *If either argument is a nodeset, it's a 'special case'
 5724|       |     */
 5725|   330k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 114k, False: 215k]
  |  Branch (5725:42): [True: 0, False: 215k]
  ------------------
 5726|   215k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 21.2k, False: 194k]
  |  Branch (5726:40): [True: 0, False: 194k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   135k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 99.1k, False: 36.3k]
  |  Branch (5730:39): [True: 99.1k, False: 0]
  ------------------
 5731|  99.1k|		argtmp = arg2;
 5732|  99.1k|		arg2 = arg1;
 5733|  99.1k|		arg1 = argtmp;
 5734|  99.1k|	}
 5735|   135k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 135k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 135k]
  ------------------
 5737|      0|		break;
 5738|  15.1k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 15.1k, False: 120k]
  ------------------
 5739|  15.1k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 135k]
  ------------------
 5740|  15.1k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  15.1k|		break;
 5742|  81.5k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 81.5k, False: 54.0k]
  ------------------
 5743|  81.5k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 81.5k]
  ------------------
 5744|  81.5k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 59.9k, False: 21.5k]
  ------------------
 5745|  21.5k|		else
 5746|  21.5k|		    ret = 1;
 5747|  81.5k|		ret = (ret == arg2->boolval);
 5748|  81.5k|		break;
 5749|  35.9k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 35.9k, False: 99.6k]
  ------------------
 5750|  35.9k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  35.9k|		break;
 5752|  2.93k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 2.93k, False: 132k]
  ------------------
 5753|  2.93k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  2.93k|                                                 arg2->stringval, 0);
 5755|  2.93k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 135k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   135k|	}
 5760|   135k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   135k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   135k|	return(ret);
 5763|   135k|    }
 5764|       |
 5765|   194k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   330k|}
xmlXPathNotEqualValues:
 5775|  7.16k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  7.16k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  7.16k|    int ret = 0;
 5778|       |
 5779|  7.16k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 7.16k]
  |  Branch (5779:27): [True: 0, False: 7.16k]
  ------------------
 5780|  7.16k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  7.16k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  7.16k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 7.16k]
  |  Branch (5782:27): [True: 0, False: 7.16k]
  ------------------
 5783|      0|	if (arg1 != NULL)
  ------------------
  |  Branch (5783:6): [True: 0, False: 0]
  ------------------
 5784|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5785|      0|	else
 5786|      0|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5787|      0|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5788|      0|    }
 5789|       |
 5790|  7.16k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 7.16k]
  ------------------
 5791|      0|	xmlXPathReleaseObject(ctxt->context, arg1);
 5792|      0|        return(0);
 5793|      0|    }
 5794|       |
 5795|       |    /*
 5796|       |     *If either argument is a nodeset, it's a 'special case'
 5797|       |     */
 5798|  7.16k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 4.32k, False: 2.83k]
  |  Branch (5798:42): [True: 0, False: 2.83k]
  ------------------
 5799|  5.56k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.24k, False: 1.59k]
  |  Branch (5799:40): [True: 0, False: 1.59k]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  5.56k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 3.45k, False: 2.11k]
  |  Branch (5803:39): [True: 3.45k, False: 0]
  ------------------
 5804|  3.45k|		argtmp = arg2;
 5805|  3.45k|		arg2 = arg1;
 5806|  3.45k|		arg1 = argtmp;
 5807|  3.45k|	}
 5808|  5.56k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 5.56k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 5.56k]
  ------------------
 5810|      0|		break;
 5811|    871|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 871, False: 4.69k]
  ------------------
 5812|    871|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 5.56k]
  ------------------
 5813|    871|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|    871|		break;
 5815|  1.58k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.58k, False: 3.98k]
  ------------------
 5816|  1.58k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.58k]
  ------------------
 5817|  1.58k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 1.08k, False: 497]
  ------------------
 5818|    497|		else
 5819|    497|		    ret = 1;
 5820|  1.58k|		ret = (ret != arg2->boolval);
 5821|  1.58k|		break;
 5822|  2.16k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 2.16k, False: 3.39k]
  ------------------
 5823|  2.16k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|  2.16k|		break;
 5825|    943|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 943, False: 4.62k]
  ------------------
 5826|    943|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    943|                                                 arg2->stringval, 1);
 5828|    943|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 5.56k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  5.56k|	}
 5833|  5.56k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  5.56k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  5.56k|	return(ret);
 5836|  5.56k|    }
 5837|       |
 5838|  1.59k|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  7.16k|}
xmlXPathCompareValues:
 5864|   203k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   203k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   203k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   203k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 203k]
  |  Branch (5868:27): [True: 0, False: 203k]
  ------------------
 5869|   203k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   203k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   203k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 12, False: 203k]
  |  Branch (5871:27): [True: 0, False: 203k]
  ------------------
 5872|     12|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 12]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|     12|	else
 5875|     12|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|     12|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|     12|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   203k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 110k, False: 93.3k]
  |  Branch (5879:42): [True: 0, False: 93.3k]
  ------------------
 5880|   132k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 22.3k, False: 71.0k]
  |  Branch (5880:40): [True: 0, False: 71.0k]
  ------------------
 5881|       |	/*
 5882|       |	 * If either argument is a XPATH_NODESET or XPATH_XSLT_TREE the two arguments
 5883|       |	 * are not freed from within this routine; they will be freed from the
 5884|       |	 * called routine, e.g. xmlXPathCompareNodeSets or xmlXPathCompareNodeSetValue
 5885|       |	 */
 5886|   132k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 110k, False: 22.3k]
  |  Branch (5886:40): [True: 0, False: 22.3k]
  ------------------
 5887|   110k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 59.9k, False: 50.4k]
  |  Branch (5887:38): [True: 0, False: 50.4k]
  ------------------
 5888|  59.9k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  72.7k|	} else {
 5890|  72.7k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 22.3k, False: 50.4k]
  |  Branch (5890:43): [True: 0, False: 50.4k]
  ------------------
 5891|  22.3k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  22.3k|			                          arg1, arg2);
 5893|  50.4k|	    } else {
 5894|  50.4k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  50.4k|			                          arg2, arg1);
 5896|  50.4k|	    }
 5897|  72.7k|	}
 5898|   132k|	return(ret);
 5899|   132k|    }
 5900|       |
 5901|  71.0k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 20.2k, False: 50.8k]
  ------------------
 5902|  20.2k|	xmlXPathValuePush(ctxt, arg1);
 5903|  20.2k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  20.2k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  20.2k|    }
 5906|  71.0k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 14.7k, False: 56.3k]
  ------------------
 5907|  14.7k|	xmlXPathValuePush(ctxt, arg2);
 5908|  14.7k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  14.7k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  14.7k|    }
 5911|  71.0k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 283, False: 70.7k]
  ------------------
 5912|    283|        goto error;
 5913|       |    /*
 5914|       |     * Add tests for infinity and nan
 5915|       |     * => feedback on 3.4 for Inf and NaN
 5916|       |     */
 5917|       |    /* Hand check NaN and Infinity comparisons */
 5918|  70.7k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 32.9k, False: 37.7k]
  |  Branch (5918:42): [True: 3.33k, False: 34.4k]
  ------------------
 5919|  36.3k|	ret=0;
 5920|  36.3k|    } else {
 5921|  34.4k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  34.4k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  34.4k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 22.7k, False: 11.6k]
  |  Branch (5923:13): [True: 20.8k, False: 1.82k]
  ------------------
 5924|  20.8k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 649, False: 20.2k]
  |  Branch (5924:26): [True: 259, False: 390]
  ------------------
 5925|  20.6k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 656, False: 19.9k]
  |  Branch (5925:18): [True: 408, False: 248]
  ------------------
 5926|    667|		ret = 1;
 5927|  20.2k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 19.2k, False: 957]
  |  Branch (5927:31): [True: 18.2k, False: 1.00k]
  ------------------
 5928|  18.2k|		ret = (arg1->floatval < arg2->floatval);
 5929|  18.2k|	    } else {
 5930|  1.96k|		ret = 0;
 5931|  1.96k|	    }
 5932|  20.8k|	}
 5933|  13.5k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 1.82k, False: 11.6k]
  |  Branch (5933:18): [True: 1.82k, False: 0]
  ------------------
 5934|  1.82k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 233, False: 1.59k]
  |  Branch (5934:25): [True: 341, False: 1.25k]
  ------------------
 5935|    574|		ret = 1;
 5936|  1.25k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 986, False: 267]
  |  Branch (5936:31): [True: 674, False: 312]
  ------------------
 5937|    674|		ret = (arg1->floatval <= arg2->floatval);
 5938|    674|	    } else {
 5939|    579|		ret = 0;
 5940|    579|	    }
 5941|  1.82k|	}
 5942|  11.6k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 11.6k, False: 0]
  |  Branch (5942:19): [True: 6.25k, False: 5.44k]
  ------------------
 5943|  6.25k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 831, False: 5.42k]
  |  Branch (5943:25): [True: 486, False: 345]
  ------------------
 5944|  5.76k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 493, False: 5.27k]
  |  Branch (5944:19): [True: 229, False: 264]
  ------------------
 5945|    715|		ret = 1;
 5946|  5.53k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 4.42k, False: 1.10k]
  |  Branch (5946:31): [True: 4.10k, False: 321]
  ------------------
 5947|  4.10k|		ret = (arg1->floatval > arg2->floatval);
 5948|  4.10k|	    } else {
 5949|  1.43k|		ret = 0;
 5950|  1.43k|	    }
 5951|  6.25k|	}
 5952|  5.44k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 5.44k, False: 0]
  |  Branch (5952:19): [True: 5.44k, False: 0]
  ------------------
 5953|  5.44k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 3.31k, False: 2.12k]
  |  Branch (5953:24): [True: 220, False: 1.90k]
  ------------------
 5954|  3.53k|		ret = 1;
 5955|  3.53k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 1.59k, False: 306]
  |  Branch (5955:31): [True: 1.32k, False: 268]
  ------------------
 5956|  1.32k|		ret = (arg1->floatval >= arg2->floatval);
 5957|  1.32k|	    } else {
 5958|    574|		ret = 0;
 5959|    574|	    }
 5960|  5.44k|	}
 5961|  34.4k|    }
 5962|  71.0k|error:
 5963|  71.0k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|  71.0k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|  71.0k|    return(ret);
 5966|  70.7k|}
xmlXPathValueFlipSign:
 5976|   127k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|   127k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 127k]
  |  Branch (5977:27): [True: 0, False: 127k]
  ------------------
 5978|   127k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   127k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 127k, False: 0]
  |  |  |  Branch (297:34): [True: 73.0k, False: 54.5k]
  |  |  ------------------
  |  |  298|   127k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|   127k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   127k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 127k]
  |  |  |  Branch (261:34): [True: 7, False: 127k]
  |  |  ------------------
  |  |  262|   127k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     11|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|   127k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|   127k|}
xmlXPathAddValues:
 5991|  80.6k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  80.6k|    xmlXPathObjectPtr arg;
 5993|  80.6k|    double val;
 5994|       |
 5995|  80.6k|    arg = xmlXPathValuePop(ctxt);
 5996|  80.6k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 80.6k]
  ------------------
 5997|  80.6k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  80.6k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  80.6k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  80.6k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  80.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 80.6k, False: 0]
  |  |  |  Branch (297:34): [True: 67.8k, False: 12.7k]
  |  |  ------------------
  |  |  298|  80.6k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  80.6k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  80.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 80.6k]
  |  |  |  Branch (261:34): [True: 6, False: 80.6k]
  |  |  ------------------
  |  |  262|  80.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  80.6k|    ctxt->value->floatval += val;
 6003|  80.6k|}
xmlXPathSubValues:
 6013|  79.5k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  79.5k|    xmlXPathObjectPtr arg;
 6015|  79.5k|    double val;
 6016|       |
 6017|  79.5k|    arg = xmlXPathValuePop(ctxt);
 6018|  79.5k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 79.5k]
  ------------------
 6019|  79.5k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  79.5k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  79.5k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  79.5k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  79.5k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 79.5k, False: 0]
  |  |  |  Branch (297:34): [True: 14.7k, False: 64.8k]
  |  |  ------------------
  |  |  298|  79.5k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  79.5k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  79.5k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 79.5k]
  |  |  |  Branch (261:34): [True: 4, False: 79.5k]
  |  |  ------------------
  |  |  262|  79.5k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  79.5k|    ctxt->value->floatval -= val;
 6025|  79.5k|}
xmlXPathMultValues:
 6035|   215k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   215k|    xmlXPathObjectPtr arg;
 6037|   215k|    double val;
 6038|       |
 6039|   215k|    arg = xmlXPathValuePop(ctxt);
 6040|   215k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 215k]
  ------------------
 6041|   215k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   215k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   215k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   215k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   215k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 215k, False: 0]
  |  |  |  Branch (297:34): [True: 60.3k, False: 155k]
  |  |  ------------------
  |  |  298|   215k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   215k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   215k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 9, False: 215k]
  |  |  |  Branch (261:34): [True: 1, False: 215k]
  |  |  ------------------
  |  |  262|   215k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     10|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   215k|    ctxt->value->floatval *= val;
 6047|   215k|}
xmlXPathDivValues:
 6058|  1.22k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  1.22k|    xmlXPathObjectPtr arg;
 6060|  1.22k|    double val;
 6061|       |
 6062|  1.22k|    arg = xmlXPathValuePop(ctxt);
 6063|  1.22k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 1.22k]
  ------------------
 6064|  1.22k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  1.22k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  1.22k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  1.22k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.22k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.22k, False: 0]
  |  |  |  Branch (297:34): [True: 488, False: 733]
  |  |  ------------------
  |  |  298|  1.22k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  1.22k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.22k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.22k]
  |  |  |  Branch (261:34): [True: 1, False: 1.21k]
  |  |  ------------------
  |  |  262|  1.22k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  1.21k|    ctxt->value->floatval /= val;
 6070|  1.21k|}
xmlXPathModValues:
 6080|    877|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|    877|    xmlXPathObjectPtr arg;
 6082|    877|    double arg1, arg2;
 6083|       |
 6084|    877|    arg = xmlXPathValuePop(ctxt);
 6085|    877|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 877]
  ------------------
 6086|    877|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|    877|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|    877|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|    877|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    877|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 877, False: 0]
  |  |  |  Branch (297:34): [True: 405, False: 472]
  |  |  ------------------
  |  |  298|    877|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|    877|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    877|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 876]
  |  |  |  Branch (261:34): [True: 1, False: 875]
  |  |  ------------------
  |  |  262|    877|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|    875|    arg1 = ctxt->value->floatval;
 6092|    875|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 310, False: 565]
  ------------------
 6093|    310|	ctxt->value->floatval = xmlXPathNAN;
 6094|    565|    else {
 6095|    565|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|    565|    }
 6097|    875|}
xmlXPathNextSelf:
 6138|    800|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    800|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 800]
  |  Branch (6139:27): [True: 0, False: 800]
  ------------------
 6140|    800|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 400, False: 400]
  ------------------
 6141|    400|        return(ctxt->context->node);
 6142|    400|    return(NULL);
 6143|    800|}
xmlXPathNextChild:
 6154|   204k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   204k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 204k]
  |  Branch (6155:27): [True: 0, False: 204k]
  ------------------
 6156|   204k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 84.4k, False: 119k]
  ------------------
 6157|  84.4k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 84.4k]
  ------------------
 6158|  84.4k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 84.4k, False: 0]
  ------------------
 6159|  20.3k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 20.3k, False: 64.0k]
  ------------------
 6160|  59.4k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 39.0k, False: 45.3k]
  ------------------
 6161|  71.6k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 12.2k, False: 72.2k]
  ------------------
 6162|  71.6k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 84.4k]
  ------------------
 6163|  71.6k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 84.4k]
  ------------------
 6164|  72.6k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 985, False: 83.4k]
  ------------------
 6165|  82.4k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 9.82k, False: 74.6k]
  ------------------
 6166|  82.4k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 84.4k]
  ------------------
 6167|  82.4k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 84.4k]
  ------------------
 6168|  82.4k|		return(ctxt->context->node->children);
 6169|    448|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 448, False: 84.0k]
  ------------------
 6170|    448|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 84.4k]
  ------------------
 6171|    448|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 84.4k]
  ------------------
 6172|    448|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 84.4k]
  ------------------
 6173|    448|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 84.4k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 84.4k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 84.4k]
  ------------------
 6177|  1.51k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 1.51k, False: 82.9k]
  ------------------
 6178|  1.51k|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 84.4k]
  ------------------
 6179|  1.51k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 84.4k]
  ------------------
 6180|  1.51k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 84.4k]
  ------------------
 6181|  1.51k|		return(NULL);
 6182|  84.4k|	}
 6183|      0|	return(NULL);
 6184|  84.4k|    }
 6185|   119k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 119k]
  ------------------
 6186|   119k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 119k]
  ------------------
 6187|      0|	return(NULL);
 6188|   119k|    return(cur->next);
 6189|   119k|}
xmlXPathNextDescendant:
 6271|  5.09M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  5.09M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 5.09M]
  |  Branch (6272:27): [True: 0, False: 5.09M]
  ------------------
 6273|  5.09M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 115k, False: 4.97M]
  ------------------
 6274|   115k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 115k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   115k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 375, False: 114k]
  ------------------
 6277|   114k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 5.00k, False: 109k]
  ------------------
 6278|  5.37k|	    return(NULL);
 6279|       |
 6280|   109k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 38.5k, False: 71.0k]
  ------------------
 6281|  38.5k|	    return(ctxt->context->doc->children);
 6282|  71.0k|        return(ctxt->context->node->children);
 6283|   109k|    }
 6284|       |
 6285|  4.97M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 4.97M]
  ------------------
 6286|      0|        return(NULL);
 6287|  4.97M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.34M, False: 3.63M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.34M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.33M, False: 5.04k]
  ------------------
 6292|  1.33M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.33M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.33M, False: 1.39k]
  ------------------
 6297|  1.33M|		return(cur);
 6298|  1.33M|	}
 6299|  1.34M|    }
 6300|       |
 6301|  3.64M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 2.12k, False: 3.63M]
  ------------------
 6302|       |
 6303|  3.64M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 2.96M, False: 672k]
  ------------------
 6304|  2.96M|	cur = cur->next;
 6305|  2.96M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 2.96M, False: 794]
  ------------------
 6306|  2.96M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 2.96M, False: 1.61k]
  ------------------
 6307|  2.96M|	    return(cur);
 6308|  2.96M|    }
 6309|       |
 6310|  1.38M|    do {
 6311|  1.38M|        cur = cur->parent;
 6312|  1.38M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.38M]
  ------------------
 6313|  1.38M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 167k, False: 1.21M]
  ------------------
 6314|  1.21M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 504k, False: 708k]
  ------------------
 6315|   504k|	    cur = cur->next;
 6316|   504k|	    return(cur);
 6317|   504k|	}
 6318|  1.21M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 708k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   672k|}
xmlXPathNextDescendantOrSelf:
 6334|  3.77M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  3.77M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 3.77M]
  |  Branch (6335:27): [True: 0, False: 3.77M]
  ------------------
 6336|  3.77M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 146k, False: 3.62M]
  ------------------
 6337|   146k|        return(ctxt->context->node);
 6338|       |
 6339|  3.62M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 3.62M]
  ------------------
 6340|      0|        return(NULL);
 6341|  3.62M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 718, False: 3.62M]
  ------------------
 6342|  3.62M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 4.82k, False: 3.62M]
  ------------------
 6343|  5.54k|        return(NULL);
 6344|       |
 6345|  3.62M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  3.62M|}
xmlXPathNextParent:
 6357|   284k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   284k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 284k]
  |  Branch (6358:27): [True: 0, False: 284k]
  ------------------
 6359|       |    /*
 6360|       |     * the parent of an attribute or namespace node is the element
 6361|       |     * to which the attribute or namespace node is attached
 6362|       |     * Namespace handling !!!
 6363|       |     */
 6364|   284k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 146k, False: 137k]
  ------------------
 6365|   146k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 146k]
  ------------------
 6366|   146k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 146k, False: 0]
  ------------------
 6367|  99.1k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 99.1k, False: 47.7k]
  ------------------
 6368|   136k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 37.7k, False: 109k]
  ------------------
 6369|   137k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 758, False: 146k]
  ------------------
 6370|   137k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 146k]
  ------------------
 6371|   137k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 146k]
  ------------------
 6372|   138k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 480, False: 146k]
  ------------------
 6373|   139k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 984, False: 145k]
  ------------------
 6374|   139k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 146k]
  ------------------
 6375|   139k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 146k]
  ------------------
 6376|   139k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 146k]
  ------------------
 6377|   139k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 146k]
  ------------------
 6378|   139k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 146k]
  ------------------
 6379|   139k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 146k]
  ------------------
 6380|   139k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 146k]
  ------------------
 6381|   139k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 139k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|   139k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 133k, False: 5.59k]
  ------------------
 6384|   133k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 133k]
  ------------------
 6385|   133k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 133k]
  ------------------
 6386|   133k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|   133k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|   139k|		return(ctxt->context->node->parent);
 6389|    315|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 315, False: 146k]
  ------------------
 6390|    315|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|    315|		return(att->parent);
 6393|   139k|	    }
 6394|  6.97k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 6.97k, False: 139k]
  ------------------
 6395|  6.97k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 146k]
  ------------------
 6396|  6.97k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 146k]
  ------------------
 6397|  6.97k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 146k]
  ------------------
 6398|  6.97k|                return(NULL);
 6399|    475|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 475, False: 146k]
  ------------------
 6400|    475|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|    475|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 475, False: 0]
  ------------------
 6403|    475|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 475, False: 0]
  ------------------
 6404|    475|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|    475|	    }
 6407|   146k|	}
 6408|   146k|    }
 6409|   137k|    return(NULL);
 6410|   284k|}
xmlXPathNextAncestor:
 6425|   163k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   163k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 163k]
  |  Branch (6426:27): [True: 0, False: 163k]
  ------------------
 6427|       |    /*
 6428|       |     * the parent of an attribute or namespace node is the element
 6429|       |     * to which the attribute or namespace node is attached
 6430|       |     * !!!!!!!!!!!!!
 6431|       |     */
 6432|   163k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 26.4k, False: 136k]
  ------------------
 6433|  26.4k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 26.4k]
  ------------------
 6434|  26.4k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 26.4k, False: 0]
  ------------------
 6435|  23.9k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 23.9k, False: 2.48k]
  ------------------
 6436|  25.2k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.29k, False: 25.1k]
  ------------------
 6437|  25.3k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 97, False: 26.3k]
  ------------------
 6438|  25.3k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 26.4k]
  ------------------
 6439|  25.3k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 26.4k]
  ------------------
 6440|  25.7k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 345, False: 26.1k]
  ------------------
 6441|  25.7k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 80, False: 26.3k]
  ------------------
 6442|  25.7k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 26.4k]
  ------------------
 6443|  25.7k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 26.4k]
  ------------------
 6444|  25.7k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 26.4k]
  ------------------
 6445|  25.7k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 26.4k]
  ------------------
 6446|  25.7k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 26.4k]
  ------------------
 6447|  25.7k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 26.4k]
  ------------------
 6448|  25.7k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 26.4k]
  ------------------
 6449|  25.7k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 25.7k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  25.7k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 24.8k, False: 941]
  ------------------
 6452|  24.8k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 24.8k]
  ------------------
 6453|  24.8k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 24.8k]
  ------------------
 6454|  24.8k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  24.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  25.7k|		return(ctxt->context->node->parent);
 6457|     58|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 58, False: 26.4k]
  ------------------
 6458|     58|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     58|		return(tmp->parent);
 6461|  25.7k|	    }
 6462|    615|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 615, False: 25.8k]
  ------------------
 6463|    615|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 26.4k]
  ------------------
 6464|    615|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 26.4k]
  ------------------
 6465|    615|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 26.4k]
  ------------------
 6466|    615|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 26.4k]
  ------------------
 6468|      0|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6469|       |
 6470|      0|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6470:7): [True: 0, False: 0]
  ------------------
 6471|      0|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6471:7): [True: 0, False: 0]
  ------------------
 6472|      0|		    return((xmlNodePtr) ns->next);
 6473|       |		/* Bad, how did that namespace end up here ? */
 6474|      0|                return(NULL);
 6475|      0|	    }
 6476|  26.4k|	}
 6477|      0|	return(NULL);
 6478|  26.4k|    }
 6479|   136k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 4.23k, False: 132k]
  ------------------
 6480|  4.23k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   132k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 29.5k, False: 103k]
  ------------------
 6482|  29.5k|	return(NULL);
 6483|   103k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 103k, False: 0]
  ------------------
 6484|   100k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 100k, False: 2.27k]
  ------------------
 6485|   102k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 1.48k, False: 101k]
  ------------------
 6486|   102k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 194, False: 102k]
  ------------------
 6487|   102k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 103k]
  ------------------
 6488|   102k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 103k]
  ------------------
 6489|   102k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 370, False: 102k]
  ------------------
 6490|   102k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 23, False: 103k]
  ------------------
 6491|   102k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 103k]
  ------------------
 6492|   102k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 103k]
  ------------------
 6493|   102k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 103k]
  ------------------
 6494|   102k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 103k]
  ------------------
 6495|   102k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 103k]
  ------------------
 6496|   102k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 103k]
  ------------------
 6497|   102k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 103k]
  ------------------
 6498|   102k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 102k]
  ------------------
 6499|      0|		return(NULL);
 6500|   102k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 78.5k, False: 24.3k]
  ------------------
 6501|  78.5k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 78.5k]
  ------------------
 6502|  78.5k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 78.5k]
  ------------------
 6503|  78.5k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  78.5k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|   102k|	    return(cur->parent);
 6506|    199|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 199, False: 102k]
  ------------------
 6507|    199|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|    199|	    return(att->parent);
 6510|   102k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 103k]
  ------------------
 6512|      0|	    xmlNsPtr ns = (xmlNsPtr) cur;
 6513|       |
 6514|      0|	    if ((ns->next != NULL) &&
  ------------------
  |  Branch (6514:10): [True: 0, False: 0]
  ------------------
 6515|      0|	        (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6515:10): [True: 0, False: 0]
  ------------------
 6516|      0|	        return((xmlNodePtr) ns->next);
 6517|       |	    /* Bad, how did that namespace end up here ? */
 6518|      0|            return(NULL);
 6519|      0|	}
 6520|      0|	case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6520:2): [True: 0, False: 103k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 103k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 103k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 103k]
  ------------------
 6524|      0|	    return(NULL);
 6525|   103k|    }
 6526|      0|    return(NULL);
 6527|   103k|}
xmlXPathNextAncestorOrSelf:
 6541|  37.3k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  37.3k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 37.3k]
  |  Branch (6542:27): [True: 0, False: 37.3k]
  ------------------
 6543|  37.3k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 3.74k, False: 33.5k]
  ------------------
 6544|  3.74k|        return(ctxt->context->node);
 6545|  33.5k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  37.3k|}
xmlXPathNextPrecedingSibling:
 6587|      3|xmlXPathNextPrecedingSibling(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6588|      3|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6588:9): [True: 0, False: 3]
  |  Branch (6588:27): [True: 0, False: 3]
  ------------------
 6589|      3|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6589:9): [True: 0, False: 3]
  ------------------
 6590|      3|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6590:9): [True: 0, False: 3]
  ------------------
 6591|      0|        return(NULL);
 6592|       |
 6593|      3|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6593:9): [True: 0, False: 3]
  ------------------
 6594|      0|        return(NULL);
 6595|       |
 6596|      3|    if (cur == NULL) {
  ------------------
  |  Branch (6596:9): [True: 3, False: 0]
  ------------------
 6597|      3|        cur = ctxt->context->node;
 6598|      3|    } else if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE)) {
  ------------------
  |  Branch (6598:16): [True: 0, False: 0]
  |  Branch (6598:39): [True: 0, False: 0]
  ------------------
 6599|      0|        cur = cur->prev;
 6600|      0|        if (cur == NULL)
  ------------------
  |  Branch (6600:13): [True: 0, False: 0]
  ------------------
 6601|      0|            cur = ctxt->context->node;
 6602|      0|    }
 6603|       |
 6604|      3|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6604:9): [True: 3, False: 0]
  ------------------
 6605|      3|        return(NULL);
 6606|       |
 6607|      0|    return(cur->prev);
 6608|      3|}
xmlXPathNextFollowing:
 6622|  9.29k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  9.29k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 9.29k]
  |  Branch (6623:27): [True: 0, False: 9.29k]
  ------------------
 6624|  9.29k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 7.85k, False: 1.43k]
  |  Branch (6624:26): [True: 7.85k, False: 0]
  ------------------
 6625|  7.85k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 7.85k, False: 0]
  |  Branch (6625:46): [True: 358, False: 7.49k]
  ------------------
 6626|    358|        return(cur->children);
 6627|       |
 6628|  8.93k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 1.43k, False: 7.49k]
  ------------------
 6629|  1.43k|        cur = ctxt->context->node;
 6630|  1.43k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 80, False: 1.35k]
  ------------------
 6631|     80|            cur = cur->parent;
 6632|  1.35k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 1.35k]
  ------------------
 6633|      0|            xmlNsPtr ns = (xmlNsPtr) cur;
 6634|       |
 6635|      0|            if ((ns->next == NULL) ||
  ------------------
  |  Branch (6635:17): [True: 0, False: 0]
  ------------------
 6636|      0|                (ns->next->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6636:17): [True: 0, False: 0]
  ------------------
 6637|      0|                return (NULL);
 6638|      0|            cur = (xmlNodePtr) ns->next;
 6639|      0|        }
 6640|  1.43k|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  8.93k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 8.93k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  8.93k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 180, False: 8.75k]
  ------------------
 6647|    180|        return(NULL);
 6648|       |
 6649|  8.75k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 7.15k, False: 1.59k]
  ------------------
 6650|  7.15k|        return(cur->next);
 6651|       |
 6652|  2.86k|    do {
 6653|  2.86k|        cur = cur->parent;
 6654|  2.86k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 2.86k]
  ------------------
 6655|      0|            break;
 6656|  2.86k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 1.25k, False: 1.60k]
  ------------------
 6657|  1.25k|            return(NULL);
 6658|  1.60k|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 340, False: 1.26k]
  |  Branch (6658:34): [True: 340, False: 0]
  ------------------
 6659|    340|            return(cur->next);
 6660|  1.60k|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 1.26k, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|  1.59k|}
xmlXPathNextNamespace:
 6814|   236k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|   236k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 236k]
  |  Branch (6815:27): [True: 0, False: 236k]
  ------------------
 6816|   236k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 8.51k, False: 228k]
  ------------------
 6817|   228k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 75.5k, False: 152k]
  ------------------
 6818|  75.5k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 18.9k, False: 56.5k]
  ------------------
 6819|  18.9k|	    xmlFree(ctxt->context->tmpNsList);
 6820|  75.5k|	ctxt->context->tmpNsNr = 0;
 6821|  75.5k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 4, False: 75.5k]
  ------------------
 6822|  75.5k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      4|            xmlXPathPErrMemory(ctxt);
 6824|      4|            return(NULL);
 6825|      4|        }
 6826|  75.5k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 74.4k, False: 1.05k]
  ------------------
 6827|   190k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 115k, False: 74.4k]
  ------------------
 6828|   115k|                ctxt->context->tmpNsNr++;
 6829|   115k|            }
 6830|  74.4k|        }
 6831|  75.5k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  75.5k|    }
 6833|   152k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 96.5k, False: 56.0k]
  ------------------
 6834|  96.5k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  96.5k|    } else {
 6836|  56.0k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 55.2k, False: 825]
  ------------------
 6837|  55.2k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  56.0k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  56.0k|    }
 6841|   152k|}
xmlXPathNextAttribute:
 6852|   239k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   239k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 239k]
  |  Branch (6853:27): [True: 0, False: 239k]
  ------------------
 6854|   239k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 239k]
  ------------------
 6855|      0|	return(NULL);
 6856|   239k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 43.1k, False: 196k]
  ------------------
 6857|  43.1k|	return(NULL);
 6858|   196k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 186k, False: 10.6k]
  ------------------
 6859|   186k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 186k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   186k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   186k|    }
 6863|  10.6k|    return((xmlNodePtr)cur->next);
 6864|   196k|}
xmlXPathRoot:
 6887|   339k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   339k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 339k]
  |  Branch (6888:27): [True: 0, False: 339k]
  ------------------
 6889|      0|	return;
 6890|   339k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   339k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   339k|}
xmlXPathLastFunction:
 6911|    895|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  2.67k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    895|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 895]
  |  |  ------------------
  |  |  281|    895|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 892]
  |  |  ------------------
  |  |  282|    895|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    892|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 892]
  |  |  ------------------
  |  |  284|    892|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  2.67k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 892, False: 0]
  ------------------
 6914|    892|	xmlXPathValuePush(ctxt,
 6915|    892|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    892|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  2.67k|}
xmlXPathPositionFunction:
 6932|  12.1k|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  36.3k|    CHECK_ARITY(0);
  ------------------
  |  |  280|  12.1k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 12.1k]
  |  |  ------------------
  |  |  281|  12.1k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 12.1k]
  |  |  ------------------
  |  |  282|  12.1k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  12.1k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 12.1k]
  |  |  ------------------
  |  |  284|  12.1k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  36.3k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 12.1k, False: 0]
  ------------------
 6935|  12.1k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|  12.1k|            (double) ctxt->context->proximityPosition));
 6937|  12.1k|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  36.3k|}
xmlXPathCountFunction:
 6950|     51|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     51|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    147|    CHECK_ARITY(1);
  ------------------
  |  |  280|     51|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 51]
  |  |  ------------------
  |  |  281|     51|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 48]
  |  |  ------------------
  |  |  282|     51|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     48|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 48]
  |  |  ------------------
  |  |  284|     48|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    147|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 48]
  ------------------
 6955|     48|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 45]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     45|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     45|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     45|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 45]
  |  Branch (6960:26): [True: 0, False: 45]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     45|    else
 6963|     45|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     45|	    (double) cur->nodesetval->nodeNr));
 6965|     45|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     45|}
xmlXPathIdFunction:
 7047|  6.17k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  6.17k|    xmlChar *tokens;
 7049|  6.17k|    xmlNodeSetPtr ret;
 7050|  6.17k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  18.5k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  6.17k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6.17k]
  |  |  ------------------
  |  |  281|  6.17k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 6.17k]
  |  |  ------------------
  |  |  282|  6.17k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  6.17k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 11, False: 6.16k]
  |  |  ------------------
  |  |  284|  6.17k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|     11|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  18.5k|    obj = xmlXPathValuePop(ctxt);
 7054|  18.5k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 6.16k]
  ------------------
 7055|  6.16k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 1.31k, False: 4.84k]
  |  Branch (7055:41): [True: 0, False: 4.84k]
  ------------------
 7056|  1.31k|	xmlNodeSetPtr ns;
 7057|  1.31k|	int i;
 7058|       |
 7059|  1.31k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  1.31k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 6, False: 1.31k]
  ------------------
 7061|      6|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  1.31k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 1.31k, False: 0]
  ------------------
 7064|  5.19k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.88k, False: 1.31k]
  ------------------
 7065|  3.88k|		tokens =
 7066|  3.88k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.88k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 7, False: 3.87k]
  ------------------
 7068|      7|                    xmlXPathPErrMemory(ctxt);
 7069|  3.88k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.88k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 25, False: 3.85k]
  ------------------
 7071|     25|                    xmlXPathPErrMemory(ctxt);
 7072|  3.88k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.88k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.87k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.88k|		xmlXPathFreeNodeSet(ns);
 7076|  3.88k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.87k, False: 7]
  ------------------
 7077|  3.87k|		    xmlFree(tokens);
 7078|  3.88k|	    }
 7079|  1.31k|	}
 7080|  1.31k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  1.31k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  1.31k|	return;
 7083|  1.31k|    }
 7084|  4.84k|    tokens = xmlXPathCastToString(obj);
 7085|  4.84k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 1, False: 4.84k]
  ------------------
 7086|      1|        xmlXPathPErrMemory(ctxt);
 7087|  4.84k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  4.84k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  4.84k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 6, False: 4.83k]
  ------------------
 7090|      6|        xmlXPathPErrMemory(ctxt);
 7091|  4.84k|    xmlFree(tokens);
 7092|  4.84k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  4.84k|}
xmlXPathLocalNameFunction:
 7108|  2.22k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  2.22k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  2.22k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 2.22k]
  ------------------
 7112|       |
 7113|  2.22k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 2.22k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  6.66k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  2.22k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 2.22k]
  |  |  ------------------
  |  |  281|  2.22k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 2.22k]
  |  |  ------------------
  |  |  282|  2.22k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  2.22k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 2, False: 2.22k]
  |  |  ------------------
  |  |  284|  2.22k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  6.66k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 2.22k]
  ------------------
 7120|  2.22k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 2.22k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  2.22k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  2.22k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  2.22k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 2.22k]
  |  Branch (7125:38): [True: 1, False: 2.21k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  2.21k|    } else {
 7128|  2.21k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  2.21k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 2.21k]
  ------------------
 7131|      2|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 1, False: 2.21k]
  ------------------
 7132|      2|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 2.21k]
  ------------------
 7133|      2|	    if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7133:10): [True: 0, False: 2]
  ------------------
 7134|      0|		xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7135|      2|	    else
 7136|      2|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7137|      2|			cur->nodesetval->nodeTab[i]->name));
 7138|      2|	    break;
 7139|      0|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (7139:2): [True: 0, False: 2.21k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  2.21k|	default:
  ------------------
  |  Branch (7143:2): [True: 2.21k, False: 2]
  ------------------
 7144|  2.21k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  2.21k|	}
 7146|  2.21k|    }
 7147|  2.22k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  2.22k|}
xmlXPathStringFunction:
 7312|  48.4k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  48.4k|    xmlXPathObjectPtr cur;
 7314|  48.4k|    xmlChar *stringval;
 7315|       |
 7316|  48.4k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 48.4k]
  ------------------
 7317|  48.4k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 118, False: 48.3k]
  ------------------
 7318|    118|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|    118|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 117]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|    118|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|    118|	return;
 7323|    118|    }
 7324|       |
 7325|   193k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  48.3k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 48.3k]
  |  |  ------------------
  |  |  281|  48.3k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 48.3k]
  |  |  ------------------
  |  |  282|  48.3k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  48.3k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 48.3k]
  |  |  ------------------
  |  |  284|  48.3k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   193k|    cur = xmlXPathValuePop(ctxt);
 7327|   193k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 48.3k]
  ------------------
 7328|  48.3k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 48.3k, False: 15]
  ------------------
 7329|  48.3k|        stringval = xmlXPathCastToString(cur);
 7330|  48.3k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 42, False: 48.2k]
  ------------------
 7331|     42|            xmlXPathPErrMemory(ctxt);
 7332|  48.3k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  48.3k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  48.3k|    }
 7335|  48.3k|    xmlXPathValuePush(ctxt, cur);
 7336|  48.3k|}
xmlXPathStringLengthFunction:
 7350|    154|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    154|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    154|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 12, False: 142]
  ------------------
 7354|     12|        if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (7354:13): [True: 0, False: 12]
  |  Branch (7354:31): [True: 0, False: 12]
  ------------------
 7355|      0|	    return;
 7356|     12|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7356:6): [True: 0, False: 12]
  ------------------
 7357|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0));
 7358|     12|	} else {
 7359|     12|	    xmlChar *content;
 7360|       |
 7361|     12|	    content = xmlXPathCastNodeToString(ctxt->context->node);
 7362|     12|            if (content == NULL)
  ------------------
  |  Branch (7362:17): [True: 1, False: 11]
  ------------------
 7363|      1|                xmlXPathPErrMemory(ctxt);
 7364|     12|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7365|     12|		xmlUTF8Strlen(content)));
 7366|     12|	    xmlFree(content);
 7367|     12|	}
 7368|     12|	return;
 7369|     12|    }
 7370|    562|    CHECK_ARITY(1);
  ------------------
  |  |  280|    142|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 142]
  |  |  ------------------
  |  |  281|    142|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 139]
  |  |  ------------------
  |  |  282|    142|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    139|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 139]
  |  |  ------------------
  |  |  284|    139|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    562|    CAST_TO_STRING;
  ------------------
  |  |  290|    139|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 139, False: 0]
  |  |  |  Branch (290:34): [True: 129, False: 10]
  |  |  ------------------
  |  |  291|    139|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    562|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    139|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 138]
  |  |  |  Branch (261:34): [True: 1, False: 137]
  |  |  ------------------
  |  |  262|    139|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    137|    cur = xmlXPathValuePop(ctxt);
 7374|    137|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    137|	xmlUTF8Strlen(cur->stringval)));
 7376|    137|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    137|}
xmlXPathConcatFunction:
 7388|    628|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    628|    xmlXPathObjectPtr cur, newobj;
 7390|    628|    xmlChar *tmp;
 7391|       |
 7392|    628|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 628]
  ------------------
 7393|    628|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 7, False: 621]
  ------------------
 7394|      7|	CHECK_ARITY(2);
  ------------------
  |  |  280|      7|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7]
  |  |  ------------------
  |  |  281|      7|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 7, False: 0]
  |  |  ------------------
  |  |  282|      7|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7395|      7|    }
 7396|       |
 7397|    621|    CAST_TO_STRING;
  ------------------
  |  |  290|    621|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 621, False: 0]
  |  |  |  Branch (290:34): [True: 504, False: 117]
  |  |  ------------------
  |  |  291|    621|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    621|    cur = xmlXPathValuePop(ctxt);
 7399|    621|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 621]
  |  Branch (7399:26): [True: 2, False: 619]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    619|    nargs--;
 7404|       |
 7405|  2.48k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.87k, False: 616]
  ------------------
 7406|  1.87k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.87k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.87k, False: 0]
  |  |  |  Branch (290:34): [True: 1.82k, False: 50]
  |  |  ------------------
  |  |  291|  1.87k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.87k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.87k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.87k]
  |  Branch (7408:26): [True: 2, False: 1.86k]
  ------------------
 7409|      3|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      3|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      3|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|  1.86k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.86k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 3, False: 1.86k]
  ------------------
 7415|      3|            xmlXPathPErrMemory(ctxt);
 7416|  1.86k|	newobj->stringval = cur->stringval;
 7417|  1.86k|	cur->stringval = tmp;
 7418|  1.86k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.86k|	nargs--;
 7420|  1.86k|    }
 7421|    616|    xmlXPathValuePush(ctxt, cur);
 7422|    616|}
xmlXPathStartsWithFunction:
 7467|    179|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    179|    xmlXPathObjectPtr hay, needle;
 7469|    179|    int n;
 7470|       |
 7471|    535|    CHECK_ARITY(2);
  ------------------
  |  |  280|    179|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 179]
  |  |  ------------------
  |  |  281|    179|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 178]
  |  |  ------------------
  |  |  282|    179|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    178|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 178]
  |  |  ------------------
  |  |  284|    178|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    535|    CAST_TO_STRING;
  ------------------
  |  |  290|    178|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 178, False: 0]
  |  |  |  Branch (290:34): [True: 67, False: 111]
  |  |  ------------------
  |  |  291|    178|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    535|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    178|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 178]
  |  |  |  Branch (261:34): [True: 1, False: 177]
  |  |  ------------------
  |  |  262|    178|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    177|    needle = xmlXPathValuePop(ctxt);
 7475|    177|    CAST_TO_STRING;
  ------------------
  |  |  290|    177|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 177, False: 0]
  |  |  |  Branch (290:34): [True: 177, False: 0]
  |  |  ------------------
  |  |  291|    177|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    177|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    177|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 1, False: 176]
  |  Branch (7478:26): [True: 1, False: 175]
  ------------------
 7479|      2|	xmlXPathReleaseObject(ctxt->context, hay);
 7480|      2|	xmlXPathReleaseObject(ctxt->context, needle);
 7481|      2|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7482|      0|    }
 7483|    175|    n = xmlStrlen(needle->stringval);
 7484|    175|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 136, False: 39]
  ------------------
 7485|    136|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     39|    else
 7487|     39|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    175|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    175|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    175|}
xmlXPathSubstringFunction:
 7520|  16.6k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  16.6k|    xmlXPathObjectPtr str, start, len;
 7522|  16.6k|    double le=0, in;
 7523|  16.6k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  16.6k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 6, False: 16.6k]
  ------------------
 7526|      6|	CHECK_ARITY(2);
  ------------------
  |  |  280|      6|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6]
  |  |  ------------------
  |  |  281|      6|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 0]
  |  |  ------------------
  |  |  282|      6|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7527|      6|    }
 7528|  16.6k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 3, False: 16.6k]
  ------------------
 7529|      3|	CHECK_ARITY(3);
  ------------------
  |  |  280|      3|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 3]
  |  |  ------------------
  |  |  281|      3|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 0]
  |  |  ------------------
  |  |  282|      3|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      0|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 0]
  |  |  ------------------
  |  |  284|      0|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7530|      3|    }
 7531|       |    /*
 7532|       |     * take care of possible last (position) argument
 7533|       |    */
 7534|  16.6k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 7.54k, False: 9.12k]
  ------------------
 7535|  7.54k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  7.54k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 7.54k, False: 0]
  |  |  |  Branch (297:34): [True: 1.35k, False: 6.19k]
  |  |  ------------------
  |  |  298|  7.54k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  7.54k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  7.54k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 7.54k]
  |  |  |  Branch (261:34): [True: 2, False: 7.54k]
  |  |  ------------------
  |  |  262|  7.54k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  7.54k|	len = xmlXPathValuePop(ctxt);
 7538|  7.54k|	le = len->floatval;
 7539|  7.54k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  7.54k|    }
 7541|       |
 7542|  16.6k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  16.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 16.6k, False: 0]
  |  |  |  Branch (297:34): [True: 6.13k, False: 10.5k]
  |  |  ------------------
  |  |  298|  16.6k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  16.6k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  16.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 16.6k]
  |  |  |  Branch (261:34): [True: 1, False: 16.6k]
  |  |  ------------------
  |  |  262|  16.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  16.6k|    start = xmlXPathValuePop(ctxt);
 7545|  16.6k|    in = start->floatval;
 7546|  16.6k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  16.6k|    CAST_TO_STRING;
  ------------------
  |  |  290|  16.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 16.6k, False: 5]
  |  |  |  Branch (290:34): [True: 16.6k, False: 1]
  |  |  ------------------
  |  |  291|  16.6k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  16.6k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  16.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 8, False: 16.6k]
  |  |  |  Branch (261:34): [True: 2, False: 16.6k]
  |  |  ------------------
  |  |  262|  16.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     10|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  16.6k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  16.6k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 1.39k, False: 15.2k]
  ------------------
 7552|  1.39k|        i = INT_MAX;
 7553|  15.2k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 9.41k, False: 5.83k]
  ------------------
 7554|  9.41k|        i = (int)in;
 7555|  9.41k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 667, False: 8.75k]
  ------------------
 7556|    667|            i += 1;
 7557|  9.41k|    }
 7558|       |
 7559|  16.6k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 7.53k, False: 9.11k]
  ------------------
 7560|  7.53k|        double rin, rle, end;
 7561|       |
 7562|  7.53k|        rin = floor(in);
 7563|  7.53k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 413, False: 7.12k]
  ------------------
 7564|    413|            rin += 1.0;
 7565|       |
 7566|  7.53k|        rle = floor(le);
 7567|  7.53k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 601, False: 6.93k]
  ------------------
 7568|    601|            rle += 1.0;
 7569|       |
 7570|  7.53k|        end = rin + rle;
 7571|  7.53k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 1.59k, False: 5.94k]
  ------------------
 7572|  1.59k|            j = 1;
 7573|  5.94k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 5.70k, False: 237]
  ------------------
 7574|  5.70k|            j = (int)end;
 7575|  5.70k|        }
 7576|  7.53k|    }
 7577|       |
 7578|  16.6k|    i -= 1;
 7579|  16.6k|    j -= 1;
 7580|       |
 7581|  16.6k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 13.9k, False: 2.74k]
  |  Branch (7581:20): [True: 13.0k, False: 874]
  ------------------
 7582|  13.0k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  13.0k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 5, False: 13.0k]
  ------------------
 7584|      5|            xmlXPathPErrMemory(ctxt);
 7585|  13.0k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  13.0k|	xmlFree(ret);
 7587|  13.0k|    } else {
 7588|  3.61k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  3.61k|    }
 7590|       |
 7591|  16.6k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  16.6k|}
xmlXPathSubstringBeforeFunction:
 7607|    572|xmlXPathSubstringBeforeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7608|    572|    xmlXPathObjectPtr str = NULL;
 7609|    572|    xmlXPathObjectPtr find = NULL;
 7610|    572|    const xmlChar *point;
 7611|    572|    xmlChar *result;
 7612|       |
 7613|  1.71k|    CHECK_ARITY(2);
  ------------------
  |  |  280|    572|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 572]
  |  |  ------------------
  |  |  281|    572|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 571]
  |  |  ------------------
  |  |  282|    572|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    571|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 571]
  |  |  ------------------
  |  |  284|    571|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7614|  1.71k|    CAST_TO_STRING;
  ------------------
  |  |  290|    571|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 571, False: 0]
  |  |  |  Branch (290:34): [True: 571, False: 0]
  |  |  ------------------
  |  |  291|    571|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7615|  1.71k|    find = xmlXPathValuePop(ctxt);
 7616|  1.71k|    CAST_TO_STRING;
  ------------------
  |  |  290|    571|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 570, False: 1]
  |  |  |  Branch (290:34): [True: 570, False: 0]
  |  |  ------------------
  |  |  291|    571|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7617|  1.71k|    str = xmlXPathValuePop(ctxt);
 7618|  1.71k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7618:9): [True: 7, False: 564]
  ------------------
 7619|      7|        goto error;
 7620|       |
 7621|    564|    point = xmlStrstr(str->stringval, find->stringval);
 7622|    564|    if (point == NULL) {
  ------------------
  |  Branch (7622:9): [True: 226, False: 338]
  ------------------
 7623|    226|        result = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    226|#define BAD_CAST (xmlChar *)
  ------------------
 7624|    338|    } else {
 7625|    338|        result = xmlStrndup(str->stringval, point - str->stringval);
 7626|    338|    }
 7627|    564|    if (result == NULL) {
  ------------------
  |  Branch (7627:9): [True: 1, False: 563]
  ------------------
 7628|      1|        xmlXPathPErrMemory(ctxt);
 7629|      1|        goto error;
 7630|      1|    }
 7631|    563|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result));
 7632|       |
 7633|    571|error:
 7634|    571|    xmlXPathReleaseObject(ctxt->context, str);
 7635|    571|    xmlXPathReleaseObject(ctxt->context, find);
 7636|    571|}
xmlXPathNormalizeFunction:
 7697|  4.86k|xmlXPathNormalizeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7698|  4.86k|    xmlChar *source, *target;
 7699|  4.86k|    int blank;
 7700|       |
 7701|  4.86k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7701:9): [True: 0, False: 4.86k]
  ------------------
 7702|  4.86k|    if (nargs == 0) {
  ------------------
  |  Branch (7702:9): [True: 4.16k, False: 699]
  ------------------
 7703|       |        /* Use current context node */
 7704|  4.16k|        source = xmlXPathCastNodeToString(ctxt->context->node);
 7705|  4.16k|        if (source == NULL)
  ------------------
  |  Branch (7705:13): [True: 3, False: 4.16k]
  ------------------
 7706|      3|            xmlXPathPErrMemory(ctxt);
 7707|  4.16k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, source));
 7708|  4.16k|        nargs = 1;
 7709|  4.16k|    }
 7710|       |
 7711|  14.5k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  4.86k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 4.86k]
  |  |  ------------------
  |  |  281|  4.86k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 4.86k]
  |  |  ------------------
  |  |  282|  4.86k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  4.86k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 4.86k]
  |  |  ------------------
  |  |  284|  4.86k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7712|  14.5k|    CAST_TO_STRING;
  ------------------
  |  |  290|  4.86k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 4.86k, False: 0]
  |  |  |  Branch (290:34): [True: 701, False: 4.16k]
  |  |  ------------------
  |  |  291|  4.86k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7713|  14.5k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  4.86k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 4.86k]
  |  |  |  Branch (261:34): [True: 1, False: 4.86k]
  |  |  ------------------
  |  |  262|  4.86k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7714|  4.86k|    source = ctxt->value->stringval;
 7715|  4.86k|    if (source == NULL)
  ------------------
  |  Branch (7715:9): [True: 3, False: 4.86k]
  ------------------
 7716|      3|        return;
 7717|  4.86k|    target = source;
 7718|       |
 7719|       |    /* Skip leading whitespaces */
 7720|  4.86k|    while (IS_BLANK_CH(*source))
 7721|    666|        source++;
 7722|       |
 7723|       |    /* Collapse intermediate whitespaces, and skip trailing whitespaces */
 7724|  4.86k|    blank = 0;
 7725|  22.0k|    while (*source) {
  ------------------
  |  Branch (7725:12): [True: 17.2k, False: 4.86k]
  ------------------
 7726|  17.2k|        if (IS_BLANK_CH(*source)) {
  ------------------
  |  |  137|  17.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  17.2k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 664, False: 16.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|  17.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 16.5k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 843, False: 15.7k]
  |  |  |  |  ------------------
  |  |  |  |   92|  17.2k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 10, False: 15.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7727|  1.51k|	    blank = 1;
 7728|  15.6k|        } else {
 7729|  15.6k|            if (blank) {
  ------------------
  |  Branch (7729:17): [True: 898, False: 14.7k]
  ------------------
 7730|    898|                *target++ = 0x20;
 7731|    898|                blank = 0;
 7732|    898|            }
 7733|  15.6k|            *target++ = *source;
 7734|  15.6k|        }
 7735|  17.2k|        source++;
 7736|  17.2k|    }
 7737|  4.86k|    *target = 0;
 7738|  4.86k|}
xmlXPathTranslateFunction:
 7762|  5.49k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  5.49k|    xmlXPathObjectPtr str = NULL;
 7764|  5.49k|    xmlXPathObjectPtr from = NULL;
 7765|  5.49k|    xmlXPathObjectPtr to = NULL;
 7766|  5.49k|    xmlBufPtr target;
 7767|  5.49k|    int offset, max;
 7768|  5.49k|    int ch;
 7769|  5.49k|    const xmlChar *point;
 7770|  5.49k|    xmlChar *cptr, *content;
 7771|       |
 7772|  16.4k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  5.49k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.49k]
  |  |  ------------------
  |  |  281|  5.49k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 9, False: 5.48k]
  |  |  ------------------
  |  |  282|  5.49k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.48k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5.48k]
  |  |  ------------------
  |  |  284|  5.48k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  16.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.48k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.48k, False: 0]
  |  |  |  Branch (290:34): [True: 5.23k, False: 250]
  |  |  ------------------
  |  |  291|  5.48k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  16.4k|    to = xmlXPathValuePop(ctxt);
 7776|  16.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.48k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.48k, False: 0]
  |  |  |  Branch (290:34): [True: 4.73k, False: 747]
  |  |  ------------------
  |  |  291|  5.48k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  16.4k|    from = xmlXPathValuePop(ctxt);
 7778|  16.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.48k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.47k, False: 5]
  |  |  |  Branch (290:34): [True: 5.47k, False: 1]
  |  |  ------------------
  |  |  291|  5.48k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  16.4k|    str = xmlXPathValuePop(ctxt);
 7780|  16.4k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 28, False: 5.45k]
  ------------------
 7781|     28|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  5.45k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 5.45k, False: 0]
  ------------------
 7787|  5.45k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  5.45k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  5.45k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 4.90k, False: 552]
  |  Branch (7790:25): [True: 4.56k, False: 340]
  ------------------
 7791|  4.56k|            unsigned long p;
 7792|       |
 7793|  4.56k|            f1 = f1 / 10 + 1;
 7794|  4.56k|            f2 = f2 / 10 + 1;
 7795|  4.56k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 4.56k]
  ------------------
 7796|  4.56k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 13, False: 4.54k]
  ------------------
 7797|     13|                goto error;
 7798|  4.56k|        }
 7799|  5.45k|    }
 7800|       |
 7801|  5.44k|    target = xmlBufCreate(50);
 7802|  5.44k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 6, False: 5.43k]
  ------------------
 7803|      6|        xmlXPathPErrMemory(ctxt);
 7804|      6|        goto error;
 7805|      6|    }
 7806|       |
 7807|  5.43k|    max = xmlUTF8Strlen(to->stringval);
 7808|  61.7k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 56.2k, False: 5.43k]
  ------------------
 7809|  56.2k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|  56.2k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 31.4k, False: 24.8k]
  ------------------
 7811|  31.4k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 12.9k, False: 18.4k]
  ------------------
 7812|  12.9k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  12.9k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 12.9k, False: 0]
  ------------------
 7814|  12.9k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  12.9k|            }
 7816|  31.4k|        } else
 7817|  24.8k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|  56.2k|        cptr++;
 7821|  56.2k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 56.2k]
  ------------------
 7822|       |            /* if not simple ascii, verify proper format */
 7823|      0|            if ( (ch & 0xc0) != 0xc0 ) {
  ------------------
  |  Branch (7823:18): [True: 0, False: 0]
  ------------------
 7824|      0|                xmlXPathErr(ctxt, XPATH_INVALID_CHAR_ERROR);
 7825|      0|                break;
 7826|      0|            }
 7827|       |            /* then skip over remaining bytes for this char */
 7828|      0|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (7828:21): [True: 0, False: 0]
  ------------------
 7829|      0|                if ( (*cptr++ & 0xc0) != 0x80 ) {
  ------------------
  |  Branch (7829:22): [True: 0, False: 0]
  ------------------
 7830|      0|                    xmlXPathErr(ctxt, XPATH_INVALID_CHAR_ERROR);
 7831|      0|                    break;
 7832|      0|                }
 7833|      0|            if (ch & 0x80) /* must have had error encountered */
  ------------------
  |  Branch (7833:17): [True: 0, False: 0]
  ------------------
 7834|      0|                break;
 7835|      0|        }
 7836|  56.2k|    }
 7837|       |
 7838|  5.43k|    content = xmlBufDetach(target);
 7839|  5.43k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 5.43k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  5.43k|    else
 7842|  5.43k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  5.43k|    xmlBufFree(target);
 7844|  5.48k|error:
 7845|  5.48k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  5.48k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  5.48k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  5.48k|}
xmlXPathBooleanFunction:
 7863|  19.8k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  19.8k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  59.5k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  19.8k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 19.8k]
  |  |  ------------------
  |  |  281|  19.8k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 19.8k]
  |  |  ------------------
  |  |  282|  19.8k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  19.8k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 19.8k]
  |  |  ------------------
  |  |  284|  19.8k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  59.5k|    cur = xmlXPathValuePop(ctxt);
 7868|  59.5k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 19.8k]
  ------------------
 7869|  19.8k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 14.3k, False: 5.52k]
  ------------------
 7870|  14.3k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  14.3k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  14.3k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  14.3k|    }
 7875|  19.8k|    xmlXPathValuePush(ctxt, cur);
 7876|  19.8k|}
xmlXPathNotFunction:
 7888|      7|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     19|    CHECK_ARITY(1);
  ------------------
  |  |  280|      7|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7]
  |  |  ------------------
  |  |  281|      7|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 6]
  |  |  ------------------
  |  |  282|      7|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      6|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 6]
  |  |  ------------------
  |  |  284|      6|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     19|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      6|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 6, False: 0]
  |  |  |  Branch (304:34): [True: 3, False: 3]
  |  |  ------------------
  |  |  305|      6|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     19|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      6|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 5]
  |  |  |  Branch (261:34): [True: 1, False: 4]
  |  |  ------------------
  |  |  262|      6|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7892|      4|    ctxt->value->boolval = ! ctxt->value->boolval;
 7893|      4|}
xmlXPathTrueFunction:
 7903|     15|xmlXPathTrueFunction(xmlXPathParserContext *ctxt, int nargs) {
 7904|     39|    CHECK_ARITY(0);
  ------------------
  |  |  280|     15|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 15]
  |  |  ------------------
  |  |  281|     15|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 12]
  |  |  ------------------
  |  |  282|     15|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     12|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 12]
  |  |  ------------------
  |  |  284|     12|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7905|     39|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7906|     39|}
xmlXPathFalseFunction:
 7916|     25|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     69|    CHECK_ARITY(0);
  ------------------
  |  |  280|     25|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 25]
  |  |  ------------------
  |  |  281|     25|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 22]
  |  |  ------------------
  |  |  282|     25|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     22|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 22]
  |  |  ------------------
  |  |  284|     22|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     69|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     69|}
xmlXPathLangFunction:
 7942|  11.7k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  11.7k|    xmlXPathObjectPtr val;
 7944|  11.7k|    xmlNodePtr cur;
 7945|  11.7k|    xmlChar *theLang = NULL;
 7946|  11.7k|    const xmlChar *lang;
 7947|  11.7k|    int ret = 0;
 7948|  11.7k|    int i;
 7949|       |
 7950|  35.1k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  11.7k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |  281|  11.7k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 11.7k]
  |  |  ------------------
  |  |  282|  11.7k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  11.7k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 11.7k]
  |  |  ------------------
  |  |  284|  11.7k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  35.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  11.7k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 11.7k, False: 0]
  |  |  |  Branch (290:34): [True: 11.6k, False: 14]
  |  |  ------------------
  |  |  291|  11.7k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  35.1k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  11.7k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 11.7k]
  |  |  |  Branch (261:34): [True: 1, False: 11.6k]
  |  |  ------------------
  |  |  262|  11.7k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  11.6k|    val = xmlXPathValuePop(ctxt);
 7954|  11.6k|    lang = val->stringval;
 7955|  11.6k|    cur = ctxt->context->node;
 7956|   201k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 190k, False: 11.6k]
  ------------------
 7957|   190k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   190k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   190k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 190k]
  ------------------
 7958|   190k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|   190k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 190k]
  ------------------
 7961|      0|            break;
 7962|   190k|        cur = cur->parent;
 7963|   190k|    }
 7964|  11.6k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 11.6k]
  |  Branch (7964:30): [True: 0, False: 0]
  ------------------
 7965|      0|        for (i = 0;lang[i] != 0;i++)
  ------------------
  |  Branch (7965:20): [True: 0, False: 0]
  ------------------
 7966|      0|            if (toupper(lang[i]) != toupper(theLang[i]))
  ------------------
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:17): [Folded, False: 0]
  |  Branch (7966:17): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [True: 0, False: 0]
  |  Branch (7966:37): [Folded, False: 0]
  ------------------
 7967|      0|                goto not_equal;
 7968|      0|        if ((theLang[i] == 0) || (theLang[i] == '-'))
  ------------------
  |  Branch (7968:13): [True: 0, False: 0]
  |  Branch (7968:34): [True: 0, False: 0]
  ------------------
 7969|      0|            ret = 1;
 7970|      0|    }
 7971|  11.6k|not_equal:
 7972|  11.6k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 11.6k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  11.6k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  11.6k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  11.6k|}
xmlXPathNumberFunction:
 7987|   360k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   360k|    xmlXPathObjectPtr cur;
 7989|   360k|    double res;
 7990|       |
 7991|   360k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 360k]
  ------------------
 7992|   360k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 360k]
  ------------------
 7993|      0|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7993:6): [True: 0, False: 0]
  ------------------
 7994|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 7995|      0|	} else {
 7996|      0|	    xmlChar* content = xmlNodeGetContent(ctxt->context->node);
 7997|      0|            if (content == NULL)
  ------------------
  |  Branch (7997:17): [True: 0, False: 0]
  ------------------
 7998|      0|                xmlXPathPErrMemory(ctxt);
 7999|       |
 8000|      0|	    res = xmlXPathStringEvalNumber(content);
 8001|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8002|      0|	    xmlFree(content);
 8003|      0|	}
 8004|      0|	return;
 8005|      0|    }
 8006|       |
 8007|  1.44M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   360k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 360k]
  |  |  ------------------
  |  |  281|   360k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 360k]
  |  |  ------------------
  |  |  282|   360k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   360k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 8, False: 360k]
  |  |  ------------------
  |  |  284|   360k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.44M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.44M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 360k, False: 1]
  ------------------
 8010|   360k|        double floatval;
 8011|       |
 8012|   360k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   360k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   360k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   360k|    }
 8016|  1.44M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.44M|}
xmlXPathSumFunction:
 8029|     38|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     38|    xmlXPathObjectPtr cur;
 8031|     38|    int i;
 8032|     38|    double res = 0.0;
 8033|       |
 8034|    108|    CHECK_ARITY(1);
  ------------------
  |  |  280|     38|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 38]
  |  |  ------------------
  |  |  281|     38|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 35]
  |  |  ------------------
  |  |  282|     38|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     35|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 35]
  |  |  ------------------
  |  |  284|     35|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|    108|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 35]
  ------------------
 8036|     35|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 32]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     32|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     32|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     32|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 32, False: 0]
  |  Branch (8041:38): [True: 11, False: 21]
  ------------------
 8042|     42|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 31, False: 11]
  ------------------
 8043|     31|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     31|                                                cur->nodesetval->nodeTab[i]);
 8045|     31|	}
 8046|     11|    }
 8047|     32|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     32|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     32|}
xmlXPathFloorFunction:
 8061|    292|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    864|    CHECK_ARITY(1);
  ------------------
  |  |  280|    292|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 292]
  |  |  ------------------
  |  |  281|    292|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 6, False: 286]
  |  |  ------------------
  |  |  282|    292|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    286|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 286]
  |  |  ------------------
  |  |  284|    286|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    864|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    286|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 286, False: 0]
  |  |  |  Branch (297:34): [True: 160, False: 126]
  |  |  ------------------
  |  |  298|    286|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    864|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    286|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 286]
  |  |  |  Branch (261:34): [True: 3, False: 283]
  |  |  ------------------
  |  |  262|    286|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|    283|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|    283|}
xmlXPathParseNCName:
 8147|   101k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|   101k|    const xmlChar *end;
 8149|   101k|    xmlChar *ret;
 8150|       |
 8151|   101k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 101k]
  |  Branch (8151:27): [True: 0, False: 101k]
  ------------------
 8152|       |
 8153|   101k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|   101k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|   101k|#define XML_SCAN_NC         1
  ------------------
 8154|   101k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 3, False: 101k]
  ------------------
 8155|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|   101k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 5.08k, False: 96.3k]
  ------------------
 8158|  5.08k|        return(NULL);
 8159|       |
 8160|  96.3k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  96.3k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 74, False: 96.2k]
  ------------------
 8162|     74|        xmlXPathPErrMemory(ctxt);
 8163|  96.3k|    ctxt->cur = end;
 8164|  96.3k|    return(ret);
 8165|   101k|}
xmlXPathParseName:
 8199|  25.6k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  25.6k|    const xmlChar *end;
 8201|  25.6k|    xmlChar *ret;
 8202|       |
 8203|  25.6k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 25.6k]
  |  Branch (8203:27): [True: 0, False: 25.6k]
  ------------------
 8204|       |
 8205|  25.6k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  25.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  25.6k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 3, False: 25.6k]
  ------------------
 8207|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  25.6k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 3.44k, False: 22.1k]
  ------------------
 8210|  3.44k|        return(NULL);
 8211|       |
 8212|  22.1k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  22.1k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 53, False: 22.1k]
  ------------------
 8214|     53|        xmlXPathPErrMemory(ctxt);
 8215|  22.1k|    ctxt->cur = end;
 8216|  22.1k|    return(ret);
 8217|  25.6k|}
xmlXPathStringEvalNumber:
 8236|   699k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   699k|    const xmlChar *cur = str;
 8238|   699k|    double ret;
 8239|   699k|    int ok = 0;
 8240|   699k|    int isneg = 0;
 8241|   699k|    int exponent = 0;
 8242|   699k|    int is_exponent_negative = 0;
 8243|   699k|#ifdef __GNUC__
 8244|   699k|    unsigned long tmp = 0;
 8245|   699k|    double temp;
 8246|   699k|#endif
 8247|   699k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 699k]
  ------------------
 8248|   699k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   699k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 69.2k, False: 630k]
  ------------------
 8250|  69.2k|	isneg = 1;
 8251|  69.2k|	cur++;
 8252|  69.2k|    }
 8253|   699k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 624k, False: 74.8k]
  |  Branch (8253:27): [True: 540k, False: 84.7k]
  |  Branch (8253:43): [True: 64.1k, False: 20.6k]
  ------------------
 8254|   604k|        return(xmlXPathNAN);
 8255|   604k|    }
 8256|       |
 8257|  95.4k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  95.4k|    ret = 0;
 8263|   156k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 63.1k, False: 93.4k]
  |  Branch (8263:29): [True: 61.1k, False: 1.99k]
  ------------------
 8264|  61.1k|	ret = ret * 10;
 8265|  61.1k|	tmp = (*cur - '0');
 8266|  61.1k|	ok = 1;
 8267|  61.1k|	cur++;
 8268|  61.1k|	temp = (double) tmp;
 8269|  61.1k|	ret = ret + temp;
 8270|  61.1k|    }
 8271|       |#else
 8272|       |    ret = 0;
 8273|       |    while ((*cur >= '0') && (*cur <= '9')) {
 8274|       |	ret = ret * 10 + (*cur - '0');
 8275|       |	ok = 1;
 8276|       |	cur++;
 8277|       |    }
 8278|       |#endif
 8279|       |
 8280|  95.4k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 79.6k, False: 15.7k]
  ------------------
 8281|  79.6k|	int v, frac = 0, max;
 8282|  79.6k|	double fraction = 0;
 8283|       |
 8284|  79.6k|        cur++;
 8285|  79.6k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 17.0k, False: 62.5k]
  |  Branch (8285:23): [True: 21.4k, False: 41.0k]
  |  Branch (8285:40): [True: 37.0k, False: 1.52k]
  ------------------
 8286|  37.0k|	    return(xmlXPathNAN);
 8287|  37.0k|	}
 8288|  71.6k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 29.0k, False: 42.6k]
  ------------------
 8289|  29.0k|	    frac = frac + 1;
 8290|  29.0k|	    cur++;
 8291|  29.0k|        }
 8292|  42.6k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  42.6k|#define MAX_FRAC 20
  ------------------
 8293|  89.1k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 64.6k, False: 24.4k]
  |  Branch (8293:27): [True: 46.5k, False: 18.1k]
  |  Branch (8293:45): [True: 46.4k, False: 31]
  ------------------
 8294|  46.4k|	    v = (*cur - '0');
 8295|  46.4k|	    fraction = fraction * 10 + v;
 8296|  46.4k|	    frac = frac + 1;
 8297|  46.4k|	    cur++;
 8298|  46.4k|	}
 8299|  42.6k|	fraction /= pow(10.0, frac);
 8300|  42.6k|	ret = ret + fraction;
 8301|  42.8k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 18.4k, False: 24.4k]
  |  Branch (8301:26): [True: 233, False: 18.1k]
  ------------------
 8302|    233|	    cur++;
 8303|  42.6k|    }
 8304|  58.4k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 3.37k, False: 55.0k]
  |  Branch (8304:26): [True: 7.63k, False: 47.3k]
  ------------------
 8305|  11.0k|      cur++;
 8306|  11.0k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 2.56k, False: 8.44k]
  ------------------
 8307|  2.56k|	is_exponent_negative = 1;
 8308|  2.56k|	cur++;
 8309|  8.44k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 4.02k, False: 4.41k]
  ------------------
 8310|  4.02k|        cur++;
 8311|  4.02k|      }
 8312|  55.0k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 44.7k, False: 10.3k]
  |  Branch (8312:31): [True: 44.0k, False: 672]
  ------------------
 8313|  44.0k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 39.6k, False: 4.44k]
  ------------------
 8314|  39.6k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  44.0k|	cur++;
 8316|  44.0k|      }
 8317|  11.0k|    }
 8318|  58.4k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  58.4k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 30.2k, False: 28.1k]
  ------------------
 8320|  28.1k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 11.6k, False: 16.5k]
  ------------------
 8321|  28.1k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 2.40k, False: 25.7k]
  ------------------
 8322|  28.1k|    ret *= pow(10.0, (double)exponent);
 8323|  28.1k|    return(ret);
 8324|  58.4k|}
xmlXPathIsNodeType:
 8548|  12.0k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  12.0k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 12.0k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  12.0k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  12.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 36, False: 11.9k]
  ------------------
 8553|     36|	return(1);
 8554|  11.9k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  11.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 45, False: 11.9k]
  ------------------
 8555|     45|	return(1);
 8556|  11.9k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  11.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 36, False: 11.9k]
  ------------------
 8557|     36|	return(1);
 8558|  11.9k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  11.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 176, False: 11.7k]
  ------------------
 8559|    176|	return(1);
 8560|  11.7k|    return(0);
 8561|  11.9k|}
xmlXPathEvaluatePredicateResult:
11626|   223k|                                xmlXPathObject *res) {
11627|   223k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 223k]
  |  Branch (11627:27): [True: 0, False: 223k]
  ------------------
11628|   223k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 223k]
  ------------------
11630|      0|	    return(res->boolval);
11631|  90.6k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 90.6k, False: 133k]
  ------------------
11632|       |#if defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER == 1200))
11633|       |	    return((res->floatval == ctxt->context->proximityPosition) &&
11634|       |	           (!xmlXPathIsNaN(res->floatval))); /* MSC pbm Mark Vakoc !*/
11635|       |#else
11636|  90.6k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   128k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 128k, False: 94.8k]
  ------------------
11639|   128k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 223k]
  ------------------
11640|   128k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 128k]
  ------------------
11641|      0|		return(0);
11642|   128k|	    return(res->nodesetval->nodeNr != 0);
11643|  4.17k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 4.17k, False: 219k]
  ------------------
11644|  4.17k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 4.17k, False: 0]
  |  Branch (11644:41): [True: 3.34k, False: 833]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 223k]
  ------------------
11646|      0|	    break;
11647|   223k|    }
11648|      0|    return(0);
11649|   223k|}
xmlXPathEvalExpr:
12002|  18.8k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  18.8k|    int oldDepth = 0;
12007|       |
12008|  18.8k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 18.8k]
  |  Branch (12008:27): [True: 0, False: 18.8k]
  ------------------
12009|      0|        return;
12010|  18.8k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 2.96k, False: 15.8k]
  ------------------
12011|  2.96k|        return;
12012|       |
12013|       |#ifdef XPATH_STREAMING
12014|       |    comp = xmlXPathTryStreamCompile(ctxt->context, ctxt->base);
12015|       |    if ((comp == NULL) &&
12016|       |        (ctxt->context->lastError.code == XML_ERR_NO_MEMORY)) {
12017|       |        xmlXPathPErrMemory(ctxt);
12018|       |        return;
12019|       |    }
12020|       |    if (comp != NULL) {
12021|       |        if (ctxt->comp != NULL)
12022|       |	    xmlXPathFreeCompExpr(ctxt->comp);
12023|       |        ctxt->comp = comp;
12024|       |    } else
12025|       |#endif
12026|  15.8k|    {
12027|  15.8k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 15.8k, False: 0]
  ------------------
12028|  15.8k|            oldDepth = ctxt->context->depth;
12029|  15.8k|	xmlXPathCompileExpr(ctxt, 1);
12030|  15.8k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 15.8k, False: 0]
  ------------------
12031|  15.8k|            ctxt->context->depth = oldDepth;
12032|  15.8k|        CHECK_ERROR;
  ------------------
  |  |  230|  15.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.11k, False: 13.7k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  13.7k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 433, False: 13.2k]
  ------------------
12036|  13.2k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    433|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  13.2k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 13.2k, False: 36]
  |  Branch (12038:34): [True: 13.2k, False: 0]
  ------------------
12039|  13.2k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 13.2k, False: 0]
  ------------------
12040|  13.2k|                oldDepth = ctxt->context->depth;
12041|  13.2k|	    xmlXPathOptimizeExpression(ctxt,
12042|  13.2k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  13.2k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 13.2k, False: 0]
  ------------------
12044|  13.2k|                ctxt->context->depth = oldDepth;
12045|  13.2k|        }
12046|  13.2k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  13.2k|}
xpath.c:xmlXPathNameFunction:
 7223|  8.64k|{
 7224|  8.64k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  8.64k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 2.95k, False: 5.68k]
  ------------------
 7227|  2.95k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  2.95k|        nargs = 1;
 7229|  2.95k|    }
 7230|       |
 7231|  25.9k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  8.64k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8.64k]
  |  |  ------------------
  |  |  281|  8.64k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 8.63k]
  |  |  ------------------
  |  |  282|  8.64k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  8.63k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 4, False: 8.63k]
  |  |  ------------------
  |  |  284|  8.63k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  25.9k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 8.63k]
  ------------------
 7233|  8.63k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 5, False: 8.62k]
  ------------------
 7234|      5|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 5, False: 0]
  ------------------
 7235|  8.62k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  8.62k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  8.62k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 8.62k]
  |  Branch (7238:38): [True: 2.50k, False: 6.12k]
  ------------------
 7239|  2.50k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  6.12k|    } else {
 7241|  6.12k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  6.12k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  3.90k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 3.90k, False: 2.22k]
  ------------------
 7245|  3.90k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 6.12k]
  ------------------
 7246|  3.90k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 3.90k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  3.90k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 3.32k, False: 573]
  ------------------
 7250|  3.68k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 360, False: 213]
  ------------------
 7251|  3.68k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  3.68k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  3.68k|		} else {
 7254|    213|		    xmlChar *fullname;
 7255|       |
 7256|    213|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|    213|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|    213|				     NULL, 0);
 7259|    213|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 213]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|    213|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 212]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|    213|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|    213|                }
 7265|  3.90k|                break;
 7266|  2.22k|            default:
  ------------------
  |  Branch (7266:13): [True: 2.22k, False: 3.90k]
  ------------------
 7267|  2.22k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  2.22k|		    cur->nodesetval->nodeTab[i]));
 7269|  2.22k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  6.12k|        }
 7271|  6.12k|    }
 7272|  8.62k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  8.62k|}
xpath.c:xmlXPathSFComputeHash:
  186|  7.57k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  7.57k|    unsigned hashValue = 5381;
  188|  7.57k|    const xmlChar *ptr;
  189|       |
  190|  48.2k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 40.6k, False: 7.57k]
  ------------------
  191|  40.6k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  7.57k|    return(hashValue);
  194|  7.57k|}
xpath.c:wrap_cmp:
  606|  4.17M|    {
  607|  4.17M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  4.17M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 4.17M]
  ------------------
  609|  4.17M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  4.17M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  4.17M|    int depth1, depth2;
  311|  4.17M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  4.17M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  4.17M|    xmlNodePtr cur, root;
  314|  4.17M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  4.17M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  4.17M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 4.17M]
  |  Branch (316:28): [True: 0, False: 4.17M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  4.17M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 4.17M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  4.17M|    switch (node1->type) {
  326|  3.10M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 3.10M, False: 1.06M]
  ------------------
  327|  3.10M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.41M, False: 690k]
  ------------------
  328|  2.41M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.41M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.41M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.41M]
  ------------------
  329|      0|		    (0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (329:7): [True: 0, False: 0]
  ------------------
  330|      0|		    (node1->doc == node2->doc))
  ------------------
  |  Branch (330:7): [True: 0, False: 0]
  ------------------
  331|      0|		{
  332|      0|		    l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  333|      0|		    l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  334|      0|		    if (l1 < l2)
  ------------------
  |  Branch (334:11): [True: 0, False: 0]
  ------------------
  335|      0|			return(1);
  336|      0|		    if (l1 > l2)
  ------------------
  |  Branch (336:11): [True: 0, False: 0]
  ------------------
  337|      0|			return(-1);
  338|      0|		} else
  339|  2.41M|		    goto turtle_comparison;
  340|  2.41M|	    }
  341|   690k|	    break;
  342|   690k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 6.65k, False: 4.16M]
  ------------------
  343|  6.65k|	    precedence1 = 1; /* element is owner */
  344|  6.65k|	    miscNode1 = node1;
  345|  6.65k|	    node1 = node1->parent;
  346|  6.65k|	    misc = 1;
  347|  6.65k|	    break;
  348|   759k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 759k, False: 3.41M]
  ------------------
  349|   806k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 46.6k, False: 4.12M]
  ------------------
  350|   814k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 8.07k, False: 4.16M]
  ------------------
  351|   889k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 75.1k, False: 4.09M]
  ------------------
  352|   889k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   889k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 419k, False: 470k]
  ------------------
  357|  4.91M|		do {
  358|  4.91M|		    node1 = node1->prev;
  359|  4.91M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 409k, False: 4.51M]
  ------------------
  360|   409k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   409k|			break;
  362|   409k|		    }
  363|  4.51M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 9.88k, False: 4.50M]
  ------------------
  364|  9.88k|			precedence1 = 2; /* element is parent */
  365|       |			/*
  366|       |			* URGENT TODO: Are there any cases, where the
  367|       |			* parent of such a node is not an element node?
  368|       |			*/
  369|  9.88k|			node1 = node1->parent;
  370|  9.88k|			break;
  371|  9.88k|		    }
  372|  4.51M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 4.50M, Folded]
  ------------------
  373|   470k|	    } else {
  374|   470k|		precedence1 = 2; /* element is parent */
  375|   470k|		node1 = node1->parent;
  376|   470k|	    }
  377|   889k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 889k]
  |  Branch (377:29): [True: 1.05k, False: 888k]
  ------------------
  378|   889k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   888k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   888k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 888k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   889k|		node1 = miscNode1;
  383|   889k|		precedence1 = 0;
  384|   889k|	    } else
  385|      0|		misc = 1;
  386|   889k|	}
  387|   889k|	    break;
  388|   147k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 147k, False: 4.02M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|   147k|	    return(1);
  393|  24.7k|	default:
  ------------------
  |  Branch (393:2): [True: 24.7k, False: 4.14M]
  ------------------
  394|  24.7k|	    break;
  395|  4.17M|    }
  396|  1.61M|    switch (node2->type) {
  397|   525k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 525k, False: 1.08M]
  ------------------
  398|   525k|	    break;
  399|  19.7k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 19.7k, False: 1.59M]
  ------------------
  400|  19.7k|	    precedence2 = 1; /* element is owner */
  401|  19.7k|	    miscNode2 = node2;
  402|  19.7k|	    node2 = node2->parent;
  403|  19.7k|	    misc = 1;
  404|  19.7k|	    break;
  405|   832k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 832k, False: 779k]
  ------------------
  406|   880k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 47.9k, False: 1.56M]
  ------------------
  407|   889k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 8.76k, False: 1.60M]
  ------------------
  408|   963k|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 74.0k, False: 1.53M]
  ------------------
  409|   963k|	    miscNode2 = node2;
  410|   963k|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 436k, False: 526k]
  ------------------
  411|  4.93M|		do {
  412|  4.93M|		    node2 = node2->prev;
  413|  4.93M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 426k, False: 4.51M]
  ------------------
  414|   426k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   426k|			break;
  416|   426k|		    }
  417|  4.51M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 10.0k, False: 4.50M]
  ------------------
  418|  10.0k|			precedence2 = 2; /* element is parent */
  419|  10.0k|			node2 = node2->parent;
  420|  10.0k|			break;
  421|  10.0k|		    }
  422|  4.51M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 4.50M, Folded]
  ------------------
  423|   526k|	    } else {
  424|   526k|		precedence2 = 2; /* element is parent */
  425|   526k|		node2 = node2->parent;
  426|   526k|	    }
  427|   963k|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 963k]
  |  Branch (427:29): [True: 852, False: 962k]
  ------------------
  428|   962k|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|   962k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   962k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 962k, False: 0]
  ------------------
  429|   963k|	    {
  430|   963k|		node2 = miscNode2;
  431|   963k|		precedence2 = 0;
  432|   963k|	    } else
  433|      0|		misc = 1;
  434|   963k|	}
  435|   963k|	    break;
  436|    238|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 238, False: 1.61M]
  ------------------
  437|    238|	    return(1);
  438|   102k|	default:
  ------------------
  |  Branch (438:2): [True: 102k, False: 1.50M]
  ------------------
  439|   102k|	    break;
  440|  1.61M|    }
  441|  1.61M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 24.2k, False: 1.58M]
  ------------------
  442|  24.2k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.33k, False: 21.9k]
  ------------------
  443|  2.33k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 979, False: 1.35k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|    979|		cur = miscNode2->prev;
  449|  1.27k|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 747, False: 529]
  ------------------
  450|    747|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 450, False: 297]
  ------------------
  451|    450|			return(1);
  452|    297|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 297]
  ------------------
  453|      0|			return(-1);
  454|    297|		    cur = cur->prev;
  455|    297|		}
  456|    529|		return (-1);
  457|  1.35k|	    } else {
  458|       |		/*
  459|       |		* Evaluate based on higher precedence wrt to the element.
  460|       |		* TODO: This assumes attributes are sorted before content.
  461|       |		*   Is this 100% correct?
  462|       |		*/
  463|  1.35k|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 756, False: 595]
  ------------------
  464|    756|		    return(1);
  465|    595|		else
  466|    595|		    return(-1);
  467|  1.35k|	    }
  468|  2.33k|	}
  469|       |	/*
  470|       |	* Special case: One of the helper-elements is contained by the other.
  471|       |	* <foo>
  472|       |	*   <node2>
  473|       |	*     <node1>Text-1(precedence1 == 2)</node1>
  474|       |	*   </node2>
  475|       |	*   Text-6(precedence2 == 3)
  476|       |	* </foo>
  477|       |	*/
  478|  21.9k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 21.9k]
  |  Branch (478:28): [True: 0, False: 0]
  ------------------
  479|      0|	    cur = node1->parent;
  480|      0|	    while (cur) {
  ------------------
  |  Branch (480:13): [True: 0, False: 0]
  ------------------
  481|      0|		if (cur == node2)
  ------------------
  |  Branch (481:7): [True: 0, False: 0]
  ------------------
  482|      0|		    return(1);
  483|      0|		cur = cur->parent;
  484|      0|	    }
  485|      0|	}
  486|  21.9k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 21.9k]
  |  Branch (486:28): [True: 0, False: 0]
  ------------------
  487|      0|	    cur = node2->parent;
  488|      0|	    while (cur) {
  ------------------
  |  Branch (488:13): [True: 0, False: 0]
  ------------------
  489|      0|		if (cur == node1)
  ------------------
  |  Branch (489:7): [True: 0, False: 0]
  ------------------
  490|      0|		    return(-1);
  491|      0|		cur = cur->parent;
  492|      0|	    }
  493|      0|	}
  494|  21.9k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.60M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 694k, False: 914k]
  ------------------
  500|   694k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 19.1k, False: 675k]
  ------------------
  501|  19.1k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  19.1k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  19.1k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 19.1k]
  ------------------
  502|      0|	(0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (502:2): [True: 0, False: 0]
  ------------------
  503|      0|	(node1->doc == node2->doc)) {
  ------------------
  |  Branch (503:2): [True: 0, False: 0]
  ------------------
  504|       |
  505|      0|	l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  506|      0|	l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  507|      0|	if (l1 < l2)
  ------------------
  |  Branch (507:6): [True: 0, False: 0]
  ------------------
  508|      0|	    return(1);
  509|      0|	if (l1 > l2)
  ------------------
  |  Branch (509:6): [True: 0, False: 0]
  ------------------
  510|      0|	    return(-1);
  511|      0|    }
  512|       |
  513|  4.02M|turtle_comparison:
  514|       |
  515|  4.02M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 1.07M, False: 2.95M]
  ------------------
  516|  1.07M|	return(1);
  517|  2.95M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 68.8k, False: 2.88M]
  ------------------
  518|  68.8k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  42.5M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 40.4M, False: 2.11M]
  ------------------
  523|  40.4M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 772k, False: 39.6M]
  ------------------
  524|   772k|	    return(1);
  525|  39.6M|	depth2++;
  526|  39.6M|    }
  527|  2.11M|    root = cur;
  528|  38.5M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 36.8M, False: 1.70M]
  ------------------
  529|  36.8M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 408k, False: 36.4M]
  ------------------
  530|   408k|	    return(-1);
  531|  36.4M|	depth1++;
  532|  36.4M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.70M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.70M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  5.25M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.55M, False: 1.70M]
  ------------------
  543|  3.55M|	depth1--;
  544|  3.55M|	node1 = node1->parent;
  545|  3.55M|    }
  546|  6.27M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 4.57M, False: 1.70M]
  ------------------
  547|  4.57M|	depth2--;
  548|  4.57M|	node2 = node2->parent;
  549|  4.57M|    }
  550|  2.85M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.15M, False: 1.70M]
  ------------------
  551|  1.15M|	node1 = node1->parent;
  552|  1.15M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.15M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.15M]
  |  Branch (554:25): [True: 0, False: 1.15M]
  ------------------
  555|      0|	    return(-2);
  556|  1.15M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.70M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 509k, False: 1.19M]
  ------------------
  561|   509k|	return(1);
  562|  1.19M|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 487k, False: 705k]
  ------------------
  563|   487k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   705k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 693k, False: 11.3k]
  ------------------
  568|   693k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 679k, False: 14.0k]
  ------------------
  569|   679k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   679k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   679k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 679k]
  ------------------
  570|      0|	(0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (570:2): [True: 0, False: 0]
  ------------------
  571|      0|	(node1->doc == node2->doc)) {
  ------------------
  |  Branch (571:2): [True: 0, False: 0]
  ------------------
  572|       |
  573|      0|	l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  574|      0|	l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  575|      0|	if (l1 < l2)
  ------------------
  |  Branch (575:6): [True: 0, False: 0]
  ------------------
  576|      0|	    return(1);
  577|      0|	if (l1 > l2)
  ------------------
  |  Branch (577:6): [True: 0, False: 0]
  ------------------
  578|      0|	    return(-1);
  579|      0|    }
  580|       |
  581|  6.33M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 6.00M, False: 334k]
  ------------------
  582|  6.00M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 370k, False: 5.62M]
  ------------------
  583|   370k|	    return(1);
  584|   334k|    return(-1); /* assume there is no sibling list corruption */
  585|   705k|}
xpath.c:xmlXPathErrFmt:
  707|  9.29k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  9.29k|    va_list ap;
  709|  9.29k|    xmlStructuredErrorFunc schannel = NULL;
  710|  9.29k|    xmlGenericErrorFunc channel = NULL;
  711|  9.29k|    void *data = NULL;
  712|  9.29k|    xmlNodePtr node = NULL;
  713|  9.29k|    int res;
  714|       |
  715|  9.29k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 9.29k]
  ------------------
  716|      0|        return;
  717|  9.29k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  9.29k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  9.29k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 9.29k]
  |  Branch (717:23): [True: 0, False: 9.29k]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  9.29k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.58k, False: 5.70k]
  ------------------
  721|  3.58k|        return;
  722|       |
  723|  5.70k|    ctxt->error = code;
  724|       |
  725|  5.70k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 5.70k, False: 0]
  ------------------
  726|  5.70k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  5.70k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 5.70k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  5.70k|        xmlResetError(err);
  734|       |
  735|  5.70k|        err->domain = XML_FROM_XPATH;
  736|  5.70k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  5.70k|        err->level = XML_ERR_ERROR;
  738|  5.70k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 5.70k, False: 0]
  ------------------
  739|  5.70k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  5.70k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 38, False: 5.66k]
  ------------------
  741|     38|                xmlXPathPErrMemory(ctxt);
  742|     38|                return;
  743|     38|            }
  744|  5.70k|        }
  745|  5.66k|        err->int1 = ctxt->cur - ctxt->base;
  746|  5.66k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  5.66k|        schannel = ctxt->context->error;
  749|  5.66k|        data = ctxt->context->userData;
  750|  5.66k|        node = ctxt->context->debugNode;
  751|  5.66k|    }
  752|       |
  753|  5.66k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 5.66k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  5.66k|    va_start(ap, fmt);
  759|  5.66k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  5.66k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  5.66k|                         XML_ERR_ERROR, NULL, 0,
  762|  5.66k|                         (const char *) ctxt->base, NULL, NULL,
  763|  5.66k|                         ctxt->cur - ctxt->base, 0,
  764|  5.66k|                         fmt, ap);
  765|  5.66k|    va_end(ap);
  766|  5.66k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 49, False: 5.61k]
  ------------------
  767|     49|        xmlXPathPErrMemory(ctxt);
  768|  5.66k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   739k|                             xmlXPathObjectPtr val) {
 1932|   739k|    double ret = 0.0;
 1933|       |
 1934|   739k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 739k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   739k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 739k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 739k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   496k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 496k, False: 242k]
  ------------------
 1941|   496k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 739k]
  ------------------
 1942|   496k|        xmlChar *str;
 1943|       |
 1944|   496k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   496k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 64, False: 496k]
  ------------------
 1946|     64|            xmlXPathPErrMemory(ctxt);
 1947|     64|            ret = xmlXPathNAN;
 1948|   496k|        } else {
 1949|   496k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   496k|            xmlFree(str);
 1951|   496k|        }
 1952|   496k|	break;
 1953|   496k|    }
 1954|   124k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 124k, False: 614k]
  ------------------
 1955|   124k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   124k|	break;
 1957|  72.9k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 72.9k, False: 666k]
  ------------------
 1958|  72.9k|	ret = val->floatval;
 1959|  72.9k|	break;
 1960|  44.2k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 44.2k, False: 694k]
  ------------------
 1961|  44.2k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  44.2k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 739k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   739k|    }
 1968|   739k|    return(ret);
 1969|   739k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|   181k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|   181k|    xmlNsPtr cur;
 2606|       |
 2607|   181k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 181k]
  |  Branch (2607:25): [True: 0, False: 181k]
  ------------------
 2608|      0|	return(NULL);
 2609|   181k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 181k]
  |  Branch (2609:27): [True: 0, False: 181k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|   181k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|   181k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 22, False: 181k]
  ------------------
 2617|     22|	return(NULL);
 2618|   181k|    memset(cur, 0, sizeof(xmlNs));
 2619|   181k|    cur->type = XML_NAMESPACE_DECL;
 2620|   181k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 128k, False: 53.0k]
  ------------------
 2621|   128k|	cur->href = xmlStrdup(ns->href);
 2622|   128k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 17, False: 128k]
  ------------------
 2623|     17|            xmlFree(cur);
 2624|     17|            return(NULL);
 2625|     17|        }
 2626|   128k|    }
 2627|   181k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 133k, False: 48.4k]
  ------------------
 2628|   133k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|   133k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 22, False: 133k]
  ------------------
 2630|     22|            xmlFree((xmlChar *) cur->href);
 2631|     22|            xmlFree(cur);
 2632|     22|            return(NULL);
 2633|     22|        }
 2634|   133k|    }
 2635|   181k|    cur->next = (xmlNsPtr) node;
 2636|   181k|    return((xmlNodePtr) cur);
 2637|   181k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.49M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.49M|    xmlNodePtr *temp;
 2737|  1.49M|    int newSize;
 2738|       |
 2739|  1.49M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.49M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.49M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.49M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.49M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.49M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.49M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.49M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 304, False: 1.49M]
  ------------------
 2745|    304|        return(-1);
 2746|  1.49M|    cur->nodeMax = newSize;
 2747|  1.49M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.49M|    return(0);
 2750|  1.49M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.50M|{
 4258|  3.50M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 24, False: 3.50M]
  ------------------
 4259|     24|	return;
 4260|  3.50M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.50M]
  |  Branch (4260:27): [True: 3.50M, False: 0]
  ------------------
 4261|  3.50M|	 xmlXPathFreeObject(obj);
 4262|  3.50M|    } else {
 4263|      0|	xmlXPathContextCachePtr cache =
 4264|      0|	    (xmlXPathContextCachePtr) ctxt->cache;
 4265|       |
 4266|      0|	switch (obj->type) {
 4267|      0|	    case XPATH_NODESET:
  ------------------
  |  Branch (4267:6): [True: 0, False: 0]
  ------------------
 4268|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4268:6): [True: 0, False: 0]
  ------------------
 4269|      0|		if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (4269:7): [True: 0, False: 0]
  ------------------
 4270|      0|		    if ((obj->nodesetval->nodeMax <= 40) &&
  ------------------
  |  Branch (4270:11): [True: 0, False: 0]
  ------------------
 4271|      0|			(cache->numNodeset < cache->maxNodeset)) {
  ------------------
  |  Branch (4271:4): [True: 0, False: 0]
  ------------------
 4272|      0|                        obj->stringval = (void *) cache->nodesetObjs;
 4273|      0|                        cache->nodesetObjs = obj;
 4274|      0|                        cache->numNodeset += 1;
 4275|      0|			goto obj_cached;
 4276|      0|		    } else {
 4277|      0|			xmlXPathFreeNodeSet(obj->nodesetval);
 4278|      0|			obj->nodesetval = NULL;
 4279|      0|		    }
 4280|      0|		}
 4281|      0|		break;
 4282|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (4282:6): [True: 0, False: 0]
  ------------------
 4283|      0|		if (obj->stringval != NULL)
  ------------------
  |  Branch (4283:7): [True: 0, False: 0]
  ------------------
 4284|      0|		    xmlFree(obj->stringval);
 4285|      0|                obj->stringval = NULL;
 4286|      0|		break;
 4287|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4287:6): [True: 0, False: 0]
  ------------------
 4288|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (4288:6): [True: 0, False: 0]
  ------------------
 4289|      0|		break;
 4290|      0|	    default:
  ------------------
  |  Branch (4290:6): [True: 0, False: 0]
  ------------------
 4291|      0|		goto free_obj;
 4292|      0|	}
 4293|       |
 4294|       |	/*
 4295|       |	* Fallback to adding to the misc-objects slot.
 4296|       |	*/
 4297|      0|        if (cache->numMisc >= cache->maxMisc)
  ------------------
  |  Branch (4297:13): [True: 0, False: 0]
  ------------------
 4298|      0|	    goto free_obj;
 4299|      0|        obj->stringval = (void *) cache->miscObjs;
 4300|      0|        cache->miscObjs = obj;
 4301|      0|        cache->numMisc += 1;
 4302|       |
 4303|      0|obj_cached:
 4304|      0|        obj->boolval = 0;
 4305|      0|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (4305:6): [True: 0, False: 0]
  ------------------
 4306|      0|	    xmlNodeSetPtr tmpset = obj->nodesetval;
 4307|       |
 4308|       |	    /*
 4309|       |	    * Due to those nasty ns-nodes, we need to traverse
 4310|       |	    * the list and free the ns-nodes.
 4311|       |	    */
 4312|      0|	    if (tmpset->nodeNr > 0) {
  ------------------
  |  Branch (4312:10): [True: 0, False: 0]
  ------------------
 4313|      0|		int i;
 4314|      0|		xmlNodePtr node;
 4315|       |
 4316|      0|		for (i = 0; i < tmpset->nodeNr; i++) {
  ------------------
  |  Branch (4316:15): [True: 0, False: 0]
  ------------------
 4317|      0|		    node = tmpset->nodeTab[i];
 4318|      0|		    if ((node != NULL) &&
  ------------------
  |  Branch (4318:11): [True: 0, False: 0]
  ------------------
 4319|      0|			(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4319:4): [True: 0, False: 0]
  ------------------
 4320|      0|		    {
 4321|      0|			xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 4322|      0|		    }
 4323|      0|		}
 4324|      0|	    }
 4325|      0|	    tmpset->nodeNr = 0;
 4326|      0|        }
 4327|       |
 4328|      0|	return;
 4329|       |
 4330|      0|free_obj:
 4331|       |	/*
 4332|       |	* Cache is full; free the object.
 4333|       |	*/
 4334|      0|	if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4334:6): [True: 0, False: 0]
  ------------------
 4335|      0|	    xmlXPathFreeNodeSet(obj->nodesetval);
 4336|      0|	xmlFree(obj);
 4337|      0|    }
 4338|  3.50M|}
xpath.c:xmlXPathFormatNumber:
 2229|  15.2k|{
 2230|  15.2k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 15.2k]
  ------------------
 2232|      0|	if (buffersize > (int)sizeof("Infinity"))
  ------------------
  |  Branch (2232:6): [True: 0, False: 0]
  ------------------
 2233|      0|	    snprintf(buffer, buffersize, "Infinity");
 2234|      0|	break;
 2235|      0|    case -1:
  ------------------
  |  Branch (2235:5): [True: 0, False: 15.2k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  15.2k|    default:
  ------------------
  |  Branch (2239:5): [True: 15.2k, False: 0]
  ------------------
 2240|  15.2k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 15.2k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  15.2k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 15.2k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  15.2k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 8.71k, False: 6.52k]
  |  Branch (2246:35): [True: 5.42k, False: 3.28k]
  ------------------
 2247|  5.42k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 4.11k, False: 1.31k]
  ------------------
 2248|  4.11k|	    char work[30];
 2249|  4.11k|	    char *ptr, *cur;
 2250|  4.11k|	    int value = (int) number;
 2251|       |
 2252|  4.11k|            ptr = &buffer[0];
 2253|  4.11k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 4.11k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  4.11k|	    } else {
 2256|  4.11k|		snprintf(work, 29, "%d", value);
 2257|  4.11k|		cur = &work[0];
 2258|  18.1k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 13.9k, False: 4.11k]
  |  Branch (2258:20): [True: 13.9k, False: 0]
  ------------------
 2259|  13.9k|		    *ptr++ = *cur++;
 2260|  13.9k|		}
 2261|  4.11k|	    }
 2262|  4.11k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 4.11k, False: 0]
  ------------------
 2263|  4.11k|		*ptr = 0;
 2264|  4.11k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  11.1k|	} else {
 2269|       |	    /*
 2270|       |	      For the dimension of work,
 2271|       |	          DBL_DIG is number of significant digits
 2272|       |		  EXPONENT is only needed for "scientific notation"
 2273|       |	          3 is sign, decimal point, and terminating zero
 2274|       |		  LOWER_DOUBLE_EXP is max number of leading zeroes in fraction
 2275|       |	      Note that this dimension is slightly (a few characters)
 2276|       |	      larger than actually necessary.
 2277|       |	    */
 2278|  11.1k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  11.1k|	    int integer_place, fraction_place;
 2280|  11.1k|	    char *ptr;
 2281|  11.1k|	    char *after_fraction;
 2282|  11.1k|	    double absolute_value;
 2283|  11.1k|	    int size;
 2284|       |
 2285|  11.1k|	    absolute_value = fabs(number);
 2286|       |
 2287|       |	    /*
 2288|       |	     * First choose format - scientific or regular floating point.
 2289|       |	     * In either case, result is in work, and after_fraction points
 2290|       |	     * just past the fractional part.
 2291|       |	    */
 2292|  11.1k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  11.1k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 9.81k, False: 1.30k]
  ------------------
 2293|  1.30k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.30k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 270, False: 1.03k]
  ------------------
 2294|  10.0k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 10.0k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  10.0k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  10.0k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  10.0k|		fraction_place = DBL_DIG - 1;
 2298|  10.0k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  10.0k|			 integer_place, fraction_place, number);
 2300|  53.3k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 53.3k, False: 0]
  |  Branch (2300:24): [True: 43.2k, False: 10.0k]
  ------------------
 2301|       |
 2302|  10.0k|	    }
 2303|  1.03k|	    else {
 2304|       |		/* Use regular notation */
 2305|  1.03k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 1.03k, False: 0]
  ------------------
 2306|  1.03k|		    integer_place = (int)log10(absolute_value);
 2307|  1.03k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 689, False: 348]
  ------------------
 2308|    689|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|    348|		    else
 2310|    348|		        fraction_place = DBL_DIG - integer_place;
 2311|  1.03k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  1.03k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  1.03k|				fraction_place, number);
 2316|  1.03k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  14.4k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 3.31k, False: 11.1k]
  ------------------
 2320|  69.5k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 66.2k, False: 3.31k]
  ------------------
 2321|  3.31k|		size--;
 2322|  3.31k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  11.1k|	    after_fraction = work + size;
 2326|  11.1k|	    ptr = after_fraction;
 2327|  38.0k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 26.9k, False: 11.1k]
  ------------------
 2328|  26.9k|		;
 2329|  11.1k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 10.7k, False: 344]
  ------------------
 2330|  10.7k|	        ptr++;
 2331|  54.3k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 43.2k, False: 11.1k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  11.1k|	    size = strlen(work) + 1;
 2335|  11.1k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 11.1k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  11.1k|	    memmove(buffer, work, size);
 2340|  11.1k|	}
 2341|  15.2k|	break;
 2342|  15.2k|    }
 2343|  15.2k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|  78.0k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|  78.0k|    xmlChar *strval;
 4534|  78.0k|    double ret;
 4535|       |
 4536|  78.0k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 78.0k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|  78.0k|    strval = xmlXPathCastNodeToString(node);
 4539|  78.0k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 24, False: 78.0k]
  ------------------
 4540|     24|        xmlXPathPErrMemory(ctxt);
 4541|     24|	return(xmlXPathNAN);
 4542|     24|    }
 4543|  78.0k|    ret = xmlXPathCastStringToNumber(strval);
 4544|  78.0k|    xmlFree(strval);
 4545|       |
 4546|  78.0k|    return(ret);
 4547|  78.0k|}
xpath.c:xmlXPathNewCompExpr:
  940|  12.8k|xmlXPathNewCompExpr(void) {
  941|  12.8k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  12.8k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  12.8k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 26, False: 12.8k]
  ------------------
  945|     26|	return(NULL);
  946|  12.8k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  12.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  12.8k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  12.8k|    cur->nbStep = 0;
  953|  12.8k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  12.8k|	                                   sizeof(xmlXPathStepOp));
  955|  12.8k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 38, False: 12.7k]
  ------------------
  956|     38|	xmlFree(cur);
  957|     38|	return(NULL);
  958|     38|    }
  959|  12.7k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  12.7k|    cur->last = -1;
  961|  12.7k|    return(cur);
  962|  12.8k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  16.0k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  16.0k|    int i, j;
 5435|  16.0k|    unsigned int *hashs1;
 5436|  16.0k|    unsigned int *hashs2;
 5437|  16.0k|    xmlChar **values1;
 5438|  16.0k|    xmlChar **values2;
 5439|  16.0k|    int ret = 0;
 5440|  16.0k|    xmlNodeSetPtr ns1;
 5441|  16.0k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  16.0k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 16.0k]
  ------------------
 5444|  16.0k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 16.0k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  16.0k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 16.0k]
  ------------------
 5447|  16.0k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 16.0k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  16.0k|    ns1 = arg1->nodesetval;
 5451|  16.0k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  16.0k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 16.0k]
  |  Branch (5453:26): [True: 6.03k, False: 10.0k]
  ------------------
 5454|  6.03k|	return(0);
 5455|  10.0k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 10.0k]
  |  Branch (5455:26): [True: 4.94k, False: 5.08k]
  ------------------
 5456|  4.94k|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  5.08k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 4.67k, False: 408]
  ------------------
 5462|  12.9k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 10.7k, False: 2.20k]
  ------------------
 5463|  50.2k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 41.9k, False: 8.25k]
  ------------------
 5464|  41.9k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 2.46k, False: 39.5k]
  ------------------
 5465|  2.46k|		    return(1);
 5466|       |
 5467|  2.61k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  2.61k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 2, False: 2.61k]
  ------------------
 5469|      2|        xmlXPathPErrMemory(ctxt);
 5470|      2|	return(0);
 5471|      2|    }
 5472|  2.61k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  2.61k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 2, False: 2.60k]
  ------------------
 5474|      2|        xmlXPathPErrMemory(ctxt);
 5475|      2|	xmlFree(values1);
 5476|      2|	return(0);
 5477|      2|    }
 5478|  2.60k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  2.60k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  2.60k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 1, False: 2.60k]
  ------------------
 5481|      1|        xmlXPathPErrMemory(ctxt);
 5482|      1|	xmlFree(hashs1);
 5483|      1|	xmlFree(values1);
 5484|      1|	return(0);
 5485|      1|    }
 5486|  2.60k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  2.60k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 3, False: 2.60k]
  ------------------
 5488|      3|        xmlXPathPErrMemory(ctxt);
 5489|      3|	xmlFree(hashs1);
 5490|      3|	xmlFree(values1);
 5491|      3|	xmlFree(values2);
 5492|      3|	return(0);
 5493|      3|    }
 5494|  2.60k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  6.20k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 4.40k, False: 1.80k]
  ------------------
 5496|  4.40k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  23.6k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 20.0k, False: 3.60k]
  ------------------
 5498|  20.0k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 18.0k, False: 1.97k]
  ------------------
 5499|  18.0k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  20.0k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 18.4k, False: 1.57k]
  ------------------
 5501|  18.4k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 214, False: 18.2k]
  ------------------
 5502|    214|		    ret = 1;
 5503|    214|		    break;
 5504|    214|		}
 5505|  18.4k|	    }
 5506|  1.57k|	    else {
 5507|  1.57k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 1.33k, False: 241]
  ------------------
 5508|  1.33k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  1.33k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 11, False: 1.32k]
  ------------------
 5510|     11|                        xmlXPathPErrMemory(ctxt);
 5511|  1.33k|                }
 5512|  1.57k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 1.09k, False: 484]
  ------------------
 5513|  1.09k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  1.09k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 9, False: 1.08k]
  ------------------
 5515|      9|                        xmlXPathPErrMemory(ctxt);
 5516|  1.09k|                }
 5517|  1.57k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  1.57k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 585, False: 989]
  ------------------
 5519|    585|		    break;
 5520|  1.57k|	    }
 5521|  20.0k|	}
 5522|  4.40k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 799, False: 3.60k]
  ------------------
 5523|    799|	    break;
 5524|  4.40k|    }
 5525|  11.9k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 9.33k, False: 2.60k]
  ------------------
 5526|  9.33k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 1.32k, False: 8.00k]
  ------------------
 5527|  1.32k|	    xmlFree(values1[i]);
 5528|  20.6k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 18.0k, False: 2.60k]
  ------------------
 5529|  18.0k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 1.08k, False: 16.9k]
  ------------------
 5530|  1.08k|	    xmlFree(values2[j]);
 5531|  2.60k|    xmlFree(values1);
 5532|  2.60k|    xmlFree(values2);
 5533|  2.60k|    xmlFree(hashs1);
 5534|  2.60k|    xmlFree(hashs2);
 5535|  2.60k|    return(ret);
 5536|  2.60k|}
xpath.c:xmlXPathNodeValHash:
 4920|  32.4k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  32.4k|    int len = 2;
 4922|  32.4k|    const xmlChar * string = NULL;
 4923|  32.4k|    xmlNodePtr tmp = NULL;
 4924|  32.4k|    unsigned int ret = 0;
 4925|       |
 4926|  32.4k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 32.4k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  32.4k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 3.28k, False: 29.2k]
  ------------------
 4930|  3.28k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  3.28k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 3.28k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  3.28k|	else
 4934|  3.28k|	    node = tmp;
 4935|       |
 4936|  3.28k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 3.28k]
  ------------------
 4937|      0|	    return(0);
 4938|  3.28k|    }
 4939|       |
 4940|  32.4k|    switch (node->type) {
 4941|    625|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 625, False: 31.8k]
  ------------------
 4942|    978|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 353, False: 32.1k]
  ------------------
 4943|  1.18k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 207, False: 32.2k]
  ------------------
 4944|  5.74k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 4.55k, False: 27.9k]
  ------------------
 4945|  5.74k|	    string = node->content;
 4946|  5.74k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 353, False: 5.39k]
  ------------------
 4947|    353|		return(0);
 4948|  5.39k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 512, False: 4.87k]
  ------------------
 4949|    512|		return(0);
 4950|  4.87k|	    return(string[0] + (string[1] << 8));
 4951|    511|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 511, False: 31.9k]
  ------------------
 4952|    511|	    string = ((xmlNsPtr)node)->href;
 4953|    511|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 236, False: 275]
  ------------------
 4954|    236|		return(0);
 4955|    275|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 275]
  ------------------
 4956|      0|		return(0);
 4957|    275|	    return(string[0] + (string[1] << 8));
 4958|    830|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 830, False: 31.6k]
  ------------------
 4959|    830|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    830|	    break;
 4961|  25.4k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 25.4k, False: 7.08k]
  ------------------
 4962|  25.4k|	    tmp = node->children;
 4963|  25.4k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 32.4k]
  ------------------
 4965|      0|	    return(0);
 4966|  32.4k|    }
 4967|  89.3k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 74.5k, False: 14.7k]
  ------------------
 4968|  74.5k|	switch (tmp->type) {
 4969|  1.13k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 1.13k, False: 73.4k]
  ------------------
 4970|  18.1k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 16.9k, False: 57.6k]
  ------------------
 4971|  18.1k|		string = tmp->content;
 4972|  18.1k|		break;
 4973|  56.4k|	    default:
  ------------------
  |  Branch (4973:6): [True: 56.4k, False: 18.1k]
  ------------------
 4974|  56.4k|                string = NULL;
 4975|  56.4k|		break;
 4976|  74.5k|	}
 4977|  74.5k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 18.1k, False: 56.4k]
  |  Branch (4977:26): [True: 17.8k, False: 275]
  ------------------
 4978|  17.8k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 4.15k, False: 13.6k]
  ------------------
 4979|  4.15k|		return(ret + (string[0] << 8));
 4980|  4.15k|	    }
 4981|  13.6k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 6.34k, False: 7.33k]
  ------------------
 4982|  6.34k|		len = 1;
 4983|  6.34k|		ret = string[0];
 4984|  7.33k|	    } else {
 4985|  7.33k|		return(string[0] + (string[1] << 8));
 4986|  7.33k|	    }
 4987|  13.6k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|  63.1k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 40.9k, False: 22.1k]
  ------------------
 4992|  40.9k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 40.9k, False: 0]
  ------------------
 4993|  40.9k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 40.9k, False: 0]
  ------------------
 4994|  40.9k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 40.9k, False: 0]
  ------------------
 4995|  40.9k|            tmp = tmp->children;
 4996|  40.9k|            continue;
 4997|  40.9k|	}
 4998|  22.1k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 22.1k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|  22.1k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 15.6k, False: 6.51k]
  ------------------
 5002|  15.6k|	    tmp = tmp->next;
 5003|  15.6k|	    continue;
 5004|  15.6k|	}
 5005|       |
 5006|  10.5k|	do {
 5007|  10.5k|	    tmp = tmp->parent;
 5008|  10.5k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 10.5k]
  ------------------
 5009|      0|		break;
 5010|  10.5k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 2.91k, False: 7.62k]
  ------------------
 5011|  2.91k|		tmp = NULL;
 5012|  2.91k|		break;
 5013|  2.91k|	    }
 5014|  7.62k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 3.60k, False: 4.02k]
  ------------------
 5015|  3.60k|		tmp = tmp->next;
 5016|  3.60k|		break;
 5017|  3.60k|	    }
 5018|  7.62k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 4.02k, False: 0]
  ------------------
 5019|  6.51k|    }
 5020|  14.7k|    return(ret);
 5021|  26.2k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  38.0k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  38.0k|  int i, ret=0;
 5372|  38.0k|  xmlNodeSetPtr ns;
 5373|  38.0k|  xmlChar *str2;
 5374|  38.0k|  xmlXPathObjectPtr val;
 5375|  38.0k|  double v;
 5376|       |
 5377|  38.0k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 38.0k]
  ------------------
 5378|  38.0k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 38.0k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  38.0k|    ns = arg->nodesetval;
 5382|  38.0k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 38.0k, False: 0]
  ------------------
 5383|  95.7k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 58.1k, False: 37.6k]
  ------------------
 5384|  58.1k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  58.1k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 58.1k, False: 11]
  ------------------
 5386|  58.1k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  58.1k|		xmlFree(str2);
 5388|  58.1k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  58.1k|                CHECK_ERROR0;
  ------------------
  |  |  236|  58.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 14, False: 58.0k]
  |  |  ------------------
  ------------------
 5390|  58.0k|		val = xmlXPathValuePop(ctxt);
 5391|  58.0k|		v = val->floatval;
 5392|  58.0k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  58.0k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 2.69k, False: 55.3k]
  ------------------
 5394|  2.69k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 2.30k, False: 387]
  |  Branch (5394:21): [True: 75, False: 2.23k]
  ------------------
 5395|     75|			ret = 1;
 5396|     75|			break;
 5397|  2.62k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 387, False: 2.23k]
  |  Branch (5397:27): [True: 363, False: 24]
  ------------------
 5398|    363|			ret = 1;
 5399|    363|			break;
 5400|    363|		    }
 5401|  55.3k|		} else {	/* NaN is unequal to any value */
 5402|  55.3k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 4.87k, False: 50.5k]
  ------------------
 5403|  4.87k|			ret = 1;
 5404|  55.3k|		}
 5405|  58.0k|	    } else {
 5406|     11|                xmlXPathPErrMemory(ctxt);
 5407|     11|            }
 5408|  58.1k|	}
 5409|  38.0k|    }
 5410|       |
 5411|  38.0k|    return(ret);
 5412|  38.0k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  3.87k|{
 5315|  3.87k|    int i;
 5316|  3.87k|    xmlNodeSetPtr ns;
 5317|  3.87k|    xmlChar *str2;
 5318|  3.87k|    unsigned int hash;
 5319|       |
 5320|  3.87k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 3.87k]
  |  Branch (5320:26): [True: 0, False: 3.87k]
  ------------------
 5321|  3.87k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 3.87k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  3.87k|    ns = arg->nodesetval;
 5324|       |    /*
 5325|       |     * A NULL nodeset compared with a string is always false
 5326|       |     * (since there is no node equal, and no node not equal)
 5327|       |     */
 5328|  3.87k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 3.87k]
  |  Branch (5328:25): [True: 2.30k, False: 1.57k]
  ------------------
 5329|  2.30k|        return (0);
 5330|  1.57k|    hash = xmlXPathStringHash(str);
 5331|  10.6k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 10.0k, False: 617]
  ------------------
 5332|  10.0k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 1.78k, False: 8.25k]
  ------------------
 5333|  1.78k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  1.78k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 2, False: 1.78k]
  ------------------
 5335|      2|                xmlXPathPErrMemory(ctxt);
 5336|      2|                return(0);
 5337|      2|            }
 5338|  1.78k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 1.31k, False: 465]
  ------------------
 5339|  1.31k|                xmlFree(str2);
 5340|  1.31k|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 880, False: 437]
  ------------------
 5341|    880|		    continue;
 5342|    437|                return (1);
 5343|  1.31k|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 244, False: 221]
  ------------------
 5344|    244|		xmlFree(str2);
 5345|    244|		return (1);
 5346|    244|	    }
 5347|    221|            xmlFree(str2);
 5348|  8.25k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 277, False: 7.97k]
  ------------------
 5349|    277|	    return (1);
 5350|  10.0k|    }
 5351|    617|    return (0);
 5352|  1.57k|}
xpath.c:xmlXPathStringHash:
 5031|  1.57k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.57k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.57k]
  ------------------
 5033|      0|	return(0);
 5034|  1.57k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 552, False: 1.02k]
  ------------------
 5035|    552|	return(0);
 5036|  1.02k|    return(string[0] + (string[1] << 8));
 5037|  1.57k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   196k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   196k|    int ret = 0;
 5542|       |    /*
 5543|       |     *At this point we are assured neither arg1 nor arg2
 5544|       |     *is a nodeset, so we can just pick the appropriate routine.
 5545|       |     */
 5546|   196k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 196k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 196k]
  ------------------
 5548|      0|	    break;
 5549|  80.4k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 80.4k, False: 115k]
  ------------------
 5550|  80.4k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 80.4k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 80.4k]
  ------------------
 5552|      0|		    break;
 5553|  38.0k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 38.0k, False: 42.4k]
  ------------------
 5554|  38.0k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  38.0k|		    break;
 5556|  35.3k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 35.3k, False: 45.1k]
  ------------------
 5557|  35.3k|		    ret = (arg1->boolval ==
 5558|  35.3k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  35.3k|		    break;
 5560|  7.08k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 7.08k, False: 73.3k]
  ------------------
 5561|  7.08k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 7.08k]
  ------------------
 5562|  7.08k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 3.19k, False: 3.89k]
  ------------------
 5563|  3.89k|		    else
 5564|  3.89k|			ret = 1;
 5565|  7.08k|		    ret = (arg1->boolval == ret);
 5566|  7.08k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 80.4k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 80.4k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 80.4k]
  ------------------
 5572|      0|		    break;
 5573|  80.4k|	    }
 5574|  80.4k|	    break;
 5575|   114k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 114k, False: 82.3k]
  ------------------
 5576|   114k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 114k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 114k]
  ------------------
 5578|      0|		    break;
 5579|  26.9k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 26.9k, False: 87.1k]
  ------------------
 5580|  26.9k|		    ret = (arg2->boolval==
 5581|  26.9k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  26.9k|		    break;
 5583|    473|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 473, False: 113k]
  ------------------
 5584|    473|		    xmlXPathValuePush(ctxt, arg2);
 5585|    473|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    473|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    473|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 1, False: 472]
  ------------------
 5588|      1|                        break;
 5589|       |                    /* Falls through. */
 5590|  87.1k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 86.6k, False: 27.3k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  87.1k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 7.64k, False: 79.5k]
  ------------------
 5593|  79.5k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 890, False: 78.6k]
  ------------------
 5594|  8.53k|		        ret = 0;
 5595|  78.6k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 5.42k, False: 73.1k]
  ------------------
 5596|  5.42k|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 76, False: 5.34k]
  ------------------
 5597|     76|			    ret = 1;
 5598|  5.34k|			else
 5599|  5.34k|			    ret = 0;
 5600|  73.1k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 686, False: 72.5k]
  ------------------
 5601|    686|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 221, False: 465]
  ------------------
 5602|    221|			    ret = 1;
 5603|    465|			else
 5604|    465|			    ret = 0;
 5605|  72.5k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 1.26k, False: 71.2k]
  ------------------
 5606|  1.26k|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 1.26k]
  ------------------
 5607|      0|			    ret = 1;
 5608|  1.26k|			else
 5609|  1.26k|			    ret = 0;
 5610|  71.2k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 262, False: 70.9k]
  ------------------
 5611|    262|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 262]
  ------------------
 5612|      0|			    ret = 1;
 5613|    262|			else
 5614|    262|			    ret = 0;
 5615|  70.9k|		    } else {
 5616|  70.9k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  70.9k|		    }
 5618|  87.1k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 114k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 114k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 114k]
  ------------------
 5624|      0|		    break;
 5625|   114k|	    }
 5626|   114k|	    break;
 5627|   114k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.83k, False: 194k]
  ------------------
 5628|  1.83k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.83k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.83k]
  ------------------
 5630|      0|		    break;
 5631|    524|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 524, False: 1.30k]
  ------------------
 5632|    524|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 524]
  ------------------
 5633|    524|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 310, False: 214]
  ------------------
 5634|    214|		    else
 5635|    214|			ret = 1;
 5636|    524|		    ret = (arg2->boolval == ret);
 5637|    524|		    break;
 5638|    244|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 244, False: 1.58k]
  ------------------
 5639|    244|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|    244|		    break;
 5641|  1.06k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 1.06k, False: 768]
  ------------------
 5642|  1.06k|		    xmlXPathValuePush(ctxt, arg1);
 5643|  1.06k|		    xmlXPathNumberFunction(ctxt, 1);
 5644|  1.06k|		    arg1 = xmlXPathValuePop(ctxt);
 5645|  1.06k|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 3, False: 1.06k]
  ------------------
 5646|      3|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|  1.06k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 506, False: 554]
  ------------------
 5649|    749|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 243, False: 311]
  ------------------
 5650|    749|		        ret = 0;
 5651|    749|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 310]
  ------------------
 5652|      1|			if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5652:8): [True: 0, False: 1]
  ------------------
 5653|      0|			    ret = 1;
 5654|      1|			else
 5655|      1|			    ret = 0;
 5656|    310|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 1, False: 309]
  ------------------
 5657|      1|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5657:8): [True: 0, False: 1]
  ------------------
 5658|      0|			    ret = 1;
 5659|      1|			else
 5660|      1|			    ret = 0;
 5661|    309|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 299]
  ------------------
 5662|     10|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5662:8): [True: 0, False: 10]
  ------------------
 5663|      0|			    ret = 1;
 5664|     10|			else
 5665|     10|			    ret = 0;
 5666|    299|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 3, False: 296]
  ------------------
 5667|      3|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5667:8): [True: 0, False: 3]
  ------------------
 5668|      0|			    ret = 1;
 5669|      3|			else
 5670|      3|			    ret = 0;
 5671|    296|		    } else {
 5672|    296|		        ret = (arg1->floatval == arg2->floatval);
 5673|    296|		    }
 5674|  1.06k|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.83k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.83k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.83k]
  ------------------
 5680|      0|		    break;
 5681|  1.83k|	    }
 5682|  1.83k|	    break;
 5683|  1.83k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 196k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 196k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 196k]
  ------------------
 5688|      0|	    break;
 5689|   196k|    }
 5690|   196k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   196k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   196k|    return(ret);
 5693|   196k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  59.9k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  59.9k|    int i, j, init = 0;
 5180|  59.9k|    double val1;
 5181|  59.9k|    double *values2;
 5182|  59.9k|    int ret = 0;
 5183|  59.9k|    xmlNodeSetPtr ns1;
 5184|  59.9k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  59.9k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 59.9k]
  ------------------
 5187|  59.9k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 59.9k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  59.9k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 59.9k]
  ------------------
 5192|  59.9k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 59.9k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  59.9k|    ns1 = arg1->nodesetval;
 5199|  59.9k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  59.9k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 59.9k]
  |  Branch (5201:26): [True: 38.5k, False: 21.3k]
  ------------------
 5202|  38.5k|	xmlXPathFreeObject(arg1);
 5203|  38.5k|	xmlXPathFreeObject(arg2);
 5204|  38.5k|	return(0);
 5205|  38.5k|    }
 5206|  21.3k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 21.3k]
  |  Branch (5206:26): [True: 15.5k, False: 5.81k]
  ------------------
 5207|  15.5k|	xmlXPathFreeObject(arg1);
 5208|  15.5k|	xmlXPathFreeObject(arg2);
 5209|  15.5k|	return(0);
 5210|  15.5k|    }
 5211|       |
 5212|  5.81k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  5.81k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 5.81k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  36.7k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 34.0k, False: 2.74k]
  ------------------
 5220|  34.0k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  34.0k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 28.6k, False: 5.34k]
  ------------------
 5222|  28.6k|	    continue;
 5223|  56.5k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 54.2k, False: 2.27k]
  ------------------
 5224|  54.2k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 43.9k, False: 10.2k]
  ------------------
 5225|  43.9k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  43.9k|                                                          ns2->nodeTab[j]);
 5227|  43.9k|	    }
 5228|  54.2k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 44.3k, False: 9.94k]
  ------------------
 5229|  44.3k|		continue;
 5230|  9.94k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 523, False: 9.42k]
  |  Branch (5230:17): [True: 299, False: 224]
  ------------------
 5231|    299|		ret = (val1 < values2[j]);
 5232|  9.64k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 224, False: 9.42k]
  |  Branch (5232:22): [True: 224, False: 0]
  ------------------
 5233|    224|		ret = (val1 <= values2[j]);
 5234|  9.42k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 9.42k, False: 0]
  |  Branch (5234:23): [True: 9.18k, False: 234]
  ------------------
 5235|  9.18k|		ret = (val1 > values2[j]);
 5236|    234|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 234, False: 0]
  |  Branch (5236:23): [True: 234, False: 0]
  ------------------
 5237|    234|		ret = (val1 >= values2[j]);
 5238|  9.94k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 3.06k, False: 6.87k]
  ------------------
 5239|  3.06k|		break;
 5240|  9.94k|	}
 5241|  5.34k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 3.06k, False: 2.27k]
  ------------------
 5242|  3.06k|	    break;
 5243|  2.27k|	init = 1;
 5244|  2.27k|    }
 5245|  5.81k|    xmlFree(values2);
 5246|  5.81k|    xmlXPathFreeObject(arg1);
 5247|  5.81k|    xmlXPathFreeObject(arg2);
 5248|  5.81k|    return(ret);
 5249|  5.81k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  72.7k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  72.7k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 72.7k]
  |  Branch (5273:26): [True: 0, False: 72.7k]
  ------------------
 5274|  72.7k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 72.7k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  72.7k|    switch(val->type) {
 5278|  61.4k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 61.4k, False: 11.2k]
  ------------------
 5279|  61.4k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 72.7k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 72.7k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|    884|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 884, False: 71.8k]
  ------------------
 5284|    884|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  10.3k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 10.3k, False: 62.3k]
  ------------------
 5286|  10.3k|	    xmlXPathValuePush(ctxt, arg);
 5287|  10.3k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  10.3k|	    xmlXPathValuePush(ctxt, val);
 5289|  10.3k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 72.7k]
  ------------------
 5291|      0|            xmlXPathReleaseObject(ctxt->context, arg);
 5292|      0|            xmlXPathReleaseObject(ctxt->context, val);
 5293|      0|            XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5294|  72.7k|    }
 5295|      0|    return(0);
 5296|  72.7k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  61.4k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  61.4k|    int i, ret = 0;
 5063|  61.4k|    xmlNodeSetPtr ns;
 5064|  61.4k|    xmlChar *str2;
 5065|       |
 5066|  61.4k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 61.4k]
  |  Branch (5066:24): [True: 0, False: 61.4k]
  ------------------
 5067|  61.4k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 61.4k]
  |  Branch (5067:35): [True: 0, False: 0]
  ------------------
 5068|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5069|      0|	xmlXPathReleaseObject(ctxt->context, f);
 5070|      0|        return(0);
 5071|      0|    }
 5072|  61.4k|    ns = arg->nodesetval;
 5073|  61.4k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 61.4k, False: 0]
  ------------------
 5074|  90.6k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 30.0k, False: 60.6k]
  ------------------
 5075|  30.0k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  30.0k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 29.9k, False: 29]
  ------------------
 5077|  29.9k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  29.9k|		 xmlFree(str2);
 5079|  29.9k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  29.9k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  29.9k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  29.9k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 854, False: 29.1k]
  ------------------
 5083|    854|		     break;
 5084|  29.9k|	     } else {
 5085|     29|                 xmlXPathPErrMemory(ctxt);
 5086|     29|             }
 5087|  30.0k|	}
 5088|  61.4k|    }
 5089|  61.4k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  61.4k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  61.4k|    return(ret);
 5092|  61.4k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   347k|{
 1882|   347k|    xmlXPathObjectPtr ret;
 1883|   347k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   347k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 347k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   347k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 347k, False: 0]
  |  Branch (1888:27): [True: 0, False: 347k]
  ------------------
 1889|      0|	switch (val->type) {
 1890|      0|            case XPATH_NODESET: {
  ------------------
  |  Branch (1890:13): [True: 0, False: 0]
  ------------------
 1891|      0|                xmlNodeSetPtr set;
 1892|       |
 1893|      0|                set = xmlXPathNodeSetMerge(NULL, val->nodesetval);
 1894|      0|                if (set == NULL) {
  ------------------
  |  Branch (1894:21): [True: 0, False: 0]
  ------------------
 1895|      0|                    xmlXPathPErrMemory(pctxt);
 1896|      0|                    return(NULL);
 1897|      0|                }
 1898|      0|                return(xmlXPathCacheWrapNodeSet(pctxt, set));
 1899|      0|            }
 1900|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (1900:6): [True: 0, False: 0]
  ------------------
 1901|      0|		return(xmlXPathCacheNewString(pctxt, val->stringval));
 1902|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1902:6): [True: 0, False: 0]
  ------------------
 1903|      0|		return(xmlXPathCacheNewBoolean(pctxt, val->boolval));
 1904|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (1904:6): [True: 0, False: 0]
  ------------------
 1905|      0|		return(xmlXPathCacheNewFloat(pctxt, val->floatval));
 1906|      0|	    default:
  ------------------
  |  Branch (1906:6): [True: 0, False: 0]
  ------------------
 1907|      0|		break;
 1908|      0|	}
 1909|      0|    }
 1910|   347k|    ret = xmlXPathObjectCopy(val);
 1911|   347k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 111, False: 347k]
  ------------------
 1912|    111|        xmlXPathPErrMemory(pctxt);
 1913|   347k|    return(ret);
 1914|   347k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|    884|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|    884|    int i, ret = 0;
 5117|    884|    xmlNodeSetPtr ns;
 5118|    884|    xmlChar *str2;
 5119|       |
 5120|    884|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 884]
  |  Branch (5120:24): [True: 0, False: 884]
  ------------------
 5121|    884|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 884]
  |  Branch (5121:35): [True: 0, False: 0]
  ------------------
 5122|      0|	xmlXPathReleaseObject(ctxt->context, arg);
 5123|      0|	xmlXPathReleaseObject(ctxt->context, s);
 5124|      0|        return(0);
 5125|      0|    }
 5126|    884|    ns = arg->nodesetval;
 5127|    884|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 884, False: 0]
  ------------------
 5128|  4.71k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 3.82k, False: 884]
  ------------------
 5129|  3.82k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|  3.82k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 3.82k, False: 1]
  ------------------
 5131|  3.82k|		 xmlXPathValuePush(ctxt,
 5132|  3.82k|			   xmlXPathCacheNewString(ctxt, str2));
 5133|  3.82k|		 xmlFree(str2);
 5134|  3.82k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|  3.82k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|  3.82k|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 3.82k]
  ------------------
 5137|      0|		     break;
 5138|  3.82k|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|  3.82k|	}
 5142|    884|    }
 5143|    884|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|    884|    xmlXPathReleaseObject(ctxt->context, s);
 5145|    884|    return(ret);
 5146|    884|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.14M|{
 1690|  1.14M|    xmlXPathObjectPtr ret;
 1691|  1.14M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.14M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.14M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.14M]
  ------------------
 1694|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1695|       |
 1696|      0|	if (cache->nodesetObjs != NULL) {
  ------------------
  |  Branch (1696:6): [True: 0, False: 0]
  ------------------
 1697|       |	    /*
 1698|       |	    * Use the nodeset-cache.
 1699|       |	    */
 1700|      0|	    ret = cache->nodesetObjs;
 1701|      0|            cache->nodesetObjs = (void *) ret->stringval;
 1702|      0|            cache->numNodeset -= 1;
 1703|      0|            ret->stringval = NULL;
 1704|      0|	    ret->type = XPATH_NODESET;
 1705|      0|	    ret->boolval = 0;
 1706|      0|	    if (val) {
  ------------------
  |  Branch (1706:10): [True: 0, False: 0]
  ------------------
 1707|      0|		if ((ret->nodesetval->nodeMax == 0) ||
  ------------------
  |  Branch (1707:7): [True: 0, False: 0]
  ------------------
 1708|      0|		    (val->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1708:7): [True: 0, False: 0]
  ------------------
 1709|      0|		{
 1710|      0|		    if (xmlXPathNodeSetAddUnique(ret->nodesetval, val) < 0)
  ------------------
  |  Branch (1710:11): [True: 0, False: 0]
  ------------------
 1711|      0|                        xmlXPathPErrMemory(pctxt);
 1712|      0|		} else {
 1713|      0|		    ret->nodesetval->nodeTab[0] = val;
 1714|      0|		    ret->nodesetval->nodeNr = 1;
 1715|      0|		}
 1716|      0|	    }
 1717|      0|	    return(ret);
 1718|      0|	} else if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1718:13): [True: 0, False: 0]
  ------------------
 1719|      0|            xmlNodeSetPtr set;
 1720|       |	    /*
 1721|       |	    * Fallback to misc-cache.
 1722|       |	    */
 1723|       |
 1724|      0|	    set = xmlXPathNodeSetCreate(val);
 1725|      0|	    if (set == NULL) {
  ------------------
  |  Branch (1725:10): [True: 0, False: 0]
  ------------------
 1726|      0|                xmlXPathPErrMemory(pctxt);
 1727|      0|		return(NULL);
 1728|      0|	    }
 1729|       |
 1730|      0|	    ret = cache->miscObjs;
 1731|      0|            cache->miscObjs = (void *) ret->stringval;
 1732|      0|            cache->numMisc -= 1;
 1733|      0|            ret->stringval = NULL;
 1734|      0|	    ret->type = XPATH_NODESET;
 1735|      0|	    ret->boolval = 0;
 1736|      0|	    ret->nodesetval = set;
 1737|      0|	    return(ret);
 1738|      0|	}
 1739|      0|    }
 1740|  1.14M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.14M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 477, False: 1.14M]
  ------------------
 1742|    477|        xmlXPathPErrMemory(pctxt);
 1743|  1.14M|    return(ret);
 1744|  1.14M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   432k|{
 1848|   432k|    xmlXPathObjectPtr ret;
 1849|   432k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   432k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 432k, False: 0]
  |  Branch (1851:27): [True: 0, False: 432k]
  ------------------
 1852|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1853|       |
 1854|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1854:6): [True: 0, False: 0]
  ------------------
 1855|      0|	    ret = cache->miscObjs;
 1856|      0|            cache->miscObjs = (void *) ret->stringval;
 1857|      0|            cache->numMisc -= 1;
 1858|      0|            ret->stringval = NULL;
 1859|      0|	    ret->type = XPATH_NUMBER;
 1860|      0|	    ret->floatval = val;
 1861|      0|	    return(ret);
 1862|      0|	}
 1863|      0|    }
 1864|       |
 1865|   432k|    ret = xmlXPathNewFloat(val);
 1866|   432k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 157, False: 431k]
  ------------------
 1867|    157|        xmlXPathPErrMemory(pctxt);
 1868|   432k|    return(ret);
 1869|   432k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  8.72k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  8.72k|    xmlNodeSetPtr ret;
 6978|  8.72k|    const xmlChar *cur = ids;
 6979|  8.72k|    xmlChar *ID;
 6980|  8.72k|    xmlAttrPtr attr;
 6981|  8.72k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  8.72k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 8, False: 8.71k]
  ------------------
 6984|       |
 6985|  8.71k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  8.71k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 5, False: 8.70k]
  ------------------
 6987|      5|        return(ret);
 6988|       |
 6989|  8.70k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  19.7k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 11.0k, False: 8.69k]
  ------------------
 6991|  73.8k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|  73.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  73.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.52k, False: 70.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|  73.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 63.6k, False: 6.66k]
  |  |  |  |  |  Branch (91:23): [True: 584, False: 63.0k]
  |  |  |  |  ------------------
  |  |  |  |   92|  73.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 279, False: 69.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 62.8k, False: 6.66k]
  ------------------
 6992|  62.8k|	    cur++;
 6993|       |
 6994|  11.0k|        ID = xmlStrndup(ids, cur - ids);
 6995|  11.0k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 16, False: 11.0k]
  ------------------
 6996|     16|            xmlXPathFreeNodeSet(ret);
 6997|     16|            return(NULL);
 6998|     16|        }
 6999|       |        /*
 7000|       |         * We used to check the fact that the value passed
 7001|       |         * was an NCName, but this generated much troubles for
 7002|       |         * me and Aleksey Sanin, people blatantly violated that
 7003|       |         * constraint, like Visa3D spec.
 7004|       |         * if (xmlValidateNCName(ID, 1) == 0)
 7005|       |         */
 7006|  11.0k|        attr = xmlGetID(doc, ID);
 7007|  11.0k|        xmlFree(ID);
 7008|  11.0k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 1.82k, False: 9.21k]
  ------------------
 7009|  1.82k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 1.82k, False: 0]
  ------------------
 7010|  1.82k|                elem = attr->parent;
 7011|      0|            else if (attr->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (7011:22): [True: 0, False: 0]
  ------------------
 7012|      0|                elem = (xmlNodePtr) attr;
 7013|      0|            else
 7014|      0|                elem = NULL;
 7015|  1.82k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 1.82k, False: 0]
  ------------------
 7016|  1.82k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 2, False: 1.82k]
  ------------------
 7017|      2|                    xmlXPathFreeNodeSet(ret);
 7018|      2|                    return(NULL);
 7019|      2|                }
 7020|  1.82k|            }
 7021|  1.82k|        }
 7022|       |
 7023|  11.0k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  11.0k|	ids = cur;
 7025|  11.0k|    }
 7026|  8.69k|    return(ret);
 7027|  8.70k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.06M|{
 1621|  1.06M|    xmlXPathObjectPtr ret;
 1622|  1.06M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.06M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.06M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.06M]
  ------------------
 1625|      0|	xmlXPathContextCachePtr cache =
 1626|      0|	    (xmlXPathContextCachePtr) ctxt->cache;
 1627|       |
 1628|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1628:6): [True: 0, False: 0]
  ------------------
 1629|      0|	    ret = cache->miscObjs;
 1630|      0|            cache->miscObjs = (void *) ret->stringval;
 1631|      0|            cache->numMisc -= 1;
 1632|      0|            ret->stringval = NULL;
 1633|      0|	    ret->type = XPATH_NODESET;
 1634|      0|	    ret->nodesetval = val;
 1635|      0|	    return(ret);
 1636|      0|	}
 1637|      0|    }
 1638|       |
 1639|  1.06M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.06M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 181, False: 1.06M]
  ------------------
 1641|    181|        xmlXPathPErrMemory(pctxt);
 1642|  1.06M|    return(ret);
 1643|  1.06M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  8.33k|{
 1800|  8.33k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  8.33k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  8.33k|}
xpath.c:xmlXPathCacheNewString:
 1756|   118k|{
 1757|   118k|    xmlXPathObjectPtr ret;
 1758|   118k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   118k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 118k, False: 0]
  |  Branch (1760:27): [True: 0, False: 118k]
  ------------------
 1761|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1762|       |
 1763|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1763:6): [True: 0, False: 0]
  ------------------
 1764|      0|            xmlChar *copy;
 1765|       |
 1766|      0|            if (val == NULL)
  ------------------
  |  Branch (1766:17): [True: 0, False: 0]
  ------------------
 1767|      0|                val = BAD_CAST "";
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1768|      0|            copy = xmlStrdup(val);
 1769|      0|            if (copy == NULL) {
  ------------------
  |  Branch (1769:17): [True: 0, False: 0]
  ------------------
 1770|      0|                xmlXPathPErrMemory(pctxt);
 1771|      0|                return(NULL);
 1772|      0|            }
 1773|       |
 1774|      0|	    ret = cache->miscObjs;
 1775|      0|            cache->miscObjs = (void *) ret->stringval;
 1776|      0|            cache->numMisc -= 1;
 1777|      0|	    ret->type = XPATH_STRING;
 1778|      0|            ret->stringval = copy;
 1779|      0|	    return(ret);
 1780|      0|	}
 1781|      0|    }
 1782|       |
 1783|   118k|    ret = xmlXPathNewString(val);
 1784|   118k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 40, False: 118k]
  ------------------
 1785|     40|        xmlXPathPErrMemory(pctxt);
 1786|   118k|    return(ret);
 1787|   118k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  58.8k|{
 1656|  58.8k|    xmlXPathObjectPtr ret;
 1657|  58.8k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  58.8k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 58.8k, False: 0]
  |  Branch (1659:27): [True: 0, False: 58.8k]
  ------------------
 1660|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1661|       |
 1662|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1662:6): [True: 0, False: 0]
  ------------------
 1663|      0|	    ret = cache->miscObjs;
 1664|      0|            cache->miscObjs = (void *) ret->stringval;
 1665|      0|            cache->numMisc -= 1;
 1666|      0|	    ret->type = XPATH_STRING;
 1667|      0|	    ret->stringval = val;
 1668|      0|	    return(ret);
 1669|      0|	}
 1670|      0|    }
 1671|       |
 1672|  58.8k|    ret = xmlXPathWrapString(val);
 1673|  58.8k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 51, False: 58.7k]
  ------------------
 1674|     51|        xmlXPathPErrMemory(pctxt);
 1675|  58.8k|    return(ret);
 1676|  58.8k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   523k|{
 1814|   523k|    xmlXPathObjectPtr ret;
 1815|   523k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   523k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 523k, False: 0]
  |  Branch (1817:27): [True: 0, False: 523k]
  ------------------
 1818|      0|	xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
 1819|       |
 1820|      0|	if (cache->miscObjs != NULL) {
  ------------------
  |  Branch (1820:6): [True: 0, False: 0]
  ------------------
 1821|      0|	    ret = cache->miscObjs;
 1822|      0|            cache->miscObjs = (void *) ret->stringval;
 1823|      0|            cache->numMisc -= 1;
 1824|      0|            ret->stringval = NULL;
 1825|      0|	    ret->type = XPATH_BOOLEAN;
 1826|      0|	    ret->boolval = (val != 0);
 1827|      0|	    return(ret);
 1828|      0|	}
 1829|      0|    }
 1830|       |
 1831|   523k|    ret = xmlXPathNewBoolean(val);
 1832|   523k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 96, False: 523k]
  ------------------
 1833|     96|        xmlXPathPErrMemory(pctxt);
 1834|   523k|    return(ret);
 1835|   523k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  14.1M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  14.1M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  14.1M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 1, False: 14.1M]
  ------------------
  807|  14.1M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 106, False: 14.1M]
  ------------------
  808|    107|        xpctxt->opCount = xpctxt->opLimit;
  809|    107|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|    107|        return(-1);
  811|    107|    }
  812|       |
  813|  14.1M|    xpctxt->opCount += opCount;
  814|  14.1M|    return(0);
  815|  14.1M|}
xpath.c:xmlXPathCompileExpr:
 9088|  52.8k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  52.8k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  52.8k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 52.8k, False: 0]
  ------------------
 9092|  52.8k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  52.8k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 311, False: 52.5k]
  ------------------
 9093|  52.5k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    311|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  52.5k|        xpctxt->depth += 10;
 9099|  52.5k|    }
 9100|       |
 9101|  52.5k|    xmlXPathCompAndExpr(ctxt);
 9102|  52.5k|    CHECK_ERROR;
  ------------------
  |  |  230|  52.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.65k, False: 46.8k]
  |  |  ------------------
  ------------------
 9103|  46.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  46.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  52.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  51.4k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  51.4k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  4.75k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 4.75k, False: 46.7k]
  |  Branch (9104:28): [True: 4.74k, False: 11]
  ------------------
 9105|  4.74k|	int op1 = ctxt->comp->last;
 9106|  4.74k|        SKIP(2);
  ------------------
  |  | 2194|  4.74k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  4.74k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.74k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  3.54k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  4.74k|        xmlXPathCompAndExpr(ctxt);
 9109|  4.74k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 132, False: 4.60k]
  |  |  ------------------
  ------------------
 9110|  4.60k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  4.60k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  4.60k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  4.60k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  4.60k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.60k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.60k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  4.60k|    }
 9113|  46.7k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 38.8k, False: 7.91k]
  |  Branch (9113:19): [True: 31.5k, False: 7.32k]
  ------------------
 9114|       |	/* more ops could be optimized too */
 9115|       |	/*
 9116|       |	* This is the main place to eliminate sorting for
 9117|       |	* operations which don't require a sorted node-set.
 9118|       |	* E.g. count().
 9119|       |	*/
 9120|  31.5k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  31.5k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  31.5k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  31.5k|    }
 9122|       |
 9123|  46.7k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 46.7k, False: 0]
  ------------------
 9124|  46.7k|        xpctxt->depth -= 10;
 9125|  46.7k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  57.2k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  57.2k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  57.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  57.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.74k, False: 51.5k]
  |  |  ------------------
  ------------------
 9065|  51.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  51.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  57.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  52.0k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  52.0k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    645|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    607|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 645, False: 51.4k]
  |  Branch (9066:28): [True: 607, False: 38]
  |  Branch (9066:47): [True: 605, False: 2]
  ------------------
 9067|    605|	int op1 = ctxt->comp->last;
 9068|    605|        SKIP(3);
  ------------------
  |  | 2194|    605|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    605|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.69k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.69k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.69k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    605|        xmlXPathCompEqualityExpr(ctxt);
 9071|    605|	CHECK_ERROR;
  ------------------
  |  |  230|    605|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 36, False: 569]
  |  |  ------------------
  ------------------
 9072|    569|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    569|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    569|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    569|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    569|	SKIP_BLANKS;
  ------------------
  |  | 2199|    569|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    569|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    569|    }
 9075|  51.5k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  57.8k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  57.8k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  57.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  57.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.95k, False: 52.9k]
  |  |  ------------------
  ------------------
 9036|  52.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  52.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  57.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  95.7k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  95.7k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  54.3k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  2.28k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 41.3k, False: 54.3k]
  |  Branch (9037:29): [True: 2.28k, False: 52.0k]
  |  Branch (9037:45): [True: 2.24k, False: 32]
  ------------------
 9038|  43.6k|	int eq;
 9039|  43.6k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  43.6k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  43.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 41.3k, False: 2.24k]
  ------------------
 9042|  2.24k|	else eq = 0;
 9043|  43.6k|	NEXT;
  ------------------
  |  | 2202|  43.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 43.6k, False: 0]
  |  |  ------------------
  ------------------
 9044|  43.6k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  2.24k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.24k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 2.24k, False: 41.3k]
  ------------------
 9045|  43.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  70.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  70.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 70.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  43.6k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  43.6k|	CHECK_ERROR;
  ------------------
  |  |  230|  43.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 827, False: 42.8k]
  |  |  ------------------
  ------------------
 9048|  42.8k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  42.8k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  42.8k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  42.8k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  42.8k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  42.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  42.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  42.8k|    }
 9051|  52.9k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|   101k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|   101k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|   101k|    CHECK_ERROR;
  ------------------
  |  |  230|   101k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.94k, False: 96.5k]
  |  |  ------------------
  ------------------
 8999|  96.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  96.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   101k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|   123k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   123k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   117k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 5.96k, False: 117k]
  |  Branch (9000:28): [True: 21.7k, False: 95.7k]
  ------------------
 9001|  27.7k|	int inf, strict;
 9002|  27.7k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  27.7k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  27.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 5.96k, False: 21.7k]
  ------------------
 9005|  21.7k|	else inf = 0;
 9006|  27.7k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  27.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 7.00k, False: 20.7k]
  ------------------
 9007|  20.7k|	else strict = 1;
 9008|  27.7k|	NEXT;
  ------------------
  |  | 2202|  27.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 27.7k, False: 0]
  |  |  ------------------
  ------------------
 9009|  27.7k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  7.00k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 7.00k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 7.00k, False: 20.7k]
  ------------------
 9010|  27.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  27.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.34k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.34k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  27.7k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  27.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  27.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 840, False: 26.8k]
  |  |  ------------------
  ------------------
 9013|  26.8k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  26.8k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  26.8k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  26.8k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  26.8k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  26.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  26.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  26.8k|    }
 9016|  96.5k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|   129k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|   129k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|   129k|    CHECK_ERROR;
  ------------------
  |  |  230|   129k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.00k, False: 124k]
  |  |  ------------------
  ------------------
 8962|   124k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   124k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   129k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   177k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   177k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   172k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 5.14k, False: 172k]
  |  Branch (8963:28): [True: 48.8k, False: 123k]
  ------------------
 8964|  53.9k|	int plus;
 8965|  53.9k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  53.9k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  53.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 5.14k, False: 48.8k]
  ------------------
 8968|  48.8k|	else plus = 0;
 8969|  53.9k|	NEXT;
  ------------------
  |  | 2202|  53.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 53.9k, False: 0]
  |  |  ------------------
  ------------------
 8970|  53.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  53.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.72k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.72k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  53.9k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  53.9k|	CHECK_ERROR;
  ------------------
  |  |  230|  53.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 773, False: 53.2k]
  |  |  ------------------
  ------------------
 8973|  53.2k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  53.2k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  53.2k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  53.2k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  53.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  53.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  53.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  53.2k|    }
 8976|   124k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   183k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   183k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   183k|    CHECK_ERROR;
  ------------------
  |  |  230|   183k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.42k, False: 177k]
  |  |  ------------------
  ------------------
 8922|   177k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   177k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   183k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|  1.26M|    while ((CUR == '*') ||
  ------------------
  |  | 2193|  1.26M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 1.08M, False: 178k]
  ------------------
 8924|   178k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   178k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    626|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    601|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 626, False: 177k]
  |  Branch (8924:29): [True: 601, False: 25]
  |  Branch (8924:48): [True: 591, False: 10]
  ------------------
 8925|  1.08M|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   178k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    596|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    585|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 596, False: 177k]
  |  Branch (8925:29): [True: 585, False: 11]
  |  Branch (8925:48): [True: 581, False: 4]
  ------------------
 8926|  1.08M|	int op = -1;
 8927|  1.08M|	int op1 = ctxt->comp->last;
 8928|       |
 8929|  1.08M|        if (CUR == '*') {
  ------------------
  |  | 2193|  1.08M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 1.08M, False: 1.17k]
  ------------------
 8930|  1.08M|	    op = 0;
 8931|  1.08M|	    NEXT;
  ------------------
  |  | 2202|  1.08M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.08M, False: 0]
  |  |  ------------------
  ------------------
 8932|  1.08M|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|  1.17k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 591, False: 581]
  ------------------
 8933|    591|	    op = 1;
 8934|    591|	    SKIP(3);
  ------------------
  |  | 2194|    591|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    591|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    581|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 581, False: 0]
  ------------------
 8936|    581|	    op = 2;
 8937|    581|	    SKIP(3);
  ------------------
  |  | 2194|    581|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    581|	}
 8939|  1.08M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.08M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|  1.08M|        xmlXPathCompUnaryExpr(ctxt);
 8941|  1.08M|	CHECK_ERROR;
  ------------------
  |  |  230|  1.08M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 344, False: 1.08M]
  |  |  ------------------
  ------------------
 8942|  1.08M|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|  1.08M|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  1.08M|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  1.08M|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|  1.08M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.08M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.08M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|  1.08M|    }
 8945|   177k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|  1.26M|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|  1.26M|    int minus = 0;
 8886|  1.26M|    int found = 0;
 8887|       |
 8888|  1.26M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.26M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|  1.34M|    while (CUR == '-') {
  ------------------
  |  | 2193|  1.34M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 80.9k, False: 1.26M]
  ------------------
 8890|  80.9k|        minus = 1 - minus;
 8891|  80.9k|	found = 1;
 8892|  80.9k|	NEXT;
  ------------------
  |  | 2202|  80.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 80.9k, False: 0]
  |  |  ------------------
  ------------------
 8893|  80.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  80.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.15k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.15k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  80.9k|    }
 8895|       |
 8896|  1.26M|    xmlXPathCompUnionExpr(ctxt);
 8897|  1.26M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.26M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.76k, False: 1.26M]
  |  |  ------------------
  ------------------
 8898|  1.26M|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 56.1k, False: 1.20M]
  ------------------
 8899|  56.1k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 46.8k, False: 9.31k]
  ------------------
 8900|  46.8k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  46.8k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  46.8k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  9.31k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  9.31k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  9.31k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  56.1k|    }
 8904|  1.26M|}
xpath.c:xmlXPathCompUnionExpr:
 8856|  1.26M|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|  1.26M|    xmlXPathCompPathExpr(ctxt);
 8858|  1.26M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.26M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.58k, False: 1.26M]
  |  |  ------------------
  ------------------
 8859|  1.26M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.26M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.26M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|  1.27M|    while (CUR == '|') {
  ------------------
  |  | 2193|  1.27M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 8.71k, False: 1.26M]
  ------------------
 8861|  8.71k|	int op1 = ctxt->comp->last;
 8862|  8.71k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  8.71k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  8.71k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  8.71k|	NEXT;
  ------------------
  |  | 2202|  8.71k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.71k, False: 0]
  |  |  ------------------
  ------------------
 8865|  8.71k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.71k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.47k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  8.71k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  8.71k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  8.71k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  8.71k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  8.71k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  8.71k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  8.71k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8871|  8.71k|    }
 8872|  1.26M|}
xpath.c:xmlXPathCompPathExpr:
 8734|  1.27M|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|  1.27M|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|  1.27M|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|  1.27M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.27M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8739|  1.27M|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.27M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|  1.27M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 1.48k, False: 1.27M]
  |  Branch (8739:25): [True: 3.96k, False: 1.27M]
  ------------------
 8740|  1.27M|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|  1.27M|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 128k, False: 1.14M]
  |  |  |  Branch (230:45): [True: 55.5k, False: 72.8k]
  |  |  ------------------
  ------------------
 8741|  1.21M|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.90k, False: 1.21M]
  |  Branch (8741:26): [True: 118, False: 1.21M]
  ------------------
 8742|  1.21M|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  11.0k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 6.75k, False: 4.30k]
  |  |  |  Branch (230:45): [True: 2.65k, False: 4.10k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 11.0k, False: 1.20M]
  ------------------
 8743|  65.6k|	lc = 0;
 8744|  1.21M|    } else if (CUR == '*') {
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 1.04M, False: 161k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|  1.04M|	lc = 1;
 8747|  1.04M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   161k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 80.1k, False: 81.6k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  80.1k|	lc = 1;
 8750|  81.6k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  81.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 1.65k, False: 80.0k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|  1.65k|	lc = 1;
 8753|  80.0k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  80.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 8.40k, False: 71.6k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  8.40k|	lc = 1;
 8756|  71.6k|    } else {
 8757|       |	/*
 8758|       |	 * Problem is finding if we have a name here whether it's:
 8759|       |	 *   - a nodetype
 8760|       |	 *   - a function call in which case it's followed by '('
 8761|       |	 *   - an axis in which case it's followed by ':'
 8762|       |	 *   - a element name
 8763|       |	 * We do an a priori analysis here rather than having to
 8764|       |	 * maintain parsed token content through the recursive function
 8765|       |	 * calls. This looks uglier but makes the code easier to
 8766|       |	 * read/write/debug.
 8767|       |	 */
 8768|  71.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  71.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8769|  71.6k|	name = xmlXPathScanName(ctxt);
 8770|  71.6k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 68.3k, False: 3.25k]
  |  Branch (8770:24): [True: 684, False: 67.6k]
  ------------------
 8771|    684|	    lc = 1;
 8772|    684|	    xmlFree(name);
 8773|  70.9k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 67.6k, False: 3.25k]
  ------------------
 8774|  67.6k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   526k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   526k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 525k, False: 1.09k]
  ------------------
 8778|   525k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   525k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.81k, False: 521k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.81k|		    lc = 1;
 8781|  3.81k|		    break;
 8782|   521k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   521k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   521k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 457k, False: 64.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|   521k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 64.1k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.24k, False: 62.9k]
  |  |  |  |  ------------------
  |  |  |  |   92|   521k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 137, False: 62.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   458k|		    ;
 8785|   458k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  62.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 716, False: 62.0k]
  ------------------
 8786|    716|		    lc = 1;
 8787|    716|		    break;
 8788|  62.0k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  62.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 12.0k, False: 50.0k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  12.0k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 293, False: 11.7k]
  ------------------
 8791|    293|			lc = 1;
 8792|  11.7k|		    } else {
 8793|  11.7k|			lc = 0;
 8794|  11.7k|		    }
 8795|  12.0k|                    break;
 8796|  50.0k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  50.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 986, False: 49.0k]
  ------------------
 8797|       |		    /* element name */
 8798|    986|		    lc = 1;
 8799|    986|		    break;
 8800|  49.0k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  49.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  47.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 1.94k, False: 47.1k]
  |  Branch (8800:35): [True: 6.99k, False: 40.1k]
  ------------------
 8801|  40.1k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  40.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 7.60k, False: 32.5k]
  ------------------
 8802|  16.5k|		    lc = 1;
 8803|  16.5k|		    break;
 8804|  32.5k|		} else {
 8805|  32.5k|		    lc = 1;
 8806|  32.5k|		    break;
 8807|  32.5k|		}
 8808|   458k|		len++;
 8809|   458k|	    }
 8810|  67.6k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  67.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 1.09k, False: 66.5k]
  ------------------
 8811|       |		/* element name */
 8812|  1.09k|		lc = 1;
 8813|  1.09k|	    }
 8814|  67.6k|	    xmlFree(name);
 8815|  67.6k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  3.25k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  3.25k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  71.6k|    }
 8820|       |
 8821|  1.27M|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 1.19M, False: 77.4k]
  ------------------
 8822|  1.19M|	if (CUR == '/') {
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 80.1k, False: 1.11M]
  ------------------
 8823|  80.1k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  80.1k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  80.1k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|  1.11M|	} else {
 8825|  1.11M|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  1.11M|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  1.11M|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|  1.11M|	}
 8827|  1.19M|	xmlXPathCompLocationPath(ctxt);
 8828|  1.19M|    } else {
 8829|  77.4k|	xmlXPathCompFilterExpr(ctxt);
 8830|  77.4k|	CHECK_ERROR;
  ------------------
  |  |  230|  77.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.18k, False: 75.2k]
  |  |  ------------------
  ------------------
 8831|  75.2k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  75.2k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.38k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.38k, False: 72.8k]
  |  Branch (8831:22): [True: 810, False: 1.57k]
  ------------------
 8832|    810|	    SKIP(2);
  ------------------
  |  | 2194|    810|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    810|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  2.37k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.37k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.37k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    810|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    810|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    810|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    810|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    810|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  74.4k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  74.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.57k, False: 72.8k]
  ------------------
 8840|  1.57k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.57k|	}
 8842|  75.2k|    }
 8843|  1.27M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.27M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.27M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|  1.27M|}
xpath.c:xmlXPathScanName:
 8705|  71.6k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  71.6k|    const xmlChar *end;
 8707|  71.6k|    xmlChar *ret;
 8708|       |
 8709|  71.6k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  71.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  71.6k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 3, False: 71.6k]
  ------------------
 8711|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  71.6k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 3.18k, False: 68.4k]
  ------------------
 8714|  3.18k|        return(NULL);
 8715|       |
 8716|  68.4k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  68.4k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 61, False: 68.3k]
  ------------------
 8718|     61|        xmlXPathPErrMemory(ctxt);
 8719|  68.4k|    return(ret);
 8720|  71.6k|}
xpath.c:xmlXPathCompLocationPath:
 9524|  1.19M|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|  1.19M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.19M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9526|  1.19M|    if (CUR != '/') {
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 1.11M, False: 80.1k]
  ------------------
 9527|  1.11M|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|  1.11M|    } else {
 9529|   162k|	while (CUR == '/') {
  ------------------
  |  | 2193|   162k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 82.6k, False: 79.5k]
  ------------------
 9530|  82.6k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  82.6k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  82.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 82.6k, False: 0]
  |  Branch (9530:26): [True: 10.6k, False: 72.0k]
  ------------------
 9531|  10.6k|		SKIP(2);
  ------------------
  |  | 2194|  10.6k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  10.6k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  10.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.50k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  10.6k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  10.6k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.6k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  10.6k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  10.6k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  72.0k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  72.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 72.0k, False: 0]
  ------------------
 9537|  72.0k|		NEXT;
  ------------------
  |  | 2202|  72.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 72.0k, False: 0]
  |  |  ------------------
  ------------------
 9538|  72.0k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  72.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  32.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 32.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  72.0k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  72.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 71.3k, False: 696]
  ------------------
 9540|  71.3k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  71.3k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.14k, False: 63.2k]
  |  |  ------------------
  |  |  223|  71.3k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.22k, False: 1.92k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  65.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 304, False: 64.8k]
  ------------------
 9541|  64.8k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  64.8k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  64.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 712, False: 64.1k]
  |  Branch (9541:38): [True: 3.65k, False: 60.4k]
  ------------------
 9542|  60.4k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  60.4k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  60.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 153, False: 60.3k]
  |  Branch (9542:24): [True: 54.6k, False: 5.65k]
  ------------------
 9543|  65.7k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  72.0k|	    }
 9545|  82.6k|	    CHECK_ERROR;
  ------------------
  |  |  230|  82.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 529, False: 82.1k]
  |  |  ------------------
  ------------------
 9546|  82.6k|	}
 9547|  80.1k|    }
 9548|  1.19M|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  77.4k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  77.4k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  77.4k|    CHECK_ERROR;
  ------------------
  |  |  230|  77.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.61k, False: 75.7k]
  |  |  ------------------
  ------------------
 8686|  75.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  75.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  77.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  83.7k|    while (CUR == '[') {
  ------------------
  |  | 2193|  83.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 7.93k, False: 75.7k]
  ------------------
 8689|  7.93k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  7.93k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.93k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8691|  7.93k|    }
 8692|       |
 8693|       |
 8694|  75.7k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  77.4k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  77.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  77.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8647|  77.4k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  77.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 1.48k, False: 75.9k]
  ------------------
 8648|  75.9k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  75.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 3.96k, False: 71.9k]
  ------------------
 8649|  3.96k|	NEXT;
  ------------------
  |  | 2202|  3.96k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.96k, False: 0]
  |  |  ------------------
  ------------------
 8650|  3.96k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.96k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.96k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.96k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  3.96k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  3.96k|	CHECK_ERROR;
  ------------------
  |  |  230|  3.96k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 344, False: 3.62k]
  |  |  ------------------
  ------------------
 8653|  3.62k|	if (CUR != ')') {
  ------------------
  |  | 2193|  3.62k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 44, False: 3.57k]
  ------------------
 8654|     44|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     44|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  3.57k|	NEXT;
  ------------------
  |  | 2202|  3.57k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.57k, False: 0]
  |  |  ------------------
  ------------------
 8657|  3.57k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  14.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  18.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  71.9k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   143k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 67.2k, False: 4.67k]
  |  |  |  Branch (230:45): [True: 55.5k, False: 11.7k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  16.4k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.65k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.65k, False: 0]
  |  |  |  Branch (230:45): [True: 2.65k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.65k, False: 13.7k]
  ------------------
 8659|  58.2k|	xmlXPathCompNumber(ctxt);
 8660|  58.2k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  13.7k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.90k, False: 11.8k]
  |  Branch (8660:33): [True: 118, False: 11.7k]
  ------------------
 8661|  2.02k|	xmlXPathCompLiteral(ctxt);
 8662|  11.7k|    } else {
 8663|  11.7k|	xmlXPathCompFunctionCall(ctxt);
 8664|  11.7k|    }
 8665|  77.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  77.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   139k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 61.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  77.0k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  1.48k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  1.48k|    xmlChar *name;
 8513|  1.48k|    xmlChar *prefix;
 8514|       |
 8515|  1.48k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.48k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8516|  1.48k|    if (CUR != '$') {
  ------------------
  |  | 2193|  1.48k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 1.48k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  1.48k|    NEXT;
  ------------------
  |  | 2202|  1.48k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.48k, False: 0]
  |  |  ------------------
  ------------------
 8520|  1.48k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  1.48k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 53, False: 1.43k]
  ------------------
 8522|     53|        xmlFree(prefix);
 8523|     53|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     53|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|  1.43k|    ctxt->comp->last = -1;
 8526|  1.43k|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  1.43k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.43k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 1, False: 1.42k]
  ------------------
 8527|      1|        xmlFree(prefix);
 8528|      1|        xmlFree(name);
 8529|      1|    }
 8530|  1.43k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.47k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.90k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|  1.43k|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|  1.43k|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 1.43k, False: 0]
  |  Branch (8531:36): [True: 0, False: 1.43k]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|  1.43k|}
xpath.c:xmlXPathParseQName:
 8178|  13.2k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  13.2k|    xmlChar *ret = NULL;
 8180|       |
 8181|  13.2k|    *prefix = NULL;
 8182|  13.2k|    ret = xmlXPathParseNCName(ctxt);
 8183|  13.2k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  13.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 13.1k, False: 71]
  |  Branch (8183:16): [True: 873, False: 12.2k]
  ------------------
 8184|    873|        *prefix = ret;
 8185|    873|	NEXT;
  ------------------
  |  | 2202|    873|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 873, False: 0]
  |  |  ------------------
  ------------------
 8186|    873|	ret = xmlXPathParseNCName(ctxt);
 8187|    873|    }
 8188|  13.2k|    return(ret);
 8189|  13.2k|}
xpath.c:xmlXPathCompNumber:
 8337|  58.2k|{
 8338|  58.2k|    double ret = 0.0;
 8339|  58.2k|    int ok = 0;
 8340|  58.2k|    int exponent = 0;
 8341|  58.2k|    int is_exponent_negative = 0;
 8342|  58.2k|    xmlXPathObjectPtr num;
 8343|  58.2k|#ifdef __GNUC__
 8344|  58.2k|    unsigned long tmp = 0;
 8345|  58.2k|    double temp;
 8346|  58.2k|#endif
 8347|       |
 8348|  58.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  58.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 42, False: 58.1k]
  |  |  ------------------
  ------------------
 8349|  58.1k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  58.1k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  55.5k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  55.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 55.5k, False: 2.65k]
  |  Branch (8349:26): [True: 0, False: 55.5k]
  |  Branch (8349:41): [True: 0, False: 55.5k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  58.1k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  58.1k|    ret = 0;
 8358|   205k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   205k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   172k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 172k, False: 32.8k]
  |  Branch (8358:28): [True: 147k, False: 25.2k]
  ------------------
 8359|   147k|	ret = ret * 10;
 8360|   147k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|   147k|#define CUR (*ctxt->cur)
  ------------------
 8361|   147k|        ok = 1;
 8362|   147k|        NEXT;
  ------------------
  |  | 2202|   147k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 147k, False: 0]
  |  |  ------------------
  ------------------
 8363|   147k|	temp = (double) tmp;
 8364|   147k|	ret = ret + temp;
 8365|   147k|    }
 8366|       |#else
 8367|       |    ret = 0;
 8368|       |    while ((CUR >= '0') && (CUR <= '9')) {
 8369|       |	ret = ret * 10 + (CUR - '0');
 8370|       |	ok = 1;
 8371|       |	NEXT;
 8372|       |    }
 8373|       |#endif
 8374|  58.1k|    if (CUR == '.') {
  ------------------
  |  | 2193|  58.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 9.84k, False: 48.3k]
  ------------------
 8375|  9.84k|	int v, frac = 0, max;
 8376|  9.84k|	double fraction = 0;
 8377|       |
 8378|  9.84k|        NEXT;
  ------------------
  |  | 2202|  9.84k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.84k, False: 0]
  |  |  ------------------
  ------------------
 8379|  9.84k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  9.84k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  8.83k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 1.00k, False: 8.83k]
  |  Branch (8379:29): [True: 1.16k, False: 7.66k]
  |  Branch (8379:45): [True: 0, False: 2.17k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  14.4k|        while (CUR == '0') {
  ------------------
  |  | 2193|  14.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 4.59k, False: 9.84k]
  ------------------
 8383|  4.59k|            frac = frac + 1;
 8384|  4.59k|            NEXT;
  ------------------
  |  | 2202|  4.59k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.59k, False: 0]
  |  |  ------------------
  ------------------
 8385|  4.59k|        }
 8386|  9.84k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  9.84k|#define MAX_FRAC 20
  ------------------
 8387|  29.6k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  29.6k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  27.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 27.0k, False: 2.68k]
  |  Branch (8387:32): [True: 19.9k, False: 7.09k]
  |  Branch (8387:48): [True: 19.8k, False: 57]
  ------------------
 8388|  19.8k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  19.8k|#define CUR (*ctxt->cur)
  ------------------
 8389|  19.8k|	    fraction = fraction * 10 + v;
 8390|  19.8k|	    frac = frac + 1;
 8391|  19.8k|            NEXT;
  ------------------
  |  | 2202|  19.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 19.8k, False: 0]
  |  |  ------------------
  ------------------
 8392|  19.8k|        }
 8393|  9.84k|        fraction /= pow(10.0, frac);
 8394|  9.84k|        ret = ret + fraction;
 8395|  10.4k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  10.4k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  7.75k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 7.75k, False: 2.73k]
  |  Branch (8395:32): [True: 647, False: 7.10k]
  ------------------
 8396|    647|            NEXT;
  ------------------
  |  | 2202|  10.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 647, False: 0]
  |  |  ------------------
  ------------------
 8397|  9.84k|    }
 8398|  58.1k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  58.1k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  57.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 796, False: 57.3k]
  |  Branch (8398:25): [True: 8.72k, False: 48.6k]
  ------------------
 8399|  9.52k|        NEXT;
  ------------------
  |  | 2202|  9.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.52k, False: 0]
  |  |  ------------------
  ------------------
 8400|  9.52k|        if (CUR == '-') {
  ------------------
  |  | 2193|  9.52k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 580, False: 8.94k]
  ------------------
 8401|    580|            is_exponent_negative = 1;
 8402|    580|            NEXT;
  ------------------
  |  | 2202|    580|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 580, False: 0]
  |  |  ------------------
  ------------------
 8403|  8.94k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  8.94k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 784, False: 8.15k]
  ------------------
 8404|    784|	    NEXT;
  ------------------
  |  | 2202|    784|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 784, False: 0]
  |  |  ------------------
  ------------------
 8405|    784|	}
 8406|  72.6k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  72.6k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  69.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 69.2k, False: 3.41k]
  |  Branch (8406:32): [True: 63.1k, False: 6.10k]
  ------------------
 8407|  63.1k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 49.3k, False: 13.8k]
  ------------------
 8408|  49.3k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  49.3k|#define CUR (*ctxt->cur)
  ------------------
 8409|  63.1k|            NEXT;
  ------------------
  |  | 2202|  63.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 63.1k, False: 0]
  |  |  ------------------
  ------------------
 8410|  63.1k|        }
 8411|  9.52k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 580, False: 8.94k]
  ------------------
 8412|    580|            exponent = -exponent;
 8413|  9.52k|        ret *= pow(10.0, (double) exponent);
 8414|  9.52k|    }
 8415|  58.1k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  58.1k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 56, False: 58.1k]
  ------------------
 8417|     56|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  58.1k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  58.1k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  58.1k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 14, False: 58.0k]
  ------------------
 8419|  58.1k|                              NULL) == -1) {
 8420|     14|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     14|    }
 8422|  58.1k|}
xpath.c:xmlXPathCompLiteral:
 8478|  2.02k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  2.02k|    xmlChar *ret = NULL;
 8480|  2.02k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  2.02k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  2.02k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 154, False: 1.86k]
  ------------------
 8484|    154|        return;
 8485|  1.86k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.86k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 7, False: 1.86k]
  ------------------
 8487|      7|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.86k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.86k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.86k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 2, False: 1.85k]
  ------------------
 8489|  1.86k|                              NULL) == -1) {
 8490|      2|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      2|    }
 8492|  1.86k|    xmlFree(ret);
 8493|  1.86k|}
xpath.c:xmlXPathParseLiteral:
 8434|  2.15k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  2.15k|    const xmlChar *q;
 8436|  2.15k|    xmlChar *ret = NULL;
 8437|  2.15k|    int quote;
 8438|       |
 8439|  2.15k|    if (CUR == '"') {
  ------------------
  |  | 2193|  2.15k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 118, False: 2.03k]
  ------------------
 8440|    118|        quote = '"';
 8441|  2.03k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  2.03k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 2.02k, False: 9]
  ------------------
 8442|  2.02k|        quote = '\'';
 8443|  2.02k|    } else {
 8444|      9|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      9|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  2.14k|    NEXT;
  ------------------
  |  | 2202|  2.14k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.14k, False: 0]
  |  |  ------------------
  ------------------
 8448|  2.14k|    q = CUR_PTR;
  ------------------
  |  | 2196|  2.14k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  18.0k|    while (CUR != quote) {
  ------------------
  |  | 2193|  18.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 16.0k, False: 1.99k]
  ------------------
 8450|  16.0k|        int ch;
 8451|  16.0k|        int len = 4;
 8452|       |
 8453|  16.0k|        if (CUR == 0)
  ------------------
  |  | 2193|  16.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 135, False: 15.9k]
  ------------------
 8454|  15.9k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    135|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  15.9k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  15.9k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  15.9k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  15.9k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  15.9k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 15.4k, False: 475]
  |  |  |  |  ------------------
  |  |  |  |  118|  15.9k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  15.4k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 15.4k, False: 10]
  |  |  |  |  |  |  |  Branch (108:44): [True: 231, False: 15.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  15.4k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 164, False: 15.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  15.4k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 15.0k, False: 10]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  15.9k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 475, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 285, False: 190]
  |  |  |  |  ------------------
  |  |  |  |  120|    475|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 190, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 91, False: 99]
  |  |  |  |  ------------------
  |  |  |  |  121|    475|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 99, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 99, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 15.9k]
  |  Branch (8456:25): [True: 10, False: 15.9k]
  ------------------
 8457|  15.9k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|     13|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  15.9k|        CUR_PTR += len;
  ------------------
  |  | 2196|  15.9k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  15.9k|    }
 8460|  1.99k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.99k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.99k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 9, False: 1.98k]
  ------------------
 8462|      9|        xmlXPathPErrMemory(ctxt);
 8463|  1.99k|    NEXT;
  ------------------
  |  | 2202|  1.99k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.99k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.99k|    return(ret);
 8465|  2.14k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  11.7k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  11.7k|    xmlChar *name;
 8575|  11.7k|    xmlChar *prefix;
 8576|  11.7k|    int nbargs = 0;
 8577|  11.7k|    int sort = 1;
 8578|       |
 8579|  11.7k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  11.7k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 18, False: 11.7k]
  ------------------
 8581|     18|	xmlFree(prefix);
 8582|     18|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     18|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  11.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   302k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   314k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 302k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  11.7k|    if (CUR != '(') {
  ------------------
  |  | 2193|  11.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 7, False: 11.7k]
  ------------------
 8587|      7|	xmlFree(name);
 8588|      7|	xmlFree(prefix);
 8589|      7|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|  11.7k|    NEXT;
  ------------------
  |  | 2202|  11.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.7k, False: 0]
  |  |  ------------------
  ------------------
 8592|  11.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   104k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   116k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 104k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  11.7k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 11.2k, False: 481]
  |  Branch (8597:29): [True: 1.22k, False: 10.0k]
  ------------------
 8598|  1.22k|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|  1.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 52, False: 1.16k]
  ------------------
 8599|     52|    {
 8600|     52|	sort = 0;
 8601|     52|    }
 8602|  11.7k|    ctxt->comp->last = -1;
 8603|  11.7k|    if (CUR != ')') {
  ------------------
  |  | 2193|  11.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 9.51k, False: 2.19k]
  ------------------
 8604|  15.1k|	while (CUR != 0) {
  ------------------
  |  | 2193|  15.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 15.1k, False: 3]
  ------------------
 8605|  15.1k|	    int op1 = ctxt->comp->last;
 8606|  15.1k|	    ctxt->comp->last = -1;
 8607|  15.1k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  15.1k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 742, False: 14.3k]
  ------------------
 8609|    742|		xmlFree(name);
 8610|    742|		xmlFree(prefix);
 8611|    742|		return;
 8612|    742|	    }
 8613|  14.3k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  14.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  14.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  14.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  14.3k|	    nbargs++;
 8615|  14.3k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  14.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 8.65k, False: 5.71k]
  ------------------
 8616|  5.71k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  5.71k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 114, False: 5.60k]
  ------------------
 8617|    114|		xmlFree(name);
 8618|    114|		xmlFree(prefix);
 8619|    114|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    114|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  5.60k|	    NEXT;
  ------------------
  |  | 2202|  5.60k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 5.60k, False: 0]
  |  |  ------------------
  ------------------
 8622|  5.60k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  5.60k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.39k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.79k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  5.60k|	}
 8624|  9.51k|    }
 8625|  10.8k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  10.8k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  10.8k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 2, False: 10.8k]
  ------------------
 8626|      2|        xmlFree(prefix);
 8627|      2|        xmlFree(name);
 8628|      2|    }
 8629|  10.8k|    NEXT;
  ------------------
  |  | 2202|  10.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.8k, False: 3]
  |  |  ------------------
  ------------------
 8630|  10.8k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   108k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   118k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 108k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  10.8k|}
xpath.c:xmlXPathCompPredicate:
 9137|  17.9k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  17.9k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  17.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  17.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9141|  17.9k|    if (CUR != '[') {
  ------------------
  |  | 2193|  17.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 17.9k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  17.9k|    NEXT;
  ------------------
  |  | 2202|  17.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.9k, False: 0]
  |  |  ------------------
  ------------------
 9145|  17.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  17.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  32.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 14.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  17.9k|    ctxt->comp->last = -1;
 9148|       |    /*
 9149|       |    * This call to xmlXPathCompileExpr() will deactivate sorting
 9150|       |    * of the predicate result.
 9151|       |    * TODO: Sorting is still activated for filters, since I'm not
 9152|       |    *  sure if needed. Normally sorting should not be needed, since
 9153|       |    *  a filter can only diminish the number of items in a sequence,
 9154|       |    *  but won't change its order; so if the initial sequence is sorted,
 9155|       |    *  subsequent sorting is not needed.
 9156|       |    */
 9157|  17.9k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 9.99k, False: 7.93k]
  ------------------
 9158|  9.99k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  7.93k|    else
 9160|  7.93k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  17.9k|    CHECK_ERROR;
  ------------------
  |  |  230|  17.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.90k, False: 15.0k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  15.0k|    if (CUR != ']') {
  ------------------
  |  | 2193|  15.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 273, False: 14.7k]
  ------------------
 9164|    273|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    273|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  14.7k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 7.09k, False: 7.65k]
  ------------------
 9168|  7.09k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.09k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.09k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.09k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  7.65k|    else
 9170|  7.65k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.65k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.65k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.65k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  14.7k|    NEXT;
  ------------------
  |  | 2202|  14.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 14.7k, False: 0]
  |  |  ------------------
  ------------------
 9173|  14.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  19.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  33.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 19.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  14.7k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|  1.19M|(xmlXPathParserContextPtr ctxt) {
 9482|  1.19M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.19M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9483|  1.19M|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.71k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.71k, False: 1.18M]
  |  Branch (9483:25): [True: 3.14k, False: 4.56k]
  ------------------
 9484|  3.14k|	SKIP(2);
  ------------------
  |  | 2194|  3.14k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.14k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  11.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  11.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.14k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.14k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.14k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.14k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|  1.19M|    } else if (CUR == '/') {
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 4.56k, False: 1.18M]
  ------------------
 9489|  4.56k|	    NEXT;
  ------------------
  |  | 2202|  4.56k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.56k, False: 0]
  |  |  ------------------
  ------------------
 9490|  4.56k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  12.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  4.56k|    }
 9492|  1.19M|    xmlXPathCompStep(ctxt);
 9493|  1.19M|    CHECK_ERROR;
  ------------------
  |  |  230|  1.19M|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.38k, False: 1.19M]
  |  |  ------------------
  ------------------
 9494|  1.19M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.19M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.19M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|  1.21M|    while (CUR == '/') {
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 18.1k, False: 1.19M]
  ------------------
 9496|  18.1k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  18.1k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  18.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 18.1k, False: 0]
  |  Branch (9496:22): [True: 5.54k, False: 12.6k]
  ------------------
 9497|  5.54k|	    SKIP(2);
  ------------------
  |  | 2194|  5.54k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  5.54k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.18k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.18k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  5.54k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  5.54k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.54k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  5.54k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  5.54k|	    xmlXPathCompStep(ctxt);
 9502|  12.6k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  12.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 12.6k, False: 0]
  ------------------
 9503|  12.6k|	    NEXT;
  ------------------
  |  | 2202|  12.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 12.6k, False: 0]
  |  |  ------------------
  ------------------
 9504|  12.6k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  12.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.21k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  12.6k|	    xmlXPathCompStep(ctxt);
 9506|  12.6k|	}
 9507|  18.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.26k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.26k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  18.1k|    }
 9509|  1.19M|}
xpath.c:xmlXPathCompStep:
 9390|  1.21M|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|  1.21M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.21M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9392|  1.21M|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|  1.21M|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  22.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 22.8k, False: 1.18M]
  |  Branch (9392:25): [True: 5.68k, False: 17.1k]
  ------------------
 9393|  5.68k|	SKIP(2);
  ------------------
  |  | 2194|  5.68k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  5.68k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.68k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.12k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.12k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  5.68k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  5.68k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.68k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  5.68k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|  1.20M|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  1.20M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 17.1k, False: 1.18M]
  ------------------
 9398|  17.1k|	NEXT;
  ------------------
  |  | 2202|  17.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 17.1k, False: 0]
  |  |  ------------------
  ------------------
 9399|  17.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.73k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.73k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|  1.18M|    } else {
 9401|  1.18M|	xmlChar *name = NULL;
 9402|  1.18M|	xmlChar *prefix = NULL;
 9403|  1.18M|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|  1.18M|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|  1.18M|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|  1.18M|	int op1;
 9407|       |
 9408|  1.18M|	if (CUR == '*') {
  ------------------
  |  | 2193|  1.18M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 1.11M, False: 78.8k]
  ------------------
 9409|  1.11M|	    axis = AXIS_CHILD;
 9410|  1.11M|	} else {
 9411|  78.8k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 78.8k, False: 0]
  ------------------
 9412|  78.8k|		name = xmlXPathParseNCName(ctxt);
 9413|  78.8k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 74.1k, False: 4.65k]
  ------------------
 9414|  74.1k|		axis = xmlXPathIsAxisName(name);
 9415|  74.1k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 4.54k, False: 69.6k]
  ------------------
 9416|  4.54k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  55.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  55.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 55.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  4.54k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  4.54k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  2.69k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 2.69k, False: 1.85k]
  |  Branch (9417:27): [True: 2.24k, False: 446]
  ------------------
 9418|  2.24k|			SKIP(2);
  ------------------
  |  | 2194|  2.24k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.24k|			xmlFree(name);
 9420|  2.24k|			name = NULL;
 9421|  2.29k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  2.29k|			axis = AXIS_CHILD;
 9424|  2.29k|		    }
 9425|  69.6k|		} else {
 9426|  69.6k|		    axis = AXIS_CHILD;
 9427|  69.6k|		}
 9428|  74.1k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  4.65k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 3.85k, False: 799]
  ------------------
 9429|  3.85k|		NEXT;
  ------------------
  |  | 2202|  3.85k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.85k, False: 0]
  |  |  ------------------
  ------------------
 9430|  3.85k|		axis = AXIS_ATTRIBUTE;
 9431|  3.85k|	    } else {
 9432|    799|		axis = AXIS_CHILD;
 9433|    799|	    }
 9434|  78.8k|	}
 9435|       |
 9436|  1.18M|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 1.09k, False: 1.18M]
  ------------------
 9437|  1.09k|            xmlFree(name);
 9438|  1.09k|            return;
 9439|  1.09k|        }
 9440|       |
 9441|  1.18M|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|  1.18M|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 436, False: 1.18M]
  ------------------
 9443|    436|	    return;
 9444|       |
 9445|  1.18M|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 3.09k, False: 1.18M]
  |  Branch (9445:33): [True: 3.09k, False: 0]
  ------------------
 9446|  3.09k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  3.09k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 3.09k]
  ------------------
 9447|      0|	    if (xmlXPathNsLookup(ctxt->context, prefix) == NULL) {
  ------------------
  |  Branch (9447:10): [True: 0, False: 0]
  ------------------
 9448|      0|		xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9449|      0|                               "Undefined namespace prefix: %s\n", prefix);
 9450|      0|	    }
 9451|      0|	}
 9452|       |
 9453|  1.18M|	op1 = ctxt->comp->last;
 9454|  1.18M|	ctxt->comp->last = -1;
 9455|       |
 9456|  1.18M|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.18M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.20M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|  1.19M|	while (CUR == '[') {
  ------------------
  |  | 2193|  1.19M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 9.99k, False: 1.18M]
  ------------------
 9458|  9.99k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  9.99k|	}
 9460|       |
 9461|  1.18M|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|  1.18M|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|  1.18M|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 42, False: 1.18M]
  ------------------
 9462|  1.18M|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     42|            xmlFree(prefix);
 9464|     42|            xmlFree(name);
 9465|     42|        }
 9466|  1.18M|    }
 9467|  1.21M|}
xpath.c:xmlXPathIsAxisName:
 9321|  74.1k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  74.1k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  74.1k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 28.7k, False: 45.3k]
  ------------------
 9324|  7.74k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 7.74k, False: 66.4k]
  ------------------
 9325|  7.74k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  7.74k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.58k, False: 6.16k]
  ------------------
 9326|  1.58k|		ret = AXIS_ANCESTOR;
 9327|  7.74k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  7.74k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 296, False: 7.45k]
  ------------------
 9328|    296|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  7.74k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  7.74k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 70, False: 7.67k]
  ------------------
 9330|     70|		ret = AXIS_ATTRIBUTE;
 9331|  7.74k|	    break;
 9332|  2.00k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 2.00k, False: 72.1k]
  ------------------
 9333|  2.00k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 19, False: 1.98k]
  ------------------
 9334|     19|		ret = AXIS_CHILD;
 9335|  2.00k|	    break;
 9336|  1.86k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.86k, False: 72.2k]
  ------------------
 9337|  1.86k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 200, False: 1.66k]
  ------------------
 9338|    200|		ret = AXIS_DESCENDANT;
 9339|  1.86k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 196, False: 1.66k]
  ------------------
 9340|    196|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.86k|	    break;
 9342|  6.17k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 6.17k, False: 67.9k]
  ------------------
 9343|  6.17k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  6.17k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 230, False: 5.94k]
  ------------------
 9344|    230|		ret = AXIS_FOLLOWING;
 9345|  6.17k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  6.17k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 18, False: 6.15k]
  ------------------
 9346|     18|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  6.17k|	    break;
 9348|  6.23k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 6.23k, False: 67.9k]
  ------------------
 9349|  6.23k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  6.23k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 532, False: 5.70k]
  ------------------
 9350|    532|		ret = AXIS_NAMESPACE;
 9351|  6.23k|	    break;
 9352|  1.87k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 1.87k, False: 72.2k]
  ------------------
 9353|  1.87k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  1.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 278, False: 1.59k]
  ------------------
 9354|    278|		ret = AXIS_PARENT;
 9355|  1.87k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  1.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 71, False: 1.80k]
  ------------------
 9356|     71|		ret = AXIS_PRECEDING;
 9357|  1.87k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  1.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 12, False: 1.86k]
  ------------------
 9358|     12|		ret = AXIS_PRECEDING_SIBLING;
 9359|  1.87k|	    break;
 9360|  2.88k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.88k, False: 71.2k]
  ------------------
 9361|  2.88k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.88k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 1.04k, False: 1.84k]
  ------------------
 9362|  1.04k|		ret = AXIS_SELF;
 9363|  2.88k|	    break;
 9364|  74.1k|    }
 9365|  74.1k|    return(ret);
 9366|  74.1k|}
xpath.c:xmlXPathCompNodeTest:
 9201|  1.18M|		     xmlChar *name) {
 9202|  1.18M|    int blanks;
 9203|       |
 9204|  1.18M|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 1.18M]
  |  Branch (9204:27): [True: 0, False: 1.18M]
  |  Branch (9204:45): [True: 0, False: 1.18M]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|  1.18M|    *type = (xmlXPathTypeVal) 0;
 9208|  1.18M|    *test = (xmlXPathTestVal) 0;
 9209|  1.18M|    *prefix = NULL;
 9210|  1.18M|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.18M|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.33M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 149k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|  1.18M|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|  1.11M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 1.11M, False: 71.4k]
  |  Branch (9212:27): [True: 1.11M, False: 5.57k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|  1.11M|	NEXT;
  ------------------
  |  | 2202|  1.11M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.11M, False: 0]
  |  |  ------------------
  ------------------
 9217|  1.11M|	*test = NODE_TEST_ALL;
 9218|  1.11M|	return(NULL);
 9219|  1.11M|    }
 9220|       |
 9221|  77.0k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 5.57k, False: 71.4k]
  ------------------
 9222|  5.57k|	name = xmlXPathParseNCName(ctxt);
 9223|  77.0k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 355, False: 76.6k]
  ------------------
 9224|    355|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    355|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  76.6k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  76.6k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  76.6k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.37k, False: 74.2k]
  |  |  |  |  ------------------
  |  |  |  |   91|  76.6k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 72.1k, False: 2.13k]
  |  |  |  |  |  Branch (91:23): [True: 14, False: 72.1k]
  |  |  |  |  ------------------
  |  |  |  |   92|  76.6k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 7, False: 74.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  76.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  76.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  93.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 16.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  76.6k|    if (CUR == '(') {
  ------------------
  |  | 2193|  76.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 924, False: 75.7k]
  ------------------
 9230|    924|	NEXT;
  ------------------
  |  | 2202|    924|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 924, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    924|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    924|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 39, False: 885]
  ------------------
 9235|     39|	    *type = NODE_TYPE_COMMENT;
 9236|    885|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    885|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 90, False: 795]
  ------------------
 9237|     90|	    *type = NODE_TYPE_NODE;
 9238|    795|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    795|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 176, False: 619]
  ------------------
 9239|    176|	    *type = NODE_TYPE_PI;
 9240|    619|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    619|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 538, False: 81]
  ------------------
 9241|    538|	    *type = NODE_TYPE_TEXT;
 9242|     81|	else {
 9243|     81|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 81, False: 0]
  ------------------
 9244|     81|		xmlFree(name);
 9245|     81|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     81|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    843|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    843|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.27k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.12k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    843|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 176, False: 667]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    176|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 176, False: 0]
  ------------------
 9256|    176|		xmlFree(name);
 9257|    176|	    name = NULL;
 9258|    176|	    if (CUR != ')') {
  ------------------
  |  | 2193|    176|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 131, False: 45]
  ------------------
 9259|    131|		name = xmlXPathParseLiteral(ctxt);
 9260|    131|		*test = NODE_TEST_PI;
 9261|    131|		SKIP_BLANKS;
  ------------------
  |  | 2199|    552|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    552|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 552, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|    131|	    }
 9263|    176|	}
 9264|    843|	if (CUR != ')') {
  ------------------
  |  | 2193|    843|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 73, False: 770]
  ------------------
 9265|     73|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 61, False: 12]
  ------------------
 9266|     61|		xmlFree(name);
 9267|     73|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     73|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    770|	NEXT;
  ------------------
  |  | 2202|    770|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 770, False: 0]
  |  |  ------------------
  ------------------
 9270|    770|	return(name);
 9271|    843|    }
 9272|  75.7k|    *test = NODE_TEST_NAME;
 9273|  75.7k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  73.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 73.3k, False: 2.38k]
  |  Branch (9273:22): [True: 3.09k, False: 70.2k]
  ------------------
 9274|  3.09k|	NEXT;
  ------------------
  |  | 2202|  3.09k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.09k, False: 0]
  |  |  ------------------
  ------------------
 9275|       |
 9276|       |	/*
 9277|       |	 * Since currently the parser context don't have a
 9278|       |	 * namespace list associated:
 9279|       |	 * The namespace name for this prefix can be computed
 9280|       |	 * only at evaluation time. The compilation is done
 9281|       |	 * outside of any context.
 9282|       |	 */
 9283|  3.09k|	*prefix = name;
 9284|       |
 9285|  3.09k|	if (CUR == '*') {
  ------------------
  |  | 2193|  3.09k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 761, False: 2.33k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    761|	    NEXT;
  ------------------
  |  | 2202|    761|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 761, False: 0]
  |  |  ------------------
  ------------------
 9290|    761|	    *test = NODE_TEST_ALL;
 9291|    761|	    return(NULL);
 9292|    761|	}
 9293|       |
 9294|  2.33k|	name = xmlXPathParseNCName(ctxt);
 9295|  2.33k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 74, False: 2.26k]
  ------------------
 9296|     74|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     74|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  2.33k|    }
 9299|  74.8k|    return(name);
 9300|  75.7k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  3.82M|   int value2, int value3, void *value4, void *value5) {
 1032|  3.82M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  3.82M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 66.9k, False: 3.76M]
  ------------------
 1034|  66.9k|	xmlXPathStepOp *real;
 1035|  66.9k|        int newSize;
 1036|       |
 1037|  66.9k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  66.9k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  66.9k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  66.9k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 66.9k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  66.9k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  66.9k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 144, False: 66.7k]
  ------------------
 1045|    144|	    xmlXPathPErrMemory(ctxt);
 1046|    144|	    return(-1);
 1047|    144|	}
 1048|  66.7k|	comp->steps = real;
 1049|  66.7k|	comp->maxStep = newSize;
 1050|  66.7k|    }
 1051|  3.82M|    comp->last = comp->nbStep;
 1052|  3.82M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  3.82M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  3.82M|    comp->steps[comp->nbStep].op = op;
 1055|  3.82M|    comp->steps[comp->nbStep].value = value;
 1056|  3.82M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  3.82M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  3.82M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 3.82M]
  ------------------
 1059|      0|        ((op == XPATH_OP_FUNCTION) || (op == XPATH_OP_VARIABLE) ||
  ------------------
  |  Branch (1059:10): [True: 0, False: 0]
  |  Branch (1059:39): [True: 0, False: 0]
  ------------------
 1060|      0|	 (op == XPATH_OP_COLLECT))) {
  ------------------
  |  Branch (1060:3): [True: 0, False: 0]
  ------------------
 1061|      0|        if (value4 != NULL) {
  ------------------
  |  Branch (1061:13): [True: 0, False: 0]
  ------------------
 1062|      0|	    comp->steps[comp->nbStep].value4 = (xmlChar *)
 1063|      0|	        (void *)xmlDictLookup(comp->dict, value4, -1);
 1064|      0|	    xmlFree(value4);
 1065|      0|	} else
 1066|      0|	    comp->steps[comp->nbStep].value4 = NULL;
 1067|      0|        if (value5 != NULL) {
  ------------------
  |  Branch (1067:13): [True: 0, False: 0]
  ------------------
 1068|      0|	    comp->steps[comp->nbStep].value5 = (xmlChar *)
 1069|      0|	        (void *)xmlDictLookup(comp->dict, value5, -1);
 1070|      0|	    xmlFree(value5);
 1071|      0|	} else
 1072|      0|	    comp->steps[comp->nbStep].value5 = NULL;
 1073|  3.82M|    } else {
 1074|  3.82M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  3.82M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  3.82M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  3.82M|    return(comp->nbStep++);
 1079|  3.82M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  2.03M|{
11741|  2.03M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  2.03M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  2.03M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 628k, False: 1.40M]
  ------------------
11750|   628k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 628k, False: 0]
  ------------------
11751|   628k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 622k, False: 6.14k]
  ------------------
11752|   622k|    {
11753|   622k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   622k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 18.1k, False: 604k]
  ------------------
11756|  18.1k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 9.94k, False: 8.19k]
  ------------------
11757|  18.1k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  9.94k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 9.94k, False: 0]
  ------------------
11759|  9.94k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 9.94k, False: 0]
  ------------------
11760|  9.94k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 9.94k, False: 0]
  ------------------
11761|  9.94k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  9.94k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.66k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.66k, False: 7.28k]
  ------------------
11769|  2.66k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 9.94k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.66k|                    op->ch1   = prevop->ch1;
11776|  2.66k|                    op->value = AXIS_DESCENDANT;
11777|  2.66k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 9.94k]
  ------------------
11779|  2.23k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 2.23k, False: 7.70k]
  ------------------
11780|       |                    /*
11781|       |                    * Convert "descendant-or-self::node()/self::" or
11782|       |                    * "descendant-or-self::node()/descendant-or-self::" to
11783|       |                    * to "descendant-or-self::"
11784|       |                    */
11785|  2.23k|                    op->ch1   = prevop->ch1;
11786|  2.23k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  2.23k|                    break;
11788|  5.04k|                default:
  ------------------
  |  Branch (11788:17): [True: 5.04k, False: 4.89k]
  ------------------
11789|  5.04k|                    break;
11790|  9.94k|            }
11791|  9.94k|	}
11792|   622k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  2.03M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 48.6k, False: 1.98M]
  ------------------
11796|  48.6k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  1.98M|    ctxt = pctxt->context;
11800|  1.98M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 1.98M, False: 0]
  ------------------
11801|  1.98M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.98M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 1.52k, False: 1.98M]
  ------------------
11802|  1.52k|            return;
11803|  1.98M|        ctxt->depth += 1;
11804|  1.98M|    }
11805|  1.98M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 1.35M, False: 634k]
  ------------------
11806|  1.35M|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  1.98M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 671k, False: 1.31M]
  ------------------
11808|   671k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  1.98M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 1.98M, False: 0]
  ------------------
11810|  1.98M|        ctxt->depth -= 1;
11811|  1.98M|}
xpath.c:xmlXPathRunEval:
11496|  13.2k|{
11497|  13.2k|    xmlXPathCompExprPtr comp;
11498|  13.2k|    int oldDepth;
11499|       |
11500|  13.2k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 13.2k]
  |  Branch (11500:27): [True: 0, False: 13.2k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  13.2k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 13.2k]
  ------------------
11504|      0|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
11505|      0|        int valueMax = 1;
11506|       |#else
11507|       |        int valueMax = 10;
11508|       |#endif
11509|       |
11510|       |	/* Allocate the value stack */
11511|      0|	ctxt->valueTab = xmlMalloc(valueMax * sizeof(xmlXPathObjectPtr));
11512|      0|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11512:6): [True: 0, False: 0]
  ------------------
11513|      0|	    xmlXPathPErrMemory(ctxt);
11514|      0|	    return(-1);
11515|      0|	}
11516|      0|	ctxt->valueNr = 0;
11517|      0|	ctxt->valueMax = valueMax;
11518|      0|	ctxt->value = NULL;
11519|      0|    }
11520|       |#ifdef XPATH_STREAMING
11521|       |    if (ctxt->comp->stream) {
11522|       |	int res;
11523|       |
11524|       |	if (toBool) {
11525|       |	    /*
11526|       |	    * Evaluation to boolean result.
11527|       |	    */
11528|       |	    res = xmlXPathRunStreamEval(ctxt, ctxt->comp->stream, NULL, 1);
11529|       |	    if (res != -1)
11530|       |		return(res);
11531|       |	} else {
11532|       |	    xmlXPathObjectPtr resObj = NULL;
11533|       |
11534|       |	    /*
11535|       |	    * Evaluation to a sequence.
11536|       |	    */
11537|       |	    res = xmlXPathRunStreamEval(ctxt, ctxt->comp->stream, &resObj, 0);
11538|       |
11539|       |	    if ((res != -1) && (resObj != NULL)) {
11540|       |		xmlXPathValuePush(ctxt, resObj);
11541|       |		return(0);
11542|       |	    }
11543|       |	    if (resObj != NULL)
11544|       |		xmlXPathReleaseObject(ctxt->context, resObj);
11545|       |	}
11546|       |	/*
11547|       |	* QUESTION TODO: This falls back to normal XPath evaluation
11548|       |	* if res == -1. Is this intended?
11549|       |	*/
11550|       |    }
11551|       |#endif
11552|  13.2k|    comp = ctxt->comp;
11553|  13.2k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 13.2k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  13.2k|    oldDepth = ctxt->context->depth;
11558|  13.2k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 13.2k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  13.2k|    else
11562|  13.2k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  13.2k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  13.2k|    return(0);
11566|  13.2k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   450k|{
11178|   450k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   455k|start:
11181|   455k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   455k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 455k, False: 0]
  |  |  |  Branch (818:39): [True: 3, False: 455k]
  |  |  ------------------
  ------------------
11182|      3|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   455k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 455k]
  ------------------
11186|      0|            return (0);
11187|  44.8k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 44.8k, False: 410k]
  ------------------
11188|  44.8k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  44.8k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 44.8k, False: 0]
  ------------------
11190|  44.8k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  4.79k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 4.79k, False: 450k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  4.79k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 4.79k, False: 0]
  ------------------
11197|  4.79k|		op = &ctxt->comp->steps[op->ch1];
11198|  4.79k|		goto start;
11199|  4.79k|	    }
11200|      0|	    return(0);
11201|   119k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 119k, False: 336k]
  ------------------
11202|   119k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 119k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   119k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   119k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 108, False: 118k]
  ------------------
11207|    108|		return(-1);
11208|       |
11209|   118k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   118k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 206, False: 118k]
  ------------------
11211|    206|		return(-1);
11212|       |
11213|   118k|	    resObj = xmlXPathValuePop(ctxt);
11214|   118k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 118k]
  ------------------
11215|      0|		return(-1);
11216|   118k|	    break;
11217|   286k|	default:
  ------------------
  |  Branch (11217:2): [True: 286k, False: 168k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   286k|	    xmlXPathCompOpEval(ctxt, op);
11222|   286k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.29k, False: 285k]
  ------------------
11223|  1.29k|		return(-1);
11224|       |
11225|   285k|	    resObj = xmlXPathValuePop(ctxt);
11226|   285k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 285k]
  ------------------
11227|      0|		return(-1);
11228|   285k|	    break;
11229|   455k|    }
11230|       |
11231|   403k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 403k, False: 0]
  ------------------
11232|   403k|	int res;
11233|       |
11234|   403k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 225k, False: 178k]
  ------------------
11235|   225k|	    res = resObj->boolval;
11236|   225k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 178k, False: 0]
  ------------------
11237|       |	    /*
11238|       |	    * For predicates a result of type "number" is handled
11239|       |	    * differently:
11240|       |	    * SPEC XPath 1.0:
11241|       |	    * "If the result is a number, the result will be converted
11242|       |	    *  to true if the number is equal to the context position
11243|       |	    *  and will be converted to false otherwise;"
11244|       |	    */
11245|   178k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   178k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   403k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   403k|	return(res);
11251|   403k|    }
11252|       |
11253|      0|    return(0);
11254|   403k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.12M|{
 9794|       |
 9795|  1.12M|#define XP_TEST_HIT \
 9796|  1.12M|    if (hasAxisRange != 0) { \
 9797|  1.12M|	if (++pos == maxPos) { \
 9798|  1.12M|	    if (addNode(seq, cur) < 0) \
 9799|  1.12M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.12M|	    goto axis_range_end; } \
 9801|  1.12M|    } else { \
 9802|  1.12M|	if (addNode(seq, cur) < 0) \
 9803|  1.12M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.12M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.12M|#define XP_TEST_HIT_NS \
 9807|  1.12M|    if (hasAxisRange != 0) { \
 9808|  1.12M|	if (++pos == maxPos) { \
 9809|  1.12M|	    hasNsNodes = 1; \
 9810|  1.12M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.12M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.12M|	goto axis_range_end; } \
 9813|  1.12M|    } else { \
 9814|  1.12M|	hasNsNodes = 1; \
 9815|  1.12M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.12M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.12M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.12M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.12M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.12M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.12M|    const xmlChar *prefix = op->value4;
 9823|  1.12M|    const xmlChar *name = op->value5;
 9824|  1.12M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.12M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.12M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.12M|    xmlNodeSetPtr contextSeq;
 9831|  1.12M|    int contextIdx;
 9832|  1.12M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.12M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.12M|    xmlNodeSetPtr seq;
 9840|  1.12M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.12M|    xmlXPathStepOpPtr predOp;
 9843|  1.12M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.12M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.12M|    int breakOnFirstHit;
 9846|       |
 9847|  1.12M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.12M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.12M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.12M|    xmlNodePtr oldContextNode;
 9851|  1.12M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.12M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.12M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.12M]
  |  |  |  Branch (271:34): [True: 107, False: 1.12M]
  |  |  ------------------
  |  |  272|  1.12M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    107|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.12M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.12M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 7.00k, False: 1.11M]
  ------------------
 9860|  7.00k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  7.00k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 193, False: 6.80k]
  ------------------
 9862|    193|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    193|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    193|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    193|            return 0;
 9866|    193|	}
 9867|  7.00k|    }
 9868|       |    /*
 9869|       |    * Setup axis.
 9870|       |    *
 9871|       |    * MAYBE FUTURE TODO: merging optimizations:
 9872|       |    * - If the nodes to be traversed wrt to the initial nodes and
 9873|       |    *   the current axis cannot overlap, then we could avoid searching
 9874|       |    *   for duplicates during the merge.
 9875|       |    *   But the question is how/when to evaluate if they cannot overlap.
 9876|       |    *   Example: if we know that for two initial nodes, the one is
 9877|       |    *   not in the ancestor-or-self axis of the other, then we could safely
 9878|       |    *   avoid a duplicate-aware merge, if the axis to be traversed is e.g.
 9879|       |    *   the descendant-or-self axis.
 9880|       |    */
 9881|  1.12M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.12M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.12M, False: 0]
  ------------------
 9883|    622|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 622, False: 1.12M]
  ------------------
 9884|    622|            first = NULL;
 9885|    622|            next = xmlXPathNextAncestor;
 9886|    622|            break;
 9887|     98|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 98, False: 1.12M]
  ------------------
 9888|     98|            first = NULL;
 9889|     98|            next = xmlXPathNextAncestorOrSelf;
 9890|     98|            break;
 9891|  18.0k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 18.0k, False: 1.10M]
  ------------------
 9892|  18.0k|            first = NULL;
 9893|  18.0k|	    last = NULL;
 9894|  18.0k|            next = xmlXPathNextAttribute;
 9895|  18.0k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  18.0k|            break;
 9897|   881k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 881k, False: 240k]
  ------------------
 9898|   881k|	    last = NULL;
 9899|   881k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 616k, False: 265k]
  |  Branch (9899:39): [True: 259k, False: 5.95k]
  ------------------
 9900|   875k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 875k, False: 0]
  ------------------
 9901|   875k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   875k|		next = xmlXPathNextChildElement;
 9906|   875k|	    } else
 9907|  5.95k|		next = xmlXPathNextChild;
 9908|   881k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   881k|            break;
 9910|  41.6k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 41.6k, False: 1.08M]
  ------------------
 9911|  41.6k|	    last = NULL;
 9912|  41.6k|            next = xmlXPathNextDescendant;
 9913|  41.6k|            break;
 9914|   154k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 154k, False: 968k]
  ------------------
 9915|   154k|	    last = NULL;
 9916|   154k|            next = xmlXPathNextDescendantOrSelf;
 9917|   154k|            break;
 9918|    369|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 369, False: 1.12M]
  ------------------
 9919|    369|	    last = NULL;
 9920|    369|            next = xmlXPathNextFollowing;
 9921|    369|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.12M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  2.69k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 2.69k, False: 1.11M]
  ------------------
 9927|  2.69k|            first = NULL;
 9928|  2.69k|	    last = NULL;
 9929|  2.69k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  2.69k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  2.69k|            break;
 9932|  22.1k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 22.1k, False: 1.09M]
  ------------------
 9933|  22.1k|            first = NULL;
 9934|  22.1k|            next = xmlXPathNextParent;
 9935|  22.1k|            break;
 9936|     60|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 60, False: 1.12M]
  ------------------
 9937|     60|            first = NULL;
 9938|     60|            next = xmlXPathNextPrecedingInternal;
 9939|     60|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.12M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    400|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 400, False: 1.12M]
  ------------------
 9945|    400|            first = NULL;
 9946|    400|	    last = NULL;
 9947|    400|            next = xmlXPathNextSelf;
 9948|    400|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    400|            break;
 9950|  1.12M|    }
 9951|       |
 9952|  1.12M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.12M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.12M|    contextSeq = obj->nodesetval;
 9957|  1.12M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.12M]
  |  Branch (9957:33): [True: 62.4k, False: 1.05M]
  ------------------
 9958|  62.4k|        xmlXPathValuePush(ctxt, obj);
 9959|  62.4k|        return(0);
 9960|  62.4k|    }
 9961|       |    /*
 9962|       |    * Predicate optimization ---------------------------------------------
 9963|       |    * If this step has a last predicate, which contains a position(),
 9964|       |    * then we'll optimize (although not exactly "position()", but only
 9965|       |    * the  short-hand form, i.e., "[n]".
 9966|       |    *
 9967|       |    * Example - expression "/foo[parent::bar][1]":
 9968|       |    *
 9969|       |    * COLLECT 'child' 'name' 'node' foo    -- op (we are here)
 9970|       |    *   ROOT                               -- op->ch1
 9971|       |    *   PREDICATE                          -- op->ch2 (predOp)
 9972|       |    *     PREDICATE                          -- predOp->ch1 = [parent::bar]
 9973|       |    *       SORT
 9974|       |    *         COLLECT  'parent' 'name' 'node' bar
 9975|       |    *           NODE
 9976|       |    *     ELEM Object is a number : 1        -- predOp->ch2 = [1]
 9977|       |    *
 9978|       |    */
 9979|  1.05M|    maxPos = 0;
 9980|  1.05M|    predOp = NULL;
 9981|  1.05M|    hasPredicateRange = 0;
 9982|  1.05M|    hasAxisRange = 0;
 9983|  1.05M|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 122k, False: 936k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   122k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   122k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 57.8k, False: 64.9k]
  ------------------
 9989|  57.8k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 36.4k, False: 21.3k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  36.4k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  36.4k|		hasPredicateRange = 1;
 9995|  36.4k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  21.3k|		predOp = NULL;
10000|  21.3k|		hasAxisRange = 1;
10001|  21.3k|	    }
10002|  57.8k|	}
10003|   122k|    }
10004|  1.05M|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 113k, False: 946k]
  |  Branch (10004:36): [True: 86.4k, False: 27.0k]
  ------------------
10005|       |    /*
10006|       |    * Axis traversal -----------------------------------------------------
10007|       |    */
10008|       |    /*
10009|       |     * 2.3 Node Tests
10010|       |     *  - For the attribute axis, the principal node type is attribute.
10011|       |     *  - For the namespace axis, the principal node type is namespace.
10012|       |     *  - For other axes, the principal node type is element.
10013|       |     *
10014|       |     * A node test * is true for any node of the
10015|       |     * principal node type. For example, child::* will
10016|       |     * select all element children of the context node
10017|       |     */
10018|  1.05M|    oldContextNode = xpctxt->node;
10019|  1.05M|    addNode = xmlXPathNodeSetAddUnique;
10020|  1.05M|    outSeq = NULL;
10021|  1.05M|    seq = NULL;
10022|  1.05M|    contextNode = NULL;
10023|  1.05M|    contextIdx = 0;
10024|       |
10025|       |
10026|  3.35M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.36M, False: 985k]
  |  Branch (10026:50): [True: 0, False: 985k]
  ------------------
10027|  2.36M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.36M, False: 99]
  ------------------
10028|  2.36M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.36M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.08M, False: 1.27M]
  ------------------
10031|  1.08M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.08M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 134, False: 1.08M]
  ------------------
10033|    134|                xmlXPathPErrMemory(ctxt);
10034|    134|		total = 0;
10035|    134|		goto error;
10036|    134|	    }
10037|  1.08M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.36M|	pos = 0;
10042|  2.36M|	cur = NULL;
10043|  2.36M|	hasNsNodes = 0;
10044|  9.43M|        do {
10045|  9.43M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  9.43M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 9.43M, False: 0]
  |  |  |  Branch (818:39): [True: 24, False: 9.43M]
  |  |  ------------------
  ------------------
10046|     24|                goto error;
10047|       |
10048|  9.43M|            cur = next(ctxt, cur);
10049|  9.43M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 2.26M, False: 7.16M]
  ------------------
10050|  2.26M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  7.16M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 7.21k, False: 7.15M]
  |  Branch (10055:36): [True: 814, False: 6.39k]
  ------------------
10056|    814|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 278, False: 536]
  ------------------
10057|    278|		    break;
10058|    536|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 399, False: 137]
  ------------------
10059|    399|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|    399|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 305, False: 94]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|    305|		{
10065|    305|		    break;
10066|    305|		}
10067|    536|	    }
10068|  7.16M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 4.18k, False: 7.15M]
  |  Branch (10068:28): [True: 3.72k, False: 459]
  ------------------
10069|  3.72k|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 859, False: 2.86k]
  ------------------
10070|    859|		    break;
10071|  2.86k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 1.57k, False: 1.29k]
  ------------------
10072|  1.57k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|  1.57k|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 1.29k, False: 283]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|  1.29k|		{
10078|  1.29k|		    break;
10079|  1.29k|		}
10080|  2.86k|	    }
10081|       |
10082|  7.15M|            total++;
10083|       |
10084|  7.15M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 7.15M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 7.15M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  3.90M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 3.90M, False: 3.25M]
  ------------------
10089|  3.90M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 3.78M, False: 119k]
  ------------------
10090|  3.78M|			switch (cur->type) {
10091|   137k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 137k, False: 3.64M]
  ------------------
10092|   137k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 3.78M]
  ------------------
10093|  2.43M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.29M, False: 1.48M]
  ------------------
10094|  2.43M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 718, False: 3.78M]
  ------------------
10095|  2.56M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 135k, False: 3.64M]
  ------------------
10096|  2.59M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 24.6k, False: 3.75M]
  ------------------
10097|  2.69M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 104k, False: 3.67M]
  ------------------
10098|  3.77M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 1.07M, False: 2.70M]
  ------------------
10099|  3.77M|				XP_TEST_HIT
  ------------------
  |  | 9796|  3.77M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 562, False: 3.77M]
  |  |  ------------------
  |  | 9797|    562|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 247, False: 315]
  |  |  ------------------
  |  | 9798|    247|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 246]
  |  |  ------------------
  |  | 9799|    247|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    247|	    goto axis_range_end; } \
  |  | 9801|  3.77M|    } else { \
  |  | 9802|  3.77M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 86, False: 3.77M]
  |  |  ------------------
  |  | 9803|  3.77M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.77M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 17.2k, False: 3.75M]
  |  |  ------------------
  ------------------
10100|  3.75M|				break;
10101|  3.75M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 4.83k, False: 3.77M]
  ------------------
10102|  4.83k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 4.83k]
  ------------------
10103|      0|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 9808|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9809|      0|	    hasNsNodes = 1; \
  |  | 9810|      0|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9811|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|      0|	goto axis_range_end; } \
  |  | 9813|      0|    } else { \
  |  | 9814|      0|	hasNsNodes = 1; \
  |  | 9815|      0|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9816|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10104|  4.83k|				} else {
10105|  4.83k|	                            hasNsNodes = 1;
10106|  4.83k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  4.83k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 4.83k]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|  4.83k|    } else { \
  |  | 9802|  4.83k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 8, False: 4.82k]
  |  |  ------------------
  |  | 9803|  4.83k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  4.83k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 4.83k]
  |  |  ------------------
  ------------------
10107|  4.83k|				}
10108|  4.83k|				break;
10109|  4.83k|                            }
10110|  6.39k|			    default:
  ------------------
  |  Branch (10110:8): [True: 6.39k, False: 3.77M]
  ------------------
10111|  6.39k|				break;
10112|  3.78M|			}
10113|  3.78M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 59.1k, False: 60.6k]
  ------------------
10114|  59.1k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 59.1k]
  ------------------
10115|      0|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|      0|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 0, False: 0]
  |  |  ------------------
  |  | 9808|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9809|      0|	    hasNsNodes = 1; \
  |  | 9810|      0|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9811|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|      0|	goto axis_range_end; } \
  |  | 9813|      0|    } else { \
  |  | 9814|      0|	hasNsNodes = 1; \
  |  | 9815|      0|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9816|      0|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|      0|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
10116|  59.1k|			else
10117|  59.1k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  59.1k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.01k, False: 57.1k]
  |  |  ------------------
  |  | 9797|  2.01k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 236, False: 1.78k]
  |  |  ------------------
  |  | 9798|    236|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 235]
  |  |  ------------------
  |  | 9799|    236|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    236|	    goto axis_range_end; } \
  |  | 9801|  57.1k|    } else { \
  |  | 9802|  57.1k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 57.1k]
  |  |  ------------------
  |  | 9803|  57.1k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  57.1k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 195, False: 56.9k]
  |  |  ------------------
  ------------------
10118|  60.6k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 60.6k, False: 42]
  ------------------
10119|  60.6k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 18.7k, False: 41.8k]
  ------------------
10120|  18.7k|		    {
10121|  18.7k|			XP_TEST_HIT
  ------------------
  |  | 9796|  18.7k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 504, False: 18.2k]
  |  |  ------------------
  |  | 9797|    504|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 233, False: 271]
  |  |  ------------------
  |  | 9798|    233|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 3, False: 230]
  |  |  ------------------
  |  | 9799|    233|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    233|	    goto axis_range_end; } \
  |  | 9801|  18.2k|    } else { \
  |  | 9802|  18.2k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 18.2k]
  |  |  ------------------
  |  | 9803|  18.2k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  18.2k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 200, False: 18.0k]
  |  |  ------------------
  ------------------
10122|  18.7k|		    }
10123|  3.88M|		    break;
10124|  3.88M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 426, False: 7.15M]
  ------------------
10125|    426|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 129, False: 297]
  ------------------
10126|    129|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 129]
  |  Branch (10126:44): [True: 86, False: 43]
  ------------------
10127|     86|		    {
10128|     86|			XP_TEST_HIT
  ------------------
  |  | 9796|     86|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 86]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|     86|    } else { \
  |  | 9802|     86|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 85]
  |  |  ------------------
  |  | 9803|     86|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     86|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 86]
  |  |  ------------------
  ------------------
10129|     86|                    }
10130|    426|                    break;
10131|  1.47M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.47M, False: 5.68M]
  ------------------
10132|  1.47M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 11.9k, False: 1.46M]
  ------------------
10133|  11.9k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 11.9k, False: 0]
  ------------------
10134|  11.9k|			{
10135|  11.9k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 11.0k, False: 917]
  ------------------
10136|  11.0k|			    {
10137|  11.0k|				XP_TEST_HIT
  ------------------
  |  | 9796|  11.0k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 667, False: 10.3k]
  |  |  ------------------
  |  | 9797|    667|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 409, False: 258]
  |  |  ------------------
  |  | 9798|    409|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 408]
  |  |  ------------------
  |  | 9799|    409|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    409|	    goto axis_range_end; } \
  |  | 9801|  10.3k|    } else { \
  |  | 9802|  10.3k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 4, False: 10.3k]
  |  |  ------------------
  |  | 9803|  10.3k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  10.3k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 4.87k, False: 5.51k]
  |  |  ------------------
  ------------------
10138|  11.0k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 685, False: 232]
  ------------------
10139|    685|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 685, False: 0]
  ------------------
10140|    685|			    {
10141|    685|				XP_TEST_HIT
  ------------------
  |  | 9796|    685|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 424, False: 261]
  |  |  ------------------
  |  | 9797|    424|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 211, False: 213]
  |  |  ------------------
  |  | 9798|    211|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 210]
  |  |  ------------------
  |  | 9799|    211|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    211|	    goto axis_range_end; } \
  |  | 9801|    424|    } else { \
  |  | 9802|    261|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 260]
  |  |  ------------------
  |  | 9803|    261|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    261|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 39, False: 222]
  |  |  ------------------
  ------------------
10142|    685|                            }
10143|  11.9k|                        }
10144|  1.46M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 167k, False: 1.29M]
  ------------------
10145|   167k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 167k, False: 0]
  ------------------
10146|   167k|			{
10147|   167k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|   167k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 19.6k, False: 148k]
  |  |  ------------------
  |  | 9808|  19.6k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 19.3k, False: 311]
  |  |  ------------------
  |  | 9809|  19.3k|	    hasNsNodes = 1; \
  |  | 9810|  19.3k|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 6, False: 19.3k]
  |  |  ------------------
  |  | 9811|  19.3k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|  19.3k|	goto axis_range_end; } \
  |  | 9813|   148k|    } else { \
  |  | 9814|   148k|	hasNsNodes = 1; \
  |  | 9815|   148k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 25, False: 148k]
  |  |  ------------------
  |  | 9816|   148k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|   148k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 35, False: 147k]
  |  |  ------------------
  ------------------
10148|   167k|                        }
10149|  1.29M|                    } else {
10150|  1.29M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.13M, False: 161k]
  ------------------
10151|  1.13M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.10M, False: 25.4k]
  ------------------
10152|  1.10M|			    {
10153|  1.10M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.10M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 4.95k, False: 1.10M]
  |  |  ------------------
  |  | 9797|  4.95k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 3.64k, False: 1.31k]
  |  |  ------------------
  |  | 9798|  3.64k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 3.64k]
  |  |  ------------------
  |  | 9799|  3.64k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  3.64k|	    goto axis_range_end; } \
  |  | 9801|  1.10M|    } else { \
  |  | 9802|  1.10M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 39, False: 1.10M]
  |  |  ------------------
  |  | 9803|  1.10M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.10M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 21.7k, False: 1.07M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.10M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 8.02k, False: 17.4k]
  ------------------
10156|  8.02k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 2.74k, False: 5.27k]
  ------------------
10157|  2.74k|			    {
10158|  2.74k|				XP_TEST_HIT
  ------------------
  |  | 9796|  2.74k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 338, False: 2.40k]
  |  |  ------------------
  |  | 9797|    338|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 71, False: 267]
  |  |  ------------------
  |  | 9798|     71|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 70]
  |  |  ------------------
  |  | 9799|     71|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     71|	    goto axis_range_end; } \
  |  | 9801|  2.40k|    } else { \
  |  | 9802|  2.40k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 2.40k]
  |  |  ------------------
  |  | 9803|  2.40k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  2.40k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 2.04k, False: 364]
  |  |  ------------------
  ------------------
10159|  2.74k|                            }
10160|  1.13M|                        }
10161|  1.29M|                    }
10162|  1.42M|                    break;
10163|  1.42M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 7.15M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.47M|                    }
10167|  1.78M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.78M, False: 5.37M]
  ------------------
10168|  1.78M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 4.95k, False: 1.77M]
  ------------------
10169|  4.95k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 4.95k]
  ------------------
10170|      0|			    break;
10171|  1.77M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 4.44k, False: 1.77M]
  ------------------
10172|  4.44k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 4.44k]
  ------------------
10173|      0|			    break;
10174|  1.77M|		    } else {
10175|  1.77M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 231k, False: 1.54M]
  ------------------
10176|   231k|			    break;
10177|  1.77M|		    }
10178|  1.54M|                    switch (cur->type) {
10179|  1.54M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.54M, False: 9.39k]
  ------------------
10180|  1.54M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 538k, False: 1.00M]
  ------------------
10181|   538k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 536k, False: 1.97k]
  ------------------
10182|   536k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 536k, False: 755]
  ------------------
10183|   536k|				    {
10184|   536k|					XP_TEST_HIT
  ------------------
  |  | 9796|   536k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 42.9k, False: 493k]
  |  |  ------------------
  |  | 9797|  42.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 21.0k, False: 21.9k]
  |  |  ------------------
  |  | 9798|  21.0k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 21.0k]
  |  |  ------------------
  |  | 9799|  21.0k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  21.0k|	    goto axis_range_end; } \
  |  | 9801|   493k|    } else { \
  |  | 9802|   493k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 12, False: 493k]
  |  |  ------------------
  |  | 9803|   493k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   493k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 96, False: 493k]
  |  |  ------------------
  ------------------
10185|   536k|                                    }
10186|   536k|                                } else {
10187|  1.97k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 368, False: 1.60k]
  ------------------
10188|    368|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 161, False: 207]
  ------------------
10189|    161|				    {
10190|    161|					XP_TEST_HIT
  ------------------
  |  | 9796|    161|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 161]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|    161|    } else { \
  |  | 9802|    161|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 160]
  |  |  ------------------
  |  | 9803|    161|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    161|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 88, False: 73]
  |  |  ------------------
  ------------------
10191|    161|                                    }
10192|  1.97k|                                }
10193|   538k|                            }
10194|  1.51M|                            break;
10195|  1.51M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 4.95k, False: 1.54M]
  ------------------
10196|  4.95k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  4.95k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 3.42k, False: 1.52k]
  ------------------
10199|  3.42k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 3.17k, False: 255]
  ------------------
10200|  3.17k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 2.90k, False: 265]
  ------------------
10201|    265|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 265]
  ------------------
10202|  2.90k|					{
10203|  2.90k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  2.90k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.10k, False: 801]
  |  |  ------------------
  |  | 9797|  2.10k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 670, False: 1.43k]
  |  |  ------------------
  |  | 9798|    670|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 669]
  |  |  ------------------
  |  | 9799|    670|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    670|	    goto axis_range_end; } \
  |  | 9801|  2.10k|    } else { \
  |  | 9802|    801|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 800]
  |  |  ------------------
  |  | 9803|    801|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    801|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 74, False: 727]
  |  |  ------------------
  ------------------
10204|  2.90k|                                        }
10205|  3.17k|                                    } else {
10206|    255|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 2, False: 253]
  ------------------
10207|      2|                                            (xmlStrEqual(URI,
  ------------------
  |  Branch (10207:45): [True: 2, False: 0]
  ------------------
10208|      2|					      attr->ns->href)))
10209|      2|					{
10210|      2|					    XP_TEST_HIT
  ------------------
  |  | 9796|      2|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 2]
  |  |  ------------------
  |  | 9797|      0|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 9798|      0|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 0, False: 0]
  |  |  ------------------
  |  | 9799|      0|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|      0|	    goto axis_range_end; } \
  |  | 9801|      2|    } else { \
  |  | 9802|      2|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 1]
  |  |  ------------------
  |  | 9803|      2|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      2|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 2]
  |  |  ------------------
  ------------------
10211|      2|                                        }
10212|    255|                                    }
10213|  3.42k|                                }
10214|  4.20k|                                break;
10215|  4.95k|                            }
10216|  4.44k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 4.44k, False: 1.54M]
  ------------------
10217|  4.44k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 4.44k, False: 0]
  ------------------
10218|  4.44k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  4.44k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 3.10k, False: 1.34k]
  |  Branch (10220:61): [True: 3.10k, False: 0]
  ------------------
10221|  3.10k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 440, False: 2.66k]
  ------------------
10222|    440|				{
10223|    440|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|    440|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 168, False: 272]
  |  |  ------------------
  |  | 9808|    168|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 99, False: 69]
  |  |  ------------------
  |  | 9809|     99|	    hasNsNodes = 1; \
  |  | 9810|     99|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 1, False: 98]
  |  |  ------------------
  |  | 9811|     99|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|     99|	goto axis_range_end; } \
  |  | 9813|    272|    } else { \
  |  | 9814|    272|	hasNsNodes = 1; \
  |  | 9815|    272|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 1, False: 271]
  |  |  ------------------
  |  | 9816|    272|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    272|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 272]
  |  |  ------------------
  ------------------
10224|    440|                                }
10225|  4.44k|                            }
10226|  4.34k|                            break;
10227|  4.34k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.54M]
  ------------------
10228|      0|                            break;
10229|  1.54M|                    }
10230|  1.52M|                    break;
10231|  7.15M|	    } /* switch(test) */
10232|  7.15M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 7.06M, False: 0]
  |  Branch (10232:35): [True: 7.06M, False: 184]
  ------------------
10233|       |
10234|  2.27M|	goto apply_predicates;
10235|       |
10236|  2.27M|axis_range_end: /* ----------------------------------------------------- */
10237|       |	/*
10238|       |	* We have a "/foo[n]", and position() = n was reached.
10239|       |	* Note that we can have as well "/foo/::parent::foo[1]", so
10240|       |	* a duplicate-aware merge is still needed.
10241|       |	* Merge with the result.
10242|       |	*/
10243|  46.1k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 18.8k, False: 27.3k]
  ------------------
10244|  18.8k|	    outSeq = seq;
10245|  18.8k|	    seq = NULL;
10246|  27.3k|	} else {
10247|  27.3k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  27.3k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 1, False: 27.3k]
  ------------------
10249|      1|                xmlXPathPErrMemory(ctxt);
10250|  27.3k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  46.1k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.6k, False: 32.5k]
  ------------------
10255|  13.6k|	    break;
10256|  32.5k|	continue;
10257|       |
10258|  46.6k|first_hit: /* ---------------------------------------------------------- */
10259|       |	/*
10260|       |	* Break if only a true/false result was requested and
10261|       |	* no predicates existed and a node test succeeded.
10262|       |	*/
10263|  46.6k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 46.6k, False: 0]
  ------------------
10264|  46.6k|	    outSeq = seq;
10265|  46.6k|	    seq = NULL;
10266|  46.6k|	} else {
10267|      0|	    outSeq = mergeAndClear(outSeq, seq);
10268|      0|            if (outSeq == NULL)
  ------------------
  |  Branch (10268:17): [True: 0, False: 0]
  ------------------
10269|      0|                xmlXPathPErrMemory(ctxt);
10270|      0|        }
10271|  46.6k|	break;
10272|       |
10273|  2.27M|apply_predicates: /* --------------------------------------------------- */
10274|  2.27M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 188, False: 2.27M]
  ------------------
10275|    188|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  2.27M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 685k, False: 1.58M]
  |  Branch (10280:33): [True: 153k, False: 532k]
  ------------------
10281|       |	    /*
10282|       |	    * E.g. when we have a "/foo[some expression][n]".
10283|       |	    */
10284|       |	    /*
10285|       |	    * QUESTION TODO: The old predicate evaluation took into
10286|       |	    *  account location-sets.
10287|       |	    *  (E.g. ctxt->value->type == XPATH_LOCATIONSET)
10288|       |	    *  Do we expect such a set here?
10289|       |	    *  All what I learned now from the evaluation semantics
10290|       |	    *  does not indicate that a location-set will be processed
10291|       |	    *  here, so this looks OK.
10292|       |	    */
10293|       |	    /*
10294|       |	    * Iterate over all predicates, starting with the outermost
10295|       |	    * predicate.
10296|       |	    * TODO: Problem: we cannot execute the inner predicates first
10297|       |	    *  since we cannot go back *up* the operator tree!
10298|       |	    *  Options we have:
10299|       |	    *  1) Use of recursive functions (like is it currently done
10300|       |	    *     via xmlXPathCompOpEval())
10301|       |	    *  2) Add a predicate evaluation information stack to the
10302|       |	    *     context struct
10303|       |	    *  3) Change the way the operators are linked; we need a
10304|       |	    *     "parent" field on xmlXPathStepOp
10305|       |	    *
10306|       |	    * For the moment, I'll try to solve this with a recursive
10307|       |	    * function: xmlXPathCompOpEvalPredicate().
10308|       |	    */
10309|   153k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 10.0k, False: 143k]
  ------------------
10310|  10.0k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  10.0k|					    hasNsNodes);
10312|   143k|	    else
10313|   143k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   143k|					    hasNsNodes);
10315|       |
10316|   153k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.58k, False: 151k]
  ------------------
10317|  1.58k|		total = 0;
10318|  1.58k|		goto error;
10319|  1.58k|	    }
10320|   153k|        }
10321|       |
10322|  2.27M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 623k, False: 1.64M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   623k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 342k, False: 280k]
  ------------------
10327|   342k|		outSeq = seq;
10328|   342k|		seq = NULL;
10329|   342k|	    } else {
10330|   280k|		outSeq = mergeAndClear(outSeq, seq);
10331|   280k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 103, False: 280k]
  ------------------
10332|    103|                    xmlXPathPErrMemory(ctxt);
10333|   280k|	    }
10334|       |
10335|   623k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 11.5k, False: 611k]
  ------------------
10336|  11.5k|                break;
10337|   623k|	}
10338|  2.27M|    }
10339|       |
10340|  1.05M|error:
10341|  1.05M|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 1.05M]
  |  Branch (10341:27): [True: 0, False: 0]
  ------------------
10342|       |	/*
10343|       |	* QUESTION TODO: What does this do and why?
10344|       |	* TODO: Do we have to do this also for the "error"
10345|       |	* cleanup further down?
10346|       |	*/
10347|      0|	ctxt->value->boolval = 1;
10348|      0|	ctxt->value->user = obj->user;
10349|      0|	obj->user = NULL;
10350|      0|	obj->boolval = 0;
10351|      0|    }
10352|  1.05M|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|  1.05M|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 651k, False: 407k]
  ------------------
10358|   651k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 651k, False: 126]
  |  Branch (10358:23): [True: 651k, False: 147]
  ------------------
10359|   651k|	    outSeq = seq;
10360|   651k|        } else {
10361|    273|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    273|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 272]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    273|        }
10365|   651k|    }
10366|  1.05M|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 680k, False: 378k]
  |  Branch (10366:26): [True: 29.4k, False: 651k]
  ------------------
10367|  29.4k|	 xmlXPathFreeNodeSet(seq);
10368|  29.4k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|  1.05M|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|  1.05M|    xpctxt->node = oldContextNode;
10378|       |    /*
10379|       |    * When traversing the namespace axis in "toBool" mode, it's
10380|       |    * possible that tmpNsList wasn't freed.
10381|       |    */
10382|  1.05M|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 325, False: 1.05M]
  ------------------
10383|    325|        xmlFree(xpctxt->tmpNsList);
10384|    325|        xpctxt->tmpNsList = NULL;
10385|    325|    }
10386|       |
10387|  1.05M|    return(total);
10388|  1.05M|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   162k|{
 2959|   162k|    {
 2960|   162k|	int i, j, initNbSet1;
 2961|   162k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   162k|	initNbSet1 = set1->nodeNr;
 2964|   591k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 429k, False: 162k]
  ------------------
 2965|   429k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  73.0M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 72.9M, False: 90.9k]
  ------------------
 2970|  72.9M|		n1 = set1->nodeTab[j];
 2971|  72.9M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 338k, False: 72.6M]
  ------------------
 2972|   338k|		    goto skip_node;
 2973|  72.6M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 153k, False: 72.4M]
  ------------------
 2974|   153k|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 153k, False: 0]
  ------------------
 2975|   153k|		{
 2976|   153k|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 3.54k, False: 149k]
  ------------------
 2977|  3.54k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 3.54k]
  ------------------
 2978|  3.54k|			((xmlNsPtr) n2)->prefix)))
 2979|      0|		    {
 2980|       |			/*
 2981|       |			* Free the namespace node.
 2982|       |			*/
 2983|      0|			xmlXPathNodeSetFreeNs((xmlNsPtr) n2);
 2984|      0|			goto skip_node;
 2985|      0|		    }
 2986|   153k|		}
 2987|  72.9M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  90.9k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 16.2k, False: 74.7k]
  ------------------
 2992|  16.2k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 46, False: 16.1k]
  ------------------
 2993|     46|                    goto error;
 2994|  16.2k|            }
 2995|  90.9k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   429k|skip_node:
 2997|   429k|            set2->nodeTab[i] = NULL;
 2998|   429k|	}
 2999|   162k|    }
 3000|   162k|    set2->nodeNr = 0;
 3001|   162k|    return(set1);
 3002|       |
 3003|     46|error:
 3004|     46|    xmlXPathFreeNodeSet(set1);
 3005|     46|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   162k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  4.27k|{
 3155|  4.27k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  4.27k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  4.93k|{
 3128|  4.93k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 4.93k]
  |  Branch (3128:26): [True: 0, False: 4.93k]
  ------------------
 3129|      0|	return;
 3130|  4.93k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 762, False: 4.17k]
  ------------------
 3131|    762|	int i;
 3132|    762|	xmlNodePtr node;
 3133|       |
 3134|  3.83k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 3.06k, False: 762]
  ------------------
 3135|  3.06k|	    node = set->nodeTab[i];
 3136|  3.06k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 2.51k, False: 559]
  ------------------
 3137|  2.51k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 58, False: 2.45k]
  ------------------
 3138|     58|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  3.06k|	}
 3140|    762|    }
 3141|  4.93k|    set->nodeNr = pos;
 3142|  4.93k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   145k|{
 3022|   145k|    {
 3023|   145k|	int i;
 3024|   145k|	xmlNodePtr n2;
 3025|       |
 3026|   631k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 485k, False: 145k]
  ------------------
 3027|   485k|	    n2 = set2->nodeTab[i];
 3028|   485k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 72.4k, False: 412k]
  ------------------
 3029|  72.4k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 58, False: 72.3k]
  ------------------
 3030|     58|                    goto error;
 3031|  72.4k|            }
 3032|   485k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   485k|            set2->nodeTab[i] = NULL;
 3034|   485k|	}
 3035|   145k|    }
 3036|   145k|    set2->nodeNr = 0;
 3037|   145k|    return(set1);
 3038|       |
 3039|     58|error:
 3040|     58|    xmlXPathFreeNodeSet(set1);
 3041|     58|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   145k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.96M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.96M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.96M]
  |  Branch (6201:27): [True: 0, False: 2.96M]
  ------------------
 6202|  2.96M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.52M, False: 1.44M]
  ------------------
 6203|  1.52M|	cur = ctxt->context->node;
 6204|  1.52M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.52M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.52M|	switch (cur->type) {
 6209|  1.11M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.11M, False: 405k]
  ------------------
 6210|  1.11M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.52M]
  ------------------
 6211|  1.11M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.52M]
  ------------------
 6212|  1.11M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.52M]
  ------------------
 6213|  1.11M|		cur = cur->children;
 6214|  1.11M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 352k, False: 765k]
  ------------------
 6215|   352k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 154k, False: 197k]
  ------------------
 6216|   154k|			return(cur);
 6217|   207k|		    do {
 6218|   207k|			cur = cur->next;
 6219|   207k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 137k, False: 69.5k]
  ------------------
 6220|   137k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 9.53k, False: 128k]
  ------------------
 6221|   197k|		    return(cur);
 6222|   352k|		}
 6223|   765k|		return(NULL);
 6224|   282k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 282k, False: 1.24M]
  ------------------
 6225|   282k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.52M]
  ------------------
 6226|   282k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   122k|	    default:
  ------------------
  |  Branch (6227:6): [True: 122k, False: 1.40M]
  ------------------
 6228|   122k|		return(NULL);
 6229|  1.52M|	}
 6230|      0|	return(NULL);
 6231|  1.52M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.44M|    switch (cur->type) {
 6236|  1.44M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.44M, False: 0]
  ------------------
 6237|  1.44M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.44M]
  ------------------
 6238|  1.44M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.44M]
  ------------------
 6239|  1.44M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.44M]
  ------------------
 6240|  1.44M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.44M]
  ------------------
 6241|  1.44M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.44M]
  ------------------
 6242|  1.44M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.44M]
  ------------------
 6243|  1.44M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.44M]
  ------------------
 6244|  1.44M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.44M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.44M|    }
 6249|  1.44M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 976k, False: 464k]
  ------------------
 6250|   976k|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 792k, False: 183k]
  ------------------
 6251|   792k|	    return(cur->next);
 6252|   183k|	cur = cur->next;
 6253|   362k|	do {
 6254|   362k|	    cur = cur->next;
 6255|   362k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 287k, False: 75.3k]
  |  Branch (6255:28): [True: 179k, False: 108k]
  ------------------
 6256|   183k|	return(cur);
 6257|   976k|    }
 6258|   464k|    return(NULL);
 6259|  1.44M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  80.7k|{
 6757|  80.7k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 80.7k]
  |  Branch (6757:27): [True: 0, False: 80.7k]
  ------------------
 6758|  80.7k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 3.71k, False: 77.0k]
  ------------------
 6759|  3.71k|        cur = ctxt->context->node;
 6760|  3.71k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 3.71k]
  ------------------
 6761|      0|            return (NULL);
 6762|  3.71k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 3.71k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  3.71k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 3.71k]
  ------------------
 6765|      0|            xmlNsPtr ns = (xmlNsPtr) cur;
 6766|       |
 6767|      0|            if ((ns->next == NULL) ||
  ------------------
  |  Branch (6767:17): [True: 0, False: 0]
  ------------------
 6768|      0|                (ns->next->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6768:17): [True: 0, False: 0]
  ------------------
 6769|      0|                return (NULL);
 6770|      0|            cur = (xmlNodePtr) ns->next;
 6771|      0|        }
 6772|  3.71k|        ctxt->ancestor = cur->parent;
 6773|  3.71k|    }
 6774|       |
 6775|  80.7k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 80.7k]
  |  Branch (6775:44): [True: 60, False: 80.7k]
  ------------------
 6776|     60|        return(NULL);
 6777|       |
 6778|  80.7k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 33.7k, False: 46.9k]
  |  Branch (6778:32): [True: 2.09k, False: 31.7k]
  ------------------
 6779|  2.09k|	cur = cur->prev;
 6780|       |
 6781|  1.29M|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 1.25M, False: 40.3k]
  ------------------
 6782|  1.25M|        cur = cur->parent;
 6783|  1.25M|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 2.38k, False: 1.25M]
  ------------------
 6784|  2.38k|            return (NULL);
 6785|  1.25M|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 1.26k, False: 1.25M]
  ------------------
 6786|  1.26k|            return (NULL);
 6787|  1.25M|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 36.7k, False: 1.21M]
  ------------------
 6788|  36.7k|            return (cur);
 6789|  1.21M|        ctxt->ancestor = cur->parent;
 6790|  1.21M|    }
 6791|       |
 6792|  40.3k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 40.3k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  40.3k|    cur = cur->prev;
 6796|  77.0k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 36.7k, False: 40.3k]
  ------------------
 6797|  36.7k|        cur = cur->last;
 6798|  40.3k|    return (cur);
 6799|  40.3k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   122k|{
 9737|       |
 9738|   122k|    xmlXPathStepOpPtr exprOp;
 9739|       |
 9740|       |    /*
 9741|       |    * BIG NOTE: This is not intended for XPATH_OP_FILTER yet!
 9742|       |    */
 9743|       |
 9744|       |    /*
 9745|       |    * If not -1, then ch1 will point to:
 9746|       |    * 1) For predicates (XPATH_OP_PREDICATE):
 9747|       |    *    - an inner predicate operator
 9748|       |    * 2) For filters (XPATH_OP_FILTER):
 9749|       |    *    - an inner filter operator OR
 9750|       |    *    - an expression selecting the node set.
 9751|       |    *      E.g. "key('a', 'b')" or "(//foo | //bar)".
 9752|       |    */
 9753|   122k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 122k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   122k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 122k, False: 0]
  ------------------
 9757|   122k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   122k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   122k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 122k, False: 0]
  ------------------
 9762|   122k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 62.1k, False: 60.7k]
  ------------------
 9763|  62.1k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 62.1k, False: 0]
  ------------------
 9764|  62.1k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 61.8k, False: 243]
  ------------------
 9765|  61.8k|    {
 9766|  61.8k|        double floatval = ((xmlXPathObjectPtr) exprOp->value4)->floatval;
 9767|       |
 9768|       |	/*
 9769|       |	* We have a "[n]" predicate here.
 9770|       |	* TODO: Unfortunately this simplistic test here is not
 9771|       |	* able to detect a position() predicate in compound
 9772|       |	* expressions like "[@attr = 'a" and position() = 1],
 9773|       |	* and even not the usage of position() in
 9774|       |	* "[position() = 1]"; thus - obviously - a position-range,
 9775|       |	* like it "[position() < 5]", is also not detected.
 9776|       |	* Maybe we could rewrite the AST to ease the optimization.
 9777|       |	*/
 9778|       |
 9779|  61.8k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 61.6k, False: 220]
  |  Branch (9779:37): [True: 58.2k, False: 3.44k]
  ------------------
 9780|  58.2k|	    *maxPos = (int) floatval;
 9781|  58.2k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 57.8k, False: 376]
  ------------------
 9782|  57.8k|                return(1);
 9783|  58.2k|        }
 9784|  61.8k|    }
 9785|  64.9k|    return(0);
 9786|   122k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   154k|{
 9711|   154k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 1.23k, False: 153k]
  ------------------
 9712|  1.23k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  1.23k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 1.23k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  1.23k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.23k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 1, False: 1.23k]
  ------------------
 9720|  1.23k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  1.23k|        ctxt->context->depth += 1;
 9722|  1.23k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  1.23k|                                    1, set->nodeNr, hasNsNodes);
 9724|  1.23k|        ctxt->context->depth -= 1;
 9725|  1.23k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.23k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 842, False: 388]
  |  |  ------------------
  ------------------
 9726|  1.23k|    }
 9727|       |
 9728|   153k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 153k, False: 0]
  ------------------
 9729|   153k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   153k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   168k|{
 9578|   168k|    xmlXPathContextPtr xpctxt;
 9579|   168k|    xmlNodePtr oldnode;
 9580|   168k|    xmlDocPtr olddoc;
 9581|   168k|    xmlXPathStepOpPtr filterOp;
 9582|   168k|    int oldcs, oldpp;
 9583|   168k|    int i, j, pos;
 9584|       |
 9585|   168k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 168k]
  |  Branch (9585:26): [True: 9.22k, False: 159k]
  ------------------
 9586|  9.22k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   159k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 4.17k, False: 155k]
  ------------------
 9593|  4.17k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  4.17k|        return;
 9595|  4.17k|    }
 9596|       |
 9597|   155k|    xpctxt = ctxt->context;
 9598|   155k|    oldnode = xpctxt->node;
 9599|   155k|    olddoc = xpctxt->doc;
 9600|   155k|    oldcs = xpctxt->contextSize;
 9601|   155k|    oldpp = xpctxt->proximityPosition;
 9602|   155k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   155k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   540k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 450k, False: 90.0k]
  ------------------
 9607|   450k|        xmlNodePtr node = set->nodeTab[i];
 9608|   450k|        int res;
 9609|       |
 9610|   450k|        xpctxt->node = node;
 9611|   450k|        xpctxt->proximityPosition = i + 1;
 9612|       |
 9613|       |        /*
 9614|       |        * Also set the xpath document in case things like
 9615|       |        * key() are evaluated in the predicate.
 9616|       |        *
 9617|       |        * TODO: Get real doc for namespace nodes.
 9618|       |        */
 9619|   450k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 447k, False: 2.73k]
  ------------------
 9620|   447k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 447k, False: 0]
  ------------------
 9621|   447k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   450k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   450k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.61k, False: 448k]
  ------------------
 9626|  1.61k|            break;
 9627|   448k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 448k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   448k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 173k, False: 275k]
  |  Branch (9633:28): [True: 165k, False: 7.61k]
  |  Branch (9633:47): [True: 162k, False: 3.03k]
  ------------------
 9634|   162k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 5.29k, False: 157k]
  ------------------
 9635|  5.29k|                set->nodeTab[j] = node;
 9636|  5.29k|                set->nodeTab[i] = NULL;
 9637|  5.29k|            }
 9638|       |
 9639|   162k|            j += 1;
 9640|   286k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   286k|            set->nodeTab[i] = NULL;
 9643|   286k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 2.61k, False: 283k]
  ------------------
 9644|  2.61k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   286k|        }
 9646|       |
 9647|   448k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 173k, False: 275k]
  ------------------
 9648|   173k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 63.5k, False: 109k]
  ------------------
 9649|  63.5k|                i += 1;
 9650|  63.5k|                break;
 9651|  63.5k|            }
 9652|       |
 9653|   109k|            pos += 1;
 9654|   109k|        }
 9655|   448k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   155k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 7.04k, False: 148k]
  ------------------
 9659|  8.18k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 1.13k, False: 7.04k]
  ------------------
 9660|  1.13k|            xmlNodePtr node = set->nodeTab[i];
 9661|  1.13k|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 1.13k, False: 0]
  |  Branch (9661:35): [True: 28, False: 1.11k]
  ------------------
 9662|     28|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|  1.13k|        }
 9664|  7.04k|    }
 9665|       |
 9666|   155k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   155k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   155k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 9.99k, False: 145k]
  ------------------
 9670|  9.99k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 5.93k, False: 4.06k]
  ------------------
 9671|  5.93k|        xmlNodePtr *tmp;
 9672|  5.93k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  5.93k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  5.93k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 5.82k, False: 103]
  ------------------
 9675|  5.82k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  5.82k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  5.93k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  5.93k|                nodeMax * sizeof(xmlNodePtr));
 9678|  5.93k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 5.93k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  5.93k|        } else {
 9681|  5.93k|            set->nodeTab = tmp;
 9682|  5.93k|            set->nodeMax = nodeMax;
 9683|  5.93k|        }
 9684|  5.93k|    }
 9685|       |
 9686|   155k|    xpctxt->node = oldnode;
 9687|   155k|    xpctxt->doc = olddoc;
 9688|   155k|    xpctxt->contextSize = oldcs;
 9689|   155k|    xpctxt->proximityPosition = oldpp;
 9690|   155k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.90M|{
10751|  3.90M|    int total = 0;
10752|  3.90M|    int equal, ret;
10753|  3.90M|    xmlXPathCompExprPtr comp;
10754|  3.90M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.90M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.90M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 3, False: 3.90M]
  |  |  ------------------
  ------------------
10757|  3.90M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.90M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.90M, False: 0]
  |  |  |  Branch (818:39): [True: 48, False: 3.90M]
  |  |  ------------------
  ------------------
10758|     48|        return(0);
10759|  3.90M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.90M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 26, False: 3.90M]
  ------------------
10760|  3.90M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     26|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.90M|    ctxt->context->depth += 1;
10762|  3.90M|    comp = ctxt->comp;
10763|  3.90M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.90M]
  ------------------
10765|      0|            break;
10766|  2.03k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 2.03k, False: 3.90M]
  ------------------
10767|  2.03k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  2.03k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.03k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 71, False: 1.96k]
  |  |  ------------------
  ------------------
10769|  1.96k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.96k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 1, False: 1.96k]
  |  Branch (10770:42): [True: 628, False: 1.33k]
  ------------------
10771|    629|                break;
10772|  1.33k|            arg2 = xmlXPathValuePop(ctxt);
10773|  1.33k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|  1.33k|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 15, False: 1.32k]
  ------------------
10775|     15|		xmlXPathFreeObject(arg2);
10776|     15|		break;
10777|     15|	    }
10778|  1.32k|            xmlXPathBooleanFunction(ctxt, 1);
10779|  1.32k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 1.32k, False: 1]
  ------------------
10780|  1.32k|                ctxt->value->boolval &= arg2->boolval;
10781|  1.32k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|  1.32k|            break;
10783|  4.66k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 4.66k, False: 3.90M]
  ------------------
10784|  4.66k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  4.66k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  4.66k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 858, False: 3.80k]
  |  |  ------------------
  ------------------
10786|  3.80k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  3.80k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 2, False: 3.80k]
  |  Branch (10787:42): [True: 1.33k, False: 2.46k]
  ------------------
10788|  1.33k|                break;
10789|  2.46k|            arg2 = xmlXPathValuePop(ctxt);
10790|  2.46k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  2.46k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 106, False: 2.35k]
  ------------------
10792|    106|		xmlXPathFreeObject(arg2);
10793|    106|		break;
10794|    106|	    }
10795|  2.35k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  2.35k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 2.35k, False: 3]
  ------------------
10797|  2.35k|                ctxt->value->boolval |= arg2->boolval;
10798|  2.35k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  2.35k|            break;
10800|   344k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 344k, False: 3.56M]
  ------------------
10801|   344k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   344k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   344k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 5.99k, False: 338k]
  |  |  ------------------
  ------------------
10803|   338k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   338k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   338k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.39k, False: 337k]
  |  |  ------------------
  ------------------
10805|   337k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 330k, False: 7.16k]
  ------------------
10806|   330k|		equal = xmlXPathEqualValues(ctxt);
10807|  7.16k|	    else
10808|  7.16k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   337k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   337k|            break;
10811|   161k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 161k, False: 3.74M]
  ------------------
10812|   161k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   161k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   161k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.18k, False: 160k]
  |  |  ------------------
  ------------------
10814|   160k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   160k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   160k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 697, False: 159k]
  |  |  ------------------
  ------------------
10816|   159k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   159k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   159k|            break;
10819|   315k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 315k, False: 3.59M]
  ------------------
10820|   315k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   315k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   315k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 5.87k, False: 309k]
  |  |  ------------------
  ------------------
10822|   309k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 161k, False: 148k]
  ------------------
10823|   161k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   161k|	    }
10825|   309k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   309k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 982, False: 308k]
  |  |  ------------------
  ------------------
10826|   308k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 79.5k, False: 228k]
  ------------------
10827|  79.5k|                xmlXPathSubValues(ctxt);
10828|   228k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 80.6k, False: 148k]
  ------------------
10829|  80.6k|                xmlXPathAddValues(ctxt);
10830|   148k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 127k, False: 20.5k]
  ------------------
10831|   127k|                xmlXPathValueFlipSign(ctxt);
10832|  20.5k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 20.5k, False: 0]
  ------------------
10833|  20.5k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  20.5k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 20.5k, False: 0]
  |  |  |  Branch (297:34): [True: 11.7k, False: 8.82k]
  |  |  ------------------
  |  |  298|  20.5k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  20.5k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  20.5k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 2, False: 20.5k]
  |  |  |  Branch (271:34): [True: 2, False: 20.5k]
  |  |  ------------------
  |  |  272|  20.5k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      4|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  20.5k|            }
10836|   308k|            break;
10837|   308k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 230k, False: 3.67M]
  ------------------
10838|   230k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   230k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   230k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 11.9k, False: 218k]
  |  |  ------------------
  ------------------
10840|   218k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   218k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   218k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 382, False: 218k]
  |  |  ------------------
  ------------------
10842|   218k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 215k, False: 2.09k]
  ------------------
10843|   215k|                xmlXPathMultValues(ctxt);
10844|  2.09k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 1.22k, False: 877]
  ------------------
10845|  1.22k|                xmlXPathDivValues(ctxt);
10846|    877|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 877, False: 0]
  ------------------
10847|    877|                xmlXPathModValues(ctxt);
10848|   218k|            break;
10849|   123k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 123k, False: 3.78M]
  ------------------
10850|   123k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   123k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   123k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 515, False: 123k]
  |  |  ------------------
  ------------------
10852|   123k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   123k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   123k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 338, False: 122k]
  |  |  ------------------
  ------------------
10854|       |
10855|   122k|            arg2 = xmlXPathValuePop(ctxt);
10856|   122k|            arg1 = xmlXPathValuePop(ctxt);
10857|   122k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 122k]
  |  Branch (10857:35): [True: 38, False: 122k]
  ------------------
10858|   122k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 122k]
  |  Branch (10858:35): [True: 14, False: 122k]
  ------------------
10859|     52|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     52|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     52|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     52|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   122k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 122k, False: 0]
  ------------------
10864|   122k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 122k, False: 0]
  ------------------
10865|   122k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 13, False: 122k]
  ------------------
10866|   122k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   122k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 122k, False: 0]
  ------------------
10868|   122k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 3, False: 122k]
  ------------------
10869|   122k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     16|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     16|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     16|                break;
10873|     16|            }
10874|       |
10875|   122k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 122k, False: 0]
  ------------------
10876|   122k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 52.4k, False: 70.1k]
  ------------------
10877|  52.4k|	    {
10878|  52.4k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  52.4k|							arg2->nodesetval);
10880|  52.4k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 46, False: 52.4k]
  ------------------
10881|     46|                    xmlXPathPErrMemory(ctxt);
10882|  52.4k|	    }
10883|       |
10884|   122k|            xmlXPathValuePush(ctxt, arg1);
10885|   122k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   122k|            break;
10887|   337k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 337k, False: 3.56M]
  ------------------
10888|   337k|            xmlXPathRoot(ctxt);
10889|   337k|            break;
10890|   801k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 801k, False: 3.10M]
  ------------------
10891|   801k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 801k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   801k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   801k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 801k]
  |  |  ------------------
  ------------------
10894|   801k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 801k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   801k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   801k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 801k]
  |  |  ------------------
  ------------------
10897|   801k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   801k|                                                    ctxt->context->node));
10899|   801k|            break;
10900|   985k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 985k, False: 2.92M]
  ------------------
10901|   985k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 985k]
  ------------------
10902|      0|                    break;
10903|       |
10904|   985k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|   985k|		CHECK_ERROR0;
  ------------------
  |  |  236|   985k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.43k, False: 984k]
  |  |  ------------------
  ------------------
10906|       |
10907|   984k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|   984k|                break;
10909|   985k|            }
10910|   314k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 314k, False: 3.59M]
  ------------------
10911|   314k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   314k|            break;
10913|     98|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 98, False: 3.90M]
  ------------------
10914|     98|		xmlXPathObjectPtr val;
10915|       |
10916|     98|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 98]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     98|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 74, False: 24]
  ------------------
10920|     74|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     74|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 74, False: 0]
  ------------------
10922|     74|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     74|                                       "Undefined variable: %s\n", op->value4);
10924|     74|                        return 0;
10925|     74|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     24|		} else {
10928|     24|                    const xmlChar *URI;
10929|       |
10930|     24|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     24|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 6, False: 18]
  ------------------
10932|      6|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      6|                                       "Undefined namespace prefix: %s\n",
10934|      6|                                       op->value5);
10935|      6|                        return 0;
10936|      6|                    }
10937|     18|		    val = xmlXPathVariableLookupNS(ctxt->context,
10938|     18|                                                       op->value4, URI);
10939|     18|		    if (val == NULL) {
  ------------------
  |  Branch (10939:11): [True: 18, False: 0]
  ------------------
10940|     18|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10941|     18|                                       "Undefined variable: %s:%s\n",
10942|     18|                                       op->value5, op->value4);
10943|     18|                        return 0;
10944|     18|                    }
10945|      0|                    xmlXPathValuePush(ctxt, val);
10946|      0|                }
10947|      0|                break;
10948|     98|            }
10949|  69.6k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 69.6k, False: 3.83M]
  ------------------
10950|  69.6k|                xmlXPathFunction func;
10951|  69.6k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  69.6k|		int i;
10953|  69.6k|                int frame;
10954|       |
10955|  69.6k|                frame = ctxt->valueNr;
10956|  69.6k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 49.2k, False: 20.3k]
  ------------------
10957|  49.2k|                    total +=
10958|  49.2k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  49.2k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 891, False: 48.3k]
  ------------------
10960|    891|                        break;
10961|  49.2k|                }
10962|  68.7k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 68.7k]
  ------------------
10963|  68.7k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|   155k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 86.7k, False: 68.7k]
  ------------------
10965|  86.7k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 86.7k]
  ------------------
10966|  86.7k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  86.7k|                }
10968|  68.7k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 61.1k, False: 7.57k]
  ------------------
10969|  61.1k|                    func = op->cache;
10970|  7.57k|                else {
10971|  7.57k|                    const xmlChar *URI = NULL;
10972|       |
10973|  7.57k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 7.52k, False: 58]
  ------------------
10974|  7.52k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  7.52k|                                                      op->value4);
10976|  7.52k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 537, False: 6.98k]
  ------------------
10977|    537|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    537|                                           "Unregistered function: %s\n",
10979|    537|                                           op->value4);
10980|    537|                            return 0;
10981|    537|                        }
10982|  7.52k|                    } else {
10983|     58|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     58|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 50, False: 8]
  ------------------
10985|     50|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     50|                                           "Undefined namespace prefix: %s\n",
10987|     50|                                           op->value5);
10988|     50|                            return 0;
10989|     50|                        }
10990|      8|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|      8|                                                        op->value4, URI);
10992|      8|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 8, False: 0]
  ------------------
10993|      8|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|      8|                                           "Unregistered function: %s:%s\n",
10995|      8|                                           op->value5, op->value4);
10996|      8|                            return 0;
10997|      8|                        }
10998|      8|                    }
10999|  6.98k|                    op->cache = func;
11000|  6.98k|                    op->cacheURI = (void *) URI;
11001|  6.98k|                }
11002|  68.1k|                oldFunc = ctxt->context->function;
11003|  68.1k|                oldFuncURI = ctxt->context->functionURI;
11004|  68.1k|                ctxt->context->function = op->value4;
11005|  68.1k|                ctxt->context->functionURI = op->cacheURI;
11006|  68.1k|                func(ctxt, op->value);
11007|  68.1k|                ctxt->context->function = oldFunc;
11008|  68.1k|                ctxt->context->functionURI = oldFuncURI;
11009|  68.1k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 67.8k, False: 301]
  ------------------
11010|  67.8k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 67.8k]
  ------------------
11011|  68.1k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  68.1k|                break;
11013|  68.1k|            }
11014|  89.0k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 89.0k, False: 3.81M]
  ------------------
11015|  89.0k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 39.7k, False: 49.2k]
  ------------------
11016|  39.7k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  39.7k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  39.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 946, False: 38.8k]
  |  |  ------------------
  ------------------
11018|  39.7k|            }
11019|  88.1k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 88.1k, False: 0]
  ------------------
11020|  88.1k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  88.1k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  88.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 890, False: 87.2k]
  |  |  ------------------
  ------------------
11022|  88.1k|	    }
11023|  87.2k|            break;
11024|  87.2k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.90M]
  ------------------
11025|  25.2k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 25.2k, False: 3.88M]
  ------------------
11026|  25.2k|                xmlXPathObjectPtr obj;
11027|  25.2k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  25.2k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 25.2k, False: 0]
  |  Branch (11032:40): [True: 25.2k, False: 0]
  ------------------
11033|  25.2k|#ifdef XP_OPTIMIZED_FILTER_FIRST
11034|       |		    /*
11035|       |		    * FILTER TODO: Can we assume that the inner processing
11036|       |		    *  will result in an ordered list if we have an
11037|       |		    *  XPATH_OP_FILTER?
11038|       |		    *  What about an additional field or flag on
11039|       |		    *  xmlXPathObject like @sorted ? This way we wouldn't need
11040|       |		    *  to assume anything, so it would be more robust and
11041|       |		    *  easier to optimize.
11042|       |		    */
11043|  25.2k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 14.1k, False: 11.0k]
  ------------------
11044|  11.0k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 10.9k, False: 133]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  25.0k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 17.5k, False: 7.52k]
  ------------------
11049|  17.5k|                    xmlXPathObjectPtr val;
11050|       |
11051|  17.5k|                    val = comp->steps[op->ch2].value4;
11052|  17.5k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 17.5k, False: 0]
  |  Branch (11052:42): [True: 17.5k, False: 10]
  ------------------
11053|  17.5k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 12.0k, False: 5.53k]
  ------------------
11054|  12.0k|                        xmlNodePtr first = NULL;
11055|       |
11056|  12.0k|                        total +=
11057|  12.0k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  12.0k|                                                    &comp->steps[op->ch1],
11059|  12.0k|                                                    &first);
11060|  12.0k|			CHECK_ERROR0;
  ------------------
  |  |  236|  12.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 989, False: 11.0k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  11.0k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 11.0k, False: 0]
  ------------------
11066|  11.0k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 10.8k, False: 148]
  ------------------
11067|  10.8k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 10.8k, False: 0]
  ------------------
11068|  10.8k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 658, False: 10.2k]
  ------------------
11069|    658|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    658|                                                        1, 1);
11071|  11.0k|                        break;
11072|  12.0k|                    }
11073|  17.5k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  13.1k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 13.1k, False: 0]
  |  Branch (11077:40): [True: 13.1k, False: 0]
  ------------------
11078|  13.1k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 7.64k, False: 5.55k]
  ------------------
11079|  7.64k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 7.11k, False: 526]
  ------------------
11080|  7.11k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  7.11k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 7.11k, False: 0]
  ------------------
11083|  7.11k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.64k, False: 4.46k]
  ------------------
11084|  2.64k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 2.42k, False: 220]
  ------------------
11085|  2.42k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 2.12k, False: 298]
  ------------------
11086|  2.12k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 2.12k, False: 0]
  ------------------
11087|  2.12k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 2.02k, False: 105]
  ------------------
11088|  2.12k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.12k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  2.02k|                        xmlNodePtr last = NULL;
11090|       |
11091|  2.02k|                        total +=
11092|  2.02k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  2.02k|                                                   &comp->steps[op->ch1],
11094|  2.02k|                                                   &last);
11095|  2.02k|			CHECK_ERROR0;
  ------------------
  |  |  236|  2.02k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 42, False: 1.98k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.98k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.98k, False: 0]
  ------------------
11101|  1.98k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.92k, False: 55]
  ------------------
11102|  1.92k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.92k, False: 0]
  ------------------
11103|  1.92k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.64k, False: 285]
  ------------------
11104|  1.64k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 607, False: 1.03k]
  ------------------
11105|    607|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.98k|                        break;
11107|  2.02k|                    }
11108|  7.11k|                }
11109|       |		/*
11110|       |		* Process inner predicates first.
11111|       |		* Example "index[parent::book][1]":
11112|       |		* ...
11113|       |		*   PREDICATE   <-- we are here "[1]"
11114|       |		*     PREDICATE <-- process "[parent::book]" first
11115|       |		*       SORT
11116|       |		*         COLLECT  'parent' 'name' 'node' book
11117|       |		*           NODE
11118|       |		*     ELEM Object is a number : 1
11119|       |		*/
11120|  11.1k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 11.1k, False: 0]
  ------------------
11121|  11.1k|                    total +=
11122|  11.1k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  11.1k|		CHECK_ERROR0;
  ------------------
  |  |  236|  11.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 352, False: 10.8k]
  |  |  ------------------
  ------------------
11124|  10.8k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 10.8k]
  ------------------
11125|      0|                    break;
11126|  10.8k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 10.8k]
  ------------------
11127|      0|                    break;
11128|       |
11129|       |                /*
11130|       |                 * In case of errors, xmlXPathNodeSetFilter can pop additional
11131|       |                 * nodes from the stack. We have to temporarily remove the
11132|       |                 * nodeset object from the stack to avoid freeing it
11133|       |                 * prematurely.
11134|       |                 */
11135|  10.8k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  10.8k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 10.8k]
  |  |  |  Branch (271:34): [True: 51, False: 10.7k]
  |  |  ------------------
  |  |  272|  10.8k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     51|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  10.7k|                obj = xmlXPathValuePop(ctxt);
11137|  10.7k|                set = obj->nodesetval;
11138|  10.7k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 10.7k, False: 0]
  ------------------
11139|  10.7k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  10.7k|                                          1, set->nodeNr, 1);
11141|  10.7k|                xmlXPathValuePush(ctxt, obj);
11142|  10.7k|                break;
11143|  10.8k|            }
11144|   101k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 101k, False: 3.80M]
  ------------------
11145|   101k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 101k, False: 0]
  ------------------
11146|   101k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|   101k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   101k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.40k, False: 97.5k]
  |  |  ------------------
  ------------------
11148|  97.5k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 97.5k, False: 0]
  ------------------
11149|  97.5k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 53.7k, False: 43.8k]
  ------------------
11150|  53.7k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 53.7k, False: 0]
  ------------------
11151|  53.7k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 5.72k, False: 47.9k]
  ------------------
11152|  5.72k|	    {
11153|  5.72k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  5.72k|	    }
11155|  97.5k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.90M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.90M|    }
11160|       |
11161|  3.86M|    ctxt->context->depth -= 1;
11162|  3.86M|    return (total);
11163|  3.90M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  23.4k|{
10407|  23.4k|    int total = 0, cur;
10408|  23.4k|    xmlXPathCompExprPtr comp;
10409|  23.4k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  23.4k|    CHECK_ERROR0;
  ------------------
  |  |  236|  23.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 23.4k]
  |  |  ------------------
  ------------------
10412|  23.4k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  23.4k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 23.4k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 23.4k]
  |  |  ------------------
  ------------------
10413|      1|        return(0);
10414|  23.4k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  23.4k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 2, False: 23.4k]
  ------------------
10415|  23.4k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  23.4k|    ctxt->context->depth += 1;
10417|  23.4k|    comp = ctxt->comp;
10418|  23.4k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 23.4k]
  ------------------
10420|      0|            break;
10421|  2.57k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.57k, False: 20.8k]
  ------------------
10422|  2.57k|            total =
10423|  2.57k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.57k|                                        first);
10425|  2.57k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.57k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 236, False: 2.34k]
  |  |  ------------------
  ------------------
10426|  2.34k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 2.34k, False: 0]
  ------------------
10427|  2.34k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 2.31k, False: 22]
  ------------------
10428|  2.31k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 2.31k, False: 0]
  ------------------
10429|  2.31k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 1.42k, False: 891]
  ------------------
10430|       |                /*
10431|       |                 * limit tree traversing to first node in the result
10432|       |                 */
10433|       |		/*
10434|       |		* OPTIMIZE TODO: This implicitly sorts
10435|       |		*  the result, even if not needed. E.g. if the argument
10436|       |		*  of the count() function, no sorting is needed.
10437|       |		* OPTIMIZE TODO: How do we know if the node-list wasn't
10438|       |		*  already sorted?
10439|       |		*/
10440|  1.42k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 284, False: 1.14k]
  ------------------
10441|    284|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.42k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.42k|            }
10444|  2.34k|            cur =
10445|  2.34k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  2.34k|                                        first);
10447|  2.34k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.34k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 40, False: 2.30k]
  |  |  ------------------
  ------------------
10448|       |
10449|  2.30k|            arg2 = xmlXPathValuePop(ctxt);
10450|  2.30k|            arg1 = xmlXPathValuePop(ctxt);
10451|  2.30k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 2.30k]
  |  Branch (10451:35): [True: 13, False: 2.28k]
  ------------------
10452|  2.28k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 2.28k]
  |  Branch (10452:35): [True: 3, False: 2.28k]
  ------------------
10453|     16|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|     16|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|     16|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     16|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.28k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.28k, False: 0]
  ------------------
10458|  2.28k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.28k, False: 0]
  ------------------
10459|  2.28k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.28k]
  ------------------
10460|  2.28k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.28k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.28k, False: 0]
  ------------------
10462|  2.28k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.28k]
  ------------------
10463|  2.28k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.28k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.28k, False: 0]
  ------------------
10470|  2.28k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 324, False: 1.96k]
  ------------------
10471|    324|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    324|                                                        arg2->nodesetval);
10473|    324|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 1, False: 323]
  ------------------
10474|      1|                    xmlXPathPErrMemory(ctxt);
10475|    324|            }
10476|  2.28k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.28k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.28k|            total += cur;
10479|  2.28k|            break;
10480|    315|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 315, False: 23.1k]
  ------------------
10481|    315|            xmlXPathRoot(ctxt);
10482|    315|            break;
10483|    283|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 283, False: 23.1k]
  ------------------
10484|    283|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 283]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|    283|	    CHECK_ERROR0;
  ------------------
  |  |  236|    283|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 283]
  |  |  ------------------
  ------------------
10487|    283|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 283]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|    283|	    CHECK_ERROR0;
  ------------------
  |  |  236|    283|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 283]
  |  |  ------------------
  ------------------
10490|    283|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|    283|		ctxt->context->node));
10492|    283|            break;
10493|  8.13k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 8.13k, False: 15.3k]
  ------------------
10494|  8.13k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 8.13k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  8.13k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  8.13k|		CHECK_ERROR0;
  ------------------
  |  |  236|  8.13k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 10, False: 8.12k]
  |  |  ------------------
  ------------------
10499|       |
10500|  8.12k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  8.12k|                break;
10502|  8.13k|            }
10503|     28|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 28, False: 23.4k]
  ------------------
10504|     28|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|     28|            break;
10506|  6.54k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 6.54k, False: 16.9k]
  ------------------
10507|  6.54k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 6.54k, False: 0]
  ------------------
10508|  6.54k|                total +=
10509|  6.54k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  6.54k|                                            first);
10511|  6.54k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  6.54k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 70, False: 6.47k]
  |  |  ------------------
  ------------------
10512|  6.47k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 6.47k, False: 0]
  ------------------
10513|  6.47k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 6.39k, False: 73]
  ------------------
10514|  6.39k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 6.39k, False: 0]
  ------------------
10515|  6.39k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 660, False: 5.73k]
  ------------------
10516|    660|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  6.47k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  5.52k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 5.52k, False: 17.9k]
  ------------------
10520|  5.52k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  5.52k|            break;
10522|      0|#endif
10523|     75|        default:
  ------------------
  |  Branch (10523:9): [True: 75, False: 23.3k]
  ------------------
10524|     75|            total += xmlXPathCompOpEval(ctxt, op);
10525|     75|            break;
10526|  23.4k|    }
10527|       |
10528|  23.0k|    ctxt->context->depth -= 1;
10529|  23.0k|    return(total);
10530|  23.4k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  5.52k|{
10669|  5.52k|    int total = 0;
10670|  5.52k|    xmlXPathCompExprPtr comp;
10671|  5.52k|    xmlXPathObjectPtr obj;
10672|  5.52k|    xmlNodeSetPtr set;
10673|       |
10674|  5.52k|    CHECK_ERROR0;
  ------------------
  |  |  236|  5.52k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 5.52k]
  |  |  ------------------
  ------------------
10675|  5.52k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  5.52k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 5.52k, False: 0]
  |  Branch (10679:28): [True: 5.52k, False: 0]
  ------------------
10680|  5.52k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 4.30k, False: 1.21k]
  ------------------
10681|  4.30k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 1.41k, False: 2.89k]
  ------------------
10682|  1.41k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  1.41k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 1.41k, False: 0]
  ------------------
10685|  1.41k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 1.12k, False: 284]
  ------------------
10686|  1.12k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 1.05k, False: 68]
  ------------------
10687|  1.05k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 839, False: 219]
  ------------------
10688|    839|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 839, False: 0]
  ------------------
10689|    839|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 772, False: 67]
  ------------------
10690|    839|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|    839|#define BAD_CAST (xmlChar *)
  ------------------
10691|    772|	    xmlNodePtr last = NULL;
10692|       |
10693|    772|	    total +=
10694|    772|		xmlXPathCompOpEvalLast(ctxt,
10695|    772|		    &comp->steps[op->ch1],
10696|    772|		    &last);
10697|    772|	    CHECK_ERROR0;
  ------------------
  |  |  236|    772|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4, False: 768]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|    768|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 768, False: 0]
  ------------------
10703|    768|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 693, False: 75]
  ------------------
10704|    693|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 693, False: 0]
  ------------------
10705|    693|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 614, False: 79]
  ------------------
10706|    614|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 297, False: 317]
  ------------------
10707|    297|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    297|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    297|	    }
10710|    768|	    return (total);
10711|    772|	}
10712|  1.41k|    }
10713|       |
10714|  4.74k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 4.74k, False: 0]
  ------------------
10715|  4.74k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  4.74k|    CHECK_ERROR0;
  ------------------
  |  |  236|  4.74k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 917, False: 3.83k]
  |  |  ------------------
  ------------------
10717|  3.83k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 3.83k]
  ------------------
10718|      0|	return (total);
10719|  3.83k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 3.83k]
  ------------------
10720|      0|	return (total);
10721|       |
10722|       |    /*
10723|       |     * In case of errors, xmlXPathNodeSetFilter can pop additional nodes from
10724|       |     * the stack. We have to temporarily remove the nodeset object from the
10725|       |     * stack to avoid freeing it prematurely.
10726|       |     */
10727|  3.83k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  3.83k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 3.83k]
  |  |  |  Branch (271:34): [True: 21, False: 3.81k]
  |  |  ------------------
  |  |  272|  3.83k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     21|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  3.81k|    obj = xmlXPathValuePop(ctxt);
10729|  3.81k|    set = obj->nodesetval;
10730|  3.81k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 3.81k, False: 0]
  ------------------
10731|  3.81k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  3.81k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 1.19k, False: 2.62k]
  ------------------
10733|  1.19k|            *first = set->nodeTab[0];
10734|  3.81k|    }
10735|  3.81k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  3.81k|    return (total);
10738|  3.83k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  27.6k|{
10545|  27.6k|    int total = 0, cur;
10546|  27.6k|    xmlXPathCompExprPtr comp;
10547|  27.6k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  27.6k|    CHECK_ERROR0;
  ------------------
  |  |  236|  27.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 27.6k]
  |  |  ------------------
  ------------------
10550|  27.6k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  27.6k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 27.6k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 27.6k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  27.6k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  27.6k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 27.6k]
  ------------------
10553|  27.6k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  27.6k|    ctxt->context->depth += 1;
10555|  27.6k|    comp = ctxt->comp;
10556|  27.6k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 27.6k]
  ------------------
10558|      0|            break;
10559|  11.0k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 11.0k, False: 16.5k]
  ------------------
10560|  11.0k|            total =
10561|  11.0k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  11.0k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  11.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 123, False: 10.9k]
  |  |  ------------------
  ------------------
10563|  10.9k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 10.9k, False: 0]
  ------------------
10564|  10.9k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 10.9k, False: 1]
  ------------------
10565|  10.9k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 10.9k, False: 0]
  ------------------
10566|  10.9k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 8.74k, False: 2.19k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  8.74k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 2.81k, False: 5.93k]
  ------------------
10571|  2.81k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  8.74k|                *last =
10573|  8.74k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  8.74k|                                                     nodesetval->nodeNr -
10575|  8.74k|                                                     1];
10576|  8.74k|            }
10577|  10.9k|            cur =
10578|  10.9k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  10.9k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  10.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 27, False: 10.9k]
  |  |  ------------------
  ------------------
10580|  10.9k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 10.9k, False: 0]
  ------------------
10581|  10.9k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 10.9k, False: 2]
  ------------------
10582|  10.9k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 10.9k, False: 0]
  ------------------
10583|  10.9k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 2.72k, False: 8.19k]
  ------------------
10584|  2.72k|            }
10585|       |
10586|  10.9k|            arg2 = xmlXPathValuePop(ctxt);
10587|  10.9k|            arg1 = xmlXPathValuePop(ctxt);
10588|  10.9k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 10.9k]
  |  Branch (10588:35): [True: 1, False: 10.9k]
  ------------------
10589|  10.9k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 10.9k]
  |  Branch (10589:35): [True: 1, False: 10.9k]
  ------------------
10590|      2|	        xmlXPathReleaseObject(ctxt->context, arg1);
10591|      2|	        xmlXPathReleaseObject(ctxt->context, arg2);
10592|      2|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      2|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10593|      0|            }
10594|  10.9k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 10.9k, False: 0]
  ------------------
10595|  10.9k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 10.9k, False: 0]
  ------------------
10596|  10.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 10.9k]
  ------------------
10597|  10.9k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  10.9k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 10.9k, False: 0]
  ------------------
10599|  10.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 10.9k]
  ------------------
10600|  10.9k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  10.9k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 10.9k, False: 0]
  ------------------
10607|  10.9k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 2.72k, False: 8.19k]
  ------------------
10608|  2.72k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  2.72k|                                                        arg2->nodesetval);
10610|  2.72k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 1, False: 2.72k]
  ------------------
10611|      1|                    xmlXPathPErrMemory(ctxt);
10612|  2.72k|            }
10613|  10.9k|            xmlXPathValuePush(ctxt, arg1);
10614|  10.9k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  10.9k|            total += cur;
10616|  10.9k|            break;
10617|  1.53k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 1.53k, False: 26.0k]
  ------------------
10618|  1.53k|            xmlXPathRoot(ctxt);
10619|  1.53k|            break;
10620|  1.19k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 1.19k, False: 26.4k]
  ------------------
10621|  1.19k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 1.19k]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|  1.19k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.19k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.19k]
  |  |  ------------------
  ------------------
10624|  1.19k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 1.19k]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|  1.19k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.19k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.19k]
  |  |  ------------------
  ------------------
10627|  1.19k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|  1.19k|		ctxt->context->node));
10629|  1.19k|            break;
10630|  10.8k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 10.8k, False: 16.7k]
  ------------------
10631|  10.8k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 10.8k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  10.8k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  10.8k|		CHECK_ERROR0;
  ------------------
  |  |  236|  10.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 17, False: 10.8k]
  |  |  ------------------
  ------------------
10636|       |
10637|  10.8k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  10.8k|                break;
10639|  10.8k|            }
10640|      3|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 3, False: 27.6k]
  ------------------
10641|      3|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      3|            break;
10643|  2.80k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 2.80k, False: 24.8k]
  ------------------
10644|  2.80k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 2.80k, False: 0]
  ------------------
10645|  2.80k|                total +=
10646|  2.80k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  2.80k|                                           last);
10648|  2.80k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.80k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 47, False: 2.75k]
  |  |  ------------------
  ------------------
10649|  2.75k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 2.75k, False: 0]
  ------------------
10650|  2.75k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 2.62k, False: 130]
  ------------------
10651|  2.62k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 2.62k, False: 0]
  ------------------
10652|  2.62k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 905, False: 1.71k]
  ------------------
10653|    905|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  2.75k|            break;
10655|    133|        default:
  ------------------
  |  Branch (10655:9): [True: 133, False: 27.4k]
  ------------------
10656|    133|            total += xmlXPathCompOpEval(ctxt, op);
10657|    133|            break;
10658|  27.6k|    }
10659|       |
10660|  27.3k|    ctxt->context->depth -= 1;
10661|  27.3k|    return (total);
10662|  27.6k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|    904|{
 3168|    904|    int i;
 3169|    904|    xmlNodePtr node;
 3170|       |
 3171|    904|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 904]
  |  Branch (3171:26): [True: 0, False: 904]
  ------------------
 3172|      0|	return;
 3173|  4.92k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 4.02k, False: 904]
  ------------------
 3174|  4.02k|        node = set->nodeTab[i];
 3175|  4.02k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 4.02k, False: 0]
  ------------------
 3176|  4.02k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 4.02k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  4.02k|    }
 3179|    904|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|    904|    set->nodeNr = 1;
 3181|    904|}

xmlXPtrEval:
  607|  12.8k|xmlXPtrEval(const xmlChar *str, xmlXPathContext *ctx) {
  608|  12.8k|    xmlXPathParserContextPtr ctxt;
  609|  12.8k|    xmlXPathObjectPtr res = NULL, tmp;
  610|  12.8k|    xmlXPathObjectPtr init = NULL;
  611|  12.8k|    int stack = 0;
  612|       |
  613|  12.8k|    xmlInitParser();
  614|       |
  615|  12.8k|    if ((ctx == NULL) || (str == NULL))
  ------------------
  |  Branch (615:9): [True: 0, False: 12.8k]
  |  Branch (615:26): [True: 0, False: 12.8k]
  ------------------
  616|      0|	return(NULL);
  617|       |
  618|  12.8k|    xmlResetError(&ctx->lastError);
  619|       |
  620|  12.8k|    ctxt = xmlXPathNewParserContext(str, ctx);
  621|  12.8k|    if (ctxt == NULL) {
  ------------------
  |  Branch (621:9): [True: 102, False: 12.7k]
  ------------------
  622|    102|        xmlXPathErrMemory(ctx);
  623|    102|	return(NULL);
  624|    102|    }
  625|  12.7k|    xmlXPtrEvalXPointer(ctxt);
  626|  12.7k|    if (ctx->lastError.code != XML_ERR_OK)
  ------------------
  |  Branch (626:9): [True: 8.33k, False: 4.44k]
  ------------------
  627|  8.33k|        goto error;
  628|       |
  629|  4.44k|    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (629:9): [True: 1.44k, False: 3.00k]
  ------------------
  630|  1.44k|	(ctxt->value->type != XPATH_NODESET)) {
  ------------------
  |  Branch (630:2): [True: 0, False: 1.44k]
  ------------------
  631|      0|        xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
  632|      0|		"xmlXPtrEval: evaluation failed to return a node set\n",
  633|      0|		   NULL);
  634|  4.44k|    } else {
  635|  4.44k|	res = xmlXPathValuePop(ctxt);
  636|  4.44k|    }
  637|       |
  638|  4.44k|    do {
  639|  4.44k|        tmp = xmlXPathValuePop(ctxt);
  640|  4.44k|	if (tmp != NULL) {
  ------------------
  |  Branch (640:6): [True: 0, False: 4.44k]
  ------------------
  641|      0|	    if (tmp != init) {
  ------------------
  |  Branch (641:10): [True: 0, False: 0]
  ------------------
  642|      0|		if (tmp->type == XPATH_NODESET) {
  ------------------
  |  Branch (642:7): [True: 0, False: 0]
  ------------------
  643|       |		    /*
  644|       |		     * Evaluation may push a root nodeset which is unused
  645|       |		     */
  646|      0|		    xmlNodeSetPtr set;
  647|      0|		    set = tmp->nodesetval;
  648|      0|		    if ((set == NULL) || (set->nodeNr != 1) ||
  ------------------
  |  Branch (648:11): [True: 0, False: 0]
  |  Branch (648:28): [True: 0, False: 0]
  ------------------
  649|      0|			(set->nodeTab[0] != (xmlNodePtr) ctx->doc))
  ------------------
  |  Branch (649:4): [True: 0, False: 0]
  ------------------
  650|      0|			stack++;
  651|      0|		} else
  652|      0|		    stack++;
  653|      0|	    }
  654|      0|	    xmlXPathFreeObject(tmp);
  655|      0|        }
  656|  4.44k|    } while (tmp != NULL);
  ------------------
  |  Branch (656:14): [True: 0, False: 4.44k]
  ------------------
  657|  4.44k|    if (stack != 0) {
  ------------------
  |  Branch (657:9): [True: 0, False: 4.44k]
  ------------------
  658|      0|        xmlXPtrErr(ctxt, XML_XPTR_EXTRA_OBJECTS,
  659|      0|		   "xmlXPtrEval: object(s) left on the eval stack\n",
  660|      0|		   NULL);
  661|      0|    }
  662|  4.44k|    if (ctx->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (662:9): [True: 0, False: 4.44k]
  ------------------
  663|      0|	xmlXPathFreeObject(res);
  664|      0|	res = NULL;
  665|      0|    }
  666|       |
  667|  12.7k|error:
  668|  12.7k|    xmlXPathFreeParserContext(ctxt);
  669|  12.7k|    return(res);
  670|  4.44k|}
xpointer.c:xmlXPtrEvalXPointer:
  528|  12.7k|xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
  529|  12.7k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (529:9): [True: 12.7k, False: 0]
  ------------------
  530|       |	/* Allocate the value stack */
  531|  12.7k|	ctxt->valueTab = (xmlXPathObjectPtr *)
  532|  12.7k|			 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
  533|  12.7k|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (533:6): [True: 35, False: 12.7k]
  ------------------
  534|     35|	    xmlXPathPErrMemory(ctxt);
  535|     35|	    return;
  536|     35|	}
  537|  12.7k|	ctxt->valueNr = 0;
  538|  12.7k|	ctxt->valueMax = 10;
  539|  12.7k|	ctxt->value = NULL;
  540|  12.7k|    }
  541|  12.7k|    SKIP_BLANKS;
  ------------------
  |  |  178|  12.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  15.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.62k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  12.7k|    if (CUR == '/') {
  ------------------
  |  |  173|  12.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (542:9): [True: 193, False: 12.5k]
  ------------------
  543|    193|	xmlXPathRoot(ctxt);
  544|    193|        xmlXPtrEvalChildSeq(ctxt, NULL);
  545|  12.5k|    } else {
  546|  12.5k|	xmlChar *name;
  547|       |
  548|  12.5k|	name = xmlXPathParseName(ctxt);
  549|  12.5k|	if (name == NULL)
  ------------------
  |  Branch (549:6): [True: 219, False: 12.3k]
  ------------------
  550|  12.3k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    219|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  551|  12.3k|	if (CUR == '(') {
  ------------------
  |  |  173|  12.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (551:6): [True: 11.8k, False: 479]
  ------------------
  552|  11.8k|	    xmlXPtrEvalFullXPtr(ctxt, name);
  553|       |	    /* Short evaluation */
  554|  11.8k|	    return;
  555|  11.8k|	} else {
  556|       |	    /* this handle both Bare Names and Child Sequences */
  557|    479|	    xmlXPtrEvalChildSeq(ctxt, name);
  558|    479|	}
  559|  12.3k|    }
  560|    672|    SKIP_BLANKS;
  ------------------
  |  |  178|  1.47k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  14.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 1.47k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  561|    672|    if (CUR != 0)
  ------------------
  |  |  173|    672|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (561:9): [True: 368, False: 304]
  ------------------
  562|    368|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    368|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  563|    304|}
xpointer.c:xmlXPtrEvalChildSeq:
  478|    709|xmlXPtrEvalChildSeq(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  479|       |    /*
  480|       |     * XPointer don't allow by syntax to address in multirooted trees
  481|       |     * this might prove useful in some cases, warn about it.
  482|       |     */
  483|    709|    if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  173|    196|#define CUR (*ctxt->cur)
  ------------------
                  if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  175|    196|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (483:9): [True: 196, False: 513]
  |  Branch (483:27): [True: 196, False: 0]
  |  Branch (483:43): [True: 83, False: 113]
  ------------------
  484|     83|        xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
  485|     83|		   "warning: ChildSeq not starting by /1\n", NULL);
  486|     83|    }
  487|       |
  488|    709|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 513, False: 196]
  ------------------
  489|    513|	xmlXPathValuePush(ctxt, xmlXPathNewString(name));
  490|    513|	xmlFree(name);
  491|    513|	xmlXPathIdFunction(ctxt, 1);
  492|    513|	CHECK_ERROR;
  ------------------
  |  |  230|    513|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 18, False: 495]
  |  |  ------------------
  ------------------
  493|    513|    }
  494|       |
  495|  2.15k|    while (CUR == '/') {
  ------------------
  |  |  173|  2.15k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (495:12): [True: 1.46k, False: 691]
  ------------------
  496|  1.46k|	int child = 0, overflow = 0;
  497|  1.46k|	NEXT;
  ------------------
  |  |  181|  1.46k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 1.46k, False: 0]
  |  |  ------------------
  ------------------
  498|       |
  499|  5.11k|	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  5.11k|#define CUR (*ctxt->cur)
  ------------------
              	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  3.87k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (499:9): [True: 3.87k, False: 1.24k]
  |  Branch (499:25): [True: 3.65k, False: 213]
  ------------------
  500|  3.65k|            int d = CUR - '0';
  ------------------
  |  |  173|  3.65k|#define CUR (*ctxt->cur)
  ------------------
  501|  3.65k|            if (child > INT_MAX / 10)
  ------------------
  |  Branch (501:17): [True: 1.11k, False: 2.54k]
  ------------------
  502|  1.11k|                overflow = 1;
  503|  2.54k|            else
  504|  2.54k|                child *= 10;
  505|  3.65k|            if (child > INT_MAX - d)
  ------------------
  |  Branch (505:17): [True: 312, False: 3.34k]
  ------------------
  506|    312|                overflow = 1;
  507|  3.34k|            else
  508|  3.34k|                child += d;
  509|  3.65k|	    NEXT;
  ------------------
  |  |  181|  3.65k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 3.65k, False: 0]
  |  |  ------------------
  ------------------
  510|  3.65k|	}
  511|  1.46k|        if (overflow)
  ------------------
  |  Branch (511:13): [True: 84, False: 1.37k]
  ------------------
  512|     84|            child = 0;
  513|  1.46k|	xmlXPtrGetChildNo(ctxt, child);
  514|  1.46k|    }
  515|    691|}
xpointer.c:xmlXPtrGetChildNo:
  191|  1.46k|xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
  192|  1.46k|    xmlNodePtr cur = NULL;
  193|  1.46k|    xmlXPathObjectPtr obj;
  194|  1.46k|    xmlNodeSetPtr oldset;
  195|       |
  196|  1.46k|    CHECK_TYPE(XPATH_NODESET);
  ------------------
  |  |  261|  1.46k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 290, False: 1.17k]
  |  |  |  Branch (261:34): [True: 0, False: 1.17k]
  |  |  ------------------
  |  |  262|  1.46k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|    290|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
  197|  1.17k|    obj = xmlXPathValuePop(ctxt);
  198|  1.17k|    oldset = obj->nodesetval;
  199|  1.17k|    if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
  ------------------
  |  Branch (199:9): [True: 831, False: 340]
  |  Branch (199:24): [True: 0, False: 340]
  |  Branch (199:44): [True: 125, False: 215]
  ------------------
  200|    956|	xmlXPathFreeObject(obj);
  201|    956|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  202|    956|	return;
  203|    956|    }
  204|    215|    cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
  205|    215|    if (cur == NULL) {
  ------------------
  |  Branch (205:9): [True: 118, False: 97]
  ------------------
  206|    118|	xmlXPathFreeObject(obj);
  207|    118|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  208|    118|	return;
  209|    118|    }
  210|     97|    oldset->nodeTab[0] = cur;
  211|     97|    xmlXPathValuePush(ctxt, obj);
  212|     97|}
xpointer.c:xmlXPtrGetNthChild:
  124|    215|xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
  125|    215|    int i;
  126|    215|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (126:9): [True: 0, False: 215]
  |  Branch (126:26): [True: 0, False: 215]
  ------------------
  127|      0|	return(cur);
  128|    215|    cur = cur->children;
  129|  1.21k|    for (i = 0;i <= no;cur = cur->next) {
  ------------------
  |  Branch (129:16): [True: 1.21k, False: 0]
  ------------------
  130|  1.21k|	if (cur == NULL)
  ------------------
  |  Branch (130:6): [True: 118, False: 1.09k]
  ------------------
  131|    118|	    return(cur);
  132|  1.09k|	if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (132:6): [True: 787, False: 305]
  ------------------
  133|    305|	    (cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (133:6): [True: 0, False: 305]
  ------------------
  134|    787|	    (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (134:6): [True: 0, False: 305]
  ------------------
  135|    787|	    i++;
  136|    787|	    if (i == no)
  ------------------
  |  Branch (136:10): [True: 97, False: 690]
  ------------------
  137|     97|		break;
  138|    787|	}
  139|  1.09k|    }
  140|     97|    return(cur);
  141|    215|}
xpointer.c:xmlXPtrEvalFullXPtr:
  415|  11.8k|xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  416|  11.8k|    if (name == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 11.8k]
  ------------------
  417|      0|    name = xmlXPathParseName(ctxt);
  418|  11.8k|    if (name == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 11.8k]
  ------------------
  419|  11.8k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  420|  24.8k|    while (name != NULL) {
  ------------------
  |  Branch (420:12): [True: 21.5k, False: 3.27k]
  ------------------
  421|  21.5k|	ctxt->error = XPATH_EXPRESSION_OK;
  422|  21.5k|	xmlXPtrEvalXPtrPart(ctxt, name);
  423|       |
  424|       |	/* in case of syntax error, break here */
  425|  21.5k|	if ((ctxt->error != XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (425:6): [True: 7.85k, False: 13.7k]
  ------------------
  426|  7.85k|            (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
  ------------------
  |  Branch (426:13): [True: 7.41k, False: 440]
  ------------------
  427|  7.41k|	    return;
  428|       |
  429|       |	/*
  430|       |	 * If the returned value is a non-empty nodeset
  431|       |	 * or location set, return here.
  432|       |	 */
  433|  14.1k|	if (ctxt->value != NULL) {
  ------------------
  |  Branch (433:6): [True: 10.2k, False: 3.97k]
  ------------------
  434|  10.2k|	    xmlXPathObjectPtr obj = ctxt->value;
  435|       |
  436|  10.2k|	    switch (obj->type) {
  437|  2.28k|		case XPATH_NODESET: {
  ------------------
  |  Branch (437:3): [True: 2.28k, False: 7.92k]
  ------------------
  438|  2.28k|		    xmlNodeSetPtr loc = ctxt->value->nodesetval;
  439|  2.28k|		    if ((loc != NULL) && (loc->nodeNr > 0))
  ------------------
  |  Branch (439:11): [True: 2.28k, False: 0]
  |  Branch (439:28): [True: 1.15k, False: 1.12k]
  ------------------
  440|  1.15k|			return;
  441|  1.12k|		    break;
  442|  2.28k|		}
  443|  7.92k|		default:
  ------------------
  |  Branch (443:3): [True: 7.92k, False: 2.28k]
  ------------------
  444|  7.92k|		    break;
  445|  10.2k|	    }
  446|       |
  447|       |	    /*
  448|       |	     * Evaluating to improper values is equivalent to
  449|       |	     * a sub-resource error, clean-up the stack
  450|       |	     */
  451|  18.0k|	    do {
  452|  18.0k|		obj = xmlXPathValuePop(ctxt);
  453|  18.0k|		if (obj != NULL) {
  ------------------
  |  Branch (453:7): [True: 9.04k, False: 9.04k]
  ------------------
  454|  9.04k|		    xmlXPathFreeObject(obj);
  455|  9.04k|		}
  456|  18.0k|	    } while (obj != NULL);
  ------------------
  |  Branch (456:15): [True: 9.04k, False: 9.04k]
  ------------------
  457|  9.04k|	}
  458|       |
  459|       |	/*
  460|       |	 * Is there another XPointer part.
  461|       |	 */
  462|  13.0k|	SKIP_BLANKS;
  ------------------
  |  |  178|  13.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  22.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 8.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  13.0k|	name = xmlXPathParseName(ctxt);
  464|  13.0k|    }
  465|  11.8k|}
xpointer.c:xmlXPtrEvalXPtrPart:
  248|  21.5k|xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  249|  21.5k|    xmlChar *buffer, *cur;
  250|  21.5k|    int len;
  251|  21.5k|    int level;
  252|       |
  253|  21.5k|    if (name == NULL)
  ------------------
  |  Branch (253:9): [True: 0, False: 21.5k]
  ------------------
  254|      0|    name = xmlXPathParseName(ctxt);
  255|  21.5k|    if (name == NULL)
  ------------------
  |  Branch (255:9): [True: 0, False: 21.5k]
  ------------------
  256|  21.5k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  257|       |
  258|  21.5k|    if (CUR != '(') {
  ------------------
  |  |  173|  21.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (258:9): [True: 1.44k, False: 20.1k]
  ------------------
  259|  1.44k|        xmlFree(name);
  260|  1.44k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  1.44k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  261|      0|    }
  262|  20.1k|    NEXT;
  ------------------
  |  |  181|  20.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 20.1k, False: 0]
  |  |  ------------------
  ------------------
  263|  20.1k|    level = 1;
  264|       |
  265|  20.1k|    len = xmlStrlen(ctxt->cur);
  266|       |    /* Overflow in xmlStrlen */
  267|  20.1k|    if (len == 0 && ctxt->cur != NULL && *ctxt->cur != 0) {
  ------------------
  |  Branch (267:9): [True: 39, False: 20.1k]
  |  Branch (267:21): [True: 39, False: 0]
  |  Branch (267:42): [True: 0, False: 39]
  ------------------
  268|      0|        xmlXPathPErrMemory(ctxt);
  269|      0|        xmlFree(name);
  270|      0|        return;
  271|      0|    }
  272|       |
  273|  20.1k|    len++;
  274|  20.1k|    buffer = xmlMalloc(len);
  275|  20.1k|    if (buffer == NULL) {
  ------------------
  |  Branch (275:9): [True: 36, False: 20.1k]
  ------------------
  276|     36|        xmlXPathPErrMemory(ctxt);
  277|     36|        xmlFree(name);
  278|     36|	return;
  279|     36|    }
  280|       |
  281|  20.1k|    cur = buffer;
  282|  5.52M|    while (CUR != 0) {
  ------------------
  |  |  173|  5.52M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (282:12): [True: 5.52M, False: 211]
  ------------------
  283|  5.52M|	if (CUR == ')') {
  ------------------
  |  |  173|  5.52M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (283:6): [True: 38.0k, False: 5.48M]
  ------------------
  284|  38.0k|	    level--;
  285|  38.0k|	    if (level == 0) {
  ------------------
  |  Branch (285:10): [True: 19.8k, False: 18.1k]
  ------------------
  286|  19.8k|		NEXT;
  ------------------
  |  |  181|  19.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 19.8k, False: 0]
  |  |  ------------------
  ------------------
  287|  19.8k|		break;
  288|  19.8k|	    }
  289|  5.48M|	} else if (CUR == '(') {
  ------------------
  |  |  173|  5.48M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (289:13): [True: 23.0k, False: 5.46M]
  ------------------
  290|  23.0k|	    level++;
  291|  5.46M|	} else if (CUR == '^') {
  ------------------
  |  |  173|  5.46M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (291:13): [True: 4.47k, False: 5.45M]
  ------------------
  292|  4.47k|            if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  4.47k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  4.13k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  3.76k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (292:17): [True: 336, False: 4.13k]
  |  Branch (292:36): [True: 370, False: 3.76k]
  |  Branch (292:55): [True: 3.34k, False: 419]
  ------------------
  293|  4.05k|                NEXT;
  ------------------
  |  |  181|  4.05k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 4.05k, False: 0]
  |  |  ------------------
  ------------------
  294|  4.05k|            }
  295|  4.47k|	}
  296|  5.50M|        *cur++ = CUR;
  ------------------
  |  |  173|  5.50M|#define CUR (*ctxt->cur)
  ------------------
  297|  5.50M|	NEXT;
  ------------------
  |  |  181|  5.50M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 5.50M, False: 0]
  |  |  ------------------
  ------------------
  298|  5.50M|    }
  299|  20.1k|    *cur = 0;
  300|       |
  301|  20.1k|    if ((level != 0) && (CUR == 0)) {
  ------------------
  |  |  173|    211|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (301:9): [True: 211, False: 19.8k]
  |  Branch (301:25): [True: 211, False: 0]
  ------------------
  302|    211|        xmlFree(name);
  303|    211|	xmlFree(buffer);
  304|    211|	XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|    211|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  305|      0|    }
  306|       |
  307|  19.8k|    if (xmlStrEqual(name, (xmlChar *) "xpointer") ||
  ------------------
  |  Branch (307:9): [True: 18.7k, False: 1.10k]
  ------------------
  308|  18.8k|        xmlStrEqual(name, (xmlChar *) "xpath1")) {
  ------------------
  |  Branch (308:9): [True: 16, False: 1.09k]
  ------------------
  309|  18.8k|	const xmlChar *oldBase = ctxt->base;
  310|  18.8k|	const xmlChar *oldCur = ctxt->cur;
  311|       |
  312|  18.8k|	ctxt->cur = ctxt->base = buffer;
  313|       |	/*
  314|       |	 * To evaluate an xpointer scheme element (4.3) we need:
  315|       |	 *   context initialized to the root
  316|       |	 *   context position initialized to 1
  317|       |	 *   context size initialized to 1
  318|       |	 */
  319|  18.8k|	ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
  320|  18.8k|	ctxt->context->proximityPosition = 1;
  321|  18.8k|	ctxt->context->contextSize = 1;
  322|  18.8k|	xmlXPathEvalExpr(ctxt);
  323|  18.8k|	ctxt->base = oldBase;
  324|  18.8k|        ctxt->cur = oldCur;
  325|  18.8k|    } else if (xmlStrEqual(name, (xmlChar *) "element")) {
  ------------------
  |  Branch (325:16): [True: 42, False: 1.04k]
  ------------------
  326|     42|	const xmlChar *oldBase = ctxt->base;
  327|     42|	const xmlChar *oldCur = ctxt->cur;
  328|     42|	xmlChar *name2;
  329|       |
  330|     42|	ctxt->cur = ctxt->base = buffer;
  331|     42|	if (buffer[0] == '/') {
  ------------------
  |  Branch (331:6): [True: 3, False: 39]
  ------------------
  332|      3|	    xmlXPathRoot(ctxt);
  333|      3|	    xmlXPtrEvalChildSeq(ctxt, NULL);
  334|     39|	} else {
  335|     39|	    name2 = xmlXPathParseName(ctxt);
  336|     39|	    if (name2 == NULL) {
  ------------------
  |  Branch (336:10): [True: 5, False: 34]
  ------------------
  337|      5|                ctxt->base = oldBase;
  338|      5|                ctxt->cur = oldCur;
  339|      5|		xmlFree(buffer);
  340|      5|                xmlFree(name);
  341|      5|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  342|      0|	    }
  343|     34|	    xmlXPtrEvalChildSeq(ctxt, name2);
  344|     34|	}
  345|     37|	ctxt->base = oldBase;
  346|     37|        ctxt->cur = oldCur;
  347|     37|#ifdef XPTR_XMLNS_SCHEME
  348|  1.04k|    } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) {
  ------------------
  |  Branch (348:16): [True: 606, False: 442]
  ------------------
  349|    606|	const xmlChar *oldBase = ctxt->base;
  350|    606|	const xmlChar *oldCur = ctxt->cur;
  351|    606|	xmlChar *prefix;
  352|       |
  353|    606|	ctxt->cur = ctxt->base = buffer;
  354|    606|        prefix = xmlXPathParseNCName(ctxt);
  355|    606|	if (prefix == NULL) {
  ------------------
  |  Branch (355:6): [True: 7, False: 599]
  ------------------
  356|      7|            ctxt->base = oldBase;
  357|      7|            ctxt->cur = oldCur;
  358|      7|	    xmlFree(buffer);
  359|      7|	    xmlFree(name);
  360|      7|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  361|      0|	}
  362|    599|	SKIP_BLANKS;
  ------------------
  |  |  178|  7.73k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  8.34k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 7.73k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|    599|	if (CUR != '=') {
  ------------------
  |  |  173|    599|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (363:6): [True: 27, False: 572]
  ------------------
  364|     27|            ctxt->base = oldBase;
  365|     27|            ctxt->cur = oldCur;
  366|     27|	    xmlFree(prefix);
  367|     27|	    xmlFree(buffer);
  368|     27|	    xmlFree(name);
  369|     27|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|     27|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  370|      0|	}
  371|    572|	NEXT;
  ------------------
  |  |  181|    572|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 572, False: 0]
  |  |  ------------------
  ------------------
  372|    572|	SKIP_BLANKS;
  ------------------
  |  |  178|  2.30k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  2.88k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|    572|	if (xmlXPathRegisterNs(ctxt->context, prefix, ctxt->cur) < 0)
  ------------------
  |  Branch (374:6): [True: 6, False: 566]
  ------------------
  375|      6|            xmlXPathPErrMemory(ctxt);
  376|    572|        ctxt->base = oldBase;
  377|    572|        ctxt->cur = oldCur;
  378|    572|	xmlFree(prefix);
  379|    572|#endif /* XPTR_XMLNS_SCHEME */
  380|    572|    } else {
  381|    442|        xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
  382|    442|		   "unsupported scheme '%s'\n", name);
  383|    442|    }
  384|  19.8k|    xmlFree(buffer);
  385|  19.8k|    xmlFree(name);
  386|  19.8k|}
xpointer.c:xmlXPtrErr:
   67|    525|{
   68|    525|    xmlStructuredErrorFunc serror = NULL;
   69|    525|    void *data = NULL;
   70|    525|    xmlNodePtr node = NULL;
   71|    525|    int res;
   72|       |
   73|    525|    if (ctxt == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 525]
  ------------------
   74|      0|        return;
   75|       |    /* Only report the first error */
   76|    525|    if (ctxt->error != 0)
  ------------------
  |  Branch (76:9): [True: 3, False: 522]
  ------------------
   77|      3|        return;
   78|       |
   79|    522|    ctxt->error = code;
   80|       |
   81|    522|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (81:9): [True: 522, False: 0]
  ------------------
   82|    522|        xmlErrorPtr err = &ctxt->context->lastError;
   83|       |
   84|       |        /* cleanup current last error */
   85|    522|        xmlResetError(err);
   86|       |
   87|    522|        err->domain = XML_FROM_XPOINTER;
   88|    522|        err->code = code;
   89|    522|        err->level = XML_ERR_ERROR;
   90|    522|        err->str1 = (char *) xmlStrdup(ctxt->base);
   91|    522|        if (err->str1 == NULL) {
  ------------------
  |  Branch (91:13): [True: 2, False: 520]
  ------------------
   92|      2|            xmlXPathPErrMemory(ctxt);
   93|      2|            return;
   94|      2|        }
   95|    520|        err->int1 = ctxt->cur - ctxt->base;
   96|    520|        err->node = ctxt->context->debugNode;
   97|       |
   98|    520|        serror = ctxt->context->error;
   99|    520|        data = ctxt->context->userData;
  100|    520|        node = ctxt->context->debugNode;
  101|    520|    }
  102|       |
  103|    520|    res = xmlRaiseError(serror, NULL, data, NULL, node,
  104|    520|                        XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0,
  105|    520|                        (const char *) extra, (const char *) ctxt->base,
  106|    520|                        NULL, ctxt->cur - ctxt->base, 0,
  107|    520|                        msg, extra);
  108|    520|    if (res < 0)
  ------------------
  |  Branch (108:9): [True: 2, False: 518]
  ------------------
  109|      2|        xmlXPathPErrMemory(ctxt);
  110|    520|}

