htmlIsBooleanAttr:
  362|  14.5k|{
  363|  14.5k|    const char *str = NULL;
  364|       |
  365|  14.5k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 14.5k]
  ------------------
  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|  14.5k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 9.51k, False: 5.01k]
  ------------------
  389|  2.48k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.48k, False: 12.0k]
  ------------------
  390|  2.48k|            name += 1;
  391|  2.48k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 329, False: 2.15k]
  ------------------
  392|     91|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 91, False: 2.39k]
  ------------------
  393|    238|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 238, False: 2.24k]
  ------------------
  394|  2.48k|            }
  395|  2.48k|            break;
  396|  2.96k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 2.96k, False: 11.5k]
  ------------------
  397|  2.96k|            name += 1;
  398|  2.96k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 764, False: 2.20k]
  ------------------
  399|    537|                case 'e':
  ------------------
  |  Branch (399:17): [True: 537, False: 2.42k]
  ------------------
  400|    537|                    name += 1;
  401|    537|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 275, False: 262]
  ------------------
  402|     73|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 73, False: 464]
  ------------------
  403|    202|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 202, False: 335]
  ------------------
  404|    537|                    }
  405|    537|                    break;
  406|    537|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 227, False: 2.73k]
  ------------------
  407|  2.96k|            }
  408|  2.96k|            break;
  409|  2.96k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 613, False: 13.9k]
  ------------------
  410|    613|            str = "smap";
  411|    613|            break;
  412|    240|        case 'm':
  ------------------
  |  Branch (412:9): [True: 240, False: 14.2k]
  ------------------
  413|    240|            str = "ultiple";
  414|    240|            break;
  415|  2.65k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.65k, False: 11.8k]
  ------------------
  416|  2.65k|            name += 1;
  417|  2.65k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.27k, False: 1.37k]
  ------------------
  418|  1.27k|                break;
  419|  1.37k|            name += 1;
  420|  1.37k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.14k, False: 233]
  ------------------
  421|    203|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 203, False: 1.17k]
  ------------------
  422|    664|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 664, False: 712]
  ------------------
  423|     77|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 77, False: 1.29k]
  ------------------
  424|    199|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 199, False: 1.17k]
  ------------------
  425|  1.37k|            }
  426|  1.37k|            break;
  427|  1.37k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 288, False: 14.2k]
  ------------------
  428|    288|            str = "eadonly";
  429|    288|            break;
  430|    270|        case 's':
  ------------------
  |  Branch (430:9): [True: 270, False: 14.2k]
  ------------------
  431|    270|            str = "elected";
  432|    270|            break;
  433|  14.5k|    }
  434|       |
  435|  14.5k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 11.1k, False: 3.38k]
  ------------------
  436|  11.1k|        return(0);
  437|       |
  438|  3.38k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.38k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  14.5k|}

xmlSAX2InternalSubset:
  242|  20.6k|{
  243|  20.6k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  244|  20.6k|    xmlDtdPtr dtd;
  245|  20.6k|    if (ctx == NULL) return;
  ------------------
  |  Branch (245:9): [True: 0, False: 20.6k]
  ------------------
  246|       |
  247|  20.6k|    if (ctxt->myDoc == NULL)
  ------------------
  |  Branch (247:9): [True: 0, False: 20.6k]
  ------------------
  248|      0|	return;
  249|  20.6k|    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
  ------------------
  |  Branch (249:9): [True: 0, False: 20.6k]
  |  Branch (249:25): [True: 0, False: 0]
  ------------------
  250|      0|        return;
  251|  20.6k|    dtd = xmlGetIntSubset(ctxt->myDoc);
  252|  20.6k|    if (dtd != NULL) {
  ------------------
  |  Branch (252:9): [True: 0, False: 20.6k]
  ------------------
  253|      0|	xmlUnlinkNode((xmlNodePtr) dtd);
  254|      0|	xmlFreeDtd(dtd);
  255|      0|	ctxt->myDoc->intSubset = NULL;
  256|      0|    }
  257|  20.6k|    ctxt->myDoc->intSubset =
  258|  20.6k|	xmlCreateIntSubset(ctxt->myDoc, name, publicId, systemId);
  259|  20.6k|    if (ctxt->myDoc->intSubset == NULL)
  ------------------
  |  Branch (259:9): [True: 12, False: 20.6k]
  ------------------
  260|     12|        xmlSAX2ErrMemory(ctxt);
  261|  20.6k|}
xmlSAX2ExternalSubset:
  274|  18.1k|{
  275|  18.1k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  276|  18.1k|    if (ctx == NULL) return;
  ------------------
  |  Branch (276:9): [True: 0, False: 18.1k]
  ------------------
  277|  18.1k|    if ((systemId != NULL) &&
  ------------------
  |  Branch (277:9): [True: 3.09k, False: 15.0k]
  ------------------
  278|  3.09k|        ((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (278:9): [True: 2.81k, False: 277]
  ------------------
  279|  2.81k|        (((ctxt->validate) || (ctxt->loadsubset & ~XML_SKIP_IDS)) &&
  ------------------
  |  |  210|    983|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (279:11): [True: 1.83k, False: 983]
  |  Branch (279:31): [True: 794, False: 189]
  ------------------
  280|  2.62k|	 (ctxt->wellFormed && ctxt->myDoc))) {
  ------------------
  |  Branch (280:4): [True: 2.56k, False: 61]
  |  Branch (280:24): [True: 2.56k, False: 0]
  ------------------
  281|       |	/*
  282|       |	 * Try to fetch and parse the external subset.
  283|       |	 */
  284|  2.56k|	xmlParserInputPtr oldinput;
  285|  2.56k|	int oldinputNr;
  286|  2.56k|	int oldinputMax;
  287|  2.56k|	xmlParserInputPtr *oldinputTab;
  288|  2.56k|	xmlParserInputPtr input = NULL;
  289|  2.56k|	xmlChar *oldencoding;
  290|  2.56k|        unsigned long consumed;
  291|  2.56k|        size_t buffered;
  292|  2.56k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  293|  2.56k|        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|  2.56k|	if ((ctxt->sax != NULL) && (ctxt->sax->resolveEntity != NULL))
  ------------------
  |  Branch (301:6): [True: 2.56k, False: 0]
  |  Branch (301:29): [True: 2.56k, False: 0]
  ------------------
  302|  2.56k|	    input = ctxt->sax->resolveEntity(ctxt->userData, publicId,
  303|  2.56k|	                                     systemId);
  304|  2.56k|	if (input == NULL) {
  ------------------
  |  Branch (304:6): [True: 828, False: 1.73k]
  ------------------
  305|    828|	    return;
  306|    828|	}
  307|       |
  308|  1.73k|	if (xmlNewDtd(ctxt->myDoc, name, publicId, systemId) == NULL) {
  ------------------
  |  Branch (308:6): [True: 3, False: 1.73k]
  ------------------
  309|      3|            xmlSAX2ErrMemory(ctxt);
  310|      3|            xmlFreeInputStream(input);
  311|      3|            return;
  312|      3|        }
  313|       |
  314|       |	/*
  315|       |	 * make sure we won't destroy the main document context
  316|       |	 */
  317|  1.73k|	oldinput = ctxt->input;
  318|  1.73k|	oldinputNr = ctxt->inputNr;
  319|  1.73k|	oldinputMax = ctxt->inputMax;
  320|  1.73k|	oldinputTab = ctxt->inputTab;
  321|  1.73k|	oldencoding = ctxt->encoding;
  322|  1.73k|	ctxt->encoding = NULL;
  323|       |
  324|  1.73k|	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
  325|  1.73k|	if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (325:6): [True: 1, False: 1.73k]
  ------------------
  326|      1|	    xmlSAX2ErrMemory(ctxt);
  327|      1|            goto error;
  328|      1|	}
  329|  1.73k|	ctxt->inputNr = 0;
  330|  1.73k|	ctxt->inputMax = inputMax;
  331|  1.73k|	ctxt->input = NULL;
  332|  1.73k|	if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (332:6): [True: 2, False: 1.73k]
  ------------------
  333|      2|            goto error;
  334|       |
  335|  1.73k|	if (input->filename == NULL)
  ------------------
  |  Branch (335:6): [True: 0, False: 1.73k]
  ------------------
  336|      0|	    input->filename = (char *) xmlCanonicPath(systemId);
  337|  1.73k|	input->line = 1;
  338|  1.73k|	input->col = 1;
  339|  1.73k|	input->base = ctxt->input->cur;
  340|  1.73k|	input->cur = ctxt->input->cur;
  341|  1.73k|	input->free = NULL;
  342|       |
  343|       |	/*
  344|       |	 * let's parse that entity knowing it's an external subset.
  345|       |	 */
  346|  1.73k|	xmlParseExternalSubset(ctxt, publicId, systemId);
  347|       |
  348|       |        /*
  349|       |	 * Free up the external entities
  350|       |	 */
  351|       |
  352|  1.80k|	while (ctxt->inputNr > 1)
  ------------------
  |  Branch (352:9): [True: 74, False: 1.73k]
  ------------------
  353|     74|	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
  354|       |
  355|  1.73k|        consumed = ctxt->input->consumed;
  356|  1.73k|        buffered = ctxt->input->cur - ctxt->input->base;
  357|  1.73k|        if (buffered > ULONG_MAX - consumed)
  ------------------
  |  Branch (357:13): [True: 0, False: 1.73k]
  ------------------
  358|      0|            consumed = ULONG_MAX;
  359|  1.73k|        else
  360|  1.73k|            consumed += buffered;
  361|  1.73k|        if (consumed > ULONG_MAX - ctxt->sizeentities)
  ------------------
  |  Branch (361:13): [True: 0, False: 1.73k]
  ------------------
  362|      0|            ctxt->sizeentities = ULONG_MAX;
  363|  1.73k|        else
  364|  1.73k|            ctxt->sizeentities += consumed;
  365|       |
  366|  1.73k|error:
  367|  1.73k|	xmlFreeInputStream(input);
  368|  1.73k|        xmlFree(ctxt->inputTab);
  369|       |
  370|       |	/*
  371|       |	 * Restore the parsing context of the main entity
  372|       |	 */
  373|  1.73k|	ctxt->input = oldinput;
  374|  1.73k|	ctxt->inputNr = oldinputNr;
  375|  1.73k|	ctxt->inputMax = oldinputMax;
  376|  1.73k|	ctxt->inputTab = oldinputTab;
  377|  1.73k|	if (ctxt->encoding != NULL)
  ------------------
  |  Branch (377:6): [True: 70, False: 1.66k]
  ------------------
  378|     70|	    xmlFree(ctxt->encoding);
  379|  1.73k|	ctxt->encoding = oldencoding;
  380|       |	/* ctxt->wellFormed = oldwellFormed; */
  381|  1.73k|    }
  382|  18.1k|}
xmlSAX2ResolveEntity:
  396|  2.56k|{
  397|  2.56k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  398|  2.56k|    xmlParserInputPtr ret = NULL;
  399|  2.56k|    xmlChar *URI = NULL;
  400|       |
  401|  2.56k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (401:9): [True: 0, False: 2.56k]
  ------------------
  402|       |
  403|  2.56k|    if (systemId != NULL) {
  ------------------
  |  Branch (403:9): [True: 2.56k, False: 0]
  ------------------
  404|  2.56k|        const xmlChar *base = NULL;
  405|  2.56k|        int res;
  406|       |
  407|  2.56k|        if (ctxt->input != NULL)
  ------------------
  |  Branch (407:13): [True: 2.56k, False: 0]
  ------------------
  408|  2.56k|            base = BAD_CAST ctxt->input->filename;
  ------------------
  |  |   34|  2.56k|#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|  2.56k|        if (base == NULL)
  ------------------
  |  Branch (414:13): [True: 2.19k, False: 376]
  ------------------
  415|  2.19k|            base = BAD_CAST ctxt->directory;
  ------------------
  |  |   34|  2.19k|#define BAD_CAST (xmlChar *)
  ------------------
  416|       |
  417|  2.56k|        if ((xmlStrlen(systemId) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  2.56k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (417:13): [True: 2, False: 2.56k]
  ------------------
  418|  2.56k|            (xmlStrlen(base) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  2.56k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (418:13): [True: 0, False: 2.56k]
  ------------------
  419|      2|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  420|      2|            return(NULL);
  421|      2|        }
  422|  2.56k|        res = xmlBuildURISafe(systemId, base, &URI);
  423|  2.56k|        if (URI == NULL) {
  ------------------
  |  Branch (423:13): [True: 36, False: 2.52k]
  ------------------
  424|     36|            if (res < 0)
  ------------------
  |  Branch (424:17): [True: 3, False: 33]
  ------------------
  425|      3|                xmlSAX2ErrMemory(ctxt);
  426|     33|            else
  427|     33|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  428|     33|                           "Can't resolve URI: %s\n", systemId);
  429|     36|            return(NULL);
  430|     36|        }
  431|  2.52k|        if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  2.52k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (431:13): [True: 0, False: 2.52k]
  ------------------
  432|      0|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  433|      0|            xmlFree(URI);
  434|      0|            return(NULL);
  435|      0|        }
  436|  2.52k|    }
  437|       |
  438|  2.52k|    ret = xmlLoadResource(ctxt, (const char *) URI,
  439|  2.52k|                          (const char *) publicId, XML_RESOURCE_DTD);
  440|       |
  441|  2.52k|    xmlFree(URI);
  442|  2.52k|    return(ret);
  443|  2.56k|}
xmlSAX2GetEntity:
  454|  3.51M|{
  455|  3.51M|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  456|  3.51M|    xmlEntityPtr ret = NULL;
  457|       |
  458|  3.51M|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (458:9): [True: 0, False: 3.51M]
  ------------------
  459|       |
  460|  3.51M|    if (ctxt->inSubset == 0) {
  ------------------
  |  Branch (460:9): [True: 2.98M, False: 530k]
  ------------------
  461|  2.98M|	ret = xmlGetPredefinedEntity(name);
  462|  2.98M|	if (ret != NULL)
  ------------------
  |  Branch (462:6): [True: 980k, False: 2.00M]
  ------------------
  463|   980k|	    return(ret);
  464|  2.98M|    }
  465|  2.53M|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->standalone == 1)) {
  ------------------
  |  Branch (465:9): [True: 2.53M, False: 390]
  |  Branch (465:34): [True: 1.42k, False: 2.53M]
  ------------------
  466|  1.42k|	if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (466:6): [True: 230, False: 1.19k]
  ------------------
  467|    230|	    ctxt->myDoc->standalone = 0;
  468|    230|	    ret = xmlGetDocEntity(ctxt->myDoc, name);
  469|    230|	    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: 879, False: 315]
  ------------------
  473|    879|		ctxt->myDoc->standalone = 0;
  474|    879|		ret = xmlGetDocEntity(ctxt->myDoc, name);
  475|    879|		if (ret != NULL) {
  ------------------
  |  Branch (475:7): [True: 253, False: 626]
  ------------------
  476|    253|		    xmlFatalErrMsg(ctxt, XML_ERR_NOT_STANDALONE,
  477|    253|	 "Entity(%s) document marked standalone but requires external subset\n",
  478|    253|				   name, NULL);
  479|    253|		}
  480|    879|		ctxt->myDoc->standalone = 1;
  481|    879|	    }
  482|  1.19k|	}
  483|  2.53M|    } else {
  484|  2.53M|	ret = xmlGetDocEntity(ctxt->myDoc, name);
  485|  2.53M|    }
  486|  2.53M|    return(ret);
  487|  3.51M|}
xmlSAX2GetParameterEntity:
  498|   471k|{
  499|   471k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  500|   471k|    xmlEntityPtr ret;
  501|       |
  502|   471k|    if (ctx == NULL) return(NULL);
  ------------------
  |  Branch (502:9): [True: 0, False: 471k]
  ------------------
  503|       |
  504|   471k|    ret = xmlGetParameterEntity(ctxt->myDoc, name);
  505|   471k|    return(ret);
  506|   471k|}
xmlSAX2EntityDecl:
  522|   144k|{
  523|   144k|    xmlEntityPtr ent;
  524|   144k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  525|   144k|    int extSubset;
  526|   144k|    int res;
  527|       |
  528|   144k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (528:9): [True: 0, False: 144k]
  |  Branch (528:27): [True: 0, False: 144k]
  ------------------
  529|      0|        return;
  530|       |
  531|   144k|    extSubset = ctxt->inSubset == 2;
  532|   144k|    res = xmlAddEntity(ctxt->myDoc, extSubset, name, type, publicId, systemId,
  533|   144k|                       content, &ent);
  534|   144k|    switch (res) {
  535|  22.0k|        case XML_ERR_OK:
  ------------------
  |  Branch (535:9): [True: 22.0k, False: 122k]
  ------------------
  536|  22.0k|            break;
  537|     30|        case XML_ERR_NO_MEMORY:
  ------------------
  |  Branch (537:9): [True: 30, False: 144k]
  ------------------
  538|     30|            xmlSAX2ErrMemory(ctxt);
  539|     30|            return;
  540|   117k|        case XML_WAR_ENTITY_REDEFINED:
  ------------------
  |  Branch (540:9): [True: 117k, False: 26.8k]
  ------------------
  541|   117k|            if (ctxt->pedantic) {
  ------------------
  |  Branch (541:17): [True: 7.65k, False: 109k]
  ------------------
  542|  7.65k|                if (extSubset)
  ------------------
  |  Branch (542:21): [True: 685, False: 6.97k]
  ------------------
  543|    685|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  544|    685|                               " external subset\n", name);
  545|  6.97k|                else
  546|  6.97k|                    xmlWarnMsg(ctxt, res, "Entity(%s) already defined in the"
  547|  6.97k|                               " internal subset\n", name);
  548|  7.65k|            }
  549|   117k|            return;
  550|  4.75k|        case XML_ERR_REDECL_PREDEF_ENTITY:
  ------------------
  |  Branch (550:9): [True: 4.75k, False: 139k]
  ------------------
  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.75k|            xmlWarnMsg(ctxt, res, "Invalid redeclaration of predefined"
  556|  4.75k|                       " entity '%s'", name);
  557|  4.75k|            return;
  558|      0|        default:
  ------------------
  |  Branch (558:9): [True: 0, False: 144k]
  ------------------
  559|      0|            xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
  560|      0|                           "Unexpected error code from xmlAddEntity\n",
  561|      0|                           NULL, NULL);
  562|      0|            return;
  563|   144k|    }
  564|       |
  565|  22.0k|    if ((ent->URI == NULL) && (systemId != NULL)) {
  ------------------
  |  Branch (565:9): [True: 22.0k, False: 0]
  |  Branch (565:31): [True: 7.71k, False: 14.3k]
  ------------------
  566|  7.71k|        xmlChar *URI;
  567|  7.71k|        const char *base = NULL;
  568|  7.71k|        int i;
  569|       |
  570|  14.8k|        for (i = ctxt->inputNr - 1; i >= 0; i--) {
  ------------------
  |  Branch (570:37): [True: 7.76k, False: 7.05k]
  ------------------
  571|  7.76k|            if (ctxt->inputTab[i]->filename != NULL) {
  ------------------
  |  Branch (571:17): [True: 660, False: 7.10k]
  ------------------
  572|    660|                base = ctxt->inputTab[i]->filename;
  573|    660|                break;
  574|    660|            }
  575|  7.76k|        }
  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.71k|        if (base == NULL)
  ------------------
  |  Branch (581:13): [True: 7.05k, False: 660]
  ------------------
  582|  7.05k|            base = ctxt->directory;
  583|       |
  584|  7.71k|        res = xmlBuildURISafe(systemId, (const xmlChar *) base, &URI);
  585|       |
  586|  7.71k|        if (URI == NULL) {
  ------------------
  |  Branch (586:13): [True: 110, False: 7.60k]
  ------------------
  587|    110|            if (res < 0) {
  ------------------
  |  Branch (587:17): [True: 1, False: 109]
  ------------------
  588|      1|                xmlSAX2ErrMemory(ctxt);
  589|    109|            } else {
  590|    109|                xmlWarnMsg(ctxt, XML_ERR_INVALID_URI,
  591|    109|                           "Can't resolve URI: %s\n", systemId);
  592|    109|            }
  593|  7.60k|        } else if (xmlStrlen(URI) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  7.60k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (593:20): [True: 1, False: 7.60k]
  ------------------
  594|      1|            xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT, "URI too long");
  595|      1|            xmlFree(URI);
  596|  7.60k|        } else {
  597|  7.60k|            ent->URI = URI;
  598|  7.60k|        }
  599|  7.71k|    }
  600|  22.0k|}
xmlSAX2AttributeDecl:
  617|  60.5k|{
  618|  60.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  619|  60.5k|    xmlAttributePtr attr;
  620|  60.5k|    const xmlChar *name = NULL;
  621|  60.5k|    xmlChar *prefix = NULL;
  622|       |
  623|       |    /* Avoid unused variable warning if features are disabled. */
  624|  60.5k|    (void) attr;
  625|       |
  626|  60.5k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (626:9): [True: 0, False: 60.5k]
  |  Branch (626:27): [True: 0, False: 60.5k]
  ------------------
  627|      0|        return;
  628|       |
  629|  60.5k|    if ((xmlStrEqual(fullname, BAD_CAST "xml:id")) &&
  ------------------
  |  |   34|  60.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (629:9): [True: 642, False: 59.9k]
  ------------------
  630|    642|        (type != XML_ATTRIBUTE_ID)) {
  ------------------
  |  Branch (630:9): [True: 352, False: 290]
  ------------------
  631|    352|	xmlErrId(ctxt, XML_DTD_XMLID_TYPE,
  632|    352|	      "xml:id : attribute type should be ID\n", NULL);
  633|    352|    }
  634|  60.5k|    name = xmlSplitQName4(fullname, &prefix);
  635|  60.5k|    if (name == NULL)
  ------------------
  |  Branch (635:9): [True: 8, False: 60.5k]
  ------------------
  636|      8|        xmlSAX2ErrMemory(ctxt);
  637|  60.5k|    ctxt->vctxt.valid = 1;
  638|  60.5k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (638:9): [True: 39.7k, False: 20.8k]
  ------------------
  639|  39.7k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, elem,
  640|  39.7k|	       name, prefix, (xmlAttributeType) type,
  641|  39.7k|	       (xmlAttributeDefault) def, defaultValue, tree);
  642|  20.8k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (642:14): [True: 20.8k, False: 0]
  ------------------
  643|  20.8k|	attr = xmlAddAttributeDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, elem,
  644|  20.8k|	   name, prefix, (xmlAttributeType) type,
  645|  20.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|  60.5k|#ifdef LIBXML_VALID_ENABLED
  655|  60.5k|    if (ctxt->vctxt.valid == 0)
  ------------------
  |  Branch (655:9): [True: 12.5k, False: 47.9k]
  ------------------
  656|  12.5k|	ctxt->valid = 0;
  657|  60.5k|    if ((attr != NULL) && (ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (657:9): [True: 29.0k, False: 31.5k]
  |  Branch (657:27): [True: 22.5k, False: 6.50k]
  |  Branch (657:47): [True: 17.6k, False: 4.94k]
  ------------------
  658|  17.6k|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (658:9): [True: 17.6k, False: 0]
  ------------------
  659|  17.6k|	ctxt->valid &= xmlValidateAttributeDecl(&ctxt->vctxt, ctxt->myDoc,
  660|  17.6k|	                                        attr);
  661|  60.5k|#endif /* LIBXML_VALID_ENABLED */
  662|  60.5k|    if (prefix != NULL)
  ------------------
  |  Branch (662:9): [True: 5.90k, False: 54.6k]
  ------------------
  663|  5.90k|	xmlFree(prefix);
  664|  60.5k|}
xmlSAX2ElementDecl:
  677|  18.7k|{
  678|  18.7k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  679|  18.7k|    xmlElementPtr elem = NULL;
  680|       |
  681|       |    /* Avoid unused variable warning if features are disabled. */
  682|  18.7k|    (void) elem;
  683|       |
  684|  18.7k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (684:9): [True: 0, False: 18.7k]
  |  Branch (684:27): [True: 0, False: 18.7k]
  ------------------
  685|      0|        return;
  686|       |
  687|  18.7k|    if (ctxt->inSubset == 1)
  ------------------
  |  Branch (687:9): [True: 12.4k, False: 6.30k]
  ------------------
  688|  12.4k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->intSubset,
  689|  12.4k|                                 name, (xmlElementTypeVal) type, content);
  690|  6.30k|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (690:14): [True: 6.30k, False: 0]
  ------------------
  691|  6.30k|        elem = xmlAddElementDecl(&ctxt->vctxt, ctxt->myDoc->extSubset,
  692|  6.30k|                                 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|  18.7k|#ifdef LIBXML_VALID_ENABLED
  700|  18.7k|    if (elem == NULL)
  ------------------
  |  Branch (700:9): [True: 7.56k, False: 11.1k]
  ------------------
  701|  7.56k|        ctxt->valid = 0;
  702|  18.7k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (702:9): [True: 14.3k, False: 4.35k]
  |  Branch (702:27): [True: 8.94k, False: 5.41k]
  ------------------
  703|  8.94k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (703:9): [True: 8.94k, False: 0]
  |  Branch (703:24): [True: 8.94k, False: 0]
  ------------------
  704|  8.94k|        ctxt->valid &=
  705|  8.94k|            xmlValidateElementDecl(&ctxt->vctxt, ctxt->myDoc, elem);
  706|  18.7k|#endif /* LIBXML_VALID_ENABLED */
  707|  18.7k|}
xmlSAX2NotationDecl:
  720|  1.72k|{
  721|  1.72k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  722|  1.72k|    xmlNotationPtr nota = NULL;
  723|       |
  724|       |    /* Avoid unused variable warning if features are disabled. */
  725|  1.72k|    (void) nota;
  726|       |
  727|  1.72k|    if ((ctxt == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (727:9): [True: 0, False: 1.72k]
  |  Branch (727:27): [True: 0, False: 1.72k]
  ------------------
  728|      0|        return;
  729|       |
  730|  1.72k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (730:9): [True: 665, False: 1.06k]
  |  Branch (730:31): [True: 96, False: 569]
  ------------------
  731|     96|	xmlFatalErrMsg(ctxt, XML_ERR_NOTATION_PROCESSING,
  732|     96|	     "SAX.xmlSAX2NotationDecl(%s) externalID or PublicID missing\n",
  733|     96|	               name, NULL);
  734|     96|	return;
  735|  1.63k|    } else if (ctxt->inSubset == 1)
  ------------------
  |  Branch (735:16): [True: 1.10k, False: 530]
  ------------------
  736|  1.10k|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->intSubset, name,
  737|  1.10k|                              publicId, systemId);
  738|    530|    else if (ctxt->inSubset == 2)
  ------------------
  |  Branch (738:14): [True: 530, False: 0]
  ------------------
  739|    530|	nota = xmlAddNotationDecl(&ctxt->vctxt, ctxt->myDoc->extSubset, name,
  740|    530|                              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|  1.63k|#ifdef LIBXML_VALID_ENABLED
  748|  1.63k|    if (nota == NULL) ctxt->valid = 0;
  ------------------
  |  Branch (748:9): [True: 1.37k, False: 253]
  ------------------
  749|  1.63k|    if ((ctxt->validate) && (ctxt->wellFormed) &&
  ------------------
  |  Branch (749:9): [True: 1.13k, False: 500]
  |  Branch (749:29): [True: 333, False: 798]
  ------------------
  750|    333|        (ctxt->myDoc->intSubset != NULL))
  ------------------
  |  Branch (750:9): [True: 333, False: 0]
  ------------------
  751|    333|	ctxt->valid &= xmlValidateNotationDecl(&ctxt->vctxt, ctxt->myDoc,
  752|    333|	                                       nota);
  753|  1.63k|#endif /* LIBXML_VALID_ENABLED */
  754|  1.63k|}
xmlSAX2UnparsedEntityDecl:
  769|    617|{
  770|    617|    xmlSAX2EntityDecl(ctx, name, XML_EXTERNAL_GENERAL_UNPARSED_ENTITY,
  771|    617|                      publicId, systemId, (xmlChar *) notationName);
  772|    617|}
xmlSAX2SetDocumentLocator:
  783|  48.9k|{
  784|  48.9k|}
xmlSAX2StartDocument:
  793|  48.5k|{
  794|  48.5k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  795|  48.5k|    xmlDocPtr doc;
  796|       |
  797|  48.5k|    if (ctx == NULL) return;
  ------------------
  |  Branch (797:9): [True: 0, False: 48.5k]
  ------------------
  798|       |
  799|  48.5k|#ifdef LIBXML_HTML_ENABLED
  800|  48.5k|    if (ctxt->html) {
  ------------------
  |  Branch (800:9): [True: 0, False: 48.5k]
  ------------------
  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|  48.5k|#endif
  811|  48.5k|    {
  812|  48.5k|	doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
  813|  48.5k|	if (doc != NULL) {
  ------------------
  |  Branch (813:6): [True: 48.5k, False: 23]
  ------------------
  814|  48.5k|	    doc->properties = 0;
  815|  48.5k|	    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (815:10): [True: 18.3k, False: 30.1k]
  ------------------
  816|  18.3k|	        doc->properties |= XML_DOC_OLD10;
  817|  48.5k|	    doc->parseFlags = ctxt->options;
  818|  48.5k|	    doc->standalone = ctxt->standalone;
  819|  48.5k|	} else {
  820|     23|	    xmlSAX2ErrMemory(ctxt);
  821|     23|	    return;
  822|     23|	}
  823|  48.5k|	if ((ctxt->dictNames) && (doc != NULL)) {
  ------------------
  |  Branch (823:6): [True: 28.1k, False: 20.4k]
  |  Branch (823:27): [True: 28.1k, False: 0]
  ------------------
  824|  28.1k|	    doc->dict = ctxt->dict;
  825|  28.1k|	    xmlDictReference(doc->dict);
  826|  28.1k|	}
  827|  48.5k|    }
  828|  48.5k|    if ((ctxt->myDoc != NULL) && (ctxt->myDoc->URL == NULL) &&
  ------------------
  |  Branch (828:9): [True: 48.5k, False: 0]
  |  Branch (828:34): [True: 48.5k, False: 0]
  ------------------
  829|  48.5k|	(ctxt->input != NULL) && (ctxt->input->filename != NULL)) {
  ------------------
  |  Branch (829:2): [True: 48.5k, False: 0]
  |  Branch (829:27): [True: 8.77k, False: 39.7k]
  ------------------
  830|  8.77k|	ctxt->myDoc->URL = xmlPathToURI((const xmlChar *)ctxt->input->filename);
  831|  8.77k|	if (ctxt->myDoc->URL == NULL)
  ------------------
  |  Branch (831:6): [True: 6, False: 8.76k]
  ------------------
  832|      6|	    xmlSAX2ErrMemory(ctxt);
  833|  8.77k|    }
  834|  48.5k|}
xmlSAX2EndDocument:
  843|  26.9k|{
  844|  26.9k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  845|  26.9k|    xmlDocPtr doc;
  846|       |
  847|  26.9k|    if (ctx == NULL) return;
  ------------------
  |  Branch (847:9): [True: 0, False: 26.9k]
  ------------------
  848|  26.9k|#ifdef LIBXML_VALID_ENABLED
  849|  26.9k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (849:9): [True: 4.69k, False: 22.2k]
  |  Branch (849:27): [True: 616, False: 4.07k]
  ------------------
  850|    616|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (850:9): [True: 616, False: 0]
  |  Branch (850:24): [True: 616, False: 0]
  ------------------
  851|    616|	ctxt->valid &= xmlValidateDocumentFinal(&ctxt->vctxt, ctxt->myDoc);
  852|  26.9k|#endif /* LIBXML_VALID_ENABLED */
  853|       |
  854|  26.9k|    doc = ctxt->myDoc;
  855|  26.9k|    if (doc == NULL)
  ------------------
  |  Branch (855:9): [True: 82, False: 26.8k]
  ------------------
  856|     82|        return;
  857|       |
  858|  26.8k|    if (doc->encoding == NULL) {
  ------------------
  |  Branch (858:9): [True: 26.8k, False: 0]
  ------------------
  859|  26.8k|        const xmlChar *encoding = xmlGetActualEncoding(ctxt);
  860|       |
  861|  26.8k|        if (encoding != NULL) {
  ------------------
  |  Branch (861:13): [True: 277, False: 26.5k]
  ------------------
  862|    277|            doc->encoding = xmlStrdup(encoding);
  863|    277|            if (doc->encoding == NULL)
  ------------------
  |  Branch (863:17): [True: 1, False: 276]
  ------------------
  864|      1|                xmlSAX2ErrMemory(ctxt);
  865|    277|        }
  866|  26.8k|    }
  867|       |
  868|  26.8k|#ifdef LIBXML_HTML_ENABLED
  869|  26.8k|    if (ctxt->html) {
  ------------------
  |  Branch (869:9): [True: 0, False: 26.8k]
  ------------------
  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|  26.8k|#endif /* LIBXML_HTML_ENABLED */
  880|  26.8k|    {
  881|  26.8k|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (881:13): [True: 12.8k, False: 14.0k]
  ------------------
  882|  12.8k|            doc->properties |= XML_DOC_WELLFORMED;
  883|  12.8k|            if (ctxt->valid)
  ------------------
  |  Branch (883:17): [True: 7.04k, False: 5.76k]
  ------------------
  884|  7.04k|                doc->properties |= XML_DOC_DTDVALID;
  885|  12.8k|            if (ctxt->nsWellFormed)
  ------------------
  |  Branch (885:17): [True: 10.1k, False: 2.65k]
  ------------------
  886|  10.1k|                doc->properties |= XML_DOC_NSVALID;
  887|  12.8k|        }
  888|       |
  889|  26.8k|        if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (889:13): [True: 10.7k, False: 16.1k]
  ------------------
  890|  10.7k|            doc->properties |= XML_DOC_OLD10;
  891|  26.8k|    }
  892|  26.8k|}
xmlSAX2StartElement:
 1713|   292k|xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
 1714|   292k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1715|       |
 1716|   292k|    (void) atts;
 1717|       |
 1718|   292k|    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
  ------------------
  |  Branch (1718:9): [True: 0, False: 292k]
  |  Branch (1718:27): [True: 0, False: 292k]
  |  Branch (1718:49): [True: 0, False: 292k]
  ------------------
 1719|      0|        return;
 1720|       |
 1721|   292k|#ifdef LIBXML_SAX1_ENABLED
 1722|   292k|    if (!ctxt->html) {
  ------------------
  |  Branch (1722:9): [True: 292k, False: 0]
  ------------------
 1723|   292k|        xmlSAX1StartElement(ctxt, fullname, atts);
 1724|   292k|        return;
 1725|   292k|    }
 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|   186k|{
 1749|   186k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1750|       |
 1751|   186k|    if (ctxt == NULL)
  ------------------
  |  Branch (1751:9): [True: 0, False: 186k]
  ------------------
 1752|      0|        return;
 1753|       |
 1754|   186k|#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
 1755|   186k|    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1755:9): [True: 186k, False: 0]
  |  Branch (1755:24): [True: 25.0k, False: 161k]
  |  Branch (1755:42): [True: 15.7k, False: 9.24k]
  ------------------
 1756|  15.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (1756:9): [True: 15.7k, False: 0]
  |  Branch (1756:24): [True: 15.7k, False: 0]
  ------------------
 1757|  15.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 1758|  15.7k|					     ctxt->node);
 1759|   186k|#endif /* LIBXML_VALID_ENABLED */
 1760|       |
 1761|   186k|#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
 1762|   186k|    ctxt->nodemem = -1;
 1763|       |
 1764|       |    /*
 1765|       |     * end of parsing of this node.
 1766|       |     */
 1767|   186k|    nodePop(ctxt);
 1768|   186k|#endif
 1769|   186k|}
xmlSAX2StartElementNs:
 2155|   531k|{
 2156|   531k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2157|   531k|    xmlNodePtr ret;
 2158|   531k|    xmlNsPtr last = NULL, ns;
 2159|   531k|    const xmlChar *uri, *pref;
 2160|   531k|    xmlChar *lname = NULL;
 2161|   531k|    int i, j;
 2162|       |
 2163|   531k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2163:9): [True: 0, False: 531k]
  ------------------
 2164|       |
 2165|   531k|#ifdef LIBXML_VALID_ENABLED
 2166|       |    /*
 2167|       |     * First check on validity:
 2168|       |     */
 2169|   531k|    if (ctxt->validate &&
  ------------------
  |  Branch (2169:9): [True: 204k, False: 327k]
  ------------------
 2170|   204k|        ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (2170:10): [True: 0, False: 204k]
  ------------------
 2171|   204k|         ((ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (2171:11): [True: 200k, False: 4.08k]
  ------------------
 2172|   200k|          ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (2172:12): [True: 5.04k, False: 195k]
  ------------------
 2173|   195k|	   ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (2173:6): [True: 194k, False: 633]
  ------------------
 2174|   194k|	    (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (2174:6): [True: 16.5k, False: 178k]
  ------------------
 2175|  16.5k|	    (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (2175:6): [True: 16.5k, False: 0]
  ------------------
 2176|  16.5k|	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
  ------------------
  |  Branch (2176:6): [True: 860, False: 15.7k]
  ------------------
 2177|  5.90k|	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 2178|  5.90k|	  "Validation failed: no DTD found !", NULL, NULL);
 2179|  5.90k|	ctxt->validate = 0;
 2180|  5.90k|    }
 2181|   531k|#endif /* LIBXML_VALID_ENABLED */
 2182|       |
 2183|       |    /*
 2184|       |     * Take care of the rare case of an undefined namespace prefix
 2185|       |     */
 2186|   531k|    if ((prefix != NULL) && (URI == NULL)) {
  ------------------
  |  Branch (2186:9): [True: 83.7k, False: 447k]
  |  Branch (2186:29): [True: 26.0k, False: 57.7k]
  ------------------
 2187|  26.0k|        if (ctxt->dictNames) {
  ------------------
  |  Branch (2187:13): [True: 20.0k, False: 5.98k]
  ------------------
 2188|  20.0k|	    const xmlChar *fullname;
 2189|       |
 2190|  20.0k|	    fullname = xmlDictQLookup(ctxt->dict, prefix, localname);
 2191|  20.0k|	    if (fullname == NULL) {
  ------------------
  |  Branch (2191:10): [True: 2, False: 20.0k]
  ------------------
 2192|      2|                xmlSAX2ErrMemory(ctxt);
 2193|      2|                return;
 2194|      2|            }
 2195|  20.0k|	    localname = fullname;
 2196|  20.0k|	} else {
 2197|  5.98k|	    lname = xmlBuildQName(localname, prefix, NULL, 0);
 2198|  5.98k|            if (lname == NULL) {
  ------------------
  |  Branch (2198:17): [True: 2, False: 5.97k]
  ------------------
 2199|      2|                xmlSAX2ErrMemory(ctxt);
 2200|      2|                return;
 2201|      2|            }
 2202|  5.98k|	}
 2203|  26.0k|    }
 2204|       |    /*
 2205|       |     * allocate the node
 2206|       |     */
 2207|   531k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2207:9): [True: 2.60k, False: 529k]
  ------------------
 2208|  2.60k|        ret = ctxt->freeElems;
 2209|  2.60k|	ctxt->freeElems = ret->next;
 2210|  2.60k|	ctxt->freeElemsNr--;
 2211|  2.60k|	memset(ret, 0, sizeof(xmlNode));
 2212|  2.60k|        ret->doc = ctxt->myDoc;
 2213|  2.60k|	ret->type = XML_ELEMENT_NODE;
 2214|       |
 2215|  2.60k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2215:6): [True: 1.26k, False: 1.34k]
  ------------------
 2216|  1.26k|	    ret->name = localname;
 2217|  1.34k|	else {
 2218|  1.34k|	    if (lname == NULL)
  ------------------
  |  Branch (2218:10): [True: 1.11k, False: 234]
  ------------------
 2219|  1.11k|		ret->name = xmlStrdup(localname);
 2220|    234|	    else
 2221|    234|	        ret->name = lname;
 2222|  1.34k|	    if (ret->name == NULL) {
  ------------------
  |  Branch (2222:10): [True: 2, False: 1.34k]
  ------------------
 2223|      2|	        xmlSAX2ErrMemory(ctxt);
 2224|      2|                xmlFree(ret);
 2225|      2|		return;
 2226|      2|	    }
 2227|  1.34k|	}
 2228|  2.60k|	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2228:6): [True: 0, False: 2.60k]
  |  Branch (2228:32): [True: 0, False: 0]
  ------------------
 2229|      0|	    xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2230|   529k|    } else {
 2231|   529k|	if (ctxt->dictNames)
  ------------------
  |  Branch (2231:6): [True: 316k, False: 212k]
  ------------------
 2232|   316k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
 2233|   316k|	                               (xmlChar *) localname, NULL);
 2234|   212k|	else if (lname == NULL)
  ------------------
  |  Branch (2234:11): [True: 206k, False: 5.74k]
  ------------------
 2235|   206k|	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 2236|  5.74k|	else
 2237|  5.74k|	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 2238|   529k|	if (ret == NULL) {
  ------------------
  |  Branch (2238:6): [True: 57, False: 529k]
  ------------------
 2239|     57|	    xmlSAX2ErrMemory(ctxt);
 2240|     57|	    return;
 2241|     57|	}
 2242|   529k|    }
 2243|       |
 2244|       |    /*
 2245|       |     * Build the namespace list
 2246|       |     */
 2247|   822k|    for (i = 0,j = 0;j < nb_namespaces;j++) {
  ------------------
  |  Branch (2247:22): [True: 290k, False: 531k]
  ------------------
 2248|   290k|        pref = namespaces[i++];
 2249|   290k|	uri = namespaces[i++];
 2250|   290k|	ns = xmlNewNs(NULL, uri, pref);
 2251|   290k|	if (ns != NULL) {
  ------------------
  |  Branch (2251:6): [True: 290k, False: 82]
  ------------------
 2252|   290k|	    if (last == NULL) {
  ------------------
  |  Branch (2252:10): [True: 117k, False: 172k]
  ------------------
 2253|   117k|	        ret->nsDef = last = ns;
 2254|   172k|	    } else {
 2255|   172k|	        last->next = ns;
 2256|   172k|		last = ns;
 2257|   172k|	    }
 2258|   290k|	    if ((URI != NULL) && (prefix == pref))
  ------------------
  |  Branch (2258:10): [True: 240k, False: 49.6k]
  |  Branch (2258:27): [True: 79.9k, False: 160k]
  ------------------
 2259|  79.9k|		ret->ns = ns;
 2260|   290k|	} else {
 2261|     82|            xmlSAX2ErrMemory(ctxt);
 2262|     82|	    continue;
 2263|     82|	}
 2264|       |
 2265|   290k|        xmlParserNsUpdateSax(ctxt, pref, ns);
 2266|       |
 2267|   290k|#ifdef LIBXML_VALID_ENABLED
 2268|   290k|	if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2268:6): [True: 290k, False: 0]
  |  Branch (2268:23): [True: 155k, False: 135k]
  |  Branch (2268:41): [True: 16.3k, False: 138k]
  ------------------
 2269|  16.3k|	    ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2269:6): [True: 16.3k, False: 0]
  |  Branch (2269:21): [True: 16.3k, False: 0]
  ------------------
 2270|  16.3k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 2271|  16.3k|	                                           ret, prefix, ns, uri);
 2272|  16.3k|	}
 2273|   290k|#endif /* LIBXML_VALID_ENABLED */
 2274|   290k|    }
 2275|   531k|    ctxt->nodemem = -1;
 2276|       |
 2277|       |    /*
 2278|       |     * Link the child element
 2279|       |     */
 2280|   531k|    xmlSAX2AppendChild(ctxt, ret);
 2281|       |
 2282|       |    /*
 2283|       |     * We are parsing a new node.
 2284|       |     */
 2285|   531k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (2285:9): [True: 36, False: 531k]
  ------------------
 2286|     36|        xmlUnlinkNode(ret);
 2287|     36|        xmlFreeNode(ret);
 2288|     36|        return;
 2289|     36|    }
 2290|       |
 2291|       |    /*
 2292|       |     * Insert the defaulted attributes from the DTD only if requested:
 2293|       |     */
 2294|   531k|    if ((nb_defaulted != 0) &&
  ------------------
  |  Branch (2294:9): [True: 76.6k, False: 455k]
  ------------------
 2295|  76.6k|        ((ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0))
  ------------------
  |  |  209|  76.6k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (2295:9): [True: 20.1k, False: 56.4k]
  ------------------
 2296|  20.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|   531k|    if ((URI != NULL) && (ret->ns == NULL)) {
  ------------------
  |  Branch (2302:9): [True: 109k, False: 422k]
  |  Branch (2302:26): [True: 29.5k, False: 79.9k]
  ------------------
 2303|  29.5k|        ret->ns = xmlParserNsLookupSax(ctxt, prefix);
 2304|  29.5k|	if ((ret->ns == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|    529|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2304:6): [True: 529, False: 29.0k]
  |  Branch (2304:27): [True: 495, False: 34]
  ------------------
 2305|    495|            int res;
 2306|       |
 2307|    495|	    res = xmlSearchNsSafe(ret, prefix, &ret->ns);
 2308|    495|            if (res < 0)
  ------------------
  |  Branch (2308:17): [True: 6, False: 489]
  ------------------
 2309|      6|                xmlSAX2ErrMemory(ctxt);
 2310|    495|	}
 2311|  29.5k|	if (ret->ns == NULL) {
  ------------------
  |  Branch (2311:6): [True: 40, False: 29.5k]
  ------------------
 2312|     40|	    ns = xmlNewNs(ret, NULL, prefix);
 2313|     40|	    if (ns == NULL) {
  ------------------
  |  Branch (2313:10): [True: 0, False: 40]
  ------------------
 2314|       |
 2315|      0|	        xmlSAX2ErrMemory(ctxt);
 2316|      0|		return;
 2317|      0|	    }
 2318|     40|            if (prefix != NULL)
  ------------------
  |  Branch (2318:17): [True: 14, False: 26]
  ------------------
 2319|     14|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2320|     14|                             "Namespace prefix %s was not found\n",
 2321|     14|                             prefix, NULL);
 2322|     26|            else
 2323|     26|                xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 2324|     26|                             "Namespace default prefix was not found\n",
 2325|     26|                             NULL, NULL);
 2326|     40|	}
 2327|  29.5k|    }
 2328|       |
 2329|       |    /*
 2330|       |     * process all the other attributes
 2331|       |     */
 2332|   531k|    if (nb_attributes > 0) {
  ------------------
  |  Branch (2332:9): [True: 92.4k, False: 439k]
  ------------------
 2333|  92.4k|        xmlAttrPtr prev = NULL;
 2334|       |
 2335|   437k|        for (j = 0,i = 0;i < nb_attributes;i++,j+=5) {
  ------------------
  |  Branch (2335:26): [True: 345k, False: 92.4k]
  ------------------
 2336|   345k|            xmlAttrPtr attr = NULL;
 2337|       |
 2338|       |	    /*
 2339|       |	     * Handle the rare case of an undefined attribute prefix
 2340|       |	     */
 2341|   345k|	    if ((attributes[j+1] != NULL) && (attributes[j+2] == NULL)) {
  ------------------
  |  Branch (2341:10): [True: 208k, False: 136k]
  |  Branch (2341:39): [True: 85.3k, False: 123k]
  ------------------
 2342|  85.3k|		if (ctxt->dictNames) {
  ------------------
  |  Branch (2342:7): [True: 20.9k, False: 64.3k]
  ------------------
 2343|  20.9k|		    const xmlChar *fullname;
 2344|       |
 2345|  20.9k|		    fullname = xmlDictQLookup(ctxt->dict, attributes[j+1],
 2346|  20.9k|		                              attributes[j]);
 2347|  20.9k|		    if (fullname == NULL) {
  ------------------
  |  Branch (2347:11): [True: 2, False: 20.9k]
  ------------------
 2348|      2|                        xmlSAX2ErrMemory(ctxt);
 2349|      2|                        return;
 2350|      2|                    }
 2351|  20.9k|                    attr = xmlSAX2AttributeNs(ctxt, fullname, NULL,
 2352|  20.9k|                                              attributes[j+3],
 2353|  20.9k|                                              attributes[j+4]);
 2354|  20.9k|                    goto have_attr;
 2355|  64.3k|		} else {
 2356|  64.3k|		    lname = xmlBuildQName(attributes[j], attributes[j+1],
 2357|  64.3k|		                          NULL, 0);
 2358|  64.3k|		    if (lname == NULL) {
  ------------------
  |  Branch (2358:11): [True: 2, False: 64.3k]
  ------------------
 2359|      2|                        xmlSAX2ErrMemory(ctxt);
 2360|      2|                        return;
 2361|      2|                    }
 2362|  64.3k|                    attr = xmlSAX2AttributeNs(ctxt, lname, NULL,
 2363|  64.3k|                                              attributes[j+3],
 2364|  64.3k|                                              attributes[j+4]);
 2365|  64.3k|                    xmlFree(lname);
 2366|  64.3k|                    goto have_attr;
 2367|  64.3k|		}
 2368|  85.3k|	    }
 2369|   259k|            attr = xmlSAX2AttributeNs(ctxt, attributes[j], attributes[j+1],
 2370|   259k|                                      attributes[j+3], attributes[j+4]);
 2371|   345k|have_attr:
 2372|   345k|            if (attr == NULL)
  ------------------
  |  Branch (2372:17): [True: 21, False: 344k]
  ------------------
 2373|     21|                continue;
 2374|       |
 2375|       |            /* link at the end to preserve order */
 2376|   344k|            if (prev == NULL) {
  ------------------
  |  Branch (2376:17): [True: 92.4k, False: 252k]
  ------------------
 2377|  92.4k|                ctxt->node->properties = attr;
 2378|   252k|            } else {
 2379|   252k|                prev->next = attr;
 2380|   252k|                attr->prev = prev;
 2381|   252k|            }
 2382|       |
 2383|   344k|            prev = attr;
 2384|   344k|	}
 2385|  92.4k|    }
 2386|       |
 2387|   531k|#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|   531k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (2392:9): [True: 198k, False: 333k]
  ------------------
 2393|   198k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|   198k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (2393:9): [True: 4.16k, False: 194k]
  ------------------
 2394|  4.16k|	int chk;
 2395|       |
 2396|  4.16k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 2397|  4.16k|	if (chk <= 0)
  ------------------
  |  Branch (2397:6): [True: 53, False: 4.11k]
  ------------------
 2398|     53|	    ctxt->valid = 0;
 2399|  4.16k|	if (chk < 0)
  ------------------
  |  Branch (2399:6): [True: 0, False: 4.16k]
  ------------------
 2400|      0|	    ctxt->wellFormed = 0;
 2401|  4.16k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 2402|  4.16k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  4.16k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 2403|  4.16k|    }
 2404|   531k|#endif /* LIBXML_VALID_ENABLED */
 2405|   531k|}
xmlSAX2EndElementNs:
 2421|   335k|{
 2422|   335k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2423|       |
 2424|   335k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2424:9): [True: 0, False: 335k]
  ------------------
 2425|   335k|    ctxt->nodemem = -1;
 2426|       |
 2427|   335k|#ifdef LIBXML_VALID_ENABLED
 2428|   335k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2428:9): [True: 117k, False: 218k]
  |  Branch (2428:27): [True: 98.7k, False: 18.9k]
  ------------------
 2429|  98.7k|        ctxt->myDoc && ctxt->myDoc->intSubset)
  ------------------
  |  Branch (2429:9): [True: 98.7k, False: 0]
  |  Branch (2429:24): [True: 98.7k, False: 0]
  ------------------
 2430|  98.7k|        ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 2431|  98.7k|                                             ctxt->node);
 2432|   335k|#endif /* LIBXML_VALID_ENABLED */
 2433|       |
 2434|       |    /*
 2435|       |     * end of parsing of this node.
 2436|       |     */
 2437|   335k|    nodePop(ctxt);
 2438|   335k|}
xmlSAX2Reference:
 2448|  26.4k|{
 2449|  26.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2450|  26.4k|    xmlNodePtr ret;
 2451|       |
 2452|  26.4k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2452:9): [True: 0, False: 26.4k]
  ------------------
 2453|  26.4k|    ret = xmlNewReference(ctxt->myDoc, name);
 2454|  26.4k|    if (ret == NULL) {
  ------------------
  |  Branch (2454:9): [True: 8, False: 26.4k]
  ------------------
 2455|      8|        xmlSAX2ErrMemory(ctxt);
 2456|      8|        return;
 2457|      8|    }
 2458|       |
 2459|  26.4k|    xmlSAX2AppendChild(ctxt, ret);
 2460|  26.4k|}
xmlSAX2Characters:
 2606|   840k|{
 2607|   840k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
 2608|   840k|}
xmlSAX2ProcessingInstruction:
 2633|   192k|{
 2634|   192k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2635|   192k|    xmlNodePtr ret;
 2636|       |
 2637|   192k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2637:9): [True: 0, False: 192k]
  ------------------
 2638|       |
 2639|   192k|    ret = xmlNewDocPI(ctxt->myDoc, target, data);
 2640|   192k|    if (ret == NULL) {
  ------------------
  |  Branch (2640:9): [True: 4, False: 192k]
  ------------------
 2641|      4|        xmlSAX2ErrMemory(ctxt);
 2642|      4|        return;
 2643|      4|    }
 2644|       |
 2645|   192k|    xmlSAX2AppendChild(ctxt, ret);
 2646|   192k|}
xmlSAX2Comment:
 2656|   281k|{
 2657|   281k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 2658|   281k|    xmlNodePtr ret;
 2659|       |
 2660|   281k|    if (ctx == NULL) return;
  ------------------
  |  Branch (2660:9): [True: 0, False: 281k]
  ------------------
 2661|       |
 2662|   281k|    ret = xmlNewDocComment(ctxt->myDoc, value);
 2663|   281k|    if (ret == NULL) {
  ------------------
  |  Branch (2663:9): [True: 16, False: 281k]
  ------------------
 2664|     16|        xmlSAX2ErrMemory(ctxt);
 2665|     16|        return;
 2666|     16|    }
 2667|       |
 2668|   281k|    xmlSAX2AppendChild(ctxt, ret);
 2669|   281k|}
xmlSAX2CDataBlock:
 2680|  77.3k|{
 2681|  77.3k|    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 2682|  77.3k|}
xmlSAXVersion:
 2711|  91.4k|{
 2712|  91.4k|    if (hdlr == NULL) return(-1);
  ------------------
  |  Branch (2712:9): [True: 0, False: 91.4k]
  ------------------
 2713|  91.4k|    if (version == 2) {
  ------------------
  |  Branch (2713:9): [True: 91.4k, False: 0]
  ------------------
 2714|  91.4k|	hdlr->startElementNs = xmlSAX2StartElementNs;
 2715|  91.4k|	hdlr->endElementNs = xmlSAX2EndElementNs;
 2716|  91.4k|	hdlr->serror = NULL;
 2717|  91.4k|	hdlr->initialized = XML_SAX2_MAGIC;
  ------------------
  |  |  953|  91.4k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
 2718|  91.4k|#ifdef LIBXML_SAX1_ENABLED
 2719|  91.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|  91.4k|#ifdef LIBXML_SAX1_ENABLED
 2725|  91.4k|    hdlr->startElement = xmlSAX2StartElement;
 2726|  91.4k|    hdlr->endElement = xmlSAX2EndElement;
 2727|       |#else
 2728|       |    hdlr->startElement = NULL;
 2729|       |    hdlr->endElement = NULL;
 2730|       |#endif /* LIBXML_SAX1_ENABLED */
 2731|  91.4k|    hdlr->internalSubset = xmlSAX2InternalSubset;
 2732|  91.4k|    hdlr->externalSubset = xmlSAX2ExternalSubset;
 2733|  91.4k|    hdlr->isStandalone = xmlSAX2IsStandalone;
 2734|  91.4k|    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
 2735|  91.4k|    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
 2736|  91.4k|    hdlr->resolveEntity = xmlSAX2ResolveEntity;
 2737|  91.4k|    hdlr->getEntity = xmlSAX2GetEntity;
 2738|  91.4k|    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
 2739|  91.4k|    hdlr->entityDecl = xmlSAX2EntityDecl;
 2740|  91.4k|    hdlr->attributeDecl = xmlSAX2AttributeDecl;
 2741|  91.4k|    hdlr->elementDecl = xmlSAX2ElementDecl;
 2742|  91.4k|    hdlr->notationDecl = xmlSAX2NotationDecl;
 2743|  91.4k|    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
 2744|  91.4k|    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
 2745|  91.4k|    hdlr->startDocument = xmlSAX2StartDocument;
 2746|  91.4k|    hdlr->endDocument = xmlSAX2EndDocument;
 2747|  91.4k|    hdlr->reference = xmlSAX2Reference;
 2748|  91.4k|    hdlr->characters = xmlSAX2Characters;
 2749|  91.4k|    hdlr->cdataBlock = xmlSAX2CDataBlock;
 2750|  91.4k|    hdlr->ignorableWhitespace = xmlSAX2Characters;
 2751|  91.4k|    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
 2752|  91.4k|    hdlr->comment = xmlSAX2Comment;
 2753|  91.4k|    hdlr->warning = xmlParserWarning;
 2754|  91.4k|    hdlr->error = xmlParserError;
 2755|  91.4k|    hdlr->fatalError = xmlParserError;
 2756|       |
 2757|  91.4k|    return(0);
 2758|  91.4k|}
SAX2.c:xmlSAX2ErrMemory:
   42|    815|xmlSAX2ErrMemory(xmlParserCtxtPtr ctxt) {
   43|    815|    xmlCtxtErrMemory(ctxt);
   44|    815|}
SAX2.c:xmlWarnMsg:
  111|  12.5k|{
  112|  12.5k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  113|  12.5k|               str1, NULL, NULL, 0, msg, str1);
  114|  12.5k|}
SAX2.c:xmlFatalErrMsg:
   79|    349|{
   80|    349|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
   81|       |               str1, str2, NULL, 0, msg, str1, str2);
   82|    349|}
SAX2.c:xmlErrId:
   95|  2.44k|{
   96|  2.44k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
   97|  2.44k|               str1, NULL, NULL, 0, msg, str1);
   98|  2.44k|}
SAX2.c:xmlSAX1StartElement:
 1422|   292k|{
 1423|   292k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 1424|   292k|    xmlNodePtr ret;
 1425|   292k|    xmlNodePtr parent;
 1426|   292k|    xmlNsPtr ns;
 1427|   292k|    const xmlChar *name;
 1428|   292k|    xmlChar *prefix;
 1429|   292k|    const xmlChar *att;
 1430|   292k|    const xmlChar *value;
 1431|   292k|    int i, res;
 1432|       |
 1433|   292k|    if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
  ------------------
  |  Branch (1433:9): [True: 0, False: 292k]
  |  Branch (1433:26): [True: 0, False: 292k]
  |  Branch (1433:48): [True: 0, False: 292k]
  ------------------
 1434|       |
 1435|   292k|#ifdef LIBXML_VALID_ENABLED
 1436|       |    /*
 1437|       |     * First check on validity:
 1438|       |     */
 1439|   292k|    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
  ------------------
  |  Branch (1439:9): [True: 75.6k, False: 216k]
  |  Branch (1439:27): [True: 68.1k, False: 7.53k]
  ------------------
 1440|  68.1k|        ((ctxt->myDoc->intSubset == NULL) ||
  ------------------
  |  Branch (1440:10): [True: 4.87k, False: 63.2k]
  ------------------
 1441|  63.2k|	 ((ctxt->myDoc->intSubset->notations == NULL) &&
  ------------------
  |  Branch (1441:4): [True: 62.4k, False: 869]
  ------------------
 1442|  62.4k|	  (ctxt->myDoc->intSubset->elements == NULL) &&
  ------------------
  |  Branch (1442:4): [True: 14.3k, False: 48.0k]
  ------------------
 1443|  14.3k|	  (ctxt->myDoc->intSubset->attributes == NULL) &&
  ------------------
  |  Branch (1443:4): [True: 14.3k, False: 0]
  ------------------
 1444|  14.3k|	  (ctxt->myDoc->intSubset->entities == NULL)))) {
  ------------------
  |  Branch (1444:4): [True: 1.04k, False: 13.3k]
  ------------------
 1445|  5.91k|	xmlErrValid(ctxt, XML_ERR_NO_DTD,
 1446|  5.91k|	  "Validation failed: no DTD found !", NULL, NULL);
 1447|  5.91k|	ctxt->validate = 0;
 1448|  5.91k|    }
 1449|   292k|#endif
 1450|       |
 1451|       |    /*
 1452|       |     * Split the full name into a namespace prefix and the tag name
 1453|       |     */
 1454|   292k|    name = xmlSplitQName4(fullname, &prefix);
 1455|   292k|    if (name == NULL) {
  ------------------
  |  Branch (1455:9): [True: 4, False: 292k]
  ------------------
 1456|      4|        xmlSAX2ErrMemory(ctxt);
 1457|      4|        return;
 1458|      4|    }
 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|   292k|    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
 1466|   292k|    if (ret == NULL) {
  ------------------
  |  Branch (1466:9): [True: 45, False: 292k]
  ------------------
 1467|     45|	xmlFree(prefix);
 1468|     45|	xmlSAX2ErrMemory(ctxt);
 1469|     45|        return;
 1470|     45|    }
 1471|   292k|    ctxt->nodemem = -1;
 1472|       |
 1473|       |    /* Initialize parent before pushing node */
 1474|   292k|    parent = ctxt->node;
 1475|   292k|    if (parent == NULL)
  ------------------
  |  Branch (1475:9): [True: 17.3k, False: 275k]
  ------------------
 1476|  17.3k|        parent = (xmlNodePtr) ctxt->myDoc;
 1477|       |
 1478|       |    /*
 1479|       |     * Link the child element
 1480|       |     */
 1481|   292k|    xmlSAX2AppendChild(ctxt, ret);
 1482|       |
 1483|       |    /*
 1484|       |     * We are parsing a new node.
 1485|       |     */
 1486|   292k|    if (nodePush(ctxt, ret) < 0) {
  ------------------
  |  Branch (1486:9): [True: 35, False: 292k]
  ------------------
 1487|     35|        xmlUnlinkNode(ret);
 1488|     35|        xmlFreeNode(ret);
 1489|     35|        if (prefix != NULL)
  ------------------
  |  Branch (1489:13): [True: 5, False: 30]
  ------------------
 1490|      5|            xmlFree(prefix);
 1491|     35|        return;
 1492|     35|    }
 1493|       |
 1494|       |    /*
 1495|       |     * Insert all the defaulted attributes from the DTD especially
 1496|       |     * namespaces
 1497|       |     */
 1498|   292k|    if ((ctxt->myDoc->intSubset != NULL) ||
  ------------------
  |  Branch (1498:9): [True: 115k, False: 177k]
  ------------------
 1499|   177k|        (ctxt->myDoc->extSubset != NULL)) {
  ------------------
  |  Branch (1499:9): [True: 0, False: 177k]
  ------------------
 1500|   115k|        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
 1501|   115k|    }
 1502|       |
 1503|       |    /*
 1504|       |     * process all the attributes whose name start with "xmlns"
 1505|       |     */
 1506|   292k|    if (atts != NULL) {
  ------------------
  |  Branch (1506:9): [True: 81.5k, False: 210k]
  ------------------
 1507|  81.5k|        i = 0;
 1508|  81.5k|        att = atts[i++];
 1509|  81.5k|        value = atts[i++];
 1510|   181k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1510:16): [True: 100k, False: 81.5k]
  |  Branch (1510:33): [True: 100k, False: 0]
  ------------------
 1511|   100k|            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
  ------------------
  |  Branch (1511:17): [True: 76.6k, False: 23.4k]
  |  Branch (1511:36): [True: 68.7k, False: 7.93k]
  |  Branch (1511:55): [True: 67.8k, False: 915]
  ------------------
 1512|  67.8k|                (att[3] == 'n') && (att[4] == 's'))
  ------------------
  |  Branch (1512:17): [True: 58.2k, False: 9.54k]
  |  Branch (1512:36): [True: 57.9k, False: 313]
  ------------------
 1513|  57.9k|                xmlSAX1Attribute(ctxt, att, value, prefix);
 1514|       |
 1515|   100k|            att = atts[i++];
 1516|   100k|            value = atts[i++];
 1517|   100k|        }
 1518|  81.5k|    }
 1519|       |
 1520|       |    /*
 1521|       |     * Search the namespace, note that since the attributes have been
 1522|       |     * processed, the local namespaces are available.
 1523|       |     */
 1524|   292k|    res = xmlSearchNsSafe(ret, prefix, &ns);
 1525|   292k|    if (res < 0)
  ------------------
  |  Branch (1525:9): [True: 4, False: 292k]
  ------------------
 1526|      4|        xmlSAX2ErrMemory(ctxt);
 1527|   292k|    if ((ns == NULL) && (parent != NULL)) {
  ------------------
  |  Branch (1527:9): [True: 209k, False: 82.9k]
  |  Branch (1527:25): [True: 209k, False: 0]
  ------------------
 1528|   209k|        res = xmlSearchNsSafe(parent, prefix, &ns);
 1529|   209k|        if (res < 0)
  ------------------
  |  Branch (1529:13): [True: 0, False: 209k]
  ------------------
 1530|      0|            xmlSAX2ErrMemory(ctxt);
 1531|   209k|    }
 1532|   292k|    if ((prefix != NULL) && (ns == NULL)) {
  ------------------
  |  Branch (1532:9): [True: 67.2k, False: 225k]
  |  Branch (1532:29): [True: 11.9k, False: 55.2k]
  ------------------
 1533|  11.9k|        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1534|  11.9k|                     "Namespace prefix %s is not defined\n",
 1535|  11.9k|                     prefix, NULL);
 1536|  11.9k|        ns = xmlNewNs(ret, NULL, prefix);
 1537|  11.9k|        if (ns == NULL)
  ------------------
  |  Branch (1537:13): [True: 7, False: 11.9k]
  ------------------
 1538|      7|            xmlSAX2ErrMemory(ctxt);
 1539|  11.9k|    }
 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|   292k|    if ((ns != NULL) && (ns->href != NULL) &&
  ------------------
  |  Branch (1545:9): [True: 94.8k, False: 197k]
  |  Branch (1545:25): [True: 82.9k, False: 11.9k]
  ------------------
 1546|  82.9k|        ((ns->href[0] != 0) || (ns->prefix != NULL)))
  ------------------
  |  Branch (1546:10): [True: 75.8k, False: 7.04k]
  |  Branch (1546:32): [True: 251, False: 6.79k]
  ------------------
 1547|  76.1k|        xmlSetNs(ret, ns);
 1548|       |
 1549|       |    /*
 1550|       |     * process all the other attributes
 1551|       |     */
 1552|   292k|    if (atts != NULL) {
  ------------------
  |  Branch (1552:9): [True: 81.5k, False: 210k]
  ------------------
 1553|  81.5k|        i = 0;
 1554|  81.5k|	att = atts[i++];
 1555|  81.5k|	value = atts[i++];
 1556|   181k|        while ((att != NULL) && (value != NULL)) {
  ------------------
  |  Branch (1556:16): [True: 100k, False: 81.5k]
  |  Branch (1556:33): [True: 100k, False: 0]
  ------------------
 1557|   100k|            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
  ------------------
  |  Branch (1557:17): [True: 23.4k, False: 76.6k]
  |  Branch (1557:36): [True: 7.93k, False: 68.7k]
  |  Branch (1557:55): [True: 915, False: 67.8k]
  ------------------
 1558|  67.8k|                (att[3] != 'n') || (att[4] != 's'))
  ------------------
  |  Branch (1558:17): [True: 9.54k, False: 58.2k]
  |  Branch (1558:36): [True: 313, False: 57.9k]
  ------------------
 1559|  42.1k|                xmlSAX1Attribute(ctxt, att, value, NULL);
 1560|       |
 1561|       |            /*
 1562|       |             * Next ones
 1563|       |             */
 1564|   100k|            att = atts[i++];
 1565|   100k|            value = atts[i++];
 1566|   100k|        }
 1567|  81.5k|    }
 1568|       |
 1569|   292k|#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|   292k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (1574:9): [True: 69.7k, False: 222k]
  ------------------
 1575|  69.7k|        ((ctxt->vctxt.flags & XML_VCTXT_DTD_VALIDATED) == 0)) {
  ------------------
  |  |   16|  69.7k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
  |  Branch (1575:9): [True: 2.61k, False: 67.1k]
  ------------------
 1576|  2.61k|	int chk;
 1577|       |
 1578|  2.61k|	chk = xmlValidateDtdFinal(&ctxt->vctxt, ctxt->myDoc);
 1579|  2.61k|	if (chk <= 0)
  ------------------
  |  Branch (1579:6): [True: 35, False: 2.58k]
  ------------------
 1580|     35|	    ctxt->valid = 0;
 1581|  2.61k|	if (chk < 0)
  ------------------
  |  Branch (1581:6): [True: 0, False: 2.61k]
  ------------------
 1582|      0|	    ctxt->wellFormed = 0;
 1583|  2.61k|	ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 1584|  2.61k|	ctxt->vctxt.flags |= XML_VCTXT_DTD_VALIDATED;
  ------------------
  |  |   16|  2.61k|#define XML_VCTXT_DTD_VALIDATED (1u << 0)
  ------------------
 1585|  2.61k|    }
 1586|   292k|#endif /* LIBXML_VALID_ENABLED */
 1587|       |
 1588|   292k|    if (prefix != NULL)
  ------------------
  |  Branch (1588:9): [True: 67.2k, False: 225k]
  ------------------
 1589|  67.2k|	xmlFree(prefix);
 1590|       |
 1591|   292k|}
SAX2.c:xmlCheckDefaultedAttributes:
 1257|   115k|	const xmlChar *prefix, const xmlChar **atts) {
 1258|   115k|    xmlElementPtr elemDecl;
 1259|   115k|    const xmlChar *att;
 1260|   115k|    int internal = 1;
 1261|   115k|    int i;
 1262|       |
 1263|   115k|    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->intSubset, name, prefix);
 1264|   115k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (1264:9): [True: 68.5k, False: 46.6k]
  ------------------
 1265|  68.5k|	elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset, name, prefix);
 1266|  68.5k|	internal = 0;
 1267|  68.5k|    }
 1268|       |
 1269|   161k|process_external_subset:
 1270|       |
 1271|   161k|    if (elemDecl != NULL) {
  ------------------
  |  Branch (1271:9): [True: 51.1k, False: 110k]
  ------------------
 1272|  51.1k|	xmlAttributePtr attr = elemDecl->attributes;
 1273|       |
 1274|  51.1k|#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|  51.1k|	if ((ctxt->myDoc->standalone == 1) &&
  ------------------
  |  Branch (1282:6): [True: 3.06k, False: 48.0k]
  ------------------
 1283|  3.06k|	    (ctxt->myDoc->extSubset != NULL) &&
  ------------------
  |  Branch (1283:6): [True: 2.82k, False: 243]
  ------------------
 1284|  2.82k|	    (ctxt->validate)) {
  ------------------
  |  Branch (1284:6): [True: 2.62k, False: 202]
  ------------------
 1285|  5.59k|	    while (attr != NULL) {
  ------------------
  |  Branch (1285:13): [True: 2.97k, False: 2.61k]
  ------------------
 1286|  2.97k|		if ((attr->defaultValue != NULL) &&
  ------------------
  |  Branch (1286:7): [True: 1.15k, False: 1.81k]
  ------------------
 1287|  1.15k|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->extSubset,
  ------------------
  |  Branch (1287:7): [True: 1.04k, False: 109]
  ------------------
 1288|  1.15k|					attr->elem, attr->name,
 1289|  1.15k|					attr->prefix) == attr) &&
 1290|  1.04k|		    (xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
  ------------------
  |  Branch (1290:7): [True: 1.04k, False: 0]
  ------------------
 1291|  1.04k|					attr->elem, attr->name,
 1292|  1.04k|					attr->prefix) == NULL)) {
 1293|  1.04k|		    xmlChar *fulln;
 1294|       |
 1295|  1.04k|		    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1295:11): [True: 71, False: 973]
  ------------------
 1296|     71|			fulln = xmlStrdup(attr->prefix);
 1297|     71|                        if (fulln != NULL)
  ------------------
  |  Branch (1297:29): [True: 70, False: 1]
  ------------------
 1298|     70|			    fulln = xmlStrcat(fulln, BAD_CAST ":");
  ------------------
  |  |   34|     70|#define BAD_CAST (xmlChar *)
  ------------------
 1299|     71|                        if (fulln != NULL)
  ------------------
  |  Branch (1299:29): [True: 69, False: 2]
  ------------------
 1300|     69|			    fulln = xmlStrcat(fulln, attr->name);
 1301|    973|		    } else {
 1302|    973|			fulln = xmlStrdup(attr->name);
 1303|    973|		    }
 1304|  1.04k|                    if (fulln == NULL) {
  ------------------
  |  Branch (1304:25): [True: 4, False: 1.04k]
  ------------------
 1305|      4|                        xmlSAX2ErrMemory(ctxt);
 1306|      4|                        break;
 1307|      4|                    }
 1308|       |
 1309|       |		    /*
 1310|       |		     * Check that the attribute is not declared in the
 1311|       |		     * serialization
 1312|       |		     */
 1313|  1.04k|		    att = NULL;
 1314|  1.04k|		    if (atts != NULL) {
  ------------------
  |  Branch (1314:11): [True: 463, False: 577]
  ------------------
 1315|    463|			i = 0;
 1316|    463|			att = atts[i];
 1317|    892|			while (att != NULL) {
  ------------------
  |  Branch (1317:11): [True: 497, False: 395]
  ------------------
 1318|    497|			    if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1318:12): [True: 68, False: 429]
  ------------------
 1319|     68|				break;
 1320|    429|			    i += 2;
 1321|    429|			    att = atts[i];
 1322|    429|			}
 1323|    463|		    }
 1324|  1.04k|		    if (att == NULL) {
  ------------------
  |  Branch (1324:11): [True: 972, False: 68]
  ------------------
 1325|    972|		        xmlErrValid(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 1326|    972|      "standalone: attribute %s on %s defaulted from external subset\n",
 1327|    972|				    fulln,
 1328|    972|				    attr->elem);
 1329|    972|		    }
 1330|  1.04k|                    xmlFree(fulln);
 1331|  1.04k|		}
 1332|  2.96k|		attr = attr->nexth;
 1333|  2.96k|	    }
 1334|  2.62k|	}
 1335|  51.1k|#endif
 1336|       |
 1337|       |	/*
 1338|       |	 * Actually insert defaulted values when needed
 1339|       |	 */
 1340|  51.1k|	attr = elemDecl->attributes;
 1341|   166k|	while (attr != NULL) {
  ------------------
  |  Branch (1341:9): [True: 115k, False: 51.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|   115k|	    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1347:10): [True: 108k, False: 6.51k]
  ------------------
 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|   108k|		if (((attr->prefix != NULL) &&
  ------------------
  |  Branch (1356:8): [True: 53.8k, False: 54.7k]
  ------------------
 1357|  53.8k|		     (xmlStrEqual(attr->prefix, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  53.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1357:8): [True: 18.6k, False: 35.1k]
  ------------------
 1358|  89.8k|		    ((attr->prefix == NULL) &&
  ------------------
  |  Branch (1358:8): [True: 54.7k, False: 35.1k]
  ------------------
 1359|  54.7k|		     (xmlStrEqual(attr->name, BAD_CAST "xmlns"))) ||
  ------------------
  |  |   34|  54.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1359:8): [True: 7.35k, False: 47.3k]
  ------------------
 1360|  82.5k|		    (ctxt->loadsubset & XML_COMPLETE_ATTRS)) {
  ------------------
  |  |  209|  82.5k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (1360:7): [True: 23.3k, False: 59.1k]
  ------------------
 1361|  49.4k|		    xmlAttributePtr tst;
 1362|       |
 1363|  49.4k|		    tst = xmlGetDtdQAttrDesc(ctxt->myDoc->intSubset,
 1364|  49.4k|					     attr->elem, attr->name,
 1365|  49.4k|					     attr->prefix);
 1366|  49.4k|		    if ((tst == attr) || (tst == NULL)) {
  ------------------
  |  Branch (1366:11): [True: 47.4k, False: 1.96k]
  |  Branch (1366:28): [True: 1.96k, False: 0]
  ------------------
 1367|  49.4k|		        xmlChar fn[50];
 1368|  49.4k|			xmlChar *fulln;
 1369|       |
 1370|  49.4k|                        fulln = xmlBuildQName(attr->name, attr->prefix, fn, 50);
 1371|  49.4k|			if (fulln == NULL) {
  ------------------
  |  Branch (1371:8): [True: 2, False: 49.4k]
  ------------------
 1372|      2|			    xmlSAX2ErrMemory(ctxt);
 1373|      2|			    return;
 1374|      2|			}
 1375|       |
 1376|       |			/*
 1377|       |			 * Check that the attribute is not declared in the
 1378|       |			 * serialization
 1379|       |			 */
 1380|  49.4k|			att = NULL;
 1381|  49.4k|			if (atts != NULL) {
  ------------------
  |  Branch (1381:8): [True: 2.18k, False: 47.2k]
  ------------------
 1382|  2.18k|			    i = 0;
 1383|  2.18k|			    att = atts[i];
 1384|  4.56k|			    while (att != NULL) {
  ------------------
  |  Branch (1384:15): [True: 2.77k, False: 1.78k]
  ------------------
 1385|  2.77k|				if (xmlStrEqual(att, fulln))
  ------------------
  |  Branch (1385:9): [True: 393, False: 2.38k]
  ------------------
 1386|    393|				    break;
 1387|  2.38k|				i += 2;
 1388|  2.38k|				att = atts[i];
 1389|  2.38k|			    }
 1390|  2.18k|			}
 1391|  49.4k|			if (att == NULL) {
  ------------------
  |  Branch (1391:8): [True: 49.0k, False: 393]
  ------------------
 1392|  49.0k|			    xmlSAX1Attribute(ctxt, fulln,
 1393|  49.0k|					     attr->defaultValue, prefix);
 1394|  49.0k|			}
 1395|  49.4k|			if ((fulln != fn) && (fulln != attr->name))
  ------------------
  |  Branch (1395:8): [True: 47.1k, False: 2.32k]
  |  Branch (1395:25): [True: 22.6k, False: 24.4k]
  ------------------
 1396|  22.6k|			    xmlFree(fulln);
 1397|  49.4k|		    }
 1398|  49.4k|		}
 1399|   108k|	    }
 1400|   115k|	    attr = attr->nexth;
 1401|   115k|	}
 1402|  51.0k|	if (internal == 1) {
  ------------------
  |  Branch (1402:6): [True: 46.6k, False: 4.44k]
  ------------------
 1403|  46.6k|	    elemDecl = xmlGetDtdQElementDesc(ctxt->myDoc->extSubset,
 1404|  46.6k|		                             name, prefix);
 1405|  46.6k|	    internal = 0;
 1406|  46.6k|	    goto process_external_subset;
 1407|  46.6k|	}
 1408|  51.0k|    }
 1409|   161k|}
SAX2.c:xmlSAX1Attribute:
  960|   149k|{
  961|   149k|    xmlAttrPtr ret;
  962|   149k|    const xmlChar *name;
  963|   149k|    xmlChar *ns;
  964|   149k|    xmlNsPtr namespace;
  965|       |
  966|       |    /*
  967|       |     * Split the full name into a namespace prefix and the tag name
  968|       |     */
  969|   149k|    name = xmlSplitQName4(fullname, &ns);
  970|   149k|    if (name == NULL) {
  ------------------
  |  Branch (970:9): [True: 12, False: 149k]
  ------------------
  971|     12|        xmlSAX2ErrMemory(ctxt);
  972|     12|        return;
  973|     12|    }
  974|       |
  975|       |    /*
  976|       |     * Check whether it's a namespace definition
  977|       |     */
  978|   149k|    if ((ns == NULL) &&
  ------------------
  |  Branch (978:9): [True: 57.9k, False: 91.1k]
  ------------------
  979|  57.9k|        (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
  ------------------
  |  Branch (979:9): [True: 25.9k, False: 32.0k]
  |  Branch (979:29): [True: 17.6k, False: 8.31k]
  |  Branch (979:49): [True: 16.7k, False: 881]
  ------------------
  980|  16.7k|        (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
  ------------------
  |  Branch (980:9): [True: 15.5k, False: 1.14k]
  |  Branch (980:29): [True: 15.1k, False: 480]
  |  Branch (980:49): [True: 14.8k, False: 299]
  ------------------
  981|  14.8k|	xmlNsPtr nsret;
  982|  14.8k|	xmlChar *val;
  983|       |
  984|       |        /* Avoid unused variable warning if features are disabled. */
  985|  14.8k|        (void) nsret;
  986|       |
  987|  14.8k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (987:13): [True: 9.71k, False: 5.08k]
  ------------------
  988|       |            /* TODO: normalize if needed */
  989|  9.71k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
  990|  9.71k|	    if (val == NULL) {
  ------------------
  |  Branch (990:10): [True: 11, False: 9.70k]
  ------------------
  991|     11|	        xmlSAX2ErrMemory(ctxt);
  992|     11|		return;
  993|     11|	    }
  994|  9.71k|	} else {
  995|  5.08k|	    val = (xmlChar *) value;
  996|  5.08k|	}
  997|       |
  998|  14.7k|	if (val[0] != 0) {
  ------------------
  |  Branch (998:6): [True: 10.2k, False: 4.56k]
  ------------------
  999|  10.2k|	    xmlURIPtr uri;
 1000|       |
 1001|  10.2k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1001:10): [True: 13, False: 10.2k]
  ------------------
 1002|     13|                xmlSAX2ErrMemory(ctxt);
 1003|  10.2k|	    if (uri == NULL) {
  ------------------
  |  Branch (1003:10): [True: 2.62k, False: 7.59k]
  ------------------
 1004|  2.62k|                xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1005|  2.62k|                             "xmlns:%s: %s not a valid URI\n", name, value);
 1006|  7.59k|	    } else {
 1007|  7.59k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1007:7): [True: 6.93k, False: 658]
  ------------------
 1008|  6.93k|                    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1009|  6.93k|                                 "xmlns:%s: URI %s is not absolute\n",
 1010|  6.93k|                                 name, value);
 1011|  6.93k|		}
 1012|  7.59k|		xmlFreeURI(uri);
 1013|  7.59k|	    }
 1014|  10.2k|	}
 1015|       |
 1016|       |	/* a default namespace definition */
 1017|  14.7k|	nsret = xmlNewNs(ctxt->node, val, NULL);
 1018|  14.7k|        if (nsret == NULL) {
  ------------------
  |  Branch (1018:13): [True: 13, False: 14.7k]
  ------------------
 1019|     13|            xmlSAX2ErrMemory(ctxt);
 1020|     13|        }
 1021|  14.7k|#ifdef LIBXML_VALID_ENABLED
 1022|       |	/*
 1023|       |	 * Validate also for namespace decls, they are attributes from
 1024|       |	 * an XML-1.0 perspective
 1025|       |	 */
 1026|  14.7k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1026:18): [True: 2.46k, False: 12.3k]
  |  Branch (1026:36): [True: 1.86k, False: 605]
  ------------------
 1027|  1.86k|                 ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1027:18): [True: 1.86k, False: 0]
  |  Branch (1027:33): [True: 1.86k, False: 0]
  ------------------
 1028|  1.86k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1029|  1.86k|					   ctxt->node, prefix, nsret, val);
 1030|  1.86k|        }
 1031|  14.7k|#endif /* LIBXML_VALID_ENABLED */
 1032|  14.7k|	if (val != value)
  ------------------
  |  Branch (1032:6): [True: 9.70k, False: 5.08k]
  ------------------
 1033|  9.70k|	    xmlFree(val);
 1034|  14.7k|	return;
 1035|  14.8k|    }
 1036|   134k|    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
  ------------------
  |  Branch (1036:9): [True: 91.1k, False: 43.1k]
  |  Branch (1036:25): [True: 82.8k, False: 8.28k]
  |  Branch (1036:43): [True: 81.8k, False: 1.08k]
  |  Branch (1036:61): [True: 80.6k, False: 1.15k]
  ------------------
 1037|  80.6k|        (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
  ------------------
  |  Branch (1037:9): [True: 70.2k, False: 10.3k]
  |  Branch (1037:27): [True: 69.9k, False: 303]
  |  Branch (1037:45): [True: 68.9k, False: 997]
  ------------------
 1038|  68.9k|	xmlNsPtr nsret;
 1039|  68.9k|	xmlChar *val;
 1040|       |
 1041|       |        /* Avoid unused variable warning if features are disabled. */
 1042|  68.9k|        (void) nsret;
 1043|       |
 1044|  68.9k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1044:13): [True: 21.7k, False: 47.2k]
  ------------------
 1045|       |            /* TODO: normalize if needed */
 1046|  21.7k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1047|  21.7k|	    if (val == NULL) {
  ------------------
  |  Branch (1047:10): [True: 1, False: 21.7k]
  ------------------
 1048|      1|	        xmlSAX2ErrMemory(ctxt);
 1049|      1|	        xmlFree(ns);
 1050|      1|		return;
 1051|      1|	    }
 1052|  47.2k|	} else {
 1053|  47.2k|	    val = (xmlChar *) value;
 1054|  47.2k|	}
 1055|       |
 1056|  68.9k|	if (val[0] == 0) {
  ------------------
  |  Branch (1056:6): [True: 390, False: 68.5k]
  ------------------
 1057|    390|	    xmlNsErrMsg(ctxt, XML_NS_ERR_EMPTY,
 1058|    390|		        "Empty namespace name for prefix %s\n", name, NULL);
 1059|    390|	}
 1060|  68.9k|	if ((ctxt->pedantic != 0) && (val[0] != 0)) {
  ------------------
  |  Branch (1060:6): [True: 41.6k, False: 27.2k]
  |  Branch (1060:31): [True: 41.3k, False: 283]
  ------------------
 1061|  41.3k|	    xmlURIPtr uri;
 1062|       |
 1063|  41.3k|	    if (xmlParseURISafe((const char *)val, &uri) < 0)
  ------------------
  |  Branch (1063:10): [True: 8, False: 41.3k]
  ------------------
 1064|      8|                xmlSAX2ErrMemory(ctxt);
 1065|  41.3k|	    if (uri == NULL) {
  ------------------
  |  Branch (1065:10): [True: 1.74k, False: 39.6k]
  ------------------
 1066|  1.74k|	        xmlNsWarnMsg(ctxt, XML_WAR_NS_URI,
 1067|  1.74k|			 "xmlns:%s: %s not a valid URI\n", name, value);
 1068|  39.6k|	    } else {
 1069|  39.6k|		if (uri->scheme == NULL) {
  ------------------
  |  Branch (1069:7): [True: 37.6k, False: 2.00k]
  ------------------
 1070|  37.6k|		    xmlNsWarnMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
 1071|  37.6k|			   "xmlns:%s: URI %s is not absolute\n", name, value);
 1072|  37.6k|		}
 1073|  39.6k|		xmlFreeURI(uri);
 1074|  39.6k|	    }
 1075|  41.3k|	}
 1076|       |
 1077|       |	/* a standard namespace definition */
 1078|  68.9k|	nsret = xmlNewNs(ctxt->node, val, name);
 1079|  68.9k|	xmlFree(ns);
 1080|       |
 1081|  68.9k|        if (nsret == NULL) {
  ------------------
  |  Branch (1081:13): [True: 4, False: 68.9k]
  ------------------
 1082|      4|            xmlSAX2ErrMemory(ctxt);
 1083|      4|        }
 1084|  68.9k|#ifdef LIBXML_VALID_ENABLED
 1085|       |	/*
 1086|       |	 * Validate also for namespace decls, they are attributes from
 1087|       |	 * an XML-1.0 perspective
 1088|       |	 */
 1089|  68.9k|        else if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1089:18): [True: 3.85k, False: 65.1k]
  |  Branch (1089:36): [True: 2.69k, False: 1.15k]
  ------------------
 1090|  2.69k|	         ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1090:11): [True: 2.69k, False: 0]
  |  Branch (1090:26): [True: 2.69k, False: 0]
  ------------------
 1091|  2.69k|	    ctxt->valid &= xmlValidateOneNamespace(&ctxt->vctxt, ctxt->myDoc,
 1092|  2.69k|					   ctxt->node, prefix, nsret, value);
 1093|  2.69k|        }
 1094|  68.9k|#endif /* LIBXML_VALID_ENABLED */
 1095|  68.9k|	if (val != value)
  ------------------
  |  Branch (1095:6): [True: 21.7k, False: 47.2k]
  ------------------
 1096|  21.7k|	    xmlFree(val);
 1097|  68.9k|	return;
 1098|  68.9k|    }
 1099|       |
 1100|  65.3k|    if (ns != NULL) {
  ------------------
  |  Branch (1100:9): [True: 22.1k, False: 43.1k]
  ------------------
 1101|  22.1k|        int res;
 1102|       |
 1103|  22.1k|	res = xmlSearchNsSafe(ctxt->node, ns, &namespace);
 1104|  22.1k|        if (res < 0)
  ------------------
  |  Branch (1104:13): [True: 8, False: 22.1k]
  ------------------
 1105|      8|            xmlSAX2ErrMemory(ctxt);
 1106|       |
 1107|  22.1k|	if (namespace == NULL) {
  ------------------
  |  Branch (1107:6): [True: 9.35k, False: 12.8k]
  ------------------
 1108|  9.35k|	    xmlNsErrMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 1109|  9.35k|		    "Namespace prefix %s of attribute %s is not defined\n",
 1110|  9.35k|		             ns, name);
 1111|  12.8k|	} else {
 1112|  12.8k|            xmlAttrPtr prop;
 1113|       |
 1114|  12.8k|            prop = ctxt->node->properties;
 1115|  38.1k|            while (prop != NULL) {
  ------------------
  |  Branch (1115:20): [True: 25.4k, False: 12.6k]
  ------------------
 1116|  25.4k|                if (prop->ns != NULL) {
  ------------------
  |  Branch (1116:21): [True: 11.8k, False: 13.5k]
  ------------------
 1117|  11.8k|                    if ((xmlStrEqual(name, prop->name)) &&
  ------------------
  |  Branch (1117:25): [True: 414, False: 11.4k]
  ------------------
 1118|    414|                        ((namespace == prop->ns) ||
  ------------------
  |  Branch (1118:26): [True: 0, False: 414]
  ------------------
 1119|    414|                         (xmlStrEqual(namespace->href, prop->ns->href)))) {
  ------------------
  |  Branch (1119:26): [True: 207, False: 207]
  ------------------
 1120|    207|                        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER,
 1121|    207|                                   XML_ERR_ATTRIBUTE_REDEFINED, XML_ERR_FATAL,
 1122|    207|                                   name, NULL, NULL, 0,
 1123|    207|                                   "Attribute %s in %s redefined\n",
 1124|    207|                                   name, namespace->href);
 1125|    207|                        goto error;
 1126|    207|                    }
 1127|  11.8k|                }
 1128|  25.2k|                prop = prop->next;
 1129|  25.2k|            }
 1130|  12.8k|        }
 1131|  43.1k|    } else {
 1132|  43.1k|	namespace = NULL;
 1133|  43.1k|    }
 1134|       |
 1135|       |    /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
 1136|  65.1k|    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
 1137|  65.1k|    if (ret == NULL) {
  ------------------
  |  Branch (1137:9): [True: 32, False: 65.1k]
  ------------------
 1138|     32|        xmlSAX2ErrMemory(ctxt);
 1139|     32|        goto error;
 1140|     32|    }
 1141|       |
 1142|  65.1k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (1142:9): [True: 28.3k, False: 36.7k]
  ------------------
 1143|  28.3k|        if (xmlNodeParseAttValue(ret->doc, ret, value, SIZE_MAX, NULL) < 0)
  ------------------
  |  Branch (1143:13): [True: 40, False: 28.3k]
  ------------------
 1144|     40|            xmlSAX2ErrMemory(ctxt);
 1145|  36.7k|    } else if (value != NULL) {
  ------------------
  |  Branch (1145:16): [True: 36.7k, False: 0]
  ------------------
 1146|  36.7k|        ret->children = xmlNewDocText(ctxt->myDoc, value);
 1147|  36.7k|        if (ret->children == NULL) {
  ------------------
  |  Branch (1147:13): [True: 25, False: 36.6k]
  ------------------
 1148|     25|            xmlSAX2ErrMemory(ctxt);
 1149|  36.6k|        } else {
 1150|  36.6k|            ret->last = ret->children;
 1151|  36.6k|            ret->children->parent = (xmlNodePtr) ret;
 1152|  36.6k|        }
 1153|  36.7k|    }
 1154|       |
 1155|  65.1k|#ifdef LIBXML_VALID_ENABLED
 1156|  65.1k|    if (ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (1156:9): [True: 20.3k, False: 44.7k]
  |  Branch (1156:27): [True: 7.14k, False: 13.2k]
  ------------------
 1157|  7.14k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (1157:9): [True: 7.14k, False: 0]
  |  Branch (1157:24): [True: 7.14k, 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|  7.14k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (1163:13): [True: 3.49k, False: 3.64k]
  ------------------
 1164|  3.49k|	    xmlChar *val;
 1165|       |
 1166|       |            /* TODO: normalize if needed */
 1167|  3.49k|	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 1168|       |
 1169|  3.49k|	    if (val == NULL)
  ------------------
  |  Branch (1169:10): [True: 3, False: 3.49k]
  ------------------
 1170|      3|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1171|      3|				ctxt->myDoc, ctxt->node, ret, value);
 1172|  3.49k|	    else {
 1173|  3.49k|		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|  3.49k|                nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 1181|  3.49k|                                 &ctxt->vctxt, ctxt->myDoc,
 1182|  3.49k|                                 ctxt->node, fullname, val);
 1183|  3.49k|		if (nvalnorm != NULL) {
  ------------------
  |  Branch (1183:7): [True: 1.95k, False: 1.54k]
  ------------------
 1184|  1.95k|		    xmlFree(val);
 1185|  1.95k|		    val = nvalnorm;
 1186|  1.95k|		}
 1187|       |
 1188|  3.49k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 1189|  3.49k|			        ctxt->myDoc, ctxt->node, ret, val);
 1190|  3.49k|                xmlFree(val);
 1191|  3.49k|	    }
 1192|  3.64k|	} 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|  3.64k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (1199:17): [True: 726, False: 2.92k]
  ------------------
 1200|    726|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    726|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1201|       |
 1202|  3.64k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt, ctxt->myDoc,
 1203|  3.64k|					       ctxt->node, ret, value);
 1204|       |
 1205|  3.64k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  3.64k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 1206|  3.64k|	}
 1207|  7.14k|    } else
 1208|  57.9k|#endif /* LIBXML_VALID_ENABLED */
 1209|  57.9k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|  57.9k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (1209:16): [True: 31.5k, False: 26.3k]
  ------------------
 1210|  31.5k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (1210:16): [True: 30.0k, False: 1.52k]
  ------------------
 1211|       |               /* Don't create IDs containing entity references */
 1212|  30.0k|               (ret->children != NULL) &&
  ------------------
  |  Branch (1212:16): [True: 27.6k, False: 2.37k]
  ------------------
 1213|  27.6k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1213:16): [True: 27.3k, False: 335]
  ------------------
 1214|  27.3k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (1214:16): [True: 27.0k, False: 274]
  ------------------
 1215|  27.0k|        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|  27.0k|	if (xmlStrEqual(fullname, BAD_CAST "xml:id")) {
  ------------------
  |  |   34|  27.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1220:6): [True: 1.34k, False: 25.7k]
  ------------------
 1221|       |	    /*
 1222|       |	     * Add the xml:id value
 1223|       |	     *
 1224|       |	     * Open issue: normalization of the value.
 1225|       |	     */
 1226|  1.34k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (1226:10): [True: 1.01k, False: 336]
  ------------------
 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.34k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1232|  25.7k|	} else {
 1233|  25.7k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 1234|       |
 1235|  25.7k|            if (res < 0)
  ------------------
  |  Branch (1235:17): [True: 1, False: 25.7k]
  ------------------
 1236|      1|                xmlCtxtErrMemory(ctxt);
 1237|  25.7k|            else if (res > 0)
  ------------------
  |  Branch (1237:22): [True: 2.09k, False: 23.6k]
  ------------------
 1238|  2.09k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1239|  23.6k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (1239:22): [True: 6.03k, False: 17.5k]
  ------------------
 1240|  6.03k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 1241|  25.7k|        }
 1242|  27.0k|    }
 1243|       |
 1244|  65.3k|error:
 1245|  65.3k|    if (ns != NULL)
  ------------------
  |  Branch (1245:9): [True: 22.1k, False: 43.1k]
  ------------------
 1246|  22.1k|	xmlFree(ns);
 1247|  65.3k|}
SAX2.c:xmlNsErrMsg:
  942|  9.74k|{
  943|  9.74k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  944|       |               str1, str2, NULL, 0, msg, str1, str2);
  945|  9.74k|}
SAX2.c:xmlErrValid:
   59|  12.7k|{
   60|  12.7k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
   61|  12.7k|               str1, str2, NULL, 0, msg, str1, str2);
   62|  12.7k|    if (ctxt != NULL)
  ------------------
  |  Branch (62:9): [True: 12.7k, False: 0]
  ------------------
   63|  12.7k|	ctxt->valid = 0;
   64|  12.7k|}
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: 10.4k, False: 1.91M]
  ------------------
  900|  10.4k|	parent = (xmlNodePtr) ctxt->myDoc->intSubset;
  901|  1.91M|    } else if (ctxt->inSubset == 2) {
  ------------------
  |  Branch (901:16): [True: 148k, False: 1.76M]
  ------------------
  902|   148k|	parent = (xmlNodePtr) ctxt->myDoc->extSubset;
  903|  1.76M|    } else {
  904|  1.76M|        parent = ctxt->node;
  905|  1.76M|        if (parent == NULL)
  ------------------
  |  Branch (905:13): [True: 139k, False: 1.62M]
  ------------------
  906|   139k|            parent = (xmlNodePtr) ctxt->myDoc;
  907|  1.76M|    }
  908|       |
  909|  1.92M|    last = parent->last;
  910|  1.92M|    if (last == NULL) {
  ------------------
  |  Branch (910:9): [True: 311k, False: 1.61M]
  ------------------
  911|   311k|        parent->children = node;
  912|  1.61M|    } else {
  913|  1.61M|        last->next = node;
  914|  1.61M|        node->prev = last;
  915|  1.61M|    }
  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.40M, False: 524k]
  ------------------
  921|  1.40M|	(ctxt->input != NULL)) {
  ------------------
  |  Branch (921:2): [True: 1.40M, False: 0]
  ------------------
  922|  1.40M|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (922:13): [True: 1.34M, False: 60.0k]
  ------------------
  923|  1.34M|            node->line = ctxt->input->line;
  924|  60.0k|        else
  925|  60.0k|            node->line = USHRT_MAX;
  926|  1.40M|    }
  927|  1.92M|}
SAX2.c:xmlNsWarnMsg:
  128|  60.9k|{
  129|  60.9k|    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  130|       |               str1, str2, NULL, 0, msg, str1, str2);
  131|  60.9k|}
SAX2.c:xmlSAX2AttributeNs:
 1908|   345k|{
 1909|   345k|    xmlAttrPtr ret;
 1910|   345k|    xmlNsPtr namespace = NULL;
 1911|   345k|    xmlChar *dup = NULL;
 1912|       |
 1913|       |    /*
 1914|       |     * Note: if prefix == NULL, the attribute is not in the default namespace
 1915|       |     */
 1916|   345k|    if (prefix != NULL) {
  ------------------
  |  Branch (1916:9): [True: 123k, False: 221k]
  ------------------
 1917|   123k|	namespace = xmlParserNsLookupSax(ctxt, prefix);
 1918|   123k|	if ((namespace == NULL) && (xmlStrEqual(prefix, BAD_CAST "xml"))) {
  ------------------
  |  |   34|   105k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1918:6): [True: 105k, False: 17.3k]
  |  Branch (1918:29): [True: 105k, False: 203]
  ------------------
 1919|   105k|            int res;
 1920|       |
 1921|   105k|	    res = xmlSearchNsSafe(ctxt->node, prefix, &namespace);
 1922|   105k|            if (res < 0)
  ------------------
  |  Branch (1922:17): [True: 8, False: 105k]
  ------------------
 1923|      8|                xmlSAX2ErrMemory(ctxt);
 1924|   105k|	}
 1925|   123k|    }
 1926|       |
 1927|       |    /*
 1928|       |     * allocate the node
 1929|       |     */
 1930|   345k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (1930:9): [True: 1.46k, False: 343k]
  ------------------
 1931|  1.46k|        ret = ctxt->freeAttrs;
 1932|  1.46k|	ctxt->freeAttrs = ret->next;
 1933|  1.46k|	ctxt->freeAttrsNr--;
 1934|   343k|    } else {
 1935|   343k|        ret = xmlMalloc(sizeof(*ret));
 1936|   343k|        if (ret == NULL) {
  ------------------
  |  Branch (1936:13): [True: 21, False: 343k]
  ------------------
 1937|     21|            xmlSAX2ErrMemory(ctxt);
 1938|     21|            return(NULL);
 1939|     21|        }
 1940|   343k|    }
 1941|       |
 1942|   344k|    memset(ret, 0, sizeof(xmlAttr));
 1943|   344k|    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|   344k|    ret->parent = ctxt->node;
 1955|   344k|    ret->doc = ctxt->node->doc;
 1956|   344k|    ret->ns = namespace;
 1957|       |
 1958|   344k|    if (ctxt->dictNames) {
  ------------------
  |  Branch (1958:9): [True: 187k, False: 157k]
  ------------------
 1959|   187k|        ret->name = localname;
 1960|   187k|    } else {
 1961|   157k|        ret->name = xmlStrdup(localname);
 1962|   157k|        if (ret->name == NULL)
  ------------------
  |  Branch (1962:13): [True: 61, False: 157k]
  ------------------
 1963|     61|            xmlSAX2ErrMemory(ctxt);
 1964|   157k|    }
 1965|       |
 1966|   344k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1966:9): [True: 0, False: 344k]
  |  Branch (1966:35): [True: 0, False: 0]
  ------------------
 1967|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1968|       |
 1969|   344k|    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
  ------------------
  |  Branch (1969:9): [True: 102k, False: 242k]
  |  Branch (1969:41): [True: 102k, False: 0]
  ------------------
 1970|   102k|	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|   102k|	if (*valueend != 0) {
  ------------------
  |  Branch (1977:6): [True: 30.7k, False: 71.5k]
  ------------------
 1978|  30.7k|	    tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1979|  30.7k|	    ret->children = tmp;
 1980|  30.7k|	    ret->last = tmp;
 1981|  30.7k|	    if (tmp != NULL) {
  ------------------
  |  Branch (1981:10): [True: 30.6k, False: 15]
  ------------------
 1982|  30.6k|		tmp->parent = (xmlNodePtr) ret;
 1983|  30.6k|	    }
 1984|  71.5k|	} else if (valueend > value) {
  ------------------
  |  Branch (1984:13): [True: 70.7k, False: 844]
  ------------------
 1985|  70.7k|            if (xmlNodeParseAttValue(ret->doc, ret, value, valueend - value,
  ------------------
  |  Branch (1985:17): [True: 37, False: 70.6k]
  ------------------
 1986|  70.7k|                                     NULL) < 0)
 1987|     37|                xmlSAX2ErrMemory(ctxt);
 1988|  70.7k|	}
 1989|   242k|    } else if (value != NULL) {
  ------------------
  |  Branch (1989:16): [True: 242k, False: 0]
  ------------------
 1990|   242k|	xmlNodePtr tmp;
 1991|       |
 1992|   242k|	tmp = xmlSAX2TextNode(ctxt, ret->doc, value, valueend - value);
 1993|   242k|	ret->children = tmp;
 1994|   242k|	ret->last = tmp;
 1995|   242k|	if (tmp != NULL) {
  ------------------
  |  Branch (1995:6): [True: 242k, False: 30]
  ------------------
 1996|   242k|	    tmp->parent = (xmlNodePtr) ret;
 1997|   242k|	}
 1998|   242k|    }
 1999|       |
 2000|   344k|#ifdef LIBXML_VALID_ENABLED
 2001|   344k|    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
  ------------------
  |  Branch (2001:9): [True: 344k, False: 0]
  |  Branch (2001:26): [True: 184k, False: 160k]
  |  Branch (2001:44): [True: 54.9k, False: 129k]
  ------------------
 2002|  54.9k|        ctxt->myDoc && ctxt->myDoc->intSubset) {
  ------------------
  |  Branch (2002:9): [True: 54.9k, False: 0]
  |  Branch (2002:24): [True: 54.9k, 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|  54.9k|        if (!ctxt->replaceEntities) {
  ------------------
  |  Branch (2007:13): [True: 7.68k, False: 47.2k]
  ------------------
 2008|  7.68k|	    dup = xmlSAX2DecodeAttrEntities(ctxt, value, valueend);
 2009|  7.68k|	    if (dup == NULL) {
  ------------------
  |  Branch (2009:10): [True: 5.42k, False: 2.26k]
  ------------------
 2010|  5.42k|	        if (*valueend == 0) {
  ------------------
  |  Branch (2010:14): [True: 3.86k, False: 1.55k]
  ------------------
 2011|  3.86k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2012|  3.86k|				    ctxt->myDoc, ctxt->node, ret, value);
 2013|  3.86k|		} 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|  1.55k|		    dup = xmlStrndup(value, valueend - value);
 2020|  1.55k|                    if (dup == NULL)
  ------------------
  |  Branch (2020:25): [True: 2, False: 1.55k]
  ------------------
 2021|      2|                        xmlSAX2ErrMemory(ctxt);
 2022|       |
 2023|  1.55k|		    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2024|  1.55k|				    ctxt->myDoc, ctxt->node, ret, dup);
 2025|  1.55k|		}
 2026|  5.42k|	    } 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.26k|		if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (2034:7): [True: 1.97k, False: 290]
  ------------------
 2035|  1.97k|		    xmlChar *nvalnorm;
 2036|  1.97k|		    xmlChar fn[50];
 2037|  1.97k|		    xmlChar *fullname;
 2038|       |
 2039|  1.97k|		    fullname = xmlBuildQName(localname, prefix, fn, 50);
 2040|  1.97k|                    if (fullname == NULL) {
  ------------------
  |  Branch (2040:25): [True: 1, False: 1.97k]
  ------------------
 2041|      1|                        xmlSAX2ErrMemory(ctxt);
 2042|  1.97k|                    } else {
 2043|  1.97k|			ctxt->vctxt.valid = 1;
 2044|  1.97k|		        nvalnorm = xmlValidCtxtNormalizeAttributeValue(
 2045|  1.97k|			                 &ctxt->vctxt, ctxt->myDoc,
 2046|  1.97k|					 ctxt->node, fullname, dup);
 2047|  1.97k|			if (ctxt->vctxt.valid != 1)
  ------------------
  |  Branch (2047:8): [True: 34, False: 1.94k]
  ------------------
 2048|     34|			    ctxt->valid = 0;
 2049|       |
 2050|  1.97k|			if ((fullname != fn) && (fullname != localname))
  ------------------
  |  Branch (2050:8): [True: 1.89k, False: 83]
  |  Branch (2050:28): [True: 522, False: 1.37k]
  ------------------
 2051|    522|			    xmlFree(fullname);
 2052|  1.97k|			if (nvalnorm != NULL) {
  ------------------
  |  Branch (2052:8): [True: 1.90k, False: 70]
  ------------------
 2053|  1.90k|			    xmlFree(dup);
 2054|  1.90k|			    dup = nvalnorm;
 2055|  1.90k|			}
 2056|  1.97k|		    }
 2057|  1.97k|		}
 2058|       |
 2059|  2.26k|		ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2060|  2.26k|			        ctxt->myDoc, ctxt->node, ret, dup);
 2061|  2.26k|	    }
 2062|  47.2k|	} else {
 2063|       |	    /*
 2064|       |	     * if entities already have been substituted, then
 2065|       |	     * the attribute as passed is already normalized
 2066|       |	     */
 2067|  47.2k|	    dup = xmlStrndup(value, valueend - value);
 2068|  47.2k|            if (dup == NULL)
  ------------------
  |  Branch (2068:17): [True: 11, False: 47.2k]
  ------------------
 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|  47.2k|            if (ctxt->input->entity != NULL)
  ------------------
  |  Branch (2077:17): [True: 894, False: 46.3k]
  ------------------
 2078|    894|                ctxt->vctxt.flags |= XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|    894|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2079|       |
 2080|  47.2k|	    ctxt->valid &= xmlValidateOneAttribute(&ctxt->vctxt,
 2081|  47.2k|	                             ctxt->myDoc, ctxt->node, ret, dup);
 2082|       |
 2083|  47.2k|            ctxt->vctxt.flags &= ~XML_VCTXT_IN_ENTITY;
  ------------------
  |  |   28|  47.2k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
 2084|  47.2k|	}
 2085|  54.9k|    } else
 2086|   290k|#endif /* LIBXML_VALID_ENABLED */
 2087|   290k|           if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   290k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (2087:16): [True: 119k, False: 170k]
  ------------------
 2088|   119k|               (ctxt->input->entity == NULL) &&
  ------------------
  |  Branch (2088:16): [True: 116k, False: 3.00k]
  ------------------
 2089|       |               /* Don't create IDs containing entity references */
 2090|   116k|               (ret->children != NULL) &&
  ------------------
  |  Branch (2090:16): [True: 115k, False: 366]
  ------------------
 2091|   115k|               (ret->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2091:16): [True: 115k, False: 425]
  ------------------
 2092|   115k|               (ret->children->next == NULL)) {
  ------------------
  |  Branch (2092:16): [True: 114k, False: 360]
  ------------------
 2093|   114k|        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|   114k|        if ((prefix == ctxt->str_xml) &&
  ------------------
  |  Branch (2098:13): [True: 27.5k, False: 87.3k]
  ------------------
 2099|  27.5k|	           (localname[0] == 'i') && (localname[1] == 'd') &&
  ------------------
  |  Branch (2099:13): [True: 2.24k, False: 25.2k]
  |  Branch (2099:38): [True: 1.92k, False: 325]
  ------------------
 2100|  1.92k|		   (localname[2] == 0)) {
  ------------------
  |  Branch (2100:6): [True: 1.60k, False: 322]
  ------------------
 2101|       |	    /*
 2102|       |	     * Add the xml:id value
 2103|       |	     *
 2104|       |	     * Open issue: normalization of the value.
 2105|       |	     */
 2106|  1.60k|	    if (xmlValidateNCName(content, 1) != 0) {
  ------------------
  |  Branch (2106:10): [True: 1.07k, False: 524]
  ------------------
 2107|  1.07k|	        xmlErrId(ctxt, XML_DTD_XMLID_VALUE,
 2108|  1.07k|                         "xml:id : attribute value %s is not an NCName\n",
 2109|  1.07k|                         content);
 2110|  1.07k|	    }
 2111|  1.60k|	    xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2112|   113k|	} else {
 2113|   113k|            int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
 2114|       |
 2115|   113k|            if (res < 0)
  ------------------
  |  Branch (2115:17): [True: 1, False: 113k]
  ------------------
 2116|      1|                xmlCtxtErrMemory(ctxt);
 2117|   113k|            else if (res > 0)
  ------------------
  |  Branch (2117:22): [True: 2.94k, False: 110k]
  ------------------
 2118|  2.94k|                xmlAddID(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2119|   110k|            else if (xmlIsRef(ctxt->myDoc, ctxt->node, ret))
  ------------------
  |  Branch (2119:22): [True: 14.2k, False: 96.0k]
  ------------------
 2120|  14.2k|                xmlAddRef(&ctxt->vctxt, ctxt->myDoc, content, ret);
 2121|   113k|	}
 2122|   114k|    }
 2123|   344k|    if (dup != NULL)
  ------------------
  |  Branch (2123:9): [True: 51.0k, False: 293k]
  ------------------
 2124|  51.0k|	xmlFree(dup);
 2125|       |
 2126|   344k|    return(ret);
 2127|   345k|}
SAX2.c:xmlSAX2TextNode:
 1783|   918k|                int len) {
 1784|   918k|    xmlNodePtr ret;
 1785|   918k|    const xmlChar *intern = NULL;
 1786|       |
 1787|       |    /*
 1788|       |     * Allocate
 1789|       |     */
 1790|   918k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (1790:9): [True: 1.65k, False: 917k]
  ------------------
 1791|  1.65k|	ret = ctxt->freeElems;
 1792|  1.65k|	ctxt->freeElems = ret->next;
 1793|  1.65k|	ctxt->freeElemsNr--;
 1794|   917k|    } else {
 1795|   917k|	ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1796|   917k|    }
 1797|   918k|    if (ret == NULL) {
  ------------------
  |  Branch (1797:9): [True: 81, False: 918k]
  ------------------
 1798|     81|        xmlCtxtErrMemory(ctxt);
 1799|     81|	return(NULL);
 1800|     81|    }
 1801|   918k|    memset(ret, 0, sizeof(xmlNode));
 1802|       |    /*
 1803|       |     * intern the formatting blanks found between tags, or the
 1804|       |     * very short strings
 1805|       |     */
 1806|   918k|    if ((!ctxt->html) && (ctxt->dictNames)) {
  ------------------
  |  Branch (1806:9): [True: 918k, False: 0]
  |  Branch (1806:26): [True: 510k, False: 407k]
  ------------------
 1807|   510k|        xmlChar cur = str[len];
 1808|       |
 1809|   510k|	if ((len < (int) (2 * sizeof(void *))) &&
  ------------------
  |  Branch (1809:6): [True: 386k, False: 124k]
  ------------------
 1810|   386k|	    (ctxt->options & XML_PARSE_COMPACT)) {
  ------------------
  |  Branch (1810:6): [True: 386k, False: 0]
  ------------------
 1811|       |	    /* store the string in the node overriding properties and nsDef */
 1812|   386k|	    xmlChar *tmp = (xmlChar *) &(ret->properties);
 1813|   386k|	    memcpy(tmp, str, len);
 1814|   386k|	    tmp[len] = 0;
 1815|   386k|	    intern = tmp;
 1816|   386k|	} else if ((len <= 3) && ((cur == '"') || (cur == '\'') ||
  ------------------
  |  Branch (1816:13): [True: 0, False: 124k]
  |  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|   124k|	} else if (IS_BLANK_CH(*str) && (len < 60) && (cur == '<') &&
  ------------------
  |  |  137|   124k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   249k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.67k, False: 121k]
  |  |  |  |  ------------------
  |  |  |  |   91|   124k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 121k, False: 219]
  |  |  |  |  |  Branch (91:23): [True: 3.53k, False: 118k]
  |  |  |  |  ------------------
  |  |  |  |   92|   249k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 223, False: 118k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1824:34): [True: 5.20k, False: 1.22k]
  |  Branch (1824:48): [True: 4.10k, False: 1.10k]
  ------------------
 1825|  4.10k|	           (str[len + 1] != '!')) {
  ------------------
  |  Branch (1825:13): [True: 3.62k, False: 477]
  ------------------
 1826|  3.62k|	    int i;
 1827|       |
 1828|  40.6k|	    for (i = 1;i < len;i++) {
  ------------------
  |  Branch (1828:17): [True: 39.2k, False: 1.38k]
  ------------------
 1829|  39.2k|		if (!IS_BLANK_CH(str[i])) goto skip;
  ------------------
  |  |  137|  39.2k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  39.2k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 27.3k, False: 11.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|  39.2k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 11.8k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 9.65k, False: 2.23k]
  |  |  |  |  ------------------
  |  |  |  |   92|  39.2k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1830|  39.2k|	    }
 1831|  1.38k|	    intern = xmlDictLookup(ctxt->dict, str, len);
 1832|  1.38k|            if (intern == NULL) {
  ------------------
  |  Branch (1832:17): [True: 1, False: 1.38k]
  ------------------
 1833|      1|                xmlSAX2ErrMemory(ctxt);
 1834|      1|                xmlFree(ret);
 1835|      1|                return(NULL);
 1836|      1|            }
 1837|  1.38k|	}
 1838|   510k|    }
 1839|   918k|skip:
 1840|   918k|    ret->type = XML_TEXT_NODE;
 1841|   918k|    ret->doc = doc;
 1842|       |
 1843|   918k|    ret->name = xmlStringText;
 1844|   918k|    if (intern == NULL) {
  ------------------
  |  Branch (1844:9): [True: 530k, False: 387k]
  ------------------
 1845|   530k|	ret->content = xmlStrndup(str, len);
 1846|   530k|	if (ret->content == NULL) {
  ------------------
  |  Branch (1846:6): [True: 53, False: 530k]
  ------------------
 1847|     53|	    xmlSAX2ErrMemory(ctxt);
 1848|     53|	    xmlFree(ret);
 1849|     53|	    return(NULL);
 1850|     53|	}
 1851|   530k|    } else
 1852|   387k|	ret->content = (xmlChar *) intern;
 1853|       |
 1854|   918k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1854:9): [True: 0, False: 918k]
  |  Branch (1854:35): [True: 0, False: 0]
  ------------------
 1855|      0|	xmlRegisterNodeDefaultValue(ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1856|   918k|    return(ret);
 1857|   918k|}
SAX2.c:xmlSAX2DecodeAttrEntities:
 1871|  7.68k|                          const xmlChar *end) {
 1872|  7.68k|    const xmlChar *in;
 1873|       |
 1874|  7.68k|    in = str;
 1875|  57.5k|    while (in < end)
  ------------------
  |  Branch (1875:12): [True: 52.0k, False: 5.42k]
  ------------------
 1876|  52.0k|        if (*in++ == '&')
  ------------------
  |  Branch (1876:13): [True: 2.26k, False: 49.8k]
  ------------------
 1877|  2.26k|	    goto decode;
 1878|  5.42k|    return(NULL);
 1879|  2.26k|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.26k|    return(xmlExpandEntitiesInAttValue(ctxt, str, /* normalize */ 0));
 1886|  7.68k|}
SAX2.c:xmlSAX2Text:
 2473|   918k|{
 2474|   918k|    xmlNodePtr lastChild;
 2475|   918k|    xmlNodePtr parent;
 2476|       |
 2477|   918k|    if (ctxt == NULL)
  ------------------
  |  Branch (2477:9): [True: 0, False: 918k]
  ------------------
 2478|      0|        return;
 2479|       |
 2480|   918k|    parent = ctxt->node;
 2481|   918k|    if (parent == NULL)
  ------------------
  |  Branch (2481:9): [True: 0, False: 918k]
  ------------------
 2482|      0|        return;
 2483|   918k|    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|   918k|    if ((lastChild == NULL) ||
  ------------------
  |  Branch (2492:9): [True: 121k, False: 796k]
  ------------------
 2493|   796k|        (lastChild->type != type) ||
  ------------------
  |  Branch (2493:9): [True: 600k, False: 196k]
  ------------------
 2494|   722k|        ((!ctxt->html) && (type != XML_TEXT_NODE))) {
  ------------------
  |  Branch (2494:10): [True: 196k, False: 0]
  |  Branch (2494:27): [True: 764, False: 195k]
  ------------------
 2495|   722k|        xmlNode *node;
 2496|       |
 2497|   722k|        if (type == XML_TEXT_NODE)
  ------------------
  |  Branch (2497:13): [True: 645k, False: 77.3k]
  ------------------
 2498|   645k|            node = xmlSAX2TextNode(ctxt, parent->doc, ch, len);
 2499|  77.3k|        else
 2500|  77.3k|            node = xmlNewCDataBlock(parent->doc, ch, len);
 2501|   722k|	if (node == NULL) {
  ------------------
  |  Branch (2501:6): [True: 94, False: 722k]
  ------------------
 2502|     94|	    xmlSAX2ErrMemory(ctxt);
 2503|     94|	    return;
 2504|     94|	}
 2505|       |
 2506|   722k|        if (lastChild == NULL) {
  ------------------
  |  Branch (2506:13): [True: 121k, False: 601k]
  ------------------
 2507|   121k|            parent->children = node;
 2508|   121k|            parent->last = node;
 2509|   121k|            node->parent = parent;
 2510|   601k|        } else {
 2511|   601k|            xmlSAX2AppendChild(ctxt, node);
 2512|   601k|        }
 2513|       |
 2514|   722k|        ctxt->nodelen = len;
 2515|   722k|        ctxt->nodemem = len + 1;
 2516|   722k|        lastChild = node;
 2517|   722k|    } else {
 2518|   195k|        xmlChar *content;
 2519|   195k|        int oldSize, newSize, capacity;
 2520|   195k|        int maxSize = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (2520:23): [True: 96.9k, False: 98.4k]
  ------------------
 2521|  96.9k|                      XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  96.9k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 2522|   195k|                      XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  98.4k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 2523|       |
 2524|   195k|        content = lastChild->content;
 2525|   195k|        oldSize = ctxt->nodelen;
 2526|   195k|        capacity = ctxt->nodemem;
 2527|       |
 2528|       |        /* Shouldn't happen */
 2529|   195k|        if ((content == NULL) || (capacity <= 0)) {
  ------------------
  |  Branch (2529:13): [True: 0, False: 195k]
  |  Branch (2529:34): [True: 0, False: 195k]
  ------------------
 2530|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR,
 2531|      0|                        "xmlSAX2Text: no content");
 2532|      0|            return;
 2533|      0|        }
 2534|       |
 2535|   195k|        if ((len > maxSize) || (oldSize > maxSize - len)) {
  ------------------
  |  Branch (2535:13): [True: 0, False: 195k]
  |  Branch (2535:32): [True: 0, False: 195k]
  ------------------
 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|   195k|        newSize = oldSize + len;
 2542|       |
 2543|   195k|        if (newSize >= capacity) {
  ------------------
  |  Branch (2543:13): [True: 69.0k, False: 126k]
  ------------------
 2544|  69.0k|            if (newSize <= 20)
  ------------------
  |  Branch (2544:17): [True: 39.2k, False: 29.8k]
  ------------------
 2545|  39.2k|                capacity = 40;
 2546|  29.8k|            else
 2547|  29.8k|                capacity = newSize > INT_MAX / 2 ? INT_MAX : newSize * 2;
  ------------------
  |  Branch (2547:28): [True: 0, False: 29.8k]
  ------------------
 2548|       |
 2549|       |            /*
 2550|       |             * If the content was stored in properties or in
 2551|       |             * the dictionary, don't realloc.
 2552|       |             */
 2553|  69.0k|            if ((content == (xmlChar *) &lastChild->properties) ||
  ------------------
  |  Branch (2553:17): [True: 31.5k, False: 37.5k]
  ------------------
 2554|  37.5k|                ((ctxt->nodemem == oldSize + 1) &&
  ------------------
  |  Branch (2554:18): [True: 24.3k, False: 13.1k]
  ------------------
 2555|  31.8k|                 (xmlDictOwns(ctxt->dict, content)))) {
  ------------------
  |  Branch (2555:18): [True: 329, False: 24.0k]
  ------------------
 2556|  31.8k|                xmlChar *newContent;
 2557|       |
 2558|  31.8k|                newContent = xmlMalloc(capacity);
 2559|  31.8k|                if (newContent == NULL) {
  ------------------
  |  Branch (2559:21): [True: 15, False: 31.8k]
  ------------------
 2560|     15|                    xmlSAX2ErrMemory(ctxt);
 2561|     15|                    return;
 2562|     15|                }
 2563|       |
 2564|  31.8k|                memcpy(newContent, content, oldSize);
 2565|  31.8k|                lastChild->properties = NULL;
 2566|  31.8k|                content = newContent;
 2567|  37.2k|            } else {
 2568|  37.2k|                content = xmlRealloc(content, capacity);
 2569|  37.2k|                if (content == NULL) {
  ------------------
  |  Branch (2569:21): [True: 7, False: 37.2k]
  ------------------
 2570|      7|                    xmlSAX2ErrMemory(ctxt);
 2571|      7|                    return;
 2572|      7|                }
 2573|  37.2k|            }
 2574|       |
 2575|  69.0k|            ctxt->nodemem = capacity;
 2576|  69.0k|            lastChild->content = content;
 2577|  69.0k|        }
 2578|       |
 2579|   195k|        memcpy(&content[oldSize], ch, len);
 2580|   195k|        content[newSize] = 0;
 2581|   195k|        ctxt->nodelen = newSize;
 2582|   195k|    }
 2583|       |
 2584|   917k|    if ((lastChild != NULL) &&
  ------------------
  |  Branch (2584:9): [True: 917k, False: 0]
  ------------------
 2585|   917k|        (type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (2585:9): [True: 840k, False: 77.3k]
  ------------------
 2586|   840k|        (ctxt->input != NULL)) {
  ------------------
  |  Branch (2586:9): [True: 840k, False: 0]
  ------------------
 2587|   840k|        if ((unsigned) ctxt->input->line < (unsigned) USHRT_MAX)
  ------------------
  |  Branch (2587:13): [True: 814k, False: 26.4k]
  ------------------
 2588|   814k|            lastChild->line = ctxt->input->line;
 2589|  26.4k|        else {
 2590|  26.4k|            lastChild->line = USHRT_MAX;
 2591|  26.4k|            if (ctxt->options & XML_PARSE_BIG_LINES)
  ------------------
  |  Branch (2591:17): [True: 8.82k, False: 17.6k]
  ------------------
 2592|  8.82k|                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
  ------------------
  |  |   59|  8.82k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 2593|  26.4k|        }
 2594|   840k|    }
 2595|   917k|}

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

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|   297k|xmlCatalogGetDefaults(void) {
 3587|   297k|    return(xmlCatalogDefaultAllow);
 3588|   297k|}
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|  2.53M|xmlCharInRange (unsigned int val, const xmlChRangeGroup *rptr) {
   33|  2.53M|    int low, high, mid;
   34|  2.53M|    const xmlChSRange *sptr;
   35|  2.53M|    const xmlChLRange *lptr;
   36|       |
   37|  2.53M|    if (rptr == NULL) return(0);
  ------------------
  |  Branch (37:9): [True: 0, False: 2.53M]
  ------------------
   38|  2.53M|    if (val < 0x10000) {	/* is val in 'short' or 'long'  array? */
  ------------------
  |  Branch (38:9): [True: 2.48M, False: 49.7k]
  ------------------
   39|  2.48M|	if (rptr->nbShortRange == 0)
  ------------------
  |  Branch (39:6): [True: 0, False: 2.48M]
  ------------------
   40|      0|	    return 0;
   41|  2.48M|	low = 0;
   42|  2.48M|	high = rptr->nbShortRange - 1;
   43|  2.48M|	sptr = rptr->shortRange;
   44|  19.2M|	while (low <= high) {
  ------------------
  |  Branch (44:9): [True: 19.1M, False: 14.5k]
  ------------------
   45|  19.1M|	    mid = (low + high) / 2;
   46|  19.1M|	    if ((unsigned short) val < sptr[mid].low) {
  ------------------
  |  Branch (46:10): [True: 11.1M, False: 8.03M]
  ------------------
   47|  11.1M|		high = mid - 1;
   48|  11.1M|	    } else {
   49|  8.03M|		if ((unsigned short) val > sptr[mid].high) {
  ------------------
  |  Branch (49:7): [True: 5.56M, False: 2.46M]
  ------------------
   50|  5.56M|		    low = mid + 1;
   51|  5.56M|		} else {
   52|  2.46M|		    return 1;
   53|  2.46M|		}
   54|  8.03M|	    }
   55|  19.1M|	}
   56|  2.48M|    } else {
   57|  49.7k|	if (rptr->nbLongRange == 0) {
  ------------------
  |  Branch (57:6): [True: 49.7k, False: 0]
  ------------------
   58|  49.7k|	    return 0;
   59|  49.7k|	}
   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|  14.5k|    return 0;
   77|  2.53M|}

xmlInitDictInternal:
   98|      2|xmlInitDictInternal(void) {
   99|      2|    xmlInitMutex(&xmlDictMutex);
  100|      2|}
xmlDictCreate:
  264|  50.6k|xmlDictCreate(void) {
  265|  50.6k|    xmlDictPtr dict;
  266|       |
  267|  50.6k|    xmlInitParser();
  268|       |
  269|  50.6k|    dict = xmlMalloc(sizeof(xmlDict));
  270|  50.6k|    if (dict == NULL)
  ------------------
  |  Branch (270:9): [True: 5, False: 50.6k]
  ------------------
  271|      5|        return(NULL);
  272|  50.6k|    dict->ref_counter = 1;
  273|  50.6k|    dict->limit = 0;
  274|       |
  275|  50.6k|    dict->size = 0;
  276|  50.6k|    dict->nbElems = 0;
  277|  50.6k|    dict->table = NULL;
  278|  50.6k|    dict->strings = NULL;
  279|       |    dict->subdict = NULL;
  280|  50.6k|    dict->seed = xmlRandom();
  281|  50.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  282|  50.6k|    dict->seed = 0;
  283|  50.6k|#endif
  284|  50.6k|    return(dict);
  285|  50.6k|}
xmlDictReference:
  315|  62.9k|xmlDictReference(xmlDict *dict) {
  316|  62.9k|    if (dict == NULL) return -1;
  ------------------
  |  Branch (316:9): [True: 9.51k, False: 53.4k]
  ------------------
  317|  53.4k|    xmlMutexLock(&xmlDictMutex);
  318|  53.4k|    dict->ref_counter++;
  319|  53.4k|    xmlMutexUnlock(&xmlDictMutex);
  320|  53.4k|    return(0);
  321|  62.9k|}
xmlDictFree:
  330|   104k|xmlDictFree(xmlDict *dict) {
  331|   104k|    xmlDictStringsPtr pool, nextp;
  332|       |
  333|   104k|    if (dict == NULL)
  ------------------
  |  Branch (333:9): [True: 0, False: 104k]
  ------------------
  334|      0|	return;
  335|       |
  336|       |    /* decrement the counter, it may be shared by a parser and docs */
  337|   104k|    xmlMutexLock(&xmlDictMutex);
  338|   104k|    dict->ref_counter--;
  339|   104k|    if (dict->ref_counter > 0) {
  ------------------
  |  Branch (339:9): [True: 53.4k, False: 50.6k]
  ------------------
  340|  53.4k|        xmlMutexUnlock(&xmlDictMutex);
  341|  53.4k|        return;
  342|  53.4k|    }
  343|       |
  344|  50.6k|    xmlMutexUnlock(&xmlDictMutex);
  345|       |
  346|  50.6k|    if (dict->subdict != NULL) {
  ------------------
  |  Branch (346:9): [True: 0, False: 50.6k]
  ------------------
  347|      0|        xmlDictFree(dict->subdict);
  348|      0|    }
  349|       |
  350|  50.6k|    if (dict->table) {
  ------------------
  |  Branch (350:9): [True: 44.4k, False: 6.25k]
  ------------------
  351|  44.4k|	xmlFree(dict->table);
  352|  44.4k|    }
  353|  50.6k|    pool = dict->strings;
  354|  95.8k|    while (pool != NULL) {
  ------------------
  |  Branch (354:12): [True: 45.2k, False: 50.6k]
  ------------------
  355|  45.2k|        nextp = pool->next;
  356|  45.2k|	xmlFree(pool);
  357|  45.2k|	pool = nextp;
  358|  45.2k|    }
  359|  50.6k|    xmlFree(dict);
  360|  50.6k|}
xmlDictOwns:
  371|  25.6M|xmlDictOwns(xmlDict *dict, const xmlChar *str) {
  372|  25.6M|    xmlDictStringsPtr pool;
  373|       |
  374|  25.6M|    if ((dict == NULL) || (str == NULL))
  ------------------
  |  Branch (374:9): [True: 0, False: 25.6M]
  |  Branch (374:27): [True: 0, False: 25.6M]
  ------------------
  375|      0|	return(-1);
  376|  25.6M|    pool = dict->strings;
  377|  33.2M|    while (pool != NULL) {
  ------------------
  |  Branch (377:12): [True: 25.8M, False: 7.38M]
  ------------------
  378|  25.8M|        if ((str >= &pool->array[0]) && (str <= pool->free))
  ------------------
  |  Branch (378:13): [True: 25.5M, False: 342k]
  |  Branch (378:41): [True: 18.2M, False: 7.22M]
  ------------------
  379|  18.2M|	    return(1);
  380|  7.56M|	pool = pool->next;
  381|  7.56M|    }
  382|  7.38M|    if (dict->subdict)
  ------------------
  |  Branch (382:9): [True: 0, False: 7.38M]
  ------------------
  383|      0|        return(xmlDictOwns(dict->subdict, str));
  384|  7.38M|    return(0);
  385|  7.38M|}
xmlDictSetLimit:
  412|  51.6k|xmlDictSetLimit(xmlDict *dict, size_t limit) {
  413|  51.6k|    size_t ret;
  414|       |
  415|  51.6k|    if (dict == NULL)
  ------------------
  |  Branch (415:9): [True: 0, False: 51.6k]
  ------------------
  416|      0|	return(0);
  417|  51.6k|    ret = dict->limit;
  418|  51.6k|    dict->limit = limit;
  419|  51.6k|    return(ret);
  420|  51.6k|}
xmlDictComputeHash:
  508|   287k|xmlDictComputeHash(const xmlDict *dict, const xmlChar *string) {
  509|   287k|    size_t len;
  510|       |    return(xmlDictHashName(dict->seed, string, SIZE_MAX, &len));
  511|   287k|}
xmlDictCombineHash:
  524|   429k|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|   429k|    v1 ^= v2;
  530|   429k|    v1 += HASH_ROL31(v2, 5);
  ------------------
  |  |  513|   429k|#define HASH_ROL31(x,n) ((x) << (n) | ((x) & 0x7FFFFFFF) >> (31 - (n)))
  ------------------
  531|       |
  532|   429k|    return((v1 & 0xFFFFFFFF) | 0x80000000);
  533|   429k|}
xmlDictLookup:
  825|  20.6M|xmlDictLookup(xmlDict *dict, const xmlChar *name, int len) {
  826|  20.6M|    const xmlDictEntry *entry;
  827|       |
  828|  20.6M|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  829|  20.6M|    if (entry == NULL)
  ------------------
  |  Branch (829:9): [True: 39, False: 20.6M]
  ------------------
  830|     39|        return(NULL);
  831|  20.6M|    return(entry->name);
  832|  20.6M|}
xmlDictLookupHashed:
  844|  1.45M|xmlDictLookupHashed(xmlDict *dict, const xmlChar *name, int len) {
  845|  1.45M|    const xmlDictEntry *entry;
  846|  1.45M|    xmlHashedString ret;
  847|       |
  848|  1.45M|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  849|       |
  850|  1.45M|    if (entry == NULL) {
  ------------------
  |  Branch (850:9): [True: 14, False: 1.45M]
  ------------------
  851|     14|        ret.name = NULL;
  852|     14|        ret.hashValue = 0;
  853|  1.45M|    } else {
  854|  1.45M|        ret = *entry;
  855|  1.45M|    }
  856|       |
  857|  1.45M|    return(ret);
  858|  1.45M|}
xmlDictQLookup:
  889|  44.2k|xmlDictQLookup(xmlDict *dict, const xmlChar *prefix, const xmlChar *name) {
  890|  44.2k|    const xmlDictEntry *entry;
  891|       |
  892|  44.2k|    entry = xmlDictLookupInternal(dict, prefix, name, -1, 1);
  893|  44.2k|    if (entry == NULL)
  ------------------
  |  Branch (893:9): [True: 6, False: 44.2k]
  ------------------
  894|      6|        return(NULL);
  895|  44.2k|    return(entry->name);
  896|  44.2k|}
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|   137k|xmlRandom(void) {
 1035|   137k|    return(xoroshiro64ss(xmlGetLocalRngState()));
 1036|   137k|}
dict.c:xmlDictHashName:
  454|  22.4M|                size_t *plen) {
  455|  22.4M|    unsigned h1, h2;
  456|  22.4M|    size_t i;
  457|       |
  458|  22.4M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  22.4M|    do { \
  |  |   24|  22.4M|        h1 = seed ^ 0x3b00; \
  |  |   25|  22.4M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  22.4M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  22.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 22.4M]
  |  |  ------------------
  ------------------
  459|       |
  460|   229M|    for (i = 0; i < maxLen && data[i]; i++) {
  ------------------
  |  Branch (460:17): [True: 225M, False: 4.39M]
  |  Branch (460:31): [True: 207M, False: 18.0M]
  ------------------
  461|   207M|        HASH_UPDATE(h1, h2, data[i]);
  ------------------
  |  |   29|   207M|    do { \
  |  |   30|   207M|        h1 += ch; \
  |  |   31|   207M|        h1 += h1 << 3; \
  |  |   32|   207M|        h2 += h1; \
  |  |   33|   207M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   207M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   207M|        h2 += h2 << 2; \
  |  |   35|   207M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 207M]
  |  |  ------------------
  ------------------
  462|   207M|    }
  463|       |
  464|  22.4M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  22.4M|    do { \
  |  |   40|  22.4M|        h1 ^= h2; \
  |  |   41|  22.4M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  22.4M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  22.4M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  22.4M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  22.4M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  22.4M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  22.4M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  22.4M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  22.4M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  22.4M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 22.4M]
  |  |  ------------------
  ------------------
  465|       |
  466|  22.4M|    *plen = i;
  467|  22.4M|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  22.4M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  468|  22.4M|}
dict.c:xmlDictLookupInternal:
  678|  22.1M|                      const xmlChar *name, int maybeLen, int update) {
  679|  22.1M|    xmlDictEntry *entry = NULL;
  680|  22.1M|    const xmlChar *ret;
  681|  22.1M|    unsigned hashValue, newSize;
  682|  22.1M|    size_t maxLen, len, plen, klen;
  683|  22.1M|    int found = 0;
  684|       |
  685|  22.1M|    if ((dict == NULL) || (name == NULL))
  ------------------
  |  Branch (685:9): [True: 0, False: 22.1M]
  |  Branch (685:27): [True: 0, False: 22.1M]
  ------------------
  686|      0|	return(NULL);
  687|       |
  688|  22.1M|    maxLen = (maybeLen < 0) ? SIZE_MAX : (size_t) maybeLen;
  ------------------
  |  Branch (688:14): [True: 17.7M, False: 4.39M]
  ------------------
  689|       |
  690|  22.1M|    if (prefix == NULL) {
  ------------------
  |  Branch (690:9): [True: 22.1M, False: 44.2k]
  ------------------
  691|  22.1M|        hashValue = xmlDictHashName(dict->seed, name, maxLen, &len);
  692|  22.1M|        if (len > INT_MAX / 2)
  ------------------
  |  Branch (692:13): [True: 0, False: 22.1M]
  ------------------
  693|      0|            return(NULL);
  694|  22.1M|        klen = len;
  695|  22.1M|    } else {
  696|  44.2k|        hashValue = xmlDictHashQName(dict->seed, prefix, name, &plen, &len);
  697|  44.2k|        if ((len > INT_MAX / 2) || (plen >= INT_MAX / 2 - len))
  ------------------
  |  Branch (697:13): [True: 0, False: 44.2k]
  |  Branch (697:36): [True: 0, False: 44.2k]
  ------------------
  698|      0|            return(NULL);
  699|  44.2k|        klen = plen + 1 + len;
  700|  44.2k|    }
  701|       |
  702|  22.1M|    if ((dict->limit > 0) && (klen >= dict->limit))
  ------------------
  |  Branch (702:9): [True: 19.1M, False: 3.03M]
  |  Branch (702:30): [True: 0, False: 19.1M]
  ------------------
  703|      0|        return(NULL);
  704|       |
  705|       |    /*
  706|       |     * Check for an existing entry
  707|       |     */
  708|  22.1M|    if (dict->size == 0) {
  ------------------
  |  Branch (708:9): [True: 44.4k, False: 22.1M]
  ------------------
  709|  44.4k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   43|  44.4k|#define MIN_HASH_SIZE 8
  ------------------
  710|  22.1M|    } else {
  711|  22.1M|        entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found);
  712|  22.1M|        if (found)
  ------------------
  |  Branch (712:13): [True: 21.7M, False: 372k]
  ------------------
  713|  21.7M|            return(entry);
  714|       |
  715|   372k|        if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   42|   372k|#define MAX_FILL_DENOM 8
  ------------------
                      if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   41|   372k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (715:13): [True: 27.9k, False: 344k]
  ------------------
  716|  27.9k|            if (dict->size >= MAX_HASH_SIZE)
  ------------------
  |  |   44|  27.9k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (716:17): [True: 0, False: 27.9k]
  ------------------
  717|      0|                return(NULL);
  718|  27.9k|            newSize = dict->size * 2;
  719|   344k|        } else {
  720|   344k|            newSize = 0;
  721|   344k|        }
  722|   372k|    }
  723|       |
  724|   416k|    if ((dict->subdict != NULL) && (dict->subdict->size > 0)) {
  ------------------
  |  Branch (724:9): [True: 0, False: 416k]
  |  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|   416k|    if (!update)
  ------------------
  |  Branch (740:9): [True: 0, False: 416k]
  ------------------
  741|      0|        return(NULL);
  742|       |
  743|       |    /*
  744|       |     * Grow the hash table if needed
  745|       |     */
  746|   416k|    if (newSize > 0) {
  ------------------
  |  Branch (746:9): [True: 72.3k, False: 344k]
  ------------------
  747|  72.3k|        unsigned mask, displ, pos;
  748|       |
  749|  72.3k|        if (xmlDictGrow(dict, newSize) != 0)
  ------------------
  |  Branch (749:13): [True: 50, False: 72.3k]
  ------------------
  750|     50|            return(NULL);
  751|       |
  752|       |        /*
  753|       |         * Find new entry
  754|       |         */
  755|  72.3k|        mask = dict->size - 1;
  756|  72.3k|        displ = 0;
  757|  72.3k|        pos = hashValue & mask;
  758|  72.3k|        entry = &dict->table[pos];
  759|       |
  760|  85.7k|        while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (760:16): [True: 17.5k, False: 68.1k]
  ------------------
  761|  17.5k|               ((pos - entry->hashValue) & mask) >= displ) {
  ------------------
  |  Branch (761:16): [True: 13.3k, False: 4.20k]
  ------------------
  762|  13.3k|            displ++;
  763|  13.3k|            pos++;
  764|  13.3k|            entry++;
  765|  13.3k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (765:17): [True: 1.28k, False: 12.1k]
  ------------------
  766|  1.28k|                entry = dict->table;
  767|  13.3k|        }
  768|  72.3k|    }
  769|       |
  770|   416k|    if (prefix == NULL)
  ------------------
  |  Branch (770:9): [True: 411k, False: 5.67k]
  ------------------
  771|   411k|        ret = xmlDictAddString(dict, name, len);
  772|  5.67k|    else
  773|  5.67k|        ret = xmlDictAddQString(dict, prefix, plen, name, len);
  774|   416k|    if (ret == NULL)
  ------------------
  |  Branch (774:9): [True: 9, False: 416k]
  ------------------
  775|      9|        return(NULL);
  776|       |
  777|       |    /*
  778|       |     * Shift the remainder of the probe sequence to the right
  779|       |     */
  780|   416k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (780:9): [True: 76.4k, False: 340k]
  ------------------
  781|  76.4k|        const xmlDictEntry *end = &dict->table[dict->size];
  782|  76.4k|        const xmlDictEntry *cur = entry;
  783|       |
  784|   251k|        do {
  785|   251k|            cur++;
  786|   251k|            if (cur >= end)
  ------------------
  |  Branch (786:17): [True: 23.3k, False: 227k]
  ------------------
  787|  23.3k|                cur = dict->table;
  788|   251k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (788:18): [True: 174k, False: 76.4k]
  ------------------
  789|       |
  790|  76.4k|        if (cur < entry) {
  ------------------
  |  Branch (790:13): [True: 23.3k, False: 53.1k]
  ------------------
  791|       |            /*
  792|       |             * If we traversed the end of the buffer, handle the part
  793|       |             * at the start of the buffer.
  794|       |             */
  795|  23.3k|            memmove(&dict->table[1], dict->table,
  796|  23.3k|                    (char *) cur - (char *) dict->table);
  797|  23.3k|            cur = end - 1;
  798|  23.3k|            dict->table[0] = *cur;
  799|  23.3k|        }
  800|       |
  801|  76.4k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  802|  76.4k|    }
  803|       |
  804|       |    /*
  805|       |     * Populate entry
  806|       |     */
  807|   416k|    entry->hashValue = hashValue;
  808|   416k|    entry->name = ret;
  809|       |
  810|   416k|    dict->nbElems++;
  811|       |
  812|   416k|    return(entry);
  813|   416k|}
dict.c:xmlDictHashQName:
  473|  44.2k|                 size_t *pplen, size_t *plen) {
  474|  44.2k|    unsigned h1, h2;
  475|  44.2k|    size_t i;
  476|       |
  477|  44.2k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  44.2k|    do { \
  |  |   24|  44.2k|        h1 = seed ^ 0x3b00; \
  |  |   25|  44.2k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  44.2k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  478|       |
  479|   391k|    for (i = 0; prefix[i] != 0; i++) {
  ------------------
  |  Branch (479:17): [True: 347k, False: 44.2k]
  ------------------
  480|   347k|        HASH_UPDATE(h1, h2, prefix[i]);
  ------------------
  |  |   29|   347k|    do { \
  |  |   30|   347k|        h1 += ch; \
  |  |   31|   347k|        h1 += h1 << 3; \
  |  |   32|   347k|        h2 += h1; \
  |  |   33|   347k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   347k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   347k|        h2 += h2 << 2; \
  |  |   35|   347k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 347k]
  |  |  ------------------
  ------------------
  481|   347k|    }
  482|  44.2k|    *pplen = i;
  483|       |
  484|  44.2k|    HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  44.2k|    do { \
  |  |   30|  44.2k|        h1 += ch; \
  |  |   31|  44.2k|        h1 += h1 << 3; \
  |  |   32|  44.2k|        h2 += h1; \
  |  |   33|  44.2k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  44.2k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  44.2k|        h2 += h2 << 2; \
  |  |   35|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  485|       |
  486|  3.61M|    for (i = 0; name[i] != 0; i++) {
  ------------------
  |  Branch (486:17): [True: 3.56M, False: 44.2k]
  ------------------
  487|  3.56M|        HASH_UPDATE(h1, h2, name[i]);
  ------------------
  |  |   29|  3.56M|    do { \
  |  |   30|  3.56M|        h1 += ch; \
  |  |   31|  3.56M|        h1 += h1 << 3; \
  |  |   32|  3.56M|        h2 += h1; \
  |  |   33|  3.56M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  3.56M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  3.56M|        h2 += h2 << 2; \
  |  |   35|  3.56M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 3.56M]
  |  |  ------------------
  ------------------
  488|  3.56M|    }
  489|  44.2k|    *plen = i;
  490|       |
  491|  44.2k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  44.2k|    do { \
  |  |   40|  44.2k|        h1 ^= h2; \
  |  |   41|  44.2k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  44.2k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  44.2k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  44.2k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  44.2k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  44.2k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  44.2k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  44.2k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  44.2k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  44.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 44.2k]
  |  |  ------------------
  ------------------
  492|       |
  493|       |    /*
  494|       |     * Always set the upper bit of hash values since 0 means an unoccupied
  495|       |     * bucket.
  496|       |     */
  497|  44.2k|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  44.2k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  498|  44.2k|}
dict.c:xmlDictFindEntry:
  551|  22.1M|                 int *pfound) {
  552|  22.1M|    xmlDictEntry *entry;
  553|  22.1M|    unsigned mask, pos, displ;
  554|  22.1M|    int found = 0;
  555|       |
  556|  22.1M|    mask = dict->size - 1;
  557|  22.1M|    pos = hashValue & mask;
  558|  22.1M|    entry = &dict->table[pos];
  559|       |
  560|  22.1M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (560:9): [True: 21.9M, False: 216k]
  ------------------
  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|  21.9M|        displ = 0;
  567|       |
  568|  25.7M|        do {
  569|  25.7M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (569:17): [True: 21.7M, False: 3.95M]
  ------------------
  570|  21.7M|                if (prefix == NULL) {
  ------------------
  |  Branch (570:21): [True: 21.7M, False: 38.5k]
  ------------------
  571|       |                    /*
  572|       |                     * name is not necessarily null-terminated.
  573|       |                     */
  574|  21.7M|                    if ((strncmp((const char *) entry->name,
  ------------------
  |  Branch (574:25): [True: 21.7M, False: 195]
  ------------------
  575|  21.7M|                                 (const char *) name, len) == 0) &&
  576|  21.7M|                        (entry->name[len] == 0)) {
  ------------------
  |  Branch (576:25): [True: 21.7M, False: 0]
  ------------------
  577|  21.7M|                        found = 1;
  578|  21.7M|                        break;
  579|  21.7M|                    }
  580|  21.7M|                } else {
  581|  38.5k|                    if (xmlStrQEqual(prefix, name, entry->name)) {
  ------------------
  |  Branch (581:25): [True: 38.5k, False: 0]
  ------------------
  582|  38.5k|                        found = 1;
  583|  38.5k|                        break;
  584|  38.5k|                    }
  585|  38.5k|                }
  586|  21.7M|            }
  587|       |
  588|  3.95M|            displ++;
  589|  3.95M|            pos++;
  590|  3.95M|            entry++;
  591|  3.95M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (591:17): [True: 331k, False: 3.62M]
  ------------------
  592|   331k|                entry = dict->table;
  593|  3.95M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (593:18): [True: 3.89M, False: 67.2k]
  ------------------
  594|  3.89M|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (594:18): [True: 3.80M, False: 88.8k]
  ------------------
  595|  21.9M|    }
  596|       |
  597|  22.1M|    *pfound = found;
  598|  22.1M|    return(entry);
  599|  22.1M|}
dict.c:xmlDictGrow:
  609|  72.3k|xmlDictGrow(xmlDictPtr dict, unsigned size) {
  610|  72.3k|    const xmlDictEntry *oldentry, *oldend, *end;
  611|  72.3k|    xmlDictEntry *table;
  612|  72.3k|    unsigned oldsize, i;
  613|       |
  614|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  615|  72.3k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (615:9): [True: 0, False: 72.3k]
  ------------------
  616|      0|        return(-1);
  617|  72.3k|    table = xmlMalloc(size * sizeof(table[0]));
  618|  72.3k|    if (table == NULL)
  ------------------
  |  Branch (618:9): [True: 50, False: 72.3k]
  ------------------
  619|     50|        return(-1);
  620|  72.3k|    memset(table, 0, size * sizeof(table[0]));
  621|       |
  622|  72.3k|    oldsize = dict->size;
  623|  72.3k|    if (oldsize == 0)
  ------------------
  |  Branch (623:9): [True: 44.4k, False: 27.9k]
  ------------------
  624|  44.4k|        goto done;
  625|       |
  626|  27.9k|    oldend = &dict->table[oldsize];
  627|  27.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|  27.9k|    oldentry = dict->table;
  637|   156k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (637:12): [True: 128k, False: 27.9k]
  ------------------
  638|   128k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (638:13): [True: 0, False: 128k]
  ------------------
  639|      0|            oldentry = dict->table;
  640|   128k|    }
  641|       |
  642|   346k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (642:17): [True: 318k, False: 27.9k]
  ------------------
  643|   318k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (643:13): [True: 279k, False: 39.8k]
  ------------------
  644|   279k|            xmlDictEntry *entry = &table[oldentry->hashValue & (size - 1)];
  645|       |
  646|   357k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (646:20): [True: 78.6k, False: 279k]
  ------------------
  647|  78.6k|                if (++entry >= end)
  ------------------
  |  Branch (647:21): [True: 13.0k, False: 65.5k]
  ------------------
  648|  13.0k|                    entry = table;
  649|  78.6k|            }
  650|   279k|            *entry = *oldentry;
  651|   279k|        }
  652|       |
  653|   318k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (653:13): [True: 27.9k, False: 291k]
  ------------------
  654|  27.9k|            oldentry = dict->table;
  655|   318k|    }
  656|       |
  657|  27.9k|    xmlFree(dict->table);
  658|       |
  659|  72.3k|done:
  660|  72.3k|    dict->table = table;
  661|  72.3k|    dict->size = size;
  662|       |
  663|  72.3k|    return(0);
  664|  27.9k|}
dict.c:xmlDictAddString:
  130|   411k|xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
  131|   411k|    xmlDictStringsPtr pool;
  132|   411k|    const xmlChar *ret;
  133|   411k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  134|   411k|    size_t limit = 0;
  135|       |
  136|   411k|    pool = dict->strings;
  137|   413k|    while (pool != NULL) {
  ------------------
  |  Branch (137:12): [True: 368k, False: 45.1k]
  ------------------
  138|   368k|	if ((size_t)(pool->end - pool->free) > namelen)
  ------------------
  |  Branch (138:6): [True: 366k, False: 2.13k]
  ------------------
  139|   366k|	    goto found_pool;
  140|  2.13k|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (140:6): [True: 1.69k, False: 442]
  ------------------
  141|  2.13k|        limit += pool->size;
  142|  2.13k|	pool = pool->next;
  143|  2.13k|    }
  144|       |    /*
  145|       |     * Not found, need to allocate
  146|       |     */
  147|  45.1k|    if (pool == NULL) {
  ------------------
  |  Branch (147:9): [True: 45.1k, False: 0]
  ------------------
  148|  45.1k|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (148:13): [True: 498, False: 44.6k]
  |  Branch (148:34): [True: 0, False: 498]
  ------------------
  149|      0|            return(NULL);
  150|      0|        }
  151|       |
  152|  45.1k|        if (size == 0) {
  ------------------
  |  Branch (152:13): [True: 44.4k, False: 759]
  ------------------
  153|  44.4k|            size = 1000;
  154|  44.4k|        } else {
  155|    759|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (155:17): [True: 759, False: 0]
  ------------------
  156|    759|                size *= 4; /* exponential growth */
  157|      0|            else
  158|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  159|    759|        }
  160|  45.1k|        if (size / 4 < namelen) {
  ------------------
  |  Branch (160:13): [True: 521, False: 44.6k]
  ------------------
  161|    521|            if ((size_t) namelen + 0 < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (161:17): [True: 521, False: 0]
  ------------------
  162|    521|                size = 4 * (size_t) namelen; /* just in case ! */
  163|      0|            else
  164|      0|                return(NULL);
  165|    521|        }
  166|  45.1k|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  167|  45.1k|	if (pool == NULL)
  ------------------
  |  Branch (167:6): [True: 6, False: 45.1k]
  ------------------
  168|      6|	    return(NULL);
  169|  45.1k|	pool->size = size;
  170|  45.1k|	pool->nbStrings = 0;
  171|  45.1k|	pool->free = &pool->array[0];
  172|  45.1k|	pool->end = &pool->array[size];
  173|  45.1k|	pool->next = dict->strings;
  174|  45.1k|	dict->strings = pool;
  175|  45.1k|    }
  176|   411k|found_pool:
  177|   411k|    ret = pool->free;
  178|   411k|    memcpy(pool->free, name, namelen);
  179|   411k|    pool->free += namelen;
  180|   411k|    *(pool->free++) = 0;
  181|   411k|    pool->nbStrings++;
  182|   411k|    return(ret);
  183|  45.1k|}
dict.c:xmlDictAddQString:
  199|  5.67k|{
  200|  5.67k|    xmlDictStringsPtr pool;
  201|  5.67k|    const xmlChar *ret;
  202|  5.67k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  203|  5.67k|    size_t limit = 0;
  204|       |
  205|  5.67k|    pool = dict->strings;
  206|  6.58k|    while (pool != NULL) {
  ------------------
  |  Branch (206:12): [True: 6.51k, False: 71]
  ------------------
  207|  6.51k|	if ((size_t)(pool->end - pool->free) > namelen + plen + 1)
  ------------------
  |  Branch (207:6): [True: 5.59k, False: 916]
  ------------------
  208|  5.59k|	    goto found_pool;
  209|    916|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (209:6): [True: 557, False: 359]
  ------------------
  210|    916|        limit += pool->size;
  211|    916|	pool = pool->next;
  212|    916|    }
  213|       |    /*
  214|       |     * Not found, need to allocate
  215|       |     */
  216|     71|    if (pool == NULL) {
  ------------------
  |  Branch (216:9): [True: 71, False: 0]
  ------------------
  217|     71|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (217:13): [True: 43, False: 28]
  |  Branch (217:34): [True: 0, False: 43]
  ------------------
  218|      0|            return(NULL);
  219|      0|        }
  220|       |
  221|     71|        if (size == 0) {
  ------------------
  |  Branch (221:13): [True: 0, False: 71]
  ------------------
  222|      0|            size = 1000;
  223|     71|        } else {
  224|     71|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (224:17): [True: 71, False: 0]
  ------------------
  225|     71|                size *= 4; /* exponential growth */
  226|      0|            else
  227|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  228|     71|        }
  229|     71|        if (size / 4 < namelen + plen + 1) {
  ------------------
  |  Branch (229:13): [True: 0, False: 71]
  ------------------
  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|     71|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  237|     71|	if (pool == NULL)
  ------------------
  |  Branch (237:6): [True: 3, False: 68]
  ------------------
  238|      3|	    return(NULL);
  239|     68|	pool->size = size;
  240|     68|	pool->nbStrings = 0;
  241|     68|	pool->free = &pool->array[0];
  242|     68|	pool->end = &pool->array[size];
  243|     68|	pool->next = dict->strings;
  244|     68|	dict->strings = pool;
  245|     68|    }
  246|  5.66k|found_pool:
  247|  5.66k|    ret = pool->free;
  248|  5.66k|    memcpy(pool->free, prefix, plen);
  249|  5.66k|    pool->free += plen;
  250|  5.66k|    *(pool->free++) = ':';
  251|  5.66k|    memcpy(pool->free, name, namelen);
  252|  5.66k|    pool->free += namelen;
  253|  5.66k|    *(pool->free++) = 0;
  254|  5.66k|    pool->nbStrings++;
  255|  5.66k|    return(ret);
  256|     71|}
dict.c:xoroshiro64ss:
  998|   137k|xoroshiro64ss(unsigned *s) {
  999|   137k|    unsigned s0 = s[0];
 1000|   137k|    unsigned s1 = s[1];
 1001|   137k|    unsigned result = HASH_ROL(s0 * 0x9E3779BB, 5) * 5;
  ------------------
  |  |   12|   137k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1002|       |
 1003|   137k|    s1 ^= s0;
 1004|   137k|    s[0] = HASH_ROL(s0, 26) ^ s1 ^ (s1 << 9);
  ------------------
  |  |   12|   137k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1005|   137k|    s[1] = HASH_ROL(s1, 13);
  ------------------
  |  |   12|   137k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1006|       |
 1007|   137k|    return(result & 0xFFFFFFFF);
 1008|   137k|}

xmlGetEncodingAlias:
  473|  14.0k|xmlGetEncodingAlias(const char *alias) {
  474|  14.0k|    int i;
  475|  14.0k|    char upper[100];
  476|       |
  477|  14.0k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 14.0k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  14.0k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 14.0k, False: 0]
  ------------------
  481|  14.0k|	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|  10.5k|                           xmlCharEncodingHandler **out) {
  771|  10.5k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  10.5k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 10.5k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  10.5k|    handler = xmlMalloc(sizeof(*handler));
  777|  10.5k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 7, False: 10.5k]
  ------------------
  778|      7|        goto error;
  779|  10.5k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  10.5k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 10.5k, False: 0]
  ------------------
  782|  10.5k|        handler->name = xmlMemStrdup(name);
  783|  10.5k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 7, False: 10.4k]
  ------------------
  784|      7|            goto error;
  785|  10.5k|    }
  786|       |
  787|  10.4k|    handler->input.func = input;
  788|  10.4k|    handler->output.func = output;
  789|  10.4k|    handler->ctxtDtor = ctxtDtor;
  790|  10.4k|    handler->inputCtxt = inputCtxt;
  791|  10.4k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  10.4k|    *out = handler;
  794|  10.4k|    return(XML_ERR_OK);
  795|       |
  796|     14|error:
  797|     14|    xmlFree(handler);
  798|       |
  799|     14|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 14, False: 0]
  ------------------
  800|     14|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 14, False: 0]
  ------------------
  801|     14|            ctxtDtor(inputCtxt);
  802|     14|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 2, False: 12]
  ------------------
  803|      2|            ctxtDtor(outputCtxt);
  804|     14|    }
  805|       |
  806|     14|    return(XML_ERR_NO_MEMORY);
  807|  10.5k|}
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.36k|                             xmlCharEncodingHandler **out) {
  987|  6.36k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  6.36k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 6.36k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  6.36k|    *out = NULL;
  992|       |
  993|  6.36k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  6.36k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 6.36k]
  |  Branch (993:23): [True: 0, False: 6.36k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  6.36k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 25, False: 6.34k]
  ------------------
  998|  6.34k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 6.34k]
  ------------------
  999|     25|        return(XML_ERR_OK);
 1000|       |
 1001|  6.34k|    handler = &defaultHandlers[enc];
 1002|  6.34k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 5.34k, False: 991]
  |  Branch (1002:42): [True: 0, False: 991]
  ------------------
 1003|  5.34k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  5.34k|        return(XML_ERR_OK);
 1005|  5.34k|    }
 1006|       |
 1007|    991|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 991, False: 0]
  ------------------
 1008|    991|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|    991|#ifdef LIBXML_OUTPUT_ENABLED
 1011|    991|        flags |= XML_ENC_OUTPUT;
 1012|    991|#endif
 1013|    991|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|    991|                                   NULL, NULL, out));
 1015|    991|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|    991|}
xmlCreateCharEncodingHandler:
 1066|  14.0k|                             xmlCharEncodingHandler **out) {
 1067|  14.0k|    const xmlCharEncodingHandler *handler;
 1068|  14.0k|    const char *norig, *nalias;
 1069|  14.0k|    xmlCharEncoding enc;
 1070|       |
 1071|  14.0k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 14.0k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  14.0k|    *out = NULL;
 1074|       |
 1075|  14.0k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 14.0k]
  |  Branch (1075:27): [True: 0, False: 14.0k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  14.0k|    norig = name;
 1079|  14.0k|    nalias = xmlGetEncodingAlias(name);
 1080|  14.0k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 14.0k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  14.0k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  14.0k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 341, False: 13.7k]
  ------------------
 1087|    341|        return(XML_ERR_OK);
 1088|       |
 1089|  13.7k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  4.04k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 4.04k, False: 9.66k]
  |  Branch (1089:22): [True: 4.04k, False: 0]
  ------------------
 1090|  4.04k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 4.04k]
  ------------------
 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|  4.04k|        handler = &defaultHandlers[enc];
 1113|  4.04k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 4.04k]
  |  Branch (1113:48): [True: 3.41k, False: 621]
  ------------------
 1114|  3.41k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 3.41k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  3.41k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  3.41k|            ret = xmlMalloc(sizeof(*ret));
 1122|  3.41k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 3, False: 3.41k]
  ------------------
 1123|      3|                return(XML_ERR_NO_MEMORY);
 1124|  3.41k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  3.41k|            ret->name = xmlMemStrdup(norig);
 1127|  3.41k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 3, False: 3.41k]
  ------------------
 1128|      3|                xmlFree(ret);
 1129|      3|                return(XML_ERR_NO_MEMORY);
 1130|      3|            }
 1131|  3.41k|            ret->input = handler->input;
 1132|  3.41k|            ret->output = handler->output;
 1133|  3.41k|            ret->inputCtxt = handler->inputCtxt;
 1134|  3.41k|            ret->outputCtxt = handler->outputCtxt;
 1135|  3.41k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  3.41k|            *out = ret;
 1138|  3.41k|            return(XML_ERR_OK);
 1139|  3.41k|        }
 1140|  4.04k|    }
 1141|       |
 1142|  10.2k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  13.7k|}
xmlOpenCharEncodingHandler:
 1169|     27|                           xmlCharEncodingHandler **out) {
 1170|     27|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 27]
  ------------------
 1171|       |
 1172|     27|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     27|}
xmlEncInputChunk:
 1685|   173k|                 int flush) {
 1686|   173k|    xmlCharEncError ret;
 1687|       |
 1688|   173k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   173k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 173k]
  ------------------
 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|   173k|    } else {
 1699|   173k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   173k|        int oldInlen;
 1701|       |
 1702|   173k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 173k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   173k|        oldInlen = *inlen;
 1709|   173k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   173k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 13, False: 173k]
  |  Branch (1714:24): [True: 13, False: 0]
  |  Branch (1714:56): [True: 1, False: 12]
  ------------------
 1715|      1|            ret = XML_ENC_ERR_INPUT;
 1716|   173k|    }
 1717|       |
 1718|   173k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 22.7k, False: 151k]
  ------------------
 1719|  22.7k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   173k|    return(ret);
 1722|   173k|}
xmlCharEncInput:
 1795|   416k|{
 1796|   416k|    xmlBufPtr out, in;
 1797|   416k|    const xmlChar *dataIn;
 1798|   416k|    size_t availIn;
 1799|   416k|    size_t maxOut;
 1800|   416k|    size_t totalIn, totalOut;
 1801|   416k|    xmlCharEncError ret;
 1802|       |
 1803|   416k|    out = input->buffer;
 1804|   416k|    in = input->raw;
 1805|       |
 1806|   416k|    maxOut = *sizeOut;
 1807|   416k|    totalOut = 0;
 1808|       |
 1809|   416k|    *sizeOut = 0;
 1810|       |
 1811|   416k|    availIn = xmlBufUse(in);
 1812|   416k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 250k, False: 165k]
  |  Branch (1812:27): [True: 250k, False: 12]
  ------------------
 1813|   250k|        return(0);
 1814|   165k|    dataIn = xmlBufContent(in);
 1815|   165k|    totalIn = 0;
 1816|       |
 1817|   169k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 169k, Folded]
  ------------------
 1818|   169k|        size_t availOut;
 1819|   169k|        int completeOut, completeIn;
 1820|   169k|        int c_out, c_in;
 1821|       |
 1822|   169k|        availOut = xmlBufAvail(out);
 1823|   169k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 169k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   169k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 111k, False: 57.5k]
  ------------------
 1827|   111k|            c_out = availOut;
 1828|   111k|            completeOut = 0;
 1829|   111k|        } else {
 1830|  57.5k|            c_out = maxOut;
 1831|  57.5k|            completeOut = 1;
 1832|  57.5k|        }
 1833|       |
 1834|   169k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 169k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   169k|        } else {
 1838|   169k|            c_in = availIn;
 1839|   169k|            completeIn = 1;
 1840|   169k|        }
 1841|       |
 1842|   169k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   169k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 13, False: 169k]
  |  Branch (1843:56): [True: 13, False: 0]
  ------------------
 1844|       |
 1845|   169k|        totalIn += c_in;
 1846|   169k|        dataIn += c_in;
 1847|   169k|        availIn -= c_in;
 1848|       |
 1849|   169k|        totalOut += c_out;
 1850|   169k|        maxOut -= c_out;
 1851|   169k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   169k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 26.3k, False: 143k]
  |  Branch (1853:45): [True: 3.28k, False: 23.0k]
  ------------------
 1854|  3.28k|            input->error = xmlEncConvertError(ret);
 1855|  3.28k|            return(ret);
 1856|  3.28k|        }
 1857|       |
 1858|   166k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 54.9k, False: 111k]
  |  Branch (1858:30): [True: 54.9k, False: 0]
  ------------------
 1859|  54.9k|            break;
 1860|   111k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 111k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|   111k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 111k, False: 0]
  |  Branch (1862:29): [True: 107k, False: 3.62k]
  ------------------
 1863|   107k|            break;
 1864|       |
 1865|  3.62k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 3.62k, False: 0]
  ------------------
 1866|  3.62k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 10, False: 3.61k]
  ------------------
 1867|     10|                input->error = XML_ERR_NO_MEMORY;
 1868|     10|                return(XML_ENC_ERR_MEMORY);
 1869|     10|            }
 1870|  3.62k|        }
 1871|  3.62k|    }
 1872|       |
 1873|   162k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   162k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 162k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   162k|    else
 1878|   162k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   162k|    *sizeOut = totalOut;
 1881|   162k|    return(XML_ENC_ERR_SUCCESS);
 1882|   165k|}
xmlCharEncCloseFunc:
 2192|  19.4k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  19.4k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 174, False: 19.2k]
  ------------------
 2194|    174|        return(0);
 2195|       |
 2196|  19.2k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  19.2k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 5.34k, False: 13.9k]
  ------------------
 2197|  5.34k|        return(0);
 2198|       |
 2199|  13.9k|    xmlFree(handler->name);
 2200|  13.9k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 10.4k, False: 3.41k]
  ------------------
 2201|  10.4k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  10.4k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  10.4k|    }
 2204|  13.9k|    xmlFree(handler);
 2205|  13.9k|    return(0);
 2206|  19.2k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  14.0k|{
  619|  14.0k|    const xmlEncTableEntry *entry;
  620|       |
  621|  14.0k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 14.0k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  14.0k|    entry = bsearch(name, xmlEncTable,
  625|  14.0k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  14.0k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  14.0k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 4.38k, False: 9.66k]
  ------------------
  628|  4.38k|        return(entry->enc);
  629|       |
  630|  9.66k|    return(XML_CHAR_ENCODING_ERROR);
  631|  14.0k|}
encoding.c:xmlCompareEncTableEntries:
  609|  85.2k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  85.2k|    const char *key = vkey;
  611|  85.2k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  85.2k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  85.2k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  85.2k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  85.2k|}
encoding.c:UTF16LEToUTF8:
 2492|   103k|              int flush ATTRIBUTE_UNUSED) {
 2493|   103k|    const unsigned char *instart = in;
 2494|   103k|    const unsigned char *inend = in + (*inlen & ~1);
 2495|   103k|    unsigned char *outstart = out;
 2496|   103k|    unsigned char *outend = out + *outlen;
 2497|   103k|    unsigned c, d;
 2498|   103k|    int ret = XML_ENC_ERR_SPACE;
 2499|       |
 2500|  3.43M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 3.33M, False: 100k]
  ------------------
 2501|  3.33M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  3.33M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 12.9k, False: 3.31M]
  ------------------
 2504|  12.9k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 268, False: 12.6k]
  ------------------
 2505|    268|                goto done;
 2506|  12.6k|            out[0] = c;
 2507|  12.6k|            in += 2;
 2508|  12.6k|            out += 1;
 2509|  3.31M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 5.70k, False: 3.31M]
  ------------------
 2510|  5.70k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 293, False: 5.41k]
  ------------------
 2511|    293|                goto done;
 2512|  5.41k|            out[0] = (c >> 6)   | 0xC0;
 2513|  5.41k|            out[1] = (c & 0x3F) | 0x80;
 2514|  5.41k|            in += 2;
 2515|  5.41k|            out += 2;
 2516|  3.31M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 3.31M, False: 2.28k]
  ------------------
 2517|  3.31M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 911, False: 3.30M]
  ------------------
 2518|    911|                goto done;
 2519|  3.30M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  3.30M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  3.30M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  3.30M|            in += 2;
 2523|  3.30M|            out += 3;
 2524|  3.30M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  2.28k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 534, False: 1.75k]
  ------------------
 2527|    534|                ret = XML_ENC_ERR_INPUT;
 2528|    534|                goto done;
 2529|    534|            }
 2530|  1.75k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 367, False: 1.38k]
  ------------------
 2531|    367|		break;
 2532|  1.38k|            d = in[2] | (in[3] << 8);
 2533|  1.38k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 521, False: 866]
  ------------------
 2534|    521|                ret = XML_ENC_ERR_INPUT;
 2535|    521|                goto done;
 2536|    521|            }
 2537|    866|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 226, False: 640]
  ------------------
 2538|    226|		goto done;
 2539|    640|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|    640|            out[0] =  (c >> 18)         | 0xF0;
 2541|    640|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|    640|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|    640|            out[3] =  (c        & 0x3F) | 0x80;
 2544|    640|            in += 4;
 2545|    640|            out += 4;
 2546|    640|        }
 2547|  3.33M|    }
 2548|       |
 2549|   100k|    ret = out - outstart;
 2550|       |
 2551|   103k|done:
 2552|   103k|    *outlen = out - outstart;
 2553|   103k|    *inlen = in - instart;
 2554|   103k|    return(ret);
 2555|   100k|}
encoding.c:UTF16BEToUTF8:
 2689|  12.3k|              int flush ATTRIBUTE_UNUSED) {
 2690|  12.3k|    const unsigned char *instart = in;
 2691|  12.3k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  12.3k|    unsigned char *outstart = out;
 2693|  12.3k|    unsigned char *outend = out + *outlen;
 2694|  12.3k|    unsigned c, d;
 2695|  12.3k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  2.93M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 2.93M, False: 9.12k]
  ------------------
 2698|  2.93M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  2.93M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 19.5k, False: 2.91M]
  ------------------
 2701|  19.5k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 273, False: 19.2k]
  ------------------
 2702|    273|                goto done;
 2703|  19.2k|            out[0] = c;
 2704|  19.2k|            in += 2;
 2705|  19.2k|            out += 1;
 2706|  2.91M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 12.6k, False: 2.89M]
  ------------------
 2707|  12.6k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 220, False: 12.4k]
  ------------------
 2708|    220|                goto done;
 2709|  12.4k|            out[0] = (c >> 6)   | 0xC0;
 2710|  12.4k|            out[1] = (c & 0x3F) | 0x80;
 2711|  12.4k|            in += 2;
 2712|  12.4k|            out += 2;
 2713|  2.89M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 2.89M, False: 1.73k]
  ------------------
 2714|  2.89M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 1.44k, False: 2.89M]
  ------------------
 2715|  1.44k|                goto done;
 2716|  2.89M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  2.89M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  2.89M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  2.89M|            in += 2;
 2720|  2.89M|            out += 3;
 2721|  2.89M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  1.73k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 671, False: 1.06k]
  ------------------
 2724|    671|                ret = XML_ENC_ERR_INPUT;
 2725|    671|                goto done;
 2726|    671|            }
 2727|  1.06k|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 249, False: 814]
  ------------------
 2728|    249|		break;
 2729|    814|            d = (in[2] << 8) | in[3];
 2730|    814|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 224, False: 590]
  ------------------
 2731|    224|                ret = XML_ENC_ERR_INPUT;
 2732|    224|                goto done;
 2733|    224|            }
 2734|    590|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 134, False: 456]
  ------------------
 2735|    134|		goto done;
 2736|    456|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    456|            out[0] =  (c >> 18)         | 0xF0;
 2738|    456|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    456|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    456|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    456|            in += 4;
 2742|    456|            out += 4;
 2743|    456|        }
 2744|  2.93M|    }
 2745|       |
 2746|  9.36k|    ret = out - outstart;
 2747|       |
 2748|  12.3k|done:
 2749|  12.3k|    *outlen = out - outstart;
 2750|  12.3k|    *inlen = in - instart;
 2751|  12.3k|    return(ret);
 2752|  9.36k|}
encoding.c:asciiToAscii:
 2278|  1.03k|             int flush ATTRIBUTE_UNUSED) {
 2279|  1.03k|    const unsigned char *inend;
 2280|  1.03k|    const unsigned char *instart = in;
 2281|  1.03k|    int inlen, outlen, ret;
 2282|       |
 2283|  1.03k|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 1.03k]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|  1.03k|    inlen = *pinlen;
 2290|  1.03k|    outlen = *poutlen;
 2291|       |
 2292|  1.03k|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 229, False: 810]
  ------------------
 2293|    229|        inlen = outlen;
 2294|    229|        ret = XML_ENC_ERR_SPACE;
 2295|    810|    } else {
 2296|    810|        ret = inlen;
 2297|    810|    }
 2298|       |
 2299|  1.03k|    inend = in + inlen;
 2300|  1.03k|    *poutlen = inlen;
 2301|  1.03k|    *pinlen = inlen;
 2302|       |
 2303|  53.0k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 52.7k, False: 226]
  ------------------
 2304|  52.7k|	unsigned c = *in;
 2305|       |
 2306|  52.7k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 813, False: 51.9k]
  ------------------
 2307|    813|	    *poutlen = in - instart;
 2308|    813|	    *pinlen = in - instart;
 2309|    813|	    return(XML_ENC_ERR_INPUT);
 2310|    813|	}
 2311|       |
 2312|  51.9k|        in++;
 2313|  51.9k|	*out++ = c;
 2314|  51.9k|    }
 2315|       |
 2316|    226|    return(ret);
 2317|  1.03k|}
encoding.c:xmlFindExtraHandler:
  908|  11.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|  11.2k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 11.2k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  11.2k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 11.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|  11.2k|#ifdef LIBXML_ICONV_ENABLED
  939|  11.2k|    {
  940|  11.2k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  11.2k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 10.4k, False: 781]
  ------------------
  943|  10.4k|            return(XML_ERR_OK);
  944|    781|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 21, False: 760]
  ------------------
  945|     21|            return(ret);
  946|    781|    }
  947|    760|#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|    760|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|    781|}
encoding.c:xmlCharEncIconv:
 1319|  11.2k|                xmlCharEncodingHandler **out) {
 1320|  11.2k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  11.2k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  11.2k|    iconv_t icv_in;
 1323|  11.2k|    iconv_t icv_out;
 1324|  11.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|  11.2k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 11.2k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  11.2k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  11.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|  11.2k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 231, False: 11.0k]
  ------------------
 1367|  11.0k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 11.0k]
  ------------------
 1368|    231|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    231|        goto error;
 1370|    231|    }
 1371|  11.0k|#endif
 1372|       |
 1373|  11.0k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 11.0k, False: 0]
  ------------------
 1374|  11.0k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  11.0k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 5, False: 11.0k]
  ------------------
 1376|      5|            ret = XML_ERR_NO_MEMORY;
 1377|      5|            goto error;
 1378|      5|        }
 1379|  11.0k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  11.0k|        icv_in = iconv_open("UTF-8", name);
 1382|  11.0k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 523, False: 10.5k]
  ------------------
 1383|    523|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 523, False: 0]
  ------------------
 1384|    523|                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|    523|            goto error;
 1390|    523|        }
 1391|  10.5k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  10.5k|        inFunc = xmlIconvConvert;
 1394|  10.5k|    }
 1395|       |
 1396|  10.5k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 991, False: 9.52k]
  ------------------
 1397|    991|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|    991|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 2, False: 989]
  ------------------
 1399|      2|            ret = XML_ERR_NO_MEMORY;
 1400|      2|            goto error;
 1401|      2|        }
 1402|    989|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|    989|        icv_out = iconv_open(name, "UTF-8");
 1405|    989|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 989]
  ------------------
 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|    989|        outputCtxt->cd = icv_out;
 1415|       |
 1416|    989|        outFunc = xmlIconvConvert;
 1417|    989|    }
 1418|       |
 1419|  10.5k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  10.5k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|    767|error:
 1423|    767|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 525, False: 242]
  ------------------
 1424|    525|        xmlIconvFree(inputCtxt);
 1425|    767|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 767]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|    767|    return(ret);
 1428|  10.5k|}
encoding.c:xmlEncodingMatch:
 1295|  22.3k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  23.5k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 23.5k, Folded]
  ------------------
 1300|  24.9k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  24.4k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 23.7k, False: 662]
  |  |  ------------------
  |  |  223|  24.4k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 23.1k, False: 652]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 24.4k, False: 469]
  ------------------
 1301|  1.31k|            name1 += 1;
 1302|  23.5k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  23.3k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 23.3k, False: 0]
  |  |  ------------------
  |  |  223|  23.3k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 23.3k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 23.3k, False: 231]
  ------------------
 1303|      0|            name2 += 1;
 1304|  23.5k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 469, False: 23.1k]
  |  Branch (1304:30): [True: 213, False: 22.9k]
  ------------------
 1305|    682|            break;
 1306|  22.9k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 21.6k, False: 1.28k]
  ------------------
 1307|  21.6k|            return(0);
 1308|  1.28k|        name1 += 1;
 1309|  1.28k|        name2 += 1;
 1310|  1.28k|    }
 1311|       |
 1312|       |    /* Only check whether name1 starts with name2 */
 1313|    682|    return(*name2 == 0);
 1314|  22.3k|}
encoding.c:xmlIconvConvert:
 1234|  36.4k|                int flush ATTRIBUTE_UNUSED) {
 1235|  36.4k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  36.4k|    size_t icv_inlen, icv_outlen;
 1237|  36.4k|    const char *icv_in = (const char *) in;
 1238|  36.4k|    char *icv_out = (char *) out;
 1239|  36.4k|    size_t ret;
 1240|       |
 1241|  36.4k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 36.4k]
  |  Branch (1241:26): [True: 0, False: 36.4k]
  |  Branch (1241:46): [True: 0, False: 36.4k]
  |  Branch (1241:65): [True: 0, False: 36.4k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  36.4k|    icv_inlen = *inlen;
 1246|  36.4k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  36.4k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  36.4k|    *inlen -= icv_inlen;
 1252|  36.4k|    *outlen -= icv_outlen;
 1253|  36.4k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 17.7k, False: 18.7k]
  ------------------
 1254|  17.7k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 517, False: 17.2k]
  ------------------
 1255|    517|            return(XML_ENC_ERR_INPUT);
 1256|  17.2k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 14.3k, False: 2.89k]
  ------------------
 1257|  14.3k|            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.89k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 2.89k, False: 0]
  ------------------
 1263|  2.89k|            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.89k|    }
 1274|  18.7k|    return(XML_ENC_ERR_SUCCESS);
 1275|  36.4k|}
encoding.c:xmlIconvFree:
 1278|  21.5k|xmlIconvFree(void *vctxt) {
 1279|  21.5k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  21.5k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 9.51k, False: 12.0k]
  ------------------
 1282|  9.51k|        return;
 1283|       |
 1284|  12.0k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 11.5k, False: 523]
  ------------------
 1285|  11.5k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  12.0k|    xmlFree(ctxt);
 1288|  12.0k|}
encoding.c:xmlEncConvertError:
 1649|  3.28k|xmlEncConvertError(xmlCharEncError code) {
 1650|  3.28k|    xmlParserErrors ret;
 1651|       |
 1652|  3.28k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.28k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  3.28k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 3.28k, False: 0]
  ------------------
 1657|  3.28k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  3.28k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 3.28k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.28k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  3.28k|    }
 1666|       |
 1667|  3.28k|    return(ret);
 1668|  3.28k|}
encoding.c:latin1ToUTF8:
 2323|  20.4k|             int flush ATTRIBUTE_UNUSED) {
 2324|  20.4k|    unsigned char* outstart = out;
 2325|  20.4k|    const unsigned char* instart = in;
 2326|  20.4k|    unsigned char* outend;
 2327|  20.4k|    const unsigned char* inend;
 2328|  20.4k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  20.4k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 20.4k]
  |  Branch (2330:26): [True: 0, False: 20.4k]
  |  Branch (2330:42): [True: 0, False: 20.4k]
  |  Branch (2330:62): [True: 0, False: 20.4k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  20.4k|    outend = out + *outlen;
 2334|  20.4k|    inend = in + *inlen;
 2335|       |
 2336|  18.5M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 18.5M, False: 14.5k]
  ------------------
 2337|  18.5M|        unsigned c = *in;
 2338|       |
 2339|  18.5M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 5.37M, False: 13.1M]
  ------------------
 2340|  5.37M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 2.23k, False: 5.37M]
  ------------------
 2341|  2.23k|                goto done;
 2342|  5.37M|            *out++ = c;
 2343|  13.1M|	} else {
 2344|  13.1M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 3.61k, False: 13.1M]
  ------------------
 2345|  3.61k|                goto done;
 2346|  13.1M|	    *out++ = (c >> 6) | 0xC0;
 2347|  13.1M|            *out++ = (c & 0x3F) | 0x80;
 2348|  13.1M|        }
 2349|       |
 2350|  18.5M|        in++;
 2351|  18.5M|    }
 2352|       |
 2353|  14.5k|    ret = out - outstart;
 2354|       |
 2355|  20.4k|done:
 2356|  20.4k|    *outlen = out - outstart;
 2357|  20.4k|    *inlen = in - instart;
 2358|  20.4k|    return(ret);
 2359|  14.5k|}

xmlFreeEntity:
   85|   143k|{
   86|   143k|    xmlDictPtr dict = NULL;
   87|       |
   88|   143k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 143k]
  ------------------
   89|      0|        return;
   90|       |
   91|   143k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 139k, False: 3.88k]
  ------------------
   92|   139k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   143k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 4.46k, False: 139k]
  ------------------
   96|  4.46k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 4.46k, False: 0]
  ------------------
   97|  4.46k|        xmlFreeNodeList(entity->children);
   98|   143k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 143k, False: 11]
  ------------------
   99|   143k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 115k, False: 27.9k]
  |  Branch (99:28): [True: 0, False: 27.9k]
  ------------------
  100|   115k|        xmlFree((char *) entity->name);
  101|   143k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 3.48k, False: 140k]
  ------------------
  102|  3.48k|        xmlFree((char *) entity->ExternalID);
  103|   143k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 14.2k, False: 129k]
  ------------------
  104|  14.2k|        xmlFree((char *) entity->SystemID);
  105|   143k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 9.53k, False: 134k]
  ------------------
  106|  9.53k|        xmlFree((char *) entity->URI);
  107|   143k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 125k, False: 18.1k]
  ------------------
  108|   125k|        xmlFree((char *) entity->content);
  109|   143k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 16.1k, False: 127k]
  ------------------
  110|  16.1k|        xmlFree((char *) entity->orig);
  111|   143k|    xmlFree(entity);
  112|   143k|}
xmlAddEntity:
  188|   144k|	  const xmlChar *content, xmlEntity **out) {
  189|   144k|    xmlDtdPtr dtd;
  190|   144k|    xmlDictPtr dict = NULL;
  191|   144k|    xmlEntitiesTablePtr table = NULL;
  192|   144k|    xmlEntityPtr ret, predef;
  193|   144k|    int res;
  194|       |
  195|   144k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 144k, False: 0]
  ------------------
  196|   144k|        *out = NULL;
  197|   144k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 144k]
  |  Branch (197:26): [True: 0, False: 144k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   144k|    dict = doc->dict;
  200|       |
  201|   144k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 6.14k, False: 138k]
  ------------------
  202|  6.14k|        dtd = doc->extSubset;
  203|   138k|    else
  204|   138k|        dtd = doc->intSubset;
  205|   144k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 144k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   144k|    switch (type) {
  209|  66.6k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 66.6k, False: 77.8k]
  ------------------
  210|  76.6k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 9.96k, False: 134k]
  ------------------
  211|  77.2k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 617, False: 143k]
  ------------------
  212|  77.2k|            predef = xmlGetPredefinedEntity(name);
  213|  77.2k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 5.51k, False: 71.7k]
  ------------------
  214|  5.51k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  5.51k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 5.15k, False: 356]
  ------------------
  218|  5.15k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 3.28k, False: 1.87k]
  ------------------
  219|  3.28k|                    int c = predef->content[0];
  220|       |
  221|  3.28k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 1.92k, False: 1.35k]
  |  Branch (221:47): [True: 540, False: 1.38k]
  ------------------
  222|    540|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 119, False: 421]
  |  Branch (222:40): [True: 112, False: 309]
  |  Branch (222:55): [True: 83, False: 226]
  ------------------
  223|    314|                        valid = 1;
  224|  2.96k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.40k, False: 1.56k]
  |  Branch (224:55): [True: 901, False: 502]
  ------------------
  225|    901|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 86, False: 815]
  ------------------
  226|     86|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|     86|#define BAD_CAST (xmlChar *)
  ------------------
  227|     86|                            xmlChar ref[] = "00;";
  228|       |
  229|     86|                            ref[0] = hex[c / 16 % 16];
  230|     86|                            ref[1] = hex[c % 16];
  231|     86|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 10, False: 76]
  ------------------
  232|     10|                                valid = 1;
  233|    815|                        } else {
  234|    815|                            xmlChar ref[] = "00;";
  235|       |
  236|    815|                            ref[0] = '0' + c / 10 % 10;
  237|    815|                            ref[1] = '0' + c % 10;
  238|    815|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 435, False: 380]
  ------------------
  239|    435|                                valid = 1;
  240|    815|                        }
  241|    901|                    }
  242|  3.28k|                }
  243|  5.51k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 4.75k, False: 759]
  ------------------
  244|  4.75k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  5.51k|            }
  246|  72.4k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 5.41k, False: 67.0k]
  ------------------
  247|  5.41k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  5.41k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 2, False: 5.41k]
  ------------------
  249|      2|                    return(XML_ERR_NO_MEMORY);
  250|  5.41k|            }
  251|  72.4k|	    table = dtd->entities;
  252|  72.4k|	    break;
  253|  61.2k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 61.2k, False: 83.2k]
  ------------------
  254|  67.2k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 6.02k, False: 138k]
  ------------------
  255|  67.2k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.48k, False: 63.8k]
  ------------------
  256|  3.48k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.48k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.48k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.48k|            }
  260|  67.2k|	    table = dtd->pentities;
  261|  67.2k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 144k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   144k|    }
  265|   139k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   139k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 21, False: 139k]
  ------------------
  267|     21|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   139k|    res = xmlHashAdd(table, name, ret);
  270|   139k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 8, False: 139k]
  ------------------
  271|      8|        xmlFreeEntity(ret);
  272|      8|        return(XML_ERR_NO_MEMORY);
  273|   139k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 117k, False: 22.1k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|   117k|        xmlFreeEntity(ret);
  278|   117k|	return(XML_WAR_ENTITY_REDEFINED);
  279|   117k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  22.1k|    ret->parent = dtd;
  285|  22.1k|    ret->doc = dtd->doc;
  286|  22.1k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 6.21k, False: 15.9k]
  ------------------
  287|  6.21k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  15.9k|    } else {
  289|  15.9k|	dtd->last->next = (xmlNodePtr) ret;
  290|  15.9k|	ret->prev = dtd->last;
  291|  15.9k|	dtd->last = (xmlNodePtr) ret;
  292|  15.9k|    }
  293|       |
  294|  22.1k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 22.1k, False: 0]
  ------------------
  295|  22.1k|        *out = ret;
  296|  22.1k|    return(0);
  297|   139k|}
xmlGetPredefinedEntity:
  306|  4.72M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  4.72M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 5, False: 4.72M]
  ------------------
  308|  4.72M|    switch (name[0]) {
  309|   400k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 400k, False: 4.32M]
  ------------------
  310|   400k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   400k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 13.8k, False: 386k]
  ------------------
  311|  13.8k|	        return(&xmlEntityLt);
  312|   386k|	    break;
  313|  1.44M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.44M, False: 3.27M]
  ------------------
  314|  1.44M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.44M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.43M, False: 18.9k]
  ------------------
  315|  1.43M|	        return(&xmlEntityGt);
  316|  18.9k|	    break;
  317|  79.3k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 79.3k, False: 4.64M]
  ------------------
  318|  79.3k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  79.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 9.59k, False: 69.7k]
  ------------------
  319|  9.59k|	        return(&xmlEntityAmp);
  320|  69.7k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  69.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 6.67k, False: 63.1k]
  ------------------
  321|  6.67k|	        return(&xmlEntityApos);
  322|  63.1k|	    break;
  323|  77.7k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 77.7k, False: 4.64M]
  ------------------
  324|  77.7k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|  77.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 77.1k, False: 528]
  ------------------
  325|  77.1k|	        return(&xmlEntityQuot);
  326|    528|	    break;
  327|  2.72M|	default:
  ------------------
  |  Branch (327:2): [True: 2.72M, False: 2.00M]
  ------------------
  328|  2.72M|	    break;
  329|  4.72M|    }
  330|  3.18M|    return(NULL);
  331|  4.72M|}
xmlAddDocEntity:
  372|    146|	        const xmlChar *content) {
  373|    146|    xmlEntityPtr ret;
  374|       |
  375|    146|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    146|    return(ret);
  377|    146|}
xmlGetParameterEntity:
  428|   471k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   471k|    xmlEntitiesTablePtr table;
  430|   471k|    xmlEntityPtr ret;
  431|       |
  432|   471k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 86, False: 471k]
  ------------------
  433|     86|	return(NULL);
  434|   471k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 471k, False: 40]
  |  Branch (434:37): [True: 456k, False: 14.8k]
  ------------------
  435|   456k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   456k|	ret = xmlGetEntityFromTable(table, name);
  437|   456k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 346k, False: 109k]
  ------------------
  438|   346k|	    return(ret);
  439|   456k|    }
  440|   124k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 15.5k, False: 108k]
  |  Branch (440:37): [True: 15.2k, False: 298]
  ------------------
  441|  15.2k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  15.2k|	return(xmlGetEntityFromTable(table, name));
  443|  15.2k|    }
  444|   109k|    return(NULL);
  445|   124k|}
xmlGetDocEntity:
  476|  2.60M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.60M|    xmlEntityPtr cur;
  478|  2.60M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.60M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.60M, False: 1.41k]
  ------------------
  481|  2.60M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.59M, False: 10.7k]
  |  Branch (481:34): [True: 2.53M, False: 60.7k]
  ------------------
  482|  2.53M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  2.53M|	    cur = xmlGetEntityFromTable(table, name);
  484|  2.53M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 2.12M, False: 412k]
  ------------------
  485|  2.12M|		return(cur);
  486|  2.53M|	}
  487|   484k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 483k, False: 984]
  ------------------
  488|   483k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 5.32k, False: 477k]
  ------------------
  489|  5.32k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 4.06k, False: 1.25k]
  ------------------
  490|  4.06k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  4.06k|		cur = xmlGetEntityFromTable(table, name);
  492|  4.06k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 3.23k, False: 832]
  ------------------
  493|  3.23k|		    return(cur);
  494|  4.06k|	    }
  495|   483k|	}
  496|   484k|    }
  497|   482k|    return(xmlGetPredefinedEntity(name));
  498|  2.60M|}
xmlFreeEntitiesTable:
  588|  11.4k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  11.4k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  11.4k|}
xmlCopyEntitiesTable:
  665|  2.63k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  2.63k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  2.63k|}
entities.c:xmlCreateEntity:
  120|   139k|	        const xmlChar *content) {
  121|   139k|    xmlEntityPtr ret;
  122|       |
  123|   139k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   139k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 7, False: 139k]
  ------------------
  125|      7|	return(NULL);
  126|   139k|    memset(ret, 0, sizeof(xmlEntity));
  127|   139k|    ret->doc = doc;
  128|   139k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   139k|    ret->etype = (xmlEntityType) type;
  134|   139k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 139k]
  |  Branch (134:26): [True: 111k, False: 27.9k]
  ------------------
  135|   111k|	ret->name = xmlStrdup(name);
  136|  27.9k|    else
  137|  27.9k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   139k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 3, False: 139k]
  ------------------
  139|      3|        goto error;
  140|   139k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.09k, False: 136k]
  ------------------
  141|  3.09k|        ret->ExternalID = xmlStrdup(publicId);
  142|  3.09k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 1, False: 3.09k]
  ------------------
  143|      1|            goto error;
  144|  3.09k|    }
  145|   139k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 12.3k, False: 127k]
  ------------------
  146|  12.3k|        ret->SystemID = xmlStrdup(systemId);
  147|  12.3k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 3, False: 12.3k]
  ------------------
  148|      3|            goto error;
  149|  12.3k|    }
  150|   139k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 123k, False: 16.6k]
  ------------------
  151|   123k|        ret->length = xmlStrlen(content);
  152|   123k|	ret->content = xmlStrndup(content, ret->length);
  153|   123k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 7, False: 123k]
  ------------------
  154|      7|            goto error;
  155|   123k|     } else {
  156|  16.6k|        ret->length = 0;
  157|  16.6k|        ret->content = NULL;
  158|  16.6k|    }
  159|   139k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   139k|    ret->orig = NULL;
  162|       |
  163|   139k|    return(ret);
  164|       |
  165|     14|error:
  166|     14|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   139k|}
entities.c:xmlGetEntityFromTable:
  415|  3.00M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  3.00M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  3.00M|}
entities.c:xmlFreeEntityWrapper:
  575|  26.0k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  26.0k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 26.0k, False: 0]
  ------------------
  577|  26.0k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  26.0k|}
entities.c:xmlCopyEntity:
  600|  3.88k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  3.88k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  3.88k|    xmlEntityPtr cur;
  603|       |
  604|  3.88k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  3.88k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 8, False: 3.88k]
  ------------------
  606|      8|	return(NULL);
  607|  3.88k|    memset(cur, 0, sizeof(xmlEntity));
  608|  3.88k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  3.88k|    cur->etype = ent->etype;
  611|  3.88k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 3.88k, False: 0]
  ------------------
  612|  3.88k|	cur->name = xmlStrdup(ent->name);
  613|  3.88k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 8, False: 3.87k]
  ------------------
  614|      8|            goto error;
  615|  3.88k|    }
  616|  3.87k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 394, False: 3.47k]
  ------------------
  617|    394|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|    394|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 2, False: 392]
  ------------------
  619|      2|            goto error;
  620|    394|    }
  621|  3.87k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 1.86k, False: 2.00k]
  ------------------
  622|  1.86k|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|  1.86k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 5, False: 1.85k]
  ------------------
  624|      5|            goto error;
  625|  1.86k|    }
  626|  3.86k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 2.25k, False: 1.61k]
  ------------------
  627|  2.25k|	cur->content = xmlStrdup(ent->content);
  628|  2.25k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 4, False: 2.24k]
  ------------------
  629|      4|            goto error;
  630|  2.25k|    }
  631|  3.86k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 2.26k, False: 1.59k]
  ------------------
  632|  2.26k|	cur->orig = xmlStrdup(ent->orig);
  633|  2.26k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 9, False: 2.25k]
  ------------------
  634|      9|            goto error;
  635|  2.26k|    }
  636|  3.85k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 1.85k, False: 1.99k]
  ------------------
  637|  1.85k|	cur->URI = xmlStrdup(ent->URI);
  638|  1.85k|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 7, False: 1.84k]
  ------------------
  639|      7|            goto error;
  640|  1.85k|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  3.84k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 923, False: 2.92k]
  ------------------
  643|    923|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    923|        cur->last = cur->children;
  646|  3.84k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 3.83k, False: 7]
  |  Branch (646:29): [True: 2.92k, False: 916]
  ------------------
  647|    923|    }
  648|       |
  649|  3.84k|    return(cur);
  650|       |
  651|     35|error:
  652|     35|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  3.85k|}

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

xmlFuzzSErrorFunc:
   69|   286k|                  const xmlError *error ATTRIBUTE_UNUSED) {
   70|   286k|}
xmlFuzzInjectFailure:
   83|  81.9k|xmlFuzzInjectFailure(size_t failurePos) {
   84|  81.9k|    fuzzNumAttempts = 0;
   85|  81.9k|    fuzzFailurePos = failurePos;
   86|  81.9k|    fuzzAllocFailed = 0;
   87|  81.9k|    fuzzIoFailed = 0;
   88|  81.9k|}
xmlFuzzMemSetup:
  151|      2|xmlFuzzMemSetup(void) {
  152|      2|    xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
  153|      2|}
xmlFuzzCheckFailureReport:
  167|  40.8k|xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport) {
  168|  40.8k|    if (oomReport >= 0 && fuzzAllocFailed != oomReport) {
  ------------------
  |  Branch (168:9): [True: 36.8k, False: 3.95k]
  |  Branch (168:27): [True: 0, False: 36.8k]
  ------------------
  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|  40.8k|    if (ioReport >= 0 && fuzzIoFailed != ioReport) {
  ------------------
  |  Branch (173:9): [True: 40.8k, False: 0]
  |  Branch (173:26): [True: 0, False: 40.8k]
  ------------------
  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|  40.8k|    fuzzAllocFailed = 0;
  179|  40.8k|    fuzzIoFailed = 0;
  180|  40.8k|}
xmlFuzzDataInit:
  188|  41.0k|xmlFuzzDataInit(const char *data, size_t size) {
  189|  41.0k|    fuzzData.data = data;
  190|  41.0k|    fuzzData.size = size;
  191|  41.0k|    fuzzData.ptr = data;
  192|  41.0k|    fuzzData.remaining = size;
  193|       |
  194|  41.0k|    fuzzData.outBuf = xmlMalloc(size + 1);
  195|  41.0k|    fuzzData.outPtr = fuzzData.outBuf;
  196|       |
  197|  41.0k|    fuzzData.entities = xmlHashCreate(8);
  198|  41.0k|    fuzzData.mainUrl = NULL;
  199|  41.0k|    fuzzData.mainEntity = NULL;
  200|  41.0k|    fuzzData.secondaryUrl = NULL;
  201|       |    fuzzData.secondaryEntity = NULL;
  202|  41.0k|}
xmlFuzzDataCleanup:
  210|  41.0k|xmlFuzzDataCleanup(void) {
  211|  41.0k|    xmlFree(fuzzData.outBuf);
  212|  41.0k|    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
  213|  41.0k|}
xmlFuzzReadInt:
  246|  82.0k|xmlFuzzReadInt(int size) {
  247|  82.0k|    size_t ret = 0;
  248|       |
  249|   410k|    while ((size > 0) && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (249:12): [True: 328k, False: 82.0k]
  |  Branch (249:26): [True: 328k, False: 10]
  ------------------
  250|   328k|        unsigned char c = (unsigned char) *fuzzData.ptr++;
  251|   328k|        fuzzData.remaining--;
  252|   328k|        ret = (ret << 8) | c;
  253|   328k|        size--;
  254|   328k|    }
  255|       |
  256|  82.0k|    return ret;
  257|  82.0k|}
xmlFuzzReadString:
  320|   200k|xmlFuzzReadString(size_t *size) {
  321|   200k|    const char *out = fuzzData.outPtr;
  322|       |
  323|   283M|    while (fuzzData.remaining > 0) {
  ------------------
  |  Branch (323:12): [True: 283M, False: 80.9k]
  ------------------
  324|   283M|        int c = *fuzzData.ptr++;
  325|   283M|        fuzzData.remaining--;
  326|       |
  327|   283M|        if ((c == '\\') && (fuzzData.remaining > 0)) {
  ------------------
  |  Branch (327:13): [True: 133k, False: 283M]
  |  Branch (327:28): [True: 133k, False: 547]
  ------------------
  328|   133k|            int c2 = *fuzzData.ptr;
  329|       |
  330|   133k|            if (c2 == '\n') {
  ------------------
  |  Branch (330:17): [True: 119k, False: 14.1k]
  ------------------
  331|   119k|                fuzzData.ptr++;
  332|   119k|                fuzzData.remaining--;
  333|   119k|                if (size != NULL)
  ------------------
  |  Branch (333:21): [True: 119k, False: 0]
  ------------------
  334|   119k|                    *size = fuzzData.outPtr - out;
  335|   119k|                *fuzzData.outPtr++ = '\0';
  336|   119k|                return(out);
  337|   119k|            }
  338|  14.1k|            if (c2 == '\\') {
  ------------------
  |  Branch (338:17): [True: 1.93k, False: 12.2k]
  ------------------
  339|  1.93k|                fuzzData.ptr++;
  340|  1.93k|                fuzzData.remaining--;
  341|  1.93k|            }
  342|  14.1k|        }
  343|       |
  344|   283M|        *fuzzData.outPtr++ = c;
  345|   283M|    }
  346|       |
  347|  80.9k|    if (fuzzData.outPtr > out) {
  ------------------
  |  Branch (347:9): [True: 39.9k, False: 41.0k]
  ------------------
  348|  39.9k|        if (size != NULL)
  ------------------
  |  Branch (348:13): [True: 39.9k, False: 0]
  ------------------
  349|  39.9k|            *size = fuzzData.outPtr - out;
  350|  39.9k|        *fuzzData.outPtr++ = '\0';
  351|  39.9k|        return(out);
  352|  39.9k|    }
  353|       |
  354|  41.0k|    if (size != NULL)
  ------------------
  |  Branch (354:9): [True: 41.0k, False: 0]
  ------------------
  355|  41.0k|        *size = 0;
  356|       |    return(NULL);
  357|  80.9k|}
xmlFuzzReadEntities:
  366|  41.0k|xmlFuzzReadEntities(void) {
  367|  41.0k|    size_t num = 0;
  368|       |
  369|  98.6k|    while (1) {
  ------------------
  |  Branch (369:12): [True: 98.6k, Folded]
  ------------------
  370|  98.6k|        const char *url, *entity;
  371|  98.6k|        size_t urlSize, entitySize;
  372|  98.6k|        xmlFuzzEntityInfo *entityInfo;
  373|       |
  374|  98.6k|        url = xmlFuzzReadString(&urlSize);
  375|  98.6k|        if (url == NULL) break;
  ------------------
  |  Branch (375:13): [True: 38.2k, False: 60.4k]
  ------------------
  376|       |
  377|  60.4k|        entity = xmlFuzzReadString(&entitySize);
  378|  60.4k|        if (entity == NULL) break;
  ------------------
  |  Branch (378:13): [True: 2.72k, False: 57.6k]
  ------------------
  379|       |
  380|       |        /*
  381|       |         * Cap URL size to avoid quadratic behavior when generating
  382|       |         * error messages or looking up entities.
  383|       |         */
  384|  57.6k|        if (urlSize < 50 &&
  ------------------
  |  Branch (384:13): [True: 57.0k, False: 606]
  ------------------
  385|  57.0k|            xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
  ------------------
  |  Branch (385:13): [True: 55.2k, False: 1.79k]
  ------------------
  386|  55.2k|            entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
  387|  55.2k|            if (entityInfo == NULL)
  ------------------
  |  Branch (387:17): [True: 0, False: 55.2k]
  ------------------
  388|      0|                break;
  389|  55.2k|            entityInfo->data = entity;
  390|  55.2k|            entityInfo->size = entitySize;
  391|       |
  392|  55.2k|            xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
  393|       |
  394|  55.2k|            if (num == 0) {
  ------------------
  |  Branch (394:17): [True: 40.8k, False: 14.3k]
  ------------------
  395|  40.8k|                fuzzData.mainUrl = url;
  396|  40.8k|                fuzzData.mainEntity = entityInfo;
  397|  40.8k|            } else if (num == 1) {
  ------------------
  |  Branch (397:24): [True: 9.60k, False: 4.78k]
  ------------------
  398|  9.60k|                fuzzData.secondaryUrl = url;
  399|  9.60k|                fuzzData.secondaryEntity = entityInfo;
  400|  9.60k|            }
  401|       |
  402|  55.2k|            num++;
  403|  55.2k|        }
  404|  57.6k|    }
  405|  41.0k|}
xmlFuzzMainEntity:
  424|  41.0k|xmlFuzzMainEntity(size_t *size) {
  425|  41.0k|    if (fuzzData.mainEntity == NULL)
  ------------------
  |  Branch (425:9): [True: 114, False: 40.8k]
  ------------------
  426|    114|        return(NULL);
  427|  40.8k|    *size = fuzzData.mainEntity->size;
  428|  40.8k|    return(fuzzData.mainEntity->data);
  429|  41.0k|}
xmlFuzzResourceLoader:
  465|   297k|                      xmlParserInputPtr *out) {
  466|   297k|    xmlParserInputPtr input;
  467|   297k|    xmlFuzzEntityInfo *entity;
  468|       |
  469|   297k|    entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
  470|   297k|    if (entity == NULL)
  ------------------
  |  Branch (470:9): [True: 6.57k, False: 290k]
  ------------------
  471|  6.57k|        return(XML_IO_ENOENT);
  472|       |
  473|       |    /* IO failure injection */
  474|   290k|    if (xmlFuzzTryIo() < 0)
  ------------------
  |  Branch (474:9): [True: 19, False: 290k]
  ------------------
  475|     19|        return(XML_IO_EIO);
  476|       |
  477|   290k|    input = xmlNewInputFromMemory(URL, entity->data, entity->size,
  478|   290k|                                  XML_INPUT_BUF_STATIC |
  479|   290k|                                  XML_INPUT_BUF_ZERO_TERMINATED);
  480|   290k|    if (input == NULL)
  ------------------
  |  Branch (480:9): [True: 48, False: 290k]
  ------------------
  481|     48|        return(XML_ERR_NO_MEMORY);
  482|       |
  483|   290k|    *out = input;
  484|   290k|    return(XML_ERR_OK);
  485|   290k|}
fuzz.c:xmlFuzzMalloc:
  123|  90.5M|xmlFuzzMalloc(size_t size) {
  124|  90.5M|    void *ret;
  125|       |
  126|  90.5M|    if (xmlFuzzTryMalloc() < 0)
  ------------------
  |  Branch (126:9): [True: 8.63k, False: 90.5M]
  ------------------
  127|  8.63k|        return NULL;
  128|       |
  129|  90.5M|    ret = malloc(size);
  130|  90.5M|    if (ret == NULL)
  ------------------
  |  Branch (130:9): [True: 0, False: 90.5M]
  ------------------
  131|      0|        fuzzAllocFailed = 1;
  132|       |
  133|  90.5M|    return ret;
  134|  90.5M|}
fuzz.c:xmlFuzzTryMalloc:
   91|  95.0M|xmlFuzzTryMalloc(void) {
   92|  95.0M|    if (fuzzFailurePos > 0) {
  ------------------
  |  Branch (92:9): [True: 30.0M, False: 65.0M]
  ------------------
   93|  30.0M|        fuzzNumAttempts += 1;
   94|  30.0M|        if (fuzzNumAttempts == fuzzFailurePos) {
  ------------------
  |  Branch (94:13): [True: 9.86k, False: 30.0M]
  ------------------
   95|       |#if XML_FUZZ_FAILURE_ABORT
   96|       |            abort();
   97|       |#endif
   98|  9.86k|            fuzzAllocFailed = 1;
   99|  9.86k|            return -1;
  100|  9.86k|        }
  101|  30.0M|    }
  102|       |
  103|  95.0M|    return 0;
  104|  95.0M|}
fuzz.c:xmlFuzzRealloc:
  137|  4.46M|xmlFuzzRealloc(void *ptr, size_t size) {
  138|  4.46M|    void *ret;
  139|       |
  140|  4.46M|    if (xmlFuzzTryMalloc() < 0)
  ------------------
  |  Branch (140:9): [True: 1.22k, False: 4.45M]
  ------------------
  141|  1.22k|        return NULL;
  142|       |
  143|  4.45M|    ret = realloc(ptr, size);
  144|  4.45M|    if (ret == NULL)
  ------------------
  |  Branch (144:9): [True: 0, False: 4.45M]
  ------------------
  145|      0|        fuzzAllocFailed = 1;
  146|       |
  147|  4.45M|    return ret;
  148|  4.46M|}
fuzz.c:xmlFuzzTryIo:
  107|   290k|xmlFuzzTryIo(void) {
  108|   290k|    if (fuzzFailurePos > 0) {
  ------------------
  |  Branch (108:9): [True: 27.5k, False: 263k]
  ------------------
  109|  27.5k|        fuzzNumAttempts += 1;
  110|  27.5k|        if (fuzzNumAttempts == fuzzFailurePos) {
  ------------------
  |  Branch (110:13): [True: 19, False: 27.4k]
  ------------------
  111|       |#if XML_FUZZ_FAILURE_ABORT
  112|       |            abort();
  113|       |#endif
  114|     19|            fuzzIoFailed = 1;
  115|     19|            return -1;
  116|     19|        }
  117|  27.5k|    }
  118|       |
  119|   290k|    return 0;
  120|   290k|}

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|  41.0k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  41.0k|    xmlTextReaderPtr reader;
  106|  41.0k|    xmlDocPtr doc = NULL;
  107|  41.0k|    const xmlError *error;
  108|  41.0k|    const char *docBuffer;
  109|  41.0k|    const unsigned char *program;
  110|  41.0k|    size_t failurePos, docSize, programSize, i;
  111|  41.0k|    size_t totalStringSize = 0;
  112|  41.0k|    int opts;
  113|  41.0k|    int oomReport = 0;
  114|       |
  115|  41.0k|    xmlFuzzDataInit(data, size);
  116|  41.0k|    opts = (int) xmlFuzzReadInt(4);
  117|  41.0k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  41.0k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  41.0k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 27, False: 40.9k]
  ------------------
  121|     27|        programSize = 1000;
  122|       |
  123|  41.0k|    xmlFuzzReadEntities();
  124|  41.0k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  41.0k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 114, False: 40.8k]
  ------------------
  126|    114|        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|  40.8k|    xmlFuzzInjectFailure(failurePos);
  142|  40.8k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  40.8k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 62, False: 40.8k]
  ------------------
  144|     62|        goto exit;
  145|       |
  146|  40.8k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  40.8k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  40.8k|    i = 0;
  150|   793k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 753k, False: 39.4k]
  ------------------
  151|   753k|        int op = program[i++];
  152|       |
  153|   753k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   753k|#define FREE_STRING(str) \
  155|   753k|    do { \
  156|   753k|        if (str != NULL) { \
  157|   753k|            totalStringSize += strlen((char *) str); \
  158|   753k|            xmlFree(str); \
  159|   753k|        } \
  160|   753k|    } while (0)
  161|       |
  162|   753k|        switch (op & 0x3F) {
  163|  51.8k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 51.8k, False: 702k]
  ------------------
  164|   256k|            default:
  ------------------
  |  Branch (164:13): [True: 204k, False: 549k]
  ------------------
  165|   256k|                startOp("Read");
  166|   256k|                xmlTextReaderRead(reader);
  167|   256k|                break;
  168|       |
  169|  12.8k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 12.8k, False: 741k]
  ------------------
  170|  12.8k|                xmlChar *result;
  171|       |
  172|  12.8k|                startOp("ReadInnerXml");
  173|  12.8k|                result = xmlTextReaderReadInnerXml(reader);
  174|  12.8k|                FREE_STRING(result);
  ------------------
  |  |  155|  12.8k|    do { \
  |  |  156|  12.8k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 8.31k, False: 4.52k]
  |  |  ------------------
  |  |  157|  8.31k|            totalStringSize += strlen((char *) str); \
  |  |  158|  8.31k|            xmlFree(str); \
  |  |  159|  8.31k|        } \
  |  |  160|  12.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 12.8k]
  |  |  ------------------
  ------------------
  175|  12.8k|                break;
  176|  51.8k|            }
  177|       |
  178|  36.9k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 36.9k, False: 716k]
  ------------------
  179|  36.9k|                xmlChar *result;
  180|       |
  181|  36.9k|                startOp("ReadOuterXml");
  182|  36.9k|                result = xmlTextReaderReadOuterXml(reader);
  183|  36.9k|                FREE_STRING(result);
  ------------------
  |  |  155|  36.9k|    do { \
  |  |  156|  36.9k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 28.7k, False: 8.16k]
  |  |  ------------------
  |  |  157|  28.7k|            totalStringSize += strlen((char *) str); \
  |  |  158|  28.7k|            xmlFree(str); \
  |  |  159|  28.7k|        } \
  |  |  160|  36.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 36.9k]
  |  |  ------------------
  ------------------
  184|  36.9k|                break;
  185|  51.8k|            }
  186|       |
  187|  9.40k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 9.40k, False: 744k]
  ------------------
  188|  9.40k|                xmlChar *result;
  189|       |
  190|  9.40k|                startOp("ReadString");
  191|  9.40k|                result = xmlTextReaderReadString(reader);
  192|  9.40k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.40k|    do { \
  |  |  156|  9.40k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.49k, False: 6.91k]
  |  |  ------------------
  |  |  157|  2.49k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.49k|            xmlFree(str); \
  |  |  159|  2.49k|        } \
  |  |  160|  9.40k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.40k]
  |  |  ------------------
  ------------------
  193|  9.40k|                break;
  194|  51.8k|            }
  195|       |
  196|  9.85k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 9.85k, False: 744k]
  ------------------
  197|  9.85k|                startOp("ReadAttributeValue");
  198|  9.85k|                xmlTextReaderReadAttributeValue(reader);
  199|  9.85k|                break;
  200|       |
  201|  9.24k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 9.24k, False: 744k]
  ------------------
  202|  9.24k|                startOp("AttributeCount");
  203|  9.24k|                xmlTextReaderAttributeCount(reader);
  204|  9.24k|                break;
  205|       |
  206|  3.59k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.59k, False: 750k]
  ------------------
  207|  3.59k|                startOp("Depth");
  208|  3.59k|                xmlTextReaderDepth(reader);
  209|  3.59k|                break;
  210|       |
  211|  3.30k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 3.30k, False: 750k]
  ------------------
  212|  3.30k|                startOp("HasAttributes");
  213|  3.30k|                xmlTextReaderHasAttributes(reader);
  214|  3.30k|                break;
  215|       |
  216|  11.3k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 11.3k, False: 742k]
  ------------------
  217|  11.3k|                startOp("HasValue");
  218|  11.3k|                xmlTextReaderHasValue(reader);
  219|  11.3k|                break;
  220|       |
  221|  6.19k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 6.19k, False: 747k]
  ------------------
  222|  6.19k|                startOp("IsDefault");
  223|  6.19k|                xmlTextReaderIsDefault(reader);
  224|  6.19k|                break;
  225|       |
  226|  8.84k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 8.84k, False: 745k]
  ------------------
  227|  8.84k|                startOp("IsEmptyElement");
  228|  8.84k|                xmlTextReaderIsEmptyElement(reader);
  229|  8.84k|                break;
  230|       |
  231|  10.9k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 10.9k, False: 742k]
  ------------------
  232|  10.9k|                startOp("NodeType");
  233|  10.9k|                xmlTextReaderNodeType(reader);
  234|  10.9k|                break;
  235|       |
  236|  2.82k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 2.82k, False: 751k]
  ------------------
  237|  2.82k|                startOp("QuoteChar");
  238|  2.82k|                xmlTextReaderQuoteChar(reader);
  239|  2.82k|                break;
  240|       |
  241|  4.72k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 4.72k, False: 749k]
  ------------------
  242|  4.72k|                startOp("ReadState");
  243|  4.72k|                xmlTextReaderReadState(reader);
  244|  4.72k|                break;
  245|       |
  246|  3.96k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 3.96k, False: 749k]
  ------------------
  247|  3.96k|                startOp("IsNamespaceDecl");
  248|  3.96k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  3.96k|                break;
  250|       |
  251|  42.7k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 42.7k, False: 711k]
  ------------------
  252|  42.7k|                startOp("ConstBaseUri");
  253|  42.7k|                xmlTextReaderConstBaseUri(reader);
  254|  42.7k|                break;
  255|       |
  256|  2.63k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 2.63k, False: 751k]
  ------------------
  257|  2.63k|                startOp("ConstLocalName");
  258|  2.63k|                xmlTextReaderConstLocalName(reader);
  259|  2.63k|                break;
  260|       |
  261|  4.20k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 4.20k, False: 749k]
  ------------------
  262|  4.20k|                startOp("ConstName");
  263|  4.20k|                xmlTextReaderConstName(reader);
  264|  4.20k|                break;
  265|       |
  266|  5.31k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.31k, False: 748k]
  ------------------
  267|  5.31k|                startOp("ConstNamespaceUri");
  268|  5.31k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.31k|                break;
  270|       |
  271|  12.6k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 12.6k, False: 741k]
  ------------------
  272|  12.6k|                startOp("ConstPrefix");
  273|  12.6k|                xmlTextReaderConstPrefix(reader);
  274|  12.6k|                break;
  275|       |
  276|  9.26k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 9.26k, False: 744k]
  ------------------
  277|  9.26k|                startOp("ConstXmlLang");
  278|  9.26k|                xmlTextReaderConstXmlLang(reader);
  279|  9.26k|                oomReport = -1;
  280|  9.26k|                break;
  281|       |
  282|  6.48k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 6.48k, False: 747k]
  ------------------
  283|  6.48k|                startOp("ConstValue");
  284|  6.48k|                xmlTextReaderConstValue(reader);
  285|  6.48k|                break;
  286|       |
  287|  8.48k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 8.48k, False: 745k]
  ------------------
  288|  8.48k|                xmlChar *result;
  289|       |
  290|  8.48k|                startOp("BaseUri");
  291|  8.48k|                result = xmlTextReaderBaseUri(reader);
  292|  8.48k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.48k|    do { \
  |  |  156|  8.48k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.54k, False: 5.93k]
  |  |  ------------------
  |  |  157|  2.54k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.54k|            xmlFree(str); \
  |  |  159|  2.54k|        } \
  |  |  160|  8.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.48k]
  |  |  ------------------
  ------------------
  293|  8.48k|                break;
  294|  51.8k|            }
  295|       |
  296|  5.61k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.61k, False: 748k]
  ------------------
  297|  5.61k|                xmlChar *result;
  298|       |
  299|  5.61k|                startOp("LocalName");
  300|  5.61k|                result = xmlTextReaderLocalName(reader);
  301|  5.61k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.61k|    do { \
  |  |  156|  5.61k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.33k, False: 2.27k]
  |  |  ------------------
  |  |  157|  3.33k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.33k|            xmlFree(str); \
  |  |  159|  3.33k|        } \
  |  |  160|  5.61k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.61k]
  |  |  ------------------
  ------------------
  302|  5.61k|                break;
  303|  51.8k|            }
  304|       |
  305|  5.90k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.90k, False: 747k]
  ------------------
  306|  5.90k|                xmlChar *result;
  307|       |
  308|  5.90k|                startOp("Name");
  309|  5.90k|                result = xmlTextReaderName(reader);
  310|  5.90k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.90k|    do { \
  |  |  156|  5.90k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.81k, False: 2.09k]
  |  |  ------------------
  |  |  157|  3.81k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.81k|            xmlFree(str); \
  |  |  159|  3.81k|        } \
  |  |  160|  5.90k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.90k]
  |  |  ------------------
  ------------------
  311|  5.90k|                break;
  312|  51.8k|            }
  313|       |
  314|  3.77k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 3.77k, False: 750k]
  ------------------
  315|  3.77k|                xmlChar *result;
  316|       |
  317|  3.77k|                startOp("NamespaceUri");
  318|  3.77k|                result = xmlTextReaderNamespaceUri(reader);
  319|  3.77k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.77k|    do { \
  |  |  156|  3.77k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 500, False: 3.27k]
  |  |  ------------------
  |  |  157|    500|            totalStringSize += strlen((char *) str); \
  |  |  158|    500|            xmlFree(str); \
  |  |  159|    500|        } \
  |  |  160|  3.77k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.77k]
  |  |  ------------------
  ------------------
  320|  3.77k|                break;
  321|  51.8k|            }
  322|       |
  323|  4.22k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.22k, False: 749k]
  ------------------
  324|  4.22k|                xmlChar *result;
  325|       |
  326|  4.22k|                startOp("Prefix");
  327|  4.22k|                result = xmlTextReaderPrefix(reader);
  328|  4.22k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.22k|    do { \
  |  |  156|  4.22k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 521, False: 3.70k]
  |  |  ------------------
  |  |  157|    521|            totalStringSize += strlen((char *) str); \
  |  |  158|    521|            xmlFree(str); \
  |  |  159|    521|        } \
  |  |  160|  4.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.22k]
  |  |  ------------------
  ------------------
  329|  4.22k|                break;
  330|  51.8k|            }
  331|       |
  332|  3.11k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.11k, False: 750k]
  ------------------
  333|  3.11k|                xmlChar *result;
  334|       |
  335|  3.11k|                startOp("XmlLang");
  336|  3.11k|                result = xmlTextReaderXmlLang(reader);
  337|  3.11k|                oomReport = -1;
  338|  3.11k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.11k|    do { \
  |  |  156|  3.11k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 231, False: 2.88k]
  |  |  ------------------
  |  |  157|    231|            totalStringSize += strlen((char *) str); \
  |  |  158|    231|            xmlFree(str); \
  |  |  159|    231|        } \
  |  |  160|  3.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.11k]
  |  |  ------------------
  ------------------
  339|  3.11k|                break;
  340|  51.8k|            }
  341|       |
  342|  9.11k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.11k, False: 744k]
  ------------------
  343|  9.11k|                xmlChar *result;
  344|       |
  345|  9.11k|                startOp("Value");
  346|  9.11k|                result = xmlTextReaderValue(reader);
  347|  9.11k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.11k|    do { \
  |  |  156|  9.11k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.78k, False: 6.33k]
  |  |  ------------------
  |  |  157|  2.78k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.78k|            xmlFree(str); \
  |  |  159|  2.78k|        } \
  |  |  160|  9.11k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.11k]
  |  |  ------------------
  ------------------
  348|  9.11k|                break;
  349|  51.8k|            }
  350|       |
  351|  1.69k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.69k, False: 752k]
  ------------------
  352|  1.69k|                startOp("Close");
  353|  1.69k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 566, False: 1.13k]
  ------------------
  354|    566|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.69k|                xmlTextReaderClose(reader);
  356|  1.69k|                break;
  357|       |
  358|  6.18k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 6.18k, False: 747k]
  ------------------
  359|  6.18k|                xmlChar *result;
  360|  6.18k|                int no = READ_BYTE();
  ------------------
  |  |  153|  6.18k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 6.10k, False: 82]
  |  |  ------------------
  ------------------
  361|       |
  362|  6.18k|                startOp("GetAttributeNo");
  363|  6.18k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  6.18k|                FREE_STRING(result);
  ------------------
  |  |  155|  6.18k|    do { \
  |  |  156|  6.18k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 458, False: 5.72k]
  |  |  ------------------
  |  |  157|    458|            totalStringSize += strlen((char *) str); \
  |  |  158|    458|            xmlFree(str); \
  |  |  159|    458|        } \
  |  |  160|  6.18k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 6.18k]
  |  |  ------------------
  ------------------
  365|  6.18k|                break;
  366|  51.8k|            }
  367|       |
  368|  29.1k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 29.1k, False: 724k]
  ------------------
  369|  29.1k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  29.1k|                xmlChar *result;
  371|       |
  372|  29.1k|                startOp("GetAttribute");
  373|  29.1k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  29.1k|                FREE_STRING(result);
  ------------------
  |  |  155|  29.1k|    do { \
  |  |  156|  29.1k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 801, False: 28.3k]
  |  |  ------------------
  |  |  157|    801|            totalStringSize += strlen((char *) str); \
  |  |  158|    801|            xmlFree(str); \
  |  |  159|    801|        } \
  |  |  160|  29.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 29.1k]
  |  |  ------------------
  ------------------
  375|  29.1k|                break;
  376|  51.8k|            }
  377|       |
  378|  23.9k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 23.9k, False: 729k]
  ------------------
  379|  23.9k|                const xmlChar *localName, *namespaceUri;
  380|  23.9k|                xmlChar *result;
  381|       |
  382|  23.9k|                startOp("GetAttributeNs");
  383|  23.9k|                localName = xmlTextReaderConstLocalName(reader);
  384|  23.9k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  23.9k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  23.9k|                                                     namespaceUri);
  387|  23.9k|                FREE_STRING(result);
  ------------------
  |  |  155|  23.9k|    do { \
  |  |  156|  23.9k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 927, False: 23.0k]
  |  |  ------------------
  |  |  157|    927|            totalStringSize += strlen((char *) str); \
  |  |  158|    927|            xmlFree(str); \
  |  |  159|    927|        } \
  |  |  160|  23.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 23.9k]
  |  |  ------------------
  ------------------
  388|  23.9k|                break;
  389|  51.8k|            }
  390|       |
  391|  3.83k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 3.83k, False: 750k]
  ------------------
  392|  3.83k|                startOp("GetRemainder");
  393|  3.83k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 1.92k, False: 1.91k]
  ------------------
  394|  1.92k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  3.83k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  3.83k|                break;
  397|       |
  398|  7.96k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 7.96k, False: 745k]
  ------------------
  399|  7.96k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  7.96k|                xmlChar *result;
  401|       |
  402|  7.96k|                startOp("LookupNamespace");
  403|  7.96k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  7.96k|                FREE_STRING(result);
  ------------------
  |  |  155|  7.96k|    do { \
  |  |  156|  7.96k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 929, False: 7.04k]
  |  |  ------------------
  |  |  157|    929|            totalStringSize += strlen((char *) str); \
  |  |  158|    929|            xmlFree(str); \
  |  |  159|    929|        } \
  |  |  160|  7.96k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 7.96k]
  |  |  ------------------
  ------------------
  405|  7.96k|                break;
  406|  51.8k|            }
  407|       |
  408|  7.30k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.30k, False: 746k]
  ------------------
  409|  7.30k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.30k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.21k, False: 90]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.30k|                startOp("MoveToAttributeNo");
  412|  7.30k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.30k|                break;
  414|  51.8k|            }
  415|       |
  416|  12.4k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.4k, False: 741k]
  ------------------
  417|  12.4k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  12.4k|                startOp("MoveToAttribute");
  420|  12.4k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  12.4k|                break;
  422|  51.8k|            }
  423|       |
  424|  10.6k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 10.6k, False: 743k]
  ------------------
  425|  10.6k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  10.6k|                startOp("MoveToAttributeNs");
  428|  10.6k|                localName = xmlTextReaderConstLocalName(reader);
  429|  10.6k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  10.6k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  10.6k|                                               namespaceUri);
  432|  10.6k|                break;
  433|  51.8k|            }
  434|       |
  435|  13.0k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 13.0k, False: 740k]
  ------------------
  436|  13.0k|                startOp("MoveToFirstAttribute");
  437|  13.0k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  13.0k|                break;
  439|       |
  440|  8.38k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 8.38k, False: 745k]
  ------------------
  441|  8.38k|                startOp("MoveToNextAttribute");
  442|  8.38k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  8.38k|                break;
  444|       |
  445|  4.98k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 4.98k, False: 748k]
  ------------------
  446|  4.98k|                startOp("MoveToElement");
  447|  4.98k|                xmlTextReaderMoveToElement(reader);
  448|  4.98k|                break;
  449|       |
  450|  2.27k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.27k, False: 751k]
  ------------------
  451|  2.27k|                startOp("Normalization");
  452|  2.27k|                xmlTextReaderNormalization(reader);
  453|  2.27k|                break;
  454|       |
  455|  3.59k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.59k, False: 750k]
  ------------------
  456|  3.59k|                startOp("ConstEncoding");
  457|  3.59k|                xmlTextReaderConstEncoding(reader);
  458|  3.59k|                break;
  459|       |
  460|  7.82k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.82k, False: 746k]
  ------------------
  461|  7.82k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.82k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.60k, False: 221]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.82k|                startOp("GetParserProp");
  464|  7.82k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.82k|                break;
  466|  51.8k|            }
  467|       |
  468|  12.6k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 12.6k, False: 741k]
  ------------------
  469|  12.6k|                startOp("CurrentNode");
  470|  12.6k|                xmlTextReaderCurrentNode(reader);
  471|  12.6k|                break;
  472|       |
  473|  5.44k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.44k, False: 748k]
  ------------------
  474|  5.44k|                startOp("GetParserLineNumber");
  475|  5.44k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.44k|                break;
  477|       |
  478|  9.24k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 9.24k, False: 744k]
  ------------------
  479|  9.24k|                startOp("GetParserColumnNumber");
  480|  9.24k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  9.24k|                break;
  482|       |
  483|  8.66k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 8.66k, False: 745k]
  ------------------
  484|  8.66k|                startOp("Preserve");
  485|  8.66k|                xmlTextReaderPreserve(reader);
  486|  8.66k|                break;
  487|       |
  488|  6.96k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 6.96k, False: 746k]
  ------------------
  489|  6.96k|                xmlDocPtr result;
  490|       |
  491|  6.96k|                startOp("CurrentDoc");
  492|  6.96k|                result = xmlTextReaderCurrentDoc(reader);
  493|  6.96k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 2.98k, False: 3.97k]
  ------------------
  494|  2.98k|                    doc = result;
  495|  6.96k|                break;
  496|  51.8k|            }
  497|       |
  498|  7.96k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 7.96k, False: 745k]
  ------------------
  499|  7.96k|                startOp("Expand");
  500|  7.96k|                xmlTextReaderExpand(reader);
  501|  7.96k|                break;
  502|       |
  503|  19.5k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 19.5k, False: 734k]
  ------------------
  504|  19.5k|                startOp("Next");
  505|  19.5k|                xmlTextReaderNext(reader);
  506|  19.5k|                break;
  507|       |
  508|  7.54k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 7.54k, False: 746k]
  ------------------
  509|  7.54k|                startOp("NextSibling");
  510|  7.54k|                xmlTextReaderNextSibling(reader);
  511|  7.54k|                break;
  512|       |
  513|  3.74k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.74k, False: 750k]
  ------------------
  514|  3.74k|                startOp("IsValid");
  515|  3.74k|                xmlTextReaderIsValid(reader);
  516|  3.74k|                break;
  517|       |
  518|  4.63k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 4.63k, False: 749k]
  ------------------
  519|  4.63k|                startOp("ConstXmlVersion");
  520|  4.63k|                xmlTextReaderConstXmlVersion(reader);
  521|  4.63k|                break;
  522|       |
  523|  4.12k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 4.12k, False: 749k]
  ------------------
  524|  4.12k|                startOp("Standalone");
  525|  4.12k|                xmlTextReaderStandalone(reader);
  526|  4.12k|                break;
  527|       |
  528|  5.85k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 5.85k, False: 748k]
  ------------------
  529|  5.85k|                startOp("ByteConsumed");
  530|  5.85k|                xmlTextReaderByteConsumed(reader);
  531|  5.85k|                oomReport = -1;
  532|  5.85k|                break;
  533|   753k|        }
  534|       |
  535|   753k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.40k, False: 752k]
  ------------------
  536|  1.40k|            break;
  537|   753k|    }
  538|       |
  539|  40.8k|    error = xmlTextReaderGetLastError(reader);
  540|  40.8k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 9.76k, False: 31.0k]
  ------------------
  541|  9.76k|        oomReport = 1;
  542|  40.8k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  40.8k|    xmlFreeTextReader(reader);
  545|       |
  546|  40.8k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.83k, False: 36.9k]
  ------------------
  547|  3.83k|        xmlFreeDoc(doc);
  548|       |
  549|  41.0k|exit:
  550|  41.0k|    xmlFuzzInjectFailure(0);
  551|  41.0k|    xmlFuzzDataCleanup();
  552|  41.0k|    xmlResetLastError();
  553|  41.0k|    return(0);
  554|  40.8k|}
reader.c:startOp:
   83|   753k|startOp(const char *name) {
   84|   753k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   753k|}

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|  50.6k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  50.6k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  50.6k|}
__xmlGetWarningsDefaultValue:
  638|   743k|__xmlGetWarningsDefaultValue(void) {
  639|   743k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   743k|}
__xmlKeepBlanksDefaultValue:
  643|  50.6k|__xmlKeepBlanksDefaultValue(void) {
  644|  50.6k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  50.6k|}
__xmlLoadExtDtdDefaultValue:
  653|  50.6k|__xmlLoadExtDtdDefaultValue(void) {
  654|  50.6k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  50.6k|}
__xmlPedanticParserDefaultValue:
  658|  50.6k|__xmlPedanticParserDefaultValue(void) {
  659|  50.6k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  50.6k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  50.6k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  50.6k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  50.6k|}
__xmlTreeIndentString:
  674|  40.3k|__xmlTreeIndentString(void) {
  675|  40.3k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  40.3k|}
__xmlSaveNoEmptyTags:
  679|  40.3k|__xmlSaveNoEmptyTags(void) {
  680|  40.3k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  40.3k|}
__xmlStructuredError:
  695|   426k|__xmlStructuredError(void) {
  696|   426k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   426k|}
xmlGetLocalRngState:
  755|   137k|xmlGetLocalRngState(void) {
  756|   137k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   137k|}
xmlGetLastErrorInternal:
  785|   779k|xmlGetLastErrorInternal(void) {
  786|   779k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   779k|}
globals.c:xmlPosixStrdup:
  200|   546k|xmlPosixStrdup(const char *cur) {
  201|   546k|    return((char*) xmlCharStrdup(cur));
  202|   546k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.41M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.41M|    xmlGlobalState *gs;
  527|       |
  528|  2.41M|    (void) allowFailure;
  529|       |
  530|  2.41M|    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.41M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.41M]
  ------------------
  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.41M|    return(gs);
  549|  2.41M|}
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|  86.4k|xmlHashCreate(int size) {
  159|  86.4k|    xmlHashTablePtr hash;
  160|       |
  161|  86.4k|    xmlInitParser();
  162|       |
  163|  86.4k|    hash = xmlMalloc(sizeof(*hash));
  164|  86.4k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 30, False: 86.4k]
  ------------------
  165|     30|        return(NULL);
  166|  86.4k|    hash->dict = NULL;
  167|  86.4k|    hash->size = 0;
  168|  86.4k|    hash->table = NULL;
  169|  86.4k|    hash->nbElems = 0;
  170|  86.4k|    hash->randomSeed = xmlRandom();
  171|  86.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  86.4k|    hash->randomSeed = 0;
  173|  86.4k|#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|  86.4k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  86.4k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 6.98k, False: 79.4k]
  ------------------
  181|  6.98k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  6.98k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  7.08k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|     94|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 94, False: 6.98k]
  |  Branch (183:47): [True: 94, False: 0]
  ------------------
  184|     94|            newSize *= 2;
  185|       |
  186|  6.98k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 3, False: 6.98k]
  ------------------
  187|      3|            xmlFree(hash);
  188|      3|            return(NULL);
  189|      3|        }
  190|  6.98k|    }
  191|       |
  192|  86.4k|    return(hash);
  193|  86.4k|}
xmlHashCreateDict:
  205|  29.6k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  29.6k|    xmlHashTablePtr hash;
  207|       |
  208|  29.6k|    hash = xmlHashCreate(size);
  209|  29.6k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 29.6k, False: 11]
  ------------------
  210|  29.6k|        hash->dict = dict;
  211|  29.6k|        xmlDictReference(dict);
  212|  29.6k|    }
  213|  29.6k|    return(hash);
  214|  29.6k|}
xmlHashFree:
  224|   107k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|   107k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 21.4k, False: 86.4k]
  ------------------
  226|  21.4k|        return;
  227|       |
  228|  86.4k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 86.0k, False: 384]
  ------------------
  229|  86.0k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  86.0k|        const xmlHashEntry *entry;
  231|       |
  232|   912k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 826k, False: 86.0k]
  ------------------
  233|   826k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 652k, False: 173k]
  ------------------
  234|   652k|                continue;
  235|   173k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 151k, False: 22.5k]
  |  Branch (235:38): [True: 151k, False: 0]
  ------------------
  236|   151k|                dealloc(entry->payload, entry->key);
  237|   173k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 101k, False: 71.9k]
  ------------------
  238|   101k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 101k, False: 0]
  ------------------
  239|   101k|                    xmlFree(entry->key);
  240|   101k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 6.65k, False: 95.0k]
  ------------------
  241|  6.65k|                    xmlFree(entry->key2);
  242|   101k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 15.8k, False: 85.8k]
  ------------------
  243|  15.8k|                    xmlFree(entry->key3);
  244|   101k|            }
  245|   173k|        }
  246|       |
  247|  86.0k|        xmlFree(hash->table);
  248|  86.0k|    }
  249|       |
  250|  86.4k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 20.1k, False: 66.2k]
  ------------------
  251|  20.1k|        xmlDictFree(hash->dict);
  252|       |
  253|  86.4k|    xmlFree(hash);
  254|  86.4k|}
xmlHashDefaultDeallocator:
  592|  59.1k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  59.1k|    xmlFree(entry);
  594|  59.1k|}
xmlHashAdd:
  610|   142k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   142k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   142k|}
xmlHashAdd2:
  629|  67.7k|                 const xmlChar *key2, void *payload) {
  630|  67.7k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  67.7k|}
xmlHashAdd3:
  650|  81.1k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  81.1k|}
xmlHashAddEntry:
  669|  58.6k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  58.6k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  58.6k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 58.6k]
  ------------------
  673|      0|        res = -1;
  674|  58.6k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 58.6k, False: 8]
  ------------------
  675|  58.6k|        res = 0;
  676|       |
  677|  58.6k|    return(res);
  678|  58.6k|}
xmlHashUpdateEntry:
  742|    412|                   void *payload, xmlHashDeallocator dealloc) {
  743|    412|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    412|                                    dealloc, 1);
  745|       |
  746|    412|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 45, False: 367]
  ------------------
  747|     45|        res = 0;
  748|       |
  749|    412|    return(res);
  750|    412|}
xmlHashUpdateEntry2:
  767|  4.21k|                   xmlHashDeallocator dealloc) {
  768|  4.21k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  4.21k|                                    dealloc, 1);
  770|       |
  771|  4.21k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 3.50k, False: 705]
  ------------------
  772|  3.50k|        res = 0;
  773|       |
  774|  4.21k|    return(res);
  775|  4.21k|}
xmlHashLookup:
  811|  3.41M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  3.41M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  3.41M|}
xmlHashLookup2:
  825|  1.20M|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|  1.20M|}
xmlHashQLookup2:
  856|  43.8k|                const xmlChar *name2) {
  857|  43.8k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  43.8k|}
xmlHashLookup3:
  871|  6.22M|               const xmlChar *key2, const xmlChar *key3) {
  872|  6.22M|    const xmlHashEntry *entry;
  873|  6.22M|    unsigned hashValue;
  874|  6.22M|    int found;
  875|       |
  876|  6.22M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 13.6k, False: 6.20M]
  |  Branch (876:27): [True: 53.8k, False: 6.15M]
  |  Branch (876:48): [True: 11, False: 6.15M]
  ------------------
  877|  67.5k|        return(NULL);
  878|  6.15M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  6.15M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  6.15M|    if (found)
  ------------------
  |  Branch (880:9): [True: 4.48M, False: 1.67M]
  ------------------
  881|  4.48M|        return(entry->payload);
  882|  1.67M|    return(NULL);
  883|  6.15M|}
xmlHashQLookup3:
  902|  43.8k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  43.8k|    const xmlHashEntry *entry;
  904|  43.8k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  43.8k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 43.8k]
  |  Branch (906:27): [True: 0, False: 43.8k]
  |  Branch (906:48): [True: 0, False: 43.8k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  43.8k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  43.8k|                                  name2, prefix3, name3);
  911|  43.8k|    mask = hash->size - 1;
  912|  43.8k|    pos = hashValue & mask;
  913|  43.8k|    entry = &hash->table[pos];
  914|       |
  915|  43.8k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 7.32k, False: 36.5k]
  ------------------
  916|  7.32k|        displ = 0;
  917|  7.32k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  7.32k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  8.08k|        do {
  920|  8.08k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 4.21k, False: 3.86k]
  ------------------
  921|  4.21k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 4.21k, False: 0]
  ------------------
  922|  4.21k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 4.21k, False: 0]
  ------------------
  923|  4.21k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 4.21k, False: 0]
  ------------------
  924|  4.21k|                return(entry->payload);
  925|       |
  926|  3.86k|            displ++;
  927|  3.86k|            pos++;
  928|  3.86k|            entry++;
  929|  3.86k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 340, False: 3.52k]
  ------------------
  930|    340|                entry = hash->table;
  931|  3.86k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 1.58k, False: 2.28k]
  ------------------
  932|  1.58k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 760, False: 822]
  ------------------
  933|  7.32k|    }
  934|       |
  935|  39.6k|    return(NULL);
  936|  43.8k|}
xmlHashScan:
  959|  7.74k|xmlHashScan(xmlHashTable *hash, xmlHashScanner scan, void *data) {
  960|  7.74k|    stubData sdata;
  961|  7.74k|    sdata.data = data;
  962|  7.74k|    sdata.scan = scan;
  963|  7.74k|    xmlHashScanFull(hash, stubHashScannerFull, &sdata);
  964|  7.74k|}
xmlHashScanFull:
  974|  11.3k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  11.3k|    const xmlHashEntry *entry, *end;
  976|  11.3k|    xmlHashEntry old;
  977|  11.3k|    unsigned i;
  978|       |
  979|  11.3k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 438, False: 10.9k]
  |  Branch (979:27): [True: 0, False: 10.9k]
  |  Branch (979:48): [True: 0, False: 10.9k]
  ------------------
  980|    438|        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|  10.9k|    entry = hash->table;
  990|  10.9k|    end = &hash->table[hash->size];
  991|  14.4k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.48k, False: 10.9k]
  ------------------
  992|  3.48k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.48k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.48k|    }
  995|       |
  996|   168k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 157k, False: 10.9k]
  ------------------
  997|   157k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 42.1k, False: 115k]
  |  Branch (997:40): [True: 42.1k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  42.9k|            do {
 1002|  42.9k|                old = *entry;
 1003|  42.9k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  42.9k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 41.4k, False: 1.46k]
  ------------------
 1005|  41.4k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 41.4k, False: 0]
  ------------------
 1006|  41.4k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 699, False: 40.7k]
  ------------------
 1007|  40.7k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 60, False: 40.6k]
  ------------------
 1008|  40.6k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 40.6k]
  ------------------
 1009|  42.1k|        }
 1010|   157k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 10.9k, False: 146k]
  ------------------
 1011|  10.9k|            entry = hash->table;
 1012|   157k|    }
 1013|  10.9k|}
xmlHashScan3:
 1030|    906|             xmlHashScanner scan, void *data) {
 1031|    906|    stubData sdata;
 1032|    906|    sdata.data = data;
 1033|    906|    sdata.scan = scan;
 1034|    906|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|    906|}
xmlHashScanFull3:
 1052|    906|                 xmlHashScannerFull scan, void *data) {
 1053|    906|    const xmlHashEntry *entry, *end;
 1054|    906|    xmlHashEntry old;
 1055|    906|    unsigned i;
 1056|       |
 1057|    906|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 377, False: 529]
  |  Branch (1057:27): [True: 0, False: 529]
  |  Branch (1057:48): [True: 0, False: 529]
  ------------------
 1058|    377|        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|    529|    entry = hash->table;
 1068|    529|    end = &hash->table[hash->size];
 1069|    993|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 464, False: 529]
  ------------------
 1070|    464|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 464]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    464|    }
 1073|       |
 1074|   199k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 199k, False: 529]
  ------------------
 1075|   199k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 101k, False: 97.6k]
  |  Branch (1075:40): [True: 101k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   101k|            do {
 1080|   101k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 101k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   101k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 101k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   101k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 101k, False: 0]
  |  Branch (1083:40): [True: 101k, False: 97]
  ------------------
 1084|   101k|                    break;
 1085|     97|                old = *entry;
 1086|     97|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|     97|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 97, False: 0]
  ------------------
 1088|     97|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 97, False: 0]
  ------------------
 1089|     97|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 97]
  ------------------
 1090|     97|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 97]
  ------------------
 1091|     97|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 97]
  ------------------
 1092|   101k|        }
 1093|   199k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 529, False: 198k]
  ------------------
 1094|    529|            entry = hash->table;
 1095|   199k|    }
 1096|    529|}
xmlHashCopySafe:
 1111|  14.3k|                xmlHashDeallocator deallocFunc) {
 1112|  14.3k|    const xmlHashEntry *entry, *end;
 1113|  14.3k|    xmlHashTablePtr ret;
 1114|       |
 1115|  14.3k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 14.3k]
  |  Branch (1115:27): [True: 0, False: 14.3k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  14.3k|    ret = xmlHashCreate(hash->size);
 1119|  14.3k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 14, False: 14.3k]
  ------------------
 1120|     14|        return(NULL);
 1121|       |
 1122|  14.3k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 14.3k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  14.3k|    end = &hash->table[hash->size];
 1126|       |
 1127|   131k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 117k, False: 14.0k]
  ------------------
 1128|   117k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 22.8k, False: 94.7k]
  ------------------
 1129|  22.8k|            void *copy;
 1130|       |
 1131|  22.8k|            copy = copyFunc(entry->payload, entry->key);
 1132|  22.8k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 216, False: 22.6k]
  ------------------
 1133|    216|                goto error;
 1134|  22.6k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 96, False: 22.5k]
  ------------------
 1135|  22.6k|                            copy) <= 0) {
 1136|     96|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 96, False: 0]
  ------------------
 1137|     96|                    deallocFunc(copy, entry->key);
 1138|     96|                goto error;
 1139|     96|            }
 1140|  22.6k|        }
 1141|   117k|    }
 1142|       |
 1143|  14.0k|    return(ret);
 1144|       |
 1145|    312|error:
 1146|    312|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  14.3k|}
xmlHashSize:
 1173|  3.64k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.64k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.64k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.64k|    return(hash->nbElems);
 1177|  3.64k|}
xmlHashRemoveEntry:
 1189|  2.10k|                       xmlHashDeallocator dealloc) {
 1190|  2.10k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  2.10k|}
xmlHashRemoveEntry2:
 1206|  2.42k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  2.42k|}
xmlHashRemoveEntry3:
 1226|  4.53k|                    xmlHashDeallocator dealloc) {
 1227|  4.53k|    xmlHashEntry *entry, *cur, *next;
 1228|  4.53k|    unsigned hashValue, mask, pos, nextpos;
 1229|  4.53k|    int found;
 1230|       |
 1231|  4.53k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 4.53k]
  |  Branch (1231:27): [True: 0, False: 4.53k]
  |  Branch (1231:48): [True: 0, False: 4.53k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  4.53k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  4.53k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  4.53k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 4.53k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  4.53k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 2.10k, False: 2.42k]
  |  Branch (1239:30): [True: 2.10k, False: 0]
  ------------------
 1240|  2.10k|        dealloc(entry->payload, entry->key);
 1241|  4.53k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 2.19k, False: 2.34k]
  ------------------
 1242|  2.19k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 2.19k, False: 0]
  ------------------
 1243|  2.19k|            xmlFree(entry->key);
 1244|  2.19k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 4, False: 2.18k]
  ------------------
 1245|      4|            xmlFree(entry->key2);
 1246|  2.19k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 2.19k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  2.19k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  4.53k|    mask = hash->size - 1;
 1255|  4.53k|    pos = entry - hash->table;
 1256|  4.53k|    cur = entry;
 1257|       |
 1258|  9.06k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 9.06k, Folded]
  ------------------
 1259|  9.06k|        nextpos = pos + 1;
 1260|  9.06k|        next = cur + 1;
 1261|  9.06k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 828, False: 8.23k]
  ------------------
 1262|    828|            next = hash->table;
 1263|       |
 1264|  9.06k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 3.12k, False: 5.93k]
  ------------------
 1265|  5.93k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.41k, False: 4.52k]
  ------------------
 1266|  4.53k|            break;
 1267|       |
 1268|  4.52k|        cur = next;
 1269|  4.52k|        pos = nextpos;
 1270|  4.52k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  4.53k|    next = entry + 1;
 1276|       |
 1277|  4.53k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 356, False: 4.17k]
  ------------------
 1278|    356|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    356|        memmove(entry, next, (char *) end - (char *) next);
 1281|    356|        entry = hash->table;
 1282|    356|        end[-1] = *entry;
 1283|    356|        next = entry + 1;
 1284|    356|    }
 1285|       |
 1286|  4.53k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  4.53k|    cur->hashValue = 0;
 1292|       |
 1293|  4.53k|    hash->nbElems--;
 1294|       |
 1295|  4.53k|    return(0);
 1296|  4.53k|}
hash.c:xmlHashGrow:
  345|  88.4k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  88.4k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  88.4k|    xmlHashEntry *table;
  348|  88.4k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  88.4k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 88.4k]
  ------------------
  352|      0|        return(-1);
  353|  88.4k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  88.4k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 37, False: 88.4k]
  ------------------
  355|     37|        return(-1);
  356|  88.4k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  88.4k|    oldsize = hash->size;
  359|  88.4k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 86.0k, False: 2.40k]
  ------------------
  360|  86.0k|        goto done;
  361|       |
  362|  2.40k|    oldend = &hash->table[oldsize];
  363|  2.40k|    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.40k|    oldentry = hash->table;
  373|  15.3k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 12.9k, False: 2.40k]
  ------------------
  374|  12.9k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 12.9k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  12.9k|    }
  377|       |
  378|  83.3k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 80.9k, False: 2.40k]
  ------------------
  379|  80.9k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 70.8k, False: 10.1k]
  ------------------
  380|  70.8k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  96.2k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 25.4k, False: 70.8k]
  ------------------
  383|  25.4k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 339, False: 25.0k]
  ------------------
  384|    339|                    entry = table;
  385|  25.4k|            }
  386|  70.8k|            *entry = *oldentry;
  387|  70.8k|        }
  388|       |
  389|  80.9k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.40k, False: 78.5k]
  ------------------
  390|  2.40k|            oldentry = hash->table;
  391|  80.9k|    }
  392|       |
  393|  2.40k|    xmlFree(hash->table);
  394|       |
  395|  88.4k|done:
  396|  88.4k|    hash->table = table;
  397|  88.4k|    hash->size = size;
  398|       |
  399|  88.4k|    return(0);
  400|  2.40k|}
hash.c:xmlHashUpdateInternal:
  417|   354k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   354k|    xmlChar *copy, *copy2, *copy3;
  419|   354k|    xmlHashEntry *entry = NULL;
  420|   354k|    size_t lengths[3] = {0, 0, 0};
  421|   354k|    unsigned hashValue, newSize;
  422|       |
  423|   354k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 354k]
  |  Branch (423:27): [True: 0, False: 354k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   354k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   354k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 79.0k, False: 275k]
  ------------------
  432|  79.0k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  79.0k|#define MIN_HASH_SIZE 8
  ------------------
  433|   275k|    } else {
  434|   275k|        int found = 0;
  435|       |
  436|   275k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   275k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 175k, False: 99.2k]
  ------------------
  439|   175k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.07k, False: 174k]
  ------------------
  440|  1.07k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 366, False: 705]
  ------------------
  441|    366|                    dealloc(entry->payload, entry->key);
  442|  1.07k|                entry->payload = payload;
  443|  1.07k|            }
  444|       |
  445|   175k|            return(0);
  446|   175k|        }
  447|       |
  448|  99.2k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  99.2k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  99.2k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.40k, False: 96.8k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.40k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.40k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.40k]
  ------------------
  451|      0|                return(-1);
  452|  2.40k|            newSize = hash->size * 2;
  453|  96.8k|        } else {
  454|  96.8k|            newSize = 0;
  455|  96.8k|        }
  456|  99.2k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   178k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 81.4k, False: 96.8k]
  ------------------
  462|  81.4k|        unsigned mask, displ, pos;
  463|       |
  464|  81.4k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 34, False: 81.4k]
  ------------------
  465|     34|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  81.4k|        mask = hash->size - 1;
  471|  81.4k|        displ = 0;
  472|  81.4k|        pos = hashValue & mask;
  473|  81.4k|        entry = &hash->table[pos];
  474|       |
  475|  81.4k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 1.03k, False: 80.4k]
  ------------------
  476|  1.46k|            do {
  477|  1.46k|                displ++;
  478|  1.46k|                pos++;
  479|  1.46k|                entry++;
  480|  1.46k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 70, False: 1.39k]
  ------------------
  481|     70|                    entry = hash->table;
  482|  1.46k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 839, False: 621]
  ------------------
  483|    839|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 421, False: 418]
  ------------------
  484|  1.03k|        }
  485|  81.4k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   178k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 74.3k, False: 103k]
  ------------------
  491|  74.3k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 74.3k, False: 0]
  ------------------
  492|  74.3k|            copy = (xmlChar *) key;
  493|  74.3k|        } 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|  74.3k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 46.1k, False: 28.1k]
  |  Branch (499:31): [True: 27.4k, False: 696]
  ------------------
  500|  73.6k|            copy2 = (xmlChar *) key2;
  501|  73.6k|        } else {
  502|    696|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    696|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 695]
  ------------------
  504|      1|                return(-1);
  505|    696|        }
  506|  74.3k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 53.6k, False: 20.7k]
  |  Branch (506:31): [True: 20.7k, False: 0]
  ------------------
  507|  74.3k|            copy3 = (xmlChar *) key3;
  508|  74.3k|        } 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|   103k|    } else {
  514|   103k|        copy = xmlMalloc(lengths[0] + 1);
  515|   103k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 71, False: 103k]
  ------------------
  516|     71|            return(-1);
  517|   103k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|   103k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 6.67k, False: 97.2k]
  ------------------
  520|  6.67k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  6.67k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 9, False: 6.66k]
  ------------------
  522|      9|                xmlFree(copy);
  523|      9|                return(-1);
  524|      9|            }
  525|  6.66k|            memcpy(copy2, key2, lengths[1] + 1);
  526|  97.2k|        } else {
  527|  97.2k|            copy2 = NULL;
  528|  97.2k|        }
  529|       |
  530|   103k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 15.8k, False: 87.9k]
  ------------------
  531|  15.8k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  15.8k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 16, False: 15.8k]
  ------------------
  533|     16|                xmlFree(copy);
  534|     16|                xmlFree(copy2);
  535|     16|                return(-1);
  536|     16|            }
  537|  15.8k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  87.9k|        } else {
  539|  87.9k|            copy3 = NULL;
  540|  87.9k|        }
  541|   103k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   178k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 20.4k, False: 157k]
  ------------------
  547|  20.4k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  20.4k|        const xmlHashEntry *cur = entry;
  549|       |
  550|   100k|        do {
  551|   100k|            cur++;
  552|   100k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.48k, False: 97.8k]
  ------------------
  553|  2.48k|                cur = hash->table;
  554|   100k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 79.9k, False: 20.4k]
  ------------------
  555|       |
  556|  20.4k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.48k, False: 17.9k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.48k|            memmove(&hash->table[1], hash->table,
  562|  2.48k|                    (char *) cur - (char *) hash->table);
  563|  2.48k|            cur = end - 1;
  564|  2.48k|            hash->table[0] = *cur;
  565|  2.48k|        }
  566|       |
  567|  20.4k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  20.4k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   178k|    entry->key = copy;
  574|   178k|    entry->key2 = copy2;
  575|   178k|    entry->key3 = copy3;
  576|   178k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   178k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   178k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   178k|    hash->nbElems++;
  581|       |
  582|   178k|    return(1);
  583|   178k|}
hash.c:xmlHashValue:
   62|  6.51M|             const xmlChar *key3, size_t *lengths) {
   63|  6.51M|    unsigned h1, h2;
   64|  6.51M|    size_t i;
   65|       |
   66|  6.51M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  6.51M|    do { \
  |  |   24|  6.51M|        h1 = seed ^ 0x3b00; \
  |  |   25|  6.51M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  6.51M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  6.51M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 6.51M]
  |  |  ------------------
  ------------------
   67|       |
   68|  48.8M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 42.3M, False: 6.51M]
  ------------------
   69|  42.3M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  42.3M|    do { \
  |  |   30|  42.3M|        h1 += ch; \
  |  |   31|  42.3M|        h1 += h1 << 3; \
  |  |   32|  42.3M|        h2 += h1; \
  |  |   33|  42.3M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  42.3M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  42.3M|        h2 += h2 << 2; \
  |  |   35|  42.3M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 42.3M]
  |  |  ------------------
  ------------------
   70|  42.3M|    }
   71|  6.51M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 354k, False: 6.15M]
  ------------------
   72|   354k|        lengths[0] = i;
   73|       |
   74|  6.51M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  6.51M|    do { \
  |  |   30|  6.51M|        h1 += ch; \
  |  |   31|  6.51M|        h1 += h1 << 3; \
  |  |   32|  6.51M|        h2 += h1; \
  |  |   33|  6.51M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.51M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.51M|        h2 += h2 << 2; \
  |  |   35|  6.51M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.51M]
  |  |  ------------------
  ------------------
   75|       |
   76|  6.51M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 271k, False: 6.24M]
  ------------------
   77|  1.34M|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 1.07M, False: 271k]
  ------------------
   78|  1.07M|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|  1.07M|    do { \
  |  |   30|  1.07M|        h1 += ch; \
  |  |   31|  1.07M|        h1 += h1 << 3; \
  |  |   32|  1.07M|        h2 += h1; \
  |  |   33|  1.07M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.07M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.07M|        h2 += h2 << 2; \
  |  |   35|  1.07M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.07M]
  |  |  ------------------
  ------------------
   79|  1.07M|        }
   80|   271k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 62.6k, False: 208k]
  ------------------
   81|  62.6k|            lengths[1] = i;
   82|   271k|    }
   83|       |
   84|  6.51M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  6.51M|    do { \
  |  |   30|  6.51M|        h1 += ch; \
  |  |   31|  6.51M|        h1 += h1 << 3; \
  |  |   32|  6.51M|        h2 += h1; \
  |  |   33|  6.51M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.51M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.51M|        h2 += h2 << 2; \
  |  |   35|  6.51M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.51M]
  |  |  ------------------
  ------------------
   85|       |
   86|  6.51M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 1.66M, False: 4.84M]
  ------------------
   87|  3.79M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 2.13M, False: 1.66M]
  ------------------
   88|  2.13M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  2.13M|    do { \
  |  |   30|  2.13M|        h1 += ch; \
  |  |   31|  2.13M|        h1 += h1 << 3; \
  |  |   32|  2.13M|        h2 += h1; \
  |  |   33|  2.13M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  2.13M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  2.13M|        h2 += h2 << 2; \
  |  |   35|  2.13M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 2.13M]
  |  |  ------------------
  ------------------
   89|  2.13M|        }
   90|  1.66M|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 66.0k, False: 1.59M]
  ------------------
   91|  66.0k|            lengths[2] = i;
   92|  1.66M|    }
   93|       |
   94|  6.51M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  6.51M|    do { \
  |  |   40|  6.51M|        h1 ^= h2; \
  |  |   41|  6.51M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  6.51M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  6.51M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  6.51M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  6.51M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  6.51M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  6.51M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  6.51M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  6.51M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  6.51M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 6.51M]
  |  |  ------------------
  ------------------
   95|       |
   96|  6.51M|    return(h2);
   97|  6.51M|}
hash.c:xmlHashFindEntry:
  287|  6.43M|                 unsigned hashValue, int *pfound) {
  288|  6.43M|    xmlHashEntry *entry;
  289|  6.43M|    unsigned mask, pos, displ;
  290|  6.43M|    int found = 0;
  291|       |
  292|  6.43M|    mask = hash->size - 1;
  293|  6.43M|    pos = hashValue & mask;
  294|  6.43M|    entry = &hash->table[pos];
  295|       |
  296|  6.43M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 5.36M, False: 1.07M]
  ------------------
  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|  5.36M|        displ = 0;
  303|  5.36M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  5.36M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  6.49M|        do {
  306|  6.49M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 4.66M, False: 1.83M]
  ------------------
  307|  4.66M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 2.27M, False: 2.38M]
  ------------------
  308|  2.27M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 1.36M, False: 907k]
  ------------------
  309|  1.36M|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 1.34M, False: 16.8k]
  ------------------
  310|  1.34M|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 1.34M, False: 913]
  ------------------
  311|  1.34M|                        found = 1;
  312|  1.34M|                        break;
  313|  1.34M|                    }
  314|  2.27M|                }
  315|  3.31M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 3.31M, False: 207]
  ------------------
  316|  3.31M|                            (const char *) key) == 0) &&
  317|  3.31M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 3.31M, False: 0]
  ------------------
  318|  3.31M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 3.31M, False: 0]
  ------------------
  319|  3.31M|                    found = 1;
  320|  3.31M|                    break;
  321|  3.31M|                }
  322|  3.31M|            }
  323|       |
  324|  1.83M|            displ++;
  325|  1.83M|            pos++;
  326|  1.83M|            entry++;
  327|  1.83M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 335k, False: 1.50M]
  ------------------
  328|   335k|                entry = hash->table;
  329|  1.83M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 1.27M, False: 560k]
  ------------------
  330|  1.27M|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 1.13M, False: 138k]
  ------------------
  331|  5.36M|    }
  332|       |
  333|  6.43M|    *pfound = found;
  334|  6.43M|    return(entry);
  335|  6.43M|}
hash.c:xmlHashQNameValue:
  104|  43.8k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  43.8k|    unsigned h1, h2, ch;
  106|       |
  107|  43.8k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  43.8k|    do { \
  |  |   24|  43.8k|        h1 = seed ^ 0x3b00; \
  |  |   25|  43.8k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  43.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  43.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 43.8k]
  |  |  ------------------
  ------------------
  108|       |
  109|  43.8k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 16.4k, False: 27.3k]
  ------------------
  110|  43.8k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 27.4k, False: 16.4k]
  ------------------
  111|  27.4k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  27.4k|    do { \
  |  |   30|  27.4k|        h1 += ch; \
  |  |   31|  27.4k|        h1 += h1 << 3; \
  |  |   32|  27.4k|        h2 += h1; \
  |  |   33|  27.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  27.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  27.4k|        h2 += h2 << 2; \
  |  |   35|  27.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 27.4k]
  |  |  ------------------
  ------------------
  112|  27.4k|        }
  113|  16.4k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  16.4k|    do { \
  |  |   30|  16.4k|        h1 += ch; \
  |  |   31|  16.4k|        h1 += h1 << 3; \
  |  |   32|  16.4k|        h2 += h1; \
  |  |   33|  16.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  16.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  16.4k|        h2 += h2 << 2; \
  |  |   35|  16.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 16.4k]
  |  |  ------------------
  ------------------
  114|  16.4k|    }
  115|  43.8k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 43.8k, False: 0]
  ------------------
  116|  5.07M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 5.02M, False: 43.8k]
  ------------------
  117|  5.02M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  5.02M|    do { \
  |  |   30|  5.02M|        h1 += ch; \
  |  |   31|  5.02M|        h1 += h1 << 3; \
  |  |   32|  5.02M|        h2 += h1; \
  |  |   33|  5.02M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  5.02M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  5.02M|        h2 += h2 << 2; \
  |  |   35|  5.02M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 5.02M]
  |  |  ------------------
  ------------------
  118|  5.02M|        }
  119|  43.8k|    }
  120|  43.8k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  43.8k|    do { \
  |  |   30|  43.8k|        h1 += ch; \
  |  |   31|  43.8k|        h1 += h1 << 3; \
  |  |   32|  43.8k|        h2 += h1; \
  |  |   33|  43.8k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  43.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  43.8k|        h2 += h2 << 2; \
  |  |   35|  43.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 43.8k]
  |  |  ------------------
  ------------------
  121|  43.8k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 18.4k, False: 25.4k]
  ------------------
  122|   101k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 83.0k, False: 18.4k]
  ------------------
  123|  83.0k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  83.0k|    do { \
  |  |   30|  83.0k|        h1 += ch; \
  |  |   31|  83.0k|        h1 += h1 << 3; \
  |  |   32|  83.0k|        h2 += h1; \
  |  |   33|  83.0k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  83.0k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  83.0k|        h2 += h2 << 2; \
  |  |   35|  83.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 83.0k]
  |  |  ------------------
  ------------------
  124|  83.0k|        }
  125|  18.4k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  18.4k|    do { \
  |  |   30|  18.4k|        h1 += ch; \
  |  |   31|  18.4k|        h1 += h1 << 3; \
  |  |   32|  18.4k|        h2 += h1; \
  |  |   33|  18.4k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  18.4k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  18.4k|        h2 += h2 << 2; \
  |  |   35|  18.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 18.4k]
  |  |  ------------------
  ------------------
  126|  18.4k|    }
  127|  43.8k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 43.8k, False: 0]
  ------------------
  128|   877k|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 833k, False: 43.8k]
  ------------------
  129|   833k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|   833k|    do { \
  |  |   30|   833k|        h1 += ch; \
  |  |   31|   833k|        h1 += h1 << 3; \
  |  |   32|   833k|        h2 += h1; \
  |  |   33|   833k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   833k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   833k|        h2 += h2 << 2; \
  |  |   35|   833k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 833k]
  |  |  ------------------
  ------------------
  130|   833k|        }
  131|  43.8k|    }
  132|  43.8k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  43.8k|    do { \
  |  |   30|  43.8k|        h1 += ch; \
  |  |   31|  43.8k|        h1 += h1 << 3; \
  |  |   32|  43.8k|        h2 += h1; \
  |  |   33|  43.8k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  43.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  43.8k|        h2 += h2 << 2; \
  |  |   35|  43.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 43.8k]
  |  |  ------------------
  ------------------
  133|  43.8k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 43.8k]
  ------------------
  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|  43.8k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 43.8k]
  ------------------
  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|  43.8k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  43.8k|    do { \
  |  |   40|  43.8k|        h1 ^= h2; \
  |  |   41|  43.8k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  43.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  43.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  43.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  43.8k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  43.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  43.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  43.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  43.8k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  43.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 43.8k]
  |  |  ------------------
  ------------------
  146|       |
  147|  43.8k|    return(h2);
  148|  43.8k|}
hash.c:stubHashScannerFull:
  946|  18.2k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  18.2k|    stubData *sdata = (stubData *) data;
  948|  18.2k|    sdata->scan(payload, sdata->data, key);
  949|  18.2k|}
hash.c:xmlFastStrEqual:
  263|  6.73M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  6.73M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 5.77M, False: 952k]
  ------------------
  265|  5.77M|        return(s2 == NULL);
  266|   952k|    else
  267|   952k|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 952k, False: 0]
  ------------------
  268|   952k|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 851k, False: 101k]
  ------------------
  269|  6.73M|}

tree.c:xmlGrowCapacity:
   32|  31.9k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  31.9k|    int extra;
   34|       |
   35|  31.9k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 30.4k, False: 1.47k]
  ------------------
   36|  30.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  30.4k|        (void) min;
   38|  30.4k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  30.4k|    }
   43|       |
   44|  1.47k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.47k]
  ------------------
   45|  1.47k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.47k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.47k|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.47k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.47k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.47k|    return(capacity + extra);
   55|  1.47k|}
uri.c:xmlGrowCapacity:
   32|  10.1k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  10.1k|    int extra;
   34|       |
   35|  10.1k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 10.1k]
  ------------------
   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|  10.1k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 27, False: 10.0k]
  ------------------
   45|  10.0k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 10.0k]
  ------------------
   46|     27|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  10.0k|    extra = (capacity + 1) / 2;
   50|       |
   51|  10.0k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 45, False: 10.0k]
  ------------------
   52|     45|        return(max);
   53|       |
   54|  10.0k|    return(capacity + extra);
   55|  10.0k|}
valid.c:xmlGrowCapacity:
   32|  8.58k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.58k|    int extra;
   34|       |
   35|  8.58k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.20k, False: 5.37k]
  ------------------
   36|  3.20k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.20k|        (void) min;
   38|  3.20k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.20k|    }
   43|       |
   44|  5.37k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.37k]
  ------------------
   45|  5.37k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.37k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.37k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.37k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.37k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.37k|    return(capacity + extra);
   55|  5.37k|}
xmlreader.c:xmlGrowCapacity:
   32|    487|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    487|    int extra;
   34|       |
   35|    487|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 231, False: 256]
  ------------------
   36|    231|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    231|        (void) min;
   38|    231|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    231|    }
   43|       |
   44|    256|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 256]
  ------------------
   45|    256|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 256]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    256|    extra = (capacity + 1) / 2;
   50|       |
   51|    256|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 256]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    256|    return(capacity + extra);
   55|    256|}
xmlregexp.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: 752k, False: 812k]
  ------------------
   36|   752k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   752k|        (void) min;
   38|   752k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   752k|    }
   43|       |
   44|   812k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 812k]
  ------------------
   45|   812k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 812k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   812k|    extra = (capacity + 1) / 2;
   50|       |
   51|   812k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 812k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|   812k|    return(capacity + extra);
   55|   812k|}
xinclude.c:xmlGrowCapacity:
   32|  23.1k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  23.1k|    int extra;
   34|       |
   35|  23.1k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 20.8k, False: 2.27k]
  ------------------
   36|  20.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  20.8k|        (void) min;
   38|  20.8k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  20.8k|    }
   43|       |
   44|  2.27k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 2.27k]
  ------------------
   45|  2.27k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 2.27k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  2.27k|    extra = (capacity + 1) / 2;
   50|       |
   51|  2.27k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 2.27k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  2.27k|    return(capacity + extra);
   55|  2.27k|}
xpath.c:xmlGrowCapacity:
   32|  1.48M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.48M|    int extra;
   34|       |
   35|  1.48M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 389k, False: 1.09M]
  ------------------
   36|   389k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   389k|        (void) min;
   38|   389k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   389k|    }
   43|       |
   44|  1.09M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.09M]
  ------------------
   45|  1.09M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.09M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.09M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.09M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.09M]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.09M|    return(capacity + extra);
   55|  1.09M|}
parser.c:xmlGrowCapacity:
   32|   379k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   379k|    int extra;
   34|       |
   35|   379k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 36.2k, False: 343k]
  ------------------
   36|  36.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  36.2k|        (void) min;
   38|  36.2k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  36.2k|    }
   43|       |
   44|   343k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 230, False: 343k]
  ------------------
   45|   343k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 343k]
  ------------------
   46|    230|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   343k|    extra = (capacity + 1) / 2;
   50|       |
   51|   343k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 446, False: 342k]
  ------------------
   52|    446|        return(max);
   53|       |
   54|   342k|    return(capacity + extra);
   55|   343k|}

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

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

xmlWarningMsg:
  276|  61.6k|{
  277|  61.6k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  61.6k|}
xmlAttrNormalizeSpace:
  989|  34.1k|{
  990|  34.1k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (990:9): [True: 0, False: 34.1k]
  |  Branch (990:26): [True: 0, False: 34.1k]
  ------------------
  991|      0|        return(NULL);
  992|       |
  993|  41.1k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (993:12): [True: 7.05k, False: 34.1k]
  ------------------
  994|  1.90M|    while (*src != 0) {
  ------------------
  |  Branch (994:12): [True: 1.86M, False: 34.1k]
  ------------------
  995|  1.86M|	if (*src == 0x20) {
  ------------------
  |  Branch (995:6): [True: 28.4k, False: 1.83M]
  ------------------
  996|   227k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (996:13): [True: 199k, False: 28.4k]
  ------------------
  997|  28.4k|	    if (*src != 0)
  ------------------
  |  Branch (997:10): [True: 27.9k, False: 536]
  ------------------
  998|  27.9k|		*dst++ = 0x20;
  999|  1.83M|	} else {
 1000|  1.83M|	    *dst++ = *src++;
 1001|  1.83M|	}
 1002|  1.86M|    }
 1003|  34.1k|    *dst = 0;
 1004|  34.1k|    if (dst == src)
  ------------------
  |  Branch (1004:9): [True: 30.3k, False: 3.75k]
  ------------------
 1005|  30.3k|       return(NULL);
 1006|  3.75k|    return(dst);
 1007|  34.1k|}
xmlAttrNormalize:
 1024|  2.06k|{
 1025|  2.06k|    xmlChar *out = NULL;
 1026|  2.06k|    xmlChar *dst = NULL;
 1027|       |
 1028|  2.06k|    if (src == NULL)
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.06k]
  ------------------
 1029|      0|        return(NULL);
 1030|       |
 1031|  2.06k|    out = src;
 1032|  2.06k|    dst = out;
 1033|  37.8k|    while (*src != 0) {
  ------------------
  |  Branch (1033:12): [True: 35.7k, False: 2.06k]
  ------------------
 1034|  35.7k|        if (*src < 0x20) {
  ------------------
  |  Branch (1034:13): [True: 251, False: 35.4k]
  ------------------
 1035|    251|            src++;
 1036|    251|            *dst++ = 0x20;
 1037|  35.4k|        } else {
 1038|  35.4k|            *dst++ = *src++;
 1039|  35.4k|        }
 1040|  35.7k|    }
 1041|  2.06k|    *dst = 0;
 1042|  2.06k|    return(out);
 1043|  2.06k|}
xmlCheckLanguageID:
 1304|  64.5k|{
 1305|  64.5k|    const xmlChar *cur = lang, *nxt;
 1306|       |
 1307|  64.5k|    if (cur == NULL)
  ------------------
  |  Branch (1307:9): [True: 261, False: 64.2k]
  ------------------
 1308|    261|        return (0);
 1309|  64.2k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1309:10): [True: 360, False: 63.9k]
  |  Branch (1309:29): [True: 89, False: 271]
  ------------------
 1310|  64.1k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1310:10): [True: 35.2k, False: 28.9k]
  |  Branch (1310:29): [True: 1.90k, False: 33.3k]
  ------------------
 1311|  62.2k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1311:10): [True: 622, False: 61.6k]
  |  Branch (1311:29): [True: 71, False: 551]
  ------------------
 1312|  62.2k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1312:10): [True: 302, False: 61.9k]
  |  Branch (1312:29): [True: 82, False: 220]
  ------------------
 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|  2.14k|        cur += 2;
 1319|  5.11k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1319:17): [True: 3.05k, False: 2.05k]
  |  Branch (1319:36): [True: 2.64k, False: 406]
  ------------------
 1320|  2.46k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1320:17): [True: 406, False: 2.05k]
  |  Branch (1320:36): [True: 314, False: 92]
  ------------------
 1321|  2.96k|            cur++;
 1322|  2.14k|        return(cur[0] == 0);
 1323|  2.14k|    }
 1324|  62.1k|    nxt = cur;
 1325|   301k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1325:13): [True: 241k, False: 60.1k]
  |  Branch (1325:32): [True: 229k, False: 12.1k]
  ------------------
 1326|  72.2k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1326:13): [True: 12.1k, False: 60.1k]
  |  Branch (1326:32): [True: 10.1k, False: 2.01k]
  ------------------
 1327|   239k|           nxt++;
 1328|  62.1k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1328:9): [True: 2.81k, False: 59.3k]
  ------------------
 1329|       |        /*
 1330|       |         * Reserved
 1331|       |         */
 1332|  2.81k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1332:13): [True: 1.69k, False: 1.12k]
  |  Branch (1332:32): [True: 766, False: 355]
  ------------------
 1333|  2.46k|            return(0);
 1334|    355|        return(1);
 1335|  2.81k|    }
 1336|  59.3k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1336:9): [True: 3.31k, False: 56.0k]
  ------------------
 1337|  3.31k|        return(0);
 1338|       |    /* we got an ISO 639 code */
 1339|  56.0k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1339:9): [True: 2.78k, False: 53.2k]
  ------------------
 1340|  2.78k|        return(1);
 1341|  53.2k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1341:9): [True: 3.87k, False: 49.3k]
  ------------------
 1342|  3.87k|        return(0);
 1343|       |
 1344|  49.3k|    nxt++;
 1345|  49.3k|    cur = nxt;
 1346|       |    /* now we can have extlang or script or region or variant */
 1347|  49.3k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1347:9): [True: 46.2k, False: 3.14k]
  |  Branch (1347:28): [True: 13.7k, False: 32.4k]
  ------------------
 1348|  13.7k|        goto region_m49;
 1349|       |
 1350|   137k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1350:13): [True: 104k, False: 33.7k]
  |  Branch (1350:32): [True: 93.1k, False: 11.0k]
  ------------------
 1351|  44.8k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1351:13): [True: 10.7k, False: 34.1k]
  |  Branch (1351:32): [True: 9.21k, False: 1.52k]
  ------------------
 1352|   102k|           nxt++;
 1353|  35.6k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1353:9): [True: 1.86k, False: 33.7k]
  ------------------
 1354|  1.86k|        goto script;
 1355|  33.7k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1355:9): [True: 2.10k, False: 31.6k]
  ------------------
 1356|  2.10k|        goto region;
 1357|  31.6k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1357:9): [True: 1.06k, False: 30.6k]
  |  Branch (1357:29): [True: 925, False: 135]
  ------------------
 1358|    925|        goto variant;
 1359|  30.7k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1359:9): [True: 4.68k, False: 26.0k]
  ------------------
 1360|  4.68k|        return(0);
 1361|       |    /* we parsed an extlang */
 1362|  26.0k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1362:9): [True: 92, False: 25.9k]
  ------------------
 1363|     92|        return(1);
 1364|  25.9k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1364:9): [True: 10.1k, False: 15.8k]
  ------------------
 1365|  10.1k|        return(0);
 1366|       |
 1367|  15.8k|    nxt++;
 1368|  15.8k|    cur = nxt;
 1369|       |    /* now we can have script or region or variant */
 1370|  15.8k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1370:9): [True: 15.4k, False: 423]
  |  Branch (1370:28): [True: 759, False: 14.6k]
  ------------------
 1371|    759|        goto region_m49;
 1372|       |
 1373|  60.0k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1373:13): [True: 45.7k, False: 14.3k]
  |  Branch (1373:32): [True: 40.9k, False: 4.77k]
  ------------------
 1374|  19.0k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1374:13): [True: 4.77k, False: 14.3k]
  |  Branch (1374:32): [True: 3.99k, False: 781]
  ------------------
 1375|  44.9k|           nxt++;
 1376|  15.0k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1376:9): [True: 11.8k, False: 3.23k]
  ------------------
 1377|  11.8k|        goto region;
 1378|  3.23k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1378:9): [True: 949, False: 2.28k]
  |  Branch (1378:29): [True: 647, False: 302]
  ------------------
 1379|    647|        goto variant;
 1380|  2.58k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1380:9): [True: 1.01k, False: 1.57k]
  ------------------
 1381|  1.01k|        return(0);
 1382|       |    /* we parsed a script */
 1383|  3.43k|script:
 1384|  3.43k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1384:9): [True: 916, False: 2.52k]
  ------------------
 1385|    916|        return(1);
 1386|  2.52k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1386:9): [True: 352, False: 2.17k]
  ------------------
 1387|    352|        return(0);
 1388|       |
 1389|  2.17k|    nxt++;
 1390|  2.17k|    cur = nxt;
 1391|       |    /* now we can have region or variant */
 1392|  2.17k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1392:9): [True: 1.72k, False: 447]
  |  Branch (1392:28): [True: 211, False: 1.51k]
  ------------------
 1393|    211|        goto region_m49;
 1394|       |
 1395|  8.30k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1395:13): [True: 6.93k, False: 1.36k]
  |  Branch (1395:32): [True: 3.30k, False: 3.63k]
  ------------------
 1396|  5.00k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1396:13): [True: 3.63k, False: 1.37k]
  |  Branch (1396:32): [True: 3.04k, False: 584]
  ------------------
 1397|  6.34k|           nxt++;
 1398|       |
 1399|  1.96k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1399:9): [True: 464, False: 1.49k]
  |  Branch (1399:29): [True: 210, False: 254]
  ------------------
 1400|    210|        goto variant;
 1401|  1.75k|    if (nxt - cur != 2)
  ------------------
  |  Branch (1401:9): [True: 972, False: 778]
  ------------------
 1402|    972|        return(0);
 1403|       |    /* we parsed a region */
 1404|  14.9k|region:
 1405|  14.9k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1405:9): [True: 1.19k, False: 13.8k]
  ------------------
 1406|  1.19k|        return(1);
 1407|  13.8k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1407:9): [True: 12.3k, False: 1.46k]
  ------------------
 1408|  12.3k|        return(0);
 1409|       |
 1410|  1.46k|    nxt++;
 1411|  1.46k|    cur = nxt;
 1412|       |    /* now we can just have a variant */
 1413|  8.36k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1413:13): [True: 7.00k, False: 1.35k]
  |  Branch (1413:32): [True: 2.87k, False: 4.13k]
  ------------------
 1414|  5.49k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1414:13): [True: 4.13k, False: 1.35k]
  |  Branch (1414:32): [True: 4.03k, False: 102]
  ------------------
 1415|  6.90k|           nxt++;
 1416|       |
 1417|  1.46k|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1417:9): [True: 930, False: 530]
  |  Branch (1417:28): [True: 265, False: 265]
  ------------------
 1418|  1.19k|        return(0);
 1419|       |
 1420|       |    /* we parsed a variant */
 1421|  2.04k|variant:
 1422|  2.04k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1422:9): [True: 734, False: 1.31k]
  ------------------
 1423|    734|        return(1);
 1424|  1.31k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1424:9): [True: 836, False: 477]
  ------------------
 1425|    836|        return(0);
 1426|       |    /* extensions and private use subtags not checked */
 1427|    477|    return (1);
 1428|       |
 1429|  14.6k|region_m49:
 1430|  14.6k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1430:10): [True: 13.0k, False: 1.62k]
  |  Branch (1430:29): [True: 10.6k, False: 2.37k]
  ------------------
 1431|  10.6k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1431:10): [True: 7.55k, False: 3.12k]
  |  Branch (1431:29): [True: 252, False: 7.30k]
  ------------------
 1432|    252|        nxt += 3;
 1433|    252|        goto region;
 1434|    252|    }
 1435|  14.4k|    return(0);
 1436|  14.6k|}
xmlParserNsCreate:
 1453|  50.6k|xmlParserNsCreate(void) {
 1454|  50.6k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1455|       |
 1456|  50.6k|    if (nsdb == NULL)
  ------------------
  |  Branch (1456:9): [True: 4, False: 50.6k]
  ------------------
 1457|      4|        return(NULL);
 1458|  50.6k|    memset(nsdb, 0, sizeof(*nsdb));
 1459|  50.6k|    nsdb->defaultNsIndex = INT_MAX;
 1460|       |
 1461|  50.6k|    return(nsdb);
 1462|  50.6k|}
xmlParserNsFree:
 1470|  50.6k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1471|  50.6k|    if (nsdb == NULL)
  ------------------
  |  Branch (1471:9): [True: 0, False: 50.6k]
  ------------------
 1472|      0|        return;
 1473|       |
 1474|  50.6k|    xmlFree(nsdb->extra);
 1475|  50.6k|    xmlFree(nsdb->hash);
 1476|  50.6k|    xmlFree(nsdb);
 1477|  50.6k|}
xmlParserNsLookupSax:
 1603|   152k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1604|   152k|    xmlHashedString hprefix;
 1605|   152k|    int nsIndex;
 1606|       |
 1607|   152k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1607:9): [True: 106k, False: 46.6k]
  ------------------
 1608|   106k|        return(NULL);
 1609|       |
 1610|  46.6k|    hprefix.name = prefix;
 1611|  46.6k|    if (prefix != NULL)
  ------------------
  |  Branch (1611:9): [True: 32.7k, False: 13.8k]
  ------------------
 1612|  32.7k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1613|  13.8k|    else
 1614|  13.8k|        hprefix.hashValue = 0;
 1615|  46.6k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1616|  46.6k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1616:9): [True: 0, False: 46.6k]
  |  Branch (1616:33): [True: 0, False: 46.6k]
  ------------------
 1617|      0|        return(NULL);
 1618|       |
 1619|  46.6k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1620|  46.6k|}
xmlParserNsUpdateSax:
 1634|   290k|                     void *saxData) {
 1635|   290k|    xmlHashedString hprefix;
 1636|   290k|    int nsIndex;
 1637|       |
 1638|   290k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1638:9): [True: 0, False: 290k]
  ------------------
 1639|      0|        return(-1);
 1640|       |
 1641|   290k|    hprefix.name = prefix;
 1642|   290k|    if (prefix != NULL)
  ------------------
  |  Branch (1642:9): [True: 249k, False: 41.1k]
  ------------------
 1643|   249k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1644|  41.1k|    else
 1645|  41.1k|        hprefix.hashValue = 0;
 1646|   290k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1647|   290k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1647:9): [True: 0, False: 290k]
  |  Branch (1647:33): [True: 0, False: 290k]
  ------------------
 1648|      0|        return(-1);
 1649|       |
 1650|   290k|    ctxt->nsdb->extra[nsIndex].saxData = saxData;
 1651|   290k|    return(0);
 1652|   290k|}
xmlCtxtPushInput:
 1929|   346k|{
 1930|   346k|    char *directory = NULL;
 1931|   346k|    int maxDepth;
 1932|       |
 1933|   346k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1933:9): [True: 0, False: 346k]
  |  Branch (1933:27): [True: 3.22k, False: 343k]
  ------------------
 1934|  3.22k|        return(-1);
 1935|       |
 1936|   343k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1936:16): [True: 81.7k, False: 261k]
  ------------------
 1937|       |
 1938|   343k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1938:9): [True: 8.01k, False: 335k]
  ------------------
 1939|  8.01k|        xmlParserInputPtr *tmp;
 1940|  8.01k|        int newSize;
 1941|       |
 1942|  8.01k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1943|  8.01k|                                  5, maxDepth);
 1944|  8.01k|        if (newSize < 0) {
  ------------------
  |  Branch (1944:13): [True: 1, False: 8.01k]
  ------------------
 1945|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1946|      1|                           "Maximum entity nesting depth exceeded");
 1947|      1|            return(-1);
 1948|      1|        }
 1949|  8.01k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1950|  8.01k|        if (tmp == NULL) {
  ------------------
  |  Branch (1950:13): [True: 1, False: 8.01k]
  ------------------
 1951|      1|            xmlErrMemory(ctxt);
 1952|      1|            return(-1);
 1953|      1|        }
 1954|  8.01k|        ctxt->inputTab = tmp;
 1955|  8.01k|        ctxt->inputMax = newSize;
 1956|  8.01k|    }
 1957|       |
 1958|   343k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1958:9): [True: 213k, False: 129k]
  |  Branch (1958:33): [True: 173k, False: 40.8k]
  ------------------
 1959|   173k|        directory = xmlParserGetDirectory(value->filename);
 1960|   173k|        if (directory == NULL) {
  ------------------
  |  Branch (1960:13): [True: 11, False: 173k]
  ------------------
 1961|     11|            xmlErrMemory(ctxt);
 1962|     11|            return(-1);
 1963|     11|        }
 1964|   173k|    }
 1965|       |
 1966|   343k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 343k]
  ------------------
 1967|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1968|      0|        return(-1);
 1969|      0|    }
 1970|       |
 1971|   343k|    ctxt->inputTab[ctxt->inputNr] = value;
 1972|   343k|    ctxt->input = value;
 1973|       |
 1974|   343k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1974:9): [True: 213k, False: 129k]
  ------------------
 1975|   213k|        xmlFree(ctxt->directory);
 1976|   213k|        ctxt->directory = directory;
 1977|   213k|    }
 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|   343k|    value->id = ctxt->input_id++;
 1985|       |
 1986|   343k|    return(ctxt->inputNr++);
 1987|   343k|}
xmlCtxtPopInput:
 1997|   442k|{
 1998|   442k|    xmlParserInputPtr ret;
 1999|       |
 2000|   442k|    if (ctxt == NULL)
  ------------------
  |  Branch (2000:9): [True: 0, False: 442k]
  ------------------
 2001|      0|        return(NULL);
 2002|   442k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (2002:9): [True: 101k, False: 341k]
  ------------------
 2003|   101k|        return (NULL);
 2004|   341k|    ctxt->inputNr--;
 2005|   341k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (2005:9): [True: 129k, False: 212k]
  ------------------
 2006|   129k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 2007|   212k|    else
 2008|   212k|        ctxt->input = NULL;
 2009|   341k|    ret = ctxt->inputTab[ctxt->inputNr];
 2010|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 2011|   341k|    return (ret);
 2012|   442k|}
nodePush:
 2025|   830k|{
 2026|   830k|    if (ctxt == NULL)
  ------------------
  |  Branch (2026:9): [True: 0, False: 830k]
  ------------------
 2027|      0|        return(0);
 2028|       |
 2029|   830k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (2029:9): [True: 52.7k, False: 777k]
  ------------------
 2030|  52.7k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (2030:24): [True: 26.1k, False: 26.6k]
  ------------------
 2031|  52.7k|        xmlNodePtr *tmp;
 2032|  52.7k|        int newSize;
 2033|       |
 2034|  52.7k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 2035|  52.7k|                                  10, maxDepth);
 2036|  52.7k|        if (newSize < 0) {
  ------------------
  |  Branch (2036:13): [True: 53, False: 52.6k]
  ------------------
 2037|     53|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2038|     53|                    "Excessive depth in document: %d,"
 2039|     53|                    " use XML_PARSE_HUGE option\n",
 2040|     53|                    ctxt->nodeNr);
 2041|     53|            return(-1);
 2042|     53|        }
 2043|       |
 2044|  52.6k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2045|  52.6k|        if (tmp == NULL) {
  ------------------
  |  Branch (2045:13): [True: 18, False: 52.6k]
  ------------------
 2046|     18|            xmlErrMemory(ctxt);
 2047|     18|            return (-1);
 2048|     18|        }
 2049|  52.6k|        ctxt->nodeTab = tmp;
 2050|  52.6k|	ctxt->nodeMax = newSize;
 2051|  52.6k|    }
 2052|       |
 2053|   830k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2054|   830k|    ctxt->node = value;
 2055|   830k|    return (ctxt->nodeNr++);
 2056|   830k|}
nodePop:
 2068|   939k|{
 2069|   939k|    xmlNodePtr ret;
 2070|       |
 2071|   939k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2071:9): [True: 0, False: 939k]
  ------------------
 2072|   939k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2072:9): [True: 246k, False: 693k]
  ------------------
 2073|   246k|        return (NULL);
 2074|   693k|    ctxt->nodeNr--;
 2075|   693k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2075:9): [True: 675k, False: 17.7k]
  ------------------
 2076|   675k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2077|  17.7k|    else
 2078|  17.7k|        ctxt->node = NULL;
 2079|   693k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2080|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2081|   693k|    return (ret);
 2082|   939k|}
xmlSkipBlankChars:
 2355|  5.36M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2356|  5.36M|    const xmlChar *cur;
 2357|  5.36M|    int res = 0;
 2358|       |
 2359|  5.36M|    cur = ctxt->input->cur;
 2360|  5.36M|    while (IS_BLANK_CH(*cur)) {
 2361|  2.22M|        if (*cur == '\n') {
  ------------------
  |  Branch (2361:13): [True: 794k, False: 1.42M]
  ------------------
 2362|   794k|            ctxt->input->line++; ctxt->input->col = 1;
 2363|  1.42M|        } else {
 2364|  1.42M|            ctxt->input->col++;
 2365|  1.42M|        }
 2366|  2.22M|        cur++;
 2367|  2.22M|        if (res < INT_MAX)
  ------------------
  |  Branch (2367:13): [True: 2.22M, False: 0]
  ------------------
 2368|  2.22M|            res++;
 2369|  2.22M|        if (*cur == 0) {
  ------------------
  |  Branch (2369:13): [True: 30.4k, False: 2.19M]
  ------------------
 2370|  30.4k|            ctxt->input->cur = cur;
 2371|  30.4k|            xmlParserGrow(ctxt);
 2372|  30.4k|            cur = ctxt->input->cur;
 2373|  30.4k|        }
 2374|  2.22M|    }
 2375|  5.36M|    ctxt->input->cur = cur;
 2376|       |
 2377|  5.36M|    if (res > 4)
  ------------------
  |  Branch (2377:9): [True: 54.8k, False: 5.30M]
  ------------------
 2378|  54.8k|        GROW;
  ------------------
  |  | 2308|  54.8k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  54.8k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  54.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 52.7k, False: 2.18k]
  |  |  ------------------
  |  | 2309|  54.8k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  52.7k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.79k, False: 49.9k]
  |  |  ------------------
  |  | 2310|  54.8k|	xmlParserGrow(ctxt);
  ------------------
 2379|       |
 2380|  5.36M|    return(res);
 2381|  5.36M|}
xmlParseCharRef:
 2566|   110k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2567|   110k|    int val = 0;
 2568|   110k|    int count = 0;
 2569|       |
 2570|       |    /*
 2571|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2572|       |     */
 2573|   110k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2261|   110k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2263|   110k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2573:9): [True: 110k, False: 0]
  |  Branch (2573:25): [True: 110k, False: 0]
  ------------------
 2574|   110k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2263|   110k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2574:9): [True: 17.7k, False: 92.7k]
  ------------------
 2575|  17.7k|	SKIP(3);
  ------------------
  |  | 2285|  17.7k|#define SKIP(val) do {							\
  |  | 2286|  17.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  17.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 217, False: 17.5k]
  |  |  ------------------
  |  | 2288|  17.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  17.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 17.7k]
  |  |  ------------------
  ------------------
 2576|  17.7k|	GROW;
  ------------------
  |  | 2308|  17.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  17.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  17.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 13.6k, False: 4.16k]
  |  |  ------------------
  |  | 2309|  17.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  13.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 1.28k, False: 12.3k]
  |  |  ------------------
  |  | 2310|  17.7k|	xmlParserGrow(ctxt);
  ------------------
 2577|  73.3k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  73.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  59.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2577:9): [True: 59.1k, False: 14.1k]
  |  Branch (2577:25): [True: 59.1k, False: 0]
  ------------------
 2578|  59.1k|	    if (count++ > 20) {
  ------------------
  |  Branch (2578:10): [True: 1.88k, False: 57.3k]
  ------------------
 2579|  1.88k|		count = 0;
 2580|  1.88k|		GROW;
  ------------------
  |  | 2308|  1.88k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.88k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.88k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.51k, False: 369]
  |  |  ------------------
  |  | 2309|  1.88k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.51k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 448, False: 1.06k]
  |  |  ------------------
  |  | 2310|  1.88k|	xmlParserGrow(ctxt);
  ------------------
 2581|  1.88k|	    }
 2582|  59.1k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  59.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  57.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2582:10): [True: 57.6k, False: 1.54k]
  |  Branch (2582:26): [True: 38.8k, False: 18.8k]
  ------------------
 2583|  38.8k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2262|  38.8k|#define CUR (*ctxt->input->cur)
  ------------------
 2584|  20.3k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  20.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  14.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2584:15): [True: 14.4k, False: 5.95k]
  |  Branch (2584:31): [True: 13.0k, False: 1.31k]
  |  Branch (2584:47): [True: 12.8k, False: 206]
  ------------------
 2585|  12.8k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2262|  12.8k|#define CUR (*ctxt->input->cur)
  ------------------
 2586|  7.47k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  7.47k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  5.65k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2586:15): [True: 5.65k, False: 1.81k]
  |  Branch (2586:31): [True: 4.10k, False: 1.55k]
  |  Branch (2586:47): [True: 3.88k, False: 221]
  ------------------
 2587|  3.88k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2262|  3.88k|#define CUR (*ctxt->input->cur)
  ------------------
 2588|  3.59k|	    else {
 2589|  3.59k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2590|  3.59k|		val = 0;
 2591|  3.59k|		break;
 2592|  3.59k|	    }
 2593|  55.6k|	    if (val > 0x110000)
  ------------------
  |  Branch (2593:10): [True: 22.0k, False: 33.5k]
  ------------------
 2594|  22.0k|	        val = 0x110000;
 2595|       |
 2596|  55.6k|	    NEXT;
  ------------------
  |  | 2316|  55.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2597|  55.6k|	    count++;
 2598|  55.6k|	}
 2599|  17.7k|	if (RAW == ';') {
  ------------------
  |  | 2261|  17.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2599:6): [True: 14.1k, False: 3.59k]
  ------------------
 2600|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2601|  14.1k|	    ctxt->input->col++;
 2602|  14.1k|	    ctxt->input->cur++;
 2603|  14.1k|	}
 2604|  92.7k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2261|  92.7k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2263|  92.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2604:17): [True: 92.7k, False: 0]
  |  Branch (2604:33): [True: 92.7k, False: 0]
  ------------------
 2605|  92.7k|	SKIP(2);
  ------------------
  |  | 2285|  92.7k|#define SKIP(val) do {							\
  |  | 2286|  92.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  92.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 429, False: 92.3k]
  |  |  ------------------
  |  | 2288|  92.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  92.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 92.7k]
  |  |  ------------------
  ------------------
 2606|  92.7k|	GROW;
  ------------------
  |  | 2308|  92.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  92.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  92.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 75.2k, False: 17.4k]
  |  |  ------------------
  |  | 2309|  92.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  75.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.8k, False: 64.4k]
  |  |  ------------------
  |  | 2310|  92.7k|	xmlParserGrow(ctxt);
  ------------------
 2607|   290k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2261|   290k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2607:9): [True: 203k, False: 87.1k]
  ------------------
 2608|   203k|	    if (count++ > 20) {
  ------------------
  |  Branch (2608:10): [True: 1.32k, False: 202k]
  ------------------
 2609|  1.32k|		count = 0;
 2610|  1.32k|		GROW;
  ------------------
  |  | 2308|  1.32k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.32k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.32k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.04k, False: 282]
  |  |  ------------------
  |  | 2309|  1.32k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.04k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 798, False: 247]
  |  |  ------------------
  |  | 2310|  1.32k|	xmlParserGrow(ctxt);
  ------------------
 2611|  1.32k|	    }
 2612|   203k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   203k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   201k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2612:10): [True: 201k, False: 2.01k]
  |  Branch (2612:26): [True: 198k, False: 3.65k]
  ------------------
 2613|   198k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2262|   198k|#define CUR (*ctxt->input->cur)
  ------------------
 2614|  5.66k|	    else {
 2615|  5.66k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2616|  5.66k|		val = 0;
 2617|  5.66k|		break;
 2618|  5.66k|	    }
 2619|   198k|	    if (val > 0x110000)
  ------------------
  |  Branch (2619:10): [True: 14.2k, False: 183k]
  ------------------
 2620|  14.2k|	        val = 0x110000;
 2621|       |
 2622|   198k|	    NEXT;
  ------------------
  |  | 2316|   198k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2623|   198k|	    count++;
 2624|   198k|	}
 2625|  92.7k|	if (RAW == ';') {
  ------------------
  |  | 2261|  92.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2625:6): [True: 87.1k, False: 5.66k]
  ------------------
 2626|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2627|  87.1k|	    ctxt->input->col++;
 2628|  87.1k|	    ctxt->input->cur++;
 2629|  87.1k|	}
 2630|  92.7k|    } 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|   110k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2641:9): [True: 1.04k, False: 109k]
  ------------------
 2642|  1.04k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2643|  1.04k|                "xmlParseCharRef: character reference out of bounds\n",
 2644|  1.04k|	        val);
 2645|  1.04k|        val = 0xFFFD;
 2646|   109k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|   109k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   109k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 108k, False: 1.41k]
  |  |  |  |  ------------------
  |  |  |  |  118|   109k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   108k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 96.3k, False: 11.7k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 16.5k, False: 79.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   108k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 42.1k, False: 49.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   108k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 37.2k, False: 12.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   109k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 457, False: 958]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.41k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 729, False: 229]
  |  |  |  |  |  Branch (120:26): [True: 262, False: 467]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.41k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 389, False: 307]
  |  |  |  |  |  Branch (121:27): [True: 389, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2646:16): [True: 12.5k, False: 96.9k]
  ------------------
 2647|  12.5k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2648|  12.5k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2649|  12.5k|	                  val);
 2650|  12.5k|    }
 2651|   110k|    return(val);
 2652|   110k|}
xmlScanName:
 3088|  3.49M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3089|  3.49M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  3.49M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3089:16): [True: 101k, False: 3.39M]
  ------------------
 3090|  3.49M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  3.49M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3090:17): [True: 2.02M, False: 1.47M]
  ------------------
 3091|       |
 3092|  13.7M|    while (1) {
  ------------------
  |  Branch (3092:12): [True: 13.7M, Folded]
  ------------------
 3093|  13.7M|        int c, len;
 3094|       |
 3095|  13.7M|        c = *ptr;
 3096|  13.7M|        if (c < 0x80) {
  ------------------
  |  Branch (3096:13): [True: 11.9M, False: 1.77M]
  ------------------
 3097|  11.9M|            if (c == stop)
  ------------------
  |  Branch (3097:17): [True: 72.4k, False: 11.8M]
  ------------------
 3098|  72.4k|                break;
 3099|  11.8M|            len = 1;
 3100|  11.8M|        } else {
 3101|  1.77M|            len = 4;
 3102|  1.77M|            c = xmlGetUTF8Char(ptr, &len);
 3103|  1.77M|            if (c < 0)
  ------------------
  |  Branch (3103:17): [True: 4.59k, False: 1.76M]
  ------------------
 3104|  4.59k|                break;
 3105|  1.77M|        }
 3106|       |
 3107|  13.6M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  13.6M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3107:13): [True: 10.2M, False: 3.43M]
  |  Branch (3107:13): [True: 3.42M, False: 10.2M]
  ------------------
 3108|  10.2M|                !xmlIsNameChar(c, old10) :
 3109|  13.6M|                !xmlIsNameStartChar(c, old10))
 3110|  3.42M|            break;
 3111|       |
 3112|  10.2M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3112:13): [True: 67, False: 10.2M]
  ------------------
 3113|     67|            return(NULL);
 3114|  10.2M|        ptr += len;
 3115|  10.2M|        maxSize -= len;
 3116|  10.2M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  10.2M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3117|  10.2M|    }
 3118|       |
 3119|  3.49M|    return(ptr);
 3120|  3.49M|}
xmlParseName:
 3187|  3.05M|xmlParseName(xmlParserCtxt *ctxt) {
 3188|  3.05M|    const xmlChar *in;
 3189|  3.05M|    const xmlChar *ret;
 3190|  3.05M|    size_t count = 0;
 3191|  3.05M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3191:24): [True: 1.23M, False: 1.82M]
  ------------------
 3192|  1.23M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.23M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3193|  3.05M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.88M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3194|       |
 3195|  3.05M|    GROW;
  ------------------
  |  | 2308|  3.05M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  3.05M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  3.05M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.91M, False: 1.14M]
  |  |  ------------------
  |  | 2309|  3.05M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.91M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 687k, False: 1.23M]
  |  |  ------------------
  |  | 2310|  3.05M|	xmlParserGrow(ctxt);
  ------------------
 3196|       |
 3197|       |    /*
 3198|       |     * Accelerator for simple ASCII names
 3199|       |     */
 3200|  3.05M|    in = ctxt->input->cur;
 3201|  3.05M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3201:10): [True: 2.69M, False: 360k]
  |  Branch (3201:27): [True: 2.66M, False: 35.9k]
  ------------------
 3202|   396k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3202:3): [True: 153k, False: 242k]
  |  Branch (3202:20): [True: 113k, False: 39.9k]
  ------------------
 3203|  2.78M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3203:2): [True: 1.25k, False: 281k]
  |  Branch (3203:18): [True: 5.73k, False: 275k]
  ------------------
 3204|  2.78M|	in++;
 3205|  16.6M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3205:10): [True: 4.51M, False: 12.1M]
  |  Branch (3205:27): [True: 4.44M, False: 67.2k]
  ------------------
 3206|  12.2M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3206:10): [True: 6.14M, False: 6.09M]
  |  Branch (3206:27): [True: 6.06M, False: 83.1k]
  ------------------
 3207|  6.17M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3207:10): [True: 5.17M, False: 1.00M]
  |  Branch (3207:27): [True: 3.07M, False: 2.09M]
  ------------------
 3208|  3.10M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3208:9): [True: 4.58k, False: 3.09M]
  |  Branch (3208:25): [True: 109k, False: 2.98M]
  ------------------
 3209|  2.98M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3209:9): [True: 186k, False: 2.80M]
  |  Branch (3209:25): [True: 16.7k, False: 2.78M]
  ------------------
 3210|  13.9M|	    in++;
 3211|  2.78M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3211:6): [True: 2.74M, False: 38.4k]
  |  Branch (3211:19): [True: 2.72M, False: 19.7k]
  ------------------
 3212|  2.72M|	    count = in - ctxt->input->cur;
 3213|  2.72M|            if (count > maxLength) {
  ------------------
  |  Branch (3213:17): [True: 68, False: 2.72M]
  ------------------
 3214|     68|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3215|     68|                return(NULL);
 3216|     68|            }
 3217|  2.72M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3218|  2.72M|	    ctxt->input->cur = in;
 3219|  2.72M|	    ctxt->input->col += count;
 3220|  2.72M|	    if (ret == NULL)
  ------------------
  |  Branch (3220:10): [True: 3, False: 2.72M]
  ------------------
 3221|      3|	        xmlErrMemory(ctxt);
 3222|  2.72M|	    return(ret);
 3223|  2.72M|	}
 3224|  2.78M|    }
 3225|       |    /* accelerator for special cases */
 3226|   333k|    return(xmlParseNameComplex(ctxt));
 3227|  3.05M|}
xmlParseNmtoken:
 3417|  33.5k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3418|  33.5k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3419|  33.5k|    xmlChar *ret;
 3420|  33.5k|    int len = 0, l;
 3421|  33.5k|    int c;
 3422|  33.5k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3422:21): [True: 15.7k, False: 17.7k]
  ------------------
 3423|  15.7k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  15.7k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3424|  33.5k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  17.7k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3425|  33.5k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3425:17): [True: 12.8k, False: 20.7k]
  ------------------
 3426|       |
 3427|  33.5k|    c = xmlCurrentChar(ctxt, &l);
 3428|       |
 3429|   163k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3429:12): [True: 130k, False: 32.5k]
  ------------------
 3430|   130k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2333|   130k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 97.0k, False: 33.9k]
  |  |  ------------------
  |  | 2334|   130k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|   130k|	NEXTL(l);
  ------------------
  |  | 2325|   130k|#define NEXTL(l) do {							\
  |  | 2326|   130k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 130k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   130k|    } else ctxt->input->col++;						\
  |  | 2329|   130k|    ctxt->input->cur += l;				\
  |  | 2330|   130k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 130k]
  |  |  ------------------
  ------------------
 3432|   130k|	c = xmlCurrentChar(ctxt, &l);
 3433|   130k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   130k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3433:6): [True: 1.00k, False: 129k]
  ------------------
 3434|       |	    /*
 3435|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3436|       |	     * for the processing speed.
 3437|       |	     */
 3438|  1.00k|	    xmlChar *buffer;
 3439|  1.00k|	    int max = len * 2;
 3440|       |
 3441|  1.00k|	    buffer = xmlMalloc(max);
 3442|  1.00k|	    if (buffer == NULL) {
  ------------------
  |  Branch (3442:10): [True: 1, False: 1.00k]
  ------------------
 3443|      1|	        xmlErrMemory(ctxt);
 3444|      1|		return(NULL);
 3445|      1|	    }
 3446|  1.00k|	    memcpy(buffer, buf, len);
 3447|  3.99M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3447:13): [True: 3.99M, False: 932]
  ------------------
 3448|  3.99M|		if (len + 10 > max) {
  ------------------
  |  Branch (3448:7): [True: 3.32k, False: 3.98M]
  ------------------
 3449|  3.32k|		    xmlChar *tmp;
 3450|  3.32k|                    int newSize;
 3451|       |
 3452|  3.32k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3453|  3.32k|                    if (newSize < 0) {
  ------------------
  |  Branch (3453:25): [True: 73, False: 3.25k]
  ------------------
 3454|     73|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3455|     73|                        xmlFree(buffer);
 3456|     73|                        return(NULL);
 3457|     73|                    }
 3458|  3.25k|		    tmp = xmlRealloc(buffer, newSize);
 3459|  3.25k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3459:11): [True: 1, False: 3.24k]
  ------------------
 3460|      1|			xmlErrMemory(ctxt);
 3461|      1|			xmlFree(buffer);
 3462|      1|			return(NULL);
 3463|      1|		    }
 3464|  3.24k|		    buffer = tmp;
 3465|  3.24k|                    max = newSize;
 3466|  3.24k|		}
 3467|  3.99M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2333|  3.99M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 977k, False: 3.01M]
  |  |  ------------------
  |  | 2334|  3.99M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3468|  3.99M|		NEXTL(l);
  ------------------
  |  | 2325|  3.99M|#define NEXTL(l) do {							\
  |  | 2326|  3.99M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 3.99M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.99M|    } else ctxt->input->col++;						\
  |  | 2329|  3.99M|    ctxt->input->cur += l;				\
  |  | 2330|  3.99M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.99M]
  |  |  ------------------
  ------------------
 3469|  3.99M|		c = xmlCurrentChar(ctxt, &l);
 3470|  3.99M|	    }
 3471|    932|	    buffer[len] = 0;
 3472|    932|	    return(buffer);
 3473|  1.00k|	}
 3474|   130k|    }
 3475|  32.5k|    if (len == 0)
  ------------------
  |  Branch (3475:9): [True: 3.02k, False: 29.5k]
  ------------------
 3476|  3.02k|        return(NULL);
 3477|  29.5k|    if (len > maxLength) {
  ------------------
  |  Branch (3477:9): [True: 0, False: 29.5k]
  ------------------
 3478|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3479|      0|        return(NULL);
 3480|      0|    }
 3481|  29.5k|    ret = xmlStrndup(buf, len);
 3482|  29.5k|    if (ret == NULL)
  ------------------
  |  Branch (3482:9): [True: 2, False: 29.5k]
  ------------------
 3483|      2|        xmlErrMemory(ctxt);
 3484|  29.5k|    return(ret);
 3485|  29.5k|}
xmlParseEntityValue:
 3647|   134k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3648|   134k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3648:26): [True: 30.8k, False: 103k]
  ------------------
 3649|  30.8k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  30.8k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3650|   134k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   238k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3651|   134k|    xmlSBuf buf;
 3652|   134k|    const xmlChar *start;
 3653|   134k|    int quote, length;
 3654|       |
 3655|   134k|    xmlSBufInit(&buf, maxLength);
 3656|       |
 3657|   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: 122k, False: 11.7k]
  |  |  ------------------
  |  | 2309|   134k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   122k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 30.5k, False: 92.1k]
  |  |  ------------------
  |  | 2310|   134k|	xmlParserGrow(ctxt);
  ------------------
 3658|       |
 3659|   134k|    quote = CUR;
  ------------------
  |  | 2262|   134k|#define CUR (*ctxt->input->cur)
  ------------------
 3660|   134k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3660:9): [True: 3.53k, False: 130k]
  |  Branch (3660:27): [True: 0, False: 3.53k]
  ------------------
 3661|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3662|      0|	return(NULL);
 3663|      0|    }
 3664|   134k|    CUR_PTR++;
  ------------------
  |  | 2264|   134k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   134k|    length = 0;
 3667|       |
 3668|       |    /*
 3669|       |     * Copy raw content of the entity into a buffer
 3670|       |     */
 3671|   129M|    while (1) {
  ------------------
  |  Branch (3671:12): [True: 129M, Folded]
  ------------------
 3672|   129M|        int c;
 3673|       |
 3674|   129M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   129M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 4, False: 129M]
  |  |  ------------------
  ------------------
 3675|      4|            goto error;
 3676|       |
 3677|   129M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   129M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3677:13): [True: 3.77k, False: 129M]
  ------------------
 3678|  3.77k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3679|  3.77k|            goto error;
 3680|  3.77k|        }
 3681|       |
 3682|   129M|        c = CUR;
  ------------------
  |  | 2262|   129M|#define CUR (*ctxt->input->cur)
  ------------------
 3683|       |
 3684|   129M|        if (c == 0) {
  ------------------
  |  Branch (3684:13): [True: 274, False: 129M]
  ------------------
 3685|    274|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3686|    274|                    "invalid character in entity value\n");
 3687|    274|            goto error;
 3688|    274|        }
 3689|   129M|        if (c == quote)
  ------------------
  |  Branch (3689:13): [True: 130k, False: 129M]
  ------------------
 3690|   130k|            break;
 3691|   129M|        NEXTL(1);
  ------------------
  |  | 2325|   129M|#define NEXTL(l) do {							\
  |  | 2326|   129M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.33M, False: 126M]
  |  |  ------------------
  |  | 2327|  2.33M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   126M|    } else ctxt->input->col++;						\
  |  | 2329|   129M|    ctxt->input->cur += l;				\
  |  | 2330|   129M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 129M]
  |  |  ------------------
  ------------------
 3692|   129M|        length += 1;
 3693|       |
 3694|       |        /*
 3695|       |         * TODO: Check growth threshold
 3696|       |         */
 3697|   129M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   129M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3697:13): [True: 77.1k, False: 129M]
  ------------------
 3698|  77.1k|            GROW;
  ------------------
  |  | 2308|  77.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  77.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  77.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 74.2k, False: 2.89k]
  |  |  ------------------
  |  | 2309|  77.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  74.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 74.2k, False: 0]
  |  |  ------------------
  |  | 2310|  77.1k|	xmlParserGrow(ctxt);
  ------------------
 3699|   129M|    }
 3700|       |
 3701|   130k|    start = CUR_PTR - length;
  ------------------
  |  | 2264|   130k|#define CUR_PTR ctxt->input->cur
  ------------------
 3702|       |
 3703|   130k|    if (orig != NULL) {
  ------------------
  |  Branch (3703:9): [True: 130k, False: 0]
  ------------------
 3704|   130k|        *orig = xmlStrndup(start, length);
 3705|   130k|        if (*orig == NULL)
  ------------------
  |  Branch (3705:13): [True: 3, False: 130k]
  ------------------
 3706|      3|            xmlErrMemory(ctxt);
 3707|   130k|    }
 3708|       |
 3709|   130k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3710|       |
 3711|   130k|    NEXTL(1);
  ------------------
  |  | 2325|   130k|#define NEXTL(l) do {							\
  |  | 2326|   130k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 130k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   130k|    } else ctxt->input->col++;						\
  |  | 2329|   130k|    ctxt->input->cur += l;				\
  |  | 2330|   130k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 130k]
  |  |  ------------------
  ------------------
 3712|       |
 3713|   130k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3714|       |
 3715|  4.05k|error:
 3716|  4.05k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3717|       |    return(NULL);
 3718|   134k|}
xmlExpandEntitiesInAttValue:
 4000|  37.2k|                            int normalize) {
 4001|  37.2k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4001:26): [True: 26.7k, False: 10.4k]
  ------------------
 4002|  26.7k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  26.7k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4003|  37.2k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  47.6k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4004|  37.2k|    xmlSBuf buf;
 4005|  37.2k|    int inSpace = 1;
 4006|       |
 4007|  37.2k|    xmlSBufInit(&buf, maxLength);
 4008|       |
 4009|  37.2k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 4010|  37.2k|                              ctxt->inputNr, /* check */ 0);
 4011|       |
 4012|  37.2k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (4012:9): [True: 0, False: 37.2k]
  |  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|  37.2k|}
xmlParseAttValue:
 4333|   204k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4334|   204k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4334:9): [True: 0, False: 204k]
  |  Branch (4334:27): [True: 0, False: 204k]
  ------------------
 4335|   204k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4336|   204k|}
xmlParseSystemLiteral:
 4350|  21.5k|xmlParseSystemLiteral(xmlParserCtxt *ctxt) {
 4351|  21.5k|    xmlChar *buf = NULL;
 4352|  21.5k|    int len = 0;
 4353|  21.5k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  21.5k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4354|  21.5k|    int cur, l;
 4355|  21.5k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4355:21): [True: 10.2k, False: 11.3k]
  ------------------
 4356|  10.2k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  10.2k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4357|  21.5k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  11.3k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4358|  21.5k|    xmlChar stop;
 4359|       |
 4360|  21.5k|    if (RAW == '"') {
  ------------------
  |  | 2261|  21.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4360:9): [True: 11.7k, False: 9.74k]
  ------------------
 4361|  11.7k|        NEXT;
  ------------------
  |  | 2316|  11.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4362|  11.7k|	stop = '"';
 4363|  11.7k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  9.74k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4363:16): [True: 6.43k, False: 3.30k]
  ------------------
 4364|  6.43k|        NEXT;
  ------------------
  |  | 2316|  6.43k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4365|  6.43k|	stop = '\'';
 4366|  6.43k|    } else {
 4367|  3.30k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4368|  3.30k|	return(NULL);
 4369|  3.30k|    }
 4370|       |
 4371|  18.2k|    buf = xmlMalloc(size);
 4372|  18.2k|    if (buf == NULL) {
  ------------------
  |  Branch (4372:9): [True: 3, False: 18.2k]
  ------------------
 4373|      3|        xmlErrMemory(ctxt);
 4374|      3|	return(NULL);
 4375|      3|    }
 4376|  18.2k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4377|  5.73M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  5.73M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  5.73M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 895k, False: 4.84M]
  |  |  |  |  ------------------
  |  |  |  |  118|  5.73M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   895k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 893k, False: 2.21k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.90k, False: 890k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   895k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 892k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   895k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 890k, False: 2.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  5.73M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 4.84M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 4.88k, False: 4.83M]
  |  |  |  |  ------------------
  |  |  |  |  120|  4.84M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 4.83M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 4.83M, False: 861]
  |  |  |  |  ------------------
  |  |  |  |  121|  4.84M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 859, False: 2]
  |  |  |  |  |  Branch (121:27): [True: 859, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4377:12): [True: 5.73M, False: 2.22k]
  |  Branch (4377:30): [True: 5.71M, False: 15.8k]
  ------------------
 4378|  5.71M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4378:6): [True: 5.39k, False: 5.71M]
  ------------------
 4379|  5.39k|	    xmlChar *tmp;
 4380|  5.39k|            int newSize;
 4381|       |
 4382|  5.39k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4383|  5.39k|            if (newSize < 0) {
  ------------------
  |  Branch (4383:17): [True: 100, False: 5.29k]
  ------------------
 4384|    100|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4385|    100|                xmlFree(buf);
 4386|    100|                return(NULL);
 4387|    100|            }
 4388|  5.29k|	    tmp = xmlRealloc(buf, newSize);
 4389|  5.29k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4389:10): [True: 3, False: 5.29k]
  ------------------
 4390|      3|	        xmlFree(buf);
 4391|      3|		xmlErrMemory(ctxt);
 4392|      3|		return(NULL);
 4393|      3|	    }
 4394|  5.29k|	    buf = tmp;
 4395|  5.29k|            size = newSize;
 4396|  5.29k|	}
 4397|  5.71M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  5.71M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 180k, False: 5.53M]
  |  |  ------------------
  |  | 2334|  5.71M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4398|  5.71M|	NEXTL(l);
  ------------------
  |  | 2325|  5.71M|#define NEXTL(l) do {							\
  |  | 2326|  5.71M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.21k, False: 5.71M]
  |  |  ------------------
  |  | 2327|  2.21k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.71M|    } else ctxt->input->col++;						\
  |  | 2329|  5.71M|    ctxt->input->cur += l;				\
  |  | 2330|  5.71M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.71M]
  |  |  ------------------
  ------------------
 4399|  5.71M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4400|  5.71M|    }
 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: 2]
  |  |  |  |  ------------------
  |  |  |  |  118|  18.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 15.9k, False: 2.21k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 15.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 15.8k, False: 2.22k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  18.1k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  120|      2|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  |  121|      2|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 2]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4402:9): [True: 2.22k, False: 15.8k]
  ------------------
 4403|  2.22k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4404|  15.8k|    } else {
 4405|  15.8k|	NEXT;
  ------------------
  |  | 2316|  15.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4406|  15.8k|    }
 4407|  18.1k|    return(buf);
 4408|  18.2k|}
xmlParsePubidLiteral:
 4422|  7.07k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4423|  7.07k|    xmlChar *buf = NULL;
 4424|  7.07k|    int len = 0;
 4425|  7.07k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  7.07k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4426|  7.07k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4426:21): [True: 2.74k, False: 4.32k]
  ------------------
 4427|  2.74k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.74k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4428|  7.07k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.32k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4429|  7.07k|    xmlChar cur;
 4430|  7.07k|    xmlChar stop;
 4431|       |
 4432|  7.07k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.07k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4432:9): [True: 1.02k, False: 6.05k]
  ------------------
 4433|  1.02k|        NEXT;
  ------------------
  |  | 2316|  1.02k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|  1.02k|	stop = '"';
 4435|  6.05k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  6.05k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4435:16): [True: 4.92k, False: 1.13k]
  ------------------
 4436|  4.92k|        NEXT;
  ------------------
  |  | 2316|  4.92k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4437|  4.92k|	stop = '\'';
 4438|  4.92k|    } else {
 4439|  1.13k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4440|  1.13k|	return(NULL);
 4441|  1.13k|    }
 4442|  5.94k|    buf = xmlMalloc(size);
 4443|  5.94k|    if (buf == NULL) {
  ------------------
  |  Branch (4443:9): [True: 1, False: 5.94k]
  ------------------
 4444|      1|	xmlErrMemory(ctxt);
 4445|      1|	return(NULL);
 4446|      1|    }
 4447|  5.94k|    cur = CUR;
  ------------------
  |  | 2262|  5.94k|#define CUR (*ctxt->input->cur)
  ------------------
 4448|   537k|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|   537k|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|   537k|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4448:12): [True: 536k, False: 1.31k]
  |  Branch (4448:38): [True: 531k, False: 4.62k]
  ------------------
 4449|   531k|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|   531k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4449:12): [True: 531k, False: 1]
  ------------------
 4450|   531k|	if (len + 1 >= size) {
  ------------------
  |  Branch (4450:6): [True: 421, False: 531k]
  ------------------
 4451|    421|	    xmlChar *tmp;
 4452|    421|            int newSize;
 4453|       |
 4454|    421|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4455|    421|            if (newSize < 0) {
  ------------------
  |  Branch (4455:17): [True: 1, False: 420]
  ------------------
 4456|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4457|      1|                xmlFree(buf);
 4458|      1|                return(NULL);
 4459|      1|            }
 4460|    420|	    tmp = xmlRealloc(buf, newSize);
 4461|    420|	    if (tmp == NULL) {
  ------------------
  |  Branch (4461:10): [True: 1, False: 419]
  ------------------
 4462|      1|		xmlErrMemory(ctxt);
 4463|      1|		xmlFree(buf);
 4464|      1|		return(NULL);
 4465|      1|	    }
 4466|    419|	    buf = tmp;
 4467|    419|            size = newSize;
 4468|    419|	}
 4469|   531k|	buf[len++] = cur;
 4470|   531k|	NEXT;
  ------------------
  |  | 2316|   531k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4471|   531k|	cur = CUR;
  ------------------
  |  | 2262|   531k|#define CUR (*ctxt->input->cur)
  ------------------
 4472|   531k|    }
 4473|  5.93k|    buf[len] = 0;
 4474|  5.93k|    if (cur != stop) {
  ------------------
  |  Branch (4474:9): [True: 480, False: 5.45k]
  ------------------
 4475|    480|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4476|  5.45k|    } else {
 4477|  5.45k|	NEXTL(1);
  ------------------
  |  | 2325|  5.45k|#define NEXTL(l) do {							\
  |  | 2326|  5.45k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 5.45k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.45k|    } else ctxt->input->col++;						\
  |  | 2329|  5.45k|    ctxt->input->cur += l;				\
  |  | 2330|  5.45k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.45k]
  |  |  ------------------
  ------------------
 4478|  5.45k|    }
 4479|  5.93k|    return(buf);
 4480|  5.94k|}
xmlParseExternalID:
 4792|  44.0k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4793|  44.0k|    xmlChar *URI = NULL;
 4794|       |
 4795|  44.0k|    *publicId = NULL;
 4796|  44.0k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2273|  44.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  88.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  88.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 16.0k, False: 28.0k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 16.0k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  44.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 16.0k, False: 5]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 16.0k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 16.0k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 16.0k, False: 1]
  |  |  ------------------
  ------------------
 4797|  16.0k|        SKIP(6);
  ------------------
  |  | 2285|  16.0k|#define SKIP(val) do {							\
  |  | 2286|  16.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  16.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 210, False: 15.8k]
  |  |  ------------------
  |  | 2288|  16.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  16.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 16.0k]
  |  |  ------------------
  ------------------
 4798|  16.0k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  16.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4798:6): [True: 2.01k, False: 14.0k]
  ------------------
 4799|  2.01k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4800|  2.01k|	                   "Space required after 'SYSTEM'\n");
 4801|  2.01k|	}
 4802|  16.0k|	URI = xmlParseSystemLiteral(ctxt);
 4803|  16.0k|	if (URI == NULL) {
  ------------------
  |  Branch (4803:6): [True: 2.02k, False: 14.0k]
  ------------------
 4804|  2.02k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4805|  2.02k|        }
 4806|  28.0k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2273|  28.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  56.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  56.1k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.09k, False: 20.9k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.09k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  28.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.08k, False: 6]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.08k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.07k, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 7.07k, False: 3]
  |  |  ------------------
  ------------------
 4807|  7.07k|        SKIP(6);
  ------------------
  |  | 2285|  7.07k|#define SKIP(val) do {							\
  |  | 2286|  7.07k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.07k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 110, False: 6.96k]
  |  |  ------------------
  |  | 2288|  7.07k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.07k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.07k]
  |  |  ------------------
  ------------------
 4808|  7.07k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.07k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4808:6): [True: 1.46k, False: 5.60k]
  ------------------
 4809|  1.46k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4810|  1.46k|		    "Space required after 'PUBLIC'\n");
 4811|  1.46k|	}
 4812|  7.07k|	*publicId = xmlParsePubidLiteral(ctxt);
 4813|  7.07k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4813:6): [True: 1.13k, False: 5.93k]
  ------------------
 4814|  1.13k|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4815|  1.13k|	}
 4816|  7.07k|	if (strict) {
  ------------------
  |  Branch (4816:6): [True: 5.42k, False: 1.64k]
  ------------------
 4817|       |	    /*
 4818|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4819|       |	     */
 4820|  5.42k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  5.42k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4820:10): [True: 2.01k, False: 3.41k]
  ------------------
 4821|  2.01k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4822|  2.01k|			"Space required after the Public Identifier\n");
 4823|  2.01k|	    }
 4824|  5.42k|	} 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|  1.64k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2312|  1.64k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4831:10): [True: 1.49k, False: 150]
  ------------------
 4832|    150|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|    150|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|     98|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4832:10): [True: 98, False: 52]
  |  Branch (4832:27): [True: 88, False: 10]
  ------------------
 4833|    150|	}
 4834|  5.49k|	URI = xmlParseSystemLiteral(ctxt);
 4835|  5.49k|	if (URI == NULL) {
  ------------------
  |  Branch (4835:6): [True: 1.38k, False: 4.10k]
  ------------------
 4836|  1.38k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4837|  1.38k|        }
 4838|  5.49k|    }
 4839|  42.5k|    return(URI);
 4840|  44.0k|}
xmlParseComment:
 4969|   454k|xmlParseComment(xmlParserCtxt *ctxt) {
 4970|   454k|    xmlChar *buf = NULL;
 4971|   454k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   454k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4972|   454k|    size_t len = 0;
 4973|   454k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4973:24): [True: 106k, False: 347k]
  ------------------
 4974|   106k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   106k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4975|   454k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   802k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4976|   454k|    const xmlChar *in;
 4977|   454k|    size_t nbchar = 0;
 4978|   454k|    int ccol;
 4979|       |
 4980|       |    /*
 4981|       |     * Check that there is a comment right here.
 4982|       |     */
 4983|   454k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2261|   454k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   454k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4983:9): [True: 0, False: 454k]
  |  Branch (4983:25): [True: 0, False: 454k]
  ------------------
 4984|      0|        return;
 4985|   454k|    SKIP(2);
  ------------------
  |  | 2285|   454k|#define SKIP(val) do {							\
  |  | 2286|   454k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   454k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 454k]
  |  |  ------------------
  |  | 2288|   454k|        xmlParserGrow(ctxt);						\
  |  | 2289|   454k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 454k]
  |  |  ------------------
  ------------------
 4986|   454k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2261|   454k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2263|   454k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4986:9): [True: 0, False: 454k]
  |  Branch (4986:25): [True: 12, False: 454k]
  ------------------
 4987|     12|        return;
 4988|   454k|    SKIP(2);
  ------------------
  |  | 2285|   454k|#define SKIP(val) do {							\
  |  | 2286|   454k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   454k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 263, False: 453k]
  |  |  ------------------
  |  | 2288|   454k|        xmlParserGrow(ctxt);						\
  |  | 2289|   454k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 454k]
  |  |  ------------------
  ------------------
 4989|   454k|    GROW;
  ------------------
  |  | 2308|   454k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   454k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   454k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 326k, False: 128k]
  |  |  ------------------
  |  | 2309|   454k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   326k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 169k, False: 156k]
  |  |  ------------------
  |  | 2310|   454k|	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|   454k|    in = ctxt->input->cur;
 4996|   454k|    do {
 4997|   454k|	if (*in == 0xA) {
  ------------------
  |  Branch (4997:6): [True: 421, False: 454k]
  ------------------
 4998|  5.44k|	    do {
 4999|  5.44k|		ctxt->input->line++; ctxt->input->col = 1;
 5000|  5.44k|		in++;
 5001|  5.44k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5001:15): [True: 5.01k, False: 421]
  ------------------
 5002|    421|	}
 5003|  1.04M|get_more:
 5004|  1.04M|        ccol = ctxt->input->col;
 5005|  6.58M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (5005:10): [True: 4.60M, False: 1.98M]
  |  Branch (5005:25): [True: 4.52M, False: 82.1k]
  ------------------
 5006|  2.06M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (5006:10): [True: 1.91M, False: 153k]
  |  Branch (5006:27): [True: 1.01M, False: 900k]
  ------------------
 5007|  5.54M|	       (*in == 0x09)) {
  ------------------
  |  Branch (5007:9): [True: 10.0k, False: 1.04M]
  ------------------
 5008|  5.54M|		    in++;
 5009|  5.54M|		    ccol++;
 5010|  5.54M|	}
 5011|  1.04M|	ctxt->input->col = ccol;
 5012|  1.04M|	if (*in == 0xA) {
  ------------------
  |  Branch (5012:6): [True: 47.0k, False: 997k]
  ------------------
 5013|   293k|	    do {
 5014|   293k|		ctxt->input->line++; ctxt->input->col = 1;
 5015|   293k|		in++;
 5016|   293k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5016:15): [True: 246k, False: 47.0k]
  ------------------
 5017|  47.0k|	    goto get_more;
 5018|  47.0k|	}
 5019|   997k|	nbchar = in - ctxt->input->cur;
 5020|       |	/*
 5021|       |	 * save current set of data
 5022|       |	 */
 5023|   997k|	if (nbchar > 0) {
  ------------------
  |  Branch (5023:6): [True: 689k, False: 308k]
  ------------------
 5024|   689k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (5024:17): [True: 0, False: 689k]
  ------------------
 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|   689k|            if (buf == NULL) {
  ------------------
  |  Branch (5030:17): [True: 208k, False: 481k]
  ------------------
 5031|   208k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (5031:21): [True: 118k, False: 89.2k]
  |  Branch (5031:37): [True: 65.1k, False: 53.7k]
  ------------------
 5032|  65.1k|                    size = nbchar + 1;
 5033|   142k|                else
 5034|   142k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   142k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5035|   208k|                buf = xmlMalloc(size);
 5036|   208k|                if (buf == NULL) {
  ------------------
  |  Branch (5036:21): [True: 4, False: 208k]
  ------------------
 5037|      4|                    xmlErrMemory(ctxt);
 5038|      4|                    return;
 5039|      4|                }
 5040|   208k|                len = 0;
 5041|   481k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5041:24): [True: 14.1k, False: 467k]
  ------------------
 5042|  14.1k|                xmlChar *new_buf;
 5043|  14.1k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  14.1k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5044|  14.1k|                new_buf = xmlRealloc(buf, size);
 5045|  14.1k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5045:21): [True: 1, False: 14.1k]
  ------------------
 5046|      1|                    xmlErrMemory(ctxt);
 5047|      1|                    xmlFree(buf);
 5048|      1|                    return;
 5049|      1|                }
 5050|  14.1k|                buf = new_buf;
 5051|  14.1k|            }
 5052|   689k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5053|   689k|            len += nbchar;
 5054|   689k|            buf[len] = 0;
 5055|   689k|	}
 5056|   997k|	ctxt->input->cur = in;
 5057|   997k|	if (*in == 0xA) {
  ------------------
  |  Branch (5057:6): [True: 0, False: 997k]
  ------------------
 5058|      0|	    in++;
 5059|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5060|      0|	}
 5061|   997k|	if (*in == 0xD) {
  ------------------
  |  Branch (5061:6): [True: 94.1k, False: 903k]
  ------------------
 5062|  94.1k|	    in++;
 5063|  94.1k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5063:10): [True: 14.0k, False: 80.0k]
  ------------------
 5064|  14.0k|		ctxt->input->cur = in;
 5065|  14.0k|		in++;
 5066|  14.0k|		ctxt->input->line++; ctxt->input->col = 1;
 5067|  14.0k|		goto get_more;
 5068|  14.0k|	    }
 5069|  80.0k|	    in--;
 5070|  80.0k|	}
 5071|   983k|	SHRINK;
  ------------------
  |  | 2304|   983k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   983k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   983k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 844k, False: 139k]
  |  |  ------------------
  |  | 2305|   983k|	xmlParserShrink(ctxt);
  ------------------
 5072|   983k|	GROW;
  ------------------
  |  | 2308|   983k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   983k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   983k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 844k, False: 139k]
  |  |  ------------------
  |  | 2309|   983k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   844k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 193k, False: 650k]
  |  |  ------------------
  |  | 2310|   983k|	xmlParserGrow(ctxt);
  ------------------
 5073|   983k|	in = ctxt->input->cur;
 5074|   983k|	if (*in == '-') {
  ------------------
  |  Branch (5074:6): [True: 818k, False: 164k]
  ------------------
 5075|   818k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5075:10): [True: 551k, False: 266k]
  ------------------
 5076|   551k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5076:14): [True: 289k, False: 262k]
  ------------------
 5077|   289k|		    SKIP(3);
  ------------------
  |  | 2285|   289k|#define SKIP(val) do {							\
  |  | 2286|   289k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   289k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 570, False: 289k]
  |  |  ------------------
  |  | 2288|   289k|        xmlParserGrow(ctxt);						\
  |  | 2289|   289k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 289k]
  |  |  ------------------
  ------------------
 5078|   289k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5078:11): [True: 289k, False: 0]
  |  Branch (5078:34): [True: 289k, False: 0]
  ------------------
 5079|   289k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5079:11): [True: 128k, False: 161k]
  ------------------
 5080|   128k|			if (buf != NULL)
  ------------------
  |  Branch (5080:8): [True: 58.0k, False: 70.7k]
  ------------------
 5081|  58.0k|			    ctxt->sax->comment(ctxt->userData, buf);
 5082|  70.7k|			else
 5083|  70.7k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|  70.7k|#define BAD_CAST (xmlChar *)
  ------------------
 5084|   128k|		    }
 5085|   289k|		    if (buf != NULL)
  ------------------
  |  Branch (5085:11): [True: 66.1k, False: 223k]
  ------------------
 5086|  66.1k|		        xmlFree(buf);
 5087|   289k|		    return;
 5088|   289k|		}
 5089|   262k|		if (buf != NULL) {
  ------------------
  |  Branch (5089:7): [True: 206k, False: 55.5k]
  ------------------
 5090|   206k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5091|   206k|		                      "Double hyphen within comment: "
 5092|   206k|                                      "<!--%.50s\n",
 5093|   206k|				      buf);
 5094|   206k|		} else
 5095|  55.5k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5096|  55.5k|		                      "Double hyphen within comment\n", NULL);
 5097|   262k|		in++;
 5098|   262k|		ctxt->input->col++;
 5099|   262k|	    }
 5100|   528k|	    in++;
 5101|   528k|	    ctxt->input->col++;
 5102|   528k|	    goto get_more;
 5103|   818k|	}
 5104|   983k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5104:15): [True: 82.5k, False: 82.4k]
  |  Branch (5104:32): [True: 357, False: 82.1k]
  |  Branch (5104:50): [True: 291, False: 164k]
  |  Branch (5104:67): [True: 0, False: 164k]
  ------------------
 5105|   164k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5106|   164k|}
xmlParsePITarget:
 5121|   212k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5122|   212k|    const xmlChar *name;
 5123|       |
 5124|   212k|    name = xmlParseName(ctxt);
 5125|   212k|    if ((name != NULL) &&
  ------------------
  |  Branch (5125:9): [True: 206k, False: 6.20k]
  ------------------
 5126|   206k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5126:10): [True: 31.9k, False: 174k]
  |  Branch (5126:30): [True: 415, False: 174k]
  ------------------
 5127|  32.3k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5127:10): [True: 29.7k, False: 2.59k]
  |  Branch (5127:30): [True: 360, False: 2.23k]
  ------------------
 5128|  30.1k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5128:10): [True: 20.3k, False: 9.80k]
  |  Branch (5128:30): [True: 302, False: 9.49k]
  ------------------
 5129|  20.6k|	int i;
 5130|  20.6k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5130:6): [True: 20.3k, False: 287]
  |  Branch (5130:26): [True: 20.0k, False: 226]
  ------------------
 5131|  20.0k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5131:6): [True: 19.8k, False: 282]
  |  Branch (5131:26): [True: 16.5k, False: 3.24k]
  ------------------
 5132|  16.5k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5133|  16.5k|		 "XML declaration allowed only at the start of the document\n");
 5134|  16.5k|	    return(name);
 5135|  16.5k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5135:13): [True: 521, False: 3.52k]
  ------------------
 5136|    521|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5137|    521|	    return(name);
 5138|    521|	}
 5139|  10.4k|	for (i = 0;;i++) {
 5140|  10.4k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5140:10): [True: 3.44k, False: 7.02k]
  ------------------
 5141|  7.02k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5141:10): [True: 82, False: 6.94k]
  ------------------
 5142|     82|	        return(name);
 5143|  7.02k|	}
 5144|  3.44k|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5145|  3.44k|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5146|  3.44k|		      NULL, NULL);
 5147|  3.44k|    }
 5148|   195k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5148:9): [True: 189k, False: 6.20k]
  |  Branch (5148:27): [True: 479, False: 188k]
  ------------------
 5149|    479|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5150|    479|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5151|    479|    }
 5152|   195k|    return(name);
 5153|   212k|}
xmlParsePI:
 5235|   212k|xmlParsePI(xmlParserCtxt *ctxt) {
 5236|   212k|    xmlChar *buf = NULL;
 5237|   212k|    size_t len = 0;
 5238|   212k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   212k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5239|   212k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5239:24): [True: 77.7k, False: 134k]
  ------------------
 5240|  77.7k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  77.7k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5241|   212k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   347k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5242|   212k|    int cur, l;
 5243|   212k|    const xmlChar *target;
 5244|       |
 5245|   212k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|   212k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|   212k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5245:9): [True: 212k, False: 0]
  |  Branch (5245:25): [True: 212k, False: 0]
  ------------------
 5246|       |	/*
 5247|       |	 * this is a Processing Instruction.
 5248|       |	 */
 5249|   212k|	SKIP(2);
  ------------------
  |  | 2285|   212k|#define SKIP(val) do {							\
  |  | 2286|   212k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   212k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 794, False: 211k]
  |  |  ------------------
  |  | 2288|   212k|        xmlParserGrow(ctxt);						\
  |  | 2289|   212k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 212k]
  |  |  ------------------
  ------------------
 5250|       |
 5251|       |	/*
 5252|       |	 * Parse the target name and check for special support like
 5253|       |	 * namespace.
 5254|       |	 */
 5255|   212k|        target = xmlParsePITarget(ctxt);
 5256|   212k|	if (target != NULL) {
  ------------------
  |  Branch (5256:6): [True: 206k, False: 6.20k]
  ------------------
 5257|   206k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   206k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   167k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5257:10): [True: 167k, False: 39.1k]
  |  Branch (5257:26): [True: 166k, False: 688]
  ------------------
 5258|   166k|		SKIP(2);
  ------------------
  |  | 2285|   166k|#define SKIP(val) do {							\
  |  | 2286|   166k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   166k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 756, False: 165k]
  |  |  ------------------
  |  | 2288|   166k|        xmlParserGrow(ctxt);						\
  |  | 2289|   166k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 166k]
  |  |  ------------------
  ------------------
 5259|       |
 5260|       |		/*
 5261|       |		 * SAX: PI detected.
 5262|       |		 */
 5263|   166k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5263:7): [True: 166k, False: 0]
  |  Branch (5263:22): [True: 163k, False: 2.83k]
  ------------------
 5264|   163k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5264:7): [True: 163k, False: 0]
  ------------------
 5265|   163k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5266|   163k|		                                     target, NULL);
 5267|   166k|		return;
 5268|   166k|	    }
 5269|  39.8k|	    buf = xmlMalloc(size);
 5270|  39.8k|	    if (buf == NULL) {
  ------------------
  |  Branch (5270:10): [True: 8, False: 39.8k]
  ------------------
 5271|      8|		xmlErrMemory(ctxt);
 5272|      8|		return;
 5273|      8|	    }
 5274|  39.8k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  39.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5274:10): [True: 11.6k, False: 28.1k]
  ------------------
 5275|  11.6k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5276|  11.6k|			  "ParsePI: PI %s space expected\n", target);
 5277|  11.6k|	    }
 5278|  39.8k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5279|  8.67M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  8.67M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  17.3M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 8.66M, False: 10.2k]
  |  |  |  |  |  Branch (117:25): [True: 1.59M, False: 7.08M]
  |  |  |  |  ------------------
  |  |  |  |  118|  17.3M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.59M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.58M, False: 9.89k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 213k, False: 1.37M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.59M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.38M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.59M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.37M, False: 10.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  17.3M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 7.08M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.20M, False: 4.87M]
  |  |  |  |  ------------------
  |  |  |  |  120|  7.08M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 4.87M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 4.87M, False: 1.80k]
  |  |  |  |  ------------------
  |  |  |  |  121|  7.08M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.59k, False: 213]
  |  |  |  |  |  Branch (121:27): [True: 1.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5280|  8.66M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2263|  35.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5280:7): [True: 8.63M, False: 35.0k]
  |  Branch (5280:23): [True: 5.51k, False: 29.5k]
  ------------------
 5281|  8.63M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5281:7): [True: 17.3k, False: 8.62M]
  ------------------
 5282|  17.3k|		    xmlChar *tmp;
 5283|  17.3k|                    int newSize;
 5284|       |
 5285|  17.3k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5286|  17.3k|                    if (newSize < 0) {
  ------------------
  |  Branch (5286:25): [True: 0, False: 17.3k]
  ------------------
 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|  17.3k|		    tmp = xmlRealloc(buf, newSize);
 5293|  17.3k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5293:11): [True: 12, False: 17.3k]
  ------------------
 5294|     12|			xmlErrMemory(ctxt);
 5295|     12|			xmlFree(buf);
 5296|     12|			return;
 5297|     12|		    }
 5298|  17.3k|		    buf = tmp;
 5299|  17.3k|                    size = newSize;
 5300|  17.3k|		}
 5301|  8.63M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  8.63M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 1.28M, False: 7.34M]
  |  |  ------------------
  |  | 2334|  8.63M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5302|  8.63M|		NEXTL(l);
  ------------------
  |  | 2325|  8.63M|#define NEXTL(l) do {							\
  |  | 2326|  8.63M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 211k, False: 8.42M]
  |  |  ------------------
  |  | 2327|   211k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  8.42M|    } else ctxt->input->col++;						\
  |  | 2329|  8.63M|    ctxt->input->cur += l;				\
  |  | 2330|  8.63M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 8.63M]
  |  |  ------------------
  ------------------
 5303|  8.63M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5304|  8.63M|	    }
 5305|  39.8k|	    buf[len] = 0;
 5306|  39.8k|	    if (cur != '?') {
  ------------------
  |  Branch (5306:10): [True: 10.2k, False: 29.5k]
  ------------------
 5307|  10.2k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5308|  10.2k|		      "ParsePI: PI %s never end ...\n", target);
 5309|  29.5k|	    } else {
 5310|  29.5k|		SKIP(2);
  ------------------
  |  | 2285|  29.5k|#define SKIP(val) do {							\
  |  | 2286|  29.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  29.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 353, False: 29.1k]
  |  |  ------------------
  |  | 2288|  29.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  29.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 29.5k]
  |  |  ------------------
  ------------------
 5311|       |
 5312|  29.5k|#ifdef LIBXML_CATALOG_ENABLED
 5313|  29.5k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5313:7): [True: 8.01k, False: 21.5k]
  ------------------
 5314|  8.01k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  8.01k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5314:7): [True: 410, False: 7.60k]
  ------------------
 5315|    410|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5316|       |
 5317|    410|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5317:11): [True: 202, False: 208]
  ------------------
 5318|    202|                        ((allow == XML_CATA_ALLOW_DOCUMENT) ||
  ------------------
  |  Branch (5318:26): [True: 0, False: 202]
  ------------------
 5319|    202|			 (allow == XML_CATA_ALLOW_ALL)))
  ------------------
  |  Branch (5319:5): [True: 0, False: 202]
  ------------------
 5320|      0|			xmlParseCatalogPI(ctxt, buf);
 5321|    410|		}
 5322|  29.5k|#endif
 5323|       |
 5324|       |		/*
 5325|       |		 * SAX: PI detected.
 5326|       |		 */
 5327|  29.5k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5327:7): [True: 29.5k, False: 0]
  |  Branch (5327:22): [True: 28.6k, False: 906]
  ------------------
 5328|  28.6k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5328:7): [True: 28.6k, False: 0]
  ------------------
 5329|  28.6k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5330|  28.6k|		                                     target, buf);
 5331|  29.5k|	    }
 5332|  39.8k|	    xmlFree(buf);
 5333|  39.8k|	} else {
 5334|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5335|  6.20k|	}
 5336|   212k|    }
 5337|   212k|}
xmlParseNotationDecl:
 5359|  3.58k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5360|  3.58k|    const xmlChar *name;
 5361|  3.58k|    xmlChar *Pubid;
 5362|  3.58k|    xmlChar *Systemid;
 5363|       |
 5364|  3.58k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  3.58k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  3.58k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5364:9): [True: 0, False: 3.58k]
  |  Branch (5364:25): [True: 0, False: 3.58k]
  ------------------
 5365|      0|        return;
 5366|  3.58k|    SKIP(2);
  ------------------
  |  | 2285|  3.58k|#define SKIP(val) do {							\
  |  | 2286|  3.58k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.58k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.58k]
  |  |  ------------------
  |  | 2288|  3.58k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.58k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.58k]
  |  |  ------------------
  ------------------
 5367|       |
 5368|  3.58k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  3.58k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  7.16k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  7.16k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  7.16k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  7.16k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 3.58k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.57k, False: 8]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  3.58k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.57k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.56k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.56k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 3.55k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 3.55k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 3.54k, False: 3]
  |  |  ------------------
  ------------------
 5369|  3.54k|#ifdef LIBXML_VALID_ENABLED
 5370|  3.54k|	int oldInputNr = ctxt->inputNr;
 5371|  3.54k|#endif
 5372|       |
 5373|  3.54k|	SKIP(8);
  ------------------
  |  | 2285|  3.54k|#define SKIP(val) do {							\
  |  | 2286|  3.54k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.54k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 82, False: 3.46k]
  |  |  ------------------
  |  | 2288|  3.54k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.54k]
  |  |  ------------------
  ------------------
 5374|  3.54k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  3.54k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5374:6): [True: 308, False: 3.24k]
  ------------------
 5375|    308|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5376|    308|			   "Space required after '<!NOTATION'\n");
 5377|    308|	    return;
 5378|    308|	}
 5379|       |
 5380|  3.24k|        name = xmlParseName(ctxt);
 5381|  3.24k|	if (name == NULL) {
  ------------------
  |  Branch (5381:6): [True: 398, False: 2.84k]
  ------------------
 5382|    398|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5383|    398|	    return;
 5384|    398|	}
 5385|  2.84k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5385:6): [True: 216, False: 2.62k]
  ------------------
 5386|    216|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5387|    216|		     "colons are forbidden from notation names '%s'\n",
 5388|    216|		     name, NULL, NULL);
 5389|    216|	}
 5390|  2.84k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  2.84k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5390:6): [True: 108, False: 2.73k]
  ------------------
 5391|    108|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5392|    108|		     "Space required after the NOTATION name'\n");
 5393|    108|	    return;
 5394|    108|	}
 5395|       |
 5396|       |	/*
 5397|       |	 * Parse the IDs.
 5398|       |	 */
 5399|  2.73k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5400|  2.73k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.73k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5401|       |
 5402|  2.73k|	if (RAW == '>') {
  ------------------
  |  | 2261|  2.73k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5402:6): [True: 2.18k, False: 554]
  ------------------
 5403|  2.18k|#ifdef LIBXML_VALID_ENABLED
 5404|  2.18k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5404:10): [True: 1.45k, False: 724]
  |  Branch (5404:30): [True: 3, False: 1.45k]
  ------------------
 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.18k|#endif
 5411|  2.18k|	    NEXT;
  ------------------
  |  | 2316|  2.18k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5412|  2.18k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5412:10): [True: 2.18k, False: 0]
  |  Branch (5412:33): [True: 1.72k, False: 454]
  ------------------
 5413|  1.72k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5413:3): [True: 1.72k, False: 0]
  ------------------
 5414|  1.72k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5415|  2.18k|	} else {
 5416|    554|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5417|    554|	}
 5418|  2.73k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5418:6): [True: 934, False: 1.80k]
  ------------------
 5419|  2.73k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5419:6): [True: 1.53k, False: 1.20k]
  ------------------
 5420|  2.73k|    }
 5421|  3.58k|}
xmlParseEntityDecl:
 5447|   191k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5448|   191k|    const xmlChar *name = NULL;
 5449|   191k|    xmlChar *value = NULL;
 5450|   191k|    xmlChar *URI = NULL, *literal = NULL;
 5451|   191k|    const xmlChar *ndata = NULL;
 5452|   191k|    int isParameter = 0;
 5453|   191k|    xmlChar *orig = NULL;
 5454|       |
 5455|   191k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   191k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   191k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5455:9): [True: 0, False: 191k]
  |  Branch (5455:25): [True: 0, False: 191k]
  ------------------
 5456|      0|        return;
 5457|   191k|    SKIP(2);
  ------------------
  |  | 2285|   191k|#define SKIP(val) do {							\
  |  | 2286|   191k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   191k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 191k]
  |  |  ------------------
  |  | 2288|   191k|        xmlParserGrow(ctxt);						\
  |  | 2289|   191k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 191k]
  |  |  ------------------
  ------------------
 5458|       |
 5459|       |    /* GROW; done in the caller */
 5460|   191k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|   191k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   382k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   382k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 191k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 191k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   191k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 191k, False: 23]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 190k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 190k, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 190k, False: 9]
  |  |  ------------------
  ------------------
 5461|   190k|#ifdef LIBXML_VALID_ENABLED
 5462|   190k|	int oldInputNr = ctxt->inputNr;
 5463|   190k|#endif
 5464|       |
 5465|   190k|	SKIP(6);
  ------------------
  |  | 2285|   190k|#define SKIP(val) do {							\
  |  | 2286|   190k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   190k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 228, False: 190k]
  |  |  ------------------
  |  | 2288|   190k|        xmlParserGrow(ctxt);						\
  |  | 2289|   190k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 190k]
  |  |  ------------------
  ------------------
 5466|   190k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   190k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5466:6): [True: 2.86k, False: 188k]
  ------------------
 5467|  2.86k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5468|  2.86k|			   "Space required after '<!ENTITY'\n");
 5469|  2.86k|	}
 5470|       |
 5471|   190k|	if (RAW == '%') {
  ------------------
  |  | 2261|   190k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5471:6): [True: 75.4k, False: 115k]
  ------------------
 5472|  75.4k|	    NEXT;
  ------------------
  |  | 2316|  75.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5473|  75.4k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  75.4k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5473:10): [True: 369, False: 75.0k]
  ------------------
 5474|    369|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5475|    369|			       "Space required after '%%'\n");
 5476|    369|	    }
 5477|  75.4k|	    isParameter = 1;
 5478|  75.4k|	}
 5479|       |
 5480|   190k|        name = xmlParseName(ctxt);
 5481|   190k|	if (name == NULL) {
  ------------------
  |  Branch (5481:6): [True: 35.9k, False: 155k]
  ------------------
 5482|  35.9k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5483|  35.9k|	                   "xmlParseEntityDecl: no name\n");
 5484|  35.9k|            return;
 5485|  35.9k|	}
 5486|   155k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5486:6): [True: 2.03k, False: 152k]
  ------------------
 5487|  2.03k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5488|  2.03k|		     "colons are forbidden from entities names '%s'\n",
 5489|  2.03k|		     name, NULL, NULL);
 5490|  2.03k|	}
 5491|   155k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   155k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5491:6): [True: 3.63k, False: 151k]
  ------------------
 5492|  3.63k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5493|  3.63k|			   "Space required after the entity name\n");
 5494|  3.63k|	}
 5495|       |
 5496|       |	/*
 5497|       |	 * handle the various case of definitions...
 5498|       |	 */
 5499|   155k|	if (isParameter) {
  ------------------
  |  Branch (5499:6): [True: 74.8k, False: 80.1k]
  ------------------
 5500|  74.8k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  74.8k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  9.67k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5500:10): [True: 65.2k, False: 9.67k]
  |  Branch (5500:26): [True: 1.47k, False: 8.19k]
  ------------------
 5501|  66.6k|	        value = xmlParseEntityValue(ctxt, &orig);
 5502|  66.6k|		if (value) {
  ------------------
  |  Branch (5502:7): [True: 65.4k, False: 1.20k]
  ------------------
 5503|  65.4k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5503:11): [True: 65.4k, False: 0]
  ------------------
 5504|  65.4k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5504:4): [True: 61.2k, False: 4.20k]
  |  Branch (5504:27): [True: 61.2k, False: 0]
  ------------------
 5505|  61.2k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5506|  61.2k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5507|  61.2k|				    NULL, NULL, value);
 5508|  65.4k|		}
 5509|  66.6k|	    } else {
 5510|  8.19k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5511|  8.19k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5511:7): [True: 968, False: 7.23k]
  |  Branch (5511:24): [True: 871, False: 97]
  ------------------
 5512|    871|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5513|    871|		}
 5514|  8.19k|		if (URI) {
  ------------------
  |  Branch (5514:7): [True: 7.23k, False: 968]
  ------------------
 5515|  7.23k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5515:25): [True: 342, False: 6.88k]
  ------------------
 5516|    342|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5517|  6.88k|                    } else {
 5518|  6.88k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5518:29): [True: 6.88k, False: 0]
  ------------------
 5519|  6.88k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5519:29): [True: 6.02k, False: 865]
  ------------------
 5520|  6.02k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5520:29): [True: 6.02k, False: 0]
  ------------------
 5521|  6.02k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5522|  6.02k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5523|  6.02k|                                        literal, URI, NULL);
 5524|  6.88k|                    }
 5525|  7.23k|		}
 5526|  8.19k|	    }
 5527|  80.1k|	} else {
 5528|  80.1k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  80.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  14.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5528:10): [True: 65.7k, False: 14.4k]
  |  Branch (5528:26): [True: 2.05k, False: 12.3k]
  ------------------
 5529|  67.7k|	        value = xmlParseEntityValue(ctxt, &orig);
 5530|  67.7k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5530:7): [True: 67.7k, False: 0]
  ------------------
 5531|  67.7k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5531:7): [True: 66.5k, False: 1.24k]
  |  Branch (5531:30): [True: 66.5k, False: 0]
  ------------------
 5532|  66.5k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5533|  66.5k|				XML_INTERNAL_GENERAL_ENTITY,
 5534|  66.5k|				NULL, NULL, value);
 5535|       |		/*
 5536|       |		 * For expat compatibility in SAX mode.
 5537|       |		 */
 5538|  67.7k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5538:7): [True: 11, False: 67.7k]
  ------------------
 5539|  67.7k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  67.7k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  67.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5539:7): [True: 67, False: 67.7k]
  ------------------
 5540|     78|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5540:11): [True: 11, False: 67]
  ------------------
 5541|     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 *)
  |  |  ------------------
  ------------------
 5542|     11|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5542:8): [True: 1, False: 10]
  ------------------
 5543|      1|			    xmlErrMemory(ctxt);
 5544|      1|			    goto done;
 5545|      1|			}
 5546|     10|			ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5547|     10|		    }
 5548|     77|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5548:11): [True: 10, False: 67]
  ------------------
 5549|     10|			ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5550|     10|					    BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|     10|#define BAD_CAST (xmlChar *)
  ------------------
 5551|     10|                        if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5551:29): [True: 1, False: 9]
  ------------------
 5552|      1|                            xmlErrMemory(ctxt);
 5553|      1|                            goto done;
 5554|      1|                        }
 5555|     10|                    }
 5556|       |
 5557|     76|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5558|     76|			              NULL, NULL, value);
 5559|     76|		}
 5560|  67.7k|	    } else {
 5561|  12.3k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5562|  12.3k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5562:7): [True: 5.57k, False: 6.77k]
  |  Branch (5562:24): [True: 5.32k, False: 247]
  ------------------
 5563|  5.32k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5564|  5.32k|		}
 5565|  12.3k|		if (URI) {
  ------------------
  |  Branch (5565:7): [True: 6.77k, False: 5.57k]
  ------------------
 5566|  6.77k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5566:25): [True: 378, False: 6.39k]
  ------------------
 5567|    378|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5568|    378|                    }
 5569|  6.77k|		}
 5570|  12.3k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2261|  12.3k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2314|  7.17k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5570:7): [True: 7.17k, False: 5.16k]
  |  Branch (5570:23): [True: 5.23k, False: 1.94k]
  ------------------
 5571|  5.23k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5572|  5.23k|				   "Space required before 'NDATA'\n");
 5573|  5.23k|		}
 5574|  12.3k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|  12.3k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  24.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 905, False: 11.4k]
  |  |  |  |  |  Branch (2268:41): [True: 899, False: 6]
  |  |  |  |  ------------------
  |  |  |  | 2269|  12.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 893, False: 6]
  |  |  |  |  |  Branch (2269:41): [True: 885, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 884, False: 1]
  |  |  ------------------
  ------------------
 5575|    884|		    SKIP(5);
  ------------------
  |  | 2285|    884|#define SKIP(val) do {							\
  |  | 2286|    884|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    884|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 76, False: 808]
  |  |  ------------------
  |  | 2288|    884|        xmlParserGrow(ctxt);						\
  |  | 2289|    884|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 884]
  |  |  ------------------
  ------------------
 5576|    884|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|    884|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5576:11): [True: 262, False: 622]
  ------------------
 5577|    262|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5578|    262|				       "Space required after 'NDATA'\n");
 5579|    262|		    }
 5580|    884|		    ndata = xmlParseName(ctxt);
 5581|    884|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5581:11): [True: 884, False: 0]
  |  Branch (5581:34): [True: 617, False: 267]
  ------------------
 5582|    617|		        (ctxt->sax->unparsedEntityDecl != NULL))
  ------------------
  |  Branch (5582:11): [True: 617, False: 0]
  ------------------
 5583|    617|			ctxt->sax->unparsedEntityDecl(ctxt->userData, name,
 5584|    617|				    literal, URI, ndata);
 5585|  11.4k|		} else {
 5586|  11.4k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5586:11): [True: 11.4k, False: 0]
  ------------------
 5587|  11.4k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5587:11): [True: 9.63k, False: 1.82k]
  |  Branch (5587:34): [True: 9.63k, False: 0]
  ------------------
 5588|  9.63k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5589|  9.63k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5590|  9.63k|				    literal, URI, NULL);
 5591|       |		    /*
 5592|       |		     * For expat compatibility in SAX mode.
 5593|       |		     * assuming the entity replacement was asked for
 5594|       |		     */
 5595|  11.4k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5595:11): [True: 5.99k, False: 5.46k]
  ------------------
 5596|  5.99k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5596:5): [True: 10, False: 5.98k]
  ------------------
 5597|  5.98k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  5.98k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  5.98k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5597:4): [True: 215, False: 5.77k]
  ------------------
 5598|    225|			if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5598:8): [True: 10, False: 215]
  ------------------
 5599|     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 *)
  |  |  ------------------
  ------------------
 5600|     10|			    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5600:12): [True: 1, False: 9]
  ------------------
 5601|      1|			        xmlErrMemory(ctxt);
 5602|      1|				goto done;
 5603|      1|			    }
 5604|      9|			    ctxt->myDoc->properties = XML_DOC_INTERNAL;
 5605|      9|			}
 5606|       |
 5607|    224|			if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5607:8): [True: 9, False: 215]
  ------------------
 5608|      9|			    ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
 5609|      9|						BAD_CAST "fake", NULL, NULL);
  ------------------
  |  |   34|      9|#define BAD_CAST (xmlChar *)
  ------------------
 5610|      9|                            if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5610:33): [True: 1, False: 8]
  ------------------
 5611|      1|                                xmlErrMemory(ctxt);
 5612|      1|                                goto done;
 5613|      1|                            }
 5614|      9|                        }
 5615|    223|			xmlSAX2EntityDecl(ctxt, name,
 5616|    223|				          XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5617|    223|				          literal, URI, NULL);
 5618|    223|		    }
 5619|  11.4k|		}
 5620|  12.3k|	    }
 5621|  80.1k|	}
 5622|   154k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   154k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5623|   154k|	if (RAW != '>') {
  ------------------
  |  | 2261|   154k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5623:6): [True: 13.3k, False: 141k]
  ------------------
 5624|  13.3k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5625|  13.3k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5626|   141k|	} else {
 5627|   141k|#ifdef LIBXML_VALID_ENABLED
 5628|   141k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5628:10): [True: 107k, False: 34.6k]
  |  Branch (5628:30): [True: 7, False: 107k]
  ------------------
 5629|      7|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5630|      7|	                         "Entity declaration doesn't start and stop in"
 5631|      7|                                 " the same entity\n",
 5632|      7|                                 NULL, NULL);
 5633|      7|	    }
 5634|   141k|#endif
 5635|   141k|	    NEXT;
  ------------------
  |  | 2316|   141k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5636|   141k|	}
 5637|   154k|	if (orig != NULL) {
  ------------------
  |  Branch (5637:6): [True: 130k, False: 24.5k]
  ------------------
 5638|       |	    /*
 5639|       |	     * Ugly mechanism to save the raw entity value.
 5640|       |	     */
 5641|   130k|	    xmlEntityPtr cur = NULL;
 5642|       |
 5643|   130k|	    if (isParameter) {
  ------------------
  |  Branch (5643:10): [True: 65.4k, False: 64.9k]
  ------------------
 5644|  65.4k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5644:14): [True: 65.4k, False: 0]
  ------------------
 5645|  65.4k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5645:7): [True: 65.4k, False: 0]
  ------------------
 5646|  65.4k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5647|  65.4k|	    } else {
 5648|  64.9k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5648:14): [True: 64.9k, False: 0]
  ------------------
 5649|  64.9k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5649:7): [True: 64.9k, False: 0]
  ------------------
 5650|  64.9k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5651|  64.9k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5651:7): [True: 972, False: 63.9k]
  |  Branch (5651:24): [True: 972, False: 0]
  ------------------
 5652|    972|		    cur = xmlSAX2GetEntity(ctxt, name);
 5653|    972|		}
 5654|  64.9k|	    }
 5655|   130k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5655:17): [True: 125k, False: 4.89k]
  |  Branch (5655:34): [True: 13.9k, False: 111k]
  ------------------
 5656|  13.9k|		cur->orig = orig;
 5657|  13.9k|                orig = NULL;
 5658|  13.9k|	    }
 5659|   130k|	}
 5660|       |
 5661|   155k|done:
 5662|   155k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5662:6): [True: 130k, False: 24.6k]
  ------------------
 5663|   155k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5663:6): [True: 14.0k, False: 140k]
  ------------------
 5664|   155k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5664:6): [True: 3.61k, False: 151k]
  ------------------
 5665|   155k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5665:13): [True: 116k, False: 38.5k]
  ------------------
 5666|   155k|    }
 5667|   191k|}
xmlParseDefaultDecl:
 5699|   104k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5700|   104k|    int val;
 5701|   104k|    xmlChar *ret;
 5702|       |
 5703|   104k|    *value = NULL;
 5704|   104k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2279|   104k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|   208k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|   208k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|   208k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|   208k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|   208k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 41.1k, False: 62.9k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.85k, False: 36.3k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|   104k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.84k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.84k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.84k, False: 1]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.84k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 4.84k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 4.83k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|   104k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 4.83k, False: 1]
  |  |  ------------------
  ------------------
 5705|  4.83k|	SKIP(9);
  ------------------
  |  | 2285|  4.83k|#define SKIP(val) do {							\
  |  | 2286|  4.83k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.83k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 82, False: 4.75k]
  |  |  ------------------
  |  | 2288|  4.83k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.83k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.83k]
  |  |  ------------------
  ------------------
 5706|  4.83k|	return(XML_ATTRIBUTE_REQUIRED);
 5707|  4.83k|    }
 5708|  99.2k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2277|  99.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   198k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   198k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   198k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   198k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 36.3k, False: 62.9k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 19.6k, False: 16.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  99.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 19.6k, False: 7]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 19.5k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 19.5k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 19.5k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 19.5k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 19.5k, False: 1]
  |  |  ------------------
  ------------------
 5709|  19.5k|	SKIP(8);
  ------------------
  |  | 2285|  19.5k|#define SKIP(val) do {							\
  |  | 2286|  19.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  19.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 494, False: 19.0k]
  |  |  ------------------
  |  | 2288|  19.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  19.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 19.5k]
  |  |  ------------------
  ------------------
 5710|  19.5k|	return(XML_ATTRIBUTE_IMPLIED);
 5711|  19.5k|    }
 5712|  79.6k|    val = XML_ATTRIBUTE_NONE;
 5713|  79.6k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2273|  79.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   159k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   159k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 16.7k, False: 62.9k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 16.6k, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  79.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 16.6k, False: 2]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 16.6k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 16.6k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 16.6k, False: 1]
  |  |  ------------------
  ------------------
 5714|  16.6k|	SKIP(6);
  ------------------
  |  | 2285|  16.6k|#define SKIP(val) do {							\
  |  | 2286|  16.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  16.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 72, False: 16.5k]
  |  |  ------------------
  |  | 2288|  16.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  16.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 16.6k]
  |  |  ------------------
  ------------------
 5715|  16.6k|	val = XML_ATTRIBUTE_FIXED;
 5716|  16.6k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  16.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5716:6): [True: 558, False: 16.1k]
  ------------------
 5717|    558|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5718|    558|			   "Space required after '#FIXED'\n");
 5719|    558|	}
 5720|  16.6k|    }
 5721|  79.6k|    ret = xmlParseAttValue(ctxt);
 5722|  79.6k|    if (ret == NULL) {
  ------------------
  |  Branch (5722:9): [True: 43.2k, False: 36.4k]
  ------------------
 5723|  43.2k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5724|  43.2k|		       "Attribute default value declaration error\n");
 5725|  43.2k|    } else
 5726|  36.4k|        *value = ret;
 5727|  79.6k|    return(val);
 5728|  99.2k|}
xmlParseNotationType:
 5748|  4.05k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5749|  4.05k|    const xmlChar *name;
 5750|  4.05k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5751|       |
 5752|  4.05k|    if (RAW != '(') {
  ------------------
  |  | 2261|  4.05k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5752:9): [True: 379, False: 3.67k]
  ------------------
 5753|    379|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5754|    379|	return(NULL);
 5755|    379|    }
 5756|  4.91k|    do {
 5757|  4.91k|        NEXT;
  ------------------
  |  | 2316|  4.91k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5758|  4.91k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.91k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5759|  4.91k|        name = xmlParseName(ctxt);
 5760|  4.91k|	if (name == NULL) {
  ------------------
  |  Branch (5760:6): [True: 272, False: 4.63k]
  ------------------
 5761|    272|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5762|    272|			   "Name expected in NOTATION declaration\n");
 5763|    272|            xmlFreeEnumeration(ret);
 5764|    272|	    return(NULL);
 5765|    272|	}
 5766|  4.63k|        tmp = NULL;
 5767|  4.63k|#ifdef LIBXML_VALID_ENABLED
 5768|  4.63k|        if (ctxt->validate) {
  ------------------
  |  Branch (5768:13): [True: 2.27k, False: 2.36k]
  ------------------
 5769|  2.27k|            tmp = ret;
 5770|  3.91k|            while (tmp != NULL) {
  ------------------
  |  Branch (5770:20): [True: 2.19k, False: 1.71k]
  ------------------
 5771|  2.19k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5771:21): [True: 557, False: 1.64k]
  ------------------
 5772|    557|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5773|    557|              "standalone: attribute notation value token %s duplicated\n",
 5774|    557|                                     name, NULL);
 5775|    557|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5775:25): [True: 0, False: 557]
  ------------------
 5776|      0|                        xmlFree((xmlChar *) name);
 5777|    557|                    break;
 5778|    557|                }
 5779|  1.64k|                tmp = tmp->next;
 5780|  1.64k|            }
 5781|  2.27k|        }
 5782|  4.63k|#endif /* LIBXML_VALID_ENABLED */
 5783|  4.63k|	if (tmp == NULL) {
  ------------------
  |  Branch (5783:6): [True: 4.08k, False: 557]
  ------------------
 5784|  4.08k|	    cur = xmlCreateEnumeration(name);
 5785|  4.08k|	    if (cur == NULL) {
  ------------------
  |  Branch (5785:10): [True: 1, False: 4.08k]
  ------------------
 5786|      1|                xmlErrMemory(ctxt);
 5787|      1|                xmlFreeEnumeration(ret);
 5788|      1|                return(NULL);
 5789|      1|            }
 5790|  4.08k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5790:10): [True: 3.40k, False: 673]
  ------------------
 5791|    673|	    else {
 5792|    673|		last->next = cur;
 5793|    673|		last = cur;
 5794|    673|	    }
 5795|  4.08k|	}
 5796|  4.63k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.63k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  4.63k|    } while (RAW == '|');
  ------------------
  |  | 2261|  4.63k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5797:14): [True: 1.23k, False: 3.40k]
  ------------------
 5798|  3.40k|    if (RAW != ')') {
  ------------------
  |  | 2261|  3.40k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5798:9): [True: 855, False: 2.54k]
  ------------------
 5799|    855|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5800|    855|        xmlFreeEnumeration(ret);
 5801|    855|	return(NULL);
 5802|    855|    }
 5803|  2.54k|    NEXT;
  ------------------
  |  | 2316|  2.54k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5804|  2.54k|    return(ret);
 5805|  3.40k|}
xmlParseEnumerationType:
 5823|  18.5k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5824|  18.5k|    xmlChar *name;
 5825|  18.5k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5826|       |
 5827|  18.5k|    if (RAW != '(') {
  ------------------
  |  | 2261|  18.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5827:9): [True: 2.87k, False: 15.7k]
  ------------------
 5828|  2.87k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5829|  2.87k|	return(NULL);
 5830|  2.87k|    }
 5831|  23.3k|    do {
 5832|  23.3k|        NEXT;
  ------------------
  |  | 2316|  23.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5833|  23.3k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  23.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5834|  23.3k|        name = xmlParseNmtoken(ctxt);
 5835|  23.3k|	if (name == NULL) {
  ------------------
  |  Branch (5835:6): [True: 335, False: 23.0k]
  ------------------
 5836|    335|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5837|    335|	    return(ret);
 5838|    335|	}
 5839|  23.0k|        tmp = NULL;
 5840|  23.0k|#ifdef LIBXML_VALID_ENABLED
 5841|  23.0k|        if (ctxt->validate) {
  ------------------
  |  Branch (5841:13): [True: 16.2k, False: 6.82k]
  ------------------
 5842|  16.2k|            tmp = ret;
 5843|  36.1k|            while (tmp != NULL) {
  ------------------
  |  Branch (5843:20): [True: 20.3k, False: 15.7k]
  ------------------
 5844|  20.3k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5844:21): [True: 463, False: 19.8k]
  ------------------
 5845|    463|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5846|    463|              "standalone: attribute enumeration value token %s duplicated\n",
 5847|    463|                                     name, NULL);
 5848|    463|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5848:25): [True: 463, False: 0]
  ------------------
 5849|    463|                        xmlFree(name);
 5850|    463|                    break;
 5851|    463|                }
 5852|  19.8k|                tmp = tmp->next;
 5853|  19.8k|            }
 5854|  16.2k|        }
 5855|  23.0k|#endif /* LIBXML_VALID_ENABLED */
 5856|  23.0k|	if (tmp == NULL) {
  ------------------
  |  Branch (5856:6): [True: 22.5k, False: 463]
  ------------------
 5857|  22.5k|	    cur = xmlCreateEnumeration(name);
 5858|  22.5k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5858:10): [True: 22.5k, False: 0]
  ------------------
 5859|  22.5k|		xmlFree(name);
 5860|  22.5k|	    if (cur == NULL) {
  ------------------
  |  Branch (5860:10): [True: 4, False: 22.5k]
  ------------------
 5861|      4|                xmlErrMemory(ctxt);
 5862|      4|                xmlFreeEnumeration(ret);
 5863|      4|                return(NULL);
 5864|      4|            }
 5865|  22.5k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5865:10): [True: 15.3k, False: 7.19k]
  ------------------
 5866|  7.19k|	    else {
 5867|  7.19k|		last->next = cur;
 5868|  7.19k|		last = cur;
 5869|  7.19k|	    }
 5870|  22.5k|	}
 5871|  23.0k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  23.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5872|  23.0k|    } while (RAW == '|');
  ------------------
  |  | 2261|  23.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5872:14): [True: 7.67k, False: 15.3k]
  ------------------
 5873|  15.3k|    if (RAW != ')') {
  ------------------
  |  | 2261|  15.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5873:9): [True: 891, False: 14.4k]
  ------------------
 5874|    891|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5875|    891|	return(ret);
 5876|    891|    }
 5877|  14.4k|    NEXT;
  ------------------
  |  | 2316|  14.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5878|  14.4k|    return(ret);
 5879|  15.3k|}
xmlParseEnumeratedType:
 5896|  23.0k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5897|  23.0k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  23.0k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  46.0k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  46.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  46.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  46.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 4.43k, False: 18.5k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.42k, False: 15]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  23.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.41k, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.41k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.41k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.40k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 4.40k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 4.40k, False: 2]
  |  |  ------------------
  ------------------
 5898|  4.40k|	SKIP(8);
  ------------------
  |  | 2285|  4.40k|#define SKIP(val) do {							\
  |  | 2286|  4.40k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.40k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 242, False: 4.16k]
  |  |  ------------------
  |  | 2288|  4.40k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.40k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.40k]
  |  |  ------------------
  ------------------
 5899|  4.40k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  4.40k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5899:6): [True: 349, False: 4.05k]
  ------------------
 5900|    349|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5901|    349|			   "Space required after 'NOTATION'\n");
 5902|    349|	    return(0);
 5903|    349|	}
 5904|  4.05k|	*tree = xmlParseNotationType(ctxt);
 5905|  4.05k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5905:6): [True: 1.50k, False: 2.54k]
  ------------------
 5906|  2.54k|	return(XML_ATTRIBUTE_NOTATION);
 5907|  4.05k|    }
 5908|  18.5k|    *tree = xmlParseEnumerationType(ctxt);
 5909|  18.5k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5909:9): [True: 3.20k, False: 15.3k]
  ------------------
 5910|  15.3k|    return(XML_ATTRIBUTE_ENUMERATION);
 5911|  18.5k|}
xmlParseAttributeType:
 5959|   111k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5960|   111k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|   111k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   223k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 13.2k, False: 98.3k]
  |  |  |  |  |  Branch (2268:41): [True: 13.2k, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2269|   111k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 13.2k, False: 3]
  |  |  |  |  |  Branch (2269:41): [True: 13.2k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 13.2k, False: 1]
  |  |  ------------------
  ------------------
 5961|  13.2k|	SKIP(5);
  ------------------
  |  | 2285|  13.2k|#define SKIP(val) do {							\
  |  | 2286|  13.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 207, False: 13.0k]
  |  |  ------------------
  |  | 2288|  13.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.2k]
  |  |  ------------------
  ------------------
 5962|  13.2k|	return(XML_ATTRIBUTE_CDATA);
 5963|  98.3k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2273|  98.3k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   196k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   196k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 22.2k, False: 76.1k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 22.2k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  98.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 11.2k, False: 10.9k]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 11.2k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 11.2k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 8.17k, False: 3.08k]
  |  |  ------------------
  ------------------
 5964|  8.17k|	SKIP(6);
  ------------------
  |  | 2285|  8.17k|#define SKIP(val) do {							\
  |  | 2286|  8.17k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.17k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 78, False: 8.09k]
  |  |  ------------------
  |  | 2288|  8.17k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.17k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.17k]
  |  |  ------------------
  ------------------
 5965|  8.17k|	return(XML_ATTRIBUTE_IDREFS);
 5966|  90.1k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2271|  90.1k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   180k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 14.0k, False: 76.1k]
  |  |  |  |  |  Branch (2268:41): [True: 14.0k, False: 3]
  |  |  |  |  ------------------
  |  |  |  | 2269|  90.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 3.08k, False: 10.9k]
  |  |  |  |  |  Branch (2269:41): [True: 3.08k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 3.08k, False: 1]
  |  |  ------------------
  ------------------
 5967|  3.08k|	SKIP(5);
  ------------------
  |  | 2285|  3.08k|#define SKIP(val) do {							\
  |  | 2286|  3.08k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.08k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 90, False: 2.99k]
  |  |  ------------------
  |  | 2288|  3.08k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.08k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.08k]
  |  |  ------------------
  ------------------
 5968|  3.08k|	return(XML_ATTRIBUTE_IDREF);
 5969|  87.0k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2261|  87.0k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2263|  10.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5969:17): [True: 10.9k, False: 76.1k]
  |  Branch (5969:33): [True: 10.9k, False: 3]
  ------------------
 5970|  10.9k|        SKIP(2);
  ------------------
  |  | 2285|  10.9k|#define SKIP(val) do {							\
  |  | 2286|  10.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  10.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 216, False: 10.7k]
  |  |  ------------------
  |  | 2288|  10.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  10.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 10.9k]
  |  |  ------------------
  ------------------
 5971|  10.9k|	return(XML_ATTRIBUTE_ID);
 5972|  76.1k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|  76.1k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   152k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   152k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 8.11k, False: 68.0k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 8.10k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  76.1k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 8.10k, False: 2]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 8.09k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 8.09k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 6.54k, False: 1.54k]
  |  |  ------------------
  ------------------
 5973|  6.54k|	SKIP(6);
  ------------------
  |  | 2285|  6.54k|#define SKIP(val) do {							\
  |  | 2286|  6.54k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.54k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 85, False: 6.45k]
  |  |  ------------------
  |  | 2288|  6.54k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.54k]
  |  |  ------------------
  ------------------
 5974|  6.54k|	return(XML_ATTRIBUTE_ENTITY);
 5975|  69.5k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2277|  69.5k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   139k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   139k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   139k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   139k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 1.56k, False: 68.0k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 1.56k, False: 3]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  69.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 1.56k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 1.55k, False: 9]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 1.54k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 1.54k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 1.54k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 1.54k, False: 1]
  |  |  ------------------
  ------------------
 5976|  1.54k|	SKIP(8);
  ------------------
  |  | 2285|  1.54k|#define SKIP(val) do {							\
  |  | 2286|  1.54k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.54k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 212, False: 1.33k]
  |  |  ------------------
  |  | 2288|  1.54k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.54k]
  |  |  ------------------
  ------------------
 5977|  1.54k|	return(XML_ATTRIBUTE_ENTITIES);
 5978|  68.0k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2277|  68.0k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   136k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   136k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   136k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   136k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 49.4k, False: 18.5k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 45.0k, False: 4.42k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  68.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 45.0k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 45.0k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 45.0k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 45.0k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 45.0k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 38.1k, False: 6.90k]
  |  |  ------------------
  ------------------
 5979|  38.1k|	SKIP(8);
  ------------------
  |  | 2285|  38.1k|#define SKIP(val) do {							\
  |  | 2286|  38.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  38.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 226, False: 37.9k]
  |  |  ------------------
  |  | 2288|  38.1k|        xmlParserGrow(ctxt);						\
  |  | 2289|  38.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 38.1k]
  |  |  ------------------
  ------------------
 5980|  38.1k|	return(XML_ATTRIBUTE_NMTOKENS);
 5981|  38.1k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2275|  29.9k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  59.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  59.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  59.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 11.3k, False: 18.5k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 6.91k, False: 4.42k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  29.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 6.91k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 6.91k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 6.90k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 6.90k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 6.90k, False: 2]
  |  |  ------------------
  ------------------
 5982|  6.90k|	SKIP(7);
  ------------------
  |  | 2285|  6.90k|#define SKIP(val) do {							\
  |  | 2286|  6.90k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.90k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 254, False: 6.65k]
  |  |  ------------------
  |  | 2288|  6.90k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.90k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.90k]
  |  |  ------------------
  ------------------
 5983|  6.90k|	return(XML_ATTRIBUTE_NMTOKEN);
 5984|  6.90k|     }
 5985|  23.0k|     return(xmlParseEnumeratedType(ctxt, tree));
 5986|   111k|}
xmlParseAttributeListDecl:
 5999|  93.0k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 6000|  93.0k|    const xmlChar *elemName;
 6001|  93.0k|    const xmlChar *attrName;
 6002|  93.0k|    xmlEnumerationPtr tree;
 6003|       |
 6004|  93.0k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  93.0k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  93.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6004:9): [True: 0, False: 93.0k]
  |  Branch (6004:25): [True: 0, False: 93.0k]
  ------------------
 6005|      0|        return;
 6006|  93.0k|    SKIP(2);
  ------------------
  |  | 2285|  93.0k|#define SKIP(val) do {							\
  |  | 2286|  93.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  93.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 93.0k]
  |  |  ------------------
  |  | 2288|  93.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  93.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 93.0k]
  |  |  ------------------
  ------------------
 6007|       |
 6008|  93.0k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2275|  93.0k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   186k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   186k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   186k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 93.0k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 93.0k, False: 20]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  93.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 93.0k, False: 20]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 93.0k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 93.0k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 93.0k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 92.9k, False: 11]
  |  |  ------------------
  ------------------
 6009|  92.9k|#ifdef LIBXML_VALID_ENABLED
 6010|  92.9k|	int oldInputNr = ctxt->inputNr;
 6011|  92.9k|#endif
 6012|       |
 6013|  92.9k|	SKIP(7);
  ------------------
  |  | 2285|  92.9k|#define SKIP(val) do {							\
  |  | 2286|  92.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  92.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 386, False: 92.6k]
  |  |  ------------------
  |  | 2288|  92.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  92.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 92.9k]
  |  |  ------------------
  ------------------
 6014|  92.9k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  92.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6014:6): [True: 2.52k, False: 90.4k]
  ------------------
 6015|  2.52k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6016|  2.52k|		                 "Space required after '<!ATTLIST'\n");
 6017|  2.52k|	}
 6018|  92.9k|        elemName = xmlParseName(ctxt);
 6019|  92.9k|	if (elemName == NULL) {
  ------------------
  |  Branch (6019:6): [True: 944, False: 92.0k]
  ------------------
 6020|    944|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6021|    944|			   "ATTLIST: no name for Element\n");
 6022|    944|	    return;
 6023|    944|	}
 6024|  92.0k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  92.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6025|  92.0k|	GROW;
  ------------------
  |  | 2308|  92.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  92.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  92.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 85.8k, False: 6.17k]
  |  |  ------------------
  |  | 2309|  92.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  85.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 43.3k, False: 42.4k]
  |  |  ------------------
  |  | 2310|  92.0k|	xmlParserGrow(ctxt);
  ------------------
 6026|   156k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|   156k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   122k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6026:9): [True: 122k, False: 33.9k]
  |  Branch (6026:25): [True: 122k, False: 26]
  ------------------
 6027|   122k|	    int type;
 6028|   122k|	    int def;
 6029|   122k|	    xmlChar *defaultValue = NULL;
 6030|       |
 6031|   122k|	    GROW;
  ------------------
  |  | 2308|   122k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   122k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   122k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 108k, False: 13.1k]
  |  |  ------------------
  |  | 2309|   122k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   108k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 54.2k, False: 54.6k]
  |  |  ------------------
  |  | 2310|   122k|	xmlParserGrow(ctxt);
  ------------------
 6032|   122k|            tree = NULL;
 6033|   122k|	    attrName = xmlParseName(ctxt);
 6034|   122k|	    if (attrName == NULL) {
  ------------------
  |  Branch (6034:10): [True: 7.76k, False: 114k]
  ------------------
 6035|  7.76k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6036|  7.76k|			       "ATTLIST: no name for Attribute\n");
 6037|  7.76k|		break;
 6038|  7.76k|	    }
 6039|   114k|	    GROW;
  ------------------
  |  | 2308|   114k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   114k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   114k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 101k, False: 12.9k]
  |  |  ------------------
  |  | 2309|   114k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   101k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 50.8k, False: 50.4k]
  |  |  ------------------
  |  | 2310|   114k|	xmlParserGrow(ctxt);
  ------------------
 6040|   114k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   114k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6040:10): [True: 2.69k, False: 111k]
  ------------------
 6041|  2.69k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6042|  2.69k|		        "Space required after the attribute name\n");
 6043|  2.69k|		break;
 6044|  2.69k|	    }
 6045|       |
 6046|   111k|	    type = xmlParseAttributeType(ctxt, &tree);
 6047|   111k|	    if (type <= 0) {
  ------------------
  |  Branch (6047:10): [True: 5.06k, False: 106k]
  ------------------
 6048|  5.06k|	        break;
 6049|  5.06k|	    }
 6050|       |
 6051|   106k|	    GROW;
  ------------------
  |  | 2308|   106k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   106k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   106k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 93.9k, False: 12.5k]
  |  |  ------------------
  |  | 2309|   106k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  93.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 45.5k, False: 48.3k]
  |  |  ------------------
  |  | 2310|   106k|	xmlParserGrow(ctxt);
  ------------------
 6052|   106k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   106k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6052:10): [True: 2.43k, False: 104k]
  ------------------
 6053|  2.43k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6054|  2.43k|			       "Space required after the attribute type\n");
 6055|  2.43k|	        if (tree != NULL)
  ------------------
  |  Branch (6055:14): [True: 916, False: 1.51k]
  ------------------
 6056|    916|		    xmlFreeEnumeration(tree);
 6057|  2.43k|		break;
 6058|  2.43k|	    }
 6059|       |
 6060|   104k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6061|   104k|	    if (def <= 0) {
  ------------------
  |  Branch (6061:10): [True: 0, False: 104k]
  ------------------
 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|   104k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6068:10): [True: 91.0k, False: 13.0k]
  |  Branch (6068:43): [True: 34.1k, False: 56.9k]
  ------------------
 6069|  34.1k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6070|       |
 6071|   104k|	    GROW;
  ------------------
  |  | 2308|   104k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   104k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   104k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 91.6k, False: 12.4k]
  |  |  ------------------
  |  | 2309|   104k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  91.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 67.4k, False: 24.1k]
  |  |  ------------------
  |  | 2310|   104k|	xmlParserGrow(ctxt);
  ------------------
 6072|   104k|            if (RAW != '>') {
  ------------------
  |  | 2261|   104k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6072:17): [True: 76.8k, False: 27.2k]
  ------------------
 6073|  76.8k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  76.8k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6073:7): [True: 40.1k, False: 36.7k]
  ------------------
 6074|  40.1k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6075|  40.1k|			"Space required after the attribute default value\n");
 6076|  40.1k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6076:11): [True: 785, False: 39.3k]
  ------------------
 6077|    785|			xmlFree(defaultValue);
 6078|  40.1k|		    if (tree != NULL)
  ------------------
  |  Branch (6078:11): [True: 2.35k, False: 37.7k]
  ------------------
 6079|  2.35k|			xmlFreeEnumeration(tree);
 6080|  40.1k|		    break;
 6081|  40.1k|		}
 6082|  76.8k|	    }
 6083|  63.9k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6083:10): [True: 63.9k, False: 0]
  |  Branch (6083:33): [True: 60.5k, False: 3.41k]
  ------------------
 6084|  60.5k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6084:3): [True: 60.5k, False: 0]
  ------------------
 6085|  60.5k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6086|  60.5k|	                        type, def, defaultValue, tree);
 6087|  3.41k|	    else if (tree != NULL)
  ------------------
  |  Branch (6087:15): [True: 663, False: 2.75k]
  ------------------
 6088|    663|		xmlFreeEnumeration(tree);
 6089|       |
 6090|  63.9k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6090:10): [True: 51.2k, False: 12.7k]
  |  Branch (6090:26): [True: 27.5k, False: 23.6k]
  ------------------
 6091|  27.5k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6091:10): [True: 27.5k, False: 0]
  ------------------
 6092|  27.5k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6092:3): [True: 27.5k, False: 0]
  ------------------
 6093|  27.5k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6094|  27.5k|	    }
 6095|  63.9k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6095:10): [True: 51.2k, False: 12.7k]
  ------------------
 6096|  51.2k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6097|  51.2k|	    }
 6098|  63.9k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6098:10): [True: 35.6k, False: 28.3k]
  ------------------
 6099|  35.6k|	        xmlFree(defaultValue);
 6100|  63.9k|	    GROW;
  ------------------
  |  | 2308|  63.9k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  63.9k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  63.9k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 51.8k, False: 12.1k]
  |  |  ------------------
  |  | 2309|  63.9k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  51.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 21.2k, False: 30.6k]
  |  |  ------------------
  |  | 2310|  63.9k|	xmlParserGrow(ctxt);
  ------------------
 6101|  63.9k|	}
 6102|  92.0k|	if (RAW == '>') {
  ------------------
  |  | 2261|  92.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6102:6): [True: 35.0k, False: 57.0k]
  ------------------
 6103|  35.0k|#ifdef LIBXML_VALID_ENABLED
 6104|  35.0k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6104:10): [True: 28.6k, False: 6.44k]
  |  Branch (6104:30): [True: 153, False: 28.4k]
  ------------------
 6105|    153|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6106|    153|                                 "Attribute list declaration doesn't start and"
 6107|    153|                                 " stop in the same entity\n",
 6108|    153|                                 NULL, NULL);
 6109|    153|	    }
 6110|  35.0k|#endif
 6111|  35.0k|	    NEXT;
  ------------------
  |  | 2316|  35.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6112|  35.0k|	}
 6113|  92.0k|    }
 6114|  93.0k|}
xmlParseElementMixedContentDecl:
 6179|  7.01k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6180|  7.01k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6181|  7.01k|    const xmlChar *elem = NULL;
 6182|       |
 6183|  7.01k|    GROW;
  ------------------
  |  | 2308|  7.01k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.01k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.01k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.26k, False: 1.74k]
  |  |  ------------------
  |  | 2309|  7.01k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.26k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.77k, False: 2.49k]
  |  |  ------------------
  |  | 2310|  7.01k|	xmlParserGrow(ctxt);
  ------------------
 6184|  7.01k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  7.01k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  14.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  14.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  14.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.01k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.01k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  7.01k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.01k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.01k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.01k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.01k, False: 0]
  |  |  ------------------
  ------------------
 6185|  7.01k|	SKIP(7);
  ------------------
  |  | 2285|  7.01k|#define SKIP(val) do {							\
  |  | 2286|  7.01k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.01k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 205, False: 6.80k]
  |  |  ------------------
  |  | 2288|  7.01k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.01k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.01k]
  |  |  ------------------
  ------------------
 6186|  7.01k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6187|  7.01k|	if (RAW == ')') {
  ------------------
  |  | 2261|  7.01k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6187:6): [True: 3.58k, False: 3.42k]
  ------------------
 6188|  3.58k|#ifdef LIBXML_VALID_ENABLED
 6189|  3.58k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6189:10): [True: 2.65k, False: 934]
  |  Branch (6189:30): [True: 10, False: 2.64k]
  ------------------
 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.58k|#endif
 6196|  3.58k|	    NEXT;
  ------------------
  |  | 2316|  3.58k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6197|  3.58k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6198|  3.58k|	    if (ret == NULL)
  ------------------
  |  Branch (6198:10): [True: 1, False: 3.58k]
  ------------------
 6199|      1|                goto mem_error;
 6200|  3.58k|	    if (RAW == '*') {
  ------------------
  |  | 2261|  3.58k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6200:10): [True: 147, False: 3.43k]
  ------------------
 6201|    147|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6202|    147|		NEXT;
  ------------------
  |  | 2316|    147|#define NEXT xmlNextChar(ctxt)
  ------------------
 6203|    147|	    }
 6204|  3.58k|	    return(ret);
 6205|  3.58k|	}
 6206|  3.42k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  3.42k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  3.42k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6206:6): [True: 1, False: 3.42k]
  |  Branch (6206:22): [True: 2.62k, False: 806]
  ------------------
 6207|  2.62k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6208|  2.62k|	    if (ret == NULL)
  ------------------
  |  Branch (6208:10): [True: 1, False: 2.62k]
  ------------------
 6209|      1|                goto mem_error;
 6210|  2.62k|	}
 6211|  21.2k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  21.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  17.9k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6211:9): [True: 17.9k, False: 3.27k]
  |  Branch (6211:25): [True: 17.9k, False: 0]
  ------------------
 6212|  17.9k|	    NEXT;
  ------------------
  |  | 2316|  17.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6213|  17.9k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6214|  17.9k|            if (n == NULL)
  ------------------
  |  Branch (6214:17): [True: 1, False: 17.9k]
  ------------------
 6215|      1|                goto mem_error;
 6216|  17.9k|	    if (elem == NULL) {
  ------------------
  |  Branch (6216:10): [True: 2.61k, False: 15.3k]
  ------------------
 6217|  2.61k|		n->c1 = cur;
 6218|  2.61k|		if (cur != NULL)
  ------------------
  |  Branch (6218:7): [True: 2.61k, False: 0]
  ------------------
 6219|  2.61k|		    cur->parent = n;
 6220|  2.61k|		ret = cur = n;
 6221|  15.3k|	    } else {
 6222|  15.3k|	        cur->c2 = n;
 6223|  15.3k|		n->parent = cur;
 6224|  15.3k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6225|  15.3k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6225:21): [True: 1, False: 15.3k]
  ------------------
 6226|      1|                    goto mem_error;
 6227|  15.3k|		n->c1->parent = n;
 6228|  15.3k|		cur = n;
 6229|  15.3k|	    }
 6230|  17.9k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6231|  17.9k|	    elem = xmlParseName(ctxt);
 6232|  17.9k|	    if (elem == NULL) {
  ------------------
  |  Branch (6232:10): [True: 149, False: 17.8k]
  ------------------
 6233|    149|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6234|    149|			"xmlParseElementMixedContentDecl : Name expected\n");
 6235|    149|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|    149|		return(NULL);
 6237|    149|	    }
 6238|  17.8k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6239|  17.8k|	}
 6240|  3.27k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2261|  3.27k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2263|  2.40k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6240:6): [True: 2.40k, False: 876]
  |  Branch (6240:22): [True: 2.39k, False: 5]
  ------------------
 6241|  2.39k|	    if (elem != NULL) {
  ------------------
  |  Branch (6241:10): [True: 2.39k, False: 0]
  ------------------
 6242|  2.39k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6243|  2.39k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6244|  2.39k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6244:7): [True: 1, False: 2.39k]
  ------------------
 6245|      1|                    goto mem_error;
 6246|  2.39k|		cur->c2->parent = cur;
 6247|  2.39k|            }
 6248|  2.39k|            if (ret != NULL)
  ------------------
  |  Branch (6248:17): [True: 2.39k, False: 0]
  ------------------
 6249|  2.39k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6250|  2.39k|#ifdef LIBXML_VALID_ENABLED
 6251|  2.39k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6251:10): [True: 1.99k, False: 396]
  |  Branch (6251:30): [True: 1, False: 1.99k]
  ------------------
 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.39k|#endif
 6258|  2.39k|	    SKIP(2);
  ------------------
  |  | 2285|  2.39k|#define SKIP(val) do {							\
  |  | 2286|  2.39k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.39k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 478, False: 1.91k]
  |  |  ------------------
  |  | 2288|  2.39k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.39k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.39k]
  |  |  ------------------
  ------------------
 6259|  2.39k|	} else {
 6260|    881|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6261|    881|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6262|    881|	    return(NULL);
 6263|    881|	}
 6264|       |
 6265|  3.27k|    } else {
 6266|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6267|      0|    }
 6268|  2.39k|    return(ret);
 6269|       |
 6270|      5|mem_error:
 6271|      5|    xmlErrMemory(ctxt);
 6272|      5|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6273|       |    return(NULL);
 6274|  7.01k|}
xmlParseElementContentDecl:
 6629|  18.8k|                           xmlElementContent **result) {
 6630|       |
 6631|  18.8k|    xmlElementContentPtr tree = NULL;
 6632|  18.8k|    int openInputNr = ctxt->inputNr;
 6633|  18.8k|    int res;
 6634|       |
 6635|  18.8k|    *result = NULL;
 6636|       |
 6637|  18.8k|    if (RAW != '(') {
  ------------------
  |  | 2261|  18.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6637:9): [True: 0, False: 18.8k]
  ------------------
 6638|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6639|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6640|      0|	return(-1);
 6641|      0|    }
 6642|  18.8k|    NEXT;
  ------------------
  |  | 2316|  18.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6643|  18.8k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6644|  18.8k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  18.8k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  37.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  37.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  37.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.03k, False: 11.7k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.03k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  18.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.02k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.02k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.02k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.02k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.01k, False: 8]
  |  |  ------------------
  ------------------
 6645|  7.01k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6646|  7.01k|	res = XML_ELEMENT_TYPE_MIXED;
 6647|  11.7k|    } else {
 6648|  11.7k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6649|  11.7k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6650|  11.7k|    }
 6651|  18.8k|    if (tree == NULL)
  ------------------
  |  Branch (6651:9): [True: 4.21k, False: 14.5k]
  ------------------
 6652|  4.21k|        return(-1);
 6653|  14.5k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  14.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6654|  14.5k|    *result = tree;
 6655|  14.5k|    return(res);
 6656|  18.8k|}
xmlParseElementDecl:
 6672|  28.3k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6673|  28.3k|    const xmlChar *name;
 6674|  28.3k|    int ret = -1;
 6675|  28.3k|    xmlElementContentPtr content  = NULL;
 6676|       |
 6677|  28.3k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  28.3k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  28.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6677:9): [True: 0, False: 28.3k]
  |  Branch (6677:25): [True: 0, False: 28.3k]
  ------------------
 6678|      0|        return(ret);
 6679|  28.3k|    SKIP(2);
  ------------------
  |  | 2285|  28.3k|#define SKIP(val) do {							\
  |  | 2286|  28.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  28.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 28.3k]
  |  |  ------------------
  |  | 2288|  28.3k|        xmlParserGrow(ctxt);						\
  |  | 2289|  28.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 28.3k]
  |  |  ------------------
  ------------------
 6680|       |
 6681|       |    /* GROW; done in the caller */
 6682|  28.3k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2275|  28.3k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  56.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  56.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  56.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 28.3k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 28.3k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  28.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 28.3k, False: 17]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 28.3k, False: 8]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 28.3k, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 28.2k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 28.2k, False: 15]
  |  |  ------------------
  ------------------
 6683|  28.2k|#ifdef LIBXML_VALID_ENABLED
 6684|  28.2k|	int oldInputNr = ctxt->inputNr;
 6685|  28.2k|#endif
 6686|       |
 6687|  28.2k|	SKIP(7);
  ------------------
  |  | 2285|  28.2k|#define SKIP(val) do {							\
  |  | 2286|  28.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  28.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 274, False: 28.0k]
  |  |  ------------------
  |  | 2288|  28.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  28.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 28.2k]
  |  |  ------------------
  ------------------
 6688|  28.2k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  28.2k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6688:6): [True: 336, False: 27.9k]
  ------------------
 6689|    336|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6690|    336|		           "Space required after 'ELEMENT'\n");
 6691|    336|	    return(-1);
 6692|    336|	}
 6693|  27.9k|        name = xmlParseName(ctxt);
 6694|  27.9k|	if (name == NULL) {
  ------------------
  |  Branch (6694:6): [True: 425, False: 27.5k]
  ------------------
 6695|    425|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6696|    425|			   "xmlParseElementDecl: no name for Element\n");
 6697|    425|	    return(-1);
 6698|    425|	}
 6699|  27.5k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  27.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6699:6): [True: 1.93k, False: 25.5k]
  ------------------
 6700|  1.93k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6701|  1.93k|			   "Space required after the element name\n");
 6702|  1.93k|	}
 6703|  27.5k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2271|  27.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  55.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 6.32k, False: 21.1k]
  |  |  |  |  |  Branch (2268:41): [True: 6.31k, False: 7]
  |  |  |  |  ------------------
  |  |  |  | 2269|  27.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 6.31k, False: 3]
  |  |  |  |  |  Branch (2269:41): [True: 6.30k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 6.30k, False: 2]
  |  |  ------------------
  ------------------
 6704|  6.30k|	    SKIP(5);
  ------------------
  |  | 2285|  6.30k|#define SKIP(val) do {							\
  |  | 2286|  6.30k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.30k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 79, False: 6.22k]
  |  |  ------------------
  |  | 2288|  6.30k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.30k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.30k]
  |  |  ------------------
  ------------------
 6705|       |	    /*
 6706|       |	     * Element must always be empty.
 6707|       |	     */
 6708|  6.30k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6709|  21.2k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2261|  21.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2263|  1.29k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6709:13): [True: 1.29k, False: 19.9k]
  |  Branch (6709:29): [True: 1.29k, False: 1]
  ------------------
 6710|  1.29k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2263|  1.29k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6710:13): [True: 1.29k, False: 1]
  ------------------
 6711|  1.29k|	    SKIP(3);
  ------------------
  |  | 2285|  1.29k|#define SKIP(val) do {							\
  |  | 2286|  1.29k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.29k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 130, False: 1.16k]
  |  |  ------------------
  |  | 2288|  1.29k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.29k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.29k]
  |  |  ------------------
  ------------------
 6712|       |	    /*
 6713|       |	     * Element is a generic container.
 6714|       |	     */
 6715|  1.29k|	    ret = XML_ELEMENT_TYPE_ANY;
 6716|  19.9k|	} else if (RAW == '(') {
  ------------------
  |  | 2261|  19.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6716:13): [True: 18.8k, False: 1.11k]
  ------------------
 6717|  18.8k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6718|  18.8k|            if (ret <= 0)
  ------------------
  |  Branch (6718:17): [True: 4.21k, False: 14.5k]
  ------------------
 6719|  4.21k|                return(-1);
 6720|  18.8k|	} else {
 6721|       |	    /*
 6722|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6723|       |	     */
 6724|  1.11k|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6725|  1.11k|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6726|  1.11k|	    return(-1);
 6727|  1.11k|	}
 6728|       |
 6729|  22.1k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  22.1k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6730|       |
 6731|  22.1k|	if (RAW != '>') {
  ------------------
  |  | 2261|  22.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6731:6): [True: 1.49k, False: 20.6k]
  ------------------
 6732|  1.49k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6733|  1.49k|	    if (content != NULL) {
  ------------------
  |  Branch (6733:10): [True: 1.01k, False: 482]
  ------------------
 6734|  1.01k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6735|  1.01k|	    }
 6736|  20.6k|	} else {
 6737|  20.6k|#ifdef LIBXML_VALID_ENABLED
 6738|  20.6k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6738:10): [True: 15.4k, False: 5.21k]
  |  Branch (6738:30): [True: 70, False: 15.4k]
  ------------------
 6739|     70|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6740|     70|                                 "Element declaration doesn't start and stop in"
 6741|     70|                                 " the same entity\n",
 6742|     70|                                 NULL, NULL);
 6743|     70|	    }
 6744|  20.6k|#endif
 6745|       |
 6746|  20.6k|	    NEXT;
  ------------------
  |  | 2316|  20.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6747|  20.6k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6747:10): [True: 20.6k, False: 0]
  |  Branch (6747:33): [True: 18.7k, False: 1.98k]
  ------------------
 6748|  18.7k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6748:3): [True: 18.7k, False: 0]
  ------------------
 6749|  18.7k|		if (content != NULL)
  ------------------
  |  Branch (6749:7): [True: 12.4k, False: 6.24k]
  ------------------
 6750|  12.4k|		    content->parent = NULL;
 6751|  18.7k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6752|  18.7k|		                       content);
 6753|  18.7k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6753:7): [True: 12.4k, False: 6.24k]
  |  Branch (6753:28): [True: 4.32k, False: 8.14k]
  ------------------
 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|  4.32k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6761|  4.32k|		}
 6762|  18.7k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6762:17): [True: 1.11k, False: 871]
  ------------------
 6763|  1.11k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6764|  1.11k|	    }
 6765|  20.6k|	}
 6766|  22.1k|    }
 6767|  22.2k|    return(ret);
 6768|  28.3k|}
xmlParseMarkupDecl:
 6943|   666k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6944|   666k|    GROW;
  ------------------
  |  | 2308|   666k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   666k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   666k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 632k, False: 34.1k]
  |  |  ------------------
  |  | 2309|   666k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   632k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 294k, False: 338k]
  |  |  ------------------
  |  | 2310|   666k|	xmlParserGrow(ctxt);
  ------------------
 6945|   666k|    if (CUR == '<') {
  ------------------
  |  | 2262|   666k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6945:9): [True: 666k, False: 0]
  ------------------
 6946|   666k|        if (NXT(1) == '!') {
  ------------------
  |  | 2263|   666k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6946:13): [True: 632k, False: 34.4k]
  ------------------
 6947|   632k|	    switch (NXT(2)) {
  ------------------
  |  | 2263|   632k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6948|   219k|	        case 'E':
  ------------------
  |  Branch (6948:10): [True: 219k, False: 413k]
  ------------------
 6949|   219k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2263|   219k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6949:11): [True: 28.3k, False: 191k]
  ------------------
 6950|  28.3k|			xmlParseElementDecl(ctxt);
 6951|   191k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2263|   191k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6951:16): [True: 191k, False: 39]
  ------------------
 6952|   191k|			xmlParseEntityDecl(ctxt);
 6953|     39|                    else
 6954|     39|                        SKIP(2);
  ------------------
  |  | 2285|     39|#define SKIP(val) do {							\
  |  | 2286|     39|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|     39|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 39]
  |  |  ------------------
  |  | 2288|     39|        xmlParserGrow(ctxt);						\
  |  | 2289|     39|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 39]
  |  |  ------------------
  ------------------
 6955|   219k|		    break;
 6956|  93.0k|	        case 'A':
  ------------------
  |  Branch (6956:10): [True: 93.0k, False: 539k]
  ------------------
 6957|  93.0k|		    xmlParseAttributeListDecl(ctxt);
 6958|  93.0k|		    break;
 6959|  3.58k|	        case 'N':
  ------------------
  |  Branch (6959:10): [True: 3.58k, False: 628k]
  ------------------
 6960|  3.58k|		    xmlParseNotationDecl(ctxt);
 6961|  3.58k|		    break;
 6962|   302k|	        case '-':
  ------------------
  |  Branch (6962:10): [True: 302k, False: 329k]
  ------------------
 6963|   302k|		    xmlParseComment(ctxt);
 6964|   302k|		    break;
 6965|  13.4k|		default:
  ------------------
  |  Branch (6965:3): [True: 13.4k, False: 619k]
  ------------------
 6966|  13.4k|                    xmlFatalErr(ctxt,
 6967|  13.4k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6967:33): [True: 1.42k, False: 12.0k]
  ------------------
 6968|  1.42k|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6969|  13.4k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6970|  13.4k|                                NULL);
 6971|  13.4k|                    SKIP(2);
  ------------------
  |  | 2285|  13.4k|#define SKIP(val) do {							\
  |  | 2286|  13.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 579, False: 12.8k]
  |  |  ------------------
  |  | 2288|  13.4k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.4k]
  |  |  ------------------
  ------------------
 6972|  13.4k|		    break;
 6973|   632k|	    }
 6974|   632k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2263|  34.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6974:13): [True: 34.4k, False: 0]
  ------------------
 6975|  34.4k|	    xmlParsePI(ctxt);
 6976|  34.4k|	}
 6977|   666k|    }
 6978|   666k|}
xmlParseTextDecl:
 6990|   204k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6991|   204k|    xmlChar *version;
 6992|       |
 6993|       |    /*
 6994|       |     * We know that '<?xml' is here.
 6995|       |     */
 6996|   204k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   204k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   409k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 204k, False: 0]
  |  |  |  |  |  Branch (2268:41): [True: 204k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2269|   204k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 204k, False: 0]
  |  |  |  |  |  Branch (2269:41): [True: 204k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 204k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   204k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   204k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 202k, False: 2.46k]
  |  |  |  |  ------------------
  |  |  |  |   91|   204k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.46k, False: 2]
  |  |  |  |  |  Branch (91:23): [True: 1.20k, False: 1.25k]
  |  |  |  |  ------------------
  |  |  |  |   92|   204k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.25k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|   204k|	SKIP(5);
  ------------------
  |  | 2285|   204k|#define SKIP(val) do {							\
  |  | 2286|   204k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   204k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 204k]
  |  |  ------------------
  |  | 2288|   204k|        xmlParserGrow(ctxt);						\
  |  | 2289|   204k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 204k]
  |  |  ------------------
  ------------------
 6998|   204k|    } else {
 6999|      7|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 7000|      7|	return;
 7001|      7|    }
 7002|       |
 7003|   204k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   204k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7003:9): [True: 0, False: 204k]
  ------------------
 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|   204k|    version = xmlParseVersionInfo(ctxt);
 7012|   204k|    if (version == NULL) {
  ------------------
  |  Branch (7012:9): [True: 197k, False: 6.87k]
  ------------------
 7013|   197k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   197k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 7014|   197k|        if (version == NULL) {
  ------------------
  |  Branch (7014:13): [True: 7, False: 197k]
  ------------------
 7015|      7|            xmlErrMemory(ctxt);
 7016|      7|            return;
 7017|      7|        }
 7018|   197k|    } else {
 7019|  6.87k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  6.87k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7019:6): [True: 703, False: 6.16k]
  ------------------
 7020|    703|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7021|    703|		           "Space needed here\n");
 7022|    703|	}
 7023|  6.87k|    }
 7024|   204k|    ctxt->input->version = version;
 7025|       |
 7026|       |    /*
 7027|       |     * We must have the encoding declaration
 7028|       |     */
 7029|   204k|    xmlParseEncodingDecl(ctxt);
 7030|       |
 7031|   204k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   204k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7032|   204k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   204k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  3.22k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7032:9): [True: 3.22k, False: 201k]
  |  Branch (7032:25): [True: 2.53k, False: 696]
  ------------------
 7033|  2.53k|        SKIP(2);
  ------------------
  |  | 2285|  2.53k|#define SKIP(val) do {							\
  |  | 2286|  2.53k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.53k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 555, False: 1.97k]
  |  |  ------------------
  |  | 2288|  2.53k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.53k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.53k]
  |  |  ------------------
  ------------------
 7034|   202k|    } else if (RAW == '>') {
  ------------------
  |  | 2261|   202k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7034:16): [True: 330, False: 201k]
  ------------------
 7035|       |        /* Deprecated old WD ... */
 7036|    330|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7037|    330|	NEXT;
  ------------------
  |  | 2316|    330|#define NEXT xmlNextChar(ctxt)
  ------------------
 7038|   201k|    } else {
 7039|   201k|        int c;
 7040|       |
 7041|   201k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7042|   601M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   601M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   601M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7042:16): [True: 601M, False: 41]
  |  Branch (7042:47): [True: 601M, False: 10.2k]
  ------------------
 7043|   601M|            NEXT;
  ------------------
  |  | 2316|   601M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7044|   601M|            if (c == '>')
  ------------------
  |  Branch (7044:17): [True: 191k, False: 601M]
  ------------------
 7045|   191k|                break;
 7046|   601M|        }
 7047|   201k|    }
 7048|   204k|}
xmlParseExternalSubset:
 7065|  1.73k|                       const xmlChar *systemId) {
 7066|  1.73k|    int oldInputNr;
 7067|       |
 7068|  1.73k|    xmlCtxtInitializeLate(ctxt);
 7069|       |
 7070|  1.73k|    xmlDetectEncoding(ctxt);
 7071|       |
 7072|  1.73k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2271|  1.73k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  3.46k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.59k, False: 141]
  |  |  |  |  |  Branch (2268:41): [True: 163, False: 1.42k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  1.73k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 122, False: 41]
  |  |  |  |  |  Branch (2269:41): [True: 117, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 102, False: 15]
  |  |  ------------------
  ------------------
 7073|    102|	xmlParseTextDecl(ctxt);
 7074|    102|    }
 7075|  1.73k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7075:9): [True: 0, False: 1.73k]
  ------------------
 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|  1.73k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7083:9): [True: 0, False: 1.73k]
  ------------------
 7084|      0|        (xmlCreateIntSubset(ctxt->myDoc, NULL, publicId, systemId) == NULL)) {
  ------------------
  |  Branch (7084:9): [True: 0, False: 0]
  ------------------
 7085|      0|        xmlErrMemory(ctxt);
 7086|      0|    }
 7087|       |
 7088|  1.73k|    ctxt->inSubset = 2;
 7089|  1.73k|    oldInputNr = ctxt->inputNr;
 7090|       |
 7091|  1.73k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.73k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7092|   190k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   190k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7092:12): [True: 190k, False: 156]
  ------------------
 7093|   190k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7093:13): [True: 1.71k, False: 188k]
  ------------------
 7094|  1.71k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7094:17): [True: 735, False: 976]
  ------------------
 7095|    735|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7096|    735|                break;
 7097|    735|            }
 7098|       |
 7099|    976|            xmlPopPE(ctxt);
 7100|   188k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   188k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   185k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   163k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7100:20): [True: 185k, False: 3.01k]
  |  Branch (7100:36): [True: 163k, False: 21.9k]
  |  Branch (7100:55): [True: 1.23k, False: 162k]
  ------------------
 7101|  1.23k|            xmlParseConditionalSections(ctxt);
 7102|   187k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   187k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   184k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  21.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7102:20): [True: 184k, False: 3.01k]
  |  Branch (7102:37): [True: 162k, False: 21.9k]
  |  Branch (7102:56): [True: 21.8k, False: 87]
  ------------------
 7103|   184k|            xmlParseMarkupDecl(ctxt);
 7104|   184k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  3.10k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7104:20): [True: 2.26k, False: 841]
  ------------------
 7105|  2.26k|            xmlParsePERefInternal(ctxt, 1);
 7106|  2.26k|        } else {
 7107|    841|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7108|       |
 7109|  1.01k|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7109:20): [True: 172, False: 841]
  ------------------
 7110|    172|                xmlPopPE(ctxt);
 7111|    841|            break;
 7112|    841|        }
 7113|   188k|        SKIP_BLANKS;
  ------------------
  |  | 2312|   188k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7114|   188k|        SHRINK;
  ------------------
  |  | 2304|   188k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   188k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   188k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 188k, False: 0]
  |  |  ------------------
  |  | 2305|   188k|	xmlParserShrink(ctxt);
  ------------------
 7115|   188k|        GROW;
  ------------------
  |  | 2308|   188k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   188k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   188k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 188k, False: 0]
  |  |  ------------------
  |  | 2309|   188k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   188k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.2k, False: 178k]
  |  |  ------------------
  |  | 2310|   188k|	xmlParserGrow(ctxt);
  ------------------
 7116|   188k|    }
 7117|  1.73k|}
xmlParseReference:
 7133|   122k|xmlParseReference(xmlParserCtxt *ctxt) {
 7134|   122k|    xmlEntityPtr ent = NULL;
 7135|   122k|    const xmlChar *name;
 7136|   122k|    xmlChar *val;
 7137|       |
 7138|   122k|    if (RAW != '&')
  ------------------
  |  | 2261|   122k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7138:9): [True: 0, False: 122k]
  ------------------
 7139|      0|        return;
 7140|       |
 7141|       |    /*
 7142|       |     * Simple case of a CharRef
 7143|       |     */
 7144|   122k|    if (NXT(1) == '#') {
  ------------------
  |  | 2263|   122k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7144:9): [True: 44.8k, False: 78.1k]
  ------------------
 7145|  44.8k|	int i = 0;
 7146|  44.8k|	xmlChar out[16];
 7147|  44.8k|	int value = xmlParseCharRef(ctxt);
 7148|       |
 7149|  44.8k|	if (value == 0)
  ------------------
  |  Branch (7149:6): [True: 8.31k, False: 36.5k]
  ------------------
 7150|  8.31k|	    return;
 7151|       |
 7152|       |        /*
 7153|       |         * Just encode the value in UTF-8
 7154|       |         */
 7155|  36.5k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2333|  36.5k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 35.8k, False: 625]
  |  |  ------------------
  |  | 2334|  36.5k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7156|  36.5k|        out[i] = 0;
 7157|  36.5k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7157:13): [True: 36.5k, False: 0]
  |  Branch (7157:36): [True: 36.5k, False: 0]
  ------------------
 7158|  36.5k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7158:13): [True: 7.04k, False: 29.4k]
  ------------------
 7159|  7.04k|            ctxt->sax->characters(ctxt->userData, out, i);
 7160|  36.5k|	return;
 7161|  44.8k|    }
 7162|       |
 7163|       |    /*
 7164|       |     * We are seeing an entity reference
 7165|       |     */
 7166|  78.1k|    name = xmlParseEntityRefInternal(ctxt);
 7167|  78.1k|    if (name == NULL)
  ------------------
  |  Branch (7167:9): [True: 18.0k, False: 60.1k]
  ------------------
 7168|  18.0k|        return;
 7169|  60.1k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7170|  60.1k|    if (ent == NULL) {
  ------------------
  |  Branch (7170:9): [True: 34.0k, False: 26.1k]
  ------------------
 7171|       |        /*
 7172|       |         * Create a reference for undeclared entities.
 7173|       |         */
 7174|  34.0k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7174:13): [True: 28.8k, False: 5.16k]
  ------------------
 7175|  28.8k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7175:13): [True: 28.8k, False: 0]
  ------------------
 7176|  28.8k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7176:13): [True: 20.4k, False: 8.38k]
  ------------------
 7177|  20.4k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7177:13): [True: 20.4k, False: 0]
  ------------------
 7178|  20.4k|            ctxt->sax->reference(ctxt->userData, name);
 7179|  20.4k|        }
 7180|  34.0k|        return;
 7181|  34.0k|    }
 7182|  26.1k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7182:9): [True: 6.08k, False: 20.0k]
  ------------------
 7183|  6.08k|	return;
 7184|       |
 7185|       |    /* special case of predefined entities */
 7186|  20.0k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7186:9): [True: 0, False: 20.0k]
  ------------------
 7187|  20.0k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7187:9): [True: 1.17k, False: 18.8k]
  ------------------
 7188|  1.17k|	val = ent->content;
 7189|  1.17k|	if (val == NULL) return;
  ------------------
  |  Branch (7189:6): [True: 0, False: 1.17k]
  ------------------
 7190|       |	/*
 7191|       |	 * inline the entity.
 7192|       |	 */
 7193|  1.17k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7193:6): [True: 1.17k, False: 0]
  |  Branch (7193:29): [True: 1.17k, False: 0]
  ------------------
 7194|  1.17k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7194:6): [True: 1.17k, False: 0]
  ------------------
 7195|  1.17k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7196|  1.17k|	return;
 7197|  1.17k|    }
 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|  18.8k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  18.8k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7204:9): [True: 5.12k, False: 13.7k]
  |  Branch (7204:49): [True: 0, False: 5.12k]
  ------------------
 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|  18.8k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7247:9): [True: 8.93k, False: 9.92k]
  ------------------
 7248|  9.92k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7248:10): [True: 9.14k, False: 777]
  ------------------
 7249|  9.14k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7249:11): [True: 6.96k, False: 2.18k]
  ------------------
 7250|  17.7k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7250:11): [True: 1.82k, False: 355]
  ------------------
 7251|  17.7k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  17.7k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7251:13): [True: 3.98k, False: 13.7k]
  ------------------
 7252|  3.98k|            xmlCtxtParseEntity(ctxt, ent);
 7253|  13.7k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7253:20): [True: 3.79k, False: 9.94k]
  ------------------
 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|  3.79k|            xmlCtxtParseEntity(ctxt, ent);
 7264|  3.79k|        }
 7265|  17.7k|    }
 7266|       |
 7267|       |    /*
 7268|       |     * We also check for amplification if entities aren't substituted.
 7269|       |     * They might be expanded later.
 7270|       |     */
 7271|  18.8k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7271:9): [True: 45, False: 18.8k]
  ------------------
 7272|     45|        return;
 7273|       |
 7274|  18.8k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7274:9): [True: 0, False: 18.8k]
  |  Branch (7274:32): [True: 854, False: 17.9k]
  ------------------
 7275|    854|        return;
 7276|       |
 7277|  17.9k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7277:9): [True: 6.03k, False: 11.9k]
  ------------------
 7278|       |	/*
 7279|       |	 * Create a reference
 7280|       |	 */
 7281|  6.03k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7281:13): [True: 6.03k, False: 0]
  ------------------
 7282|  6.03k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7283|  11.9k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7283:16): [True: 8.10k, False: 3.82k]
  |  Branch (7283:43): [True: 8.10k, False: 0]
  ------------------
 7284|  8.10k|        xmlNodePtr copy, cur;
 7285|       |
 7286|       |        /*
 7287|       |         * Seems we are generating the DOM content, copy the tree
 7288|       |	 */
 7289|  8.10k|        cur = ent->children;
 7290|       |
 7291|       |        /*
 7292|       |         * Handle first text node with SAX to coalesce text efficiently
 7293|       |         */
 7294|  8.10k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7294:13): [True: 6.58k, False: 1.52k]
  ------------------
 7295|  6.76k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7295:13): [True: 178, False: 1.34k]
  ------------------
 7296|  6.76k|            int len = xmlStrlen(cur->content);
 7297|       |
 7298|  6.76k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7298:17): [True: 6.58k, False: 178]
  ------------------
 7299|  6.58k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7299:17): [True: 0, False: 178]
  ------------------
 7300|  6.58k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7300:21): [True: 6.58k, False: 0]
  ------------------
 7301|  6.58k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7302|  6.58k|            } else {
 7303|    178|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7303:21): [True: 178, False: 0]
  ------------------
 7304|    178|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7305|    178|            }
 7306|       |
 7307|  6.76k|            cur = cur->next;
 7308|  6.76k|        }
 7309|       |
 7310|  68.0k|        while (cur != NULL) {
  ------------------
  |  Branch (7310:16): [True: 62.2k, False: 5.88k]
  ------------------
 7311|  62.2k|            xmlNodePtr last;
 7312|       |
 7313|       |            /*
 7314|       |             * Handle last text node with SAX to coalesce text efficiently
 7315|       |             */
 7316|  62.2k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7316:17): [True: 4.19k, False: 58.0k]
  ------------------
 7317|  4.19k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7317:18): [True: 1.88k, False: 2.31k]
  ------------------
 7318|  2.31k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7318:18): [True: 273, False: 2.03k]
  ------------------
 7319|  2.15k|                int len = xmlStrlen(cur->content);
 7320|       |
 7321|  2.15k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7321:21): [True: 1.88k, False: 273]
  ------------------
 7322|  1.88k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7322:21): [True: 0, False: 273]
  ------------------
 7323|  1.88k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7323:25): [True: 1.88k, False: 0]
  ------------------
 7324|  1.88k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7325|  1.88k|                                              len);
 7326|  1.88k|                } else {
 7327|    273|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7327:25): [True: 273, False: 0]
  ------------------
 7328|    273|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7329|    273|                                              len);
 7330|    273|                }
 7331|       |
 7332|  2.15k|                break;
 7333|  2.15k|            }
 7334|       |
 7335|       |            /*
 7336|       |             * Reset coalesce buffer stats only for non-text nodes.
 7337|       |             */
 7338|  60.0k|            ctxt->nodemem = 0;
 7339|  60.0k|            ctxt->nodelen = 0;
 7340|       |
 7341|  60.0k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7342|       |
 7343|  60.0k|            if (copy == NULL) {
  ------------------
  |  Branch (7343:17): [True: 57, False: 59.9k]
  ------------------
 7344|     57|                xmlErrMemory(ctxt);
 7345|     57|                break;
 7346|     57|            }
 7347|       |
 7348|  59.9k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7348:17): [True: 59.2k, False: 737]
  ------------------
 7349|       |                /* Needed for reader */
 7350|  59.2k|                copy->extra = cur->extra;
 7351|       |                /* Maybe needed for reader */
 7352|  59.2k|                copy->_private = cur->_private;
 7353|  59.2k|            }
 7354|       |
 7355|  59.9k|            copy->parent = ctxt->node;
 7356|  59.9k|            last = ctxt->node->last;
 7357|  59.9k|            if (last == NULL) {
  ------------------
  |  Branch (7357:17): [True: 379, False: 59.6k]
  ------------------
 7358|    379|                ctxt->node->children = copy;
 7359|  59.6k|            } else {
 7360|  59.6k|                last->next = copy;
 7361|  59.6k|                copy->prev = last;
 7362|  59.6k|            }
 7363|  59.9k|            ctxt->node->last = copy;
 7364|       |
 7365|  59.9k|            cur = cur->next;
 7366|  59.9k|        }
 7367|  8.10k|    }
 7368|  17.9k|}
xmlParseDocTypeDecl:
 7971|  20.8k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7972|  20.8k|    const xmlChar *name = NULL;
 7973|  20.8k|    xmlChar *publicId = NULL;
 7974|  20.8k|    xmlChar *URI = NULL;
 7975|       |
 7976|       |    /*
 7977|       |     * We know that '<!DOCTYPE' has been detected.
 7978|       |     */
 7979|  20.8k|    SKIP(9);
  ------------------
  |  | 2285|  20.8k|#define SKIP(val) do {							\
  |  | 2286|  20.8k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  20.8k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 6, False: 20.8k]
  |  |  ------------------
  |  | 2288|  20.8k|        xmlParserGrow(ctxt);						\
  |  | 2289|  20.8k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 20.8k]
  |  |  ------------------
  ------------------
 7980|       |
 7981|  20.8k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  20.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7981:9): [True: 1.42k, False: 19.3k]
  ------------------
 7982|  1.42k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7983|  1.42k|                       "Space required after 'DOCTYPE'\n");
 7984|  1.42k|    }
 7985|       |
 7986|       |    /*
 7987|       |     * Parse the DOCTYPE name.
 7988|       |     */
 7989|  20.8k|    name = xmlParseName(ctxt);
 7990|  20.8k|    if (name == NULL) {
  ------------------
  |  Branch (7990:9): [True: 1.14k, False: 19.6k]
  ------------------
 7991|  1.14k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7992|  1.14k|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7993|  1.14k|    }
 7994|  20.8k|    ctxt->intSubName = name;
 7995|       |
 7996|  20.8k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  20.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7997|       |
 7998|       |    /*
 7999|       |     * Check for public and system identifier (URI)
 8000|       |     */
 8001|  20.8k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 8002|       |
 8003|  20.8k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (8003:9): [True: 3.17k, False: 17.6k]
  |  Branch (8003:26): [True: 22, False: 17.6k]
  ------------------
 8004|  3.20k|        ctxt->hasExternalSubset = 1;
 8005|  3.20k|    }
 8006|  20.8k|    ctxt->extSubURI = URI;
 8007|  20.8k|    ctxt->extSubSystem = publicId;
 8008|       |
 8009|  20.8k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  20.8k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8010|       |
 8011|       |    /*
 8012|       |     * Create and update the internal subset.
 8013|       |     */
 8014|  20.8k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (8014:9): [True: 20.8k, False: 0]
  |  Branch (8014:32): [True: 20.8k, False: 0]
  ------------------
 8015|  20.8k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8015:2): [True: 20.6k, False: 156]
  ------------------
 8016|  20.6k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 8017|       |
 8018|  20.8k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  20.8k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  5.69k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8018:9): [True: 5.69k, False: 15.1k]
  |  Branch (8018:25): [True: 264, False: 5.42k]
  ------------------
 8019|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8020|    264|    }
 8021|  20.8k|}
xmlParseAttribute:
 8127|   253k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8128|   253k|    const xmlChar *name;
 8129|   253k|    xmlChar *val;
 8130|       |
 8131|   253k|    *value = NULL;
 8132|   253k|    GROW;
  ------------------
  |  | 2308|   253k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   253k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   253k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 186k, False: 67.1k]
  |  |  ------------------
  |  | 2309|   253k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   186k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.2k, False: 174k]
  |  |  ------------------
  |  | 2310|   253k|	xmlParserGrow(ctxt);
  ------------------
 8133|   253k|    name = xmlParseName(ctxt);
 8134|   253k|    if (name == NULL) {
  ------------------
  |  Branch (8134:9): [True: 113k, False: 139k]
  ------------------
 8135|   113k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8136|   113k|	               "error parsing attribute name\n");
 8137|   113k|        return(NULL);
 8138|   113k|    }
 8139|       |
 8140|       |    /*
 8141|       |     * read the value
 8142|       |     */
 8143|   139k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   139k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8144|   139k|    if (RAW == '=') {
  ------------------
  |  | 2261|   139k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8144:9): [True: 124k, False: 14.8k]
  ------------------
 8145|   124k|        NEXT;
  ------------------
  |  | 2316|   124k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8146|   124k|	SKIP_BLANKS;
  ------------------
  |  | 2312|   124k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8147|   124k|	val = xmlParseAttValue(ctxt);
 8148|   124k|    } else {
 8149|  14.8k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8150|  14.8k|	       "Specification mandates value for attribute %s\n", name);
 8151|  14.8k|	return(name);
 8152|  14.8k|    }
 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|   124k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  69.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8159:9): [True: 69.2k, False: 55.4k]
  |  Branch (8159:29): [True: 9.83k, False: 59.3k]
  ------------------
 8160|  9.83k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8160:6): [True: 6.83k, False: 2.99k]
  ------------------
 8161|  6.83k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8162|  6.83k|		          "Malformed value for xml:lang : %s\n",
 8163|  6.83k|			  val, NULL);
 8164|  6.83k|	}
 8165|  9.83k|    }
 8166|       |
 8167|       |    /*
 8168|       |     * Check that xml:space conforms to the specification
 8169|       |     */
 8170|   124k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|   124k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8170:9): [True: 847, False: 123k]
  ------------------
 8171|    847|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    847|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8171:6): [True: 198, False: 649]
  ------------------
 8172|    198|	    *(ctxt->space) = 0;
 8173|    649|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    649|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8173:11): [True: 402, False: 247]
  ------------------
 8174|    402|	    *(ctxt->space) = 1;
 8175|    247|	else {
 8176|    247|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8177|    247|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8178|    247|                                 val, NULL);
 8179|    247|	}
 8180|    847|    }
 8181|       |
 8182|   124k|    *value = val;
 8183|   124k|    return(name);
 8184|   139k|}
xmlParseStartTag:
 8214|   483k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8215|   483k|    const xmlChar *name;
 8216|   483k|    const xmlChar *attname;
 8217|   483k|    xmlChar *attvalue;
 8218|   483k|    const xmlChar **atts = ctxt->atts;
 8219|   483k|    int nbatts = 0;
 8220|   483k|    int maxatts = ctxt->maxatts;
 8221|   483k|    int i;
 8222|       |
 8223|   483k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   483k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8223:9): [True: 0, False: 483k]
  ------------------
 8224|   483k|    NEXT1;
  ------------------
  |  | 2318|   483k|#define NEXT1 {								\
  |  | 2319|   483k|	ctxt->input->col++;						\
  |  | 2320|   483k|	ctxt->input->cur++;						\
  |  | 2321|   483k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 654, False: 482k]
  |  |  ------------------
  |  | 2322|   483k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   483k|    }
  ------------------
 8225|       |
 8226|   483k|    name = xmlParseName(ctxt);
 8227|   483k|    if (name == NULL) {
  ------------------
  |  Branch (8227:9): [True: 15.9k, False: 467k]
  ------------------
 8228|  15.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8229|  15.9k|	     "xmlParseStartTag: invalid element name\n");
 8230|  15.9k|        return(NULL);
 8231|  15.9k|    }
 8232|       |
 8233|       |    /*
 8234|       |     * Now parse the attributes, it ends up with the ending
 8235|       |     *
 8236|       |     * (S Attribute)* S?
 8237|       |     */
 8238|   467k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   467k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8239|   467k|    GROW;
  ------------------
  |  | 2308|   467k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   467k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   467k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 365k, False: 101k]
  |  |  ------------------
  |  | 2309|   467k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   365k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 26.6k, False: 339k]
  |  |  ------------------
  |  | 2310|   467k|	xmlParserGrow(ctxt);
  ------------------
 8240|       |
 8241|   531k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   531k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8241:13): [True: 350k, False: 180k]
  ------------------
 8242|   350k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   350k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|  91.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8242:6): [True: 258k, False: 91.9k]
  |  Branch (8242:22): [True: 4.19k, False: 87.7k]
  ------------------
 8243|   263k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   263k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   263k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 254k, False: 8.22k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 254k]
  |  |  |  |  ------------------
  |  |  |  |  109|   263k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 263k]
  |  |  |  |  ------------------
  |  |  |  |  110|   263k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 253k, False: 9.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   253k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8243:29): [True: 253k, False: 146]
  ------------------
 8244|   253k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8245|   253k|        if (attname == NULL)
  ------------------
  |  Branch (8245:13): [True: 113k, False: 139k]
  ------------------
 8246|   113k|	    break;
 8247|   139k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8247:13): [True: 121k, False: 18.2k]
  ------------------
 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|   227k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8253:18): [True: 118k, False: 108k]
  ------------------
 8254|   118k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8254:14): [True: 12.8k, False: 105k]
  ------------------
 8255|  12.8k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8256|  12.8k|		    goto failed;
 8257|  12.8k|		}
 8258|   118k|	    }
 8259|       |	    /*
 8260|       |	     * Add the pair to atts
 8261|       |	     */
 8262|   108k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8262:10): [True: 20.1k, False: 88.2k]
  ------------------
 8263|  20.1k|	        const xmlChar **n;
 8264|  20.1k|                int newSize;
 8265|       |
 8266|  20.1k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8267|  20.1k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  20.1k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8268|  20.1k|                if (newSize < 0) {
  ------------------
  |  Branch (8268:21): [True: 0, False: 20.1k]
  ------------------
 8269|      0|		    xmlErrMemory(ctxt);
 8270|      0|		    goto failed;
 8271|      0|		}
 8272|  20.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8273|  20.1k|                if (newSize < 2)
  ------------------
  |  Branch (8273:21): [True: 12.4k, False: 7.64k]
  ------------------
 8274|  12.4k|                    newSize = 2;
 8275|  20.1k|#endif
 8276|  20.1k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8277|  20.1k|		if (n == NULL) {
  ------------------
  |  Branch (8277:7): [True: 3, False: 20.1k]
  ------------------
 8278|      3|		    xmlErrMemory(ctxt);
 8279|      3|		    goto failed;
 8280|      3|		}
 8281|  20.1k|		atts = n;
 8282|  20.1k|                maxatts = newSize * 2;
 8283|  20.1k|		ctxt->atts = atts;
 8284|  20.1k|		ctxt->maxatts = maxatts;
 8285|  20.1k|	    }
 8286|       |
 8287|   108k|	    atts[nbatts++] = attname;
 8288|   108k|	    atts[nbatts++] = attvalue;
 8289|   108k|	    atts[nbatts] = NULL;
 8290|   108k|	    atts[nbatts + 1] = NULL;
 8291|       |
 8292|   108k|            attvalue = NULL;
 8293|   108k|	}
 8294|       |
 8295|   139k|failed:
 8296|       |
 8297|   139k|        if (attvalue != NULL)
  ------------------
  |  Branch (8297:13): [True: 12.8k, False: 126k]
  ------------------
 8298|  12.8k|            xmlFree(attvalue);
 8299|       |
 8300|   139k|	GROW
  ------------------
  |  | 2308|   139k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   139k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   139k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 84.0k, False: 55.4k]
  |  |  ------------------
  |  | 2309|   139k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  84.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.3k, False: 73.7k]
  |  |  ------------------
  |  | 2310|   139k|	xmlParserGrow(ctxt);
  ------------------
 8301|   139k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   139k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   114k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  50.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8301:6): [True: 25.2k, False: 114k]
  |  Branch (8301:24): [True: 50.6k, False: 63.6k]
  |  Branch (8301:40): [True: 50.1k, False: 526]
  ------------------
 8302|  75.3k|	    break;
 8303|  64.1k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  64.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8303:6): [True: 22.1k, False: 42.0k]
  ------------------
 8304|  22.1k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8305|  22.1k|			   "attributes construct error\n");
 8306|  22.1k|	}
 8307|  64.1k|	SHRINK;
  ------------------
  |  | 2304|  64.1k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  64.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  64.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 30.9k, False: 33.2k]
  |  |  ------------------
  |  | 2305|  64.1k|	xmlParserShrink(ctxt);
  ------------------
 8308|  64.1k|        GROW;
  ------------------
  |  | 2308|  64.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  64.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  64.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 30.9k, False: 33.2k]
  |  |  ------------------
  |  | 2309|  64.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  30.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.53k, False: 25.4k]
  |  |  ------------------
  |  | 2310|  64.1k|	xmlParserGrow(ctxt);
  ------------------
 8309|  64.1k|    }
 8310|       |
 8311|       |    /*
 8312|       |     * SAX: Start of Element !
 8313|       |     */
 8314|   467k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8314:9): [True: 467k, False: 0]
  |  Branch (8314:32): [True: 467k, False: 0]
  ------------------
 8315|   467k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8315:2): [True: 292k, False: 174k]
  ------------------
 8316|   292k|	if (nbatts > 0)
  ------------------
  |  Branch (8316:6): [True: 81.6k, False: 210k]
  ------------------
 8317|  81.6k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8318|   210k|	else
 8319|   210k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8320|   292k|    }
 8321|       |
 8322|   467k|    if (atts != NULL) {
  ------------------
  |  Branch (8322:9): [True: 382k, False: 84.7k]
  ------------------
 8323|       |        /* Free only the content strings */
 8324|   490k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8324:20): [True: 108k, False: 382k]
  ------------------
 8325|   108k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8325:10): [True: 108k, False: 0]
  ------------------
 8326|   108k|	       xmlFree((xmlChar *) atts[i]);
 8327|   382k|    }
 8328|   467k|    return(name);
 8329|   467k|}
xmlParseCDSect:
 9480|  89.4k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9481|  89.4k|    xmlChar *buf = NULL;
 9482|  89.4k|    int len = 0;
 9483|  89.4k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  89.4k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9484|  89.4k|    int r, rl;
 9485|  89.4k|    int	s, sl;
 9486|  89.4k|    int cur, l;
 9487|  89.4k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9487:21): [True: 22.0k, False: 67.3k]
  ------------------
 9488|  22.0k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  22.0k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9489|  89.4k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  67.3k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9490|       |
 9491|  89.4k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2262|  89.4k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  89.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|  89.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9491:9): [True: 0, False: 89.4k]
  |  Branch (9491:25): [True: 0, False: 89.4k]
  |  Branch (9491:44): [True: 0, False: 89.4k]
  ------------------
 9492|      0|        return;
 9493|  89.4k|    SKIP(3);
  ------------------
  |  | 2285|  89.4k|#define SKIP(val) do {							\
  |  | 2286|  89.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  89.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 89.4k]
  |  |  ------------------
  |  | 2288|  89.4k|        xmlParserGrow(ctxt);						\
  |  | 2289|  89.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 9494|       |
 9495|  89.4k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2273|  89.4k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   178k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   178k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 89.4k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 89.4k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  89.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 89.4k, False: 0]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 89.4k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 89.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 89.4k, False: 0]
  |  |  ------------------
  ------------------
 9496|      0|        return;
 9497|  89.4k|    SKIP(6);
  ------------------
  |  | 2285|  89.4k|#define SKIP(val) do {							\
  |  | 2286|  89.4k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  89.4k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 233, False: 89.2k]
  |  |  ------------------
  |  | 2288|  89.4k|        xmlParserGrow(ctxt);						\
  |  | 2289|  89.4k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 89.4k]
  |  |  ------------------
  ------------------
 9498|       |
 9499|  89.4k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9500|  89.4k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|  89.4k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  89.4k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 87.3k, False: 2.06k]
  |  |  |  |  ------------------
  |  |  |  |  118|  89.4k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  87.3k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 87.1k, False: 237]
  |  |  |  |  |  |  |  Branch (108:44): [True: 814, False: 86.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  87.3k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 86.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  87.3k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 86.2k, False: 270]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  89.4k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.06k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 225, False: 1.83k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.06k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.83k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.21k, False: 621]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.06k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 552, False: 69]
  |  |  |  |  |  Branch (121:27): [True: 552, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9500:9): [True: 339, False: 89.1k]
  ------------------
 9501|    339|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9502|    339|        goto out;
 9503|    339|    }
 9504|  89.1k|    NEXTL(rl);
  ------------------
  |  | 2325|  89.1k|#define NEXTL(l) do {							\
  |  | 2326|  89.1k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 809, False: 88.2k]
  |  |  ------------------
  |  | 2327|    809|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  88.2k|    } else ctxt->input->col++;						\
  |  | 2329|  89.1k|    ctxt->input->cur += l;				\
  |  | 2330|  89.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 89.1k]
  |  |  ------------------
  ------------------
 9505|  89.1k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9506|  89.1k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|  89.1k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  89.1k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 87.3k, False: 1.73k]
  |  |  |  |  ------------------
  |  |  |  |  118|  89.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  87.3k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 86.5k, False: 780]
  |  |  |  |  |  |  |  Branch (108:44): [True: 241, False: 86.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  87.3k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 87.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  87.3k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 86.2k, False: 912]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  89.1k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.73k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 301, False: 1.42k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.73k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.42k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.00k, False: 428]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.73k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 233, False: 195]
  |  |  |  |  |  Branch (121:27): [True: 233, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9506:9): [True: 1.10k, False: 87.9k]
  ------------------
 9507|  1.10k|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9508|  1.10k|        goto out;
 9509|  1.10k|    }
 9510|  87.9k|    NEXTL(sl);
  ------------------
  |  | 2325|  87.9k|#define NEXTL(l) do {							\
  |  | 2326|  87.9k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 226, False: 87.7k]
  |  |  ------------------
  |  | 2327|    226|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  87.7k|    } else ctxt->input->col++;						\
  |  | 2329|  87.9k|    ctxt->input->cur += l;				\
  |  | 2330|  87.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 87.9k]
  |  |  ------------------
  ------------------
 9511|  87.9k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9512|  87.9k|    buf = xmlMalloc(size);
 9513|  87.9k|    if (buf == NULL) {
  ------------------
  |  Branch (9513:9): [True: 1, False: 87.9k]
  ------------------
 9514|      1|	xmlErrMemory(ctxt);
 9515|      1|        goto out;
 9516|      1|    }
 9517|  1.55M|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|  1.55M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  3.10M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.54M, False: 2.87k]
  |  |  |  |  |  Branch (117:25): [True: 345k, False: 1.20M]
  |  |  |  |  ------------------
  |  |  |  |  118|  3.10M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   345k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 344k, False: 1.23k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 74.4k, False: 269k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   345k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 271k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   345k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 268k, False: 2.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  3.10M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.20M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 325, False: 1.20M]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.20M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.20M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.20M, False: 636]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.20M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 389, False: 247]
  |  |  |  |  |  Branch (121:27): [True: 389, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9518|  1.54M|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9518:13): [True: 1.46M, False: 87.1k]
  |  Branch (9518:27): [True: 1.04k, False: 86.0k]
  |  Branch (9518:41): [True: 979, False: 85.1k]
  ------------------
 9519|  1.46M|	if (len + 5 >= size) {
  ------------------
  |  Branch (9519:6): [True: 1.10k, False: 1.46M]
  ------------------
 9520|  1.10k|	    xmlChar *tmp;
 9521|  1.10k|            int newSize;
 9522|       |
 9523|  1.10k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9524|  1.10k|            if (newSize < 0) {
  ------------------
  |  Branch (9524:17): [True: 0, False: 1.10k]
  ------------------
 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.10k|	    tmp = xmlRealloc(buf, newSize);
 9530|  1.10k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9530:10): [True: 1, False: 1.10k]
  ------------------
 9531|      1|		xmlErrMemory(ctxt);
 9532|      1|                goto out;
 9533|      1|	    }
 9534|  1.10k|	    buf = tmp;
 9535|  1.10k|	    size = newSize;
 9536|  1.10k|	}
 9537|  1.46M|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2333|  1.46M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 243k, False: 1.21M]
  |  |  ------------------
  |  | 2334|  1.46M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9538|  1.46M|	r = s;
 9539|  1.46M|	rl = sl;
 9540|  1.46M|	s = cur;
 9541|  1.46M|	sl = l;
 9542|  1.46M|	NEXTL(l);
  ------------------
  |  | 2325|  1.46M|#define NEXTL(l) do {							\
  |  | 2326|  1.46M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 5.58k, False: 1.45M]
  |  |  ------------------
  |  | 2327|  5.58k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  1.45M|    } else ctxt->input->col++;						\
  |  | 2329|  1.46M|    ctxt->input->cur += l;				\
  |  | 2330|  1.46M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 1.46M]
  |  |  ------------------
  ------------------
 9543|  1.46M|	cur = xmlCurrentCharRecover(ctxt, &l);
 9544|  1.46M|    }
 9545|  87.9k|    buf[len] = 0;
 9546|  87.9k|    if (cur != '>') {
  ------------------
  |  Branch (9546:9): [True: 2.87k, False: 85.1k]
  ------------------
 9547|  2.87k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9548|  2.87k|	                     "CData section not finished\n%.50s\n", buf);
 9549|  2.87k|        goto out;
 9550|  2.87k|    }
 9551|  85.1k|    NEXTL(l);
  ------------------
  |  | 2325|  85.1k|#define NEXTL(l) do {							\
  |  | 2326|  85.1k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 85.1k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  85.1k|    } else ctxt->input->col++;						\
  |  | 2329|  85.1k|    ctxt->input->cur += l;				\
  |  | 2330|  85.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 85.1k]
  |  |  ------------------
  ------------------
 9552|       |
 9553|       |    /*
 9554|       |     * OK the buffer is to be consumed as cdata.
 9555|       |     */
 9556|  85.1k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9556:9): [True: 85.1k, False: 0]
  |  Branch (9556:32): [True: 84.8k, False: 303]
  ------------------
 9557|  84.8k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9557:13): [True: 84.8k, False: 0]
  ------------------
 9558|  84.8k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9558:13): [True: 76.8k, False: 7.92k]
  ------------------
 9559|  76.8k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9560|  76.8k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9560:20): [True: 7.92k, False: 0]
  ------------------
 9561|  7.92k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9562|  7.92k|        }
 9563|  84.8k|    }
 9564|       |
 9565|  89.4k|out:
 9566|  89.4k|    xmlFree(buf);
 9567|  89.4k|}
xmlParseElement:
 9707|  8.73k|xmlParseElement(xmlParserCtxt *ctxt) {
 9708|  8.73k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9708:9): [True: 3.56k, False: 5.16k]
  ------------------
 9709|  3.56k|        return;
 9710|       |
 9711|  5.16k|    xmlParseContentInternal(ctxt);
 9712|       |
 9713|  5.16k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9713:9): [True: 508, False: 4.66k]
  ------------------
 9714|    508|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9714:13): [True: 4, False: 504]
  ------------------
 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|    508|        return;
 9722|    508|    }
 9723|       |
 9724|  4.66k|    xmlParseElementEnd(ctxt);
 9725|  4.66k|}
xmlParseVersionNum:
 9905|  12.6k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9906|  12.6k|    xmlChar *buf = NULL;
 9907|  12.6k|    int len = 0;
 9908|  12.6k|    int size = 10;
 9909|  12.6k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9909:21): [True: 4.79k, False: 7.83k]
  ------------------
 9910|  4.79k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.79k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9911|  12.6k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  7.83k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9912|  12.6k|    xmlChar cur;
 9913|       |
 9914|  12.6k|    buf = xmlMalloc(size);
 9915|  12.6k|    if (buf == NULL) {
  ------------------
  |  Branch (9915:9): [True: 3, False: 12.6k]
  ------------------
 9916|      3|	xmlErrMemory(ctxt);
 9917|      3|	return(NULL);
 9918|      3|    }
 9919|  12.6k|    cur = CUR;
  ------------------
  |  | 2262|  12.6k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  12.6k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9920:11): [True: 12.4k, False: 227]
  |  Branch (9920:27): [True: 12.1k, False: 295]
  ------------------
 9921|    522|	xmlFree(buf);
 9922|    522|	return(NULL);
 9923|    522|    }
 9924|  12.1k|    buf[len++] = cur;
 9925|  12.1k|    NEXT;
  ------------------
  |  | 2316|  12.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9926|  12.1k|    cur=CUR;
  ------------------
  |  | 2262|  12.1k|#define CUR (*ctxt->input->cur)
  ------------------
 9927|  12.1k|    if (cur != '.') {
  ------------------
  |  Branch (9927:9): [True: 2.73k, False: 9.36k]
  ------------------
 9928|  2.73k|	xmlFree(buf);
 9929|  2.73k|	return(NULL);
 9930|  2.73k|    }
 9931|  9.36k|    buf[len++] = cur;
 9932|  9.36k|    NEXT;
  ------------------
  |  | 2316|  9.36k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9933|  9.36k|    cur=CUR;
  ------------------
  |  | 2262|  9.36k|#define CUR (*ctxt->input->cur)
  ------------------
 9934|   203k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9934:12): [True: 194k, False: 8.86k]
  |  Branch (9934:28): [True: 193k, False: 503]
  ------------------
 9935|   193k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9935:6): [True: 575, False: 193k]
  ------------------
 9936|    575|	    xmlChar *tmp;
 9937|    575|            int newSize;
 9938|       |
 9939|    575|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9940|    575|            if (newSize < 0) {
  ------------------
  |  Branch (9940:17): [True: 1, False: 574]
  ------------------
 9941|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9942|      1|                xmlFree(buf);
 9943|      1|                return(NULL);
 9944|      1|            }
 9945|    574|	    tmp = xmlRealloc(buf, newSize);
 9946|    574|	    if (tmp == NULL) {
  ------------------
  |  Branch (9946:10): [True: 1, False: 573]
  ------------------
 9947|      1|		xmlErrMemory(ctxt);
 9948|      1|	        xmlFree(buf);
 9949|      1|		return(NULL);
 9950|      1|	    }
 9951|    573|	    buf = tmp;
 9952|    573|            size = newSize;
 9953|    573|	}
 9954|   193k|	buf[len++] = cur;
 9955|   193k|	NEXT;
  ------------------
  |  | 2316|   193k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9956|   193k|	cur=CUR;
  ------------------
  |  | 2262|   193k|#define CUR (*ctxt->input->cur)
  ------------------
 9957|   193k|    }
 9958|  9.36k|    buf[len] = 0;
 9959|  9.36k|    return(buf);
 9960|  9.36k|}
xmlParseVersionInfo:
 9976|   208k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9977|   208k|    xmlChar *version = NULL;
 9978|       |
 9979|   208k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2275|   208k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   416k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   416k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   416k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 16.9k, False: 191k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 16.4k, False: 544]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   208k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 15.5k, False: 900]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 15.2k, False: 240]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 14.4k, False: 816]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 13.9k, False: 481]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 13.6k, False: 350]
  |  |  ------------------
  ------------------
 9980|  13.6k|	SKIP(7);
  ------------------
  |  | 2285|  13.6k|#define SKIP(val) do {							\
  |  | 2286|  13.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 85, False: 13.5k]
  |  |  ------------------
  |  | 2288|  13.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.6k]
  |  |  ------------------
  ------------------
 9981|  13.6k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  13.6k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9982|  13.6k|	if (RAW != '=') {
  ------------------
  |  | 2261|  13.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9982:6): [True: 606, False: 13.0k]
  ------------------
 9983|    606|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9984|    606|	    return(NULL);
 9985|    606|        }
 9986|  13.0k|	NEXT;
  ------------------
  |  | 2316|  13.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9987|  13.0k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  13.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9988|  13.0k|	if (RAW == '"') {
  ------------------
  |  | 2261|  13.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9988:6): [True: 2.93k, False: 10.0k]
  ------------------
 9989|  2.93k|	    NEXT;
  ------------------
  |  | 2316|  2.93k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9990|  2.93k|	    version = xmlParseVersionNum(ctxt);
 9991|  2.93k|	    if (RAW != '"') {
  ------------------
  |  | 2261|  2.93k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9991:10): [True: 372, False: 2.56k]
  ------------------
 9992|    372|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9993|    372|	    } else
 9994|  2.56k|	        NEXT;
  ------------------
  |  | 2316|  2.56k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9995|  10.0k|	} else if (RAW == '\''){
  ------------------
  |  | 2261|  10.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9995:13): [True: 9.69k, False: 386]
  ------------------
 9996|  9.69k|	    NEXT;
  ------------------
  |  | 2316|  9.69k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9997|  9.69k|	    version = xmlParseVersionNum(ctxt);
 9998|  9.69k|	    if (RAW != '\'') {
  ------------------
  |  | 2261|  9.69k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9998:10): [True: 3.40k, False: 6.29k]
  ------------------
 9999|  3.40k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10000|  3.40k|	    } else
10001|  6.29k|	        NEXT;
  ------------------
  |  | 2316|  6.29k|#define NEXT xmlNextChar(ctxt)
  ------------------
10002|  9.69k|	} else {
10003|    386|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10004|    386|	}
10005|  13.0k|    }
10006|   207k|    return(version);
10007|   208k|}
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.05k, False: 4.10k]
  ------------------
10025|  3.05k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  3.05k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
10026|  7.15k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.10k|#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.10k, False: 6.05k]
  |  Branch (10030:26): [True: 822, False: 284]
  ------------------
10031|  6.63k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (10031:10): [True: 6.09k, False: 241]
  |  Branch (10031:26): [True: 5.81k, False: 284]
  ------------------
10032|  6.63k|	buf = xmlMalloc(size);
10033|  6.63k|	if (buf == NULL) {
  ------------------
  |  Branch (10033:6): [True: 3, False: 6.63k]
  ------------------
10034|      3|	    xmlErrMemory(ctxt);
10035|      3|	    return(NULL);
10036|      3|	}
10037|       |
10038|  6.63k|	buf[len++] = cur;
10039|  6.63k|	NEXT;
  ------------------
  |  | 2316|  6.63k|#define NEXT xmlNextChar(ctxt)
  ------------------
10040|  6.63k|	cur = CUR;
  ------------------
  |  | 2262|  6.63k|#define CUR (*ctxt->input->cur)
  ------------------
10041|   298k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10041:10): [True: 53.9k, False: 244k]
  |  Branch (10041:26): [True: 53.6k, False: 321]
  ------------------
10042|   244k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10042:10): [True: 209k, False: 35.6k]
  |  Branch (10042:26): [True: 208k, False: 535]
  ------------------
10043|  36.1k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10043:10): [True: 21.2k, False: 14.9k]
  |  Branch (10043:26): [True: 20.6k, False: 549]
  ------------------
10044|  15.4k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10044:9): [True: 515, False: 14.9k]
  |  Branch (10044:25): [True: 212, False: 14.7k]
  ------------------
10045|   291k|	       (cur == '-')) {
  ------------------
  |  Branch (10045:9): [True: 8.13k, False: 6.62k]
  ------------------
10046|   291k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10046:10): [True: 4.08k, False: 287k]
  ------------------
10047|  4.08k|	        xmlChar *tmp;
10048|  4.08k|                int newSize;
10049|       |
10050|  4.08k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10051|  4.08k|                if (newSize < 0) {
  ------------------
  |  Branch (10051:21): [True: 1, False: 4.08k]
  ------------------
10052|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10053|      1|                    xmlFree(buf);
10054|      1|                    return(NULL);
10055|      1|                }
10056|  4.08k|		tmp = xmlRealloc(buf, newSize);
10057|  4.08k|		if (tmp == NULL) {
  ------------------
  |  Branch (10057:7): [True: 2, False: 4.08k]
  ------------------
10058|      2|		    xmlErrMemory(ctxt);
10059|      2|		    xmlFree(buf);
10060|      2|		    return(NULL);
10061|      2|		}
10062|  4.08k|		buf = tmp;
10063|  4.08k|                size = newSize;
10064|  4.08k|	    }
10065|   291k|	    buf[len++] = cur;
10066|   291k|	    NEXT;
  ------------------
  |  | 2316|   291k|#define NEXT xmlNextChar(ctxt)
  ------------------
10067|   291k|	    cur = CUR;
  ------------------
  |  | 2262|   291k|#define CUR (*ctxt->input->cur)
  ------------------
10068|   291k|        }
10069|  6.62k|	buf[len] = 0;
10070|  6.62k|    } else {
10071|    525|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10072|    525|    }
10073|  7.15k|    return(buf);
10074|  7.15k|}
xmlParseEncodingDecl:
10091|   206k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10092|   206k|    xmlChar *encoding = NULL;
10093|       |
10094|   206k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   206k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10095|   206k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2277|   206k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   413k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   413k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   413k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   413k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 9.99k, False: 196k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 9.66k, False: 330]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   206k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 9.40k, False: 259]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 9.12k, False: 276]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 8.92k, False: 203]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 8.63k, False: 291]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 8.10k, False: 523]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 7.85k, False: 257]
  |  |  ------------------
  ------------------
  |  Branch (10095:9): [True: 198k, False: 7.85k]
  ------------------
10096|   198k|        return(NULL);
10097|       |
10098|  7.85k|    SKIP(8);
  ------------------
  |  | 2285|  7.85k|#define SKIP(val) do {							\
  |  | 2286|  7.85k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.85k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 198, False: 7.65k]
  |  |  ------------------
  |  | 2288|  7.85k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.85k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.85k]
  |  |  ------------------
  ------------------
10099|  7.85k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  7.85k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10100|  7.85k|    if (RAW != '=') {
  ------------------
  |  | 2261|  7.85k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10100:9): [True: 275, False: 7.57k]
  ------------------
10101|    275|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10102|    275|        return(NULL);
10103|    275|    }
10104|  7.57k|    NEXT;
  ------------------
  |  | 2316|  7.57k|#define NEXT xmlNextChar(ctxt)
  ------------------
10105|  7.57k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  7.57k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10106|  7.57k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.57k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10106:9): [True: 1.82k, False: 5.75k]
  ------------------
10107|  1.82k|        NEXT;
  ------------------
  |  | 2316|  1.82k|#define NEXT xmlNextChar(ctxt)
  ------------------
10108|  1.82k|        encoding = xmlParseEncName(ctxt);
10109|  1.82k|        if (RAW != '"') {
  ------------------
  |  | 2261|  1.82k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10109:13): [True: 699, False: 1.12k]
  ------------------
10110|    699|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10111|    699|            xmlFree(encoding);
10112|    699|            return(NULL);
10113|    699|        } else
10114|  1.12k|            NEXT;
  ------------------
  |  | 2316|  1.12k|#define NEXT xmlNextChar(ctxt)
  ------------------
10115|  5.75k|    } else if (RAW == '\''){
  ------------------
  |  | 2261|  5.75k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10115:16): [True: 5.33k, False: 417]
  ------------------
10116|  5.33k|        NEXT;
  ------------------
  |  | 2316|  5.33k|#define NEXT xmlNextChar(ctxt)
  ------------------
10117|  5.33k|        encoding = xmlParseEncName(ctxt);
10118|  5.33k|        if (RAW != '\'') {
  ------------------
  |  | 2261|  5.33k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10118:13): [True: 389, False: 4.94k]
  ------------------
10119|    389|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10120|    389|            xmlFree(encoding);
10121|    389|            return(NULL);
10122|    389|        } else
10123|  4.94k|            NEXT;
  ------------------
  |  | 2316|  4.94k|#define NEXT xmlNextChar(ctxt)
  ------------------
10124|  5.33k|    } else {
10125|    417|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10126|    417|    }
10127|       |
10128|  6.48k|    if (encoding == NULL)
  ------------------
  |  Branch (10128:9): [True: 422, False: 6.06k]
  ------------------
10129|    422|        return(NULL);
10130|       |
10131|  6.06k|    xmlSetDeclaredEncoding(ctxt, encoding);
10132|       |
10133|  6.06k|    return(ctxt->encoding);
10134|  6.48k|}
xmlParseSDDecl:
10168|  1.28k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10169|  1.28k|    int standalone = -2;
10170|       |
10171|  1.28k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.28k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10172|  1.28k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2282|  1.28k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2279|  2.57k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2277|  2.57k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2275|  2.57k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2273|  2.57k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2271|  2.57k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2268|  2.57k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 333, False: 953]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 331, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2269|  1.28k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 330, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 326, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 322, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 316, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2275:42): [True: 315, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2277:46): [True: 313, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2280|  2.57k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2280:5): [True: 312, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2283|  1.28k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2283:5): [True: 308, False: 4]
  |  |  ------------------
  ------------------
10173|    308|	SKIP(10);
  ------------------
  |  | 2285|    308|#define SKIP(val) do {							\
  |  | 2286|    308|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    308|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 307]
  |  |  ------------------
  |  | 2288|    308|        xmlParserGrow(ctxt);						\
  |  | 2289|    308|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 308]
  |  |  ------------------
  ------------------
10174|    308|        SKIP_BLANKS;
  ------------------
  |  | 2312|    308|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10175|    308|	if (RAW != '=') {
  ------------------
  |  | 2261|    308|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10175:6): [True: 1, False: 307]
  ------------------
10176|      1|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10177|      1|	    return(standalone);
10178|      1|        }
10179|    307|	NEXT;
  ------------------
  |  | 2316|    307|#define NEXT xmlNextChar(ctxt)
  ------------------
10180|    307|	SKIP_BLANKS;
  ------------------
  |  | 2312|    307|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10181|    307|        if (RAW == '\''){
  ------------------
  |  | 2261|    307|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10181:13): [True: 288, False: 19]
  ------------------
10182|    288|	    NEXT;
  ------------------
  |  | 2316|    288|#define NEXT xmlNextChar(ctxt)
  ------------------
10183|    288|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|    288|#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: 282]
  |  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|    283|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|    283|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|    280|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10186:17): [True: 280, False: 3]
  |  Branch (10186:33): [True: 279, False: 1]
  ------------------
10187|    279|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|    279|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10187:17): [True: 278, False: 1]
  ------------------
10188|    278|	        standalone = 1;
10189|    278|		SKIP(3);
  ------------------
  |  | 2285|    278|#define SKIP(val) do {							\
  |  | 2286|    278|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    278|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 277]
  |  |  ------------------
  |  | 2288|    278|        xmlParserGrow(ctxt);						\
  |  | 2289|    278|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 278]
  |  |  ------------------
  ------------------
10190|    278|            } else {
10191|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10192|      5|	    }
10193|    288|	    if (RAW != '\'') {
  ------------------
  |  | 2261|    288|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10193:10): [True: 14, False: 274]
  ------------------
10194|     14|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10195|     14|	    } else
10196|    274|	        NEXT;
  ------------------
  |  | 2316|    274|#define NEXT xmlNextChar(ctxt)
  ------------------
10197|    288|	} else if (RAW == '"'){
  ------------------
  |  | 2261|     19|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10197:13): [True: 10, False: 9]
  ------------------
10198|     10|	    NEXT;
  ------------------
  |  | 2316|     10|#define NEXT xmlNextChar(ctxt)
  ------------------
10199|     10|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|     10|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10199:10): [True: 4, False: 6]
  |  Branch (10199:26): [True: 2, False: 2]
  ------------------
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|      8|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|      8|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|      5|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10202:17): [True: 5, False: 3]
  |  Branch (10202:33): [True: 4, False: 1]
  ------------------
10203|      4|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|      4|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10203:17): [True: 3, False: 1]
  ------------------
10204|      3|	        standalone = 1;
10205|      3|                SKIP(3);
  ------------------
  |  | 2285|      3|#define SKIP(val) do {							\
  |  | 2286|      3|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      3|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 2]
  |  |  ------------------
  |  | 2288|      3|        xmlParserGrow(ctxt);						\
  |  | 2289|      3|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3]
  |  |  ------------------
  ------------------
10206|      5|            } else {
10207|      5|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10208|      5|	    }
10209|     10|	    if (RAW != '"') {
  ------------------
  |  | 2261|     10|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10209:10): [True: 8, False: 2]
  ------------------
10210|      8|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10211|      8|	    } else
10212|      2|	        NEXT;
  ------------------
  |  | 2316|      2|#define NEXT xmlNextChar(ctxt)
  ------------------
10213|     10|	} else {
10214|      9|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10215|      9|        }
10216|    307|    }
10217|  1.28k|    return(standalone);
10218|  1.28k|}
xmlParseXMLDecl:
10230|  3.36k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10231|  3.36k|    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.36k|    ctxt->standalone = -2;
10240|       |
10241|       |    /*
10242|       |     * We know that '<?xml' is here.
10243|       |     */
10244|  3.36k|    SKIP(5);
  ------------------
  |  | 2285|  3.36k|#define SKIP(val) do {							\
  |  | 2286|  3.36k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.36k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.36k]
  |  |  ------------------
  |  | 2288|  3.36k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.36k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.36k]
  |  |  ------------------
  ------------------
10245|       |
10246|  3.36k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.36k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.36k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.32k, False: 46]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.36k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 46, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 36, False: 10]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.36k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10247|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10248|      0|	               "Blank needed after '<?xml'\n");
10249|      0|    }
10250|  3.36k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  3.36k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10251|       |
10252|       |    /*
10253|       |     * We must have the VersionInfo here.
10254|       |     */
10255|  3.36k|    version = xmlParseVersionInfo(ctxt);
10256|  3.36k|    if (version == NULL) {
  ------------------
  |  Branch (10256:9): [True: 874, False: 2.49k]
  ------------------
10257|    874|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10258|  2.49k|    } else {
10259|  2.49k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.49k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10259:6): [True: 226, False: 2.26k]
  ------------------
10260|       |	    /*
10261|       |	     * Changed here for XML-1.0 5th edition
10262|       |	     */
10263|    226|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10263:10): [True: 23, False: 203]
  ------------------
10264|     23|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10265|     23|			          "Unsupported version '%s'\n",
10266|     23|			          version);
10267|    203|	    } else {
10268|    203|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10268:14): [True: 167, False: 36]
  |  Branch (10268:37): [True: 167, False: 0]
  ------------------
10269|    167|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10270|    167|		                  "Unsupported version '%s'\n",
10271|    167|				  version, NULL);
10272|    167|		} else {
10273|     36|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10274|     36|				      "Unsupported version '%s'\n",
10275|     36|				      version);
10276|     36|		}
10277|    203|	    }
10278|    226|	}
10279|  2.49k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10279:6): [True: 0, False: 2.49k]
  ------------------
10280|      0|	    xmlFree(ctxt->version);
10281|  2.49k|	ctxt->version = version;
10282|  2.49k|    }
10283|       |
10284|       |    /*
10285|       |     * We may have the encoding declaration
10286|       |     */
10287|  3.36k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.36k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.36k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.07k, False: 2.29k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.36k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.27k, False: 20]
  |  |  |  |  |  Branch (91:23): [True: 8, False: 2.26k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.36k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 8, False: 2.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10288|  2.27k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  2.27k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  1.38k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10288:13): [True: 1.38k, False: 895]
  |  Branch (10288:29): [True: 1.36k, False: 15]
  ------------------
10289|  1.36k|	    SKIP(2);
  ------------------
  |  | 2285|  1.36k|#define SKIP(val) do {							\
  |  | 2286|  1.36k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.36k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1.36k]
  |  |  ------------------
  |  | 2288|  1.36k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.36k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.36k]
  |  |  ------------------
  ------------------
10290|  1.36k|	    return;
10291|  1.36k|	}
10292|    910|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10293|    910|    }
10294|  2.00k|    xmlParseEncodingDecl(ctxt);
10295|       |
10296|       |    /*
10297|       |     * We may have the standalone status.
10298|       |     */
10299|  2.00k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    842|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    842|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 36, False: 806]
  |  |  |  |  ------------------
  |  |  |  |   91|    842|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 795, False: 11]
  |  |  |  |  |  Branch (91:23): [True: 14, False: 781]
  |  |  |  |  ------------------
  |  |  |  |   92|    842|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 4, False: 788]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10299:9): [True: 842, False: 1.15k]
  ------------------
10300|    788|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|    788|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    728|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10300:13): [True: 728, False: 60]
  |  Branch (10300:29): [True: 715, False: 13]
  ------------------
10301|    715|	    SKIP(2);
  ------------------
  |  | 2285|    715|#define SKIP(val) do {							\
  |  | 2286|    715|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    715|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 2, False: 713]
  |  |  ------------------
  |  | 2288|    715|        xmlParserGrow(ctxt);						\
  |  | 2289|    715|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 715]
  |  |  ------------------
  ------------------
10302|    715|	    return;
10303|    715|	}
10304|     73|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10305|     73|    }
10306|       |
10307|       |    /*
10308|       |     * We can grow the input buffer freely at that point
10309|       |     */
10310|  1.28k|    GROW;
  ------------------
  |  | 2308|  1.28k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.28k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.28k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 63, False: 1.22k]
  |  |  ------------------
  |  | 2309|  1.28k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     63|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 39, False: 24]
  |  |  ------------------
  |  | 2310|  1.28k|	xmlParserGrow(ctxt);
  ------------------
10311|       |
10312|  1.28k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.28k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10313|  1.28k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10314|       |
10315|  1.28k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.28k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10316|  1.28k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  1.28k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    364|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10316:9): [True: 364, False: 922]
  |  Branch (10316:25): [True: 330, False: 34]
  ------------------
10317|    330|        SKIP(2);
  ------------------
  |  | 2285|    330|#define SKIP(val) do {							\
  |  | 2286|    330|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    330|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 329]
  |  |  ------------------
  |  | 2288|    330|        xmlParserGrow(ctxt);						\
  |  | 2289|    330|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 330]
  |  |  ------------------
  ------------------
10318|    956|    } else if (RAW == '>') {
  ------------------
  |  | 2261|    956|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10318:16): [True: 21, False: 935]
  ------------------
10319|       |        /* Deprecated old WD ... */
10320|     21|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10321|     21|	NEXT;
  ------------------
  |  | 2316|     21|#define NEXT xmlNextChar(ctxt)
  ------------------
10322|    935|    } else {
10323|    935|        int c;
10324|       |
10325|    935|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10326|   181k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   181k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10326:16): [True: 181k, False: 46]
  ------------------
10327|   181k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   181k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10327:16): [True: 181k, False: 415]
  ------------------
10328|   181k|            NEXT;
  ------------------
  |  | 2316|   181k|#define NEXT xmlNextChar(ctxt)
  ------------------
10329|   181k|            if (c == '>')
  ------------------
  |  Branch (10329:17): [True: 474, False: 181k]
  ------------------
10330|    474|                break;
10331|   181k|        }
10332|    935|    }
10333|  1.28k|}
xmlParseMisc:
10373|  20.0k|xmlParseMisc(xmlParserCtxt *ctxt) {
10374|  22.1k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  22.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10374:12): [True: 22.0k, False: 184]
  ------------------
10375|  22.0k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  22.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10376|  22.0k|        GROW;
  ------------------
  |  | 2308|  22.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  22.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  22.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 22.0k, False: 0]
  |  |  ------------------
  |  | 2309|  22.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  22.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 17.4k, False: 4.57k]
  |  |  ------------------
  |  | 2310|  22.0k|	xmlParserGrow(ctxt);
  ------------------
10377|  22.0k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|  22.0k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|  13.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10377:13): [True: 13.8k, False: 8.19k]
  |  Branch (10377:29): [True: 977, False: 12.8k]
  ------------------
10378|    977|	    xmlParsePI(ctxt);
10379|  21.0k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2268|  21.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 12.8k, False: 8.19k]
  |  |  |  Branch (2268:41): [True: 3.73k, False: 9.10k]
  |  |  ------------------
  |  | 2269|  21.0k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 1.11k, False: 2.61k]
  |  |  |  Branch (2269:41): [True: 1.11k, False: 2]
  |  |  ------------------
  ------------------
10380|  1.11k|	    xmlParseComment(ctxt);
10381|  19.9k|        } else {
10382|  19.9k|            break;
10383|  19.9k|        }
10384|  22.0k|    }
10385|  20.0k|}
xmlParseDocument:
10418|  8.83k|xmlParseDocument(xmlParserCtxt *ctxt) {
10419|  8.83k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10419:9): [True: 0, False: 8.83k]
  |  Branch (10419:27): [True: 0, False: 8.83k]
  ------------------
10420|      0|        return(-1);
10421|       |
10422|  8.83k|    GROW;
  ------------------
  |  | 2308|  8.83k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.83k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.83k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  | 2309|  8.83k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.83k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.35k, False: 2.47k]
  |  |  ------------------
  |  | 2310|  8.83k|	xmlParserGrow(ctxt);
  ------------------
10423|       |
10424|       |    /*
10425|       |     * SAX: detecting the level.
10426|       |     */
10427|  8.83k|    xmlCtxtInitializeLate(ctxt);
10428|       |
10429|  8.83k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10429:9): [True: 8.83k, False: 0]
  |  Branch (10429:24): [True: 8.83k, False: 0]
  ------------------
10430|  8.83k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10431|  8.83k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10432|  8.83k|    }
10433|       |
10434|  8.83k|    xmlDetectEncoding(ctxt);
10435|       |
10436|  8.83k|    if (CUR == 0) {
  ------------------
  |  | 2262|  8.83k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10436:9): [True: 3, False: 8.83k]
  ------------------
10437|      3|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10438|      3|	return(-1);
10439|      3|    }
10440|       |
10441|  8.83k|    GROW;
  ------------------
  |  | 2308|  8.83k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.83k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.83k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  | 2309|  8.83k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.83k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.35k, False: 2.47k]
  |  |  ------------------
  |  | 2310|  8.83k|	xmlParserGrow(ctxt);
  ------------------
10442|  8.83k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|  8.83k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  17.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 8.74k, False: 89]
  |  |  |  |  |  Branch (2268:41): [True: 679, False: 8.06k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  8.83k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 385, False: 294]
  |  |  |  |  |  Branch (2269:41): [True: 197, False: 188]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 191, False: 6]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    191|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    191|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 176, False: 15]
  |  |  |  |  ------------------
  |  |  |  |   91|    191|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 14, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 8, False: 6]
  |  |  |  |  ------------------
  |  |  |  |   92|    191|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 2, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10443|       |
10444|       |	/*
10445|       |	 * Note that we will switch encoding on the fly.
10446|       |	 */
10447|    186|	xmlParseXMLDecl(ctxt);
10448|    186|	SKIP_BLANKS;
  ------------------
  |  | 2312|    186|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10449|  8.64k|    } else {
10450|  8.64k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  8.64k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10451|  8.64k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10451:13): [True: 1, False: 8.64k]
  ------------------
10452|      1|            xmlErrMemory(ctxt);
10453|      1|            return(-1);
10454|      1|        }
10455|  8.64k|    }
10456|  8.83k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10456:9): [True: 8.83k, False: 0]
  |  Branch (10456:24): [True: 8.83k, False: 0]
  |  Branch (10456:54): [True: 8.77k, False: 55]
  ------------------
10457|  8.77k|        ctxt->sax->startDocument(ctxt->userData);
10458|  8.83k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10458:9): [True: 8.77k, False: 59]
  |  Branch (10458:34): [True: 8.77k, False: 0]
  ------------------
10459|  8.77k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10459:9): [True: 8.77k, False: 0]
  |  Branch (10459:39): [True: 0, False: 8.77k]
  ------------------
10460|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10461|      0|    }
10462|       |
10463|       |    /*
10464|       |     * The Misc part of the Prolog
10465|       |     */
10466|  8.83k|    xmlParseMisc(ctxt);
10467|       |
10468|       |    /*
10469|       |     * Then possibly doc type declaration(s) and more Misc
10470|       |     * (doctypedecl Misc*)?
10471|       |     */
10472|  8.83k|    GROW;
  ------------------
  |  | 2308|  8.83k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.83k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.83k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  | 2309|  8.83k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.83k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.38k, False: 2.44k]
  |  |  ------------------
  |  | 2310|  8.83k|	xmlParserGrow(ctxt);
  ------------------
10473|  8.83k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2279|  8.83k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  17.6k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  17.6k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  17.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  17.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  17.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 8.82k, False: 12]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.58k, False: 6.24k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  8.83k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.56k, False: 11]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.56k, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.55k, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.54k, False: 11]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 2.53k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 2.53k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  8.83k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 2.53k, False: 3]
  |  |  ------------------
  ------------------
10474|       |
10475|  2.53k|	ctxt->inSubset = 1;
10476|  2.53k|	xmlParseDocTypeDecl(ctxt);
10477|  2.53k|	if (RAW == '[') {
  ------------------
  |  | 2261|  2.53k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10477:6): [True: 843, False: 1.69k]
  ------------------
10478|    843|	    xmlParseInternalSubset(ctxt);
10479|  1.69k|	} else if (RAW == '>') {
  ------------------
  |  | 2261|  1.69k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10479:13): [True: 1.65k, False: 37]
  ------------------
10480|  1.65k|            NEXT;
  ------------------
  |  | 2316|  1.65k|#define NEXT xmlNextChar(ctxt)
  ------------------
10481|  1.65k|        }
10482|       |
10483|       |	/*
10484|       |	 * Create and update the external subset.
10485|       |	 */
10486|  2.53k|	ctxt->inSubset = 2;
10487|  2.53k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10487:6): [True: 2.53k, False: 0]
  |  Branch (10487:29): [True: 2.53k, False: 0]
  ------------------
10488|  2.53k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10488:6): [True: 2.44k, False: 89]
  ------------------
10489|  2.44k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10490|  2.44k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10491|  2.53k|	ctxt->inSubset = 0;
10492|       |
10493|  2.53k|        xmlCleanSpecialAttr(ctxt);
10494|       |
10495|  2.53k|	xmlParseMisc(ctxt);
10496|  2.53k|    }
10497|       |
10498|       |    /*
10499|       |     * Time to start parsing the tree itself
10500|       |     */
10501|  8.83k|    GROW;
  ------------------
  |  | 2308|  8.83k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.83k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.83k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.83k, False: 0]
  |  |  ------------------
  |  | 2309|  8.83k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.83k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.55k, False: 2.28k]
  |  |  ------------------
  |  | 2310|  8.83k|	xmlParserGrow(ctxt);
  ------------------
10502|  8.83k|    if (RAW != '<') {
  ------------------
  |  | 2261|  8.83k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10502:9): [True: 100, False: 8.73k]
  ------------------
10503|    100|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10503:13): [True: 6, False: 94]
  ------------------
10504|      6|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10505|      6|                           "Start tag expected, '<' not found\n");
10506|  8.73k|    } else {
10507|  8.73k|	xmlParseElement(ctxt);
10508|       |
10509|       |	/*
10510|       |	 * The Misc part at the end
10511|       |	 */
10512|  8.73k|	xmlParseMisc(ctxt);
10513|       |
10514|  8.73k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10515|  8.73k|    }
10516|       |
10517|  8.83k|    ctxt->instate = XML_PARSER_EOF;
10518|  8.83k|    xmlFinishDocument(ctxt);
10519|       |
10520|  8.83k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10520:9): [True: 958, False: 7.87k]
  ------------------
10521|    958|	ctxt->valid = 0;
10522|    958|	return(-1);
10523|    958|    }
10524|       |
10525|  7.87k|    return(0);
10526|  8.83k|}
xmlParseChunk:
11275|   451k|              int terminate) {
11276|   451k|    size_t curBase;
11277|   451k|    size_t maxLength;
11278|   451k|    size_t pos;
11279|   451k|    int end_in_lf = 0;
11280|   451k|    int res;
11281|       |
11282|   451k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11282:9): [True: 0, False: 451k]
  |  Branch (11282:27): [True: 0, False: 451k]
  ------------------
11283|      0|        return(XML_ERR_ARGUMENT);
11284|   451k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11284:9): [True: 0, False: 451k]
  |  Branch (11284:28): [True: 0, False: 0]
  ------------------
11285|      0|        return(XML_ERR_ARGUMENT);
11286|   451k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11286:9): [True: 0, False: 451k]
  |  Branch (11286:34): [True: 0, False: 451k]
  ------------------
11287|      0|        return(XML_ERR_ARGUMENT);
11288|   451k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11288:9): [True: 2.65k, False: 448k]
  ------------------
11289|  2.65k|        return(ctxt->errNo);
11290|       |
11291|   448k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   448k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11292|   448k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11292:9): [True: 41.0k, False: 407k]
  ------------------
11293|  41.0k|        xmlCtxtInitializeLate(ctxt);
11294|   448k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11294:9): [True: 417k, False: 30.8k]
  |  Branch (11294:23): [True: 417k, False: 0]
  |  Branch (11294:42): [True: 417k, False: 0]
  ------------------
11295|   417k|        (chunk[size - 1] == '\r')) {
  ------------------
  |  Branch (11295:9): [True: 2.06k, False: 415k]
  ------------------
11296|  2.06k|	end_in_lf = 1;
11297|  2.06k|	size--;
11298|  2.06k|    }
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|   448k|    pos = ctxt->input->cur - ctxt->input->base;
11305|   448k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11306|   448k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11307|   448k|    if (res < 0) {
  ------------------
  |  Branch (11307:9): [True: 224, False: 448k]
  ------------------
11308|    224|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11309|    224|        return(ctxt->errNo);
11310|    224|    }
11311|       |
11312|   448k|    xmlParseTryOrFinish(ctxt, terminate);
11313|       |
11314|   448k|    curBase = ctxt->input->cur - ctxt->input->base;
11315|   448k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11315:17): [True: 216k, False: 231k]
  ------------------
11316|   216k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   216k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11317|   448k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   680k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11318|   448k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11318:9): [True: 0, False: 448k]
  ------------------
11319|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11320|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11321|      0|    }
11322|       |
11323|   448k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11323:9): [True: 86.4k, False: 361k]
  |  Branch (11323:40): [True: 12.2k, False: 74.1k]
  ------------------
11324|  12.2k|        return(ctxt->errNo);
11325|       |
11326|   435k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11326:9): [True: 2.05k, False: 433k]
  ------------------
11327|  2.05k|	pos = ctxt->input->cur - ctxt->input->base;
11328|  2.05k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11329|  2.05k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11330|  2.05k|        if (res < 0) {
  ------------------
  |  Branch (11330:13): [True: 3, False: 2.05k]
  ------------------
11331|      3|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11332|      3|            return(ctxt->errNo);
11333|      3|        }
11334|  2.05k|    }
11335|   435k|    if (terminate) {
  ------------------
  |  Branch (11335:9): [True: 21.0k, False: 414k]
  ------------------
11336|       |	/*
11337|       |	 * Check for termination
11338|       |	 */
11339|  21.0k|        if ((ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (11339:13): [True: 11.7k, False: 9.28k]
  ------------------
11340|  11.7k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11340:13): [True: 5.83k, False: 5.91k]
  ------------------
11341|  5.83k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11341:17): [True: 4.27k, False: 1.56k]
  ------------------
11342|  4.27k|                const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
11343|  4.27k|                int line = ctxt->pushTab[ctxt->nameNr - 1].line;
11344|  4.27k|                xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
11345|  4.27k|                        "Premature end of data in tag %s line %d\n",
11346|  4.27k|                        name, line, NULL);
11347|  4.27k|            } else if (ctxt->instate == XML_PARSER_START) {
  ------------------
  |  Branch (11347:24): [True: 34, False: 1.53k]
  ------------------
11348|     34|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11349|  1.53k|            } else {
11350|  1.53k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11351|  1.53k|                               "Start tag expected, '<' not found\n");
11352|  1.53k|            }
11353|  15.2k|        } else {
11354|  15.2k|            xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
11355|  15.2k|        }
11356|  21.0k|	if (ctxt->instate != XML_PARSER_EOF) {
  ------------------
  |  Branch (11356:6): [True: 11.4k, False: 9.54k]
  ------------------
11357|  11.4k|            ctxt->instate = XML_PARSER_EOF;
11358|  11.4k|            xmlFinishDocument(ctxt);
11359|  11.4k|	}
11360|  21.0k|    }
11361|   435k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11361:9): [True: 22.0k, False: 413k]
  ------------------
11362|  22.0k|	return((xmlParserErrors) ctxt->errNo);
11363|   413k|    else
11364|   413k|        return(0);
11365|   435k|}
xmlCreatePushParserCtxt:
11396|  40.8k|                        const char *chunk, int size, const char *filename) {
11397|  40.8k|    xmlParserCtxtPtr ctxt;
11398|  40.8k|    xmlParserInputPtr input;
11399|       |
11400|  40.8k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11401|  40.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (11401:9): [True: 28, False: 40.8k]
  ------------------
11402|     28|	return(NULL);
11403|       |
11404|  40.8k|    ctxt->options &= ~XML_PARSE_NODICT;
11405|  40.8k|    ctxt->dictNames = 1;
11406|       |
11407|  40.8k|    input = xmlNewPushInput(filename, chunk, size);
11408|  40.8k|    if (input == NULL) {
  ------------------
  |  Branch (11408:9): [True: 10, False: 40.8k]
  ------------------
11409|     10|	xmlFreeParserCtxt(ctxt);
11410|     10|	return(NULL);
11411|     10|    }
11412|  40.8k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11412:9): [True: 0, False: 40.8k]
  ------------------
11413|      0|        xmlFreeInputStream(input);
11414|      0|        xmlFreeParserCtxt(ctxt);
11415|      0|        return(NULL);
11416|      0|    }
11417|       |
11418|  40.8k|    return(ctxt);
11419|  40.8k|}
xmlStopParser:
11428|  43.1k|xmlStopParser(xmlParserCtxt *ctxt) {
11429|  43.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (11429:9): [True: 0, False: 43.1k]
  ------------------
11430|      0|        return;
11431|       |
11432|       |    /* This stops the parser */
11433|  43.1k|    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|  43.1k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11441:9): [True: 3.73k, False: 39.4k]
  ------------------
11442|  3.73k|        ctxt->errNo = XML_ERR_USER_STOP;
11443|  3.73k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11444|  3.73k|        ctxt->wellFormed = 0;
11445|  3.73k|    }
11446|  43.1k|}
xmlCtxtUseOptions:
13304|  50.6k|{
13305|  50.6k|    int keepMask;
13306|       |
13307|  50.6k|#ifdef LIBXML_HTML_ENABLED
13308|  50.6k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13308:9): [True: 50.6k, False: 0]
  |  Branch (13308:27): [True: 0, False: 50.6k]
  ------------------
13309|      0|        return(htmlCtxtUseOptions(ctxt, options));
13310|  50.6k|#endif
13311|       |
13312|       |    /*
13313|       |     * For historic reasons, some options can only be enabled.
13314|       |     */
13315|  50.6k|    keepMask = XML_PARSE_NOERROR |
13316|  50.6k|               XML_PARSE_NOWARNING |
13317|  50.6k|               XML_PARSE_NONET |
13318|  50.6k|               XML_PARSE_NSCLEAN |
13319|  50.6k|               XML_PARSE_NOCDATA |
13320|  50.6k|               XML_PARSE_COMPACT |
13321|  50.6k|               XML_PARSE_OLD10 |
13322|  50.6k|               XML_PARSE_HUGE |
13323|  50.6k|               XML_PARSE_OLDSAX |
13324|  50.6k|               XML_PARSE_IGNORE_ENC |
13325|  50.6k|               XML_PARSE_BIG_LINES;
13326|       |
13327|  50.6k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13328|  50.6k|}
parser.c:xmlParserNsLookup:
 1525|  2.06M|                  xmlParserNsBucket **bucketPtr) {
 1526|  2.06M|    xmlParserNsBucket *bucket, *tombstone;
 1527|  2.06M|    unsigned index, hashValue;
 1528|       |
 1529|  2.06M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1529:9): [True: 751k, False: 1.31M]
  ------------------
 1530|   751k|        return(ctxt->nsdb->defaultNsIndex);
 1531|       |
 1532|  1.31M|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1532:9): [True: 34.3k, False: 1.28M]
  ------------------
 1533|  34.3k|        return(INT_MAX);
 1534|       |
 1535|  1.28M|    hashValue = prefix->hashValue;
 1536|  1.28M|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1537|  1.28M|    bucket = &ctxt->nsdb->hash[index];
 1538|  1.28M|    tombstone = NULL;
 1539|       |
 1540|  1.86M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1540:12): [True: 1.59M, False: 269k]
  ------------------
 1541|  1.59M|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1541:13): [True: 154k, False: 1.43M]
  ------------------
 1542|   154k|            if (tombstone == NULL)
  ------------------
  |  Branch (1542:17): [True: 139k, False: 15.2k]
  ------------------
 1543|   139k|                tombstone = bucket;
 1544|  1.43M|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1544:20): [True: 1.01M, False: 424k]
  ------------------
 1545|  1.01M|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1545:17): [True: 1.01M, False: 0]
  ------------------
 1546|  1.01M|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1546:21): [True: 643k, False: 370k]
  ------------------
 1547|   643k|                    *bucketPtr = bucket;
 1548|  1.01M|                return(bucket->index);
 1549|  1.01M|            }
 1550|  1.01M|        }
 1551|       |
 1552|   578k|        index++;
 1553|   578k|        bucket++;
 1554|   578k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1554:13): [True: 153k, False: 425k]
  ------------------
 1555|   153k|            index = 0;
 1556|   153k|            bucket = ctxt->nsdb->hash;
 1557|   153k|        }
 1558|   578k|    }
 1559|       |
 1560|   269k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1560:9): [True: 126k, False: 143k]
  ------------------
 1561|   126k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1561:22): [True: 122k, False: 3.82k]
  ------------------
 1562|       |    return(INT_MAX);
 1563|  1.28M|}
parser.c:xmlFatalErrMsg:
  259|  21.8M|{
  260|  21.8M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  21.8M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  21.8M|}
parser.c:xmlErrMemory:
  224|    453|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    453|    xmlCtxtErrMemory(ctxt);
  226|    453|}
parser.c:xmlFatalErrMsgInt:
  313|  7.06M|{
  314|  7.06M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.06M|               NULL, NULL, NULL, val, msg, val);
  316|  7.06M|}
parser.c:xmlIsNameChar:
 3068|  25.4M|xmlIsNameChar(int c, int old10) {
 3069|  25.4M|    if (!old10)
  ------------------
  |  Branch (3069:9): [True: 15.6M, False: 9.82M]
  ------------------
 3070|  15.6M|        return(xmlIsNameCharNew(c));
 3071|  9.82M|    else
 3072|  9.82M|        return(xmlIsNameCharOld(c));
 3073|  25.4M|}
parser.c:xmlIsNameCharNew:
 3010|  15.6M|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|  15.6M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3015:9): [True: 15.5M, False: 64.0k]
  |  Branch (3015:23): [True: 15.5M, False: 22.5k]
  |  Branch (3015:37): [True: 15.5M, False: 11.0k]
  ------------------
 3016|  15.5M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (3016:11): [True: 9.28M, False: 6.23M]
  |  Branch (3016:25): [True: 2.45M, False: 6.83M]
  ------------------
 3017|  13.0M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (3017:11): [True: 10.8M, False: 2.24M]
  |  Branch (3017:25): [True: 3.96M, False: 6.86M]
  ------------------
 3018|  9.10M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (3018:11): [True: 8.88M, False: 224k]
  |  Branch (3018:25): [True: 772k, False: 8.10M]
  ------------------
 3019|  8.33M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3019:10): [True: 17.4k, False: 8.31M]
  |  Branch (3019:24): [True: 17.9k, False: 8.29M]
  ------------------
 3020|  8.29M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (3020:10): [True: 71.8k, False: 8.22M]
  |  Branch (3020:24): [True: 34.5k, False: 8.19M]
  |  Branch (3020:38): [True: 379, False: 8.19M]
  ------------------
 3021|  8.19M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (3021:11): [True: 6.82M, False: 1.36M]
  |  Branch (3021:26): [True: 351k, False: 6.47M]
  ------------------
 3022|  7.83M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (3022:11): [True: 6.47M, False: 1.36M]
  |  Branch (3022:26): [True: 1.43k, False: 6.47M]
  ------------------
 3023|  7.83M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (3023:11): [True: 6.47M, False: 1.36M]
  |  Branch (3023:26): [True: 8.90k, False: 6.46M]
  ------------------
 3024|  7.82M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (3024:11): [True: 6.46M, False: 1.36M]
  |  Branch (3024:27): [True: 1.63k, False: 6.46M]
  ------------------
 3025|  7.82M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (3025:11): [True: 6.46M, False: 1.36M]
  |  Branch (3025:27): [True: 301, False: 6.45M]
  ------------------
 3026|  7.82M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (3026:11): [True: 6.45M, False: 1.36M]
  |  Branch (3026:27): [True: 3.92M, False: 2.53M]
  ------------------
 3027|  3.90M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (3027:11): [True: 2.53M, False: 1.36M]
  |  Branch (3027:28): [True: 297, False: 2.53M]
  ------------------
 3028|  3.90M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (3028:11): [True: 2.53M, False: 1.36M]
  |  Branch (3028:28): [True: 218, False: 2.53M]
  ------------------
 3029|  3.90M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (3029:11): [True: 2.53M, False: 1.36M]
  |  Branch (3029:28): [True: 2.80k, False: 2.53M]
  ------------------
 3030|  3.90M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3030:11): [True: 2.53M, False: 1.36M]
  |  Branch (3030:28): [True: 4.40k, False: 2.52M]
  ------------------
 3031|  3.89M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3031:11): [True: 2.52M, False: 1.36M]
  |  Branch (3031:28): [True: 69.7k, False: 2.45M]
  ------------------
 3032|  3.82M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3032:11): [True: 2.45M, False: 1.36M]
  |  Branch (3032:28): [True: 592, False: 2.45M]
  ------------------
 3033|  3.82M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3033:11): [True: 2.45M, False: 1.36M]
  |  Branch (3033:28): [True: 2.44M, False: 10.7k]
  ------------------
 3034|  1.38M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3034:11): [True: 10.6k, False: 1.36M]
  |  Branch (3034:29): [True: 2.04k, False: 8.64k]
  ------------------
 3035|  14.1M|         return(1);
 3036|  1.47M|    return(0);
 3037|  15.6M|}
parser.c:xmlIsNameCharOld:
 3048|  9.82M|xmlIsNameCharOld(int c) {
 3049|  9.82M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3049:9): [True: 9.81M, False: 4.11k]
  |  Branch (3049:23): [True: 9.81M, False: 1.33k]
  |  Branch (3049:37): [True: 9.81M, False: 667]
  ------------------
 3050|  9.81M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  9.81M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  9.81M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  19.6M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 7.28M, False: 2.53M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 7.33M, False: 2.47M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  19.6M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  7.33M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 4.83M, False: 2.49M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 160k, False: 4.67M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  7.33M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 4.67M, False: 2.50M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.36M, False: 3.30M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  7.33M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 3.28M, False: 2.51M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 3.27M, False: 8.22k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  7.33M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 8.21k, False: 2.51M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 1.66k, False: 6.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  7.33M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 6.55k, False: 2.51M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  19.6M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  2.53M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  2.53M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.12k, False: 2.53M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 2.51M, False: 13.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  2.53M|				 0 :\
  |  |  |  |  |  |  171|  2.53M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.8k, False: 2.69k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 598, False: 10.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.5k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 198, False: 12.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.5k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.6k, False: 2.10k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 329, False: 10.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  2.53M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  2.53M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 2.51M, False: 12.4k]
  |  |  |  |  ------------------
  |  |  |  |  145|  2.53M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  2.51M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 2.49M, False: 22.4k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 464k, False: 2.03M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  2.53M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3050:28): [True: 464k, False: 2.06M]
  ------------------
 3051|  2.06M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3051:10): [True: 684, False: 2.06M]
  |  Branch (3051:24): [True: 2.06k, False: 2.06M]
  ------------------
 3052|  2.06M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3052:10): [True: 2.58k, False: 2.06M]
  |  Branch (3052:24): [True: 8.52k, False: 2.05M]
  ------------------
 3053|  2.05M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  2.05M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  2.05M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 2.04M, False: 12.1k]
  |  |  |  |  ------------------
  |  |  |  |  129|  2.05M|				 0 : \
  |  |  |  |  130|  2.05M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3053:10): [True: 1.05k, False: 2.05M]
  ------------------
 3054|  2.05M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  2.05M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  2.05M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 2.04M, False: 11.1k]
  |  |  |  |  ------------------
  |  |  |  |  161|  2.05M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  2.04M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  2.05M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3054:10): [True: 16.8k, False: 2.03M]
  ------------------
 3055|  7.77M|        return(1);
 3056|  2.04M|    return(0);
 3057|  9.82M|}
parser.c:xmlIsNameStartChar:
 3060|  3.98M|xmlIsNameStartChar(int c, int old10) {
 3061|  3.98M|    if (!old10)
  ------------------
  |  Branch (3061:9): [True: 1.72M, False: 2.25M]
  ------------------
 3062|  1.72M|        return(xmlIsNameStartCharNew(c));
 3063|  2.25M|    else
 3064|  2.25M|        return(xmlIsNameStartCharOld(c));
 3065|  3.98M|}
parser.c:xmlIsNameStartCharNew:
 2984|  1.72M|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.72M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2989:9): [True: 1.72M, False: 3.51k]
  |  Branch (2989:23): [True: 1.72M, False: 2.68k]
  |  Branch (2989:37): [True: 1.71M, False: 2.56k]
  ------------------
 2990|  1.71M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2990:11): [True: 1.43M, False: 286k]
  |  Branch (2990:25): [True: 1.39M, False: 41.2k]
  ------------------
 2991|   327k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2991:11): [True: 106k, False: 221k]
  |  Branch (2991:25): [True: 55.7k, False: 50.5k]
  ------------------
 2992|   271k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2992:10): [True: 5.44k, False: 266k]
  |  Branch (2992:24): [True: 3.23k, False: 262k]
  ------------------
 2993|   262k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2993:11): [True: 38.1k, False: 224k]
  |  Branch (2993:26): [True: 593, False: 37.5k]
  ------------------
 2994|   262k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2994:11): [True: 37.5k, False: 224k]
  |  Branch (2994:26): [True: 1.15k, False: 36.3k]
  ------------------
 2995|   261k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2995:11): [True: 36.3k, False: 224k]
  |  Branch (2995:26): [True: 1.53k, False: 34.8k]
  ------------------
 2996|   259k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2996:11): [True: 34.8k, False: 224k]
  |  Branch (2996:27): [True: 267, False: 34.5k]
  ------------------
 2997|   259k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2997:11): [True: 34.5k, False: 224k]
  |  Branch (2997:27): [True: 3.55k, False: 30.9k]
  ------------------
 2998|   255k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2998:11): [True: 30.9k, False: 224k]
  |  Branch (2998:28): [True: 358, False: 30.6k]
  ------------------
 2999|   255k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2999:11): [True: 29.3k, False: 226k]
  |  Branch (2999:28): [True: 241, False: 29.1k]
  ------------------
 3000|   255k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3000:11): [True: 29.0k, False: 226k]
  |  Branch (3000:28): [True: 428, False: 28.6k]
  ------------------
 3001|   254k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3001:11): [True: 28.6k, False: 226k]
  |  Branch (3001:28): [True: 2.75k, False: 25.9k]
  ------------------
 3002|   252k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3002:11): [True: 25.8k, False: 226k]
  |  Branch (3002:28): [True: 250, False: 25.6k]
  ------------------
 3003|   251k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3003:11): [True: 25.6k, False: 226k]
  |  Branch (3003:28): [True: 8.63k, False: 16.9k]
  ------------------
 3004|   243k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3004:11): [True: 16.9k, False: 226k]
  |  Branch (3004:29): [True: 1.38k, False: 15.6k]
  ------------------
 3005|  1.47M|        return(1);
 3006|   250k|    return(0);
 3007|  1.72M|}
parser.c:xmlIsNameStartCharOld:
 3040|  2.25M|xmlIsNameStartCharOld(int c) {
 3041|  2.25M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3041:9): [True: 2.25M, False: 3.77k]
  |  Branch (3041:23): [True: 2.25M, False: 4.23k]
  |  Branch (3041:37): [True: 2.24M, False: 2.88k]
  ------------------
 3042|  2.24M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  4.49M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  2.24M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  4.49M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 2.02M, False: 217k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 2.22M, False: 17.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  4.49M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  2.22M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 2.03M, False: 197k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 4.73k, False: 2.02M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  2.22M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 2.02M, False: 199k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 2.02M, False: 3.21k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  2.22M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.70k, False: 201k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 375, False: 1.33k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  2.22M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 1.33k, False: 201k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 612, False: 718]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  2.22M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 718, False: 201k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.49M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|   217k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|   217k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.18k, False: 216k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 201k, False: 16.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|   217k|				 0 :\
  |  |  |  |  |  |  171|   217k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 13.5k, False: 3.12k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 677, False: 12.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  16.6k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 198, False: 15.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  16.6k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 13.2k, False: 2.59k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 311, False: 12.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3042:27): [True: 472, False: 216k]
  |  Branch (3042:41): [True: 3.31k, False: 212k]
  ------------------
 3043|  2.03M|        return(1);
 3044|   223k|    return(0);
 3045|  2.25M|}
parser.c:xmlParseNameComplex:
 3123|   333k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3124|   333k|    const xmlChar *ret;
 3125|   333k|    int len = 0, l;
 3126|   333k|    int c;
 3127|   333k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3127:21): [True: 176k, False: 157k]
  ------------------
 3128|   176k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   176k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3129|   333k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   157k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3130|   333k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3130:17): [True: 155k, False: 178k]
  ------------------
 3131|       |
 3132|       |    /*
 3133|       |     * Handler for more complex cases
 3134|       |     */
 3135|   333k|    c = xmlCurrentChar(ctxt, &l);
 3136|   333k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3136:9): [True: 263k, False: 70.9k]
  ------------------
 3137|   263k|        return(NULL);
 3138|  70.9k|    len += l;
 3139|  70.9k|    NEXTL(l);
  ------------------
  |  | 2325|  70.9k|#define NEXTL(l) do {							\
  |  | 2326|  70.9k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 70.9k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  70.9k|    } else ctxt->input->col++;						\
  |  | 2329|  70.9k|    ctxt->input->cur += l;				\
  |  | 2330|  70.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 70.9k]
  |  |  ------------------
  ------------------
 3140|  70.9k|    c = xmlCurrentChar(ctxt, &l);
 3141|  6.44M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3141:12): [True: 6.37M, False: 70.9k]
  ------------------
 3142|  6.37M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3142:13): [True: 6.37M, False: 0]
  ------------------
 3143|  6.37M|            len += l;
 3144|  6.37M|        NEXTL(l);
  ------------------
  |  | 2325|  6.37M|#define NEXTL(l) do {							\
  |  | 2326|  6.37M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.37M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.37M|    } else ctxt->input->col++;						\
  |  | 2329|  6.37M|    ctxt->input->cur += l;				\
  |  | 2330|  6.37M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.37M]
  |  |  ------------------
  ------------------
 3145|  6.37M|        c = xmlCurrentChar(ctxt, &l);
 3146|  6.37M|    }
 3147|  70.9k|    if (len > maxLength) {
  ------------------
  |  Branch (3147:9): [True: 77, False: 70.9k]
  ------------------
 3148|     77|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3149|     77|        return(NULL);
 3150|     77|    }
 3151|  70.9k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 70.9k]
  ------------------
 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|  70.9k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3161:9): [True: 3.89k, False: 67.0k]
  |  Branch (3161:40): [True: 343, False: 3.55k]
  ------------------
 3162|    343|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3163|  70.5k|    else
 3164|  70.5k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3165|  70.9k|    if (ret == NULL)
  ------------------
  |  Branch (3165:9): [True: 2, False: 70.9k]
  ------------------
 3166|      2|        xmlErrMemory(ctxt);
 3167|  70.9k|    return(ret);
 3168|  70.9k|}
parser.c:xmlSBufInit:
  683|   622k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  684|       |    buf->mem = NULL;
  685|   622k|    buf->size = 0;
  686|   622k|    buf->cap = 0;
  687|   622k|    buf->max = max;
  688|   622k|    buf->code = XML_ERR_OK;
  689|   622k|}
parser.c:xmlExpandPEsInEntityValue:
 3498|   302k|                          const xmlChar *str, int length, int depth) {
 3499|   302k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3499:20): [True: 64.7k, False: 237k]
  ------------------
 3500|   302k|    const xmlChar *end, *chunk;
 3501|   302k|    int c, l;
 3502|       |
 3503|   302k|    if (str == NULL)
  ------------------
  |  Branch (3503:9): [True: 163k, False: 139k]
  ------------------
 3504|   163k|        return;
 3505|       |
 3506|   139k|    depth += 1;
 3507|   139k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3507:9): [True: 0, False: 139k]
  ------------------
 3508|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3509|      0|                       "Maximum entity nesting depth exceeded");
 3510|      0|	return;
 3511|      0|    }
 3512|       |
 3513|   139k|    end = str + length;
 3514|   139k|    chunk = str;
 3515|       |
 3516|   111M|    while ((str < end) && (!PARSER_STOPPED(ctxt))) {
  ------------------
  |  |   44|   111M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3516:12): [True: 111M, False: 63.4k]
  |  Branch (3516:27): [True: 111M, False: 104]
  ------------------
 3517|   111M|        c = *str;
 3518|       |
 3519|   111M|        if (c >= 0x80) {
  ------------------
  |  Branch (3519:13): [True: 51.5M, False: 59.5M]
  ------------------
 3520|  51.5M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3521|  51.5M|                    "invalid character in entity value\n");
 3522|  51.5M|            if (l == 0) {
  ------------------
  |  Branch (3522:17): [True: 17.6M, False: 33.8M]
  ------------------
 3523|  17.6M|                if (chunk < str)
  ------------------
  |  Branch (3523:21): [True: 154k, False: 17.4M]
  ------------------
 3524|   154k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3525|  17.6M|                xmlSBufAddReplChar(buf);
 3526|  17.6M|                str += 1;
 3527|  17.6M|                chunk = str;
 3528|  33.8M|            } else {
 3529|  33.8M|                str += l;
 3530|  33.8M|            }
 3531|  59.5M|        } else if (c == '&') {
  ------------------
  |  Branch (3531:20): [True: 131k, False: 59.3M]
  ------------------
 3532|   131k|            if (str[1] == '#') {
  ------------------
  |  Branch (3532:17): [True: 28.6k, False: 102k]
  ------------------
 3533|  28.6k|                if (chunk < str)
  ------------------
  |  Branch (3533:21): [True: 24.7k, False: 3.96k]
  ------------------
 3534|  24.7k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3535|       |
 3536|  28.6k|                c = xmlParseStringCharRef(ctxt, &str);
 3537|  28.6k|                if (c == 0)
  ------------------
  |  Branch (3537:21): [True: 3.52k, False: 25.1k]
  ------------------
 3538|  3.52k|                    return;
 3539|       |
 3540|  25.1k|                xmlSBufAddChar(buf, c);
 3541|       |
 3542|  25.1k|                chunk = str;
 3543|   102k|            } else {
 3544|   102k|                xmlChar *name;
 3545|       |
 3546|       |                /*
 3547|       |                 * General entity references are checked for
 3548|       |                 * syntactic validity.
 3549|       |                 */
 3550|   102k|                str++;
 3551|   102k|                name = xmlParseStringName(ctxt, &str);
 3552|       |
 3553|   102k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3553:21): [True: 3.91k, False: 98.9k]
  |  Branch (3553:39): [True: 8.75k, False: 90.1k]
  ------------------
 3554|  12.6k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3555|  12.6k|                            "EntityValue: '&' forbidden except for entities "
 3556|  12.6k|                            "references\n");
 3557|  12.6k|                    xmlFree(name);
 3558|  12.6k|                    return;
 3559|  12.6k|                }
 3560|       |
 3561|  90.1k|                xmlFree(name);
 3562|  90.1k|            }
 3563|  59.3M|        } else if (c == '%') {
  ------------------
  |  Branch (3563:20): [True: 231k, False: 59.1M]
  ------------------
 3564|   231k|            xmlEntityPtr ent;
 3565|       |
 3566|   231k|            if (chunk < str)
  ------------------
  |  Branch (3566:17): [True: 106k, False: 124k]
  ------------------
 3567|   106k|                xmlSBufAddString(buf, chunk, str - chunk);
 3568|       |
 3569|   231k|            ent = xmlParseStringPEReference(ctxt, &str);
 3570|   231k|            if (ent == NULL)
  ------------------
  |  Branch (3570:17): [True: 59.1k, False: 172k]
  ------------------
 3571|  59.1k|                return;
 3572|       |
 3573|   172k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   172k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 7.84k, False: 164k]
  |  |  ------------------
  |  |   56|   172k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 164k, False: 205]
  |  |  ------------------
  |  |   57|   164k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 164k, False: 0]
  |  |  ------------------
  ------------------
 3574|    205|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3575|    205|                return;
 3576|    205|            }
 3577|       |
 3578|   172k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3578:17): [True: 163k, False: 8.63k]
  ------------------
 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|   163k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3585:21): [True: 163k, False: 0]
  ------------------
 3586|   163k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3586:22): [True: 141k, False: 21.4k]
  ------------------
 3587|   163k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3587:22): [True: 21.2k, False: 246]
  ------------------
 3588|   163k|                    xmlLoadEntityContent(ctxt, ent);
 3589|   163k|                } else {
 3590|    246|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3591|    246|                                  "not validating will not read content for "
 3592|    246|                                  "PE entity %s\n", ent->name, NULL);
 3593|    246|                }
 3594|   163k|            }
 3595|       |
 3596|       |            /*
 3597|       |             * TODO: Skip if ent->content is still NULL.
 3598|       |             */
 3599|       |
 3600|   172k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3600:17): [True: 30, False: 172k]
  ------------------
 3601|     30|                return;
 3602|       |
 3603|   172k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   172k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3603:17): [True: 63, False: 171k]
  ------------------
 3604|     63|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3605|     63|                return;
 3606|     63|            }
 3607|       |
 3608|   171k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   171k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3609|   171k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3610|   171k|                                      depth);
 3611|   171k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   171k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3612|       |
 3613|   171k|            chunk = str;
 3614|  59.1M|        } else {
 3615|       |            /* Normal ASCII char */
 3616|  59.1M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  59.1M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  59.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 56.8M, False: 2.32M]
  |  |  |  |  |  Branch (108:44): [True: 10.1M, False: 46.6M]
  |  |  |  |  ------------------
  |  |  |  |  109|  59.1M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 67.4k, False: 48.9M]
  |  |  |  |  ------------------
  |  |  |  |  110|  59.1M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 46.5M, False: 2.37M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|  2.37M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3618|  2.37M|                        "invalid character in entity value\n");
 3619|  2.37M|                if (chunk < str)
  ------------------
  |  Branch (3619:21): [True: 9.61k, False: 2.36M]
  ------------------
 3620|  9.61k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3621|  2.37M|                xmlSBufAddReplChar(buf);
 3622|  2.37M|                str += 1;
 3623|  2.37M|                chunk = str;
 3624|  56.7M|            } else {
 3625|  56.7M|                str += 1;
 3626|  56.7M|            }
 3627|  59.1M|        }
 3628|   111M|    }
 3629|       |
 3630|  63.5k|    if (chunk < str)
  ------------------
  |  Branch (3630:9): [True: 60.2k, False: 3.26k]
  ------------------
 3631|  60.2k|        xmlSBufAddString(buf, chunk, str - chunk);
 3632|  63.5k|}
parser.c:xmlUTF8MultibyteLen:
  818|   125M|                    const char *errMsg) {
  819|   125M|    int c = str[0];
  820|   125M|    int c1 = str[1];
  821|       |
  822|   125M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (822:9): [True: 64.6M, False: 60.8M]
  ------------------
  823|  64.6M|        goto encoding_error;
  824|       |
  825|  60.8M|    if (c < 0xE0) {
  ------------------
  |  Branch (825:9): [True: 21.4M, False: 39.4M]
  ------------------
  826|       |        /* 2-byte sequence */
  827|  21.4M|        if (c < 0xC2)
  ------------------
  |  Branch (827:13): [True: 20.3M, False: 1.12M]
  ------------------
  828|  20.3M|            goto encoding_error;
  829|       |
  830|  1.12M|        return(2);
  831|  39.4M|    } else {
  832|  39.4M|        int c2 = str[2];
  833|       |
  834|  39.4M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (834:13): [True: 9.53k, False: 39.4M]
  ------------------
  835|  9.53k|            goto encoding_error;
  836|       |
  837|  39.4M|        if (c < 0xF0) {
  ------------------
  |  Branch (837:13): [True: 39.3M, False: 61.6k]
  ------------------
  838|       |            /* 3-byte sequence */
  839|  39.3M|            if (c == 0xE0) {
  ------------------
  |  Branch (839:17): [True: 5.84M, False: 33.5M]
  ------------------
  840|       |                /* overlong */
  841|  5.84M|                if (c1 < 0xA0)
  ------------------
  |  Branch (841:21): [True: 3.21k, False: 5.84M]
  ------------------
  842|  3.21k|                    goto encoding_error;
  843|  33.5M|            } else if (c == 0xED) {
  ------------------
  |  Branch (843:24): [True: 599, False: 33.5M]
  ------------------
  844|       |                /* surrogate */
  845|    599|                if (c1 >= 0xA0)
  ------------------
  |  Branch (845:21): [True: 209, False: 390]
  ------------------
  846|    209|                    goto encoding_error;
  847|  33.5M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (847:24): [True: 26.1M, False: 7.39M]
  ------------------
  848|       |                /* U+FFFE and U+FFFF are invalid Chars */
  849|  26.1M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (849:21): [True: 26.1M, False: 3.03k]
  |  Branch (849:37): [True: 226, False: 26.1M]
  ------------------
  850|    226|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  851|  26.1M|            }
  852|       |
  853|  39.3M|            return(3);
  854|  39.3M|        } else {
  855|       |            /* 4-byte sequence */
  856|  61.6k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (856:17): [True: 1.97k, False: 59.6k]
  ------------------
  857|  1.97k|                goto encoding_error;
  858|  59.6k|            if (c == 0xF0) {
  ------------------
  |  Branch (858:17): [True: 913, False: 58.7k]
  ------------------
  859|       |                /* overlong */
  860|    913|                if (c1 < 0x90)
  ------------------
  |  Branch (860:21): [True: 543, False: 370]
  ------------------
  861|    543|                    goto encoding_error;
  862|  58.7k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (862:24): [True: 5.97k, False: 52.7k]
  ------------------
  863|       |                /* greater than 0x10FFFF */
  864|  5.97k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (864:21): [True: 5.45k, False: 523]
  |  Branch (864:35): [True: 236, False: 287]
  ------------------
  865|  5.68k|                    goto encoding_error;
  866|  5.97k|            }
  867|       |
  868|  53.4k|            return(4);
  869|  59.6k|        }
  870|  39.4M|    }
  871|       |
  872|  85.0M|encoding_error:
  873|       |    /* Only report the first error */
  874|  85.0M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  85.0M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (874:9): [True: 22.7k, False: 84.9M]
  ------------------
  875|  22.7k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  876|  22.7k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  22.7k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  877|  22.7k|    }
  878|       |
  879|  85.0M|    return(0);
  880|  60.8M|}
parser.c:xmlSBufAddString:
  719|   126M|xmlSBufAddString(xmlSBuf *buf, const xmlChar *str, unsigned len) {
  720|   126M|    if (buf->max - buf->size < len) {
  ------------------
  |  Branch (720:9): [True: 0, False: 126M]
  ------------------
  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|   126M|    if (buf->cap - buf->size <= len) {
  ------------------
  |  Branch (726:9): [True: 517k, False: 126M]
  ------------------
  727|   517k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (727:13): [True: 89, False: 517k]
  ------------------
  728|     89|            return;
  729|   517k|    }
  730|       |
  731|   126M|    if (len > 0)
  ------------------
  |  Branch (731:9): [True: 126M, False: 0]
  ------------------
  732|   126M|        memcpy(buf->mem + buf->size, str, len);
  733|   126M|    buf->size += len;
  734|   126M|}
parser.c:xmlSBufGrow:
  692|   523k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  693|   523k|    xmlChar *mem;
  694|   523k|    unsigned cap;
  695|       |
  696|   523k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (696:9): [True: 0, False: 523k]
  ------------------
  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|   523k|    cap = (buf->size + len) * 2;
  703|   523k|    if (cap < 240)
  ------------------
  |  Branch (703:9): [True: 363k, False: 159k]
  ------------------
  704|   363k|        cap = 240;
  705|       |
  706|   523k|    mem = xmlRealloc(buf->mem, cap);
  707|   523k|    if (mem == NULL) {
  ------------------
  |  Branch (707:9): [True: 97, False: 523k]
  ------------------
  708|     97|        buf->code = XML_ERR_NO_MEMORY;
  709|     97|        return(-1);
  710|     97|    }
  711|       |
  712|   523k|    buf->mem = mem;
  713|   523k|    buf->cap = cap;
  714|       |
  715|   523k|    return(0);
  716|   523k|}
parser.c:xmlSBufAddReplChar:
  767|   106M|xmlSBufAddReplChar(xmlSBuf *buf) {
  768|   106M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  769|   106M|}
parser.c:xmlSBufAddCString:
  737|   118M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  738|   118M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  739|   118M|}
parser.c:xmlParseStringCharRef:
 2671|  1.29M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2672|  1.29M|    const xmlChar *ptr;
 2673|  1.29M|    xmlChar cur;
 2674|  1.29M|    int val = 0;
 2675|       |
 2676|  1.29M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2676:9): [True: 0, False: 1.29M]
  |  Branch (2676:26): [True: 0, False: 1.29M]
  ------------------
 2677|  1.29M|    ptr = *str;
 2678|  1.29M|    cur = *ptr;
 2679|  1.29M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2679:9): [True: 1.29M, False: 0]
  |  Branch (2679:25): [True: 1.29M, False: 0]
  |  Branch (2679:44): [True: 22.5k, False: 1.26M]
  ------------------
 2680|  22.5k|	ptr += 3;
 2681|  22.5k|	cur = *ptr;
 2682|  77.4k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2682:9): [True: 55.6k, False: 21.7k]
  ------------------
 2683|  55.6k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2683:10): [True: 55.4k, False: 252]
  |  Branch (2683:26): [True: 28.9k, False: 26.4k]
  ------------------
 2684|  28.9k|	        val = val * 16 + (cur - '0');
 2685|  26.7k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2685:15): [True: 8.78k, False: 17.9k]
  |  Branch (2685:31): [True: 8.51k, False: 268]
  ------------------
 2686|  8.51k|	        val = val * 16 + (cur - 'a') + 10;
 2687|  18.2k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2687:15): [True: 17.9k, False: 275]
  |  Branch (2687:31): [True: 17.5k, False: 437]
  ------------------
 2688|  17.5k|	        val = val * 16 + (cur - 'A') + 10;
 2689|    712|	    else {
 2690|    712|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2691|    712|		val = 0;
 2692|    712|		break;
 2693|    712|	    }
 2694|  54.9k|	    if (val > 0x110000)
  ------------------
  |  Branch (2694:10): [True: 801, False: 54.1k]
  ------------------
 2695|    801|	        val = 0x110000;
 2696|       |
 2697|  54.9k|	    ptr++;
 2698|  54.9k|	    cur = *ptr;
 2699|  54.9k|	}
 2700|  22.5k|	if (cur == ';')
  ------------------
  |  Branch (2700:6): [True: 21.7k, False: 712]
  ------------------
 2701|  21.7k|	    ptr++;
 2702|  1.26M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2702:17): [True: 1.26M, False: 0]
  |  Branch (2702:33): [True: 1.26M, False: 0]
  ------------------
 2703|  1.26M|	ptr += 2;
 2704|  1.26M|	cur = *ptr;
 2705|  3.81M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2705:9): [True: 2.54M, False: 1.26M]
  ------------------
 2706|  2.54M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2706:10): [True: 2.54M, False: 340]
  |  Branch (2706:26): [True: 2.54M, False: 777]
  ------------------
 2707|  2.54M|	        val = val * 10 + (cur - '0');
 2708|  1.11k|	    else {
 2709|  1.11k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2710|  1.11k|		val = 0;
 2711|  1.11k|		break;
 2712|  1.11k|	    }
 2713|  2.54M|	    if (val > 0x110000)
  ------------------
  |  Branch (2713:10): [True: 1.78k, False: 2.54M]
  ------------------
 2714|  1.78k|	        val = 0x110000;
 2715|       |
 2716|  2.54M|	    ptr++;
 2717|  2.54M|	    cur = *ptr;
 2718|  2.54M|	}
 2719|  1.26M|	if (cur == ';')
  ------------------
  |  Branch (2719:6): [True: 1.26M, False: 1.11k]
  ------------------
 2720|  1.26M|	    ptr++;
 2721|  1.26M|    } else {
 2722|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2723|      0|	return(0);
 2724|      0|    }
 2725|  1.29M|    *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.29M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2732:9): [True: 211, False: 1.29M]
  ------------------
 2733|    211|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2734|    211|                "xmlParseStringCharRef: character reference out of bounds\n",
 2735|    211|                val);
 2736|  1.29M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.29M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.29M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.28M, False: 3.32k]
  |  |  |  |  |  Branch (117:25): [True: 1.28M, False: 9.92k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.29M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.28M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.27M, False: 2.58k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 667, False: 1.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.28M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 2.23k, False: 1.27M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.28M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.27M, False: 2.84k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.29M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 9.92k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 6.88k, False: 3.04k]
  |  |  |  |  ------------------
  |  |  |  |  120|  9.92k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.92k, False: 113]
  |  |  |  |  |  Branch (120:26): [True: 281, False: 2.64k]
  |  |  |  |  ------------------
  |  |  |  |  121|  9.92k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 2.28k, False: 477]
  |  |  |  |  |  Branch (121:27): [True: 2.28k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2737|  1.28M|        return(val);
 2738|  1.28M|    } else {
 2739|  3.32k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2740|  3.32k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2741|  3.32k|			  val);
 2742|  3.32k|    }
 2743|  3.53k|    return(0);
 2744|  1.29M|}
parser.c:xmlSBufAddChar:
  742|  1.33M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  743|  1.33M|    xmlChar *end;
  744|       |
  745|  1.33M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (745:9): [True: 0, False: 1.33M]
  ------------------
  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.33M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (751:9): [True: 5.42k, False: 1.32M]
  ------------------
  752|  5.42k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (752:13): [True: 8, False: 5.41k]
  ------------------
  753|      8|            return;
  754|  5.42k|    }
  755|       |
  756|  1.33M|    end = buf->mem + buf->size;
  757|       |
  758|  1.33M|    if (c < 0x80) {
  ------------------
  |  Branch (758:9): [True: 1.32M, False: 5.93k]
  ------------------
  759|  1.32M|        *end = (xmlChar) c;
  760|  1.32M|        buf->size += 1;
  761|  1.32M|    } else {
  762|  5.93k|        buf->size += xmlCopyCharMultiByte(end, c);
  763|  5.93k|    }
  764|  1.33M|}
parser.c:xmlParseStringName:
 3377|  3.21M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3378|  3.21M|    xmlChar *ret;
 3379|  3.21M|    const xmlChar *cur = *str;
 3380|  3.21M|    int flags = 0;
 3381|  3.21M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3381:21): [True: 1.32M, False: 1.89M]
  ------------------
 3382|  1.32M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.32M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3383|  3.21M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  1.89M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3384|       |
 3385|  3.21M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3385:9): [True: 2.00M, False: 1.21M]
  ------------------
 3386|  2.00M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  2.00M|#define XML_SCAN_OLD10      4
  ------------------
 3387|       |
 3388|  3.21M|    cur = xmlScanName(*str, maxLength, flags);
 3389|  3.21M|    if (cur == NULL) {
  ------------------
  |  Branch (3389:9): [True: 58, False: 3.21M]
  ------------------
 3390|     58|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3391|     58|        return(NULL);
 3392|     58|    }
 3393|  3.21M|    if (cur == *str)
  ------------------
  |  Branch (3393:9): [True: 8.26k, False: 3.20M]
  ------------------
 3394|  8.26k|        return(NULL);
 3395|       |
 3396|  3.20M|    ret = xmlStrndup(*str, cur - *str);
 3397|  3.20M|    if (ret == NULL)
  ------------------
  |  Branch (3397:9): [True: 30, False: 3.20M]
  ------------------
 3398|     30|        xmlErrMemory(ctxt);
 3399|  3.20M|    *str = cur;
 3400|  3.20M|    return(ret);
 3401|  3.21M|}
parser.c:xmlParseStringPEReference:
 7898|   231k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7899|   231k|    const xmlChar *ptr;
 7900|   231k|    xmlChar cur;
 7901|   231k|    xmlChar *name;
 7902|   231k|    xmlEntityPtr entity = NULL;
 7903|       |
 7904|   231k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7904:9): [True: 0, False: 231k]
  |  Branch (7904:26): [True: 0, False: 231k]
  ------------------
 7905|   231k|    ptr = *str;
 7906|   231k|    cur = *ptr;
 7907|   231k|    if (cur != '%')
  ------------------
  |  Branch (7907:9): [True: 0, False: 231k]
  ------------------
 7908|      0|        return(NULL);
 7909|   231k|    ptr++;
 7910|   231k|    name = xmlParseStringName(ctxt, &ptr);
 7911|   231k|    if (name == NULL) {
  ------------------
  |  Branch (7911:9): [True: 4.40k, False: 226k]
  ------------------
 7912|  4.40k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7913|  4.40k|		       "xmlParseStringPEReference: no name\n");
 7914|  4.40k|	*str = ptr;
 7915|  4.40k|	return(NULL);
 7916|  4.40k|    }
 7917|   226k|    cur = *ptr;
 7918|   226k|    if (cur != ';') {
  ------------------
  |  Branch (7918:9): [True: 1.81k, False: 225k]
  ------------------
 7919|  1.81k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7920|  1.81k|	xmlFree(name);
 7921|  1.81k|	*str = ptr;
 7922|  1.81k|	return(NULL);
 7923|  1.81k|    }
 7924|   225k|    ptr++;
 7925|       |
 7926|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7927|   225k|    ctxt->hasPErefs = 1;
 7928|       |
 7929|       |    /*
 7930|       |     * Request the entity from SAX
 7931|       |     */
 7932|   225k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7932:9): [True: 225k, False: 0]
  ------------------
 7933|   225k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7933:2): [True: 225k, False: 0]
  ------------------
 7934|   225k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7935|       |
 7936|   225k|    if (entity == NULL) {
  ------------------
  |  Branch (7936:9): [True: 52.8k, False: 172k]
  ------------------
 7937|  52.8k|        xmlHandleUndeclaredEntity(ctxt, name);
 7938|   172k|    } else {
 7939|       |	/*
 7940|       |	 * Internal checking in case the entity quest barfed
 7941|       |	 */
 7942|   172k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7942:6): [True: 163k, False: 8.32k]
  ------------------
 7943|   163k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7943:6): [True: 0, False: 163k]
  ------------------
 7944|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7945|      0|			  "%%%s; is not a parameter entity\n",
 7946|      0|			  name, NULL);
 7947|      0|	}
 7948|   172k|    }
 7949|       |
 7950|   225k|    xmlFree(name);
 7951|   225k|    *str = ptr;
 7952|   225k|    return(entity);
 7953|   226k|}
parser.c:xmlHandleUndeclaredEntity:
 7371|   456k|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|   456k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7393:9): [True: 775, False: 455k]
  ------------------
 7394|   455k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7394:10): [True: 451k, False: 4.51k]
  ------------------
 7395|   451k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7395:10): [True: 112k, False: 338k]
  ------------------
 7396|   113k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7397|   113k|                          "Entity '%s' not defined\n", name);
 7398|   113k|#ifdef LIBXML_VALID_ENABLED
 7399|   342k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7399:16): [True: 299k, False: 43.2k]
  ------------------
 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|   299k|        xmlValidityError(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7408|   299k|                         "Entity '%s' not defined\n", name, NULL);
 7409|   299k|#endif
 7410|   299k|    } else if ((ctxt->loadsubset & ~XML_SKIP_IDS) ||
  ------------------
  |  |  210|  43.2k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7410:16): [True: 23.7k, False: 19.5k]
  ------------------
 7411|  19.5k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7411:17): [True: 18.9k, False: 605]
  ------------------
 7412|  42.0k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7412:17): [True: 18.2k, False: 645]
  ------------------
 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|  42.0k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7422|  42.0k|                     "Entity '%s' not defined\n", name);
 7423|  42.0k|    } else {
 7424|  1.25k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7425|  1.25k|                      "Entity '%s' not defined\n", name, NULL);
 7426|  1.25k|    }
 7427|       |
 7428|   456k|    ctxt->valid = 0;
 7429|   456k|}
parser.c:xmlErrMsgStr:
  364|  42.0k|{
  365|  42.0k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  42.0k|               val, NULL, NULL, 0, msg, val);
  367|  42.0k|}
parser.c:xmlLoadEntityContent:
 7735|   163k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7736|   163k|    xmlParserInputPtr oldinput, input = NULL;
 7737|   163k|    xmlParserInputPtr *oldinputTab;
 7738|   163k|    xmlChar *oldencoding;
 7739|   163k|    xmlChar *content = NULL;
 7740|   163k|    xmlResourceType rtype;
 7741|   163k|    size_t length, i;
 7742|   163k|    int oldinputNr, oldinputMax;
 7743|   163k|    int ret = -1;
 7744|   163k|    int res;
 7745|       |
 7746|   163k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7746:9): [True: 0, False: 163k]
  |  Branch (7746:27): [True: 0, False: 163k]
  ------------------
 7747|   163k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7747:10): [True: 0, False: 163k]
  ------------------
 7748|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7748:3): [True: 0, False: 0]
  ------------------
 7749|   163k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7749:2): [True: 0, False: 163k]
  ------------------
 7750|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7751|      0|	            "xmlLoadEntityContent parameter error");
 7752|      0|        return(-1);
 7753|      0|    }
 7754|       |
 7755|   163k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7755:9): [True: 163k, False: 0]
  ------------------
 7756|   163k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7757|      0|    else
 7758|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7759|       |
 7760|   163k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7761|   163k|                            (char *) entity->ExternalID, rtype);
 7762|   163k|    if (input == NULL)
  ------------------
  |  Branch (7762:9): [True: 678, False: 162k]
  ------------------
 7763|    678|        return(-1);
 7764|       |
 7765|   162k|    oldinput = ctxt->input;
 7766|   162k|    oldinputNr = ctxt->inputNr;
 7767|   162k|    oldinputMax = ctxt->inputMax;
 7768|   162k|    oldinputTab = ctxt->inputTab;
 7769|   162k|    oldencoding = ctxt->encoding;
 7770|       |
 7771|   162k|    ctxt->input = NULL;
 7772|   162k|    ctxt->inputNr = 0;
 7773|   162k|    ctxt->inputMax = 1;
 7774|   162k|    ctxt->encoding = NULL;
 7775|   162k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7776|   162k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7776:9): [True: 4, False: 162k]
  ------------------
 7777|      4|        xmlErrMemory(ctxt);
 7778|      4|        xmlFreeInputStream(input);
 7779|      4|        goto error;
 7780|      4|    }
 7781|       |
 7782|   162k|    xmlBufResetInput(input->buf->buffer, input);
 7783|       |
 7784|   162k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7784:9): [True: 8, False: 162k]
  ------------------
 7785|      8|        xmlFreeInputStream(input);
 7786|      8|        goto error;
 7787|      8|    }
 7788|       |
 7789|   162k|    xmlDetectEncoding(ctxt);
 7790|       |
 7791|       |    /*
 7792|       |     * Parse a possible text declaration first
 7793|       |     */
 7794|   162k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   162k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   325k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 158k, False: 3.87k]
  |  |  |  |  |  Branch (2268:41): [True: 156k, False: 1.65k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   162k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 156k, False: 303]
  |  |  |  |  |  Branch (2269:41): [True: 156k, False: 223]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 155k, False: 523]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   155k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   155k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 154k, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |   91|   155k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.34k, False: 206]
  |  |  |  |  |  Branch (91:23): [True: 548, False: 796]
  |  |  |  |  ------------------
  |  |  |  |   92|   155k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 638, False: 364]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7795|   155k|	xmlParseTextDecl(ctxt);
 7796|       |        /*
 7797|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7798|       |         */
 7799|   155k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   155k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7799:13): [True: 1.53k, False: 154k]
  ------------------
 7800|  1.53k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  1.53k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7800:13): [True: 315, False: 1.21k]
  ------------------
 7801|    315|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7802|    315|                           "Version mismatch between document and entity\n");
 7803|    315|        }
 7804|   155k|    }
 7805|       |
 7806|   162k|    length = input->cur - input->base;
 7807|   162k|    xmlBufShrink(input->buf->buffer, length);
 7808|   162k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|       |
 7810|   165k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7810:12): [True: 2.82k, False: 162k]
  ------------------
 7811|  2.82k|        ;
 7812|       |
 7813|   162k|    xmlBufResetInput(input->buf->buffer, input);
 7814|       |
 7815|   162k|    if (res < 0) {
  ------------------
  |  Branch (7815:9): [True: 965, False: 161k]
  ------------------
 7816|    965|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7817|    965|        goto error;
 7818|    965|    }
 7819|       |
 7820|   161k|    length = xmlBufUse(input->buf->buffer);
 7821|   161k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7821:9): [True: 0, False: 161k]
  ------------------
 7822|      0|        xmlErrMemory(ctxt);
 7823|      0|        goto error;
 7824|      0|    }
 7825|       |
 7826|   161k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7827|   161k|    if (content == NULL) {
  ------------------
  |  Branch (7827:9): [True: 2, False: 161k]
  ------------------
 7828|      2|        xmlErrMemory(ctxt);
 7829|      2|        goto error;
 7830|      2|    }
 7831|       |
 7832|  20.1M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7832:17): [True: 20.1M, False: 161]
  ------------------
 7833|  20.1M|        int clen = length - i;
 7834|  20.1M|        int c = xmlGetUTF8Char(content + i, &clen);
 7835|       |
 7836|  20.1M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  20.0M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  20.0M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 18.1M, False: 1.84M]
  |  |  |  |  ------------------
  |  |  |  |  118|  20.0M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 18.1M, False: 4.69k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 289k, False: 17.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.1M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 213k, False: 17.6M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.1M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 17.6M, False: 5.28k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  20.0M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.84M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.83M, False: 5.16k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.84M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.16k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.38k, False: 1.78k]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.84M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 913, False: 871]
  |  |  |  |  |  Branch (121:27): [True: 913, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7836:13): [True: 155k, False: 20.0M]
  |  Branch (7836:24): [True: 6.15k, False: 19.9M]
  ------------------
 7837|   161k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7838|   161k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7839|   161k|                              content[i]);
 7840|   161k|            goto error;
 7841|   161k|        }
 7842|  19.9M|        i += clen;
 7843|  19.9M|    }
 7844|       |
 7845|    161|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7846|    161|    entity->content = content;
 7847|    161|    entity->length = length;
 7848|    161|    content = NULL;
 7849|    161|    ret = 0;
 7850|       |
 7851|   162k|error:
 7852|   325k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7852:12): [True: 162k, False: 162k]
  ------------------
 7853|   162k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7854|   162k|    xmlFree(ctxt->inputTab);
 7855|   162k|    xmlFree(ctxt->encoding);
 7856|       |
 7857|   162k|    ctxt->input = oldinput;
 7858|   162k|    ctxt->inputNr = oldinputNr;
 7859|   162k|    ctxt->inputMax = oldinputMax;
 7860|   162k|    ctxt->inputTab = oldinputTab;
 7861|   162k|    ctxt->encoding = oldencoding;
 7862|       |
 7863|   162k|    xmlFree(content);
 7864|       |
 7865|   162k|    return(ret);
 7866|    161|}
parser.c:xmlSBufFinish:
  781|   358k|              const char *errMsg) {
  782|   358k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (782:9): [True: 28.4k, False: 329k]
  ------------------
  783|  28.4k|        buf->mem = xmlMalloc(1);
  784|  28.4k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (784:13): [True: 8, False: 28.4k]
  ------------------
  785|      8|            buf->code = XML_ERR_NO_MEMORY;
  786|  28.4k|        } else {
  787|  28.4k|            buf->mem[0] = 0;
  788|  28.4k|        }
  789|   329k|    } else {
  790|   329k|        buf->mem[buf->size] = 0;
  791|   329k|    }
  792|       |
  793|   358k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (793:9): [True: 358k, False: 73]
  ------------------
  794|   358k|        if (sizeOut != NULL)
  ------------------
  |  Branch (794:13): [True: 33.0k, False: 325k]
  ------------------
  795|  33.0k|            *sizeOut = buf->size;
  796|   358k|        return(buf->mem);
  797|   358k|    }
  798|       |
  799|     73|    xmlSBufReportError(buf, ctxt, errMsg);
  800|       |
  801|     73|    xmlFree(buf->mem);
  802|       |
  803|     73|    if (sizeOut != NULL)
  ------------------
  |  Branch (803:9): [True: 11, False: 62]
  ------------------
  804|     11|        *sizeOut = 0;
  805|       |    return(NULL);
  806|   358k|}
parser.c:xmlSBufReportError:
  772|    105|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  773|    105|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (773:9): [True: 105, False: 0]
  ------------------
  774|    105|        xmlCtxtErrMemory(ctxt);
  775|      0|    else
  776|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  777|    105|}
parser.c:xmlSBufCleanup:
  809|   259k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  810|   259k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (810:9): [True: 32, False: 259k]
  ------------------
  811|     32|        xmlSBufReportError(buf, ctxt, errMsg);
  812|       |
  813|   259k|    xmlFree(buf->mem);
  814|   259k|}
parser.c:xmlExpandEntityInAttValue:
 3839|  1.98M|                          int *inSpace, int depth, int check) {
 3840|  1.98M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3840:20): [True: 759k, False: 1.22M]
  ------------------
 3841|  1.98M|    int c, chunkSize;
 3842|  1.98M|    int normChange = 0;
 3843|       |
 3844|  1.98M|    if (str == NULL)
  ------------------
  |  Branch (3844:9): [True: 83, False: 1.98M]
  ------------------
 3845|     83|        return(0);
 3846|       |
 3847|  1.98M|    depth += 1;
 3848|  1.98M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3848:9): [True: 1, False: 1.98M]
  ------------------
 3849|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3850|      1|                       "Maximum entity nesting depth exceeded");
 3851|      1|	return(0);
 3852|      1|    }
 3853|       |
 3854|  1.98M|    if (pent != NULL) {
  ------------------
  |  Branch (3854:9): [True: 1.94M, False: 37.2k]
  ------------------
 3855|  1.94M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  1.94M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3855:13): [True: 3, False: 1.94M]
  ------------------
 3856|      3|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3857|      3|            return(0);
 3858|      3|        }
 3859|       |
 3860|  1.94M|        if (check) {
  ------------------
  |  Branch (3860:13): [True: 1.94M, False: 2.13k]
  ------------------
 3861|  1.94M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3861:17): [True: 38, False: 1.94M]
  ------------------
 3862|     38|                return(0);
 3863|  1.94M|        }
 3864|  1.94M|    }
 3865|       |
 3866|  1.98M|    chunkSize = 0;
 3867|       |
 3868|       |    /*
 3869|       |     * Note that entity values are already validated. No special
 3870|       |     * handling for multi-byte characters is needed.
 3871|       |     */
 3872|   332M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   332M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3872:12): [True: 332M, False: 297]
  ------------------
 3873|   332M|        c = *str;
 3874|       |
 3875|   332M|	if (c != '&') {
  ------------------
  |  Branch (3875:6): [True: 328M, False: 4.11M]
  ------------------
 3876|   328M|            if (c == 0)
  ------------------
  |  Branch (3876:17): [True: 1.88M, False: 326M]
  ------------------
 3877|  1.88M|                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|   326M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3884:17): [True: 321M, False: 5.25M]
  |  Branch (3884:35): [True: 102k, False: 321M]
  ------------------
 3885|   102k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3886|   102k|                        "'<' in entity '%s' is not allowed in attributes "
 3887|   102k|                        "values\n", pent->name);
 3888|   102k|                break;
 3889|   102k|            }
 3890|       |
 3891|   326M|            if (c <= 0x20) {
  ------------------
  |  Branch (3891:17): [True: 16.2M, False: 310M]
  ------------------
 3892|  16.2M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3892:21): [True: 97.6k, False: 16.1M]
  |  Branch (3892:36): [True: 29.6k, False: 67.9k]
  ------------------
 3893|       |                    /* Skip char */
 3894|  29.6k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3894:25): [True: 20.0k, False: 9.64k]
  ------------------
 3895|  20.0k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3896|  20.0k|                        chunkSize = 0;
 3897|  20.0k|                    }
 3898|  29.6k|                    normChange = 1;
 3899|  16.2M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3899:28): [True: 5.03M, False: 11.2M]
  ------------------
 3900|  5.03M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3900:25): [True: 1.34M, False: 3.69M]
  ------------------
 3901|  1.34M|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3902|  1.34M|                        chunkSize = 0;
 3903|  1.34M|                    }
 3904|       |
 3905|  5.03M|                    xmlSBufAddCString(buf, " ", 1);
 3906|  11.2M|                } else {
 3907|  11.2M|                    chunkSize += 1;
 3908|  11.2M|                }
 3909|       |
 3910|  16.2M|                *inSpace = 1;
 3911|   310M|            } else {
 3912|   310M|                chunkSize += 1;
 3913|   310M|                *inSpace = 0;
 3914|   310M|            }
 3915|       |
 3916|   326M|            str += 1;
 3917|   326M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3917:20): [True: 1.25M, False: 2.86M]
  ------------------
 3918|  1.25M|            int val;
 3919|       |
 3920|  1.25M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3920:17): [True: 1.24M, False: 6.60k]
  ------------------
 3921|  1.24M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3922|  1.24M|                chunkSize = 0;
 3923|  1.24M|            }
 3924|       |
 3925|  1.25M|	    val = xmlParseStringCharRef(ctxt, &str);
 3926|  1.25M|	    if (val == 0) {
  ------------------
  |  Branch (3926:10): [True: 3, False: 1.25M]
  ------------------
 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.25M|            if (val == ' ') {
  ------------------
  |  Branch (3932:17): [True: 7.53k, False: 1.24M]
  ------------------
 3933|  7.53k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3933:21): [True: 3.38k, False: 4.15k]
  |  Branch (3933:36): [True: 2.86k, False: 519]
  ------------------
 3934|  2.86k|                    normChange = 1;
 3935|  4.67k|                else
 3936|  4.67k|                    xmlSBufAddCString(buf, " ", 1);
 3937|  7.53k|                *inSpace = 1;
 3938|  1.24M|            } else {
 3939|  1.24M|                xmlSBufAddChar(buf, val);
 3940|  1.24M|                *inSpace = 0;
 3941|  1.24M|            }
 3942|  2.86M|	} else {
 3943|  2.86M|            xmlChar *name;
 3944|  2.86M|            xmlEntityPtr ent;
 3945|       |
 3946|  2.86M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3946:17): [True: 1.53M, False: 1.33M]
  ------------------
 3947|  1.53M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|  1.53M|                chunkSize = 0;
 3949|  1.53M|            }
 3950|       |
 3951|  2.86M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3952|  2.86M|            if (name == NULL) {
  ------------------
  |  Branch (3952:17): [True: 27, False: 2.86M]
  ------------------
 3953|     27|                if (pent != NULL)
  ------------------
  |  Branch (3953:21): [True: 25, False: 2]
  ------------------
 3954|     25|                    pent->content[0] = 0;
 3955|     27|                break;
 3956|     27|            }
 3957|       |
 3958|  2.86M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3959|  2.86M|            xmlFree(name);
 3960|       |
 3961|  2.86M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3961:10): [True: 2.78M, False: 74.4k]
  ------------------
 3962|  2.78M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3962:3): [True: 1.49M, False: 1.29M]
  ------------------
 3963|  1.49M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3963:7): [True: 0, False: 1.49M]
  ------------------
 3964|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3965|      0|			    "predefined entity has no content\n");
 3966|      0|                    break;
 3967|      0|                }
 3968|       |
 3969|  1.49M|                xmlSBufAddString(buf, ent->content, ent->length);
 3970|       |
 3971|  1.49M|                *inSpace = 0;
 3972|  1.49M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3972:17): [True: 1.29M, False: 74.4k]
  |  Branch (3972:34): [True: 1.29M, False: 78]
  ------------------
 3973|  1.29M|                if (pent != NULL)
  ------------------
  |  Branch (3973:21): [True: 1.29M, False: 670]
  ------------------
 3974|  1.29M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.29M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3975|  1.29M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3976|  1.29M|                        ent->content, ent, normalize, inSpace, depth, check);
 3977|  1.29M|                if (pent != NULL)
  ------------------
  |  Branch (3977:21): [True: 1.29M, False: 670]
  ------------------
 3978|  1.29M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.29M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3979|  1.29M|	    }
 3980|  2.86M|        }
 3981|   332M|    }
 3982|       |
 3983|  1.98M|    if (chunkSize > 0)
  ------------------
  |  Branch (3983:9): [True: 1.30M, False: 682k]
  ------------------
 3984|  1.30M|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3985|       |
 3986|  1.98M|    return(normChange);
 3987|  1.98M|}
parser.c:xmlParseStringEntityRef:
 7573|  2.88M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7574|  2.88M|    xmlChar *name;
 7575|  2.88M|    const xmlChar *ptr;
 7576|  2.88M|    xmlChar cur;
 7577|       |
 7578|  2.88M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7578:9): [True: 0, False: 2.88M]
  |  Branch (7578:26): [True: 0, False: 2.88M]
  ------------------
 7579|      0|        return(NULL);
 7580|  2.88M|    ptr = *str;
 7581|  2.88M|    cur = *ptr;
 7582|  2.88M|    if (cur != '&')
  ------------------
  |  Branch (7582:9): [True: 0, False: 2.88M]
  ------------------
 7583|      0|	return(NULL);
 7584|       |
 7585|  2.88M|    ptr++;
 7586|  2.88M|    name = xmlParseStringName(ctxt, &ptr);
 7587|  2.88M|    if (name == NULL) {
  ------------------
  |  Branch (7587:9): [True: 33, False: 2.88M]
  ------------------
 7588|     33|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7589|     33|		       "xmlParseStringEntityRef: no name\n");
 7590|     33|	*str = ptr;
 7591|     33|	return(NULL);
 7592|     33|    }
 7593|  2.88M|    if (*ptr != ';') {
  ------------------
  |  Branch (7593:9): [True: 9, False: 2.88M]
  ------------------
 7594|      9|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7595|      9|        xmlFree(name);
 7596|      9|	*str = ptr;
 7597|      9|	return(NULL);
 7598|      9|    }
 7599|  2.88M|    ptr++;
 7600|       |
 7601|  2.88M|    *str = ptr;
 7602|  2.88M|    return(name);
 7603|  2.88M|}
parser.c:xmlParseAttValueInternal:
 4056|   450k|                         int special, int isNamespace) {
 4057|   450k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4057:26): [True: 227k, False: 222k]
  ------------------
 4058|   227k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   227k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4059|   450k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   673k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4060|   450k|    xmlSBuf buf;
 4061|   450k|    xmlChar *ret;
 4062|   450k|    int c, l, quote, entFlags, chunkSize;
 4063|   450k|    int inSpace = 1;
 4064|   450k|    int replaceEntities;
 4065|   450k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   450k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   450k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4066|   450k|    int attvalFlags = 0;
 4067|       |
 4068|       |    /* Always expand namespace URIs */
 4069|   450k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4069:23): [True: 327k, False: 123k]
  |  Branch (4069:50): [True: 16.1k, False: 106k]
  ------------------
 4070|       |
 4071|   450k|    xmlSBufInit(&buf, maxLength);
 4072|       |
 4073|   450k|    GROW;
  ------------------
  |  | 2308|   450k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   450k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   450k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 224k, False: 226k]
  |  |  ------------------
  |  | 2309|   450k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   224k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 49.6k, False: 174k]
  |  |  ------------------
  |  | 2310|   450k|	xmlParserGrow(ctxt);
  ------------------
 4074|       |
 4075|   450k|    quote = CUR;
  ------------------
  |  | 2262|   450k|#define CUR (*ctxt->input->cur)
  ------------------
 4076|   450k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4076:9): [True: 293k, False: 156k]
  |  Branch (4076:27): [True: 4.82k, False: 289k]
  ------------------
 4077|  4.82k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4078|  4.82k|	return(NULL);
 4079|  4.82k|    }
 4080|   445k|    NEXTL(1);
  ------------------
  |  | 2325|   445k|#define NEXTL(l) do {							\
  |  | 2326|   445k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 445k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   445k|    } else ctxt->input->col++;						\
  |  | 2329|   445k|    ctxt->input->cur += l;				\
  |  | 2330|   445k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 445k]
  |  |  ------------------
  ------------------
 4081|       |
 4082|   445k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4082:9): [True: 367k, False: 78.8k]
  ------------------
 4083|   367k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   367k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   367k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4084|  78.8k|    else
 4085|  78.8k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  78.8k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4086|       |
 4087|   445k|    inSpace = 1;
 4088|   445k|    chunkSize = 0;
 4089|       |
 4090|   157M|    while (1) {
  ------------------
  |  Branch (4090:12): [True: 157M, Folded]
  ------------------
 4091|   157M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   157M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 132, False: 157M]
  |  |  ------------------
  ------------------
 4092|    132|            goto error;
 4093|       |
 4094|   157M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   157M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4094:13): [True: 43.1k, False: 157M]
  ------------------
 4095|  43.1k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4096|  43.1k|                           "AttValue: ' expected\n");
 4097|  43.1k|            goto error;
 4098|  43.1k|        }
 4099|       |
 4100|       |        /*
 4101|       |         * TODO: Check growth threshold
 4102|       |         */
 4103|   157M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   157M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4103:13): [True: 470k, False: 156M]
  ------------------
 4104|   470k|            GROW;
  ------------------
  |  | 2308|   470k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   470k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   470k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 415k, False: 55.1k]
  |  |  ------------------
  |  | 2309|   470k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   415k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 415k, False: 0]
  |  |  ------------------
  |  | 2310|   470k|	xmlParserGrow(ctxt);
  ------------------
 4105|       |
 4106|   157M|        c = CUR;
  ------------------
  |  | 2262|   157M|#define CUR (*ctxt->input->cur)
  ------------------
 4107|       |
 4108|   157M|        if (c >= 0x80) {
  ------------------
  |  Branch (4108:13): [True: 74.0M, False: 82.9M]
  ------------------
 4109|  74.0M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2264|  74.0M|#define CUR_PTR ctxt->input->cur
  ------------------
 4110|  74.0M|                    "invalid character in attribute value\n");
 4111|  74.0M|            if (l == 0) {
  ------------------
  |  Branch (4111:17): [True: 67.3M, False: 6.65M]
  ------------------
 4112|  67.3M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4112:21): [True: 295k, False: 67.0M]
  ------------------
 4113|   295k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   295k|#define CUR_PTR ctxt->input->cur
  ------------------
 4114|   295k|                    chunkSize = 0;
 4115|   295k|                }
 4116|  67.3M|                xmlSBufAddReplChar(&buf);
 4117|  67.3M|                NEXTL(1);
  ------------------
  |  | 2325|  67.3M|#define NEXTL(l) do {							\
  |  | 2326|  67.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 67.3M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  67.3M|    } else ctxt->input->col++;						\
  |  | 2329|  67.3M|    ctxt->input->cur += l;				\
  |  | 2330|  67.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 67.3M]
  |  |  ------------------
  ------------------
 4118|  67.3M|            } else {
 4119|  6.65M|                chunkSize += l;
 4120|  6.65M|                NEXTL(l);
  ------------------
  |  | 2325|  6.65M|#define NEXTL(l) do {							\
  |  | 2326|  6.65M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.65M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.65M|    } else ctxt->input->col++;						\
  |  | 2329|  6.65M|    ctxt->input->cur += l;				\
  |  | 2330|  6.65M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.65M]
  |  |  ------------------
  ------------------
 4121|  6.65M|            }
 4122|       |
 4123|  74.0M|            inSpace = 0;
 4124|  82.9M|        } else if (c != '&') {
  ------------------
  |  Branch (4124:20): [True: 81.7M, False: 1.18M]
  ------------------
 4125|  81.7M|            if (c > 0x20) {
  ------------------
  |  Branch (4125:17): [True: 54.1M, False: 27.6M]
  ------------------
 4126|  54.1M|                if (c == quote)
  ------------------
  |  Branch (4126:21): [True: 399k, False: 53.7M]
  ------------------
 4127|   399k|                    break;
 4128|       |
 4129|  53.7M|                if (c == '<')
  ------------------
  |  Branch (4129:21): [True: 878k, False: 52.8M]
  ------------------
 4130|   878k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4131|       |
 4132|  53.7M|                chunkSize += 1;
 4133|  53.7M|                inSpace = 0;
 4134|  53.7M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  27.6M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  27.6M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 8.96M, False: 18.7M]
  |  |  |  |  |  Branch (108:44): [True: 6.46M, False: 2.49M]
  |  |  |  |  ------------------
  |  |  |  |  109|  27.6M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 448k, False: 20.7M]
  |  |  |  |  ------------------
  |  |  |  |  110|  27.6M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 1.99M, False: 18.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4135|  18.7M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4136|  18.7M|                        "invalid character in attribute value\n");
 4137|  18.7M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4137:21): [True: 83.1k, False: 18.6M]
  ------------------
 4138|  83.1k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  83.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  83.1k|                    chunkSize = 0;
 4140|  83.1k|                }
 4141|  18.7M|                xmlSBufAddReplChar(&buf);
 4142|  18.7M|                inSpace = 0;
 4143|  18.7M|            } else {
 4144|       |                /* Whitespace */
 4145|  8.90M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4145:21): [True: 109k, False: 8.79M]
  |  Branch (4145:36): [True: 84.4k, False: 25.1k]
  ------------------
 4146|       |                    /* Skip char */
 4147|  84.4k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4147:25): [True: 14.4k, False: 69.9k]
  ------------------
 4148|  14.4k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  14.4k|#define CUR_PTR ctxt->input->cur
  ------------------
 4149|  14.4k|                        chunkSize = 0;
 4150|  14.4k|                    }
 4151|  84.4k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  84.4k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4152|  8.82M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4152:28): [True: 6.85M, False: 1.96M]
  ------------------
 4153|       |                    /* Convert to space */
 4154|  6.85M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4154:25): [True: 202k, False: 6.65M]
  ------------------
 4155|   202k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   202k|#define CUR_PTR ctxt->input->cur
  ------------------
 4156|   202k|                        chunkSize = 0;
 4157|   202k|                    }
 4158|       |
 4159|  6.85M|                    xmlSBufAddCString(&buf, " ", 1);
 4160|  6.85M|                } else {
 4161|  1.96M|                    chunkSize += 1;
 4162|  1.96M|                }
 4163|       |
 4164|  8.90M|                inSpace = 1;
 4165|       |
 4166|  8.90M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2263|   448k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4166:21): [True: 448k, False: 8.46M]
  |  Branch (4166:35): [True: 64.7k, False: 383k]
  ------------------
 4167|  64.7k|                    CUR_PTR++;
  ------------------
  |  | 2264|  64.7k|#define CUR_PTR ctxt->input->cur
  ------------------
 4168|  8.90M|            }
 4169|       |
 4170|  81.3M|            NEXTL(1);
  ------------------
  |  | 2325|  81.3M|#define NEXTL(l) do {							\
  |  | 2326|  81.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 6.48M, False: 74.9M]
  |  |  ------------------
  |  | 2327|  6.48M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  74.9M|    } else ctxt->input->col++;						\
  |  | 2329|  81.3M|    ctxt->input->cur += l;				\
  |  | 2330|  81.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 81.3M]
  |  |  ------------------
  ------------------
 4171|  81.3M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2263|  1.18M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4171:20): [True: 65.7k, False: 1.11M]
  ------------------
 4172|  65.7k|            int val;
 4173|       |
 4174|  65.7k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4174:17): [True: 42.6k, False: 23.1k]
  ------------------
 4175|  42.6k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  42.6k|#define CUR_PTR ctxt->input->cur
  ------------------
 4176|  42.6k|                chunkSize = 0;
 4177|  42.6k|            }
 4178|       |
 4179|  65.7k|            val = xmlParseCharRef(ctxt);
 4180|  65.7k|            if (val == 0)
  ------------------
  |  Branch (4180:17): [True: 2.78k, False: 62.9k]
  ------------------
 4181|  2.78k|                goto error;
 4182|       |
 4183|  62.9k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4183:17): [True: 5.08k, False: 57.8k]
  |  Branch (4183:33): [True: 2.42k, False: 2.66k]
  ------------------
 4184|       |                /*
 4185|       |                 * The reparsing will be done in xmlNodeParseContent()
 4186|       |                 * called from SAX2.c
 4187|       |                 */
 4188|  2.42k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4189|  2.42k|                inSpace = 0;
 4190|  60.5k|            } else if (val == ' ') {
  ------------------
  |  Branch (4190:24): [True: 1.94k, False: 58.5k]
  ------------------
 4191|  1.94k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4191:21): [True: 422, False: 1.51k]
  |  Branch (4191:36): [True: 202, False: 220]
  ------------------
 4192|    202|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    202|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4193|  1.73k|                else
 4194|  1.73k|                    xmlSBufAddCString(&buf, " ", 1);
 4195|  1.94k|                inSpace = 1;
 4196|  58.5k|            } else {
 4197|  58.5k|                xmlSBufAddChar(&buf, val);
 4198|  58.5k|                inSpace = 0;
 4199|  58.5k|            }
 4200|  1.11M|        } else {
 4201|  1.11M|            const xmlChar *name;
 4202|  1.11M|            xmlEntityPtr ent;
 4203|       |
 4204|  1.11M|            if (chunkSize > 0) {
  ------------------
  |  Branch (4204:17): [True: 680k, False: 436k]
  ------------------
 4205|   680k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   680k|#define CUR_PTR ctxt->input->cur
  ------------------
 4206|   680k|                chunkSize = 0;
 4207|   680k|            }
 4208|       |
 4209|  1.11M|            name = xmlParseEntityRefInternal(ctxt);
 4210|  1.11M|            if (name == NULL) {
  ------------------
  |  Branch (4210:17): [True: 153k, False: 963k]
  ------------------
 4211|       |                /*
 4212|       |                 * Probably a literal '&' which wasn't escaped.
 4213|       |                 * TODO: Handle gracefully in recovery mode.
 4214|       |                 */
 4215|   153k|                continue;
 4216|   153k|            }
 4217|       |
 4218|   963k|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4219|   963k|            if (ent == NULL)
  ------------------
  |  Branch (4219:17): [True: 232k, False: 730k]
  ------------------
 4220|   232k|                continue;
 4221|       |
 4222|   730k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4222:17): [True: 31.0k, False: 699k]
  ------------------
 4223|  31.0k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4223:21): [True: 4.07k, False: 26.9k]
  |  Branch (4223:49): [True: 2.75k, False: 1.32k]
  ------------------
 4224|  2.75k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4225|  28.2k|                else
 4226|  28.2k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4227|  31.0k|                inSpace = 0;
 4228|   699k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4228:24): [True: 653k, False: 46.3k]
  ------------------
 4229|   653k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4229:21): [True: 4.39k, False: 648k]
  ------------------
 4230|   653k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4231|   653k|                        /* check */ 1) > 0)
 4232|  4.39k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  4.39k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4233|   653k|            } else {
 4234|  46.3k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4234:21): [True: 1.04k, False: 45.3k]
  ------------------
 4235|  1.04k|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4236|       |
 4237|  46.3k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4237:21): [True: 99, False: 46.2k]
  ------------------
 4238|     99|                    ent->content[0] = 0;
 4239|     99|                    goto error;
 4240|     99|                }
 4241|       |
 4242|       |                /*
 4243|       |                 * Just output the reference
 4244|       |                 */
 4245|  46.2k|                xmlSBufAddCString(&buf, "&", 1);
 4246|  46.2k|                xmlSBufAddString(&buf, ent->name, xmlStrlen(ent->name));
 4247|  46.2k|                xmlSBufAddCString(&buf, ";", 1);
 4248|       |
 4249|  46.2k|                inSpace = 0;
 4250|  46.2k|            }
 4251|   730k|	}
 4252|   157M|    }
 4253|       |
 4254|   399k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4254:9): [True: 340k, False: 58.8k]
  |  Branch (4254:30): [True: 208k, False: 131k]
  ------------------
 4255|   208k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2264|   208k|#define CUR_PTR ctxt->input->cur
  ------------------
 4256|       |
 4257|   208k|        if (attlen != NULL)
  ------------------
  |  Branch (4257:13): [True: 208k, False: 0]
  ------------------
 4258|   208k|            *attlen = chunkSize;
 4259|   208k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4259:13): [True: 1.93k, False: 206k]
  |  Branch (4259:28): [True: 755, False: 1.18k]
  |  Branch (4259:41): [True: 439, False: 316]
  ------------------
 4260|    439|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    439|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4261|    439|            *attlen -= 1;
 4262|    439|        }
 4263|       |
 4264|       |        /* Report potential error */
 4265|   208k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4266|   208k|    } else {
 4267|   190k|        if (chunkSize > 0)
  ------------------
  |  Branch (4267:13): [True: 164k, False: 26.5k]
  ------------------
 4268|   164k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   164k|#define CUR_PTR ctxt->input->cur
  ------------------
 4269|       |
 4270|   190k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4270:13): [True: 1.67k, False: 189k]
  |  Branch (4270:28): [True: 400, False: 1.27k]
  |  Branch (4270:41): [True: 400, False: 0]
  ------------------
 4271|    400|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    400|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4272|    400|            buf.size--;
 4273|    400|        }
 4274|       |
 4275|   190k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4276|   190k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   190k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4277|       |
 4278|   190k|        if (ret != NULL) {
  ------------------
  |  Branch (4278:13): [True: 190k, False: 25]
  ------------------
 4279|   190k|            if (attlen != NULL)
  ------------------
  |  Branch (4279:17): [True: 33.0k, False: 157k]
  ------------------
 4280|  33.0k|                *attlen = buf.size;
 4281|   190k|        }
 4282|   190k|    }
 4283|       |
 4284|   399k|    if (outFlags != NULL)
  ------------------
  |  Branch (4284:9): [True: 241k, False: 157k]
  ------------------
 4285|   241k|        *outFlags = attvalFlags;
 4286|       |
 4287|   399k|    NEXTL(1);
  ------------------
  |  | 2325|   399k|#define NEXTL(l) do {							\
  |  | 2326|   399k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 399k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   399k|    } else ctxt->input->col++;						\
  |  | 2329|   399k|    ctxt->input->cur += l;				\
  |  | 2330|   399k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 399k]
  |  |  ------------------
  ------------------
 4288|       |
 4289|   399k|    return(ret);
 4290|       |
 4291|  46.2k|error:
 4292|  46.2k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4293|       |    return(NULL);
 4294|   445k|}
parser.c:xmlCheckEntityInAttValue:
 3729|  4.91k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3730|  4.91k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3730:20): [True: 3.83k, False: 1.08k]
  ------------------
 3731|  4.91k|    const xmlChar *str;
 3732|  4.91k|    unsigned long expandedSize = pent->length;
 3733|  4.91k|    int c, flags;
 3734|       |
 3735|  4.91k|    depth += 1;
 3736|  4.91k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3736:9): [True: 2, False: 4.91k]
  ------------------
 3737|      2|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3738|      2|                       "Maximum entity nesting depth exceeded");
 3739|      2|	return;
 3740|      2|    }
 3741|       |
 3742|  4.91k|    if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  4.91k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3742:9): [True: 12, False: 4.90k]
  ------------------
 3743|     12|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3744|     12|        return;
 3745|     12|    }
 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|  4.90k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3752:9): [True: 4.70k, False: 197]
  ------------------
 3753|  4.70k|        flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|  4.70k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      flags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|  4.70k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3754|    197|    else
 3755|    197|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    197|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3756|       |
 3757|  4.90k|    str = pent->content;
 3758|  4.90k|    if (str == NULL)
  ------------------
  |  Branch (3758:9): [True: 6, False: 4.89k]
  ------------------
 3759|      6|        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.8M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  28.8M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3767:12): [True: 28.8M, False: 117]
  ------------------
 3768|  28.8M|        c = *str;
 3769|       |
 3770|  28.8M|	if (c != '&') {
  ------------------
  |  Branch (3770:6): [True: 28.7M, False: 26.9k]
  ------------------
 3771|  28.7M|            if (c == 0)
  ------------------
  |  Branch (3771:17): [True: 4.76k, False: 28.7M]
  ------------------
 3772|  4.76k|                break;
 3773|       |
 3774|  28.7M|            if (c == '<')
  ------------------
  |  Branch (3774:17): [True: 2.86k, False: 28.7M]
  ------------------
 3775|  2.86k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3776|  2.86k|                        "'<' in entity '%s' is not allowed in attributes "
 3777|  2.86k|                        "values\n", pent->name);
 3778|       |
 3779|  28.7M|            str += 1;
 3780|  28.7M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3780:20): [True: 6.78k, False: 20.1k]
  ------------------
 3781|  6.78k|            int val;
 3782|       |
 3783|  6.78k|	    val = xmlParseStringCharRef(ctxt, &str);
 3784|  6.78k|	    if (val == 0) {
  ------------------
  |  Branch (3784:10): [True: 3, False: 6.78k]
  ------------------
 3785|      3|                pent->content[0] = 0;
 3786|      3|                break;
 3787|      3|            }
 3788|  20.1k|	} else {
 3789|  20.1k|            xmlChar *name;
 3790|  20.1k|            xmlEntityPtr ent;
 3791|       |
 3792|  20.1k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3793|  20.1k|	    if (name == NULL) {
  ------------------
  |  Branch (3793:10): [True: 15, False: 20.1k]
  ------------------
 3794|     15|                pent->content[0] = 0;
 3795|     15|                break;
 3796|     15|            }
 3797|       |
 3798|  20.1k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3799|  20.1k|            xmlFree(name);
 3800|       |
 3801|  20.1k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3801:17): [True: 10.0k, False: 10.0k]
  ------------------
 3802|  10.0k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3802:17): [True: 7.67k, False: 2.38k]
  ------------------
 3803|  7.67k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3803:21): [True: 3.86k, False: 3.81k]
  ------------------
 3804|  3.86k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.86k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3805|  3.86k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3806|  3.86k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.86k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3807|  3.86k|                }
 3808|       |
 3809|  7.67k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3810|  7.67k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  7.67k|#define XML_ENT_FIXED_COST 20
  ------------------
 3811|  7.67k|            }
 3812|  20.1k|        }
 3813|  28.8M|    }
 3814|       |
 3815|  4.90k|done:
 3816|  4.90k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3816:9): [True: 4.70k, False: 197]
  ------------------
 3817|  4.70k|        pent->expandedSize = expandedSize;
 3818|       |
 3819|  4.90k|    pent->flags |= flags;
 3820|  4.90k|}
parser.c:xmlCurrentCharRecover:
 2337|  51.6M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2338|  51.6M|    int c = xmlCurrentChar(ctxt, len);
 2339|       |
 2340|  51.6M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  51.6M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2340:9): [True: 15.6M, False: 35.9M]
  ------------------
 2341|  15.6M|        c = 0xFFFD; /* replacement character */
 2342|       |
 2343|  51.6M|    return(c);
 2344|  51.6M|}
parser.c:xmlParseCharDataInternal:
 4570|  7.71M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4571|  7.71M|    const xmlChar *in;
 4572|  7.71M|    int line = ctxt->input->line;
 4573|  7.71M|    int col = ctxt->input->col;
 4574|  7.71M|    int ccol;
 4575|  7.71M|    int terminate = 0;
 4576|       |
 4577|  7.71M|    GROW;
  ------------------
  |  | 2308|  7.71M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.71M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.71M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 4.23M, False: 3.48M]
  |  |  ------------------
  |  | 2309|  7.71M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.23M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 41.1k, False: 4.19M]
  |  |  ------------------
  |  | 2310|  7.71M|	xmlParserGrow(ctxt);
  ------------------
 4578|       |    /*
 4579|       |     * Accelerated common case where input don't need to be
 4580|       |     * modified before passing it to the handler.
 4581|       |     */
 4582|  7.71M|    in = ctxt->input->cur;
 4583|  7.72M|    do {
 4584|  7.84M|get_more_space:
 4585|  8.02M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4585:16): [True: 178k, False: 7.84M]
  ------------------
 4586|  7.84M|        if (*in == 0xA) {
  ------------------
  |  Branch (4586:13): [True: 121k, False: 7.72M]
  ------------------
 4587|  3.82M|            do {
 4588|  3.82M|                ctxt->input->line++; ctxt->input->col = 1;
 4589|  3.82M|                in++;
 4590|  3.82M|            } while (*in == 0xA);
  ------------------
  |  Branch (4590:22): [True: 3.70M, False: 121k]
  ------------------
 4591|   121k|            goto get_more_space;
 4592|   121k|        }
 4593|  7.72M|        if (*in == '<') {
  ------------------
  |  Branch (4593:13): [True: 94.3k, False: 7.63M]
  ------------------
 4594|   188k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4594:20): [True: 94.3k, False: 94.3k]
  ------------------
 4595|  94.3k|                const xmlChar *tmp = ctxt->input->cur;
 4596|  94.3k|                size_t nbchar = in - tmp;
 4597|       |
 4598|  94.3k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|  94.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4598:21): [True: 0, False: 94.3k]
  ------------------
 4599|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4600|  94.3k|                ctxt->input->cur += nbchar;
 4601|       |
 4602|  94.3k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4603|  94.3k|            }
 4604|  94.3k|            return;
 4605|  94.3k|        }
 4606|       |
 4607|  8.09M|get_more:
 4608|  8.09M|        ccol = ctxt->input->col;
 4609|  19.3M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4609:16): [True: 11.3M, False: 8.09M]
  ------------------
 4610|  11.3M|            in++;
 4611|  11.3M|            ccol++;
 4612|  11.3M|        }
 4613|  8.09M|        ctxt->input->col = ccol;
 4614|  8.09M|        if (*in == 0xA) {
  ------------------
  |  Branch (4614:13): [True: 47.3k, False: 8.05M]
  ------------------
 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: 47.3k]
  ------------------
 4619|  47.3k|            goto get_more;
 4620|  47.3k|        }
 4621|  8.05M|        if (*in == ']') {
  ------------------
  |  Branch (4621:13): [True: 420k, False: 7.62M]
  ------------------
 4622|   420k|            size_t avail = ctxt->input->end - in;
 4623|       |
 4624|   420k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4624:17): [True: 347k, False: 72.8k]
  |  Branch (4624:28): [True: 37, False: 347k]
  ------------------
 4625|     37|                terminate = 1;
 4626|     37|                goto invoke_callback;
 4627|     37|            }
 4628|   420k|            if (in[1] == ']') {
  ------------------
  |  Branch (4628:17): [True: 333k, False: 87.2k]
  ------------------
 4629|   333k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4629:21): [True: 328k, False: 4.57k]
  |  Branch (4629:32): [True: 416, False: 328k]
  ------------------
 4630|    416|                    terminate = 1;
 4631|    416|                    goto invoke_callback;
 4632|    416|                }
 4633|   332k|                if (in[2] == '>')
  ------------------
  |  Branch (4633:21): [True: 2.28k, False: 330k]
  ------------------
 4634|  2.28k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4635|   332k|            }
 4636|       |
 4637|   419k|            in++;
 4638|   419k|            ctxt->input->col++;
 4639|   419k|            goto get_more;
 4640|   420k|        }
 4641|       |
 4642|  7.63M|invoke_callback:
 4643|  8.39M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4643:16): [True: 759k, False: 7.63M]
  ------------------
 4644|   759k|            const xmlChar *tmp = ctxt->input->cur;
 4645|   759k|            size_t nbchar = in - tmp;
 4646|       |
 4647|   759k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   759k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4647:17): [True: 0, False: 759k]
  ------------------
 4648|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4649|   759k|            ctxt->input->cur += nbchar;
 4650|       |
 4651|   759k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4652|       |
 4653|   759k|            line = ctxt->input->line;
 4654|   759k|            col = ctxt->input->col;
 4655|   759k|        }
 4656|  7.63M|        ctxt->input->cur = in;
 4657|  7.63M|        if (*in == 0xD) {
  ------------------
  |  Branch (4657:13): [True: 14.1k, False: 7.61M]
  ------------------
 4658|  14.1k|            in++;
 4659|  14.1k|            if (*in == 0xA) {
  ------------------
  |  Branch (4659:17): [True: 5.17k, False: 8.99k]
  ------------------
 4660|  5.17k|                ctxt->input->cur = in;
 4661|  5.17k|                in++;
 4662|  5.17k|                ctxt->input->line++; ctxt->input->col = 1;
 4663|  5.17k|                continue; /* while */
 4664|  5.17k|            }
 4665|  8.99k|            in--;
 4666|  8.99k|        }
 4667|  7.62M|        if (*in == '<') {
  ------------------
  |  Branch (4667:13): [True: 622k, False: 7.00M]
  ------------------
 4668|   622k|            return;
 4669|   622k|        }
 4670|  7.00M|        if (*in == '&') {
  ------------------
  |  Branch (4670:13): [True: 46.5k, False: 6.95M]
  ------------------
 4671|  46.5k|            return;
 4672|  46.5k|        }
 4673|  6.95M|        if (terminate) {
  ------------------
  |  Branch (4673:13): [True: 453, False: 6.95M]
  ------------------
 4674|    453|            return;
 4675|    453|        }
 4676|  6.95M|        SHRINK;
  ------------------
  |  | 2304|  6.95M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.95M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.95M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 3.65M, False: 3.30M]
  |  |  ------------------
  |  | 2305|  6.95M|	xmlParserShrink(ctxt);
  ------------------
 4677|  6.95M|        GROW;
  ------------------
  |  | 2308|  6.95M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.95M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.95M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 3.65M, False: 3.30M]
  |  |  ------------------
  |  | 2309|  6.95M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  3.65M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 16.8k, False: 3.63M]
  |  |  ------------------
  |  | 2310|  6.95M|	xmlParserGrow(ctxt);
  ------------------
 4678|  6.95M|        in = ctxt->input->cur;
 4679|  6.96M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4679:15): [True: 99.2k, False: 6.86M]
  |  Branch (4679:32): [True: 1.27k, False: 98.0k]
  ------------------
 4680|  6.95M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4680:14): [True: 2.15k, False: 6.95M]
  |  Branch (4680:31): [True: 1.53k, False: 6.95M]
  ------------------
 4681|  6.95M|    ctxt->input->line = line;
 4682|  6.95M|    ctxt->input->col = col;
 4683|  6.95M|    xmlParseCharDataComplex(ctxt, partial);
 4684|  6.95M|}
parser.c:xmlCharacters:
 4524|  1.05M|              int isBlank) {
 4525|  1.05M|    int checkBlanks;
 4526|       |
 4527|  1.05M|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4527:9): [True: 0, False: 1.05M]
  |  Branch (4527:32): [True: 222k, False: 827k]
  ------------------
 4528|   222k|        return;
 4529|       |
 4530|   827k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4530:19): [True: 419k, False: 408k]
  ------------------
 4531|   408k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4531:19): [True: 0, False: 408k]
  ------------------
 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|   827k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4538:9): [True: 419k, False: 408k]
  ------------------
 4539|   419k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4539:9): [True: 11.4k, False: 407k]
  ------------------
 4540|  11.4k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4540:13): [True: 11.4k, False: 0]
  ------------------
 4541|  11.4k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4541:13): [True: 0, False: 11.4k]
  ------------------
 4542|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4543|   816k|    } else {
 4544|   816k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4544:13): [True: 816k, False: 0]
  ------------------
 4545|   816k|            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|   816k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4551:13): [True: 407k, False: 408k]
  |  Branch (4551:30): [True: 102k, False: 305k]
  ------------------
 4552|   102k|            *ctxt->space = -2;
 4553|   816k|    }
 4554|   827k|}
parser.c:areBlanks:
 2852|   419k|                     int blank_chars) {
 2853|   419k|    int i;
 2854|   419k|    xmlNodePtr lastChild;
 2855|       |
 2856|       |    /*
 2857|       |     * Check for xml:space value.
 2858|       |     */
 2859|   419k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2859:9): [True: 0, False: 419k]
  |  Branch (2859:34): [True: 311, False: 419k]
  ------------------
 2860|   419k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2860:9): [True: 304k, False: 115k]
  ------------------
 2861|   304k|	return(0);
 2862|       |
 2863|       |    /*
 2864|       |     * Check that the string is made of blanks
 2865|       |     */
 2866|   115k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2866:9): [True: 105k, False: 9.70k]
  ------------------
 2867|   200k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2867:13): [True: 194k, False: 5.24k]
  ------------------
 2868|   194k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   194k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   194k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 15.7k, False: 179k]
  |  |  |  |  ------------------
  |  |  |  |   91|   194k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 179k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 78.8k, False: 100k]
  |  |  |  |  ------------------
  |  |  |  |   92|   194k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|   105k|    }
 2870|       |
 2871|       |    /*
 2872|       |     * Look if the element is mixed content in the DTD if available
 2873|       |     */
 2874|  14.9k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2874:9): [True: 0, False: 14.9k]
  ------------------
 2875|  14.9k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2875:9): [True: 14.9k, False: 0]
  ------------------
 2876|  14.9k|        xmlElementPtr elemDecl = NULL;
 2877|  14.9k|        xmlDocPtr doc = ctxt->myDoc;
 2878|  14.9k|        const xmlChar *prefix = NULL;
 2879|       |
 2880|  14.9k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2880:13): [True: 1.94k, False: 13.0k]
  ------------------
 2881|  1.94k|            prefix = ctxt->node->ns->prefix;
 2882|  14.9k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2882:13): [True: 8.87k, False: 6.07k]
  ------------------
 2883|  8.87k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2884|  8.87k|                                      prefix);
 2885|  14.9k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2885:13): [True: 12.4k, False: 2.44k]
  |  Branch (2885:35): [True: 821, False: 11.6k]
  ------------------
 2886|    821|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2887|    821|                                      prefix);
 2888|  14.9k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2888:13): [True: 2.53k, False: 12.4k]
  ------------------
 2889|  2.53k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2889:17): [True: 1.63k, False: 897]
  ------------------
 2890|  1.63k|                return(1);
 2891|    897|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2891:17): [True: 255, False: 642]
  ------------------
 2892|    642|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2892:17): [True: 207, False: 435]
  ------------------
 2893|    462|                return(0);
 2894|    897|        }
 2895|  14.9k|    }
 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|  12.8k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  12.8k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  3.55k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2904:9): [True: 3.55k, False: 9.29k]
  |  Branch (2904:25): [True: 1.56k, False: 1.99k]
  ------------------
 2905|  11.2k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2905:9): [True: 8.43k, False: 2.84k]
  ------------------
 2906|  8.43k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2261|  8.43k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2263|  6.92k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2906:2): [True: 6.92k, False: 1.50k]
  |  Branch (2906:18): [True: 402, False: 6.52k]
  ------------------
 2907|       |
 2908|  10.8k|    lastChild = xmlGetLastChild(ctxt->node);
 2909|  10.8k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2909:9): [True: 8.03k, False: 2.84k]
  ------------------
 2910|  8.03k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2910:13): [True: 0, False: 8.03k]
  ------------------
 2911|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2911:13): [True: 0, False: 0]
  ------------------
 2912|  8.03k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2912:16): [True: 641, False: 2.20k]
  ------------------
 2913|    641|        return(0);
 2914|  2.20k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2914:14): [True: 2.20k, False: 0]
  ------------------
 2915|  2.20k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2915:14): [True: 381, False: 1.82k]
  ------------------
 2916|    381|        return(0);
 2917|  9.86k|    return(1);
 2918|  10.8k|}
parser.c:xmlParseCharDataComplex:
 4697|  6.95M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4698|  6.95M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4699|  6.95M|    int nbchar = 0;
 4700|  6.95M|    int cur, l;
 4701|       |
 4702|  6.95M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4703|  21.1M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4703:12): [True: 21.0M, False: 58.3k]
  ------------------
 4704|  21.0M|           (cur != '&') &&
  ------------------
  |  Branch (4704:12): [True: 21.0M, False: 5.26k]
  ------------------
 4705|  21.0M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  21.0M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  21.0M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 13.3M, False: 7.75M]
  |  |  |  |  ------------------
  |  |  |  |  118|  21.0M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  13.3M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 6.50M, False: 6.79M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.49M, False: 4.00M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  13.3M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 10.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  13.3M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 3.91M, False: 6.88M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  21.0M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 7.75M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.08M, False: 4.67M]
  |  |  |  |  ------------------
  |  |  |  |  120|  7.75M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 4.67M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 4.66M, False: 6.89k]
  |  |  |  |  ------------------
  |  |  |  |  121|  7.75M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 4.70k, False: 2.19k]
  |  |  |  |  |  Branch (121:27): [True: 4.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4705:5): [True: 14.1M, False: 6.89M]
  ------------------
 4706|  14.1M|        if (cur == ']') {
  ------------------
  |  Branch (4706:13): [True: 534k, False: 13.6M]
  ------------------
 4707|   534k|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4708|       |
 4709|   534k|            if (partial && avail < 2)
  ------------------
  |  Branch (4709:17): [True: 527k, False: 6.54k]
  |  Branch (4709:28): [True: 56, False: 527k]
  ------------------
 4710|     56|                break;
 4711|   534k|            if (NXT(1) == ']') {
  ------------------
  |  | 2263|   534k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4711:17): [True: 515k, False: 18.3k]
  ------------------
 4712|   515k|                if (partial && avail < 3)
  ------------------
  |  Branch (4712:21): [True: 513k, False: 2.13k]
  |  Branch (4712:32): [True: 1.24k, False: 512k]
  ------------------
 4713|  1.24k|                    break;
 4714|   514k|                if (NXT(2) == '>')
  ------------------
  |  | 2263|   514k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4714:21): [True: 799, False: 513k]
  ------------------
 4715|    799|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4716|   514k|            }
 4717|   534k|        }
 4718|       |
 4719|  14.1M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2333|  14.1M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 5.42M, False: 8.74M]
  |  |  ------------------
  |  | 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: 2.42M, False: 11.7M]
  |  |  ------------------
  |  | 2327|  2.42M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  11.7M|    } 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: 91.6k, False: 14.0M]
  ------------------
 4723|  91.6k|	    buf[nbchar] = 0;
 4724|       |
 4725|  91.6k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4726|  91.6k|	    nbchar = 0;
 4727|  91.6k|            SHRINK;
  ------------------
  |  | 2304|  91.6k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  91.6k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  91.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 77.0k, False: 14.5k]
  |  |  ------------------
  |  | 2305|  91.6k|	xmlParserShrink(ctxt);
  ------------------
 4728|  91.6k|	}
 4729|  14.1M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4730|  14.1M|    }
 4731|  6.95M|    if (nbchar != 0) {
  ------------------
  |  Branch (4731:9): [True: 104k, False: 6.85M]
  ------------------
 4732|   104k|        buf[nbchar] = 0;
 4733|       |
 4734|   104k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4735|   104k|    }
 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|  6.95M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4743:9): [True: 6.95M, False: 3.92k]
  ------------------
 4744|  6.95M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2262|  6.64M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4744:13): [True: 6.64M, False: 303k]
  |  Branch (4744:27): [True: 647, False: 6.64M]
  ------------------
 4745|    647|            if (partial == 0) {
  ------------------
  |  Branch (4745:17): [True: 428, False: 219]
  ------------------
 4746|    428|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4747|    428|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2262|    428|#define CUR (*ctxt->input->cur)
  ------------------
 4748|    428|                NEXTL(1);
  ------------------
  |  | 2325|    428|#define NEXTL(l) do {							\
  |  | 2326|    428|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 428]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|    428|    } else ctxt->input->col++;						\
  |  | 2329|    428|    ctxt->input->cur += l;				\
  |  | 2330|    428|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 428]
  |  |  ------------------
  ------------------
 4749|    428|            }
 4750|  6.95M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4750:20): [True: 6.89M, False: 58.3k]
  |  Branch (4750:36): [True: 6.88M, False: 5.26k]
  |  Branch (4750:52): [True: 6.88M, False: 1.30k]
  ------------------
 4751|       |            /* Generate the error and skip the offending character */
 4752|  6.88M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4753|  6.88M|                              "PCDATA invalid Char value %d\n", cur);
 4754|  6.88M|            NEXTL(l);
  ------------------
  |  | 2325|  6.88M|#define NEXTL(l) do {							\
  |  | 2326|  6.88M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.88M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.88M|    } else ctxt->input->col++;						\
  |  | 2329|  6.88M|    ctxt->input->cur += l;				\
  |  | 2330|  6.88M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.88M]
  |  |  ------------------
  ------------------
 4755|  6.88M|        }
 4756|  6.95M|    }
 4757|  6.95M|}
parser.c:xmlFatalErrMsgStr:
  348|   605k|{
  349|   605k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   605k|               val, NULL, NULL, 0, msg, val);
  351|   605k|}
parser.c:xmlParseCommentComplex:
 4856|   164k|                       size_t len, size_t size) {
 4857|   164k|    int q, ql;
 4858|   164k|    int r, rl;
 4859|   164k|    int cur, l;
 4860|   164k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4860:21): [True: 45.0k, False: 119k]
  ------------------
 4861|  45.0k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  45.0k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4862|   164k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   119k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4863|       |
 4864|   164k|    if (buf == NULL) {
  ------------------
  |  Branch (4864:9): [True: 22.4k, False: 141k]
  ------------------
 4865|  22.4k|        len = 0;
 4866|  22.4k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  22.4k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4867|  22.4k|	buf = xmlMalloc(size);
 4868|  22.4k|	if (buf == NULL) {
  ------------------
  |  Branch (4868:6): [True: 2, False: 22.4k]
  ------------------
 4869|      2|	    xmlErrMemory(ctxt);
 4870|      2|	    return;
 4871|      2|	}
 4872|  22.4k|    }
 4873|   164k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4874|   164k|    if (q == 0)
  ------------------
  |  Branch (4874:9): [True: 1.25k, False: 163k]
  ------------------
 4875|  1.25k|        goto not_terminated;
 4876|   163k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   163k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   163k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 83.8k, False: 79.1k]
  |  |  |  |  ------------------
  |  |  |  |  118|   163k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  83.8k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 83.3k, False: 463]
  |  |  |  |  |  |  |  Branch (108:44): [True: 80.1k, False: 3.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  83.8k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 3.67k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  83.8k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 2.95k, False: 724]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   163k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 79.1k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 10.5k, False: 68.6k]
  |  |  |  |  ------------------
  |  |  |  |  120|  79.1k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 68.6k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 68.0k, False: 538]
  |  |  |  |  ------------------
  |  |  |  |  121|  79.1k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 337, False: 201]
  |  |  |  |  |  Branch (121:27): [True: 337, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4876:9): [True: 925, False: 162k]
  ------------------
 4877|    925|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4878|    925|                          "xmlParseComment: invalid xmlChar value %d\n",
 4879|    925|	                  q);
 4880|    925|	xmlFree (buf);
 4881|    925|	return;
 4882|    925|    }
 4883|   162k|    NEXTL(ql);
  ------------------
  |  | 2325|   162k|#define NEXTL(l) do {							\
  |  | 2326|   162k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 245, False: 161k]
  |  |  ------------------
  |  | 2327|    245|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   161k|    } else ctxt->input->col++;						\
  |  | 2329|   162k|    ctxt->input->cur += l;				\
  |  | 2330|   162k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 162k]
  |  |  ------------------
  ------------------
 4884|   162k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4885|   162k|    if (r == 0)
  ------------------
  |  Branch (4885:9): [True: 455, False: 161k]
  ------------------
 4886|    455|        goto not_terminated;
 4887|   161k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   161k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   161k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 128k, False: 33.4k]
  |  |  |  |  ------------------
  |  |  |  |  118|   161k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   128k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 127k, False: 402]
  |  |  |  |  |  |  |  Branch (108:44): [True: 107k, False: 19.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   128k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 20.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   128k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 19.7k, False: 448]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   161k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 33.4k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.12k, False: 32.2k]
  |  |  |  |  ------------------
  |  |  |  |  120|  33.4k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 32.2k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 31.7k, False: 575]
  |  |  |  |  ------------------
  |  |  |  |  121|  33.4k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 316, False: 259]
  |  |  |  |  |  Branch (121:27): [True: 316, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4887:9): [True: 707, False: 160k]
  ------------------
 4888|    707|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4889|    707|                          "xmlParseComment: invalid xmlChar value %d\n",
 4890|    707|	                  r);
 4891|    707|	xmlFree (buf);
 4892|    707|	return;
 4893|    707|    }
 4894|   160k|    NEXTL(rl);
  ------------------
  |  | 2325|   160k|#define NEXTL(l) do {							\
  |  | 2326|   160k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 33.4k, False: 127k]
  |  |  ------------------
  |  | 2327|  33.4k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   127k|    } else ctxt->input->col++;						\
  |  | 2329|   160k|    ctxt->input->cur += l;				\
  |  | 2330|   160k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 160k]
  |  |  ------------------
  ------------------
 4895|   160k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4896|   160k|    if (cur == 0)
  ------------------
  |  Branch (4896:9): [True: 456, False: 160k]
  ------------------
 4897|    456|        goto not_terminated;
 4898|  14.0M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  14.0M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  28.0M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 14.0M, False: 4.86k]
  |  |  |  |  |  Branch (117:25): [True: 11.2M, False: 2.82M]
  |  |  |  |  ------------------
  |  |  |  |  118|  28.0M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  11.2M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 11.2M, False: 4.38k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 3.30M, False: 7.89M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  11.2M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 7.90M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  11.2M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 7.89M, False: 4.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  28.0M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.82M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 116k, False: 2.71M]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.82M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.70M, False: 8.11k]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.82M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 7.72k, False: 393]
  |  |  |  |  |  Branch (121:27): [True: 7.72k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4899|  14.0M|           ((cur != '>') ||
  ------------------
  |  Branch (4899:13): [True: 13.6M, False: 364k]
  ------------------
 4900|  13.8M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4900:6): [True: 186k, False: 177k]
  |  Branch (4900:20): [True: 22.4k, False: 155k]
  ------------------
 4901|  13.8M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4901:6): [True: 595k, False: 13.2M]
  |  Branch (4901:20): [True: 274k, False: 321k]
  ------------------
 4902|   274k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4903|   274k|	}
 4904|  13.8M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4904:6): [True: 85.9k, False: 13.7M]
  ------------------
 4905|  85.9k|	    xmlChar *tmp;
 4906|  85.9k|            int newSize;
 4907|       |
 4908|  85.9k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4909|  85.9k|            if (newSize < 0) {
  ------------------
  |  Branch (4909:17): [True: 0, False: 85.9k]
  ------------------
 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|  85.9k|	    tmp = xmlRealloc(buf, newSize);
 4916|  85.9k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4916:10): [True: 3, False: 85.9k]
  ------------------
 4917|      3|		xmlErrMemory(ctxt);
 4918|      3|		xmlFree(buf);
 4919|      3|		return;
 4920|      3|	    }
 4921|  85.9k|	    buf = tmp;
 4922|  85.9k|            size = newSize;
 4923|  85.9k|	}
 4924|  13.8M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2333|  13.8M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 10.6M, False: 3.24M]
  |  |  ------------------
  |  | 2334|  13.8M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4925|       |
 4926|  13.8M|	q = r;
 4927|  13.8M|	ql = rl;
 4928|  13.8M|	r = cur;
 4929|  13.8M|	rl = l;
 4930|       |
 4931|  13.8M|	NEXTL(l);
  ------------------
  |  | 2325|  13.8M|#define NEXTL(l) do {							\
  |  | 2326|  13.8M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.64M, False: 11.2M]
  |  |  ------------------
  |  | 2327|  2.64M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  11.2M|    } else ctxt->input->col++;						\
  |  | 2329|  13.8M|    ctxt->input->cur += l;				\
  |  | 2330|  13.8M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 13.8M]
  |  |  ------------------
  ------------------
 4932|  13.8M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4933|       |
 4934|  13.8M|    }
 4935|   160k|    buf[len] = 0;
 4936|   160k|    if (cur == 0) {
  ------------------
  |  Branch (4936:9): [True: 3.98k, False: 156k]
  ------------------
 4937|  3.98k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4938|  3.98k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4939|   156k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   156k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   156k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 156k, False: 393]
  |  |  |  |  ------------------
  |  |  |  |  118|   156k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   156k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 155k, False: 399]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 155k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   156k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 156k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   156k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 155k, False: 492]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   156k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 393, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 393]
  |  |  |  |  ------------------
  |  |  |  |  120|    393|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 393, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 393]
  |  |  |  |  ------------------
  |  |  |  |  121|    393|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 393]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4939:16): [True: 885, False: 155k]
  ------------------
 4940|    885|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4941|    885|                          "xmlParseComment: invalid xmlChar value %d\n",
 4942|    885|	                  cur);
 4943|   155k|    } else {
 4944|   155k|        NEXT;
  ------------------
  |  | 2316|   155k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4945|   155k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4945:6): [True: 155k, False: 0]
  |  Branch (4945:29): [True: 155k, False: 0]
  ------------------
 4946|   155k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4946:6): [True: 152k, False: 2.89k]
  ------------------
 4947|   152k|	    ctxt->sax->comment(ctxt->userData, buf);
 4948|   155k|    }
 4949|   160k|    xmlFree(buf);
 4950|   160k|    return;
 4951|  2.16k|not_terminated:
 4952|  2.16k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4953|       |			 "Comment not terminated\n", NULL);
 4954|  2.16k|    xmlFree(buf);
 4955|  2.16k|}
parser.c:xmlNsErr:
  384|   203k|{
  385|   203k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   203k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   203k|}
parser.c:xmlSkipBlankCharsPE:
 2437|  1.25M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2438|  1.25M|    int res = 0;
 2439|  1.25M|    int inParam;
 2440|  1.25M|    int expandParam;
 2441|       |
 2442|  1.25M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.25M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 1.05M, False: 206k]
  |  |  ------------------
  |  |   51|  1.25M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 158k, False: 894k]
  |  |  ------------------
  |  |   52|  1.05M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 894k, False: 0]
  |  |  ------------------
  ------------------
 2443|  1.25M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.25M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 163k, False: 1.09M]
  |  |  ------------------
  |  |   56|  1.25M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 928k, False: 166k]
  |  |  ------------------
  |  |   57|  1.09M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 892k, False: 36.7k]
  |  |  ------------------
  ------------------
 2444|       |
 2445|  1.25M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2445:9): [True: 206k, False: 1.05M]
  |  Branch (2445:21): [True: 166k, False: 39.2k]
  ------------------
 2446|   166k|        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.33M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.33M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2452:12): [True: 2.33M, False: 358]
  ------------------
 2453|  2.33M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.33M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.33M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 785k, False: 1.55M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.33M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.48M, False: 67.2k]
  |  |  |  |  |  Branch (91:23): [True: 388k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.33M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 43.0k, False: 1.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|  1.21M|            NEXT;
  ------------------
  |  | 2316|  1.21M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2455|  1.21M|        } else if (CUR == '%') {
  ------------------
  |  | 2262|  1.12M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2455:20): [True: 93.8k, False: 1.02M]
  ------------------
 2456|  93.8k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2456:17): [True: 21, False: 93.8k]
  ------------------
 2457|  93.8k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|  93.8k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  93.8k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 68.9k, False: 24.9k]
  |  |  |  |  ------------------
  |  |  |  |   91|  93.8k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 21.6k, False: 3.29k]
  |  |  |  |  |  Branch (91:23): [True: 582, False: 21.0k]
  |  |  |  |  ------------------
  |  |  |  |   92|  93.8k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 235, False: 24.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2263|  24.1k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2457:42): [True: 3.29k, False: 20.8k]
  ------------------
 2458|  73.0k|                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|  20.8k|            xmlParsePERefInternal(ctxt, 0);
 2467|       |
 2468|  20.8k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  20.8k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 20.0k, False: 795]
  |  |  ------------------
  |  |   51|  20.8k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 4.86k, False: 15.1k]
  |  |  ------------------
  |  |   52|  20.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 15.1k, False: 0]
  |  |  ------------------
  ------------------
 2469|  20.8k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  20.8k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.99k, False: 16.8k]
  |  |  ------------------
  |  |   56|  20.8k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 16.8k, False: 0]
  |  |  ------------------
  |  |   57|  16.8k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 14.1k, False: 2.69k]
  |  |  ------------------
  ------------------
 2470|  1.02M|        } else if (CUR == 0) {
  ------------------
  |  | 2262|  1.02M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2470:20): [True: 67.2k, False: 961k]
  ------------------
 2471|  67.2k|            if (inParam == 0)
  ------------------
  |  Branch (2471:17): [True: 161, False: 67.0k]
  ------------------
 2472|    161|                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|  67.0k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  67.0k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2479:17): [True: 57.6k, False: 9.48k]
  ------------------
 2480|  57.6k|                break;
 2481|       |
 2482|  9.48k|            xmlPopPE(ctxt);
 2483|       |
 2484|  9.48k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  9.48k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 7.26k, False: 2.21k]
  |  |  ------------------
  |  |   51|  9.48k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3, False: 7.26k]
  |  |  ------------------
  |  |   52|  7.26k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 7.26k, False: 0]
  |  |  ------------------
  ------------------
 2485|  9.48k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  9.48k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 2.68k, False: 6.80k]
  |  |  ------------------
  |  |   56|  9.48k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 6.80k, False: 3]
  |  |  ------------------
  |  |   57|  6.80k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 6.80k, False: 0]
  |  |  ------------------
  ------------------
 2486|   961k|        } else {
 2487|   961k|            break;
 2488|   961k|        }
 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.24M|        if (res < INT_MAX)
  ------------------
  |  Branch (2497:13): [True: 1.24M, False: 0]
  ------------------
 2498|  1.24M|            res++;
 2499|  1.24M|    }
 2500|       |
 2501|  1.09M|    return(res);
 2502|  1.25M|}
parser.c:xmlValidityError:
  294|   302k|{
  295|   302k|    ctxt->valid = 0;
  296|       |
  297|   302k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   302k|}
parser.c:xmlAddDefAttrs:
 1057|  27.5k|               const xmlChar *value) {
 1058|  27.5k|    xmlDefAttrsPtr defaults;
 1059|  27.5k|    xmlDefAttr *attr;
 1060|  27.5k|    int len, expandedSize;
 1061|  27.5k|    xmlHashedString name;
 1062|  27.5k|    xmlHashedString prefix;
 1063|  27.5k|    xmlHashedString hvalue;
 1064|  27.5k|    const xmlChar *localname;
 1065|       |
 1066|       |    /*
 1067|       |     * Allows to detect attribute redefinitions
 1068|       |     */
 1069|  27.5k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1069:9): [True: 24.7k, False: 2.85k]
  ------------------
 1070|  24.7k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1070:13): [True: 17.5k, False: 7.21k]
  ------------------
 1071|  17.5k|	    return;
 1072|  24.7k|    }
 1073|       |
 1074|  10.0k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1074:9): [True: 2.97k, False: 7.09k]
  ------------------
 1075|  2.97k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1076|  2.97k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1076:6): [True: 1, False: 2.97k]
  ------------------
 1077|      1|	    goto mem_error;
 1078|  2.97k|    }
 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|  10.0k|    localname = xmlSplitQName3(fullname, &len);
 1085|  10.0k|    if (localname == NULL) {
  ------------------
  |  Branch (1085:9): [True: 9.56k, False: 500]
  ------------------
 1086|  9.56k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1087|  9.56k|	prefix.name = NULL;
 1088|  9.56k|    } else {
 1089|    500|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1090|    500|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1091|    500|        if (prefix.name == NULL)
  ------------------
  |  Branch (1091:13): [True: 1, False: 499]
  ------------------
 1092|      1|            goto mem_error;
 1093|    500|    }
 1094|  10.0k|    if (name.name == NULL)
  ------------------
  |  Branch (1094:9): [True: 1, False: 10.0k]
  ------------------
 1095|      1|        goto mem_error;
 1096|       |
 1097|       |    /*
 1098|       |     * make sure there is some storage
 1099|       |     */
 1100|  10.0k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1101|  10.0k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1101:9): [True: 3.50k, False: 6.55k]
  ------------------
 1102|  6.55k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1102:9): [True: 705, False: 5.85k]
  ------------------
 1103|  4.21k|        xmlDefAttrsPtr temp;
 1104|  4.21k|        int newSize;
 1105|       |
 1106|  4.21k|        if (defaults == NULL) {
  ------------------
  |  Branch (1106:13): [True: 3.50k, False: 705]
  ------------------
 1107|  3.50k|            newSize = 4;
 1108|  3.50k|        } else {
 1109|    705|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    705|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1109:17): [True: 0, False: 705]
  ------------------
 1110|    705|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1110:17): [True: 0, False: 705]
  ------------------
 1111|    705|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1112|      0|                goto mem_error;
 1113|       |
 1114|    705|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    705|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1114:17): [True: 0, False: 705]
  ------------------
 1115|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1116|    705|            else
 1117|    705|                newSize = defaults->maxAttrs * 2;
 1118|    705|        }
 1119|  4.21k|        temp = xmlRealloc(defaults,
 1120|  4.21k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1121|  4.21k|	if (temp == NULL)
  ------------------
  |  Branch (1121:6): [True: 1, False: 4.21k]
  ------------------
 1122|      1|	    goto mem_error;
 1123|  4.21k|        if (defaults == NULL)
  ------------------
  |  Branch (1123:13): [True: 3.50k, False: 705]
  ------------------
 1124|  3.50k|            temp->nbAttrs = 0;
 1125|  4.21k|	temp->maxAttrs = newSize;
 1126|  4.21k|        defaults = temp;
 1127|  4.21k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1127:6): [True: 0, False: 4.21k]
  ------------------
 1128|  4.21k|	                        defaults, NULL) < 0) {
 1129|      0|	    xmlFree(defaults);
 1130|      0|	    goto mem_error;
 1131|      0|	}
 1132|  4.21k|    }
 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|  10.0k|    localname = xmlSplitQName3(fullattr, &len);
 1139|  10.0k|    if (localname == NULL) {
  ------------------
  |  Branch (1139:9): [True: 6.60k, False: 3.45k]
  ------------------
 1140|  6.60k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1141|  6.60k|	prefix.name = NULL;
 1142|  6.60k|    } 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|  10.0k|    if (name.name == NULL)
  ------------------
  |  Branch (1148:9): [True: 1, False: 10.0k]
  ------------------
 1149|      1|        goto mem_error;
 1150|       |
 1151|       |    /* intern the string and precompute the end */
 1152|  10.0k|    len = strlen((const char *) value);
 1153|  10.0k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1154|  10.0k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1154:9): [True: 1, False: 10.0k]
  ------------------
 1155|      1|        goto mem_error;
 1156|       |
 1157|  10.0k|    expandedSize = strlen((const char *) name.name);
 1158|  10.0k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1158:9): [True: 3.45k, False: 6.60k]
  ------------------
 1159|  3.45k|        expandedSize += strlen((const char *) prefix.name);
 1160|  10.0k|    expandedSize += len;
 1161|       |
 1162|  10.0k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1163|  10.0k|    attr->name = name;
 1164|  10.0k|    attr->prefix = prefix;
 1165|  10.0k|    attr->value = hvalue;
 1166|  10.0k|    attr->valueEnd = hvalue.name + len;
 1167|  10.0k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  10.0k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 509, False: 9.55k]
  |  |  ------------------
  |  |   56|  10.0k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 808, False: 8.74k]
  |  |  ------------------
  |  |   57|  9.55k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 713, False: 95]
  |  |  ------------------
  ------------------
 1168|  10.0k|    attr->expandedSize = expandedSize;
 1169|       |
 1170|  10.0k|    return;
 1171|       |
 1172|      7|mem_error:
 1173|      7|    xmlErrMemory(ctxt);
 1174|      7|}
parser.c:xmlAddSpecialAttr:
 1189|  51.2k|{
 1190|  51.2k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1190:9): [True: 3.64k, False: 47.5k]
  ------------------
 1191|  3.64k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1192|  3.64k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1192:6): [True: 1, False: 3.64k]
  ------------------
 1193|      1|	    goto mem_error;
 1194|  3.64k|    }
 1195|       |
 1196|  51.2k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  51.2k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 18.6k, False: 32.5k]
  |  |  ------------------
  |  |   56|  51.2k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 22.3k, False: 10.2k]
  |  |  ------------------
  |  |   57|  32.5k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 17.5k, False: 4.78k]
  |  |  ------------------
  ------------------
 1197|  36.1k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  36.1k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1198|       |
 1199|  51.2k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1199:9): [True: 1, False: 51.2k]
  ------------------
 1200|  51.2k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  51.2k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1201|      1|        goto mem_error;
 1202|  51.2k|    return;
 1203|       |
 1204|  51.2k|mem_error:
 1205|      2|    xmlErrMemory(ctxt);
 1206|      2|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6124|   561k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6125|   561k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   561k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6126|   561k|    GROW;
  ------------------
  |  | 2308|   561k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   561k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   561k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 86.3k, False: 474k]
  |  |  ------------------
  |  | 2309|   561k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  86.3k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 55.3k, False: 31.0k]
  |  |  ------------------
  |  | 2310|   561k|	xmlParserGrow(ctxt);
  ------------------
 6127|       |
 6128|   561k|    (void) openInputNr;
 6129|       |
 6130|   561k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|  1.12M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 24.7k, False: 536k]
  |  |  ------------------
  |  |   56|  1.12M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 60.5k, False: 475k]
  |  |  ------------------
  |  |   57|   536k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 38.0k, False: 22.4k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   498k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 22.4k, False: 475k]
  |  |  ------------------
  |  |   51|   498k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 22.4k, False: 0]
  |  |  ------------------
  |  |   52|  22.4k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6131|   475k|        return;
 6132|       |
 6133|  92.5k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  92.5k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6133:12): [True: 92.3k, False: 240]
  ------------------
 6134|  92.3k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6134:13): [True: 2.71k, False: 89.6k]
  ------------------
 6135|  2.71k|#ifdef LIBXML_VALID_ENABLED
 6136|  2.71k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6136:17): [True: 1.76k, False: 947]
  |  Branch (6136:37): [True: 708, False: 1.05k]
  ------------------
 6137|    708|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6138|    708|                                 "Element content declaration doesn't start "
 6139|    708|                                 "and stop in the same entity\n",
 6140|    708|                                 NULL, NULL);
 6141|    708|            }
 6142|  2.71k|#endif
 6143|  2.71k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  2.71k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 2.66k, False: 46]
  |  |  ------------------
  |  |   51|  2.71k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 1.01k, False: 1.65k]
  |  |  ------------------
  |  |   52|  2.66k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 1.65k, False: 0]
  |  |  ------------------
  ------------------
 6144|  2.66k|                xmlPopPE(ctxt);
 6145|     46|            else
 6146|     46|                break;
 6147|  89.6k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  89.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6147:20): [True: 4.68k, False: 84.9k]
  ------------------
 6148|  4.68k|            xmlParsePERefInternal(ctxt, 0);
 6149|  84.9k|        } else {
 6150|  84.9k|            break;
 6151|  84.9k|        }
 6152|       |
 6153|  7.34k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  7.34k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6154|  7.34k|        GROW;
  ------------------
  |  | 2308|  7.34k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.34k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.34k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.35k, False: 990]
  |  |  ------------------
  |  | 2309|  7.34k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.35k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.96k, False: 1.39k]
  |  |  ------------------
  |  | 2310|  7.34k|	xmlParserGrow(ctxt);
  ------------------
 6155|  7.34k|    }
 6156|  85.2k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6308|  75.5k|                                       int depth) {
 6309|  75.5k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6309:20): [True: 59.3k, False: 16.1k]
  ------------------
 6310|  75.5k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6311|  75.5k|    const xmlChar *elem;
 6312|  75.5k|    xmlChar type = 0;
 6313|       |
 6314|  75.5k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6314:9): [True: 3, False: 75.5k]
  ------------------
 6315|      3|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 6316|      3|                "xmlParseElementChildrenContentDecl : depth %d too deep, "
 6317|      3|                "use XML_PARSE_HUGE\n", depth);
 6318|      3|	return(NULL);
 6319|      3|    }
 6320|  75.5k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|  75.5k|    if (RAW == '(') {
  ------------------
  |  | 2261|  75.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:9): [True: 31.9k, False: 43.5k]
  ------------------
 6322|  31.9k|        int newInputNr = ctxt->inputNr;
 6323|       |
 6324|       |        /* Recurse on first child */
 6325|  31.9k|	NEXT;
  ------------------
  |  | 2316|  31.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6326|  31.9k|        cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6327|  31.9k|                                                           depth + 1);
 6328|  31.9k|        if (cur == NULL)
  ------------------
  |  Branch (6328:13): [True: 29.9k, False: 2.01k]
  ------------------
 6329|  29.9k|            return(NULL);
 6330|  43.5k|    } else {
 6331|  43.5k|	elem = xmlParseName(ctxt);
 6332|  43.5k|	if (elem == NULL) {
  ------------------
  |  Branch (6332:6): [True: 423, False: 43.1k]
  ------------------
 6333|    423|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6334|    423|	    return(NULL);
 6335|    423|	}
 6336|  43.1k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6337|  43.1k|	if (cur == NULL) {
  ------------------
  |  Branch (6337:6): [True: 5, False: 43.1k]
  ------------------
 6338|      5|	    xmlErrMemory(ctxt);
 6339|      5|	    return(NULL);
 6340|      5|	}
 6341|  43.1k|	GROW;
  ------------------
  |  | 2308|  43.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  43.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  43.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.70k, False: 34.4k]
  |  |  ------------------
  |  | 2309|  43.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.70k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.90k, False: 4.80k]
  |  |  ------------------
  |  | 2310|  43.1k|	xmlParserGrow(ctxt);
  ------------------
 6342|  43.1k|	if (RAW == '?') {
  ------------------
  |  | 2261|  43.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6342:6): [True: 1.67k, False: 41.4k]
  ------------------
 6343|  1.67k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6344|  1.67k|	    NEXT;
  ------------------
  |  | 2316|  1.67k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6345|  41.4k|	} else if (RAW == '*') {
  ------------------
  |  | 2261|  41.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6345:13): [True: 1.79k, False: 39.6k]
  ------------------
 6346|  1.79k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6347|  1.79k|	    NEXT;
  ------------------
  |  | 2316|  1.79k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6348|  39.6k|	} else if (RAW == '+') {
  ------------------
  |  | 2261|  39.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6348:13): [True: 544, False: 39.1k]
  ------------------
 6349|    544|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6350|    544|	    NEXT;
  ------------------
  |  | 2316|    544|#define NEXT xmlNextChar(ctxt)
  ------------------
 6351|  39.1k|	} else {
 6352|  39.1k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6353|  39.1k|	}
 6354|  43.1k|	GROW;
  ------------------
  |  | 2308|  43.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  43.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  43.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.70k, False: 34.4k]
  |  |  ------------------
  |  | 2309|  43.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.70k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 3.90k, False: 4.80k]
  |  |  ------------------
  |  | 2310|  43.1k|	xmlParserGrow(ctxt);
  ------------------
 6355|  43.1k|    }
 6356|   235k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   235k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6356:12): [True: 233k, False: 1.73k]
  ------------------
 6357|   233k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6358|   233k|        if (RAW == ')')
  ------------------
  |  | 2261|   233k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6358:13): [True: 40.3k, False: 193k]
  ------------------
 6359|  40.3k|            break;
 6360|       |        /*
 6361|       |	 * Each loop we parse one separator and one element.
 6362|       |	 */
 6363|   193k|        if (RAW == ',') {
  ------------------
  |  | 2261|   193k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6363:13): [True: 112k, False: 80.6k]
  ------------------
 6364|   112k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  8.01k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6364:10): [True: 8.01k, False: 104k]
  ------------------
 6365|       |
 6366|       |	    /*
 6367|       |	     * Detect "Name | Name , Name" error
 6368|       |	     */
 6369|   104k|	    else if (type != CUR) {
  ------------------
  |  | 2262|   104k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6369:15): [True: 2, False: 104k]
  ------------------
 6370|      2|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6371|      2|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6372|      2|		                  type);
 6373|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6373:7): [True: 2, False: 0]
  |  Branch (6373:25): [True: 2, False: 0]
  ------------------
 6374|      2|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6375|      2|		if (ret != NULL)
  ------------------
  |  Branch (6375:7): [True: 2, False: 0]
  ------------------
 6376|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6377|      2|		return(NULL);
 6378|      2|	    }
 6379|   112k|	    NEXT;
  ------------------
  |  | 2316|   112k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6380|       |
 6381|   112k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6382|   112k|	    if (op == NULL) {
  ------------------
  |  Branch (6382:10): [True: 2, False: 112k]
  ------------------
 6383|      2|                xmlErrMemory(ctxt);
 6384|      2|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6384:7): [True: 1, False: 1]
  |  Branch (6384:25): [True: 1, False: 0]
  ------------------
 6385|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6386|      2|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6387|      2|		return(NULL);
 6388|      2|	    }
 6389|   112k|	    if (last == NULL) {
  ------------------
  |  Branch (6389:10): [True: 8.01k, False: 104k]
  ------------------
 6390|  8.01k|		op->c1 = ret;
 6391|  8.01k|		if (ret != NULL)
  ------------------
  |  Branch (6391:7): [True: 8.01k, False: 0]
  ------------------
 6392|  8.01k|		    ret->parent = op;
 6393|  8.01k|		ret = cur = op;
 6394|   104k|	    } else {
 6395|   104k|	        cur->c2 = op;
 6396|   104k|		if (op != NULL)
  ------------------
  |  Branch (6396:7): [True: 104k, False: 0]
  ------------------
 6397|   104k|		    op->parent = cur;
 6398|   104k|		op->c1 = last;
 6399|   104k|		if (last != NULL)
  ------------------
  |  Branch (6399:7): [True: 104k, False: 0]
  ------------------
 6400|   104k|		    last->parent = op;
 6401|   104k|		cur =op;
 6402|   104k|		last = NULL;
 6403|   104k|	    }
 6404|   112k|	} else if (RAW == '|') {
  ------------------
  |  | 2261|  80.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6404:13): [True: 78.1k, False: 2.49k]
  ------------------
 6405|  78.1k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  22.8k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6405:10): [True: 22.8k, False: 55.2k]
  ------------------
 6406|       |
 6407|       |	    /*
 6408|       |	     * Detect "Name , Name | Name" error
 6409|       |	     */
 6410|  55.2k|	    else if (type != CUR) {
  ------------------
  |  | 2262|  55.2k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6410:15): [True: 1, False: 55.2k]
  ------------------
 6411|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6412|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6413|      1|				  type);
 6414|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6414:7): [True: 1, False: 0]
  |  Branch (6414:25): [True: 1, False: 0]
  ------------------
 6415|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6416|      1|		if (ret != NULL)
  ------------------
  |  Branch (6416:7): [True: 1, False: 0]
  ------------------
 6417|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6418|      1|		return(NULL);
 6419|      1|	    }
 6420|  78.1k|	    NEXT;
  ------------------
  |  | 2316|  78.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6421|       |
 6422|  78.1k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6423|  78.1k|	    if (op == NULL) {
  ------------------
  |  Branch (6423:10): [True: 2, False: 78.1k]
  ------------------
 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|  78.1k|	    if (last == NULL) {
  ------------------
  |  Branch (6431:10): [True: 22.8k, False: 55.2k]
  ------------------
 6432|  22.8k|		op->c1 = ret;
 6433|  22.8k|		if (ret != NULL)
  ------------------
  |  Branch (6433:7): [True: 22.8k, False: 0]
  ------------------
 6434|  22.8k|		    ret->parent = op;
 6435|  22.8k|		ret = cur = op;
 6436|  55.2k|	    } else {
 6437|  55.2k|	        cur->c2 = op;
 6438|  55.2k|		if (op != NULL)
  ------------------
  |  Branch (6438:7): [True: 55.2k, False: 0]
  ------------------
 6439|  55.2k|		    op->parent = cur;
 6440|  55.2k|		op->c1 = last;
 6441|  55.2k|		if (last != NULL)
  ------------------
  |  Branch (6441:7): [True: 55.2k, False: 0]
  ------------------
 6442|  55.2k|		    last->parent = op;
 6443|  55.2k|		cur =op;
 6444|  55.2k|		last = NULL;
 6445|  55.2k|	    }
 6446|  78.1k|	} else {
 6447|  2.49k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6448|  2.49k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6448:10): [True: 920, False: 1.57k]
  |  Branch (6448:28): [True: 920, False: 0]
  ------------------
 6449|    920|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6450|  2.49k|	    if (ret != NULL)
  ------------------
  |  Branch (6450:10): [True: 2.49k, False: 0]
  ------------------
 6451|  2.49k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6452|  2.49k|	    return(NULL);
 6453|  2.49k|	}
 6454|   190k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6455|   190k|        if (RAW == '(') {
  ------------------
  |  | 2261|   190k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6455:13): [True: 31.7k, False: 158k]
  ------------------
 6456|  31.7k|            int newInputNr = ctxt->inputNr;
 6457|       |
 6458|       |	    /* Recurse on second child */
 6459|  31.7k|	    NEXT;
  ------------------
  |  | 2316|  31.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6460|  31.7k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6461|  31.7k|                                                          depth + 1);
 6462|  31.7k|            if (last == NULL) {
  ------------------
  |  Branch (6462:17): [True: 356, False: 31.4k]
  ------------------
 6463|    356|		if (ret != NULL)
  ------------------
  |  Branch (6463:7): [True: 356, False: 0]
  ------------------
 6464|    356|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6465|    356|		return(NULL);
 6466|    356|            }
 6467|   158k|	} else {
 6468|   158k|	    elem = xmlParseName(ctxt);
 6469|   158k|	    if (elem == NULL) {
  ------------------
  |  Branch (6469:10): [True: 245, False: 158k]
  ------------------
 6470|    245|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6471|    245|		if (ret != NULL)
  ------------------
  |  Branch (6471:7): [True: 245, False: 0]
  ------------------
 6472|    245|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6473|    245|		return(NULL);
 6474|    245|	    }
 6475|   158k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6476|   158k|	    if (last == NULL) {
  ------------------
  |  Branch (6476:10): [True: 2, False: 158k]
  ------------------
 6477|      2|                xmlErrMemory(ctxt);
 6478|      2|		if (ret != NULL)
  ------------------
  |  Branch (6478:7): [True: 2, False: 0]
  ------------------
 6479|      2|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6480|      2|		return(NULL);
 6481|      2|	    }
 6482|   158k|	    if (RAW == '?') {
  ------------------
  |  | 2261|   158k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:10): [True: 13.0k, False: 145k]
  ------------------
 6483|  13.0k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6484|  13.0k|		NEXT;
  ------------------
  |  | 2316|  13.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6485|   145k|	    } else if (RAW == '*') {
  ------------------
  |  | 2261|   145k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6485:17): [True: 11.7k, False: 133k]
  ------------------
 6486|  11.7k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6487|  11.7k|		NEXT;
  ------------------
  |  | 2316|  11.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6488|   133k|	    } else if (RAW == '+') {
  ------------------
  |  | 2261|   133k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6488:17): [True: 16.2k, False: 117k]
  ------------------
 6489|  16.2k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6490|  16.2k|		NEXT;
  ------------------
  |  | 2316|  16.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6491|   117k|	    } else {
 6492|   117k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6493|   117k|	    }
 6494|   158k|	}
 6495|   190k|    }
 6496|  42.0k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6496:9): [True: 42.0k, False: 0]
  |  Branch (6496:26): [True: 29.3k, False: 12.6k]
  ------------------
 6497|  29.3k|        cur->c2 = last;
 6498|  29.3k|	if (last != NULL)
  ------------------
  |  Branch (6498:6): [True: 29.3k, False: 0]
  ------------------
 6499|  29.3k|	    last->parent = cur;
 6500|  29.3k|    }
 6501|  42.0k|#ifdef LIBXML_VALID_ENABLED
 6502|  42.0k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6502:9): [True: 37.6k, False: 4.39k]
  |  Branch (6502:29): [True: 102, False: 37.5k]
  ------------------
 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|  42.0k|#endif
 6509|  42.0k|    NEXT;
  ------------------
  |  | 2316|  42.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6510|  42.0k|    if (RAW == '?') {
  ------------------
  |  | 2261|  42.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6510:9): [True: 6.75k, False: 35.3k]
  ------------------
 6511|  6.75k|	if (ret != NULL) {
  ------------------
  |  Branch (6511:6): [True: 6.75k, False: 0]
  ------------------
 6512|  6.75k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6512:10): [True: 85, False: 6.67k]
  ------------------
 6513|  6.67k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6513:10): [True: 78, False: 6.59k]
  ------------------
 6514|    163|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6515|  6.59k|	    else
 6516|  6.59k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6517|  6.75k|	}
 6518|  6.75k|	NEXT;
  ------------------
  |  | 2316|  6.75k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6519|  35.3k|    } else if (RAW == '*') {
  ------------------
  |  | 2261|  35.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6519:16): [True: 15.0k, False: 20.2k]
  ------------------
 6520|  15.0k|	if (ret != NULL) {
  ------------------
  |  Branch (6520:6): [True: 15.0k, False: 0]
  ------------------
 6521|  15.0k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6522|  15.0k|	    cur = ret;
 6523|       |	    /*
 6524|       |	     * Some normalization:
 6525|       |	     * (a | b* | c?)* == (a | b | c)*
 6526|       |	     */
 6527|  67.0k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6527:13): [True: 67.0k, False: 0]
  |  Branch (6527:30): [True: 52.0k, False: 15.0k]
  ------------------
 6528|  52.0k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6528:7): [True: 52.0k, False: 0]
  ------------------
 6529|  52.0k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6529:15): [True: 393, False: 51.6k]
  ------------------
 6530|  51.6k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6530:8): [True: 529, False: 51.1k]
  ------------------
 6531|    922|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6532|  52.0k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6532:7): [True: 52.0k, False: 0]
  ------------------
 6533|  52.0k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6533:15): [True: 137, False: 51.8k]
  ------------------
 6534|  51.8k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6534:8): [True: 22, False: 51.8k]
  ------------------
 6535|    159|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6536|  52.0k|		cur = cur->c2;
 6537|  52.0k|	    }
 6538|  15.0k|	}
 6539|  15.0k|	NEXT;
  ------------------
  |  | 2316|  15.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6540|  20.2k|    } else if (RAW == '+') {
  ------------------
  |  | 2261|  20.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6540:16): [True: 5.39k, False: 14.8k]
  ------------------
 6541|  5.39k|	if (ret != NULL) {
  ------------------
  |  Branch (6541:6): [True: 5.39k, False: 0]
  ------------------
 6542|  5.39k|	    int found = 0;
 6543|       |
 6544|  5.39k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6544:10): [True: 295, False: 5.10k]
  ------------------
 6545|  5.10k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6545:10): [True: 75, False: 5.02k]
  ------------------
 6546|    370|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6547|  5.02k|	    else
 6548|  5.02k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6549|       |	    /*
 6550|       |	     * Some normalization:
 6551|       |	     * (a | b*)+ == (a | b)*
 6552|       |	     * (a | b?)+ == (a | b)*
 6553|       |	     */
 6554|  9.88k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6554:13): [True: 9.88k, False: 0]
  |  Branch (6554:30): [True: 4.48k, False: 5.39k]
  ------------------
 6555|  4.48k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6555:7): [True: 4.48k, False: 0]
  ------------------
 6556|  4.48k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6556:15): [True: 326, False: 4.16k]
  ------------------
 6557|  4.16k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6557:8): [True: 286, False: 3.87k]
  ------------------
 6558|    612|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6559|    612|		    found = 1;
 6560|    612|		}
 6561|  4.48k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6561:7): [True: 4.48k, False: 0]
  ------------------
 6562|  4.48k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6562:15): [True: 69, False: 4.41k]
  ------------------
 6563|  4.41k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6563:8): [True: 18, False: 4.39k]
  ------------------
 6564|     87|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6565|     87|		    found = 1;
 6566|     87|		}
 6567|  4.48k|		cur = cur->c2;
 6568|  4.48k|	    }
 6569|  5.39k|	    if (found)
  ------------------
  |  Branch (6569:10): [True: 547, False: 4.85k]
  ------------------
 6570|    547|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6571|  5.39k|	}
 6572|  5.39k|	NEXT;
  ------------------
  |  | 2316|  5.39k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6573|  5.39k|    }
 6574|  42.0k|    return(ret);
 6575|  45.1k|}
parser.c:xmlCtxtInitializeLate:
  897|  51.6k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  898|  51.6k|    xmlSAXHandlerPtr sax;
  899|       |
  900|       |    /* Avoid unused variable warning if features are disabled. */
  901|  51.6k|    (void) sax;
  902|       |
  903|       |    /*
  904|       |     * Changing the SAX struct directly is still widespread practice
  905|       |     * in internal and external code.
  906|       |     */
  907|  51.6k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (907:9): [True: 0, False: 51.6k]
  ------------------
  908|  51.6k|    sax = ctxt->sax;
  909|  51.6k|#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|  51.6k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (914:9): [True: 29.6k, False: 21.9k]
  ------------------
  915|  29.6k|        (sax) &&
  ------------------
  |  Branch (915:9): [True: 29.6k, False: 0]
  ------------------
  916|  29.6k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  29.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (916:9): [True: 29.6k, False: 0]
  ------------------
  917|  29.6k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 29.6k, 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|  29.6k|        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|  51.6k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  51.6k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  51.6k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  51.6k|#define BAD_CAST (xmlChar *)
  ------------------
  931|  51.6k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  51.6k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  932|  51.6k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (932:9): [True: 13, False: 51.6k]
  |  Branch (932:34): [True: 0, False: 51.6k]
  ------------------
  933|  51.6k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (933:3): [True: 0, False: 51.6k]
  ------------------
  934|     13|        xmlErrMemory(ctxt);
  935|     13|    }
  936|       |
  937|  51.6k|    xmlDictSetLimit(ctxt->dict,
  938|  51.6k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (938:21): [True: 24.9k, False: 26.6k]
  ------------------
  939|  24.9k|                        0 :
  940|  51.6k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  78.3k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  941|       |
  942|  51.6k|#ifdef LIBXML_VALID_ENABLED
  943|  51.6k|    if (ctxt->validate)
  ------------------
  |  Branch (943:9): [True: 24.9k, False: 26.6k]
  ------------------
  944|  24.9k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  24.9k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  945|  26.6k|    else
  946|  26.6k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  26.6k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  947|  51.6k|#endif /* LIBXML_VALID_ENABLED */
  948|  51.6k|}
parser.c:xmlPopPE:
 2384|   122k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2385|   122k|    unsigned long consumed;
 2386|   122k|    xmlEntityPtr ent;
 2387|       |
 2388|   122k|    ent = ctxt->input->entity;
 2389|       |
 2390|   122k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   122k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2391|       |
 2392|   122k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   122k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2392:9): [True: 4.91k, False: 117k]
  ------------------
 2393|  4.91k|        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.15k|        do {
 2400|  5.15k|            ctxt->input->cur = ctxt->input->end;
 2401|  5.15k|            xmlParserShrink(ctxt);
 2402|  5.15k|            result = xmlParserGrow(ctxt);
 2403|  5.15k|        } while (result > 0);
  ------------------
  |  Branch (2403:18): [True: 232, False: 4.91k]
  ------------------
 2404|       |
 2405|  4.91k|        consumed = ctxt->input->consumed;
 2406|  4.91k|        xmlSaturatedAddSizeT(&consumed,
 2407|  4.91k|                             ctxt->input->end - ctxt->input->base);
 2408|       |
 2409|  4.91k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2410|       |
 2411|       |        /*
 2412|       |         * Add to sizeentities when parsing an external entity
 2413|       |         * for the first time.
 2414|       |         */
 2415|  4.91k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2415:13): [True: 3.70k, False: 1.21k]
  ------------------
 2416|  3.70k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2417|  3.70k|        }
 2418|       |
 2419|  4.91k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  4.91k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2420|  4.91k|    }
 2421|       |
 2422|   122k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2423|       |
 2424|   122k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2425|       |
 2426|   122k|    GROW;
  ------------------
  |  | 2308|   122k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   122k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   122k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 109k, False: 13.3k]
  |  |  ------------------
  |  | 2309|   122k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   109k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 79.1k, False: 30.1k]
  |  |  ------------------
  |  | 2310|   122k|	xmlParserGrow(ctxt);
  ------------------
 2427|   122k|}
parser.c:xmlParseConditionalSections:
 6783|  6.17k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6784|  6.17k|    size_t depth = 0;
 6785|  6.17k|    int isFreshPE = 0;
 6786|  6.17k|    int oldInputNr = ctxt->inputNr;
 6787|  6.17k|    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.7k, False: 5]
  ------------------
 6790|  12.7k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6790:13): [True: 709, False: 11.9k]
  ------------------
 6791|    709|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6791:17): [True: 435, False: 274]
  ------------------
 6792|    435|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6793|    435|                return;
 6794|    435|            }
 6795|       |
 6796|    274|            xmlPopPE(ctxt);
 6797|    274|            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.65k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  8.35k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6798:20): [True: 8.65k, False: 3.33k]
  |  Branch (6798:36): [True: 8.35k, False: 297]
  |  Branch (6798:55): [True: 6.80k, False: 1.55k]
  ------------------
 6799|  6.80k|            SKIP(3);
  ------------------
  |  | 2285|  6.80k|#define SKIP(val) do {							\
  |  | 2286|  6.80k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.80k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 351, False: 6.45k]
  |  |  ------------------
  |  | 2288|  6.80k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.80k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.80k]
  |  |  ------------------
  ------------------
 6800|  6.80k|            SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  6.80k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6801|       |
 6802|  6.80k|            isFreshPE = 0;
 6803|       |
 6804|  6.80k|            if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
  ------------------
  |  | 2275|  6.80k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  13.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  13.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  13.6k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 6.17k, False: 633]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.37k, False: 2.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  6.80k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.37k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.36k, False: 3]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.36k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 3.36k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 3.36k, False: 2]
  |  |  ------------------
  ------------------
 6805|  3.36k|                SKIP(7);
  ------------------
  |  | 2285|  3.36k|#define SKIP(val) do {							\
  |  | 2286|  3.36k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.36k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 51, False: 3.31k]
  |  |  ------------------
  |  | 2288|  3.36k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.36k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.36k]
  |  |  ------------------
  ------------------
 6806|  3.36k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.36k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6807|  3.36k|                if (RAW != '[') {
  ------------------
  |  | 2261|  3.36k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6807:21): [True: 240, False: 3.12k]
  ------------------
 6808|    240|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6809|    240|                    return;
 6810|    240|                }
 6811|  3.12k|#ifdef LIBXML_VALID_ENABLED
 6812|  3.12k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6812:21): [True: 1.41k, False: 1.71k]
  |  Branch (6812:41): [True: 45, False: 1.36k]
  ------------------
 6813|     45|		    xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6814|     45|                                     "All markup of the conditional section is"
 6815|     45|                                     " not in the same entity\n",
 6816|     45|                                     NULL, NULL);
 6817|     45|                }
 6818|  3.12k|#endif
 6819|  3.12k|                NEXT;
  ------------------
  |  | 2316|  3.12k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6820|       |
 6821|  3.12k|                depth++;
 6822|  3.44k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2273|  3.44k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  6.88k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  6.88k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.80k, False: 633]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.79k, False: 15]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  3.44k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.78k, False: 4]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.78k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 2.78k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 2.78k, False: 1]
  |  |  ------------------
  ------------------
 6823|  2.78k|                size_t ignoreDepth = 0;
 6824|       |
 6825|  2.78k|                SKIP(6);
  ------------------
  |  | 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: 228, False: 2.55k]
  |  |  ------------------
  |  | 2288|  2.78k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.78k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.78k]
  |  |  ------------------
  ------------------
 6826|  2.78k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.78k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6827|  2.78k|                if (RAW != '[') {
  ------------------
  |  | 2261|  2.78k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6827:21): [True: 721, False: 2.06k]
  ------------------
 6828|    721|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6829|    721|                    return;
 6830|    721|                }
 6831|  2.06k|#ifdef LIBXML_VALID_ENABLED
 6832|  2.06k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6832:21): [True: 1.24k, False: 813]
  |  Branch (6832:41): [True: 7, False: 1.24k]
  ------------------
 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.06k|#endif
 6839|  2.06k|                NEXT;
  ------------------
  |  | 2316|  2.06k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6840|       |
 6841|   265k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|   265k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6841:24): [True: 265k, False: 3]
  ------------------
 6842|   265k|                    if (RAW == 0) {
  ------------------
  |  | 2261|   265k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6842:25): [True: 1.29k, False: 264k]
  ------------------
 6843|  1.29k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6844|  1.29k|                        return;
 6845|  1.29k|                    }
 6846|   264k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   264k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  3.22k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  1.91k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6846:25): [True: 3.22k, False: 261k]
  |  Branch (6846:41): [True: 1.91k, False: 1.30k]
  |  Branch (6846:60): [True: 843, False: 1.07k]
  ------------------
 6847|    843|                        SKIP(3);
  ------------------
  |  | 2285|    843|#define SKIP(val) do {							\
  |  | 2286|    843|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    843|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 127, False: 716]
  |  |  ------------------
  |  | 2288|    843|        xmlParserGrow(ctxt);						\
  |  | 2289|    843|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 843]
  |  |  ------------------
  ------------------
 6848|    843|                        ignoreDepth++;
 6849|       |                        /* Check for integer overflow */
 6850|    843|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6850:29): [True: 0, False: 843]
  ------------------
 6851|      0|                            xmlErrMemory(ctxt);
 6852|      0|                            return;
 6853|      0|                        }
 6854|   263k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2261|   263k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2263|  3.59k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6854:32): [True: 3.59k, False: 259k]
  |  Branch (6854:48): [True: 1.53k, False: 2.05k]
  ------------------
 6855|  1.53k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2263|  1.53k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6855:32): [True: 985, False: 553]
  ------------------
 6856|    985|                        SKIP(3);
  ------------------
  |  | 2285|    985|#define SKIP(val) do {							\
  |  | 2286|    985|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    985|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 284, False: 701]
  |  |  ------------------
  |  | 2288|    985|        xmlParserGrow(ctxt);						\
  |  | 2289|    985|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 985]
  |  |  ------------------
  ------------------
 6857|    985|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6857:29): [True: 769, False: 216]
  ------------------
 6858|    769|                            break;
 6859|    216|                        ignoreDepth--;
 6860|   262k|                    } else {
 6861|   262k|                        NEXT;
  ------------------
  |  | 2316|   262k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6862|   262k|                    }
 6863|   264k|                }
 6864|       |
 6865|    772|#ifdef LIBXML_VALID_ENABLED
 6866|    772|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6866:21): [True: 450, False: 322]
  |  Branch (6866:41): [True: 6, False: 444]
  ------------------
 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|    772|#endif
 6873|    772|            } else {
 6874|    657|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6875|    657|                return;
 6876|    657|            }
 6877|  6.80k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6877:20): [True: 5.18k, False: 0]
  ------------------
 6878|  5.18k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2261|  5.18k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.27k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.27k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6878:20): [True: 2.27k, False: 2.90k]
  |  Branch (6878:36): [True: 2.27k, False: 8]
  |  Branch (6878:55): [True: 2.26k, False: 1]
  ------------------
 6879|  2.26k|            if (isFreshPE) {
  ------------------
  |  Branch (6879:17): [True: 1, False: 2.26k]
  ------------------
 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.26k|            depth--;
 6887|  2.26k|#ifdef LIBXML_VALID_ENABLED
 6888|  2.26k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6888:17): [True: 911, False: 1.35k]
  |  Branch (6888:37): [True: 31, False: 880]
  ------------------
 6889|     31|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6890|     31|                                 "All markup of the conditional section is not"
 6891|     31|                                 " in the same entity\n",
 6892|     31|                                 NULL, NULL);
 6893|     31|            }
 6894|  2.26k|#endif
 6895|  2.26k|            SKIP(3);
  ------------------
  |  | 2285|  2.26k|#define SKIP(val) do {							\
  |  | 2286|  2.26k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.26k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.20k, False: 1.06k]
  |  |  ------------------
  |  | 2288|  2.26k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.26k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.26k]
  |  |  ------------------
  ------------------
 6896|  2.91k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|  2.91k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  1.84k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|    297|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6896:20): [True: 1.84k, False: 1.07k]
  |  Branch (6896:37): [True: 1.55k, False: 297]
  |  Branch (6896:56): [True: 293, False: 4]
  ------------------
 6897|  1.84k|            isFreshPE = 0;
 6898|  1.84k|            xmlParseMarkupDecl(ctxt);
 6899|  1.84k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  1.07k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6899:20): [True: 1.02k, False: 54]
  ------------------
 6900|  1.02k|            xmlParsePERefInternal(ctxt, 1);
 6901|  1.02k|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6901:17): [True: 272, False: 748]
  ------------------
 6902|    272|                isFreshPE = 1;
 6903|    272|                declInputNr = ctxt->inputNr;
 6904|    272|            }
 6905|  1.02k|        } else {
 6906|     54|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6907|     54|            return;
 6908|     54|        }
 6909|       |
 6910|  9.30k|        if (depth == 0)
  ------------------
  |  Branch (6910:13): [True: 2.77k, False: 6.53k]
  ------------------
 6911|  2.77k|            break;
 6912|       |
 6913|  6.53k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  6.53k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6914|  6.53k|        SHRINK;
  ------------------
  |  | 2304|  6.53k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.53k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.53k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 6.43k, False: 92]
  |  |  ------------------
  |  | 2305|  6.53k|	xmlParserShrink(ctxt);
  ------------------
 6915|  6.53k|        GROW;
  ------------------
  |  | 2308|  6.53k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.53k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.53k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.43k, False: 92]
  |  |  ------------------
  |  | 2309|  6.53k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.43k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.84k, False: 1.59k]
  |  |  ------------------
  |  | 2310|  6.53k|	xmlParserGrow(ctxt);
  ------------------
 6916|  6.53k|    }
 6917|  6.17k|}
parser.c:xmlParserEntityCheck:
  435|  3.05M|{
  436|  3.05M|    unsigned long consumed;
  437|  3.05M|    unsigned long *expandedSize;
  438|  3.05M|    xmlParserInputPtr input = ctxt->input;
  439|  3.05M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  3.05M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   624k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 624k, False: 2.43M]
  |  Branch (441:21): [True: 394k, False: 229k]
  ------------------
  442|   394k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.66M|    consumed = input->consumed;
  449|  2.66M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.66M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.66M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 229k, False: 2.43M]
  ------------------
  453|   229k|        expandedSize = &entity->expandedSize;
  454|  2.43M|    else
  455|  2.43M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.66M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.66M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.66M|#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.66M|    if ((ctxt->maxAmpl > 0) &&
  ------------------
  |  Branch (468:9): [True: 2.66M, False: 0]
  ------------------
  469|  2.66M|        (*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.66M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (469:9): [True: 891k, False: 1.77M]
  ------------------
  470|   891k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (470:10): [True: 0, False: 891k]
  ------------------
  471|   891k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (471:10): [True: 306, False: 890k]
  ------------------
  472|    306|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  473|    306|                       "Maximum entity amplification factor exceeded, see "
  474|    306|                       "xmlCtxtSetMaxAmplification.\n");
  475|    306|        return(1);
  476|    306|    }
  477|       |
  478|  2.66M|    return(0);
  479|  2.66M|}
parser.c:xmlLookupGeneralEntity:
 7432|  3.90M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7433|  3.90M|    xmlEntityPtr ent = NULL;
 7434|       |
 7435|       |    /*
 7436|       |     * Predefined entities override any extra definition
 7437|       |     */
 7438|  3.90M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7438:9): [True: 1.18M, False: 2.72M]
  ------------------
 7439|  1.18M|        ent = xmlGetPredefinedEntity(name);
 7440|  1.18M|        if (ent != NULL)
  ------------------
  |  Branch (7440:13): [True: 461k, False: 722k]
  ------------------
 7441|   461k|            return(ent);
 7442|  1.18M|    }
 7443|       |
 7444|       |    /*
 7445|       |     * Ask first SAX for entity resolution, otherwise try the
 7446|       |     * entities which may have stored in the parser context.
 7447|       |     */
 7448|  3.44M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7448:9): [True: 3.44M, False: 0]
  ------------------
 7449|  3.44M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7449:6): [True: 3.44M, False: 0]
  ------------------
 7450|  3.44M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7451|  3.44M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7451:6): [True: 34.8k, False: 3.40M]
  |  Branch (7451:34): [True: 3.02k, False: 31.8k]
  ------------------
 7452|  3.02k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7452:6): [True: 1.06k, False: 1.95k]
  ------------------
 7453|  1.06k|	    ent = xmlGetPredefinedEntity(name);
 7454|  3.44M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7454:6): [True: 34.8k, False: 3.40M]
  |  Branch (7454:34): [True: 3.02k, False: 31.8k]
  ------------------
 7455|  3.02k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7455:6): [True: 3.02k, False: 0]
  ------------------
 7456|  3.02k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7457|  3.02k|	}
 7458|  3.44M|    }
 7459|       |
 7460|  3.44M|    if (ent == NULL) {
  ------------------
  |  Branch (7460:9): [True: 350k, False: 3.09M]
  ------------------
 7461|   350k|        xmlHandleUndeclaredEntity(ctxt, name);
 7462|   350k|    }
 7463|       |
 7464|       |    /*
 7465|       |     * [ WFC: Parsed Entity ]
 7466|       |     * An entity reference must not contain the name of an
 7467|       |     * unparsed entity
 7468|       |     */
 7469|  3.09M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7469:14): [True: 229, False: 3.09M]
  ------------------
 7470|    229|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7471|    229|		 "Entity reference to unparsed entity %s\n", name);
 7472|    229|        ent = NULL;
 7473|    229|    }
 7474|       |
 7475|       |    /*
 7476|       |     * [ WFC: No External Entity References ]
 7477|       |     * Attribute values cannot contain direct or indirect
 7478|       |     * entity references to external entities.
 7479|       |     */
 7480|  3.09M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7480:14): [True: 14.0k, False: 3.08M]
  ------------------
 7481|  14.0k|        if (inAttr) {
  ------------------
  |  Branch (7481:13): [True: 980, False: 13.0k]
  ------------------
 7482|    980|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7483|    980|                 "Attribute references external entity '%s'\n", name);
 7484|    980|            ent = NULL;
 7485|    980|        }
 7486|  14.0k|    }
 7487|       |
 7488|  3.44M|    return(ent);
 7489|  3.90M|}
parser.c:xmlParseEntityRefInternal:
 7500|  1.19M|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7501|  1.19M|    const xmlChar *name;
 7502|       |
 7503|  1.19M|    GROW;
  ------------------
  |  | 2308|  1.19M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.19M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.19M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 567k, False: 628k]
  |  |  ------------------
  |  | 2309|  1.19M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   567k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 309k, False: 257k]
  |  |  ------------------
  |  | 2310|  1.19M|	xmlParserGrow(ctxt);
  ------------------
 7504|       |
 7505|  1.19M|    if (RAW != '&')
  ------------------
  |  | 2261|  1.19M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7505:9): [True: 0, False: 1.19M]
  ------------------
 7506|      0|        return(NULL);
 7507|  1.19M|    NEXT;
  ------------------
  |  | 2316|  1.19M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7508|  1.19M|    name = xmlParseName(ctxt);
 7509|  1.19M|    if (name == NULL) {
  ------------------
  |  Branch (7509:9): [True: 58.9k, False: 1.13M]
  ------------------
 7510|  58.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7511|  58.9k|		       "xmlParseEntityRef: no name\n");
 7512|  58.9k|        return(NULL);
 7513|  58.9k|    }
 7514|  1.13M|    if (RAW != ';') {
  ------------------
  |  | 2261|  1.13M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7514:9): [True: 112k, False: 1.02M]
  ------------------
 7515|   112k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7516|   112k|	return(NULL);
 7517|   112k|    }
 7518|  1.02M|    NEXT;
  ------------------
  |  | 2316|  1.02M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7519|       |
 7520|  1.02M|    return(name);
 7521|  1.13M|}
parser.c:xmlParsePERefInternal:
 7636|   210k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7637|   210k|    const xmlChar *name;
 7638|   210k|    xmlEntityPtr entity = NULL;
 7639|   210k|    xmlParserInputPtr input;
 7640|       |
 7641|   210k|    if (RAW != '%')
  ------------------
  |  | 2261|   210k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7641:9): [True: 0, False: 210k]
  ------------------
 7642|      0|        return;
 7643|   210k|    NEXT;
  ------------------
  |  | 2316|   210k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7644|   210k|    name = xmlParseName(ctxt);
 7645|   210k|    if (name == NULL) {
  ------------------
  |  Branch (7645:9): [True: 15.3k, False: 195k]
  ------------------
 7646|  15.3k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7647|  15.3k|	return;
 7648|  15.3k|    }
 7649|   195k|    if (RAW != ';') {
  ------------------
  |  | 2261|   195k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7649:9): [True: 14.9k, False: 180k]
  ------------------
 7650|  14.9k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7651|  14.9k|        return;
 7652|  14.9k|    }
 7653|       |
 7654|   180k|    NEXT;
  ------------------
  |  | 2316|   180k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7655|       |
 7656|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7657|   180k|    ctxt->hasPErefs = 1;
 7658|       |
 7659|       |    /*
 7660|       |     * Request the entity from SAX
 7661|       |     */
 7662|   180k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7662:9): [True: 180k, False: 0]
  ------------------
 7663|   180k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7663:2): [True: 180k, False: 0]
  ------------------
 7664|   180k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7665|       |
 7666|   180k|    if (entity == NULL) {
  ------------------
  |  Branch (7666:9): [True: 53.7k, False: 126k]
  ------------------
 7667|  53.7k|        xmlHandleUndeclaredEntity(ctxt, name);
 7668|   126k|    } else {
 7669|       |	/*
 7670|       |	 * Internal checking in case the entity quest barfed
 7671|       |	 */
 7672|   126k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7672:6): [True: 119k, False: 7.88k]
  ------------------
 7673|   119k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7673:6): [True: 0, False: 119k]
  ------------------
 7674|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7675|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7676|      0|			  name, NULL);
 7677|   126k|	} else {
 7678|   126k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7678:10): [True: 119k, False: 7.88k]
  ------------------
 7679|   119k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7679:18): [True: 197, False: 118k]
  ------------------
 7680|   118k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   118k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7680:5): [True: 29.0k, False: 89.7k]
  ------------------
 7681|  29.0k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7681:5): [True: 13.3k, False: 15.7k]
  ------------------
 7682|  13.3k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7682:5): [True: 197, False: 13.1k]
  ------------------
 7683|    394|		return;
 7684|       |
 7685|   126k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   126k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7685:17): [True: 21, False: 126k]
  ------------------
 7686|     21|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7687|     21|                return;
 7688|     21|            }
 7689|       |
 7690|   126k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7691|   126k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7691:10): [True: 3.22k, False: 123k]
  ------------------
 7692|  3.22k|                xmlFreeInputStream(input);
 7693|  3.22k|		return;
 7694|  3.22k|            }
 7695|       |
 7696|   123k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   123k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7697|       |
 7698|   123k|            if (markupDecl)
  ------------------
  |  Branch (7698:17): [True: 111k, False: 12.2k]
  ------------------
 7699|   111k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|   111k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7700|       |
 7701|   123k|            GROW;
  ------------------
  |  | 2308|   123k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   123k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   123k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 123k, False: 0]
  |  |  ------------------
  |  | 2309|   123k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   123k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 81.0k, False: 42.2k]
  |  |  ------------------
  |  | 2310|   123k|	xmlParserGrow(ctxt);
  ------------------
 7702|       |
 7703|   123k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7703:10): [True: 115k, False: 7.88k]
  ------------------
 7704|   115k|                xmlDetectEncoding(ctxt);
 7705|       |
 7706|   115k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|   115k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   230k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 90.7k, False: 24.6k]
  |  |  |  |  |  Branch (2268:41): [True: 57.5k, False: 33.2k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   115k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 52.8k, False: 4.64k]
  |  |  |  |  |  Branch (2269:41): [True: 51.7k, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 49.7k, False: 2.03k]
  |  |  ------------------
  ------------------
 7707|  49.7k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  49.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  49.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 47.5k, False: 2.17k]
  |  |  |  |  ------------------
  |  |  |  |   91|  49.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.09k, False: 81]
  |  |  |  |  |  Branch (91:23): [True: 610, False: 1.48k]
  |  |  |  |  ------------------
  |  |  |  |   92|  49.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 596, False: 967]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7708|  48.7k|                    xmlParseTextDecl(ctxt);
 7709|  48.7k|                }
 7710|   115k|            }
 7711|   123k|	}
 7712|   126k|    }
 7713|   180k|}
parser.c:xmlErrAttributeDup:
  238|   107k|{
  239|   107k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 18.4k, False: 89.0k]
  ------------------
  240|  18.4k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  18.4k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  18.4k|                   "Attribute %s redefined\n", localname);
  243|  89.0k|    else
  244|  89.0k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  89.0k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|   107k|}
parser.c:xmlParseEndTag1:
 8344|   118k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8345|   118k|    const xmlChar *name;
 8346|       |
 8347|   118k|    GROW;
  ------------------
  |  | 2308|   118k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   118k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   118k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 108k, False: 10.0k]
  |  |  ------------------
  |  | 2309|   118k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   108k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.8k, False: 98.0k]
  |  |  ------------------
  |  | 2310|   118k|	xmlParserGrow(ctxt);
  ------------------
 8348|   118k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   118k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   118k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8348:9): [True: 21, False: 118k]
  |  Branch (8348:25): [True: 13, False: 118k]
  ------------------
 8349|     34|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8350|     34|		       "xmlParseEndTag: '</' not found\n");
 8351|     34|	return;
 8352|     34|    }
 8353|   118k|    SKIP(2);
  ------------------
  |  | 2285|   118k|#define SKIP(val) do {							\
  |  | 2286|   118k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   118k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 451, False: 118k]
  |  |  ------------------
  |  | 2288|   118k|        xmlParserGrow(ctxt);						\
  |  | 2289|   118k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 118k]
  |  |  ------------------
  ------------------
 8354|       |
 8355|   118k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8356|       |
 8357|       |    /*
 8358|       |     * We should definitely be at the ending "S? '>'" part
 8359|       |     */
 8360|   118k|    GROW;
  ------------------
  |  | 2308|   118k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   118k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   118k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 108k, False: 10.0k]
  |  |  ------------------
  |  | 2309|   118k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   108k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.9k, False: 97.9k]
  |  |  ------------------
  |  | 2310|   118k|	xmlParserGrow(ctxt);
  ------------------
 8361|   118k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   118k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8362|   118k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   118k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   118k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 114k, False: 4.14k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 114k]
  |  |  |  |  ------------------
  |  |  |  |  109|   118k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 118k]
  |  |  |  |  ------------------
  |  |  |  |  110|   118k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 114k, False: 4.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   114k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8362:33): [True: 5.05k, False: 109k]
  ------------------
 8363|  9.37k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8364|  9.37k|    } else
 8365|   109k|	NEXT1;
  ------------------
  |  | 2318|   109k|#define NEXT1 {								\
  |  | 2319|   109k|	ctxt->input->col++;						\
  |  | 2320|   109k|	ctxt->input->cur++;						\
  |  | 2321|   109k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.47k, False: 108k]
  |  |  ------------------
  |  | 2322|   109k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   109k|    }
  ------------------
 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|   118k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8373:9): [True: 6.61k, False: 112k]
  ------------------
 8374|  6.61k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  2.21k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8374:13): [True: 2.21k, False: 4.39k]
  ------------------
 8375|  6.61k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8376|  6.61k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8377|  6.61k|		                ctxt->name, line, name);
 8378|  6.61k|    }
 8379|       |
 8380|       |    /*
 8381|       |     * SAX: End of Tag
 8382|       |     */
 8383|   118k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8383:9): [True: 118k, False: 0]
  |  Branch (8383:32): [True: 118k, False: 0]
  ------------------
 8384|   118k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8384:2): [True: 71.6k, False: 47.2k]
  ------------------
 8385|  71.6k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8386|       |
 8387|   118k|    namePop(ctxt);
 8388|   118k|    spacePop(ctxt);
 8389|   118k|}
parser.c:xmlParseNameAndCompare:
 3340|   308k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3341|   308k|    register const xmlChar *cmp = other;
 3342|   308k|    register const xmlChar *in;
 3343|   308k|    const xmlChar *ret;
 3344|       |
 3345|   308k|    GROW;
  ------------------
  |  | 2308|   308k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   308k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   308k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 279k, False: 29.2k]
  |  |  ------------------
  |  | 2309|   308k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   279k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 21.2k, False: 258k]
  |  |  ------------------
  |  | 2310|   308k|	xmlParserGrow(ctxt);
  ------------------
 3346|       |
 3347|   308k|    in = ctxt->input->cur;
 3348|   681k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3348:12): [True: 677k, False: 4.33k]
  |  Branch (3348:24): [True: 373k, False: 304k]
  ------------------
 3349|   373k|	++in;
 3350|   373k|	++cmp;
 3351|   373k|    }
 3352|   308k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  10.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  10.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 700, False: 9.61k]
  |  |  |  |  ------------------
  |  |  |  |   91|  10.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 5.99k, False: 3.61k]
  |  |  |  |  |  Branch (91:23): [True: 1.39k, False: 4.59k]
  |  |  |  |  ------------------
  |  |  |  |   92|  10.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.15k, False: 7.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3352:9): [True: 295k, False: 13.0k]
  |  Branch (3352:23): [True: 285k, False: 10.3k]
  ------------------
 3353|       |	/* success */
 3354|   288k|	ctxt->input->col += in - ctxt->input->cur;
 3355|   288k|	ctxt->input->cur = in;
 3356|   288k|	return (const xmlChar*) 1;
 3357|   288k|    }
 3358|       |    /* failure (or end of input buffer), check with full function */
 3359|  20.0k|    ret = xmlParseName (ctxt);
 3360|       |    /* strings coming from the dictionary direct compare possible */
 3361|  20.0k|    if (ret == other) {
  ------------------
  |  Branch (3361:9): [True: 5.85k, False: 14.2k]
  ------------------
 3362|  5.85k|	return (const xmlChar*) 1;
 3363|  5.85k|    }
 3364|  14.2k|    return ret;
 3365|  20.0k|}
parser.c:namePop:
 2175|   919k|{
 2176|   919k|    const xmlChar *ret;
 2177|       |
 2178|   919k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2178:9): [True: 0, False: 919k]
  |  Branch (2178:27): [True: 2, False: 919k]
  ------------------
 2179|      2|        return (NULL);
 2180|   919k|    ctxt->nameNr--;
 2181|   919k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2181:9): [True: 909k, False: 9.37k]
  ------------------
 2182|   909k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2183|  9.37k|    else
 2184|  9.37k|        ctxt->name = NULL;
 2185|   919k|    ret = ctxt->nameTab[ctxt->nameNr];
 2186|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2187|   919k|    return (ret);
 2188|   919k|}
parser.c:spacePop:
 2216|  1.15M|static int spacePop(xmlParserCtxtPtr ctxt) {
 2217|  1.15M|    int ret;
 2218|  1.15M|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2218:9): [True: 0, False: 1.15M]
  ------------------
 2219|  1.15M|    ctxt->spaceNr--;
 2220|  1.15M|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2220:9): [True: 1.15M, False: 25]
  ------------------
 2221|  1.15M|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2222|     25|    else
 2223|     25|        ctxt->space = &ctxt->spaceTab[0];
 2224|  1.15M|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2225|  1.15M|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2226|  1.15M|    return(ret);
 2227|  1.15M|}
parser.c:xmlParseContentInternal:
 9577|  11.0k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9578|  11.0k|    int oldNameNr = ctxt->nameNr;
 9579|  11.0k|    int oldSpaceNr = ctxt->spaceNr;
 9580|  11.0k|    int oldNodeNr = ctxt->nodeNr;
 9581|       |
 9582|  11.0k|    GROW;
  ------------------
  |  | 2308|  11.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  11.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  11.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 11.0k, False: 0]
  |  |  ------------------
  |  | 2309|  11.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  11.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 8.70k, False: 2.35k]
  |  |  ------------------
  |  | 2310|  11.0k|	xmlParserGrow(ctxt);
  ------------------
 9583|  5.76M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9583:12): [True: 5.75M, False: 6.02k]
  ------------------
 9584|  5.75M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  5.75M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9584:5): [True: 5.75M, False: 420]
  ------------------
 9585|  5.75M|	const xmlChar *cur = ctxt->input->cur;
 9586|       |
 9587|       |	/*
 9588|       |	 * First case : a Processing Instruction.
 9589|       |	 */
 9590|  5.75M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9590:6): [True: 1.42M, False: 4.33M]
  |  Branch (9590:23): [True: 112k, False: 1.31M]
  ------------------
 9591|   112k|	    xmlParsePI(ctxt);
 9592|   112k|	}
 9593|       |
 9594|       |	/*
 9595|       |	 * Second case : a CDSection
 9596|       |	 */
 9597|       |	/* 2.6.0 test was *cur not RAW */
 9598|  5.64M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2279|  5.64M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  11.2M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  11.2M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  11.2M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  11.2M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  11.2M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 1.31M, False: 4.33M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 109k, False: 1.20M]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  5.64M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 74.1k, False: 35.5k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 73.3k, False: 810]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 72.9k, False: 397]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 72.5k, False: 374]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 72.3k, False: 234]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 72.0k, False: 259]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  5.64M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 71.8k, False: 236]
  |  |  ------------------
  ------------------
 9599|  71.8k|	    xmlParseCDSect(ctxt);
 9600|  71.8k|	}
 9601|       |
 9602|       |	/*
 9603|       |	 * Third case :  a comment
 9604|       |	 */
 9605|  5.57M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2263|  1.24M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9605:11): [True: 1.24M, False: 4.33M]
  |  Branch (9605:28): [True: 37.8k, False: 1.20M]
  ------------------
 9606|  37.8k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  37.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  22.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9606:4): [True: 22.5k, False: 15.2k]
  |  Branch (9606:23): [True: 22.2k, False: 295]
  ------------------
 9607|  22.2k|	    xmlParseComment(ctxt);
 9608|  22.2k|	}
 9609|       |
 9610|       |	/*
 9611|       |	 * Fourth case :  a sub-element.
 9612|       |	 */
 9613|  5.54M|	else if (*cur == '<') {
  ------------------
  |  Branch (9613:11): [True: 1.21M, False: 4.33M]
  ------------------
 9614|  1.21M|            if (NXT(1) == '/') {
  ------------------
  |  | 2263|  1.21M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9614:17): [True: 291k, False: 927k]
  ------------------
 9615|   291k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9615:21): [True: 4.61k, False: 286k]
  ------------------
 9616|  4.61k|                    break;
 9617|   286k|	        xmlParseElementEnd(ctxt);
 9618|   927k|            } else {
 9619|   927k|	        xmlParseElementStart(ctxt);
 9620|   927k|            }
 9621|  1.21M|	}
 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|  4.33M|	else if (*cur == '&') {
  ------------------
  |  Branch (9628:11): [True: 98.3k, False: 4.23M]
  ------------------
 9629|  98.3k|	    xmlParseReference(ctxt);
 9630|  98.3k|	}
 9631|       |
 9632|       |	/*
 9633|       |	 * Last case, text. Note that References are handled directly.
 9634|       |	 */
 9635|  4.23M|	else {
 9636|  4.23M|	    xmlParseCharDataInternal(ctxt, 0);
 9637|  4.23M|	}
 9638|       |
 9639|  5.75M|	SHRINK;
  ------------------
  |  | 2304|  5.75M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  5.75M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.75M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 5.75M, False: 0]
  |  |  ------------------
  |  | 2305|  5.75M|	xmlParserShrink(ctxt);
  ------------------
 9640|  5.75M|	GROW;
  ------------------
  |  | 2308|  5.75M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  5.75M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  5.75M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.75M, False: 0]
  |  |  ------------------
  |  | 2309|  5.75M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.75M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 139k, False: 5.61M]
  |  |  ------------------
  |  | 2310|  5.75M|	xmlParserGrow(ctxt);
  ------------------
 9641|  5.75M|    }
 9642|       |
 9643|  11.0k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9643:9): [True: 1.67k, False: 9.38k]
  ------------------
 9644|  1.67k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9644:9): [True: 1.49k, False: 182]
  ------------------
 9645|  1.49k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9645:9): [True: 29, False: 1.46k]
  ------------------
 9646|     29|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9647|     29|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9648|     29|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9649|     29|                "Premature end of data in tag %s line %d\n",
 9650|     29|                name, line, NULL);
 9651|     29|    }
 9652|       |
 9653|       |    /*
 9654|       |     * Clean up in error case
 9655|       |     */
 9656|       |
 9657|  86.1k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9657:12): [True: 75.1k, False: 11.0k]
  ------------------
 9658|  75.1k|        nodePop(ctxt);
 9659|       |
 9660|   109k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9660:12): [True: 98.4k, False: 11.0k]
  ------------------
 9661|  98.4k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9662|       |
 9663|  98.4k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9663:13): [True: 21.3k, False: 77.0k]
  ------------------
 9664|  21.3k|            xmlParserNsPop(ctxt, tag->nsNr);
 9665|       |
 9666|  98.4k|        namePop(ctxt);
 9667|  98.4k|    }
 9668|       |
 9669|   109k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9669:12): [True: 98.4k, False: 11.0k]
  ------------------
 9670|  98.4k|        spacePop(ctxt);
 9671|  11.0k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   316k|{
  333|   316k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   316k|}
parser.c:xmlParseElementStart:
 9736|   936k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9737|   936k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9737:20): [True: 638k, False: 297k]
  ------------------
 9738|   936k|    const xmlChar *name;
 9739|   936k|    const xmlChar *prefix = NULL;
 9740|   936k|    const xmlChar *URI = NULL;
 9741|   936k|    xmlParserNodeInfo node_info;
 9742|   936k|    int line;
 9743|   936k|    xmlNodePtr cur;
 9744|   936k|    int nbNs = 0;
 9745|       |
 9746|   936k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9746:9): [True: 10, False: 936k]
  ------------------
 9747|     10|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9748|     10|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9749|     10|                ctxt->nameNr);
 9750|     10|	return(-1);
 9751|     10|    }
 9752|       |
 9753|       |    /* Capture start position */
 9754|   936k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9754:9): [True: 0, False: 936k]
  ------------------
 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|   936k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9760:9): [True: 0, False: 936k]
  ------------------
 9761|      0|	spacePush(ctxt, -1);
 9762|   936k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9762:14): [True: 146k, False: 789k]
  ------------------
 9763|   146k|	spacePush(ctxt, -1);
 9764|   789k|    else
 9765|   789k|	spacePush(ctxt, *ctxt->space);
 9766|       |
 9767|   936k|    line = ctxt->input->line;
 9768|   936k|#ifdef LIBXML_SAX1_ENABLED
 9769|   936k|    if (ctxt->sax2)
  ------------------
  |  Branch (9769:9): [True: 554k, False: 381k]
  ------------------
 9770|   554k|#endif /* LIBXML_SAX1_ENABLED */
 9771|   554k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9772|   381k|#ifdef LIBXML_SAX1_ENABLED
 9773|   381k|    else
 9774|   381k|	name = xmlParseStartTag(ctxt);
 9775|   936k|#endif /* LIBXML_SAX1_ENABLED */
 9776|   936k|    if (name == NULL) {
  ------------------
  |  Branch (9776:9): [True: 32.1k, False: 903k]
  ------------------
 9777|  32.1k|	spacePop(ctxt);
 9778|  32.1k|        return(-1);
 9779|  32.1k|    }
 9780|   903k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9781|   903k|    cur = ctxt->node;
 9782|       |
 9783|   903k|#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|   903k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9789:9): [True: 262k, False: 641k]
  |  Branch (9789:27): [True: 9.47k, False: 252k]
  |  Branch (9789:47): [True: 9.47k, False: 0]
  ------------------
 9790|  9.47k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9790:9): [True: 9.47k, False: 0]
  |  Branch (9790:23): [True: 0, False: 9.47k]
  ------------------
 9791|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9792|   903k|#endif /* LIBXML_VALID_ENABLED */
 9793|       |
 9794|       |    /*
 9795|       |     * Check for an Empty Element.
 9796|       |     */
 9797|   903k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   903k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   232k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9797:9): [True: 232k, False: 671k]
  |  Branch (9797:25): [True: 224k, False: 8.32k]
  ------------------
 9798|   224k|        SKIP(2);
  ------------------
  |  | 2285|   224k|#define SKIP(val) do {							\
  |  | 2286|   224k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   224k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 831, False: 223k]
  |  |  ------------------
  |  | 2288|   224k|        xmlParserGrow(ctxt);						\
  |  | 2289|   224k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 224k]
  |  |  ------------------
  ------------------
 9799|   224k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9799:6): [True: 108k, False: 115k]
  ------------------
 9800|   108k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9800:10): [True: 108k, False: 0]
  |  Branch (9800:33): [True: 108k, False: 0]
  ------------------
 9801|   108k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9801:3): [True: 73.6k, False: 34.7k]
  ------------------
 9802|  73.6k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9803|   108k|#ifdef LIBXML_SAX1_ENABLED
 9804|   115k|	} else {
 9805|   115k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9805:10): [True: 115k, False: 0]
  |  Branch (9805:33): [True: 115k, False: 0]
  ------------------
 9806|   115k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9806:3): [True: 92.7k, False: 22.8k]
  ------------------
 9807|  92.7k|		ctxt->sax->endElement(ctxt->userData, name);
 9808|   115k|#endif /* LIBXML_SAX1_ENABLED */
 9809|   115k|	}
 9810|   224k|	namePop(ctxt);
 9811|   224k|	spacePop(ctxt);
 9812|   224k|	if (nbNs > 0)
  ------------------
  |  Branch (9812:6): [True: 33.5k, False: 190k]
  ------------------
 9813|  33.5k|	    xmlParserNsPop(ctxt, nbNs);
 9814|   224k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9814:6): [True: 167k, False: 56.9k]
  |  Branch (9814:21): [True: 0, False: 167k]
  ------------------
 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|   224k|	return(1);
 9822|   224k|    }
 9823|   679k|    if (RAW == '>') {
  ------------------
  |  | 2261|   679k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9823:9): [True: 390k, False: 289k]
  ------------------
 9824|   390k|        NEXT1;
  ------------------
  |  | 2318|   390k|#define NEXT1 {								\
  |  | 2319|   390k|	ctxt->input->col++;						\
  |  | 2320|   390k|	ctxt->input->cur++;						\
  |  | 2321|   390k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 954, False: 389k]
  |  |  ------------------
  |  | 2322|   390k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   390k|    }
  ------------------
 9825|   390k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9825:13): [True: 287k, False: 102k]
  |  Branch (9825:28): [True: 0, False: 287k]
  ------------------
 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|   390k|    } else {
 9832|   289k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9833|   289k|		     "Couldn't find end of Start Tag %s line %d\n",
 9834|   289k|		                name, line, NULL);
 9835|       |
 9836|       |	/*
 9837|       |	 * end of parsing of this node.
 9838|       |	 */
 9839|   289k|	nodePop(ctxt);
 9840|   289k|	namePop(ctxt);
 9841|   289k|	spacePop(ctxt);
 9842|   289k|	if (nbNs > 0)
  ------------------
  |  Branch (9842:6): [True: 127k, False: 161k]
  ------------------
 9843|   127k|	    xmlParserNsPop(ctxt, nbNs);
 9844|   289k|	return(-1);
 9845|   289k|    }
 9846|       |
 9847|   390k|    return(0);
 9848|   679k|}
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: 90.3k, False: 1.20M]
  ------------------
 2192|  90.3k|        int *tmp;
 2193|  90.3k|        int newSize;
 2194|       |
 2195|  90.3k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2196|  90.3k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  90.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2197|  90.3k|        if (newSize < 0) {
  ------------------
  |  Branch (2197:13): [True: 0, False: 90.3k]
  ------------------
 2198|      0|	    xmlErrMemory(ctxt);
 2199|      0|	    return(-1);
 2200|      0|        }
 2201|       |
 2202|  90.3k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2203|  90.3k|        if (tmp == NULL) {
  ------------------
  |  Branch (2203:13): [True: 53, False: 90.2k]
  ------------------
 2204|     53|	    xmlErrMemory(ctxt);
 2205|     53|	    return(-1);
 2206|     53|	}
 2207|  90.2k|	ctxt->spaceTab = tmp;
 2208|       |
 2209|  90.2k|        ctxt->spaceMax = newSize;
 2210|  90.2k|    }
 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|   805k|                  const xmlChar **URI, int *nbNsPtr) {
 8789|   805k|    xmlHashedString hlocalname;
 8790|   805k|    xmlHashedString hprefix;
 8791|   805k|    xmlHashedString hattname;
 8792|   805k|    xmlHashedString haprefix;
 8793|   805k|    const xmlChar *localname;
 8794|   805k|    const xmlChar *prefix;
 8795|   805k|    const xmlChar *attname;
 8796|   805k|    const xmlChar *aprefix;
 8797|   805k|    const xmlChar *uri;
 8798|   805k|    xmlChar *attvalue = NULL;
 8799|   805k|    const xmlChar **atts = ctxt->atts;
 8800|   805k|    unsigned attrHashSize = 0;
 8801|   805k|    int maxatts = ctxt->maxatts;
 8802|   805k|    int nratts, nbatts, nbdef;
 8803|   805k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8804|   805k|    int alloc = 0;
 8805|   805k|    int numNsErr = 0;
 8806|   805k|    int numDupErr = 0;
 8807|       |
 8808|   805k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   805k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8808:9): [True: 0, False: 805k]
  ------------------
 8809|   805k|    NEXT1;
  ------------------
  |  | 2318|   805k|#define NEXT1 {								\
  |  | 2319|   805k|	ctxt->input->col++;						\
  |  | 2320|   805k|	ctxt->input->cur++;						\
  |  | 2321|   805k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 842, False: 805k]
  |  |  ------------------
  |  | 2322|   805k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   805k|    }
  ------------------
 8810|       |
 8811|   805k|    nbatts = 0;
 8812|   805k|    nratts = 0;
 8813|   805k|    nbdef = 0;
 8814|   805k|    nbNs = 0;
 8815|   805k|    nbTotalDef = 0;
 8816|   805k|    attval = 0;
 8817|       |
 8818|   805k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8818:9): [True: 0, False: 805k]
  ------------------
 8819|      0|        xmlErrMemory(ctxt);
 8820|      0|        return(NULL);
 8821|      0|    }
 8822|       |
 8823|   805k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8824|   805k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8824:9): [True: 18.1k, False: 787k]
  ------------------
 8825|  18.1k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8826|  18.1k|		       "StartTag: invalid element name\n");
 8827|  18.1k|        return(NULL);
 8828|  18.1k|    }
 8829|   787k|    localname = hlocalname.name;
 8830|   787k|    prefix = hprefix.name;
 8831|       |
 8832|       |    /*
 8833|       |     * Now parse the attributes, it ends up with the ending
 8834|       |     *
 8835|       |     * (S Attribute)* S?
 8836|       |     */
 8837|   787k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   787k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8838|   787k|    GROW;
  ------------------
  |  | 2308|   787k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   787k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   787k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 537k, False: 249k]
  |  |  ------------------
  |  | 2309|   787k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   537k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 35.7k, False: 502k]
  |  |  ------------------
  |  | 2310|   787k|	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|   935k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   935k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8864:13): [True: 616k, False: 319k]
  ------------------
 8865|   616k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   616k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|   174k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8865:6): [True: 441k, False: 174k]
  |  Branch (8865:22): [True: 6.25k, False: 168k]
  ------------------
 8866|   447k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   447k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   447k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 438k, False: 8.99k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 438k]
  |  |  |  |  ------------------
  |  |  |  |  109|   447k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 447k]
  |  |  |  |  ------------------
  |  |  |  |  110|   447k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 438k, False: 9.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   438k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8866:29): [True: 437k, False: 37]
  ------------------
 8867|   437k|	int len = -1;
 8868|       |
 8869|   437k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8870|   437k|                                          &haprefix, &attvalue, &len,
 8871|   437k|                                          &alloc);
 8872|   437k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8872:13): [True: 174k, False: 263k]
  ------------------
 8873|   174k|	    break;
 8874|   263k|        if (attvalue == NULL)
  ------------------
  |  Branch (8874:13): [True: 21.2k, False: 241k]
  ------------------
 8875|  21.2k|            goto next_attr;
 8876|   241k|        attname = hattname.name;
 8877|   241k|        aprefix = haprefix.name;
 8878|   241k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8878:6): [True: 0, False: 241k]
  ------------------
 8879|       |
 8880|   241k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8880:13): [True: 14.2k, False: 227k]
  |  Branch (8880:45): [True: 13.7k, False: 502]
  ------------------
 8881|  13.7k|            xmlHashedString huri;
 8882|  13.7k|            xmlURIPtr parsedUri;
 8883|       |
 8884|  13.7k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8885|  13.7k|            uri = huri.name;
 8886|  13.7k|            if (uri == NULL) {
  ------------------
  |  Branch (8886:17): [True: 1, False: 13.7k]
  ------------------
 8887|      1|                xmlErrMemory(ctxt);
 8888|      1|                goto next_attr;
 8889|      1|            }
 8890|  13.7k|            if (*uri != 0) {
  ------------------
  |  Branch (8890:17): [True: 6.66k, False: 7.04k]
  ------------------
 8891|  6.66k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8891:21): [True: 26, False: 6.63k]
  ------------------
 8892|     26|                    xmlErrMemory(ctxt);
 8893|     26|                    goto next_attr;
 8894|     26|                }
 8895|  6.63k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8895:21): [True: 1.91k, False: 4.71k]
  ------------------
 8896|  1.91k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8897|  1.91k|                             "xmlns: '%s' is not a valid URI\n",
 8898|  1.91k|                                       uri, NULL, NULL);
 8899|  4.71k|                } else {
 8900|  4.71k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8900:25): [True: 2.74k, False: 1.97k]
  ------------------
 8901|  2.74k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8902|  2.74k|                                  "xmlns: URI %s is not absolute\n",
 8903|  2.74k|                                  uri, NULL, NULL);
 8904|  2.74k|                    }
 8905|  4.71k|                    xmlFreeURI(parsedUri);
 8906|  4.71k|                }
 8907|  6.63k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8907:21): [True: 198, False: 6.43k]
  ------------------
 8908|    198|                    if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8908:25): [True: 198, False: 0]
  ------------------
 8909|    198|                        xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8910|    198|                     "xml namespace URI cannot be the default namespace\n",
 8911|    198|                                 NULL, NULL, NULL);
 8912|    198|                    }
 8913|    198|                    goto next_attr;
 8914|    198|                }
 8915|  6.43k|                if ((len == 29) &&
  ------------------
  |  Branch (8915:21): [True: 827, False: 5.61k]
  ------------------
 8916|    827|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8916:21): [True: 341, False: 486]
  ------------------
 8917|    827|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    827|#define BAD_CAST (xmlChar *)
  ------------------
 8918|    341|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8919|    341|                         "reuse of the xmlns namespace name is forbidden\n",
 8920|    341|                             NULL, NULL, NULL);
 8921|    341|                    goto next_attr;
 8922|    341|                }
 8923|  6.43k|            }
 8924|       |
 8925|  13.1k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8925:17): [True: 7.96k, False: 5.17k]
  ------------------
 8926|  7.96k|                nbNs++;
 8927|   228k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8927:20): [True: 61.3k, False: 166k]
  ------------------
 8928|  61.3k|            xmlHashedString huri;
 8929|  61.3k|            xmlURIPtr parsedUri;
 8930|       |
 8931|  61.3k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8932|  61.3k|            uri = huri.name;
 8933|  61.3k|            if (uri == NULL) {
  ------------------
  |  Branch (8933:17): [True: 1, False: 61.3k]
  ------------------
 8934|      1|                xmlErrMemory(ctxt);
 8935|      1|                goto next_attr;
 8936|      1|            }
 8937|       |
 8938|  61.3k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8938:17): [True: 456, False: 60.9k]
  ------------------
 8939|    456|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8939:21): [True: 248, False: 208]
  ------------------
 8940|    248|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8941|    248|                             "xml namespace prefix mapped to wrong URI\n",
 8942|    248|                             NULL, NULL, NULL);
 8943|    248|                }
 8944|       |                /*
 8945|       |                 * Do not keep a namespace definition node
 8946|       |                 */
 8947|    456|                goto next_attr;
 8948|    456|            }
 8949|  60.9k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8949:17): [True: 368, False: 60.5k]
  ------------------
 8950|    368|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8950:21): [True: 368, False: 0]
  ------------------
 8951|    368|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8952|    368|                             "xml namespace URI mapped to wrong prefix\n",
 8953|    368|                             NULL, NULL, NULL);
 8954|    368|                }
 8955|    368|                goto next_attr;
 8956|    368|            }
 8957|  60.5k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8957:17): [True: 365, False: 60.1k]
  ------------------
 8958|    365|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8959|    365|                         "redefinition of the xmlns prefix is forbidden\n",
 8960|    365|                         NULL, NULL, NULL);
 8961|    365|                goto next_attr;
 8962|    365|            }
 8963|  60.1k|            if ((len == 29) &&
  ------------------
  |  Branch (8963:17): [True: 470, False: 59.7k]
  ------------------
 8964|    470|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8964:17): [True: 196, False: 274]
  ------------------
 8965|    470|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    470|#define BAD_CAST (xmlChar *)
  ------------------
 8966|    196|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8967|    196|                         "reuse of the xmlns namespace name is forbidden\n",
 8968|    196|                         NULL, NULL, NULL);
 8969|    196|                goto next_attr;
 8970|    196|            }
 8971|  59.9k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8971:17): [True: 0, False: 59.9k]
  |  Branch (8971:34): [True: 244, False: 59.7k]
  ------------------
 8972|    244|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8973|    244|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8974|    244|                              attname, NULL, NULL);
 8975|    244|                goto next_attr;
 8976|  59.7k|            } else {
 8977|  59.7k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8977:21): [True: 6, False: 59.7k]
  ------------------
 8978|      6|                    xmlErrMemory(ctxt);
 8979|      6|                    goto next_attr;
 8980|      6|                }
 8981|  59.7k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8981:21): [True: 4.51k, False: 55.2k]
  ------------------
 8982|  4.51k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8983|  4.51k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8984|  4.51k|                                       attname, uri, NULL);
 8985|  55.2k|                } else {
 8986|  55.2k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8986:25): [True: 6.39k, False: 48.8k]
  |  Branch (8986:45): [True: 4.63k, False: 1.75k]
  ------------------
 8987|  4.63k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8988|  4.63k|                                  "xmlns:%s: URI %s is not absolute\n",
 8989|  4.63k|                                  attname, uri, NULL);
 8990|  4.63k|                    }
 8991|  55.2k|                    xmlFreeURI(parsedUri);
 8992|  55.2k|                }
 8993|  59.7k|            }
 8994|       |
 8995|  59.7k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8995:17): [True: 58.3k, False: 1.43k]
  ------------------
 8996|  58.3k|                nbNs++;
 8997|   166k|        } else {
 8998|       |            /*
 8999|       |             * Populate attributes array, see above for repurposing
 9000|       |             * of xmlChar pointers.
 9001|       |             */
 9002|   166k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9002:17): [True: 12.3k, False: 154k]
  |  Branch (9002:35): [True: 10.5k, False: 144k]
  ------------------
 9003|  22.8k|                int res = xmlCtxtGrowAttrs(ctxt);
 9004|       |
 9005|  22.8k|                maxatts = ctxt->maxatts;
 9006|  22.8k|                atts = ctxt->atts;
 9007|       |
 9008|  22.8k|                if (res < 0)
  ------------------
  |  Branch (9008:21): [True: 7, False: 22.8k]
  ------------------
 9009|      7|                    goto next_attr;
 9010|  22.8k|            }
 9011|   166k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 9012|   166k|                                        ((unsigned) alloc << 31);
 9013|   166k|            atts[nbatts++] = attname;
 9014|   166k|            atts[nbatts++] = aprefix;
 9015|   166k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   166k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9016|   166k|            if (alloc) {
  ------------------
  |  Branch (9016:17): [True: 28.4k, False: 138k]
  ------------------
 9017|  28.4k|                atts[nbatts++] = attvalue;
 9018|  28.4k|                attvalue += len;
 9019|  28.4k|                atts[nbatts++] = attvalue;
 9020|   138k|            } 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|   138k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   138k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9027|   138k|                attvalue += len;
 9028|   138k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   138k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9029|   138k|            }
 9030|       |            /*
 9031|       |             * tag if some deallocation is needed
 9032|       |             */
 9033|   166k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (9033:17): [True: 28.4k, False: 138k]
  ------------------
 9034|   166k|            attvalue = NULL; /* moved into atts */
 9035|   166k|        }
 9036|       |
 9037|   263k|next_attr:
 9038|   263k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9038:13): [True: 75.0k, False: 188k]
  |  Branch (9038:35): [True: 4.60k, False: 70.4k]
  ------------------
 9039|  4.60k|            xmlFree(attvalue);
 9040|  4.60k|            attvalue = NULL;
 9041|  4.60k|        }
 9042|       |
 9043|   263k|	GROW
  ------------------
  |  | 2308|   263k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   263k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   263k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 92.0k, False: 171k]
  |  |  ------------------
  |  | 2309|   263k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  92.0k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.0k, False: 80.0k]
  |  |  ------------------
  |  | 2310|   263k|	xmlParserGrow(ctxt);
  ------------------
 9044|   263k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   263k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   227k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  52.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9044:6): [True: 35.4k, False: 227k]
  |  Branch (9044:24): [True: 52.5k, False: 175k]
  |  Branch (9044:40): [True: 51.7k, False: 745]
  ------------------
 9045|  87.2k|	    break;
 9046|   176k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   176k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9046:6): [True: 27.7k, False: 148k]
  ------------------
 9047|  27.7k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9048|  27.7k|			   "attributes construct error\n");
 9049|  27.7k|	    break;
 9050|  27.7k|	}
 9051|   148k|        GROW;
  ------------------
  |  | 2308|   148k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   148k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   148k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 26.5k, False: 121k]
  |  |  ------------------
  |  | 2309|   148k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  26.5k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.84k, False: 20.6k]
  |  |  ------------------
  |  | 2310|   148k|	xmlParserGrow(ctxt);
  ------------------
 9052|   148k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Namespaces from default attributes
 9056|       |     */
 9057|   787k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9057:9): [True: 360k, False: 427k]
  ------------------
 9058|   360k|        xmlDefAttrsPtr defaults;
 9059|       |
 9060|   360k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9061|   360k|	if (defaults != NULL) {
  ------------------
  |  Branch (9061:6): [True: 275k, False: 85.4k]
  ------------------
 9062|  1.03M|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9062:18): [True: 754k, False: 275k]
  ------------------
 9063|   754k|                xmlDefAttr *attr = &defaults->attrs[i];
 9064|       |
 9065|   754k|	        attname = attr->name.name;
 9066|   754k|		aprefix = attr->prefix.name;
 9067|       |
 9068|   754k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9068:7): [True: 38.4k, False: 716k]
  |  Branch (9068:39): [True: 36.2k, False: 2.16k]
  ------------------
 9069|  36.2k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9070|       |
 9071|  36.2k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9071:25): [True: 34.8k, False: 1.42k]
  ------------------
 9072|  34.8k|                        nbNs++;
 9073|   718k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9073:14): [True: 381k, False: 337k]
  ------------------
 9074|   381k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9075|       |
 9076|   381k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9076:25): [True: 354k, False: 26.5k]
  ------------------
 9077|   381k|                                      NULL, 1) > 0)
 9078|   354k|                        nbNs++;
 9079|   381k|		} else {
 9080|   337k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   337k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9080:25): [True: 0, False: 337k]
  ------------------
 9081|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9082|      0|                                    "Maximum number of attributes exceeded");
 9083|      0|                        break;
 9084|      0|                    }
 9085|   337k|                    nbTotalDef += 1;
 9086|   337k|                }
 9087|   754k|	    }
 9088|   275k|	}
 9089|   360k|    }
 9090|       |
 9091|       |    /*
 9092|       |     * Resolve attribute namespaces
 9093|       |     */
 9094|   954k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9094:17): [True: 166k, False: 787k]
  ------------------
 9095|   166k|        attname = atts[i];
 9096|   166k|        aprefix = atts[i+1];
 9097|       |
 9098|       |        /*
 9099|       |	* The default namespace does not apply to attribute names.
 9100|       |	*/
 9101|   166k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9101:6): [True: 53.3k, False: 113k]
  ------------------
 9102|  53.3k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  53.3k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9103|   113k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9103:20): [True: 90.5k, False: 23.0k]
  ------------------
 9104|  90.5k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  90.5k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9105|  90.5k|        } else {
 9106|  23.0k|            haprefix.name = aprefix;
 9107|  23.0k|            haprefix.hashValue = (size_t) atts[i+2];
 9108|  23.0k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9109|       |
 9110|  23.0k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9110:10): [True: 13.2k, False: 9.77k]
  |  Branch (9110:34): [True: 224, False: 9.55k]
  ------------------
 9111|  13.4k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9112|  13.4k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9113|  13.4k|		    aprefix, attname, localname);
 9114|  13.4k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  13.4k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9115|  13.4k|            }
 9116|  23.0k|        }
 9117|       |
 9118|   166k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   166k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9119|   166k|    }
 9120|       |
 9121|       |    /*
 9122|       |     * Maximum number of attributes including default attributes.
 9123|       |     */
 9124|   787k|    maxAtts = nratts + nbTotalDef;
 9125|       |
 9126|       |    /*
 9127|       |     * Verify that attribute names are unique.
 9128|       |     */
 9129|   787k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9129:9): [True: 57.7k, False: 729k]
  ------------------
 9130|  57.7k|        attrHashSize = 4;
 9131|   145k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9131:16): [True: 87.3k, False: 57.7k]
  ------------------
 9132|  87.3k|            attrHashSize *= 2;
 9133|       |
 9134|  57.7k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9134:13): [True: 7.28k, False: 50.4k]
  ------------------
 9135|  7.28k|            xmlAttrHashBucket *tmp;
 9136|       |
 9137|  7.28k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9138|  7.28k|            if (tmp == NULL) {
  ------------------
  |  Branch (9138:17): [True: 2, False: 7.27k]
  ------------------
 9139|      2|                xmlErrMemory(ctxt);
 9140|      2|                goto done;
 9141|      2|            }
 9142|       |
 9143|  7.27k|            ctxt->attrHash = tmp;
 9144|  7.27k|            ctxt->attrHashMax = attrHashSize;
 9145|  7.27k|        }
 9146|       |
 9147|  57.7k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9148|       |
 9149|   191k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9149:28): [True: 133k, False: 57.7k]
  ------------------
 9150|   133k|            const xmlChar *nsuri;
 9151|   133k|            unsigned hashValue, nameHashValue, uriHashValue;
 9152|   133k|            int res;
 9153|       |
 9154|   133k|            attname = atts[i];
 9155|   133k|            aprefix = atts[i+1];
 9156|   133k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   133k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9157|       |            /* Hash values always have bit 31 set, see dict.c */
 9158|   133k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9159|       |
 9160|   133k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|   133k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9160:17): [True: 40.6k, False: 93.2k]
  ------------------
 9161|       |                /*
 9162|       |                 * Prefix with empty namespace means an undeclared
 9163|       |                 * prefix which was already reported above.
 9164|       |                 */
 9165|  40.6k|                if (aprefix != NULL)
  ------------------
  |  Branch (9165:21): [True: 10.9k, False: 29.7k]
  ------------------
 9166|  10.9k|                    continue;
 9167|  29.7k|                nsuri = NULL;
 9168|  29.7k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  29.7k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9169|  93.2k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  93.2k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9169:24): [True: 84.3k, False: 8.92k]
  ------------------
 9170|  84.3k|                nsuri = ctxt->str_xml_ns;
 9171|  84.3k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  84.3k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9172|  84.3k|            } else {
 9173|  8.92k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9174|  8.92k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9175|  8.92k|            }
 9176|       |
 9177|   122k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9178|   122k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9179|   122k|                                    hashValue, i);
 9180|   122k|            if (res < 0)
  ------------------
  |  Branch (9180:17): [True: 0, False: 122k]
  ------------------
 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|   122k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9189:17): [True: 94.3k, False: 28.6k]
  ------------------
 9190|  94.3k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9190:21): [True: 90.9k, False: 3.34k]
  ------------------
 9191|  90.9k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9192|  90.9k|                    numDupErr += 1;
 9193|  90.9k|                } else {
 9194|  3.34k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9195|  3.34k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9196|  3.34k|                             attname, nsuri, NULL);
 9197|  3.34k|                    numNsErr += 1;
 9198|  3.34k|                }
 9199|  94.3k|            }
 9200|   122k|        }
 9201|  57.7k|    }
 9202|       |
 9203|       |    /*
 9204|       |     * Default attributes
 9205|       |     */
 9206|   787k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9206:9): [True: 360k, False: 427k]
  ------------------
 9207|   360k|        xmlDefAttrsPtr defaults;
 9208|       |
 9209|   360k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9210|   360k|	if (defaults != NULL) {
  ------------------
  |  Branch (9210:6): [True: 275k, False: 85.4k]
  ------------------
 9211|  1.03M|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9211:18): [True: 754k, False: 275k]
  ------------------
 9212|   754k|                xmlDefAttr *attr = &defaults->attrs[i];
 9213|   754k|                const xmlChar *nsuri = NULL;
 9214|   754k|                unsigned hashValue, uriHashValue = 0;
 9215|   754k|                int res;
 9216|       |
 9217|   754k|	        attname = attr->name.name;
 9218|   754k|		aprefix = attr->prefix.name;
 9219|       |
 9220|   754k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9220:7): [True: 38.4k, False: 716k]
  |  Branch (9220:39): [True: 36.2k, False: 2.16k]
  ------------------
 9221|  36.2k|                    continue;
 9222|   718k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9222:7): [True: 381k, False: 337k]
  ------------------
 9223|   381k|                    continue;
 9224|       |
 9225|   337k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9225:21): [True: 142k, False: 194k]
  ------------------
 9226|   142k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   142k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9227|   142k|                    nsuri = NULL;
 9228|   142k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   142k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9229|   194k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9229:28): [True: 50.3k, False: 144k]
  ------------------
 9230|  50.3k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  50.3k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9231|  50.3k|                    nsuri = ctxt->str_xml_ns;
 9232|  50.3k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  50.3k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9233|   144k|                } else {
 9234|   144k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9235|   144k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9235:25): [True: 122k, False: 21.4k]
  ------------------
 9236|   123k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9236:25): [True: 253, False: 21.1k]
  ------------------
 9237|   123k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9238|   123k|                                 "Namespace prefix %s for %s on %s is not "
 9239|   123k|                                 "defined\n",
 9240|   123k|                                 aprefix, attname, localname);
 9241|   123k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   123k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9242|   123k|                        nsuri = NULL;
 9243|   123k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   123k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9244|   123k|                    } else {
 9245|  21.1k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9246|  21.1k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9247|  21.1k|                    }
 9248|   144k|                }
 9249|       |
 9250|       |                /*
 9251|       |                 * Check whether the attribute exists
 9252|       |                 */
 9253|   337k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9253:21): [True: 301k, False: 35.9k]
  ------------------
 9254|   301k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9255|   301k|                                                   uriHashValue);
 9256|   301k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9257|   301k|                                            hashValue, nbatts);
 9258|   301k|                    if (res < 0)
  ------------------
  |  Branch (9258:25): [True: 0, False: 301k]
  ------------------
 9259|      0|                        continue;
 9260|   301k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9260:25): [True: 10.1k, False: 291k]
  ------------------
 9261|  10.1k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9261:29): [True: 1.09k, False: 9.02k]
  ------------------
 9262|  1.09k|                            continue;
 9263|  9.02k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9264|  9.02k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9265|  9.02k|                                 attname, nsuri, NULL);
 9266|  9.02k|                    }
 9267|   301k|                }
 9268|       |
 9269|   336k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9270|       |
 9271|   336k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9271:21): [True: 1.44k, False: 334k]
  |  Branch (9271:39): [True: 1.08k, False: 333k]
  ------------------
 9272|  2.52k|                    res = xmlCtxtGrowAttrs(ctxt);
 9273|       |
 9274|  2.52k|                    maxatts = ctxt->maxatts;
 9275|  2.52k|                    atts = ctxt->atts;
 9276|       |
 9277|  2.52k|                    if (res < 0) {
  ------------------
  |  Branch (9277:25): [True: 3, False: 2.52k]
  ------------------
 9278|      3|                        localname = NULL;
 9279|      3|                        goto done;
 9280|      3|                    }
 9281|  2.52k|                }
 9282|       |
 9283|   336k|                atts[nbatts++] = attname;
 9284|   336k|                atts[nbatts++] = aprefix;
 9285|   336k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   336k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9286|   336k|                atts[nbatts++] = attr->value.name;
 9287|   336k|                atts[nbatts++] = attr->valueEnd;
 9288|       |
 9289|   336k|#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|   336k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9294:21): [True: 209k, False: 126k]
  ------------------
 9295|   209k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9295:21): [True: 1.02k, False: 208k]
  ------------------
 9296|  1.02k|                    (attr->external != 0)) {
  ------------------
  |  Branch (9296:21): [True: 816, False: 212]
  ------------------
 9297|    816|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9298|    816|                            "standalone: attribute %s on %s defaulted "
 9299|    816|                            "from external subset\n",
 9300|    816|                            attname, localname);
 9301|    816|                }
 9302|   336k|#endif
 9303|   336k|                nbdef++;
 9304|   336k|	    }
 9305|   275k|	}
 9306|   360k|    }
 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|   787k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9320:9): [True: 786k, False: 1.07k]
  |  Branch (9320:29): [True: 958, False: 785k]
  ------------------
 9321|    958|        memset(ctxt->attrHash, -1,
 9322|    958|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9323|       |
 9324|  6.62k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9324:28): [True: 5.67k, False: 958]
  ------------------
 9325|  5.67k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9326|  5.67k|            int res;
 9327|       |
 9328|  5.67k|            aprefix = atts[i+1];
 9329|  5.67k|            if (aprefix == NULL)
  ------------------
  |  Branch (9329:17): [True: 338, False: 5.33k]
  ------------------
 9330|    338|                continue;
 9331|       |
 9332|  5.33k|            attname = atts[i];
 9333|       |            /* Hash values always have bit 31 set, see dict.c */
 9334|  5.33k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9335|  5.33k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9336|       |
 9337|  5.33k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9338|  5.33k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9339|  5.33k|                                         aprefix, hashValue, i);
 9340|  5.33k|            if (res < INT_MAX)
  ------------------
  |  Branch (9340:17): [True: 2.41k, False: 2.91k]
  ------------------
 9341|  2.41k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9342|  5.33k|        }
 9343|    958|    }
 9344|       |
 9345|       |    /*
 9346|       |     * Reconstruct attribute pointers
 9347|       |     */
 9348|  1.29M|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9348:24): [True: 503k, False: 787k]
  ------------------
 9349|       |        /* namespace URI */
 9350|   503k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   503k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9351|   503k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9351:13): [True: 331k, False: 171k]
  ------------------
 9352|   331k|            atts[i+2] = NULL;
 9353|   171k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9353:18): [True: 140k, False: 30.7k]
  ------------------
 9354|   140k|            atts[i+2] = ctxt->str_xml_ns;
 9355|  30.7k|        else
 9356|  30.7k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9357|       |
 9358|   503k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9358:13): [True: 166k, False: 336k]
  |  Branch (9358:29): [True: 138k, False: 28.4k]
  ------------------
 9359|   138k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2265|   138k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|   138k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9360|   138k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2265|   138k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|   138k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9361|   138k|        }
 9362|   503k|    }
 9363|       |
 9364|   787k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9365|   787k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9365:9): [True: 90.8k, False: 696k]
  |  Branch (9365:29): [True: 32.8k, False: 57.9k]
  ------------------
 9366|  32.8k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9367|  32.8k|	         "Namespace prefix %s on %s is not defined\n",
 9368|  32.8k|		 prefix, localname, NULL);
 9369|  32.8k|    }
 9370|   787k|    *pref = prefix;
 9371|   787k|    *URI = uri;
 9372|       |
 9373|       |    /*
 9374|       |     * SAX callback
 9375|       |     */
 9376|   787k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9376:9): [True: 787k, False: 0]
  |  Branch (9376:32): [True: 787k, False: 0]
  ------------------
 9377|   787k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9377:2): [True: 531k, False: 255k]
  ------------------
 9378|   531k|	if (nbNs > 0)
  ------------------
  |  Branch (9378:6): [True: 117k, False: 414k]
  ------------------
 9379|   117k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9380|   117k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9381|   117k|			  nbatts / 5, nbdef, atts);
 9382|   414k|	else
 9383|   414k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9384|   414k|                          0, NULL, nbatts / 5, nbdef, atts);
 9385|   531k|    }
 9386|       |
 9387|   787k|done:
 9388|       |    /*
 9389|       |     * Free allocated attribute values
 9390|       |     */
 9391|   787k|    if (attval != 0) {
  ------------------
  |  Branch (9391:9): [True: 11.7k, False: 775k]
  ------------------
 9392|   118k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9392:21): [True: 107k, False: 11.7k]
  ------------------
 9393|   107k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9393:10): [True: 28.4k, False: 78.6k]
  ------------------
 9394|  28.4k|	        xmlFree((xmlChar *) atts[i+3]);
 9395|  11.7k|    }
 9396|       |
 9397|   787k|    *nbNsPtr = nbNs;
 9398|   787k|    return(localname);
 9399|   787k|}
parser.c:xmlParserNsStartElement:
 1504|   805k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1505|   805k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1505:9): [True: 0, False: 805k]
  ------------------
 1506|      0|        return(-1);
 1507|   805k|    nsdb->elementId++;
 1508|       |
 1509|   805k|    return(0);
 1510|   805k|}
parser.c:xmlParseQNameHashed:
 8429|  1.25M|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8430|  1.25M|    xmlHashedString l, p;
 8431|  1.25M|    int start, isNCName = 0;
 8432|       |
 8433|  1.25M|    l.name = NULL;
 8434|  1.25M|    p.name = NULL;
 8435|       |
 8436|  1.25M|    GROW;
  ------------------
  |  | 2308|  1.25M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.25M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.25M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 816k, False: 439k]
  |  |  ------------------
  |  | 2309|  1.25M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   816k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 53.5k, False: 763k]
  |  |  ------------------
  |  | 2310|  1.25M|	xmlParserGrow(ctxt);
  ------------------
 8437|  1.25M|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|  1.25M|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|  1.25M|#define BASE_PTR ctxt->input->base
  ------------------
 8438|       |
 8439|  1.25M|    l = xmlParseNCName(ctxt);
 8440|  1.25M|    if (l.name != NULL) {
  ------------------
  |  Branch (8440:9): [True: 1.05M, False: 197k]
  ------------------
 8441|  1.05M|        isNCName = 1;
 8442|  1.05M|        if (CUR == ':') {
  ------------------
  |  | 2262|  1.05M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8442:13): [True: 279k, False: 779k]
  ------------------
 8443|   279k|            NEXT;
  ------------------
  |  | 2316|   279k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8444|   279k|            p = l;
 8445|   279k|            l = xmlParseNCName(ctxt);
 8446|   279k|        }
 8447|  1.05M|    }
 8448|  1.25M|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2262|  1.05M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8448:9): [True: 202k, False: 1.05M]
  |  Branch (8448:29): [True: 2.13k, False: 1.05M]
  ------------------
 8449|   204k|        xmlChar *tmp;
 8450|       |
 8451|   204k|        l.name = NULL;
 8452|   204k|        p.name = NULL;
 8453|   204k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2262|   197k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8453:13): [True: 197k, False: 6.14k]
  |  Branch (8453:32): [True: 193k, False: 4.03k]
  ------------------
 8454|   193k|            return(l);
 8455|  10.1k|        tmp = xmlParseNmtoken(ctxt);
 8456|  10.1k|        if (tmp != NULL)
  ------------------
  |  Branch (8456:13): [True: 7.40k, False: 2.77k]
  ------------------
 8457|  7.40k|            xmlFree(tmp);
 8458|  10.1k|        l = xmlDictLookupHashed(ctxt->dict, BASE_PTR + start,
  ------------------
  |  | 2265|  10.1k|#define BASE_PTR ctxt->input->base
  ------------------
 8459|  10.1k|                                CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2264|  10.1k|#define CUR_PTR ctxt->input->cur
  ------------------
                                              CUR_PTR - (BASE_PTR + start));
  ------------------
  |  | 2265|  10.1k|#define BASE_PTR ctxt->input->base
  ------------------
 8460|  10.1k|        if (l.name == NULL) {
  ------------------
  |  Branch (8460:13): [True: 1, False: 10.1k]
  ------------------
 8461|      1|            xmlErrMemory(ctxt);
 8462|      1|            return(l);
 8463|      1|        }
 8464|  10.1k|        xmlNsErr(ctxt, XML_NS_ERR_QNAME,
 8465|  10.1k|                 "Failed to parse QName '%s'\n", l.name, NULL, NULL);
 8466|  10.1k|    }
 8467|       |
 8468|  1.06M|    *prefix = p;
 8469|  1.06M|    return(l);
 8470|  1.25M|}
parser.c:xmlParseNCName:
 3283|  1.53M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3284|  1.53M|    const xmlChar *in, *e;
 3285|  1.53M|    xmlHashedString ret;
 3286|  1.53M|    size_t count = 0;
 3287|  1.53M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3287:24): [True: 933k, False: 601k]
  ------------------
 3288|   933k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   933k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3289|  1.53M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  2.13M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3290|       |
 3291|  1.53M|    ret.name = NULL;
 3292|       |
 3293|       |    /*
 3294|       |     * Accelerator for simple ASCII names
 3295|       |     */
 3296|  1.53M|    in = ctxt->input->cur;
 3297|  1.53M|    e = ctxt->input->end;
 3298|  1.53M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3298:11): [True: 1.33M, False: 204k]
  |  Branch (3298:28): [True: 1.31M, False: 14.8k]
  ------------------
 3299|   219k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3299:4): [True: 29.4k, False: 189k]
  |  Branch (3299:21): [True: 12.9k, False: 16.4k]
  ------------------
 3300|  1.32M|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3300:3): [True: 754, False: 205k]
  |  Branch (3300:20): [True: 1.32M, False: 0]
  ------------------
 3301|  1.32M|	in++;
 3302|  5.37M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3302:11): [True: 3.11M, False: 2.26M]
  |  Branch (3302:28): [True: 3.10M, False: 10.0k]
  ------------------
 3303|  2.27M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3303:11): [True: 383k, False: 1.88M]
  |  Branch (3303:28): [True: 368k, False: 14.5k]
  ------------------
 3304|  1.90M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3304:11): [True: 1.56M, False: 336k]
  |  Branch (3304:28): [True: 561k, False: 1.00M]
  ------------------
 3305|  1.34M|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3305:10): [True: 3.86k, False: 1.33M]
  |  Branch (3305:26): [True: 5.80k, False: 1.33M]
  ------------------
 3306|  4.04M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3306:10): [True: 1.55k, False: 1.32M]
  |  Branch (3306:27): [True: 4.04M, False: 0]
  ------------------
 3307|  4.04M|	    in++;
 3308|  1.32M|	if (in >= e)
  ------------------
  |  Branch (3308:6): [True: 591, False: 1.32M]
  ------------------
 3309|    591|	    goto complex;
 3310|  1.32M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3310:6): [True: 1.32M, False: 6.13k]
  |  Branch (3310:19): [True: 1.31M, False: 9.48k]
  ------------------
 3311|  1.31M|	    count = in - ctxt->input->cur;
 3312|  1.31M|            if (count > maxLength) {
  ------------------
  |  Branch (3312:17): [True: 24, False: 1.31M]
  ------------------
 3313|     24|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3314|     24|                return(ret);
 3315|     24|            }
 3316|  1.31M|	    ret = xmlDictLookupHashed(ctxt->dict, ctxt->input->cur, count);
 3317|  1.31M|	    ctxt->input->cur = in;
 3318|  1.31M|	    ctxt->input->col += count;
 3319|  1.31M|	    if (ret.name == NULL) {
  ------------------
  |  Branch (3319:10): [True: 2, False: 1.31M]
  ------------------
 3320|      2|	        xmlErrMemory(ctxt);
 3321|      2|	    }
 3322|  1.31M|	    return(ret);
 3323|  1.31M|	}
 3324|  1.32M|    }
 3325|   221k|complex:
 3326|   221k|    return(xmlParseNCNameComplex(ctxt));
 3327|  1.53M|}
parser.c:xmlParseNCNameComplex:
 3230|   221k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3231|   221k|    xmlHashedString ret;
 3232|   221k|    int len = 0, l;
 3233|   221k|    int c;
 3234|   221k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3234:21): [True: 178k, False: 43.3k]
  ------------------
 3235|   178k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   178k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3236|   221k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  43.3k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3237|   221k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3237:17): [True: 95.8k, False: 125k]
  ------------------
 3238|   221k|    size_t startPosition = 0;
 3239|       |
 3240|   221k|    ret.name = NULL;
 3241|   221k|    ret.hashValue = 0;
 3242|       |
 3243|       |    /*
 3244|       |     * Handler for more complex cases
 3245|       |     */
 3246|   221k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|   221k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|   221k|#define BASE_PTR ctxt->input->base
  ------------------
 3247|   221k|    c = xmlCurrentChar(ctxt, &l);
 3248|   221k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3248:9): [True: 696, False: 221k]
  |  Branch (3248:23): [True: 1.58k, False: 219k]
  |  Branch (3248:37): [True: 6.55k, False: 212k]
  ------------------
 3249|   212k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3249:3): [True: 188k, False: 24.5k]
  |  Branch (3249:36): [True: 4.80k, False: 19.7k]
  ------------------
 3250|   201k|	return(ret);
 3251|   201k|    }
 3252|       |
 3253|  4.62M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3253:12): [True: 4.62M, False: 505]
  |  Branch (3253:26): [True: 4.61M, False: 1.57k]
  |  Branch (3253:40): [True: 4.61M, False: 222]
  ------------------
 3254|  4.61M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3254:6): [True: 4.60M, False: 15.5k]
  |  Branch (3254:33): [True: 4.60M, False: 1.91k]
  ------------------
 3255|  4.60M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3255:13): [True: 4.60M, False: 0]
  ------------------
 3256|  4.60M|	    len += l;
 3257|  4.60M|	NEXTL(l);
  ------------------
  |  | 2325|  4.60M|#define NEXTL(l) do {							\
  |  | 2326|  4.60M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 4.60M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  4.60M|    } else ctxt->input->col++;						\
  |  | 2329|  4.60M|    ctxt->input->cur += l;				\
  |  | 2330|  4.60M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 4.60M]
  |  |  ------------------
  ------------------
 3258|  4.60M|	c = xmlCurrentChar(ctxt, &l);
 3259|  4.60M|    }
 3260|  19.7k|    if (len > maxLength) {
  ------------------
  |  Branch (3260:9): [True: 35, False: 19.7k]
  ------------------
 3261|     35|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3262|     35|        return(ret);
 3263|     35|    }
 3264|  19.7k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2265|  19.7k|#define BASE_PTR ctxt->input->base
  ------------------
 3265|  19.7k|    if (ret.name == NULL)
  ------------------
  |  Branch (3265:9): [True: 4, False: 19.7k]
  ------------------
 3266|      4|        xmlErrMemory(ctxt);
 3267|  19.7k|    return(ret);
 3268|  19.7k|}
parser.c:xmlParseAttribute2:
 8567|   437k|{
 8568|   437k|    xmlHashedString hname;
 8569|   437k|    const xmlChar *prefix, *name;
 8570|   437k|    xmlChar *val = NULL, *internal_val = NULL;
 8571|   437k|    int special = 0;
 8572|   437k|    int isNamespace;
 8573|   437k|    int flags;
 8574|       |
 8575|   437k|    *value = NULL;
 8576|   437k|    GROW;
  ------------------
  |  | 2308|   437k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   437k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   437k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 252k, False: 185k]
  |  |  ------------------
  |  | 2309|   437k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   252k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 15.0k, False: 237k]
  |  |  ------------------
  |  | 2310|   437k|	xmlParserGrow(ctxt);
  ------------------
 8577|   437k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8578|   437k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8578:9): [True: 174k, False: 263k]
  ------------------
 8579|   174k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8580|   174k|                       "error parsing attribute name\n");
 8581|   174k|        return(hname);
 8582|   174k|    }
 8583|   263k|    name = hname.name;
 8584|   263k|    prefix = hprefix->name;
 8585|       |
 8586|       |    /*
 8587|       |     * get the type if needed
 8588|       |     */
 8589|   263k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8589:9): [True: 43.8k, False: 219k]
  ------------------
 8590|  43.8k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  43.8k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8591|  43.8k|                                              prefix, name));
 8592|  43.8k|    }
 8593|       |
 8594|       |    /*
 8595|       |     * read the value
 8596|       |     */
 8597|   263k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   263k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8598|   263k|    if (RAW != '=') {
  ------------------
  |  | 2261|   263k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8598:9): [True: 16.9k, False: 246k]
  ------------------
 8599|  16.9k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8600|  16.9k|                          "Specification mandates value for attribute %s\n",
 8601|  16.9k|                          name);
 8602|  16.9k|        goto error;
 8603|  16.9k|    }
 8604|       |
 8605|       |
 8606|   246k|    NEXT;
  ------------------
  |  | 2316|   246k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8607|   246k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   246k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8608|   246k|    flags = 0;
 8609|   246k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8609:21): [True: 70.1k, False: 176k]
  |  Branch (8609:41): [True: 14.0k, False: 56.1k]
  ------------------
 8610|   232k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8610:20): [True: 61.8k, False: 170k]
  ------------------
 8611|   246k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8612|   246k|                                   isNamespace);
 8613|   246k|    if (val == NULL)
  ------------------
  |  Branch (8613:9): [True: 4.34k, False: 241k]
  ------------------
 8614|  4.34k|        goto error;
 8615|       |
 8616|   241k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   241k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8617|       |
 8618|   241k|#ifdef LIBXML_VALID_ENABLED
 8619|   241k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8619:9): [True: 101k, False: 140k]
  ------------------
 8620|   101k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8620:9): [True: 442, False: 100k]
  ------------------
 8621|    442|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    442|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8621:9): [True: 104, False: 338]
  ------------------
 8622|    104|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    104|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8622:9): [True: 36, False: 68]
  ------------------
 8623|     36|        xmlValidityError(ctxt, XML_DTD_NOT_STANDALONE,
 8624|     36|                         "standalone: normalization of attribute %s on %s "
 8625|     36|                         "by external subset declaration\n",
 8626|     36|                         name, elem);
 8627|     36|    }
 8628|   241k|#endif
 8629|       |
 8630|   241k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8630:9): [True: 90.5k, False: 151k]
  ------------------
 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|  90.5k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  57.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8636:13): [True: 57.1k, False: 33.3k]
  |  Branch (8636:33): [True: 54.7k, False: 2.45k]
  ------------------
 8637|  54.7k|            internal_val = xmlStrndup(val, *len);
 8638|  54.7k|            if (internal_val == NULL)
  ------------------
  |  Branch (8638:17): [True: 2, False: 54.7k]
  ------------------
 8639|      2|                goto mem_error;
 8640|  54.7k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8640:17): [True: 49.2k, False: 5.43k]
  ------------------
 8641|  49.2k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8642|  49.2k|                              "Malformed value for xml:lang : %s\n",
 8643|  49.2k|                              internal_val, NULL);
 8644|  49.2k|            }
 8645|  54.7k|        }
 8646|       |
 8647|       |        /*
 8648|       |         * Check that xml:space conforms to the specification
 8649|       |         */
 8650|  90.5k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  90.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8650:13): [True: 626, False: 89.9k]
  ------------------
 8651|    626|            internal_val = xmlStrndup(val, *len);
 8652|    626|            if (internal_val == NULL)
  ------------------
  |  Branch (8652:17): [True: 1, False: 625]
  ------------------
 8653|      1|                goto mem_error;
 8654|    625|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|    625|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8654:17): [True: 204, False: 421]
  ------------------
 8655|    204|                *(ctxt->space) = 0;
 8656|    421|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    421|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8656:22): [True: 202, False: 219]
  ------------------
 8657|    202|                *(ctxt->space) = 1;
 8658|    219|            else {
 8659|    219|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8660|    219|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8661|    219|                              internal_val, NULL);
 8662|    219|            }
 8663|    625|        }
 8664|  90.5k|        if (internal_val) {
  ------------------
  |  Branch (8664:13): [True: 55.3k, False: 35.2k]
  ------------------
 8665|  55.3k|            xmlFree(internal_val);
 8666|  55.3k|        }
 8667|  90.5k|    }
 8668|       |
 8669|   241k|    *value = val;
 8670|   241k|    return (hname);
 8671|       |
 8672|      3|mem_error:
 8673|      3|    xmlErrMemory(ctxt);
 8674|  21.2k|error:
 8675|  21.2k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8675:9): [True: 3, False: 21.2k]
  |  Branch (8675:26): [True: 1, False: 2]
  ------------------
 8676|      1|        xmlFree(val);
 8677|  21.2k|    return(hname);
 8678|      3|}
parser.c:xmlNsWarn:
  406|  7.37k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  7.37k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  7.37k|}
parser.c:xmlCtxtGrowAttrs:
 1886|  25.3k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1887|  25.3k|    const xmlChar **atts;
 1888|  25.3k|    unsigned *attallocs;
 1889|  25.3k|    int newSize;
 1890|       |
 1891|  25.3k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1892|  25.3k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1893|  25.3k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  25.3k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1894|  25.3k|    if (newSize < 0) {
  ------------------
  |  Branch (1894:9): [True: 0, False: 25.3k]
  ------------------
 1895|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1896|      0|                    "Maximum number of attributes exceeded");
 1897|      0|        return(-1);
 1898|      0|    }
 1899|       |
 1900|  25.3k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1901|  25.3k|    if (atts == NULL)
  ------------------
  |  Branch (1901:9): [True: 4, False: 25.3k]
  ------------------
 1902|      4|        goto mem_error;
 1903|  25.3k|    ctxt->atts = atts;
 1904|       |
 1905|  25.3k|    attallocs = xmlRealloc(ctxt->attallocs,
 1906|  25.3k|                           newSize * sizeof(attallocs[0]));
 1907|  25.3k|    if (attallocs == NULL)
  ------------------
  |  Branch (1907:9): [True: 6, False: 25.3k]
  ------------------
 1908|      6|        goto mem_error;
 1909|  25.3k|    ctxt->attallocs = attallocs;
 1910|       |
 1911|  25.3k|    ctxt->maxatts = newSize * 5;
 1912|       |
 1913|  25.3k|    return(0);
 1914|       |
 1915|     10|mem_error:
 1916|     10|    xmlErrMemory(ctxt);
 1917|     10|    return(-1);
 1918|  25.3k|}
parser.c:xmlAttrHashInsert:
 8694|   424k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8695|   424k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8696|   424k|    xmlAttrHashBucket *bucket;
 8697|   424k|    unsigned hindex;
 8698|       |
 8699|   424k|    hindex = hashValue & (size - 1);
 8700|   424k|    bucket = &table[hindex];
 8701|       |
 8702|   474k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8702:12): [True: 154k, False: 319k]
  ------------------
 8703|   154k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8704|       |
 8705|   154k|        if (name == atts[0]) {
  ------------------
  |  Branch (8705:13): [True: 105k, False: 48.8k]
  ------------------
 8706|   105k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|   105k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8707|       |
 8708|   105k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|   105k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8708:17): [True: 15.2k, False: 90.7k]
  |  Branch (8708:17): [True: 104k, False: 1.53k]
  ------------------
 8709|   105k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  90.7k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8709:17): [True: 83.0k, False: 7.68k]
  ------------------
 8710|  90.7k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8711|   104k|                return(bucket->index);
 8712|   105k|        }
 8713|       |
 8714|  50.4k|        hindex++;
 8715|  50.4k|        bucket++;
 8716|  50.4k|        if (hindex >= size) {
  ------------------
  |  Branch (8716:13): [True: 3.15k, False: 47.2k]
  ------------------
 8717|  3.15k|            hindex = 0;
 8718|  3.15k|            bucket = table;
 8719|  3.15k|        }
 8720|  50.4k|    }
 8721|       |
 8722|   319k|    bucket->index = aindex;
 8723|       |
 8724|       |    return(INT_MAX);
 8725|   424k|}
parser.c:xmlAttrHashInsertQName:
 8730|  5.33k|                       unsigned hashValue, int aindex) {
 8731|  5.33k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8732|  5.33k|    xmlAttrHashBucket *bucket;
 8733|  5.33k|    unsigned hindex;
 8734|       |
 8735|  5.33k|    hindex = hashValue & (size - 1);
 8736|  5.33k|    bucket = &table[hindex];
 8737|       |
 8738|  6.80k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8738:12): [True: 3.88k, False: 2.91k]
  ------------------
 8739|  3.88k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8740|       |
 8741|  3.88k|        if ((name == atts[0]) && (prefix == atts[1]))
  ------------------
  |  Branch (8741:13): [True: 3.25k, False: 637]
  |  Branch (8741:34): [True: 2.41k, False: 831]
  ------------------
 8742|  2.41k|            return(bucket->index);
 8743|       |
 8744|  1.46k|        hindex++;
 8745|  1.46k|        bucket++;
 8746|  1.46k|        if (hindex >= size) {
  ------------------
  |  Branch (8746:13): [True: 199, False: 1.26k]
  ------------------
 8747|    199|            hindex = 0;
 8748|    199|            bucket = table;
 8749|    199|        }
 8750|  1.46k|    }
 8751|       |
 8752|  2.91k|    bucket->index = aindex;
 8753|       |
 8754|       |    return(INT_MAX);
 8755|  5.33k|}
parser.c:xmlParserNsLookupUri:
 1573|   787k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1574|   787k|    const xmlChar *ret;
 1575|   787k|    int nsIndex;
 1576|       |
 1577|   787k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1577:9): [True: 498, False: 787k]
  ------------------
 1578|    498|        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|   787k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1585|   787k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1585:9): [True: 665k, False: 121k]
  |  Branch (1585:33): [True: 559, False: 120k]
  ------------------
 1586|   666k|        return(NULL);
 1587|       |
 1588|   120k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1589|   120k|    if (ret[0] == 0)
  ------------------
  |  Branch (1589:9): [True: 10.3k, False: 110k]
  ------------------
 1590|  10.3k|        ret = NULL;
 1591|   120k|    return(ret);
 1592|   787k|}
parser.c:nameNsPush:
 2098|  1.08M|{
 2099|  1.08M|    xmlStartTag *tag;
 2100|       |
 2101|  1.08M|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2101:9): [True: 47.6k, False: 1.03M]
  ------------------
 2102|  47.6k|        const xmlChar **tmp;
 2103|  47.6k|        xmlStartTag *tmp2;
 2104|  47.6k|        int newSize;
 2105|       |
 2106|  47.6k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2107|  47.6k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2108|  47.6k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  47.6k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2109|  47.6k|        if (newSize < 0)
  ------------------
  |  Branch (2109:13): [True: 0, False: 47.6k]
  ------------------
 2110|      0|            goto mem_error;
 2111|       |
 2112|  47.6k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2113|  47.6k|        if (tmp == NULL)
  ------------------
  |  Branch (2113:13): [True: 19, False: 47.5k]
  ------------------
 2114|     19|	    goto mem_error;
 2115|  47.5k|	ctxt->nameTab = tmp;
 2116|       |
 2117|  47.5k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2118|  47.5k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2118:13): [True: 13, False: 47.5k]
  ------------------
 2119|     13|	    goto mem_error;
 2120|  47.5k|	ctxt->pushTab = tmp2;
 2121|       |
 2122|  47.5k|        ctxt->nameMax = newSize;
 2123|  1.03M|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2123:16): [True: 30.8k, False: 1.00M]
  ------------------
 2124|  30.8k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2125|  30.8k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2125:13): [True: 11, False: 30.8k]
  ------------------
 2126|     11|            goto mem_error;
 2127|  30.8k|    }
 2128|  1.08M|    ctxt->nameTab[ctxt->nameNr] = value;
 2129|  1.08M|    ctxt->name = value;
 2130|  1.08M|    tag = &ctxt->pushTab[ctxt->nameNr];
 2131|  1.08M|    tag->prefix = prefix;
 2132|  1.08M|    tag->URI = URI;
 2133|  1.08M|    tag->line = line;
 2134|  1.08M|    tag->nsNr = nsNr;
 2135|  1.08M|    return (ctxt->nameNr++);
 2136|     43|mem_error:
 2137|     43|    xmlErrMemory(ctxt);
 2138|     43|    return (-1);
 2139|  1.08M|}
parser.c:xmlParseElementEnd:
 9856|   291k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9857|   291k|    xmlNodePtr cur = ctxt->node;
 9858|       |
 9859|   291k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9859:9): [True: 4, False: 291k]
  ------------------
 9860|      4|        if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2261|      4|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '/'))
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9860:13): [True: 3, False: 1]
  |  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|      4|        return;
 9863|      4|    }
 9864|       |
 9865|       |    /*
 9866|       |     * parse the end of tag: '</' should be here.
 9867|       |     */
 9868|   291k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9868:9): [True: 182k, False: 108k]
  ------------------
 9869|   182k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9870|   182k|	namePop(ctxt);
 9871|   182k|    }
 9872|   108k|#ifdef LIBXML_SAX1_ENABLED
 9873|   108k|    else
 9874|   108k|	xmlParseEndTag1(ctxt, 0);
 9875|   291k|#endif /* LIBXML_SAX1_ENABLED */
 9876|       |
 9877|       |    /*
 9878|       |     * Capture end position
 9879|       |     */
 9880|   291k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9880:9): [True: 209k, False: 82.1k]
  |  Branch (9880:24): [True: 0, False: 209k]
  ------------------
 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|   291k|}
parser.c:xmlParseEndTag2:
 9414|   206k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9415|   206k|    const xmlChar *name;
 9416|       |
 9417|   206k|    GROW;
  ------------------
  |  | 2308|   206k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   206k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   206k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 182k, False: 24.2k]
  |  |  ------------------
  |  | 2309|   206k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   182k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.7k, False: 169k]
  |  |  ------------------
  |  | 2310|   206k|	xmlParserGrow(ctxt);
  ------------------
 9418|   206k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   206k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   206k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9418:9): [True: 32, False: 206k]
  |  Branch (9418:25): [True: 26, False: 206k]
  ------------------
 9419|     58|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9420|     58|	return;
 9421|     58|    }
 9422|   206k|    SKIP(2);
  ------------------
  |  | 2285|   206k|#define SKIP(val) do {							\
  |  | 2286|   206k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   206k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.07k, False: 205k]
  |  |  ------------------
  |  | 2288|   206k|        xmlParserGrow(ctxt);						\
  |  | 2289|   206k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 206k]
  |  |  ------------------
  ------------------
 9423|       |
 9424|   206k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9424:9): [True: 189k, False: 16.7k]
  ------------------
 9425|   189k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9426|  16.7k|    else
 9427|  16.7k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9428|       |
 9429|       |    /*
 9430|       |     * We should definitely be at the ending "S? '>'" part
 9431|       |     */
 9432|   206k|    GROW;
  ------------------
  |  | 2308|   206k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   206k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   206k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 182k, False: 24.2k]
  |  |  ------------------
  |  | 2309|   206k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   182k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.7k, False: 169k]
  |  |  ------------------
  |  | 2310|   206k|	xmlParserGrow(ctxt);
  ------------------
 9433|   206k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   206k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9434|   206k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   206k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   206k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 198k, False: 7.79k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 198k]
  |  |  |  |  ------------------
  |  |  |  |  109|   206k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 206k]
  |  |  |  |  ------------------
  |  |  |  |  110|   206k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 198k, False: 8.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   198k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9434:33): [True: 13.0k, False: 185k]
  ------------------
 9435|  21.1k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9436|  21.1k|    } else
 9437|   185k|	NEXT1;
  ------------------
  |  | 2318|   185k|#define NEXT1 {								\
  |  | 2319|   185k|	ctxt->input->col++;						\
  |  | 2320|   185k|	ctxt->input->cur++;						\
  |  | 2321|   185k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.30k, False: 184k]
  |  |  ------------------
  |  | 2322|   185k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   185k|    }
  ------------------
 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|   206k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9445:9): [True: 15.8k, False: 190k]
  ------------------
 9446|  15.8k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  3.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9446:13): [True: 3.87k, False: 11.9k]
  ------------------
 9447|  15.8k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9448|  15.8k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9449|  15.8k|		                ctxt->name, tag->line, name);
 9450|  15.8k|    }
 9451|       |
 9452|       |    /*
 9453|       |     * SAX: End of Tag
 9454|       |     */
 9455|   206k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9455:9): [True: 206k, False: 0]
  |  Branch (9455:32): [True: 206k, False: 0]
  ------------------
 9456|   206k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9456:2): [True: 150k, False: 55.9k]
  ------------------
 9457|   150k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9458|   150k|                                tag->URI);
 9459|       |
 9460|   206k|    spacePop(ctxt);
 9461|   206k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9461:9): [True: 34.0k, False: 172k]
  ------------------
 9462|  34.0k|	xmlParserNsPop(ctxt, tag->nsNr);
 9463|   206k|}
parser.c:xmlParseQNameAndCompare:
 8508|  16.7k|                        xmlChar const *prefix) {
 8509|  16.7k|    const xmlChar *cmp;
 8510|  16.7k|    const xmlChar *in;
 8511|  16.7k|    const xmlChar *ret;
 8512|  16.7k|    const xmlChar *prefix2;
 8513|       |
 8514|  16.7k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8514:9): [True: 0, False: 16.7k]
  ------------------
 8515|       |
 8516|  16.7k|    GROW;
  ------------------
  |  | 2308|  16.7k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  16.7k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  16.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 11.6k, False: 5.04k]
  |  |  ------------------
  |  | 2309|  16.7k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  11.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.33k, False: 9.36k]
  |  |  ------------------
  |  | 2310|  16.7k|	xmlParserGrow(ctxt);
  ------------------
 8517|  16.7k|    in = ctxt->input->cur;
 8518|       |
 8519|  16.7k|    cmp = prefix;
 8520|  33.2k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8520:12): [True: 32.3k, False: 868]
  |  Branch (8520:24): [True: 16.5k, False: 15.8k]
  ------------------
 8521|  16.5k|	++in;
 8522|  16.5k|	++cmp;
 8523|  16.5k|    }
 8524|  16.7k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8524:9): [True: 15.1k, False: 1.60k]
  |  Branch (8524:24): [True: 9.41k, False: 5.72k]
  ------------------
 8525|  9.41k|        in++;
 8526|  9.41k|	cmp = name;
 8527|  26.0k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8527:9): [True: 23.3k, False: 2.65k]
  |  Branch (8527:21): [True: 16.6k, False: 6.75k]
  ------------------
 8528|  16.6k|	    ++in;
 8529|  16.6k|	    ++cmp;
 8530|  16.6k|	}
 8531|  9.41k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  5.16k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  5.16k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 313, False: 4.84k]
  |  |  |  |  ------------------
  |  |  |  |   91|  5.16k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.09k, False: 3.74k]
  |  |  |  |  |  Branch (91:23): [True: 235, False: 864]
  |  |  |  |  ------------------
  |  |  |  |   92|  5.16k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 388, False: 4.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8531:6): [True: 8.58k, False: 828]
  |  Branch (8531:20): [True: 3.42k, False: 5.16k]
  ------------------
 8532|       |	    /* success */
 8533|  4.36k|            ctxt->input->col += in - ctxt->input->cur;
 8534|  4.36k|	    ctxt->input->cur = in;
 8535|  4.36k|	    return((const xmlChar*) 1);
 8536|  4.36k|	}
 8537|  9.41k|    }
 8538|       |    /*
 8539|       |     * all strings coms from the dictionary, equality can be done directly
 8540|       |     */
 8541|  12.3k|    ret = xmlParseQName (ctxt, &prefix2);
 8542|  12.3k|    if (ret == NULL)
  ------------------
  |  Branch (8542:9): [True: 1.04k, False: 11.3k]
  ------------------
 8543|  1.04k|        return(NULL);
 8544|  11.3k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8544:9): [True: 9.53k, False: 1.79k]
  |  Branch (8544:26): [True: 4.17k, False: 5.36k]
  ------------------
 8545|  4.17k|	return((const xmlChar*) 1);
 8546|  7.15k|    return ret;
 8547|  11.3k|}
parser.c:xmlParseQName:
 8485|  12.3k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8486|  12.3k|    xmlHashedString n, p;
 8487|       |
 8488|  12.3k|    n = xmlParseQNameHashed(ctxt, &p);
 8489|  12.3k|    if (n.name == NULL)
  ------------------
  |  Branch (8489:9): [True: 1.04k, False: 11.3k]
  ------------------
 8490|  1.04k|        return(NULL);
 8491|  11.3k|    *prefix = p.name;
 8492|  11.3k|    return(n.name);
 8493|  12.3k|}
parser.c:xmlParseInternalSubset:
 8031|  15.0k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 8032|       |    /*
 8033|       |     * Is there any DTD definition ?
 8034|       |     */
 8035|  15.0k|    if (RAW == '[') {
  ------------------
  |  | 2261|  15.0k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8035:9): [True: 15.0k, False: 0]
  ------------------
 8036|  15.0k|        int oldInputNr = ctxt->inputNr;
 8037|       |
 8038|  15.0k|        NEXT;
  ------------------
  |  | 2316|  15.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8039|       |	/*
 8040|       |	 * Parse the succession of Markup declarations and
 8041|       |	 * PEReferences.
 8042|       |	 * Subsequence (markupdecl | PEReference | S)*
 8043|       |	 */
 8044|  15.0k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  15.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8045|   791k|        while (1) {
  ------------------
  |  Branch (8045:16): [True: 791k, Folded]
  ------------------
 8046|   791k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   791k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 712, False: 790k]
  |  |  ------------------
  ------------------
 8047|    712|                return;
 8048|   790k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8048:24): [True: 110k, False: 680k]
  ------------------
 8049|   110k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8049:21): [True: 1.66k, False: 108k]
  ------------------
 8050|  1.66k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8051|  1.66k|                    return;
 8052|  1.66k|                }
 8053|   108k|                xmlPopPE(ctxt);
 8054|   680k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2261|   680k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8054:24): [True: 9.34k, False: 671k]
  |  Branch (8054:40): [True: 9.34k, False: 2]
  ------------------
 8055|  9.34k|                NEXT;
  ------------------
  |  | 2316|  9.34k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8056|  9.34k|                SKIP_BLANKS;
  ------------------
  |  | 2312|  9.34k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8057|  9.34k|                break;
 8058|   671k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   671k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 671k]
  |  |  ------------------
  |  |   56|   671k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 611k, False: 60.0k]
  |  |  ------------------
  |  |   57|   671k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 607k, False: 3.40k]
  |  |  ------------------
  ------------------
 8059|   607k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   607k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   446k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   434k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8059:24): [True: 446k, False: 160k]
  |  Branch (8059:40): [True: 434k, False: 11.9k]
  |  Branch (8059:59): [True: 4.94k, False: 429k]
  ------------------
 8060|       |                /*
 8061|       |                 * Conditional sections are allowed in external entities
 8062|       |                 * included by PE References in the internal subset.
 8063|       |                 */
 8064|  4.94k|                xmlParseConditionalSections(ctxt);
 8065|   666k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   666k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   481k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  13.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8065:24): [True: 481k, False: 184k]
  |  Branch (8065:41): [True: 468k, False: 13.2k]
  |  Branch (8065:60): [True: 12.3k, False: 916]
  ------------------
 8066|   480k|                xmlParseMarkupDecl(ctxt);
 8067|   480k|            } else if (RAW == '%') {
  ------------------
  |  | 2261|   185k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8067:24): [True: 182k, False: 3.30k]
  ------------------
 8068|   182k|                xmlParsePERefInternal(ctxt, 1);
 8069|   182k|            } else {
 8070|  3.30k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8071|       |
 8072|  3.87k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8072:24): [True: 575, False: 3.30k]
  ------------------
 8073|    575|                    xmlPopPE(ctxt);
 8074|  3.30k|                return;
 8075|  3.30k|            }
 8076|   776k|            SKIP_BLANKS;
  ------------------
  |  | 2312|   776k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8077|   776k|            SHRINK;
  ------------------
  |  | 2304|   776k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   776k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   776k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 722k, False: 53.9k]
  |  |  ------------------
  |  | 2305|   776k|	xmlParserShrink(ctxt);
  ------------------
 8078|   776k|            GROW;
  ------------------
  |  | 2308|   776k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   776k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   776k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 722k, False: 53.9k]
  |  |  ------------------
  |  | 2309|   776k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   722k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 512k, False: 210k]
  |  |  ------------------
  |  | 2310|   776k|	xmlParserGrow(ctxt);
  ------------------
 8079|   776k|        }
 8080|  15.0k|    }
 8081|       |
 8082|       |    /*
 8083|       |     * We should be at the end of the DOCTYPE declaration.
 8084|       |     */
 8085|  9.34k|    if (RAW != '>') {
  ------------------
  |  | 2261|  9.34k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8085:9): [True: 159, False: 9.18k]
  ------------------
 8086|    159|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8087|    159|        return;
 8088|    159|    }
 8089|  9.18k|    NEXT;
  ------------------
  |  | 2316|  9.18k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8090|  9.18k|}
parser.c:xmlCleanSpecialAttr:
 1231|  20.7k|{
 1232|  20.7k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1232:9): [True: 17.0k, False: 3.64k]
  ------------------
 1233|  17.0k|        return;
 1234|       |
 1235|  3.64k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1236|       |
 1237|  3.64k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1237:9): [True: 160, False: 3.48k]
  ------------------
 1238|    160|        xmlHashFree(ctxt->attsSpecial, NULL);
 1239|       |        ctxt->attsSpecial = NULL;
 1240|    160|    }
 1241|  3.64k|}
parser.c:xmlCleanSpecialAttrCallback:
 1214|  24.7k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1215|  24.7k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1216|       |
 1217|  24.7k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  24.7k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1217:9): [True: 2.22k, False: 22.5k]
  ------------------
 1218|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1219|  2.22k|    }
 1220|  24.7k|}
parser.c:xmlFinishDocument:
10388|  26.9k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10389|  26.9k|    xmlDocPtr doc;
10390|       |
10391|       |    /*
10392|       |     * SAX: end of the document processing.
10393|       |     */
10394|  26.9k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10394:9): [True: 26.9k, False: 0]
  |  Branch (10394:24): [True: 26.9k, False: 0]
  ------------------
10395|  26.9k|        ctxt->sax->endDocument(ctxt->userData);
10396|       |
10397|       |    /*
10398|       |     * Remove locally kept entity definitions if the tree was not built
10399|       |     */
10400|  26.9k|    doc = ctxt->myDoc;
10401|  26.9k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10401:9): [True: 26.8k, False: 82]
  ------------------
10402|  26.8k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  26.8k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  26.8k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10402:9): [True: 19, False: 26.8k]
  ------------------
10403|     19|        xmlFreeDoc(doc);
10404|       |        ctxt->myDoc = NULL;
10405|     19|    }
10406|  26.9k|}
parser.c:xmlParseTryOrFinish:
10867|   448k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10868|   448k|    int ret = 0;
10869|   448k|    size_t avail;
10870|   448k|    xmlChar cur, next;
10871|       |
10872|   448k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10872:9): [True: 0, False: 448k]
  ------------------
10873|      0|        return(0);
10874|       |
10875|   448k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10875:9): [True: 448k, False: 0]
  ------------------
10876|   448k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10876:9): [True: 2.70k, False: 445k]
  ------------------
10877|  2.70k|        xmlParserShrink(ctxt);
10878|  2.70k|    }
10879|       |
10880|  5.06M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10880:12): [True: 5.05M, False: 11.4k]
  ------------------
10881|  5.05M|        avail = ctxt->input->end - ctxt->input->cur;
10882|  5.05M|        if (avail < 1)
  ------------------
  |  Branch (10882:13): [True: 22.8k, False: 5.03M]
  ------------------
10883|  22.8k|	    goto done;
10884|  5.03M|        switch (ctxt->instate) {
10885|  5.10k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10885:13): [True: 5.10k, False: 5.02M]
  ------------------
10886|       |	        /*
10887|       |		 * Document parsing is done !
10888|       |		 */
10889|  5.10k|	        goto done;
10890|  41.0k|            case XML_PARSER_START:
  ------------------
  |  Branch (10890:13): [True: 41.0k, False: 4.98M]
  ------------------
10891|       |                /*
10892|       |                 * Very first chars read from the document flow.
10893|       |                 */
10894|  41.0k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10894:21): [True: 39.8k, False: 1.20k]
  |  Branch (10894:37): [True: 481, False: 39.3k]
  ------------------
10895|    481|                    goto done;
10896|       |
10897|       |                /*
10898|       |                 * We need more bytes to detect EBCDIC code pages.
10899|       |                 * See xmlDetectEBCDIC.
10900|       |                 */
10901|  40.5k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2268|  40.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 814, False: 39.7k]
  |  |  |  Branch (2268:41): [True: 795, False: 19]
  |  |  ------------------
  |  | 2269|  40.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 776, False: 19]
  |  |  |  Branch (2269:41): [True: 765, False: 11]
  |  |  ------------------
  ------------------
10902|    765|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10902:21): [True: 398, False: 367]
  |  Branch (10902:37): [True: 363, False: 35]
  ------------------
10903|    363|                    goto done;
10904|       |
10905|  40.1k|                xmlDetectEncoding(ctxt);
10906|  40.1k|                ctxt->instate = XML_PARSER_XML_DECL;
10907|  40.1k|		break;
10908|       |
10909|  55.4k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10909:13): [True: 55.4k, False: 4.97M]
  ------------------
10910|  55.4k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10910:7): [True: 53.1k, False: 2.31k]
  |  Branch (10910:23): [True: 7, False: 53.1k]
  ------------------
10911|      7|		    goto done;
10912|  55.4k|		cur = ctxt->input->cur[0];
10913|  55.4k|		next = ctxt->input->cur[1];
10914|  55.4k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10914:14): [True: 54.5k, False: 917]
  |  Branch (10914:30): [True: 24.5k, False: 29.9k]
  ------------------
10915|       |		    /* PI or XML decl */
10916|  24.5k|		    if ((!terminate) &&
  ------------------
  |  Branch (10916:11): [True: 23.0k, False: 1.50k]
  ------------------
10917|  23.0k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10917:25): [True: 15.3k, False: 7.72k]
  ------------------
10918|  15.3k|			goto done;
10919|  9.23k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10919:11): [True: 7.36k, False: 1.87k]
  ------------------
10920|  7.36k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10920:4): [True: 6.38k, False: 978]
  ------------------
10921|  6.38k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10921:4): [True: 3.29k, False: 3.08k]
  ------------------
10922|  3.29k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.29k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.29k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.14k, False: 154]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.29k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 148, False: 6]
  |  |  |  |  |  Branch (91:23): [True: 28, False: 120]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.29k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 8, False: 118]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10923|  3.18k|			ret += 5;
10924|  3.18k|			xmlParseXMLDecl(ctxt);
10925|  6.05k|		    } else {
10926|  6.05k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  6.05k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10927|  6.05k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10927:29): [True: 4, False: 6.04k]
  ------------------
10928|      4|                            xmlErrMemory(ctxt);
10929|      4|                            break;
10930|      4|                        }
10931|  6.05k|		    }
10932|  30.9k|		} else {
10933|  30.9k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  30.9k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10934|  30.9k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10934:11): [True: 2, False: 30.9k]
  ------------------
10935|      2|		        xmlErrMemory(ctxt);
10936|      2|			break;
10937|      2|		    }
10938|  30.9k|		}
10939|  40.1k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10939:21): [True: 40.1k, False: 0]
  |  Branch (10939:36): [True: 40.1k, False: 0]
  ------------------
10940|  40.1k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10941|  40.1k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10942|  40.1k|                }
10943|  40.1k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10943:21): [True: 40.1k, False: 0]
  |  Branch (10943:36): [True: 40.1k, False: 0]
  ------------------
10944|  40.1k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10944:21): [True: 39.7k, False: 351]
  ------------------
10945|  39.7k|                    ctxt->sax->startDocument(ctxt->userData);
10946|  40.1k|                ctxt->instate = XML_PARSER_MISC;
10947|  40.1k|		break;
10948|   606k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10948:13): [True: 606k, False: 4.42M]
  ------------------
10949|   606k|	        const xmlChar *name;
10950|   606k|		const xmlChar *prefix = NULL;
10951|   606k|		const xmlChar *URI = NULL;
10952|   606k|                int line = ctxt->input->line;
10953|   606k|		int nbNs = 0;
10954|       |
10955|   606k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10955:7): [True: 529k, False: 77.1k]
  |  Branch (10955:23): [True: 137, False: 529k]
  ------------------
10956|    137|		    goto done;
10957|   606k|		cur = ctxt->input->cur[0];
10958|   606k|	        if (cur != '<') {
  ------------------
  |  Branch (10958:14): [True: 2.20k, False: 604k]
  ------------------
10959|  2.20k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10960|  2.20k|                                   "Start tag expected, '<' not found");
10961|  2.20k|                    ctxt->instate = XML_PARSER_EOF;
10962|  2.20k|                    xmlFinishDocument(ctxt);
10963|  2.20k|		    goto done;
10964|  2.20k|		}
10965|   604k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10965:7): [True: 528k, False: 75.5k]
  |  Branch (10965:23): [True: 251k, False: 277k]
  ------------------
10966|   251k|                    goto done;
10967|   353k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10967:7): [True: 0, False: 353k]
  ------------------
10968|      0|		    spacePush(ctxt, -1);
10969|   353k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10969:12): [True: 57.1k, False: 296k]
  ------------------
10970|  57.1k|		    spacePush(ctxt, -1);
10971|   296k|		else
10972|   296k|		    spacePush(ctxt, *ctxt->space);
10973|   353k|#ifdef LIBXML_SAX1_ENABLED
10974|   353k|		if (ctxt->sax2)
  ------------------
  |  Branch (10974:7): [True: 251k, False: 102k]
  ------------------
10975|   251k|#endif /* LIBXML_SAX1_ENABLED */
10976|   251k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10977|   102k|#ifdef LIBXML_SAX1_ENABLED
10978|   102k|		else
10979|   102k|		    name = xmlParseStartTag(ctxt);
10980|   353k|#endif /* LIBXML_SAX1_ENABLED */
10981|   353k|		if (name == NULL) {
  ------------------
  |  Branch (10981:7): [True: 2.04k, False: 351k]
  ------------------
10982|  2.04k|		    spacePop(ctxt);
10983|  2.04k|                    ctxt->instate = XML_PARSER_EOF;
10984|  2.04k|                    xmlFinishDocument(ctxt);
10985|  2.04k|		    goto done;
10986|  2.04k|		}
10987|   351k|#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|   351k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10993:7): [True: 174k, False: 176k]
  |  Branch (10993:25): [True: 140k, False: 34.4k]
  |  Branch (10993:45): [True: 140k, False: 0]
  ------------------
10994|   140k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10994:7): [True: 140k, False: 0]
  |  Branch (10994:21): [True: 0, False: 140k]
  ------------------
10995|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10996|   351k|#endif /* LIBXML_VALID_ENABLED */
10997|       |
10998|       |		/*
10999|       |		 * Check for an Empty Element.
11000|       |		 */
11001|   351k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   351k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   136k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (11001:7): [True: 136k, False: 214k]
  |  Branch (11001:23): [True: 133k, False: 2.87k]
  ------------------
11002|   133k|		    SKIP(2);
  ------------------
  |  | 2285|   133k|#define SKIP(val) do {							\
  |  | 2286|   133k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   133k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.01k, False: 132k]
  |  |  ------------------
  |  | 2288|   133k|        xmlParserGrow(ctxt);						\
  |  | 2289|   133k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 133k]
  |  |  ------------------
  ------------------
11003|       |
11004|   133k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (11004:11): [True: 111k, False: 22.2k]
  ------------------
11005|   111k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11005:8): [True: 111k, False: 0]
  ------------------
11006|   111k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (11006:8): [True: 111k, False: 0]
  ------------------
11007|   111k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11007:8): [True: 111k, False: 71]
  ------------------
11008|   111k|			    ctxt->sax->endElementNs(ctxt->userData, name,
11009|   111k|			                            prefix, URI);
11010|   111k|			if (nbNs > 0)
  ------------------
  |  Branch (11010:8): [True: 14.8k, False: 96.6k]
  ------------------
11011|  14.8k|			    xmlParserNsPop(ctxt, nbNs);
11012|   111k|#ifdef LIBXML_SAX1_ENABLED
11013|   111k|		    } else {
11014|  22.2k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11014:8): [True: 22.2k, False: 0]
  ------------------
11015|  22.2k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (11015:8): [True: 22.2k, False: 0]
  ------------------
11016|  22.2k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11016:8): [True: 22.2k, False: 18]
  ------------------
11017|  22.2k|			    ctxt->sax->endElement(ctxt->userData, name);
11018|  22.2k|#endif /* LIBXML_SAX1_ENABLED */
11019|  22.2k|		    }
11020|   133k|		    spacePop(ctxt);
11021|   217k|		} else if (RAW == '>') {
  ------------------
  |  | 2261|   217k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11021:14): [True: 170k, False: 46.3k]
  ------------------
11022|   170k|		    NEXT;
  ------------------
  |  | 2316|   170k|#define NEXT xmlNextChar(ctxt)
  ------------------
11023|   170k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
11024|   170k|		} else {
11025|  46.3k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
11026|  46.3k|					 "Couldn't find end of Start Tag %s\n",
11027|  46.3k|					 name);
11028|  46.3k|		    nodePop(ctxt);
11029|  46.3k|		    spacePop(ctxt);
11030|  46.3k|                    if (nbNs > 0)
  ------------------
  |  Branch (11030:25): [True: 5.93k, False: 40.4k]
  ------------------
11031|  5.93k|                        xmlParserNsPop(ctxt, nbNs);
11032|  46.3k|		}
11033|       |
11034|   351k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (11034:21): [True: 9.22k, False: 341k]
  ------------------
11035|  9.22k|                    ctxt->instate = XML_PARSER_EPILOG;
11036|   341k|                else
11037|   341k|                    ctxt->instate = XML_PARSER_CONTENT;
11038|   351k|                break;
11039|   353k|	    }
11040|  4.02M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11040:13): [True: 4.02M, False: 1.00M]
  ------------------
11041|  4.02M|		cur = ctxt->input->cur[0];
11042|       |
11043|  4.02M|		if (cur == '<') {
  ------------------
  |  Branch (11043:7): [True: 484k, False: 3.53M]
  ------------------
11044|   484k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11044:25): [True: 400k, False: 83.7k]
  |  Branch (11044:41): [True: 1.33k, False: 399k]
  ------------------
11045|  1.33k|                        goto done;
11046|   482k|		    next = ctxt->input->cur[1];
11047|       |
11048|   482k|                    if (next == '/') {
  ------------------
  |  Branch (11048:25): [True: 35.4k, False: 447k]
  ------------------
11049|  35.4k|                        ctxt->instate = XML_PARSER_END_TAG;
11050|  35.4k|                        break;
11051|   447k|                    } else if (next == '?') {
  ------------------
  |  Branch (11051:32): [True: 37.9k, False: 409k]
  ------------------
11052|  37.9k|                        if ((!terminate) &&
  ------------------
  |  Branch (11052:29): [True: 33.4k, False: 4.52k]
  ------------------
11053|  33.4k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11053:29): [True: 5.02k, False: 28.4k]
  ------------------
11054|  5.02k|                            goto done;
11055|  32.9k|                        xmlParsePI(ctxt);
11056|  32.9k|                        ctxt->instate = XML_PARSER_CONTENT;
11057|  32.9k|                        break;
11058|   409k|                    } else if (next == '!') {
  ------------------
  |  Branch (11058:32): [True: 86.5k, False: 322k]
  ------------------
11059|  86.5k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11059:29): [True: 79.8k, False: 6.69k]
  |  Branch (11059:45): [True: 186, False: 79.7k]
  ------------------
11060|    186|                            goto done;
11061|  86.4k|                        next = ctxt->input->cur[2];
11062|       |
11063|  86.4k|                        if (next == '-') {
  ------------------
  |  Branch (11063:29): [True: 62.9k, False: 23.4k]
  ------------------
11064|  62.9k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11064:33): [True: 59.8k, False: 3.07k]
  |  Branch (11064:49): [True: 136, False: 59.6k]
  ------------------
11065|    136|                                goto done;
11066|  62.7k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11066:33): [True: 62.7k, False: 16]
  ------------------
11067|  62.7k|                                if ((!terminate) &&
  ------------------
  |  Branch (11067:37): [True: 59.6k, False: 3.07k]
  ------------------
11068|  59.6k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11068:37): [True: 5.02k, False: 54.6k]
  ------------------
11069|  5.02k|                                    goto done;
11070|  57.7k|                                xmlParseComment(ctxt);
11071|  57.7k|                                ctxt->instate = XML_PARSER_CONTENT;
11072|  57.7k|                                break;
11073|  62.7k|                            }
11074|  62.7k|                        } else if (next == '[') {
  ------------------
  |  Branch (11074:36): [True: 23.1k, False: 346]
  ------------------
11075|  23.1k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11075:33): [True: 19.6k, False: 3.50k]
  |  Branch (11075:49): [True: 209, False: 19.4k]
  ------------------
11076|    209|                                goto done;
11077|  22.9k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11077:33): [True: 22.9k, False: 0]
  ------------------
11078|  22.9k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11078:33): [True: 22.9k, False: 29]
  ------------------
11079|  22.9k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11079:33): [True: 22.9k, False: 9]
  ------------------
11080|  22.9k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11080:33): [True: 22.8k, False: 8]
  ------------------
11081|  22.8k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11081:33): [True: 22.8k, False: 16]
  ------------------
11082|  22.8k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11082:33): [True: 22.8k, False: 11]
  ------------------
11083|  22.8k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11083:33): [True: 22.8k, False: 9]
  ------------------
11084|  22.8k|                                if ((!terminate) &&
  ------------------
  |  Branch (11084:37): [True: 19.3k, False: 3.45k]
  ------------------
11085|  19.3k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11085:37): [True: 5.25k, False: 14.1k]
  ------------------
11086|  5.25k|                                    goto done;
11087|  17.6k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11088|  17.6k|                                xmlParseCDSect(ctxt);
11089|  17.6k|                                ctxt->instate = XML_PARSER_CONTENT;
11090|  17.6k|                                break;
11091|  22.8k|                            }
11092|  22.9k|                        }
11093|  86.4k|                    }
11094|  3.53M|		} else if (cur == '&') {
  ------------------
  |  Branch (11094:14): [True: 40.9k, False: 3.49M]
  ------------------
11095|  40.9k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11095:11): [True: 31.4k, False: 9.55k]
  |  Branch (11095:27): [True: 16.3k, False: 15.1k]
  ------------------
11096|  16.3k|			goto done;
11097|  24.6k|		    xmlParseReference(ctxt);
11098|  24.6k|                    break;
11099|  3.49M|		} 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|  3.49M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  3.49M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11112:11): [True: 139k, False: 3.35M]
  ------------------
11113|   139k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11113:8): [True: 116k, False: 23.6k]
  |  Branch (11113:24): [True: 8.18k, False: 107k]
  ------------------
11114|  8.18k|			    goto done;
11115|   139k|                    }
11116|  3.48M|                    ctxt->checkIndex = 0;
11117|  3.48M|		    xmlParseCharDataInternal(ctxt, !terminate);
11118|  3.48M|                    break;
11119|  3.49M|		}
11120|       |
11121|   323k|                ctxt->instate = XML_PARSER_START_TAG;
11122|   323k|		break;
11123|  4.02M|	    }
11124|  41.6k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11124:13): [True: 41.6k, False: 4.98M]
  ------------------
11125|  41.6k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11125:7): [True: 34.8k, False: 6.74k]
  |  Branch (11125:23): [True: 7.30k, False: 27.5k]
  ------------------
11126|  7.30k|		    goto done;
11127|  34.3k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11127:7): [True: 24.2k, False: 10.0k]
  ------------------
11128|  24.2k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11129|  24.2k|		    nameNsPop(ctxt);
11130|  24.2k|		}
11131|  10.0k|#ifdef LIBXML_SAX1_ENABLED
11132|  10.0k|		  else
11133|  10.0k|		    xmlParseEndTag1(ctxt, 0);
11134|  34.3k|#endif /* LIBXML_SAX1_ENABLED */
11135|  34.3k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11135:7): [True: 2.83k, False: 31.4k]
  ------------------
11136|  2.83k|		    ctxt->instate = XML_PARSER_EPILOG;
11137|  31.4k|		} else {
11138|  31.4k|		    ctxt->instate = XML_PARSER_CONTENT;
11139|  31.4k|		}
11140|  34.3k|		break;
11141|   110k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11141:13): [True: 110k, False: 4.91M]
  ------------------
11142|   201k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11142:13): [True: 90.2k, False: 4.94M]
  ------------------
11143|   207k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11143:13): [True: 6.25k, False: 5.02M]
  ------------------
11144|   207k|		SKIP_BLANKS;
  ------------------
  |  | 2312|   207k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11145|   207k|                avail = ctxt->input->end - ctxt->input->cur;
11146|   207k|		if (avail < 1)
  ------------------
  |  Branch (11146:7): [True: 3.57k, False: 203k]
  ------------------
11147|  3.57k|		    goto done;
11148|   203k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11148:7): [True: 199k, False: 4.24k]
  ------------------
11149|   199k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11149:25): [True: 193k, False: 5.64k]
  |  Branch (11149:41): [True: 254, False: 193k]
  ------------------
11150|    254|                        goto done;
11151|   199k|                    next = ctxt->input->cur[1];
11152|   199k|                    if (next == '?') {
  ------------------
  |  Branch (11152:25): [True: 40.7k, False: 158k]
  ------------------
11153|  40.7k|                        if ((!terminate) &&
  ------------------
  |  Branch (11153:29): [True: 39.4k, False: 1.25k]
  ------------------
11154|  39.4k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11154:29): [True: 8.62k, False: 30.8k]
  ------------------
11155|  8.62k|                            goto done;
11156|  32.0k|                        xmlParsePI(ctxt);
11157|  32.0k|                        break;
11158|   158k|                    } else if (next == '!') {
  ------------------
  |  Branch (11158:32): [True: 126k, False: 32.2k]
  ------------------
11159|   126k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11159:29): [True: 123k, False: 2.70k]
  |  Branch (11159:45): [True: 177, False: 123k]
  ------------------
11160|    177|                            goto done;
11161|       |
11162|   126k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11162:29): [True: 82.3k, False: 43.7k]
  ------------------
11163|  82.3k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11163:33): [True: 81.6k, False: 726]
  |  Branch (11163:49): [True: 171, False: 81.4k]
  ------------------
11164|    171|                                goto done;
11165|  82.1k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11165:33): [True: 82.1k, False: 17]
  ------------------
11166|  82.1k|                                if ((!terminate) &&
  ------------------
  |  Branch (11166:37): [True: 81.4k, False: 718]
  ------------------
11167|  81.4k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11167:37): [True: 12.0k, False: 69.3k]
  ------------------
11168|  12.0k|                                    goto done;
11169|  70.0k|                                xmlParseComment(ctxt);
11170|  70.0k|                                break;
11171|  82.1k|                            }
11172|  82.1k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11172:36): [True: 43.7k, False: 84]
  ------------------
11173|  43.7k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11173:33): [True: 41.7k, False: 1.92k]
  |  Branch (11173:49): [True: 24, False: 41.7k]
  ------------------
11174|     24|                                goto done;
11175|  43.6k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11175:33): [True: 43.6k, False: 16]
  ------------------
11176|  43.6k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11176:33): [True: 43.6k, False: 5]
  ------------------
11177|  43.6k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11177:33): [True: 43.6k, False: 9]
  ------------------
11178|  43.6k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11178:33): [True: 43.6k, False: 5]
  ------------------
11179|  43.6k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11179:33): [True: 43.6k, False: 9]
  ------------------
11180|  43.6k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11180:33): [True: 43.6k, False: 1]
  ------------------
11181|  43.6k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11181:33): [True: 43.6k, False: 4]
  ------------------
11182|  43.6k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11182:37): [True: 41.7k, False: 1.88k]
  |  Branch (11182:53): [True: 25.3k, False: 16.3k]
  ------------------
11183|  25.3k|                                    goto done;
11184|  18.2k|                                ctxt->inSubset = 1;
11185|  18.2k|                                xmlParseDocTypeDecl(ctxt);
11186|  18.2k|                                if (RAW == '[') {
  ------------------
  |  | 2261|  18.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11186:37): [True: 14.2k, False: 4.00k]
  ------------------
11187|  14.2k|                                    ctxt->instate = XML_PARSER_DTD;
11188|  14.2k|                                } else {
11189|  4.00k|                                    if (RAW == '>')
  ------------------
  |  | 2261|  4.00k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11189:41): [True: 3.77k, False: 227]
  ------------------
11190|  3.77k|                                        NEXT;
  ------------------
  |  | 2316|  3.77k|#define NEXT xmlNextChar(ctxt)
  ------------------
11191|       |                                    /*
11192|       |                                     * Create and update the external subset.
11193|       |                                     */
11194|  4.00k|                                    ctxt->inSubset = 2;
11195|  4.00k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11195:41): [True: 4.00k, False: 0]
  ------------------
11196|  4.00k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11196:41): [True: 3.89k, False: 108]
  ------------------
11197|  3.89k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11197:41): [True: 3.89k, False: 0]
  ------------------
11198|  3.89k|                                        ctxt->sax->externalSubset(
11199|  3.89k|                                                ctxt->userData,
11200|  3.89k|                                                ctxt->intSubName,
11201|  3.89k|                                                ctxt->extSubSystem,
11202|  3.89k|                                                ctxt->extSubURI);
11203|  4.00k|                                    ctxt->inSubset = 0;
11204|  4.00k|                                    xmlCleanSpecialAttr(ctxt);
11205|  4.00k|                                    ctxt->instate = XML_PARSER_PROLOG;
11206|  4.00k|                                }
11207|  18.2k|                                break;
11208|  43.6k|                            }
11209|  43.6k|                        }
11210|   126k|                    }
11211|   199k|                }
11212|       |
11213|  36.6k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11213:21): [True: 2.37k, False: 34.2k]
  ------------------
11214|  2.37k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11214:25): [True: 29, False: 2.34k]
  ------------------
11215|     29|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11216|  2.37k|		    ctxt->instate = XML_PARSER_EOF;
11217|  2.37k|                    xmlFinishDocument(ctxt);
11218|  34.2k|                } else {
11219|  34.2k|		    ctxt->instate = XML_PARSER_START_TAG;
11220|  34.2k|		}
11221|  36.6k|		break;
11222|  51.7k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11222:13): [True: 51.7k, False: 4.97M]
  ------------------
11223|  51.7k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11223:21): [True: 46.4k, False: 5.28k]
  |  Branch (11223:37): [True: 37.6k, False: 8.88k]
  ------------------
11224|  37.6k|                    goto done;
11225|  14.1k|		xmlParseInternalSubset(ctxt);
11226|  14.1k|		ctxt->inSubset = 2;
11227|  14.1k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11227:7): [True: 14.1k, False: 0]
  |  Branch (11227:30): [True: 11.8k, False: 2.34k]
  ------------------
11228|  11.8k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11228:7): [True: 11.8k, False: 0]
  ------------------
11229|  11.8k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11230|  11.8k|			    ctxt->extSubSystem, ctxt->extSubURI);
11231|  14.1k|		ctxt->inSubset = 0;
11232|  14.1k|		xmlCleanSpecialAttr(ctxt);
11233|  14.1k|		ctxt->instate = XML_PARSER_PROLOG;
11234|  14.1k|                break;
11235|  51.7k|	    }
11236|      0|            default:
  ------------------
  |  Branch (11236:13): [True: 0, False: 5.03M]
  ------------------
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|  5.03M|	}
11242|  5.03M|    }
11243|   448k|done:
11244|   448k|    return(ret);
11245|   448k|}
parser.c:xmlParseLookupString:
10647|   256k|                     const char *str, size_t strLen) {
10648|   256k|    const xmlChar *cur, *term;
10649|       |
10650|   256k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10650:9): [True: 207k, False: 48.9k]
  ------------------
10651|   207k|        cur = ctxt->input->cur + startDelta;
10652|   207k|    } else {
10653|  48.9k|        cur = ctxt->input->cur + ctxt->checkIndex;
10654|  48.9k|    }
10655|       |
10656|   256k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   256k|#define BAD_CAST (xmlChar *)
  ------------------
10657|   256k|    if (term == NULL) {
  ------------------
  |  Branch (10657:9): [True: 51.3k, False: 205k]
  ------------------
10658|  51.3k|        const xmlChar *end = ctxt->input->end;
10659|  51.3k|        size_t index;
10660|       |
10661|       |        /* Rescan (strLen - 1) characters. */
10662|  51.3k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10662:13): [True: 1.19k, False: 50.1k]
  ------------------
10663|  1.19k|            end = cur;
10664|  50.1k|        else
10665|  50.1k|            end -= strLen - 1;
10666|  51.3k|        index = end - ctxt->input->cur;
10667|  51.3k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10667:13): [True: 0, False: 51.3k]
  ------------------
10668|      0|            ctxt->checkIndex = 0;
10669|      0|            return(ctxt->input->end - strLen);
10670|      0|        }
10671|  51.3k|        ctxt->checkIndex = index;
10672|   205k|    } else {
10673|   205k|        ctxt->checkIndex = 0;
10674|   205k|    }
10675|       |
10676|   256k|    return(term);
10677|   256k|}
parser.c:xmlParseLookupGt:
10714|   570k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10715|   570k|    const xmlChar *cur;
10716|   570k|    const xmlChar *end = ctxt->input->end;
10717|   570k|    int state = ctxt->endCheckState;
10718|   570k|    size_t index;
10719|       |
10720|   570k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10720:9): [True: 304k, False: 266k]
  ------------------
10721|   304k|        cur = ctxt->input->cur + 1;
10722|   266k|    else
10723|   266k|        cur = ctxt->input->cur + ctxt->checkIndex;
10724|       |
10725|   149M|    while (cur < end) {
  ------------------
  |  Branch (10725:12): [True: 149M, False: 276k]
  ------------------
10726|   149M|        if (state) {
  ------------------
  |  Branch (10726:13): [True: 135M, False: 13.7M]
  ------------------
10727|   135M|            if (*cur == state)
  ------------------
  |  Branch (10727:17): [True: 264k, False: 135M]
  ------------------
10728|   264k|                state = 0;
10729|   135M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10729:20): [True: 126k, False: 13.5M]
  |  Branch (10729:36): [True: 140k, False: 13.4M]
  ------------------
10730|   267k|            state = *cur;
10731|  13.4M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10731:20): [True: 294k, False: 13.1M]
  ------------------
10732|   294k|            ctxt->checkIndex = 0;
10733|   294k|            ctxt->endCheckState = 0;
10734|   294k|            return(1);
10735|   294k|        }
10736|   148M|        cur++;
10737|   148M|    }
10738|       |
10739|   276k|    index = cur - ctxt->input->cur;
10740|   276k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10740:9): [True: 0, False: 276k]
  ------------------
10741|      0|        ctxt->checkIndex = 0;
10742|      0|        ctxt->endCheckState = 0;
10743|      0|        return(1);
10744|      0|    }
10745|   276k|    ctxt->checkIndex = index;
10746|   276k|    ctxt->endCheckState = state;
10747|   276k|    return(0);
10748|   276k|}
parser.c:xmlParseLookupChar:
10613|  66.2k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10614|  66.2k|    const xmlChar *cur;
10615|       |
10616|  66.2k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10616:9): [True: 46.5k, False: 19.7k]
  ------------------
10617|  46.5k|        cur = ctxt->input->cur + 1;
10618|  46.5k|    } else {
10619|  19.7k|        cur = ctxt->input->cur + ctxt->checkIndex;
10620|  19.7k|    }
10621|       |
10622|  66.2k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10622:9): [True: 23.6k, False: 42.6k]
  ------------------
10623|  23.6k|        size_t index = ctxt->input->end - ctxt->input->cur;
10624|       |
10625|  23.6k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10625:13): [True: 0, False: 23.6k]
  ------------------
10626|      0|            ctxt->checkIndex = 0;
10627|      0|            return(1);
10628|      0|        }
10629|  23.6k|        ctxt->checkIndex = index;
10630|  23.6k|        return(0);
10631|  42.6k|    } else {
10632|  42.6k|        ctxt->checkIndex = 0;
10633|  42.6k|        return(1);
10634|  42.6k|    }
10635|  66.2k|}
parser.c:xmlParseLookupCharData:
10685|   116k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10686|   116k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10687|   116k|    const xmlChar *end = ctxt->input->end;
10688|   116k|    size_t index;
10689|       |
10690|  1.31M|    while (cur < end) {
  ------------------
  |  Branch (10690:12): [True: 1.30M, False: 8.18k]
  ------------------
10691|  1.30M|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10691:13): [True: 101k, False: 1.20M]
  |  Branch (10691:30): [True: 6.79k, False: 1.19M]
  ------------------
10692|   107k|            ctxt->checkIndex = 0;
10693|   107k|            return(1);
10694|   107k|        }
10695|  1.19M|        cur++;
10696|  1.19M|    }
10697|       |
10698|  8.18k|    index = cur - ctxt->input->cur;
10699|  8.18k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10699:9): [True: 0, False: 8.18k]
  ------------------
10700|      0|        ctxt->checkIndex = 0;
10701|      0|        return(1);
10702|      0|    }
10703|  8.18k|    ctxt->checkIndex = index;
10704|  8.18k|    return(0);
10705|  8.18k|}
parser.c:nameNsPop:
 2149|  24.2k|{
 2150|  24.2k|    const xmlChar *ret;
 2151|       |
 2152|  24.2k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2152:9): [True: 0, False: 24.2k]
  ------------------
 2153|      0|        return (NULL);
 2154|  24.2k|    ctxt->nameNr--;
 2155|  24.2k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2155:9): [True: 22.7k, False: 1.56k]
  ------------------
 2156|  22.7k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2157|  1.56k|    else
 2158|  1.56k|        ctxt->name = NULL;
 2159|  24.2k|    ret = ctxt->nameTab[ctxt->nameNr];
 2160|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2161|  24.2k|    return (ret);
 2162|  24.2k|}
parser.c:xmlParseLookupInternalSubset:
10757|  46.4k|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|  46.4k|    const xmlChar *cur, *start;
10766|  46.4k|    const xmlChar *end = ctxt->input->end;
10767|  46.4k|    int state = ctxt->endCheckState;
10768|  46.4k|    size_t index;
10769|       |
10770|  46.4k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10770:9): [True: 12.5k, False: 33.9k]
  ------------------
10771|  12.5k|        cur = ctxt->input->cur + 1;
10772|  33.9k|    } else {
10773|  33.9k|        cur = ctxt->input->cur + ctxt->checkIndex;
10774|  33.9k|    }
10775|  46.4k|    start = cur;
10776|       |
10777|  28.4M|    while (cur < end) {
  ------------------
  |  Branch (10777:12): [True: 28.4M, False: 37.6k]
  ------------------
10778|  28.4M|        if (state == '-') {
  ------------------
  |  Branch (10778:13): [True: 151k, False: 28.2M]
  ------------------
10779|   151k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10779:17): [True: 34.5k, False: 116k]
  ------------------
10780|  34.5k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10780:17): [True: 24.8k, False: 9.67k]
  ------------------
10781|  24.8k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10781:17): [True: 14.3k, False: 10.4k]
  ------------------
10782|  14.3k|                state = 0;
10783|  14.3k|                cur += 3;
10784|  14.3k|                start = cur;
10785|  14.3k|                continue;
10786|  14.3k|            }
10787|   151k|        }
10788|  28.2M|        else if (state == ']') {
  ------------------
  |  Branch (10788:18): [True: 11.0k, False: 28.2M]
  ------------------
10789|  11.0k|            if (*cur == '>') {
  ------------------
  |  Branch (10789:17): [True: 8.64k, False: 2.38k]
  ------------------
10790|  8.64k|                ctxt->checkIndex = 0;
10791|  8.64k|                ctxt->endCheckState = 0;
10792|  8.64k|                return(1);
10793|  8.64k|            }
10794|  2.38k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.38k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.38k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 259, False: 2.12k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.38k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.91k, False: 206]
  |  |  |  |  |  Branch (91:23): [True: 453, False: 1.46k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.38k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 561, False: 1.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10795|  1.27k|                state = ' ';
10796|  1.27k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10796:24): [True: 588, False: 520]
  ------------------
10797|    588|                state = 0;
10798|    588|                start = cur;
10799|    588|                continue;
10800|    588|            }
10801|  2.38k|        }
10802|  28.2M|        else if (state == ' ') {
  ------------------
  |  Branch (10802:18): [True: 2.02k, False: 28.2M]
  ------------------
10803|  2.02k|            if (*cur == '>') {
  ------------------
  |  Branch (10803:17): [True: 242, False: 1.78k]
  ------------------
10804|    242|                ctxt->checkIndex = 0;
10805|    242|                ctxt->endCheckState = 0;
10806|    242|                return(1);
10807|    242|            }
10808|  1.78k|            if (!IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  1.78k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  1.78k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 217, False: 1.56k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.78k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.32k, False: 242]
  |  |  |  |  |  Branch (91:23): [True: 306, False: 1.01k]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.78k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 235, False: 1.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10809|  1.02k|                state = 0;
10810|  1.02k|                start = cur;
10811|  1.02k|                continue;
10812|  1.02k|            }
10813|  1.78k|        }
10814|  28.2M|        else if (state != 0) {
  ------------------
  |  Branch (10814:18): [True: 22.8M, False: 5.36M]
  ------------------
10815|  22.8M|            if (*cur == state) {
  ------------------
  |  Branch (10815:17): [True: 35.6k, False: 22.8M]
  ------------------
10816|  35.6k|                state = 0;
10817|  35.6k|                start = cur + 1;
10818|  35.6k|            }
10819|  22.8M|        }
10820|  5.36M|        else if (*cur == '<') {
  ------------------
  |  Branch (10820:18): [True: 62.0k, False: 5.30M]
  ------------------
10821|  62.0k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10821:17): [True: 46.6k, False: 15.3k]
  ------------------
10822|  46.6k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10822:17): [True: 14.7k, False: 31.9k]
  ------------------
10823|  14.7k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10823:17): [True: 14.4k, False: 289]
  ------------------
10824|  14.4k|                state = '-';
10825|  14.4k|                cur += 4;
10826|       |                /* Don't treat <!--> as comment */
10827|  14.4k|                start = cur;
10828|  14.4k|                continue;
10829|  14.4k|            }
10830|  62.0k|        }
10831|  5.30M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10831:18): [True: 24.0k, False: 5.27M]
  |  Branch (10831:35): [True: 12.0k, False: 5.26M]
  |  Branch (10831:53): [True: 10.5k, False: 5.25M]
  ------------------
10832|  46.6k|            state = *cur;
10833|  46.6k|        }
10834|       |
10835|  28.3M|        cur++;
10836|  28.3M|    }
10837|       |
10838|       |    /*
10839|       |     * Rescan the three last characters to detect "<!--" and "-->"
10840|       |     * split across chunks.
10841|       |     */
10842|  37.6k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10842:9): [True: 7.12k, False: 30.4k]
  |  Branch (10842:25): [True: 403, False: 30.0k]
  ------------------
10843|  7.52k|        if (cur - start < 3)
  ------------------
  |  Branch (10843:13): [True: 580, False: 6.94k]
  ------------------
10844|    580|            cur = start;
10845|  6.94k|        else
10846|  6.94k|            cur -= 3;
10847|  7.52k|    }
10848|  37.6k|    index = cur - ctxt->input->cur;
10849|  37.6k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10849:9): [True: 0, False: 37.6k]
  ------------------
10850|      0|        ctxt->checkIndex = 0;
10851|      0|        ctxt->endCheckState = 0;
10852|      0|        return(1);
10853|      0|    }
10854|  37.6k|    ctxt->checkIndex = index;
10855|  37.6k|    ctxt->endCheckState = state;
10856|  37.6k|    return(0);
10857|  37.6k|}
parser.c:xmlCtxtParseEntity:
11796|  7.78k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11797|  7.78k|    xmlParserInputPtr input;
11798|  7.78k|    xmlNodePtr list;
11799|  7.78k|    unsigned long consumed;
11800|  7.78k|    int isExternal;
11801|  7.78k|    int buildTree;
11802|  7.78k|    int oldMinNsIndex;
11803|  7.78k|    int oldNodelen, oldNodemem;
11804|       |
11805|  7.78k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11806|  7.78k|    buildTree = (ctxt->node != NULL);
11807|       |
11808|       |    /*
11809|       |     * Recursion check
11810|       |     */
11811|  7.78k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  7.78k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11811:9): [True: 6, False: 7.77k]
  ------------------
11812|      6|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11813|      6|        goto error;
11814|      6|    }
11815|       |
11816|       |    /*
11817|       |     * Load entity
11818|       |     */
11819|  7.77k|    input = xmlNewEntityInputStream(ctxt, ent);
11820|  7.77k|    if (input == NULL)
  ------------------
  |  Branch (11820:9): [True: 1.88k, False: 5.89k]
  ------------------
11821|  1.88k|        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|  5.89k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11829|  5.89k|    if (buildTree)
  ------------------
  |  Branch (11829:9): [True: 5.89k, False: 0]
  ------------------
11830|  5.89k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11831|       |
11832|  5.89k|    oldNodelen = ctxt->nodelen;
11833|  5.89k|    oldNodemem = ctxt->nodemem;
11834|  5.89k|    ctxt->nodelen = 0;
11835|  5.89k|    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|  5.89k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.89k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11855|       |
11856|  5.89k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11857|       |
11858|  5.89k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  5.89k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11859|       |
11860|  5.89k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11861|  5.89k|    ctxt->nodelen = oldNodelen;
11862|  5.89k|    ctxt->nodemem = oldNodemem;
11863|       |
11864|       |    /*
11865|       |     * Entity size accounting
11866|       |     */
11867|  5.89k|    consumed = input->consumed;
11868|  5.89k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11869|       |
11870|  5.89k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  5.89k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11870:9): [True: 3.75k, False: 2.13k]
  ------------------
11871|  3.75k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11872|       |
11873|  5.89k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  5.89k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11873:9): [True: 3.75k, False: 2.13k]
  ------------------
11874|  3.75k|        if (isExternal)
  ------------------
  |  Branch (11874:13): [True: 1.77k, False: 1.98k]
  ------------------
11875|  1.77k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11876|       |
11877|  3.75k|        ent->children = list;
11878|       |
11879|  37.2k|        while (list != NULL) {
  ------------------
  |  Branch (11879:16): [True: 33.4k, False: 3.75k]
  ------------------
11880|  33.4k|            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|  33.4k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11887:17): [True: 0, False: 33.4k]
  ------------------
11888|      0|                xmlSetTreeDoc(list, ent->doc);
11889|       |
11890|  33.4k|            if (list->next == NULL)
  ------------------
  |  Branch (11890:17): [True: 2.74k, False: 30.7k]
  ------------------
11891|  2.74k|                ent->last = list;
11892|  33.4k|            list = list->next;
11893|  33.4k|        }
11894|  3.75k|    } else {
11895|  2.13k|        xmlFreeNodeList(list);
11896|  2.13k|    }
11897|       |
11898|  5.89k|    xmlFreeInputStream(input);
11899|       |
11900|  7.78k|error:
11901|  7.78k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  7.78k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  7.78k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11902|  7.78k|}
parser.c:xmlCtxtParseContentInternal:
11706|  5.89k|                            int hasTextDecl, int buildTree) {
11707|  5.89k|    xmlNodePtr root = NULL;
11708|  5.89k|    xmlNodePtr list = NULL;
11709|  5.89k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  5.89k|#define BAD_CAST (xmlChar *)
  ------------------
11710|  5.89k|    int result;
11711|       |
11712|  5.89k|    if (buildTree) {
  ------------------
  |  Branch (11712:9): [True: 5.89k, False: 0]
  ------------------
11713|  5.89k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11714|  5.89k|        if (root == NULL) {
  ------------------
  |  Branch (11714:13): [True: 1, False: 5.89k]
  ------------------
11715|      1|            xmlErrMemory(ctxt);
11716|      1|            goto error;
11717|      1|        }
11718|  5.89k|    }
11719|       |
11720|  5.89k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11720:9): [True: 2, False: 5.89k]
  ------------------
11721|      2|        goto error;
11722|       |
11723|  5.89k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11724|  5.89k|    spacePush(ctxt, -1);
11725|       |
11726|  5.89k|    if (buildTree)
  ------------------
  |  Branch (11726:9): [True: 5.89k, False: 0]
  ------------------
11727|  5.89k|        nodePush(ctxt, root);
11728|       |
11729|  5.89k|    if (hasTextDecl) {
  ------------------
  |  Branch (11729:9): [True: 2.08k, False: 3.80k]
  ------------------
11730|  2.08k|        xmlDetectEncoding(ctxt);
11731|       |
11732|       |        /*
11733|       |         * Parse a possible text declaration first
11734|       |         */
11735|  2.08k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|  2.08k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.17k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.33k, False: 758]
  |  |  |  |  |  Branch (2268:41): [True: 381, False: 949]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.08k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 351, False: 30]
  |  |  |  |  |  Branch (2269:41): [True: 346, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 341, False: 5]
  |  |  ------------------
  ------------------
11736|    341|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    341|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    341|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 283, False: 58]
  |  |  |  |  ------------------
  |  |  |  |   91|    341|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 57, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 38, False: 19]
  |  |  |  |  ------------------
  |  |  |  |   92|    341|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 18, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11737|    339|            xmlParseTextDecl(ctxt);
11738|       |            /*
11739|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11740|       |             */
11741|    339|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    339|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11741:17): [True: 329, False: 10]
  ------------------
11742|    329|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    329|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11742:17): [True: 91, False: 238]
  ------------------
11743|     91|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11744|     91|                               "Version mismatch between document and "
11745|     91|                               "entity\n");
11746|     91|            }
11747|    339|        }
11748|  2.08k|    }
11749|       |
11750|  5.89k|    xmlParseContentInternal(ctxt);
11751|       |
11752|  5.89k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11752:9): [True: 374, False: 5.51k]
  ------------------
11753|    374|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11754|       |
11755|  5.89k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11755:9): [True: 4.05k, False: 1.83k]
  ------------------
11756|  5.06k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11756:10): [True: 1.16k, False: 669]
  |  Branch (11756:30): [True: 1.00k, False: 155]
  ------------------
11757|  5.06k|        if (root != NULL) {
  ------------------
  |  Branch (11757:13): [True: 5.06k, False: 0]
  ------------------
11758|  5.06k|            xmlNodePtr cur;
11759|       |
11760|       |            /*
11761|       |             * Unlink newly created node list.
11762|       |             */
11763|  5.06k|            list = root->children;
11764|  5.06k|            root->children = NULL;
11765|  5.06k|            root->last = NULL;
11766|  38.5k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11766:30): [True: 33.4k, False: 5.06k]
  ------------------
11767|  33.4k|                cur->parent = NULL;
11768|  5.06k|        }
11769|  5.06k|    }
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.08k|    do {
11776|  6.08k|        ctxt->input->cur = ctxt->input->end;
11777|  6.08k|        xmlParserShrink(ctxt);
11778|  6.08k|        result = xmlParserGrow(ctxt);
11779|  6.08k|    } while (result > 0);
  ------------------
  |  Branch (11779:14): [True: 195, False: 5.89k]
  ------------------
11780|       |
11781|  5.89k|    if (buildTree)
  ------------------
  |  Branch (11781:9): [True: 5.89k, False: 0]
  ------------------
11782|  5.89k|        nodePop(ctxt);
11783|       |
11784|  5.89k|    namePop(ctxt);
11785|  5.89k|    spacePop(ctxt);
11786|       |
11787|  5.89k|    xmlCtxtPopInput(ctxt);
11788|       |
11789|  5.89k|error:
11790|  5.89k|    xmlFreeNode(root);
11791|       |
11792|  5.89k|    return(list);
11793|  5.89k|}
parser.c:xmlParserNsPush:
 1703|   490k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1704|   490k|    xmlParserNsBucket *bucket = NULL;
 1705|   490k|    xmlParserNsExtra *extra;
 1706|   490k|    const xmlChar **ns;
 1707|   490k|    unsigned hashValue, nsIndex, oldIndex;
 1708|       |
 1709|   490k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1709:9): [True: 441k, False: 49.3k]
  |  Branch (1709:29): [True: 195, False: 440k]
  ------------------
 1710|    195|        return(0);
 1711|       |
 1712|   490k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1712:9): [True: 17.3k, False: 473k]
  |  Branch (1712:40): [True: 24, False: 17.3k]
  ------------------
 1713|     24|        xmlErrMemory(ctxt);
 1714|     24|        return(-1);
 1715|     24|    }
 1716|       |
 1717|       |    /*
 1718|       |     * Default namespace and 'xml' namespace
 1719|       |     */
 1720|   490k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1720:9): [True: 49.3k, False: 440k]
  |  Branch (1720:29): [True: 0, False: 440k]
  ------------------
 1721|  49.3k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1722|       |
 1723|  49.3k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1723:13): [True: 46.7k, False: 2.58k]
  ------------------
 1724|  46.7k|            extra = &ctxt->nsdb->extra[oldIndex];
 1725|       |
 1726|  46.7k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1726:17): [True: 591, False: 46.2k]
  ------------------
 1727|    591|                if (defAttr == 0)
  ------------------
  |  Branch (1727:21): [True: 373, False: 218]
  ------------------
 1728|    373|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    373|#define BAD_CAST (xmlChar *)
  ------------------
 1729|    591|                return(0);
 1730|    591|            }
 1731|       |
 1732|  46.2k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1732:17): [True: 7.88k, False: 38.3k]
  ------------------
 1733|  7.88k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1733:17): [True: 5.98k, False: 1.89k]
  ------------------
 1734|  5.98k|                return(0);
 1735|  46.2k|        }
 1736|       |
 1737|  42.8k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1738|  42.8k|        goto populate_entry;
 1739|  49.3k|    }
 1740|       |
 1741|       |    /*
 1742|       |     * Hash table lookup
 1743|       |     */
 1744|   440k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1745|   440k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1745:9): [True: 305k, False: 135k]
  ------------------
 1746|   305k|        extra = &ctxt->nsdb->extra[oldIndex];
 1747|       |
 1748|       |        /*
 1749|       |         * Check for duplicate definitions on the same element.
 1750|       |         */
 1751|   305k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1751:13): [True: 940, False: 305k]
  ------------------
 1752|    940|            if (defAttr == 0)
  ------------------
  |  Branch (1752:17): [True: 872, False: 68]
  ------------------
 1753|    872|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|    872|#define BAD_CAST (xmlChar *)
  ------------------
 1754|    940|            return(0);
 1755|    940|        }
 1756|       |
 1757|   305k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1757:13): [True: 27.6k, False: 277k]
  ------------------
 1758|  27.6k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1758:13): [True: 26.8k, False: 793]
  ------------------
 1759|  26.8k|            return(0);
 1760|       |
 1761|   278k|        bucket->index = ctxt->nsNr;
 1762|   278k|        goto populate_entry;
 1763|   305k|    }
 1764|       |
 1765|       |    /*
 1766|       |     * Insert new bucket
 1767|       |     */
 1768|       |
 1769|   135k|    hashValue = prefix->hashValue;
 1770|       |
 1771|       |    /*
 1772|       |     * Grow hash table, 50% fill factor
 1773|       |     */
 1774|   135k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1774:9): [True: 9.42k, False: 125k]
  ------------------
 1775|  9.42k|        xmlParserNsBucket *newHash;
 1776|  9.42k|        unsigned newSize, i, index;
 1777|       |
 1778|  9.42k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1778:13): [True: 0, False: 9.42k]
  ------------------
 1779|      0|            xmlErrMemory(ctxt);
 1780|      0|            return(-1);
 1781|      0|        }
 1782|  9.42k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1782:19): [True: 791, False: 8.63k]
  ------------------
 1783|  9.42k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1784|  9.42k|        if (newHash == NULL) {
  ------------------
  |  Branch (1784:13): [True: 4, False: 9.41k]
  ------------------
 1785|      4|            xmlErrMemory(ctxt);
 1786|      4|            return(-1);
 1787|      4|        }
 1788|  9.41k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1789|       |
 1790|   409k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1790:21): [True: 400k, False: 9.41k]
  ------------------
 1791|   400k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1792|   400k|            unsigned newIndex;
 1793|       |
 1794|   400k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1794:17): [True: 397k, False: 2.98k]
  |  Branch (1794:30): [True: 1.18k, False: 1.79k]
  ------------------
 1795|   398k|                continue;
 1796|  1.79k|            newIndex = hv & (newSize - 1);
 1797|       |
 1798|  2.73k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1798:20): [True: 934, False: 1.79k]
  ------------------
 1799|    934|                newIndex++;
 1800|    934|                if (newIndex == newSize)
  ------------------
  |  Branch (1800:21): [True: 209, False: 725]
  ------------------
 1801|    209|                    newIndex = 0;
 1802|    934|            }
 1803|       |
 1804|  1.79k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1805|  1.79k|        }
 1806|       |
 1807|  9.41k|        xmlFree(ctxt->nsdb->hash);
 1808|  9.41k|        ctxt->nsdb->hash = newHash;
 1809|  9.41k|        ctxt->nsdb->hashSize = newSize;
 1810|       |
 1811|       |        /*
 1812|       |         * Relookup
 1813|       |         */
 1814|  9.41k|        index = hashValue & (newSize - 1);
 1815|       |
 1816|  9.79k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1816:16): [True: 376, False: 9.41k]
  ------------------
 1817|    376|            index++;
 1818|    376|            if (index == newSize)
  ------------------
  |  Branch (1818:17): [True: 63, False: 313]
  ------------------
 1819|     63|                index = 0;
 1820|    376|        }
 1821|       |
 1822|  9.41k|        bucket = &newHash[index];
 1823|  9.41k|    }
 1824|       |
 1825|   134k|    bucket->hashValue = hashValue;
 1826|   134k|    bucket->index = ctxt->nsNr;
 1827|   134k|    ctxt->nsdb->hashElems++;
 1828|   134k|    oldIndex = INT_MAX;
 1829|       |
 1830|   455k|populate_entry:
 1831|   455k|    nsIndex = ctxt->nsNr;
 1832|       |
 1833|   455k|    ns = &ctxt->nsTab[nsIndex * 2];
 1834|   455k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1834:13): [True: 413k, False: 42.8k]
  ------------------
 1835|   455k|    ns[1] = uri->name;
 1836|       |
 1837|   455k|    extra = &ctxt->nsdb->extra[nsIndex];
 1838|   455k|    extra->saxData = saxData;
 1839|   455k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1839:30): [True: 413k, False: 42.8k]
  ------------------
 1840|   455k|    extra->uriHashValue = uri->hashValue;
 1841|   455k|    extra->elementId = ctxt->nsdb->elementId;
 1842|   455k|    extra->oldIndex = oldIndex;
 1843|       |
 1844|   455k|    ctxt->nsNr++;
 1845|       |
 1846|   455k|    return(1);
 1847|   134k|}
parser.c:xmlParserNsGrow:
 1661|  17.3k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1662|  17.3k|    const xmlChar **table;
 1663|  17.3k|    xmlParserNsExtra *extra;
 1664|  17.3k|    int newSize;
 1665|       |
 1666|  17.3k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1667|  17.3k|                              sizeof(table[0]) + sizeof(extra[0]),
 1668|  17.3k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  17.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1669|  17.3k|    if (newSize < 0)
  ------------------
  |  Branch (1669:9): [True: 0, False: 17.3k]
  ------------------
 1670|      0|        goto error;
 1671|       |
 1672|  17.3k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1673|  17.3k|    if (table == NULL)
  ------------------
  |  Branch (1673:9): [True: 8, False: 17.3k]
  ------------------
 1674|      8|        goto error;
 1675|  17.3k|    ctxt->nsTab = table;
 1676|       |
 1677|  17.3k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1678|  17.3k|    if (extra == NULL)
  ------------------
  |  Branch (1678:9): [True: 16, False: 17.3k]
  ------------------
 1679|     16|        goto error;
 1680|  17.3k|    ctxt->nsdb->extra = extra;
 1681|       |
 1682|  17.3k|    ctxt->nsMax = newSize;
 1683|  17.3k|    return(0);
 1684|       |
 1685|     24|error:
 1686|     24|    xmlErrMemory(ctxt);
 1687|     24|    return(-1);
 1688|  17.3k|}
parser.c:xmlParserNsPop:
 1858|   237k|{
 1859|   237k|    int i;
 1860|       |
 1861|       |    /* assert(nr <= ctxt->nsNr); */
 1862|       |
 1863|   592k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1863:30): [True: 354k, False: 237k]
  ------------------
 1864|   354k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1865|   354k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1866|       |
 1867|   354k|        if (prefix == NULL) {
  ------------------
  |  Branch (1867:13): [True: 17.7k, False: 337k]
  ------------------
 1868|  17.7k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1869|   337k|        } else {
 1870|   337k|            xmlHashedString hprefix;
 1871|   337k|            xmlParserNsBucket *bucket = NULL;
 1872|       |
 1873|   337k|            hprefix.name = prefix;
 1874|   337k|            hprefix.hashValue = extra->prefixHashValue;
 1875|   337k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1876|       |            /* assert(bucket && bucket->hashValue); */
 1877|   337k|            bucket->index = extra->oldIndex;
 1878|   337k|        }
 1879|   354k|    }
 1880|       |
 1881|   237k|    ctxt->nsNr -= nr;
 1882|   237k|    return(nr);
 1883|   237k|}
parser.c:xmlCtxtSetOptionsInternal:
13169|  50.6k|{
13170|  50.6k|    int allMask;
13171|       |
13172|  50.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (13172:9): [True: 0, False: 50.6k]
  ------------------
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|  50.6k|    allMask = XML_PARSE_RECOVER |
13183|  50.6k|              XML_PARSE_NOENT |
13184|  50.6k|              XML_PARSE_DTDLOAD |
13185|  50.6k|              XML_PARSE_DTDATTR |
13186|  50.6k|              XML_PARSE_DTDVALID |
13187|  50.6k|              XML_PARSE_NOERROR |
13188|  50.6k|              XML_PARSE_NOWARNING |
13189|  50.6k|              XML_PARSE_PEDANTIC |
13190|  50.6k|              XML_PARSE_NOBLANKS |
13191|  50.6k|#ifdef LIBXML_SAX1_ENABLED
13192|  50.6k|              XML_PARSE_SAX1 |
13193|  50.6k|#endif
13194|  50.6k|              XML_PARSE_NONET |
13195|  50.6k|              XML_PARSE_NODICT |
13196|  50.6k|              XML_PARSE_NSCLEAN |
13197|  50.6k|              XML_PARSE_NOCDATA |
13198|  50.6k|              XML_PARSE_COMPACT |
13199|  50.6k|              XML_PARSE_OLD10 |
13200|  50.6k|              XML_PARSE_HUGE |
13201|  50.6k|              XML_PARSE_OLDSAX |
13202|  50.6k|              XML_PARSE_IGNORE_ENC |
13203|  50.6k|              XML_PARSE_BIG_LINES |
13204|  50.6k|              XML_PARSE_NO_XXE |
13205|  50.6k|              XML_PARSE_UNZIP |
13206|  50.6k|              XML_PARSE_NO_SYS_CATALOG |
13207|  50.6k|              XML_PARSE_CATALOG_PI;
13208|       |
13209|  50.6k|    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|  50.6k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13225:22): [True: 26.0k, False: 24.5k]
  ------------------
13226|  50.6k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13226:29): [True: 25.7k, False: 24.9k]
  ------------------
13227|  50.6k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  28.0k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13227:24): [True: 28.0k, False: 22.5k]
  ------------------
13228|  50.6k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  24.4k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13228:25): [True: 24.4k, False: 26.1k]
  ------------------
13229|  50.6k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  24.2k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13229:25): [True: 24.2k, False: 26.3k]
  ------------------
13230|  50.6k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13230:22): [True: 24.1k, False: 26.4k]
  ------------------
13231|  50.6k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13231:22): [True: 11.7k, False: 38.8k]
  ------------------
13232|  50.6k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13232:24): [True: 23.2k, False: 27.3k]
  ------------------
13233|  50.6k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13233:23): [True: 21.2k, False: 29.3k]
  ------------------
13234|       |
13235|  50.6k|    return(options & ~allMask);
13236|  50.6k|}

xmlCtxtSetErrorHandler:
  122|  50.6k|{
  123|  50.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 50.6k]
  ------------------
  124|      0|        return;
  125|  50.6k|    ctxt->errorHandler = handler;
  126|  50.6k|    ctxt->errorCtxt = data;
  127|  50.6k|}
xmlCtxtErrMemory:
  179|  15.3k|{
  180|  15.3k|    xmlStructuredErrorFunc schannel = NULL;
  181|  15.3k|    xmlGenericErrorFunc channel = NULL;
  182|  15.3k|    void *data;
  183|       |
  184|  15.3k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 15.3k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  15.3k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  15.3k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  15.3k|    ctxt->wellFormed = 0;
  192|  15.3k|    ctxt->disableSAX = 2;
  193|       |
  194|  15.3k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 15.3k, False: 0]
  ------------------
  195|  15.3k|        schannel = ctxt->errorHandler;
  196|  15.3k|        data = ctxt->errorCtxt;
  197|  15.3k|    } 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|  15.3k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  15.3k|                        &ctxt->lastError);
  208|  15.3k|}
xmlCtxtErrIO:
  221|   242k|{
  222|   242k|    const char *errstr, *msg, *str1, *str2;
  223|   242k|    xmlErrorLevel level;
  224|       |
  225|   242k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 242k]
  ------------------
  226|      0|        return;
  227|       |
  228|   242k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 6.57k, False: 235k]
  ------------------
  229|   235k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 235k]
  ------------------
  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.57k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 3.44k, False: 3.12k]
  ------------------
  237|  3.44k|            level = XML_ERR_WARNING;
  238|  3.12k|        else
  239|  3.12k|            level = XML_ERR_ERROR;
  240|   235k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 235k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   235k|    } else {
  243|   235k|        level = XML_ERR_FATAL;
  244|   235k|    }
  245|       |
  246|   242k|    errstr = xmlErrString(code);
  247|       |
  248|   242k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 235k, False: 6.64k]
  ------------------
  249|   235k|        msg = "%s\n";
  250|   235k|        str1 = errstr;
  251|   235k|        str2 = NULL;
  252|   235k|    } else {
  253|  6.64k|        msg = "failed to load \"%s\": %s\n";
  254|  6.64k|        str1 = uri;
  255|  6.64k|        str2 = errstr;
  256|  6.64k|    }
  257|       |
  258|   242k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   242k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   242k|               msg, str1, str2);
  261|   242k|}
xmlCtxtIsCatastrophicError:
  268|  39.4M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  39.4M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 39.4M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  39.4M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  39.4M|                                  ctxt->lastError.code));
  274|  39.4M|}
xmlCtxtVErr:
  296|  39.6M|{
  297|  39.6M|    xmlStructuredErrorFunc schannel = NULL;
  298|  39.6M|    xmlGenericErrorFunc channel = NULL;
  299|  39.6M|    void *data = NULL;
  300|  39.6M|    const char *file = NULL;
  301|  39.6M|    int line = 0;
  302|  39.6M|    int col = 0;
  303|  39.6M|    int res;
  304|       |
  305|  39.6M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 3.57k, False: 39.6M]
  ------------------
  306|  3.57k|        xmlCtxtErrMemory(ctxt);
  307|  3.57k|        return;
  308|  3.57k|    }
  309|       |
  310|  39.6M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 39.6M]
  ------------------
  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|  39.6M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  39.6M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 247k, False: 39.3M]
  |  |  ------------------
  ------------------
  322|   247k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  39.3M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 39.3M]
  ------------------
  326|      0|        return;
  327|       |
  328|  39.3M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 170k, False: 39.2M]
  ------------------
  329|   170k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   170k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 119k, False: 50.9k]
  ------------------
  330|   119k|            return;
  331|  50.9k|        ctxt->nbWarnings += 1;
  332|  39.2M|    } 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|  39.2M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 22, False: 39.2M]
  ------------------
  342|  39.2M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 313, False: 39.2M]
  ------------------
  343|  39.2M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 100, False: 39.2M]
  ------------------
  344|    435|            ctxt->disableSAX = 2; /* really stop parser */
  345|  39.2M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  39.2M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|  78.4M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 38.6M, False: 616k]
  ------------------
  348|  38.6M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 758k, False: 37.8M]
  |  Branch (348:43): [True: 37.8M, False: 210]
  ------------------
  349|  38.6M|                return;
  350|       |
  351|   616k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 466k, False: 150k]
  |  Branch (351:43): [True: 110k, False: 355k]
  ------------------
  352|   110k|                ctxt->disableSAX = 1;
  353|   616k|        }
  354|       |
  355|   616k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 466k, False: 150k]
  ------------------
  356|   466k|            ctxt->wellFormed = 0;
  357|   616k|        ctxt->errNo = code;
  358|   616k|        ctxt->nbErrors += 1;
  359|   616k|    }
  360|       |
  361|   667k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 250k, False: 417k]
  ------------------
  362|   250k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 230k, False: 19.3k]
  ------------------
  363|   240k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 9.82k, False: 9.48k]
  ------------------
  364|   240k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 240k, False: 0]
  ------------------
  365|   240k|            schannel = ctxt->errorHandler;
  366|   240k|            data = ctxt->errorCtxt;
  367|   240k|        } 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|   240k|    }
  385|       |
  386|   667k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 665k, False: 2.45k]
  ------------------
  387|   665k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   665k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 389k, False: 275k]
  ------------------
  390|   389k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 22.8k, False: 367k]
  ------------------
  391|  22.8k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  22.8k|        }
  393|   665k|        file = input->filename;
  394|   665k|        line = input->line;
  395|   665k|        col = input->col;
  396|   665k|    }
  397|       |
  398|   667k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   667k|                         level, file, line, (const char *) str1,
  400|   667k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   667k|                         msg, ap);
  402|       |
  403|   667k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.59k, False: 665k]
  ------------------
  404|  2.59k|        xmlCtxtErrMemory(ctxt);
  405|  2.59k|        return;
  406|  2.59k|    }
  407|   667k|}
xmlCtxtErr:
  429|  39.1M|{
  430|  39.1M|    va_list ap;
  431|       |
  432|  39.1M|    va_start(ap, msg);
  433|  39.1M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  39.1M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  39.1M|}
xmlFatalErr:
  481|  8.30M|{
  482|  8.30M|    const char *errmsg;
  483|  8.30M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  8.30M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  8.30M|    errmsg = xmlErrString(code);
  487|       |
  488|  8.30M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 8.30M, False: 0]
  |  Branch (488:27): [True: 0, False: 8.30M]
  ------------------
  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|  8.30M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.60M, False: 6.69M]
  ------------------
  497|  1.60M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.60M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  6.69M|    } else {
  500|  6.69M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  6.69M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  6.69M|                   "%s: %s\n", errmsg, info);
  503|  6.69M|    }
  504|  8.30M|}
xmlParserGrow:
  616|  9.74M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  9.74M|    xmlParserInputPtr in = ctxt->input;
  618|  9.74M|    xmlParserInputBufferPtr buf = in->buf;
  619|  9.74M|    size_t curEnd = in->end - in->cur;
  620|  9.74M|    size_t curBase = in->cur - in->base;
  621|  9.74M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 3.15M, False: 6.58M]
  ------------------
  622|  3.15M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  3.15M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  9.74M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  16.3M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  9.74M|    int ret;
  625|       |
  626|  9.74M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 9.74M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  9.74M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  9.74M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  9.74M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.51M, False: 7.22M]
  |  |  ------------------
  ------------------
  630|  2.51M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  7.22M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 6.76M, False: 460k]
  |  Branch (632:35): [True: 6.76M, False: 0]
  ------------------
  633|  6.76M|        return(0);
  634|   460k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 93.8k, False: 367k]
  ------------------
  635|  93.8k|        return(-1);
  636|       |
  637|   367k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 367k]
  ------------------
  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|   367k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   367k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 343, False: 366k]
  ------------------
  644|    343|        return(0);
  645|       |
  646|   366k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   366k|#define INPUT_CHUNK	250
  ------------------
  647|   366k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   366k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 394, False: 366k]
  ------------------
  650|    394|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    394|    }
  652|       |
  653|   366k|    return(ret);
  654|   367k|}
xmlParserCheckEOF:
  664|  24.6k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  24.6k|    xmlParserInputPtr in = ctxt->input;
  666|  24.6k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  24.6k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 20.2k, False: 4.41k]
  ------------------
  669|  20.2k|        return;
  670|       |
  671|  4.41k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 2, False: 4.41k]
  ------------------
  672|      2|        xmlFatalErr(ctxt, code, NULL);
  673|      2|        return;
  674|      2|    }
  675|       |
  676|  4.41k|    buf = in->buf;
  677|  4.41k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 4.41k, False: 0]
  |  Branch (677:26): [True: 13, False: 4.40k]
  ------------------
  678|     13|        size_t curBase = in->cur - in->base;
  679|     13|        size_t sizeOut = 64;
  680|     13|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|     13|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|     13|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|     13|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 1, False: 12]
  ------------------
  688|      1|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      1|            return;
  690|      1|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|     12|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 12]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|     12|    }
  696|  4.41k|}
xmlParserShrink:
  749|  11.2M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  11.2M|    xmlParserInputPtr in = ctxt->input;
  751|  11.2M|    xmlParserInputBufferPtr buf = in->buf;
  752|  11.2M|    size_t used, res;
  753|       |
  754|  11.2M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 11.2M]
  ------------------
  755|      0|        return;
  756|       |
  757|  11.2M|    used = in->cur - in->base;
  758|       |
  759|  11.2M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  11.2M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 7.21M, False: 4.06M]
  ------------------
  760|  7.21M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  7.21M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  7.21M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 7.21M, False: 277]
  ------------------
  763|  7.21M|            used -= res;
  764|  7.21M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  7.21M|        }
  766|       |
  767|  7.21M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  7.21M|    }
  769|  11.2M|}
xmlNextChar:
  818|   608M|{
  819|   608M|    const unsigned char *cur;
  820|   608M|    size_t avail;
  821|   608M|    int c;
  822|       |
  823|   608M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 608M]
  |  Branch (823:27): [True: 0, False: 608M]
  ------------------
  824|      0|        return;
  825|       |
  826|   608M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   608M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   608M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 2.57M, False: 606M]
  ------------------
  829|  2.57M|        xmlParserGrow(ctxt);
  830|  2.57M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 750, False: 2.57M]
  ------------------
  831|    750|            return;
  832|  2.57M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  2.57M|    }
  834|       |
  835|   608M|    cur = ctxt->input->cur;
  836|   608M|    c = *cur;
  837|       |
  838|   608M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 583M, False: 25.3M]
  ------------------
  839|   583M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 254k, False: 583M]
  ------------------
  840|   254k|            ctxt->input->cur++;
  841|   254k|            ctxt->input->line++;
  842|   254k|            ctxt->input->col = 1;
  843|   583M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 44.4k, False: 583M]
  ------------------
  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|  44.4k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 42.5k, False: 1.98k]
  ------------------
  851|  44.4k|            ctxt->input->line++;
  852|  44.4k|            ctxt->input->col = 1;
  853|  44.4k|            return;
  854|   583M|        } else {
  855|   583M|            ctxt->input->cur++;
  856|   583M|            ctxt->input->col++;
  857|   583M|        }
  858|   583M|    } else {
  859|  25.3M|        ctxt->input->col++;
  860|       |
  861|  25.3M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.20k, False: 25.3M]
  |  Branch (861:28): [True: 22.7M, False: 2.63M]
  ------------------
  862|  22.7M|            goto encoding_error;
  863|       |
  864|  2.63M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 2.18M, False: 445k]
  ------------------
  865|       |            /* 2-byte code */
  866|  2.18M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 573k, False: 1.61M]
  ------------------
  867|   573k|                goto encoding_error;
  868|  1.61M|            ctxt->input->cur += 2;
  869|  1.61M|        } else {
  870|   445k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   445k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 319, False: 445k]
  |  Branch (872:32): [True: 5.94k, False: 439k]
  ------------------
  873|  6.25k|                goto encoding_error;
  874|       |
  875|   439k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 419k, False: 20.1k]
  ------------------
  876|       |                /* 3-byte code */
  877|   419k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 197, False: 419k]
  |  Branch (877:40): [True: 221k, False: 197k]
  |  Branch (877:59): [True: 4.74k, False: 217k]
  ------------------
  878|  4.94k|                    goto encoding_error;
  879|   414k|                ctxt->input->cur += 3;
  880|   414k|            } else {
  881|  20.1k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 347, False: 19.7k]
  |  Branch (881:36): [True: 840, False: 18.9k]
  ------------------
  882|  1.18k|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  18.9k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 655, False: 18.2k]
  |  Branch (885:39): [True: 241, False: 18.0k]
  ------------------
  886|    896|                    goto encoding_error;
  887|  18.0k|                ctxt->input->cur += 4;
  888|  18.0k|            }
  889|   439k|        }
  890|  2.63M|    }
  891|       |
  892|   585M|    return;
  893|       |
  894|   585M|encoding_error:
  895|       |    /* Only report the first error */
  896|  23.2M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  23.2M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 194k, False: 23.0M]
  ------------------
  897|   194k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   194k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   194k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   194k|    }
  900|  23.2M|    ctxt->input->cur++;
  901|  23.2M|}
xmlCurrentChar:
  924|  67.3M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  67.3M|    const unsigned char *cur;
  926|  67.3M|    size_t avail;
  927|  67.3M|    int c;
  928|       |
  929|  67.3M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 67.3M]
  |  Branch (929:27): [True: 0, False: 67.3M]
  |  Branch (929:44): [True: 0, False: 67.3M]
  ------------------
  930|       |
  931|  67.3M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  67.3M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  67.3M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 2.99M, False: 64.3M]
  ------------------
  934|  2.99M|        xmlParserGrow(ctxt);
  935|  2.99M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  2.99M|    }
  937|       |
  938|  67.3M|    cur = ctxt->input->cur;
  939|  67.3M|    c = *cur;
  940|       |
  941|  67.3M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 30.3M, False: 37.0M]
  ------------------
  942|       |	/* 1-byte code */
  943|  30.3M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 13.2M, False: 17.1M]
  ------------------
  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|  13.2M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 955k, False: 12.3M]
  ------------------
  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|   955k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 18.1k, False: 937k]
  ------------------
  957|  18.1k|                    ctxt->input->cur++;
  958|   955k|                *len = 1;
  959|   955k|                c = '\n';
  960|  12.3M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 6.72M, False: 5.57M]
  ------------------
  961|  6.72M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 35.4k, False: 6.69M]
  ------------------
  962|  35.4k|                    *len = 0;
  963|  6.69M|                } else {
  964|  6.69M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  6.69M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  6.69M|                            "Char 0x0 out of allowed range\n");
  971|  6.69M|                }
  972|  6.72M|            } else {
  973|  5.57M|                *len = 1;
  974|  5.57M|            }
  975|  17.1M|        } else {
  976|  17.1M|            *len = 1;
  977|  17.1M|        }
  978|       |
  979|  30.3M|        return(c);
  980|  37.0M|    } else {
  981|  37.0M|        int val;
  982|       |
  983|  37.0M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.37k, False: 37.0M]
  ------------------
  984|  1.37k|            goto incomplete_sequence;
  985|  37.0M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 15.2M, False: 21.7M]
  ------------------
  986|  15.2M|            goto encoding_error;
  987|       |
  988|  21.7M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 7.11M, False: 14.6M]
  ------------------
  989|       |            /* 2-byte code */
  990|  7.11M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 486k, False: 6.62M]
  ------------------
  991|   486k|                goto encoding_error;
  992|  6.62M|            val = (c & 0x1f) << 6;
  993|  6.62M|            val |= cur[1] & 0x3f;
  994|  6.62M|            *len = 2;
  995|  14.6M|        } else {
  996|  14.6M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 228, False: 14.6M]
  ------------------
  997|    228|                goto incomplete_sequence;
  998|  14.6M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 8.57k, False: 14.6M]
  ------------------
  999|  8.57k|                goto encoding_error;
 1000|       |
 1001|  14.6M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 14.6M, False: 27.6k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  14.6M|                val = (c & 0xf) << 12;
 1004|  14.6M|                val |= (cur[1] & 0x3f) << 6;
 1005|  14.6M|                val |= cur[2] & 0x3f;
 1006|  14.6M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 367, False: 14.6M]
  |  Branch (1006:39): [True: 3.40M, False: 11.2M]
  |  Branch (1006:58): [True: 262, False: 3.40M]
  ------------------
 1007|    629|                    goto encoding_error;
 1008|  14.6M|                *len = 3;
 1009|  14.6M|            } else {
 1010|  27.6k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 249, False: 27.4k]
  ------------------
 1011|    249|                    goto incomplete_sequence;
 1012|  27.4k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 2.44k, False: 24.9k]
  ------------------
 1013|  2.44k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  24.9k|                val = (c & 0x0f) << 18;
 1017|  24.9k|                val |= (cur[1] & 0x3f) << 12;
 1018|  24.9k|                val |= (cur[2] & 0x3f) << 6;
 1019|  24.9k|                val |= cur[3] & 0x3f;
 1020|  24.9k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 222, False: 24.7k]
  |  Branch (1020:40): [True: 5.59k, False: 19.1k]
  ------------------
 1021|  5.82k|                    goto encoding_error;
 1022|  19.1k|                *len = 4;
 1023|  19.1k|            }
 1024|  14.6M|        }
 1025|       |
 1026|  21.2M|        return(val);
 1027|  21.7M|    }
 1028|       |
 1029|  15.7M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  15.7M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  15.7M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 14.4k, False: 15.7M]
  ------------------
 1032|  14.4k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  14.4k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  14.4k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  14.4k|    }
 1035|  15.7M|    *len = 1;
 1036|  15.7M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  15.7M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  1.85k|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.85k|    *len = 0;
 1046|  1.85k|    return(0);
 1047|  67.3M|}
xmlCopyCharMultiByte:
 1086|  29.1M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  29.1M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 29.1M]
  |  Branch (1087:26): [True: 0, False: 29.1M]
  ------------------
 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|  29.1M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 29.1M, False: 22.9k]
  ------------------
 1098|  29.1M|	xmlChar *savedout = out;
 1099|  29.1M|	int bits;
 1100|  29.1M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 5.12M, False: 24.0M]
  ------------------
 1101|  24.0M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 24.0M, False: 18.6k]
  ------------------
 1102|  18.6k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 18.6k, 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|  82.3M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 53.2M, False: 29.1M]
  ------------------
 1110|  53.2M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  29.1M|	return (out - savedout);
 1112|  29.1M|    }
 1113|  22.9k|    *out = val;
 1114|  22.9k|    return 1;
 1115|  29.1M|}
xmlSwitchEncoding:
 1263|  6.36k|{
 1264|  6.36k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  6.36k|    int ret;
 1266|  6.36k|    xmlParserErrors code;
 1267|       |
 1268|  6.36k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 6.36k]
  |  Branch (1268:27): [True: 0, False: 6.36k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  6.36k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  6.36k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 4, False: 6.36k]
  ------------------
 1273|      4|        xmlFatalErr(ctxt, code, NULL);
 1274|      4|        return(-1);
 1275|      4|    }
 1276|       |
 1277|  6.36k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  6.36k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.68k, False: 1.67k]
  |  Branch (1279:23): [True: 0, False: 4.68k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  6.36k|    return(ret);
 1284|  6.36k|}
xmlInputSetEncodingHandler:
 1353|  15.1k|                           xmlCharEncodingHandler *handler) {
 1354|  15.1k|    xmlParserInputBufferPtr in;
 1355|  15.1k|    xmlBufPtr buf;
 1356|  15.1k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  15.1k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 15.1k]
  |  Branch (1358:28): [True: 0, False: 15.1k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  15.1k|    in = input->buf;
 1363|       |
 1364|  15.1k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  15.1k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  15.1k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 14.7k, False: 366]
  ------------------
 1370|  14.7k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.7k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  14.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 14.7k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  15.1k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 366, False: 14.7k]
  ------------------
 1376|    366|        return(XML_ERR_OK);
 1377|       |
 1378|  14.7k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 14.7k]
  ------------------
 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.7k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  14.7k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  14.7k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 25, False: 14.7k]
  ------------------
 1395|     25|        xmlCharEncCloseFunc(handler);
 1396|     25|        return(XML_ERR_NO_MEMORY);
 1397|     25|    }
 1398|       |
 1399|  14.7k|    in->encoder = handler;
 1400|  14.7k|    in->raw = in->buffer;
 1401|  14.7k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  14.7k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 14.7k, False: 0]
  ------------------
 1407|  14.7k|        size_t processed;
 1408|  14.7k|        size_t nbchars;
 1409|  14.7k|        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.7k|        processed = input->cur - input->base;
 1416|  14.7k|        xmlBufShrink(in->raw, processed);
 1417|  14.7k|        input->consumed += processed;
 1418|  14.7k|        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.7k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  14.7k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.32k, False: 13.4k]
  ------------------
 1427|  1.32k|            nbchars = SIZE_MAX;
 1428|  13.4k|        else
 1429|  13.4k|            nbchars = 4000 /* MINLEN */;
 1430|  14.7k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  14.7k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.66k, False: 12.0k]
  ------------------
 1432|  2.66k|            code = in->error;
 1433|  14.7k|    }
 1434|       |
 1435|  14.7k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  14.7k|    return(code);
 1438|  14.7k|}
xmlSwitchToEncoding:
 1475|  10.7k|{
 1476|  10.7k|    xmlParserErrors code;
 1477|       |
 1478|  10.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 10.7k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  10.7k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  10.7k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.84k, False: 8.89k]
  ------------------
 1483|  1.84k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.84k|        return(-1);
 1485|  1.84k|    }
 1486|       |
 1487|  8.89k|    return(0);
 1488|  10.7k|}
xmlDetectEncoding:
 1498|   330k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   330k|    const xmlChar *in;
 1500|   330k|    xmlCharEncoding enc;
 1501|   330k|    int bomSize;
 1502|   330k|    int autoFlag = 0;
 1503|       |
 1504|   330k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 330k]
  ------------------
 1505|      0|        return;
 1506|   330k|    in = ctxt->input->cur;
 1507|   330k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.51k, False: 329k]
  ------------------
 1508|  1.51k|        return;
 1509|       |
 1510|   329k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   329k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 329k]
  ------------------
 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|   329k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   329k|    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|   329k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 303k, False: 25.9k]
  ------------------
 1532|  1.79k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 1.79k, False: 327k]
  ------------------
 1533|  1.79k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 1.79k, False: 0]
  ------------------
 1534|  1.79k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 558, False: 1.23k]
  |  Branch (1534:36): [True: 348, False: 210]
  |  Branch (1534:55): [True: 116, False: 232]
  ------------------
 1535|    116|                enc = XML_CHAR_ENCODING_UCS4BE;
 1536|    116|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    116|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1537|  1.67k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 1.20k, False: 475]
  |  Branch (1537:43): [True: 996, False: 208]
  |  Branch (1537:62): [True: 787, False: 209]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    787|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    787|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    787|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    787|            }
 1545|  1.79k|            break;
 1546|       |
 1547|   293k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 293k, False: 35.3k]
  ------------------
 1548|   293k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.39k, False: 289k]
  ------------------
 1549|  4.39k|                if ((!ctxt->html) &&
  ------------------
  |  Branch (1549:21): [True: 4.39k, False: 0]
  ------------------
 1550|  4.39k|                    (in[2] == 0x00) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1550:21): [True: 1.10k, False: 3.29k]
  |  Branch (1550:40): [True: 875, False: 227]
  ------------------
 1551|    875|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|    875|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    875|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.51k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 3.08k, False: 434]
  |  Branch (1553:47): [True: 2.85k, False: 226]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  2.85k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  2.85k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  2.85k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  2.85k|                }
 1561|  4.39k|            }
 1562|   293k|            break;
 1563|       |
 1564|  5.19k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 5.19k, False: 324k]
  ------------------
 1565|  5.19k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 5.19k, False: 0]
  ------------------
 1566|  5.19k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 4.96k, False: 231]
  |  Branch (1566:36): [True: 4.73k, False: 232]
  |  Branch (1566:55): [True: 4.49k, False: 246]
  ------------------
 1567|  4.49k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  4.49k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  4.49k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  4.49k|            }
 1570|  5.19k|            break;
 1571|       |
 1572|    217|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 217, False: 329k]
  ------------------
 1573|    217|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 111, False: 106]
  |  Branch (1573:36): [True: 25, False: 86]
  ------------------
 1574|     25|                enc = XML_CHAR_ENCODING_UTF8;
 1575|     25|                autoFlag = XML_INPUT_AUTO_UTF8;
  ------------------
  |  |   35|     25|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
 1576|     25|                bomSize = 3;
 1577|     25|            }
 1578|    217|            break;
 1579|       |
 1580|  1.62k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 1.62k, False: 327k]
  ------------------
 1581|  1.62k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 1.41k, False: 214]
  ------------------
 1582|  1.41k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  1.41k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  1.41k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  1.41k|                bomSize = 2;
 1585|  1.41k|            }
 1586|  1.62k|            break;
 1587|       |
 1588|    536|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 536, False: 328k]
  ------------------
 1589|    536|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 288, False: 248]
  ------------------
 1590|    288|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    288|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    288|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    288|                bomSize = 2;
 1593|    288|            }
 1594|    536|            break;
 1595|   329k|    }
 1596|       |
 1597|   329k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 1.72k, False: 327k]
  ------------------
 1598|  1.72k|        ctxt->input->cur += bomSize;
 1599|  1.72k|    }
 1600|       |
 1601|   329k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 10.8k, False: 318k]
  ------------------
 1602|  10.8k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  10.8k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 4.49k, False: 6.36k]
  ------------------
 1605|  4.49k|            xmlCharEncodingHandlerPtr handler;
 1606|  4.49k|            xmlParserErrors res;
 1607|       |
 1608|  4.49k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  4.49k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 114, False: 4.37k]
  ------------------
 1610|    114|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  4.37k|            } else {
 1612|  4.37k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  4.37k|            }
 1614|  6.36k|        } else {
 1615|  6.36k|            xmlSwitchEncoding(ctxt, enc);
 1616|  6.36k|        }
 1617|  10.8k|    }
 1618|   329k|}
xmlSetDeclaredEncoding:
 1632|  6.06k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  6.06k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  6.06k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 6.05k, False: 8]
  ------------------
 1634|  6.05k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 5.04k, False: 1.01k]
  ------------------
 1635|  5.04k|        xmlCharEncodingHandlerPtr handler;
 1636|  5.04k|        xmlParserErrors res;
 1637|  5.04k|        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.04k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 5.04k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  5.04k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  5.04k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  5.04k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 657, False: 4.38k]
  ------------------
 1649|    657|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    657|            xmlFree(encoding);
 1651|    657|            return;
 1652|    657|        }
 1653|       |
 1654|  4.38k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  4.38k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 849, False: 3.54k]
  ------------------
 1656|    849|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|    849|            xmlFree(encoding);
 1658|    849|            return;
 1659|    849|        }
 1660|       |
 1661|  3.54k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  3.54k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  3.54k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|  1.02k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 8, False: 1.01k]
  ------------------
 1663|      8|        static const char *allowedUTF8[] = {
 1664|      8|            "UTF-8", "UTF8", NULL
 1665|      8|        };
 1666|      8|        static const char *allowedUTF16LE[] = {
 1667|      8|            "UTF-16", "UTF-16LE", "UTF16", NULL
 1668|      8|        };
 1669|      8|        static const char *allowedUTF16BE[] = {
 1670|      8|            "UTF-16", "UTF-16BE", "UTF16", NULL
 1671|      8|        };
 1672|      8|        const char **allowed = NULL;
 1673|      8|        const char *autoEnc = NULL;
 1674|       |
 1675|      8|        switch (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|      8|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1675:17): [True: 7, False: 1]
  ------------------
 1676|      7|            case XML_INPUT_AUTO_UTF8:
  ------------------
  |  |   35|      7|#define XML_INPUT_AUTO_UTF8         (1u << 1)
  ------------------
  |  Branch (1676:13): [True: 7, False: 1]
  ------------------
 1677|      7|                allowed = allowedUTF8;
 1678|      7|                autoEnc = "UTF-8";
 1679|      7|                break;
 1680|      0|            case XML_INPUT_AUTO_UTF16LE:
  ------------------
  |  |   36|      0|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
  |  Branch (1680:13): [True: 0, False: 8]
  ------------------
 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: 8]
  ------------------
 1685|      0|                allowed = allowedUTF16BE;
 1686|      0|                autoEnc = "UTF-16BE";
 1687|      0|                break;
 1688|      8|        }
 1689|       |
 1690|      8|        if (allowed != NULL) {
  ------------------
  |  Branch (1690:13): [True: 7, False: 1]
  ------------------
 1691|      7|            const char **p;
 1692|      7|            int match = 0;
 1693|       |
 1694|     19|            for (p = allowed; *p != NULL; p++) {
  ------------------
  |  Branch (1694:31): [True: 13, False: 6]
  ------------------
 1695|     13|                if (xmlStrcasecmp(encoding, BAD_CAST *p) == 0) {
  ------------------
  |  |   34|     13|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1695:21): [True: 1, False: 12]
  ------------------
 1696|      1|                    match = 1;
 1697|      1|                    break;
 1698|      1|                }
 1699|     13|            }
 1700|       |
 1701|      7|            if (match == 0) {
  ------------------
  |  Branch (1701:17): [True: 6, False: 1]
  ------------------
 1702|      6|                xmlWarningMsg(ctxt, XML_WAR_ENCODING_MISMATCH,
 1703|      6|                              "Encoding '%s' doesn't match "
 1704|      6|                              "auto-detected '%s'\n",
 1705|      6|                              encoding, BAD_CAST autoEnc);
  ------------------
  |  |   34|      6|#define BAD_CAST (xmlChar *)
  ------------------
 1706|      6|                xmlFree(encoding);
 1707|      6|                encoding = xmlStrdup(BAD_CAST autoEnc);
  ------------------
  |  |   34|      6|#define BAD_CAST (xmlChar *)
  ------------------
 1708|      6|                if (encoding == NULL)
  ------------------
  |  Branch (1708:21): [True: 4, False: 2]
  ------------------
 1709|      4|                    xmlCtxtErrMemory(ctxt);
 1710|      6|            }
 1711|      7|        }
 1712|      8|    }
 1713|       |
 1714|  4.56k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.58k, False: 2.97k]
  ------------------
 1715|  1.58k|        xmlFree(ctxt->encoding);
 1716|  4.56k|    ctxt->encoding = encoding;
 1717|  4.56k|}
xmlGetActualEncoding:
 1740|  30.4k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  30.4k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  30.4k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  30.4k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 718, False: 29.7k]
  ------------------
 1744|  29.7k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  29.7k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 506, False: 29.2k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.22k|        encoding = ctxt->encoding;
 1747|  29.2k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 29.2k, False: 0]
  |  Branch (1747:38): [True: 202, False: 29.0k]
  ------------------
 1748|    202|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    202|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  29.0k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  29.0k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 234, False: 28.8k]
  ------------------
 1750|    234|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    234|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    234|    }
 1752|       |
 1753|  30.4k|    return(encoding);
 1754|  30.4k|}
xmlFreeInputStream:
 1768|   346k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   346k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 3.28k, False: 343k]
  ------------------
 1770|       |
 1771|   343k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 290k, False: 52.5k]
  ------------------
 1772|   343k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 204k, False: 138k]
  ------------------
 1773|   343k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 343k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   343k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 343k, False: 0]
  ------------------
 1776|   343k|        xmlFreeParserInputBuffer(input->buf);
 1777|   343k|    xmlFree(input);
 1778|   343k|}
xmlNewInputFromMemory:
 1892|   290k|                      xmlParserInputFlags flags) {
 1893|   290k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   290k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 290k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   290k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   290k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 24, False: 290k]
  ------------------
 1900|     24|        return(NULL);
 1901|       |
 1902|   290k|    return(xmlNewInputInternal(buf, url));
 1903|   290k|}
xmlNewInputFromString:
 1954|  11.6k|                      xmlParserInputFlags flags) {
 1955|  11.6k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  11.6k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 11.6k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  11.6k|    buf = xmlNewInputBufferString(str, flags);
 1961|  11.6k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 6, False: 11.6k]
  ------------------
 1962|      6|        return(NULL);
 1963|       |
 1964|  11.6k|    return(xmlNewInputInternal(buf, url));
 1965|  11.6k|}
xmlCtxtNewInputFromString:
 1978|  11.6k|                          xmlParserInputFlags flags) {
 1979|  11.6k|    xmlParserInputPtr input;
 1980|       |
 1981|  11.6k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 11.6k]
  |  Branch (1981:27): [True: 0, False: 11.6k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  11.6k|    input = xmlNewInputFromString(url, str, flags);
 1985|  11.6k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 8, False: 11.6k]
  ------------------
 1986|      8|        xmlCtxtErrMemory(ctxt);
 1987|      8|        return(NULL);
 1988|      8|    }
 1989|       |
 1990|  11.6k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 11.6k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  11.6k|    return(input);
 1994|  11.6k|}
xmlNewPushInput:
 2155|  40.8k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  40.8k|    xmlParserInputBufferPtr buf;
 2157|  40.8k|    xmlParserInputPtr input;
 2158|       |
 2159|  40.8k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  40.8k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 7, False: 40.8k]
  ------------------
 2161|      7|        return(NULL);
 2162|       |
 2163|  40.8k|    input = xmlNewInputInternal(buf, url);
 2164|  40.8k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 3, False: 40.8k]
  ------------------
 2165|      3|	return(NULL);
 2166|       |
 2167|  40.8k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  40.8k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  40.8k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 39.7k, False: 1.08k]
  |  Branch (2169:23): [True: 39.7k, False: 0]
  ------------------
 2170|  39.7k|        int res;
 2171|       |
 2172|  39.7k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  39.7k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  39.7k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 39.7k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  39.7k|    }
 2179|       |
 2180|  40.8k|    return(input);
 2181|  40.8k|}
xmlNewEntityInputStream:
 2224|   134k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   134k|    xmlParserInputPtr input;
 2226|       |
 2227|   134k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 134k]
  |  Branch (2227:27): [True: 0, False: 134k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   134k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 11.6k, False: 122k]
  ------------------
 2231|  11.6k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  11.6k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|   122k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 122k, False: 528]
  ------------------
 2234|   122k|        xmlResourceType rtype;
 2235|       |
 2236|   122k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 118k, False: 3.75k]
  ------------------
 2237|   118k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  3.75k|        else
 2239|  3.75k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|   122k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|   122k|                                (char *) ent->ExternalID, rtype);
 2243|   122k|    } else {
 2244|    528|        return(NULL);
 2245|    528|    }
 2246|       |
 2247|   133k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 4.57k, False: 129k]
  ------------------
 2248|  4.57k|        return(NULL);
 2249|       |
 2250|   129k|    input->entity = ent;
 2251|       |
 2252|   129k|    return(input);
 2253|   133k|}
xmlCtxtSetResourceLoader:
 2645|  50.6k|                         void *vctxt) {
 2646|  50.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 50.6k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  50.6k|    ctxt->resourceLoader = loader;
 2650|  50.6k|    ctxt->resourceCtxt = vctxt;
 2651|  50.6k|}
xmlLoadResource:
 2662|   297k|                xmlResourceType type) {
 2663|   297k|    char *canonicFilename;
 2664|   297k|    xmlParserInputPtr ret;
 2665|       |
 2666|   297k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 231, False: 297k]
  ------------------
 2667|    231|        return(NULL);
 2668|       |
 2669|   297k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 297k, False: 0]
  |  Branch (2669:27): [True: 297k, False: 0]
  ------------------
 2670|   297k|        char *resource = NULL;
 2671|   297k|        void *userData;
 2672|   297k|        xmlParserInputFlags flags = 0;
 2673|   297k|        int code;
 2674|       |
 2675|   297k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   297k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   297k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 297k]
  ------------------
 2678|      0|            url = resource;
 2679|   297k|#endif
 2680|       |
 2681|   297k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 158k, False: 138k]
  ------------------
 2682|   158k|            flags |= XML_INPUT_UNZIP;
 2683|   297k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 217k, False: 79.4k]
  ------------------
 2684|   217k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   297k|        userData = ctxt->resourceCtxt;
 2687|   297k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 297k, False: 0]
  ------------------
 2688|   297k|            userData = ctxt;
 2689|       |
 2690|   297k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   297k|                                    flags, &ret);
 2692|   297k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 6.64k, False: 290k]
  ------------------
 2693|  6.64k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  6.64k|            ret = NULL;
 2695|  6.64k|        }
 2696|   297k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 297k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   297k|        return(ret);
 2699|   297k|    }
 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|  50.7k|{
 2948|  50.7k|    xmlParserInputPtr input;
 2949|       |
 2950|  50.7k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 39, False: 50.6k]
  ------------------
 2951|       |
 2952|   100k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 50.3k, False: 50.6k]
  ------------------
 2953|  50.3k|        xmlFreeInputStream(input);
 2954|  50.3k|    }
 2955|  50.6k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 50.6k, False: 30]
  ------------------
 2956|  50.6k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 50.6k, False: 27]
  ------------------
 2957|  50.6k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 50.6k, False: 20]
  ------------------
 2958|  50.6k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 50.6k]
  ------------------
 2959|  50.6k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 50.6k, False: 17]
  ------------------
 2960|  50.6k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 48.0k, False: 2.57k]
  ------------------
 2961|  50.6k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 1.05k, False: 49.6k]
  ------------------
 2962|  50.6k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 3.17k, False: 47.4k]
  ------------------
 2963|  50.6k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 791, False: 49.8k]
  ------------------
 2964|  50.6k|#ifdef LIBXML_SAX1_ENABLED
 2965|  50.6k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 50.6k, False: 11]
  ------------------
 2966|  50.6k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 50.6k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  50.6k|        xmlFree(ctxt->sax);
 2971|  50.6k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 10.8k, False: 39.8k]
  ------------------
 2972|  50.6k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 50.6k]
  ------------------
 2973|  50.6k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 26.2k, False: 24.3k]
  ------------------
 2974|  50.6k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 50.6k, False: 5]
  ------------------
 2975|  50.6k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 9.98k, False: 40.6k]
  ------------------
 2976|  50.6k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 50.6k, False: 34]
  ------------------
 2977|  50.6k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 7.11k, False: 43.5k]
  ------------------
 2978|  50.6k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 30.8k, False: 19.8k]
  ------------------
 2979|  50.6k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 13.8k, False: 36.8k]
  ------------------
 2980|  50.6k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 2.97k, False: 47.6k]
  ------------------
 2981|  2.97k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  50.6k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 3.48k, False: 47.1k]
  ------------------
 2983|  3.48k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  50.6k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 27.0k, False: 23.6k]
  ------------------
 2985|  27.0k|        xmlNodePtr cur, next;
 2986|       |
 2987|  27.0k|	cur = ctxt->freeElems;
 2988|  54.0k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 27.0k, False: 27.0k]
  ------------------
 2989|  27.0k|	    next = cur->next;
 2990|  27.0k|	    xmlFree(cur);
 2991|  27.0k|	    cur = next;
 2992|  27.0k|	}
 2993|  27.0k|    }
 2994|  50.6k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 15.3k, False: 35.2k]
  ------------------
 2995|  15.3k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  15.3k|	cur = ctxt->freeAttrs;
 2998|  30.7k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 15.3k, False: 15.3k]
  ------------------
 2999|  15.3k|	    next = cur->next;
 3000|  15.3k|	    xmlFree(cur);
 3001|  15.3k|	    cur = next;
 3002|  15.3k|	}
 3003|  15.3k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  50.6k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 35.3k, False: 15.2k]
  ------------------
 3008|  35.3k|        xmlFree(ctxt->lastError.message);
 3009|  50.6k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 9.24k, False: 41.4k]
  ------------------
 3010|  9.24k|        xmlFree(ctxt->lastError.file);
 3011|  50.6k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 20.0k, False: 30.6k]
  ------------------
 3012|  20.0k|        xmlFree(ctxt->lastError.str1);
 3013|  50.6k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 6.32k, False: 44.3k]
  ------------------
 3014|  6.32k|        xmlFree(ctxt->lastError.str2);
 3015|  50.6k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 613, False: 50.0k]
  ------------------
 3016|    613|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  50.6k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  50.6k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 50.6k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  50.6k|#endif
 3022|  50.6k|    xmlFree(ctxt);
 3023|  50.6k|}
xmlNewParserCtxt:
 3033|  9.80k|{
 3034|  9.80k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  9.80k|}
xmlNewSAXParserCtxt:
 3054|  50.6k|{
 3055|  50.6k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  50.6k|    xmlInitParser();
 3058|       |
 3059|  50.6k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  50.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 8, False: 50.6k]
  ------------------
 3061|      8|	return(NULL);
 3062|  50.6k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  50.6k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 34, False: 50.6k]
  ------------------
 3064|     34|        xmlFreeParserCtxt(ctxt);
 3065|     34|	return(NULL);
 3066|     34|    }
 3067|  50.6k|    return(ctxt);
 3068|  50.6k|}
xmlInitNodeInfoSeq:
 3540|  50.6k|{
 3541|  50.6k|    if (seq == NULL)
  ------------------
  |  Branch (3541:9): [True: 0, False: 50.6k]
  ------------------
 3542|      0|        return;
 3543|  50.6k|    seq->length = 0;
 3544|  50.6k|    seq->maximum = 0;
 3545|       |    seq->buffer = NULL;
 3546|  50.6k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  4.49k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  4.49k|    xmlChar out[200];
 1170|  4.49k|    xmlParserInputPtr input = ctxt->input;
 1171|  4.49k|    xmlCharEncodingHandlerPtr handler;
 1172|  4.49k|    int inlen, outlen, i;
 1173|  4.49k|    xmlParserErrors code;
 1174|  4.49k|    xmlCharEncError res;
 1175|       |
 1176|  4.49k|    *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.49k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  4.49k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  4.49k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 6, False: 4.48k]
  ------------------
 1185|      6|        return(code);
 1186|  4.48k|    outlen = sizeof(out) - 1;
 1187|  4.48k|    inlen = input->end - input->cur;
 1188|  4.48k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  4.48k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  4.48k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 885, False: 3.59k]
  ------------------
 1195|    885|        goto done;
 1196|  3.59k|    out[outlen] = 0;
 1197|       |
 1198|   106k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 104k, False: 1.60k]
  ------------------
 1199|   104k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 396, False: 104k]
  ------------------
 1200|    396|            break;
 1201|   104k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 4.22k, False: 100k]
  ------------------
 1202|  4.22k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  4.22k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.60k, False: 2.62k]
  ------------------
 1203|  1.60k|            int start, cur, quote;
 1204|       |
 1205|  1.60k|            i += 8;
 1206|  1.60k|            while (IS_BLANK_CH(out[i]))
 1207|    830|                i += 1;
 1208|  1.60k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 374, False: 1.22k]
  ------------------
 1209|    374|                break;
 1210|  1.22k|            while (IS_BLANK_CH(out[i]))
 1211|    797|                i += 1;
 1212|  1.22k|            quote = out[i++];
 1213|  1.22k|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 983, False: 245]
  |  Branch (1213:36): [True: 442, False: 541]
  ------------------
 1214|    442|                break;
 1215|    786|            start = i;
 1216|    786|            cur = out[i];
 1217|  4.49k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 1.13k, False: 3.36k]
  |  Branch (1217:37): [True: 847, False: 289]
  ------------------
 1218|  3.65k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.20k, False: 1.44k]
  |  Branch (1218:37): [True: 995, False: 1.20k]
  ------------------
 1219|  2.65k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.59k, False: 1.05k]
  |  Branch (1219:37): [True: 380, False: 1.21k]
  ------------------
 1220|  2.27k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 300, False: 1.97k]
  |  Branch (1220:36): [True: 919, False: 1.05k]
  ------------------
 1221|  1.05k|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 270, False: 786]
  ------------------
 1222|  3.71k|                cur = out[++i];
 1223|    786|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 529, False: 257]
  ------------------
 1224|    529|                break;
 1225|    257|            out[i] = 0;
 1226|    257|            xmlCharEncCloseFunc(handler);
 1227|    257|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    257|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    257|                    &handler);
 1230|    257|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 100, False: 157]
  ------------------
 1231|    100|                return(code);
 1232|    157|            *hout = handler;
 1233|    157|            return(XML_ERR_OK);
 1234|    257|        }
 1235|   104k|    }
 1236|       |
 1237|  4.22k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  4.22k|    xmlCharEncCloseFunc(handler);
 1242|  4.22k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  4.22k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  4.22k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 8, False: 4.21k]
  ------------------
 1245|      8|        return(code);
 1246|  4.21k|    *hout = handler;
 1247|  4.21k|    return(XML_ERR_OK);
 1248|  4.22k|}
parserInternals.c:xmlNewInputInternal:
 1842|   343k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   343k|    xmlParserInputPtr input;
 1844|       |
 1845|   343k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   343k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 16, False: 343k]
  ------------------
 1847|     16|	xmlFreeParserInputBuffer(buf);
 1848|     16|	return(NULL);
 1849|     16|    }
 1850|   343k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   343k|    input->line = 1;
 1852|   343k|    input->col = 1;
 1853|       |
 1854|   343k|    input->buf = buf;
 1855|   343k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   343k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 290k, False: 52.5k]
  ------------------
 1858|   290k|        input->filename = xmlMemStrdup(filename);
 1859|   290k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 13, False: 290k]
  ------------------
 1860|     13|            xmlFreeInputStream(input);
 1861|     13|            return(NULL);
 1862|     13|        }
 1863|   290k|    }
 1864|       |
 1865|   343k|    return(input);
 1866|   343k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   297k|                          const char *publicId) {
 2364|   297k|    char *resource;
 2365|   297k|    void *localCatalogs = NULL;
 2366|   297k|    int allowGlobal = 1;
 2367|   297k|    xmlParserErrors code;
 2368|       |
 2369|   297k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 297k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   297k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 297k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   297k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   297k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 45.7k, False: 251k]
  ------------------
 2379|  45.7k|            allowGlobal = 0;
 2380|   297k|    }
 2381|       |
 2382|   297k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 297k, False: 0]
  ------------------
 2383|   297k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 297k, False: 0]
  ------------------
 2384|   297k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 297k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 297k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 297k]
  ------------------
 2392|      0|            break;
 2393|   297k|    }
 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|   297k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  50.6k|{
 2767|  50.6k|    xmlParserInputPtr input;
 2768|  50.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  50.6k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  50.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 50.6k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  50.6k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 50.6k, False: 0]
  ------------------
 2778|  50.6k|	ctxt->dict = xmlDictCreate();
 2779|  50.6k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 5, False: 50.6k]
  ------------------
 2780|      5|	return(-1);
 2781|       |
 2782|  50.6k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 50.6k, False: 0]
  ------------------
 2783|  50.6k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  50.6k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 6, False: 50.6k]
  ------------------
 2785|      6|	return(-1);
 2786|  50.6k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 9.79k, False: 40.8k]
  ------------------
 2787|  9.79k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  9.79k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  9.79k|        ctxt->userData = ctxt;
 2790|  40.8k|    } else {
 2791|  40.8k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  40.8k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 40.8k, False: 0]
  ------------------
 2792|  40.8k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  40.8k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  40.8k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 40.8k]
  ------------------
 2798|  40.8k|    }
 2799|       |
 2800|  50.6k|    ctxt->maxatts = 0;
 2801|  50.6k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  50.6k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 50.6k, False: 0]
  ------------------
 2804|  50.6k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  50.6k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  50.6k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  50.6k|	ctxt->inputMax = initialSize;
 2812|  50.6k|    }
 2813|  50.6k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 6, False: 50.6k]
  ------------------
 2814|      6|	return(-1);
 2815|  50.6k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 50.6k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  50.6k|    ctxt->inputNr = 0;
 2819|  50.6k|    ctxt->input = NULL;
 2820|       |
 2821|  50.6k|    ctxt->version = NULL;
 2822|  50.6k|    ctxt->encoding = NULL;
 2823|  50.6k|    ctxt->standalone = -1;
 2824|  50.6k|    ctxt->hasExternalSubset = 0;
 2825|  50.6k|    ctxt->hasPErefs = 0;
 2826|  50.6k|    ctxt->html = 0;
 2827|  50.6k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  50.6k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 50.6k, False: 0]
  ------------------
 2831|  50.6k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  50.6k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  50.6k|    }
 2834|  50.6k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 3, False: 50.6k]
  ------------------
 2835|      3|	return(-1);
 2836|  50.6k|    ctxt->nodeNr = 0;
 2837|  50.6k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  50.6k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 50.6k, False: 0]
  ------------------
 2841|  50.6k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  50.6k|	ctxt->nameMax = initialNodeTabSize;
 2843|  50.6k|    }
 2844|  50.6k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 7, False: 50.6k]
  ------------------
 2845|      7|	return(-1);
 2846|  50.6k|    ctxt->nameNr = 0;
 2847|  50.6k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  50.6k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 50.6k, False: 0]
  ------------------
 2851|  50.6k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  50.6k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  50.6k|    }
 2854|  50.6k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 3, False: 50.6k]
  ------------------
 2855|      3|	return(-1);
 2856|  50.6k|    ctxt->spaceNr = 1;
 2857|  50.6k|    ctxt->spaceTab[0] = -1;
 2858|  50.6k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  50.6k|    ctxt->myDoc = NULL;
 2860|  50.6k|    ctxt->wellFormed = 1;
 2861|  50.6k|    ctxt->nsWellFormed = 1;
 2862|  50.6k|    ctxt->valid = 1;
 2863|       |
 2864|  50.6k|    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|  50.6k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  50.6k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  50.6k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 50.6k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  50.6k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  50.6k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  50.6k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 50.6k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  50.6k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  50.6k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  50.6k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 50.6k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  50.6k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  50.6k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  50.6k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 50.6k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  50.6k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  50.6k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  50.6k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 50.6k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  50.6k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  50.6k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 50.6k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  50.6k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  50.6k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  50.6k|    ctxt->vctxt.userData = ctxt;
 2898|  50.6k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  50.6k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  50.6k|    ctxt->record_info = 0;
 2902|  50.6k|    ctxt->checkIndex = 0;
 2903|  50.6k|    ctxt->inSubset = 0;
 2904|  50.6k|    ctxt->errNo = XML_ERR_OK;
 2905|  50.6k|    ctxt->depth = 0;
 2906|  50.6k|    ctxt->catalogs = NULL;
 2907|  50.6k|    ctxt->sizeentities = 0;
 2908|  50.6k|    ctxt->sizeentcopy = 0;
 2909|  50.6k|    ctxt->input_id = 1;
 2910|  50.6k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  50.6k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  50.6k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  50.6k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 50.6k, False: 0]
  ------------------
 2914|  50.6k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  50.6k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 4, False: 50.6k]
  ------------------
 2916|      4|            return(-1);
 2917|  50.6k|    }
 2918|       |
 2919|  50.6k|    return(0);
 2920|  50.6k|}

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|   157k|{
  125|   157k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 157k]
  ------------------
  126|      0|        return;
  127|   157k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   157k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   157k|}
xmlMutexUnlock:
  146|   157k|{
  147|   157k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 157k]
  ------------------
  148|      0|        return;
  149|   157k|#ifdef HAVE_POSIX_THREADS
  150|   157k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   157k|}
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.67M|xmlInitParser(void) {
  405|  2.67M|#ifdef HAVE_POSIX_THREADS
  406|  2.67M|    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.67M|}
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|  20.3k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  20.3k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 20.3k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  20.3k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  20.3k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  20.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  20.3k|}
libxml_domnode_tim_sort:
  533|  30.3k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  30.3k|  size_t minrun;
  535|  30.3k|  TEMP_STORAGE_T _store, *store;
  536|  30.3k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  30.3k|  size_t stack_curr = 0;
  538|  30.3k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  30.3k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 30.3k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  30.3k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 20.3k, False: 10.0k]
  ------------------
  546|  20.3k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  20.3k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  20.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  20.3k|    return;
  548|  20.3k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  10.0k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  10.0k|  store = &_store;
  554|  10.0k|  store->alloc = 0;
  555|  10.0k|  store->storage = NULL;
  556|       |
  557|  10.0k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 10.0k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  10.0k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 7.48k, False: 2.55k]
  ------------------
  562|  7.48k|    return;
  563|  7.48k|  }
  564|       |
  565|  2.55k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 2.08k, False: 469]
  ------------------
  566|  2.08k|    return;
  567|  2.08k|  }
  568|       |
  569|  4.58k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 4.58k, Folded]
  ------------------
  570|  4.58k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  4.58k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  4.58k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  4.58k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  4.58k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 1.78k, False: 2.79k]
  ------------------
  571|  1.78k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  1.78k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  1.78k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.78k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.78k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  1.78k|      continue;
  573|  1.78k|    }
  574|       |
  575|  2.79k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 469, False: 2.32k]
  ------------------
  576|    469|      return;
  577|    469|    }
  578|  2.79k|  }
  579|    469|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  25.9k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  25.9k|  size_t i;
  221|       |
  222|   371k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 345k, False: 25.9k]
  ------------------
  223|   345k|    size_t j;
  224|   345k|    SORT_TYPE x;
  ------------------
  |  |  593|   345k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   345k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   345k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   345k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 220k, False: 124k]
  ------------------
  229|   220k|      continue;
  230|   220k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   124k|    x = dst[i];
  234|   124k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   124k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   124k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   124k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   124k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   593k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 473k, False: 119k]
  ------------------
  237|   473k|      dst[j + 1] = dst[j];
  238|       |
  239|   473k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 4.78k, False: 468k]
  ------------------
  240|  4.78k|        break;
  241|  4.78k|      }
  242|   473k|    }
  243|       |
  244|   124k|    dst[location] = x;
  245|   124k|  }
  246|  25.9k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   124k|    const size_t size) {
  181|   124k|  size_t l, c, r;
  182|   124k|  SORT_TYPE cx;
  ------------------
  |  |  593|   124k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   124k|  l = 0;
  184|   124k|  r = size - 1;
  185|   124k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   124k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   124k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 4.78k, False: 119k]
  ------------------
  189|  4.78k|    return 0;
  190|   119k|  } else if (SORT_CMP(x, dst[r]) > 0) {
  ------------------
  |  |  617|   119k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (190:14): [True: 0, False: 119k]
  ------------------
  191|      0|    return r;
  192|      0|  }
  193|       |
  194|   119k|  cx = dst[c];
  195|       |
  196|   499k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 499k, Folded]
  ------------------
  197|   499k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   499k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   499k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 89.7k, False: 409k]
  ------------------
  200|  89.7k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 41.1k, False: 48.5k]
  ------------------
  201|  41.1k|        return c;
  202|  41.1k|      }
  203|       |
  204|  48.5k|      r = c;
  205|   409k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   409k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 78.5k, False: 331k]
  ------------------
  207|  78.5k|        return c + 1;
  208|  78.5k|      }
  209|       |
  210|   331k|      l = c;
  211|   331k|    }
  212|       |
  213|   379k|    c = l + ((r - l) >> 1);
  214|   379k|    cx = dst[c];
  215|   379k|  }
  216|   119k|}
xpath.c:compute_minrun:
  129|  10.0k|static __inline int compute_minrun(const uint64_t size) {
  130|  10.0k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  10.0k|#define CLZ __builtin_clzll
  ------------------
  131|  10.0k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  10.0k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
  132|  10.0k|  const int minrun = size >> shift;
  133|  10.0k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  10.0k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 5.90k, False: 4.14k]
  ------------------
  136|  5.90k|    return minrun + 1;
  137|  5.90k|  }
  138|       |
  139|  4.14k|  return minrun;
  140|  10.0k|}
xpath.c:PUSH_NEXT:
  496|  25.4k|                              size_t *curr) {
  497|  25.4k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  25.4k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  25.4k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  25.4k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  25.4k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  25.4k|  size_t run = minrun;
  499|       |
  500|  25.4k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 9.82k, False: 15.6k]
  ------------------
  501|  9.82k|    run = size - *curr;
  502|  9.82k|  }
  503|       |
  504|  25.4k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 5.66k, False: 19.7k]
  ------------------
  505|  5.66k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  5.66k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  5.66k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  5.66k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  5.66k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  5.66k|    len = run;
  507|  5.66k|  }
  508|       |
  509|  25.4k|  run_stack[*stack_curr].start = *curr;
  510|  25.4k|  run_stack[*stack_curr].length = len;
  511|  25.4k|  (*stack_curr)++;
  512|  25.4k|  *curr += len;
  513|       |
  514|  25.4k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 10.0k, False: 15.3k]
  ------------------
  515|       |    /* finish up */
  516|  22.4k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 12.3k, False: 10.0k]
  ------------------
  517|  12.3k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  12.3k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  12.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  12.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  12.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  12.3k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  12.3k|      (*stack_curr)--;
  520|  12.3k|    }
  521|       |
  522|  10.0k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 10.0k, False: 0]
  ------------------
  523|  10.0k|      free(store->storage);
  524|  10.0k|      store->storage = NULL;
  525|  10.0k|    }
  526|       |
  527|  10.0k|    return 0;
  528|  10.0k|  }
  529|       |
  530|  15.3k|  return 1;
  531|  25.4k|}
xpath.c:libxml_domnode_count_run:
  272|  25.4k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  25.4k|  size_t curr;
  274|       |
  275|  25.4k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 8.82k, False: 16.6k]
  ------------------
  276|  8.82k|    return 1;
  277|  8.82k|  }
  278|       |
  279|  16.6k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 145, False: 16.4k]
  ------------------
  280|    145|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|    145|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 68, False: 77]
  ------------------
  281|     68|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     68|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     68|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     68|    }
  283|       |
  284|    145|    return 2;
  285|    145|  }
  286|       |
  287|  16.4k|  curr = start + 2;
  288|       |
  289|  16.4k|  if (SORT_CMP(dst[start], dst[start + 1]) <= 0) {
  ------------------
  |  |  617|  16.4k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (289:7): [True: 15.2k, False: 1.22k]
  ------------------
  290|       |    /* increasing run */
  291|  1.65M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.65M, Folded]
  ------------------
  292|  1.65M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 9.61k, False: 1.64M]
  ------------------
  293|  9.61k|        break;
  294|  9.61k|      }
  295|       |
  296|  1.64M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.64M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 5.63k, False: 1.64M]
  ------------------
  297|  5.63k|        break;
  298|  5.63k|      }
  299|       |
  300|  1.64M|      curr++;
  301|  1.64M|    }
  302|       |
  303|  15.2k|    return curr - start;
  304|  15.2k|  } else {
  305|       |    /* decreasing run */
  306|  3.68k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 3.68k, Folded]
  ------------------
  307|  3.68k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 175, False: 3.50k]
  ------------------
  308|    175|        break;
  309|    175|      }
  310|       |
  311|  3.50k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  3.50k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.05k, False: 2.45k]
  ------------------
  312|  1.05k|        break;
  313|  1.05k|      }
  314|       |
  315|  2.45k|      curr++;
  316|  2.45k|    }
  317|       |
  318|       |    /* reverse in-place */
  319|  1.22k|    REVERSE_ELEMENTS(dst, start, curr - 1);
  ------------------
  |  |  151|  1.22k|#define REVERSE_ELEMENTS               SORT_MAKE_STR(reverse_elements)
  |  |  ------------------
  |  |  |  |  146|  1.22k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.22k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.22k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  320|  1.22k|    return curr - start;
  321|  1.22k|  }
  322|  16.4k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.22k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  3.50k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 3.50k, Folded]
  ------------------
  262|  3.50k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.22k, False: 2.27k]
  ------------------
  263|  1.22k|      return;
  264|  1.22k|    }
  265|       |
  266|  2.27k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  2.27k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  2.27k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  2.27k|    start++;
  268|  2.27k|    end--;
  269|  2.27k|  }
  270|  1.22k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  15.3k|                           TEMP_STORAGE_T *store) {
  375|  15.3k|  const size_t A = stack[stack_curr - 2].length;
  376|  15.3k|  const size_t B = stack[stack_curr - 1].length;
  377|  15.3k|  const size_t curr = stack[stack_curr - 2].start;
  378|  15.3k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  15.3k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  15.3k|  size_t i, j, k;
  380|  15.3k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  15.3k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  15.3k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  15.3k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  15.3k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  15.3k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 3.47k, False: 11.9k]
  |  |  ------------------
  ------------------
  381|  15.3k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  15.3k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 3.47k, False: 11.9k]
  ------------------
  385|  3.47k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  3.47k|    i = 0;
  387|  3.47k|    j = curr + A;
  388|       |
  389|   470k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 470k, False: 437]
  ------------------
  390|   470k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 467k, False: 3.03k]
  |  Branch (390:22): [True: 457k, False: 9.47k]
  ------------------
  391|   457k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   457k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 218k, False: 239k]
  ------------------
  392|   218k|          dst[k] = storage[i++];
  393|   239k|        } else {
  394|   239k|          dst[k] = dst[j++];
  395|   239k|        }
  396|   457k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 9.47k, False: 3.03k]
  ------------------
  397|  9.47k|        dst[k] = storage[i++];
  398|  9.47k|      } else {
  399|  3.03k|        break;
  400|  3.03k|      }
  401|   470k|    }
  402|  11.9k|  } else {
  403|       |    /* right merge */
  404|  11.9k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  11.9k|    i = B;
  406|  11.9k|    j = curr + A;
  407|  11.9k|    k = curr + A + B;
  408|       |
  409|   384k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 384k, False: 664]
  ------------------
  410|   384k|      k--;
  411|   384k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 373k, False: 11.2k]
  |  Branch (411:22): [True: 366k, False: 6.34k]
  ------------------
  412|   366k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   366k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 138k, False: 228k]
  ------------------
  413|   138k|          dst[k] = dst[--j];
  414|   228k|        } else {
  415|   228k|          dst[k] = storage[--i];
  416|   228k|        }
  417|   366k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 6.34k, False: 11.2k]
  ------------------
  418|  6.34k|        dst[k] = storage[--i];
  419|  11.2k|      } else {
  420|  11.2k|        break;
  421|  11.2k|      }
  422|   384k|    }
  423|  11.9k|  }
  424|  15.3k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  15.3k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  15.3k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 12.6k, False: 2.71k]
  ------------------
  360|  12.6k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  12.6k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  12.6k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 12.6k]
  ------------------
  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|  12.6k|    store->storage = tempstore;
  369|  12.6k|    store->alloc = new_size;
  370|  12.6k|  }
  371|  15.3k|}
xpath.c:libxml_domnode_check_invariant:
  324|  4.58k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  4.58k|  size_t A, B, C;
  326|       |
  327|  4.58k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 378, False: 4.20k]
  ------------------
  328|    378|    return 1;
  329|    378|  }
  330|       |
  331|  4.20k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 577, False: 3.62k]
  ------------------
  332|    577|    const size_t A1 = stack[stack_curr - 2].length;
  333|    577|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    577|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 23, False: 554]
  ------------------
  336|     23|      return 0;
  337|     23|    }
  338|       |
  339|    554|    return 1;
  340|    577|  }
  341|       |
  342|  3.62k|  A = stack[stack_curr - 3].length;
  343|  3.62k|  B = stack[stack_curr - 2].length;
  344|  3.62k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  3.62k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.12k, False: 2.49k]
  |  Branch (346:23): [True: 638, False: 1.86k]
  ------------------
  347|  1.76k|    return 0;
  348|  1.76k|  }
  349|       |
  350|  1.86k|  return 1;
  351|  3.62k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  1.78k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  4.43k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 4.43k, Folded]
  ------------------
  429|  4.43k|    size_t A, B, C, D;
  430|  4.43k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  4.43k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 4.43k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  4.43k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 855, False: 3.58k]
  |  Branch (438:30): [True: 0, False: 855]
  ------------------
  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|  4.43k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 855, False: 3.58k]
  |  Branch (445:35): [True: 378, False: 477]
  ------------------
  446|    378|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    378|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    378|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    378|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    378|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    378|      stack[0].length += stack[1].length;
  448|    378|      stack_curr--;
  449|    378|      break;
  450|  4.06k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 477, False: 3.58k]
  ------------------
  451|    477|      break;
  452|    477|    }
  453|       |
  454|  3.58k|    B = stack[stack_curr - 3].length;
  455|  3.58k|    C = stack[stack_curr - 2].length;
  456|  3.58k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  3.58k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 2.34k, False: 1.23k]
  ------------------
  459|  2.34k|      A = stack[stack_curr - 4].length;
  460|  2.34k|      ABC = (A <= B + C);
  461|  2.34k|    } else {
  462|  1.23k|      ABC = 0;
  463|  1.23k|    }
  464|       |
  465|  3.58k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 1.58k, False: 2.00k]
  |  Branch (465:27): [True: 25, False: 1.97k]
  ------------------
  466|  3.58k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  3.58k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 1.97k, False: 1.60k]
  |  Branch (469:17): [True: 933, False: 1.04k]
  ------------------
  470|    933|      break;
  471|    933|    }
  472|       |
  473|       |    /* left merge */
  474|  2.65k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 1.60k, False: 1.04k]
  |  Branch (474:16): [True: 646, False: 961]
  ------------------
  475|    646|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|    646|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    646|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    646|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    646|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|    646|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|    646|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|    646|      stack_curr--;
  479|  2.00k|    } else {
  480|       |      /* right merge */
  481|  2.00k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.00k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.00k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.00k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.00k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.00k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.00k|      stack_curr--;
  484|  2.00k|    }
  485|  2.65k|  }
  486|       |
  487|  1.78k|  return stack_curr;
  488|  1.78k|}

xmlBuildQName:
  170|   436k|	      xmlChar *memory, int len) {
  171|   436k|    size_t lenn, lenp;
  172|   436k|    xmlChar *ret;
  173|       |
  174|   436k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 436k]
  |  Branch (174:29): [True: 0, False: 436k]
  ------------------
  175|   436k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 288k, False: 148k]
  ------------------
  176|       |
  177|   148k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   148k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 77.0k, False: 71.0k]
  ------------------
  180|  77.0k|        len = 8;
  181|   148k|#endif
  182|       |
  183|   148k|    lenn = strlen((char *) ncname);
  184|   148k|    lenp = strlen((char *) prefix);
  185|   148k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 148k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   148k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 71.0k, False: 77.0k]
  |  Branch (188:29): [True: 42.1k, False: 34.9k]
  ------------------
  189|   113k|	ret = xmlMalloc(lenn + lenp + 2);
  190|   113k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 64, False: 113k]
  ------------------
  191|     64|	    return(NULL);
  192|   113k|    } else {
  193|  34.9k|	ret = memory;
  194|  34.9k|    }
  195|   148k|    memcpy(&ret[0], prefix, lenp);
  196|   148k|    ret[lenp] = ':';
  197|   148k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   148k|    ret[lenn + lenp + 1] = 0;
  199|   148k|    return(ret);
  200|   148k|}
xmlSplitQName3:
  268|   242k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   242k|    int l = 0;
  270|       |
  271|   242k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 242k]
  ------------------
  272|   242k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 242k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   242k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.42k, False: 241k]
  ------------------
  276|  1.42k|	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.10M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 882k, False: 226k]
  |  Branch (282:30): [True: 868k, False: 14.1k]
  ------------------
  283|   868k|	l++;
  284|       |
  285|   241k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 226k, False: 14.1k]
  |  Branch (285:27): [True: 729, False: 13.4k]
  ------------------
  286|   227k|	return(NULL);
  287|       |
  288|  13.4k|    *len = l;
  289|       |
  290|  13.4k|    return(&name[l+1]);
  291|   241k|}
xmlSplitQName4:
  306|   612k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   612k|    xmlChar *prefix;
  308|   612k|    int l = 0;
  309|       |
  310|   612k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 612k]
  |  Branch (310:27): [True: 0, False: 612k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   612k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   612k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 2.41k, False: 609k]
  ------------------
  317|  2.41k|	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.71M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 2.27M, False: 433k]
  |  Branch (323:30): [True: 2.10M, False: 176k]
  ------------------
  324|  2.10M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   609k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 433k, False: 176k]
  |  Branch (329:27): [True: 1.76k, False: 174k]
  ------------------
  330|   435k|	return(name);
  331|       |
  332|   174k|    prefix = xmlStrndup(name, l);
  333|   174k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 56, False: 174k]
  ------------------
  334|     56|        return(NULL);
  335|       |
  336|   174k|    *prefixPtr = prefix;
  337|   174k|    return(&name[l+1]);
  338|   174k|}
xmlValidateNCName:
  355|  2.95k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  2.95k|    const xmlChar *cur;
  357|       |
  358|  2.95k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 2.95k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  2.95k|    cur = value;
  362|       |
  363|  2.95k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 2.95k, False: 0]
  ------------------
  364|  2.95k|	while (IS_BLANK_CH(*cur))
  365|    843|            cur++;
  366|  2.95k|    }
  367|       |
  368|  2.95k|    value = cur;
  369|  2.95k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  2.95k|#define XML_SCAN_NC         1
  ------------------
  370|  2.95k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 2.95k]
  |  Branch (370:26): [True: 486, False: 2.46k]
  ------------------
  371|    486|        return(1);
  372|       |
  373|  2.46k|    if (space) {
  ------------------
  |  Branch (373:9): [True: 2.46k, False: 0]
  ------------------
  374|  2.46k|	while (IS_BLANK_CH(*cur))
  375|  1.00k|            cur++;
  376|  2.46k|    }
  377|       |
  378|  2.46k|    return(*cur != 0);
  379|  2.95k|}
xmlNewNs:
  517|  7.82M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  7.82M|    xmlNsPtr cur;
  519|       |
  520|  7.82M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 98.4k, False: 7.73M]
  |  Branch (520:27): [True: 0, False: 98.4k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  7.82M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  7.82M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 64, False: 7.82M]
  ------------------
  528|     64|	return(NULL);
  529|  7.82M|    memset(cur, 0, sizeof(xmlNs));
  530|  7.82M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  7.82M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  7.82M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 7.80M, False: 25.0k]
  ------------------
  533|  7.80M|	cur->href = xmlStrdup(href);
  534|  7.80M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 55, False: 7.80M]
  ------------------
  535|     55|            goto error;
  536|  7.80M|    }
  537|  7.82M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 7.49M, False: 335k]
  ------------------
  538|  7.49M|	cur->prefix = xmlStrdup(prefix);
  539|  7.49M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 47, False: 7.49M]
  ------------------
  540|     47|            goto error;
  541|  7.49M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  7.82M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 98.4k, False: 7.73M]
  ------------------
  548|  98.4k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 79.1k, False: 19.3k]
  ------------------
  549|  79.1k|	    node->nsDef = cur;
  550|  79.1k|	} else {
  551|  19.3k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  19.3k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 19.3k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  33.7k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 14.4k, False: 19.3k]
  ------------------
  557|  14.4k|	        prev = prev->next;
  558|  14.4k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 14.4k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  14.4k|	    }
  562|  19.3k|	    prev->next = cur;
  563|  19.3k|	}
  564|  98.4k|    }
  565|  7.82M|    return(cur);
  566|       |
  567|    102|error:
  568|    102|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  7.82M|}
xmlSetNs:
  580|  76.1k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  76.1k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 76.1k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  76.1k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 76.1k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  76.1k|	node->ns = ns;
  587|  76.1k|}
xmlFreeNs:
  595|  7.83M|xmlFreeNs(xmlNs *cur) {
  596|  7.83M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 7.83M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  7.83M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 7.81M, False: 25.0k]
  ------------------
  600|  7.83M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 7.49M, False: 335k]
  ------------------
  601|  7.83M|    xmlFree(cur);
  602|  7.83M|}
xmlFreeNsList:
  610|  5.99M|xmlFreeNsList(xmlNs *cur) {
  611|  5.99M|    xmlNsPtr next;
  612|  5.99M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 41, False: 5.99M]
  ------------------
  613|     41|	return;
  614|     41|    }
  615|  13.8M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 7.83M, False: 5.99M]
  ------------------
  616|  7.83M|        next = cur->next;
  617|  7.83M|        xmlFreeNs(cur);
  618|  7.83M|	cur = next;
  619|  7.83M|    }
  620|  5.99M|}
xmlNewDtd:
  640|  10.9k|          const xmlChar *systemId) {
  641|  10.9k|    xmlDtdPtr cur;
  642|       |
  643|  10.9k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 1.75k, False: 9.19k]
  |  Branch (643:26): [True: 0, False: 1.75k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  10.9k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  10.9k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 10, False: 10.9k]
  ------------------
  652|     10|	return(NULL);
  653|  10.9k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  10.9k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  10.9k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 10.9k, False: 0]
  ------------------
  657|  10.9k|	cur->name = xmlStrdup(name);
  658|  10.9k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 14, False: 10.9k]
  ------------------
  659|     14|            goto error;
  660|  10.9k|    }
  661|  10.9k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 363, False: 10.5k]
  ------------------
  662|    363|	cur->ExternalID = xmlStrdup(publicId);
  663|    363|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 1, False: 362]
  ------------------
  664|      1|            goto error;
  665|    363|    }
  666|  10.9k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 2.54k, False: 8.38k]
  ------------------
  667|  2.54k|	cur->SystemID = xmlStrdup(systemId);
  668|  2.54k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 5, False: 2.53k]
  ------------------
  669|      5|            goto error;
  670|  2.54k|    }
  671|  10.9k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 1.75k, False: 9.16k]
  ------------------
  672|  1.75k|	doc->extSubset = cur;
  673|  10.9k|    cur->doc = doc;
  674|       |
  675|  10.9k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 10.9k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  10.9k|    return(cur);
  678|       |
  679|     20|error:
  680|     20|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  10.9k|}
xmlGetIntSubset:
  691|  83.0k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  83.0k|    xmlNodePtr cur;
  693|       |
  694|  83.0k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 8.84k, False: 74.2k]
  ------------------
  695|  8.84k|	return(NULL);
  696|  74.2k|    cur = doc->children;
  697|  88.0k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 40.7k, False: 47.2k]
  ------------------
  698|  40.7k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 27.0k, False: 13.7k]
  ------------------
  699|  27.0k|	    return((xmlDtdPtr) cur);
  700|  13.7k|	cur = cur->next;
  701|  13.7k|    }
  702|  47.2k|    return((xmlDtdPtr) doc->intSubset);
  703|  74.2k|}
xmlCreateIntSubset:
  722|  20.8k|                   const xmlChar *systemId) {
  723|  20.8k|    xmlDtdPtr cur;
  724|       |
  725|  20.8k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 20.8k, False: 0]
  ------------------
  726|  20.8k|        cur = xmlGetIntSubset(doc);
  727|  20.8k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 20.8k]
  ------------------
  728|      0|            return(cur);
  729|  20.8k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  20.8k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  20.8k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 6, False: 20.8k]
  ------------------
  736|      6|	return(NULL);
  737|  20.8k|    memset(cur, 0, sizeof(xmlDtd));
  738|  20.8k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  20.8k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 19.6k, False: 1.12k]
  ------------------
  741|  19.6k|	cur->name = xmlStrdup(name);
  742|  19.6k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 5, False: 19.6k]
  ------------------
  743|      5|            goto error;
  744|  19.6k|    }
  745|  20.8k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 781, False: 20.0k]
  ------------------
  746|    781|	cur->ExternalID = xmlStrdup(publicId);
  747|    781|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 1, False: 780]
  ------------------
  748|      1|            goto error;
  749|    781|    }
  750|  20.8k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 3.11k, False: 17.6k]
  ------------------
  751|  3.11k|	cur->SystemID = xmlStrdup(systemId);
  752|  3.11k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 3.11k]
  ------------------
  753|      1|            goto error;
  754|  3.11k|    }
  755|  20.8k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 20.8k, False: 0]
  ------------------
  756|  20.8k|	doc->intSubset = cur;
  757|  20.8k|	cur->parent = doc;
  758|  20.8k|	cur->doc = doc;
  759|  20.8k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 18.6k, False: 2.11k]
  ------------------
  760|  18.6k|	    doc->children = (xmlNodePtr) cur;
  761|  18.6k|	    doc->last = (xmlNodePtr) cur;
  762|  18.6k|	} else {
  763|  2.11k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 2.11k]
  ------------------
  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.11k|	    } else {
  771|  2.11k|		xmlNodePtr next;
  772|       |
  773|  2.11k|		next = doc->children;
  774|  4.39k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.44k, False: 1.94k]
  |  Branch (774:28): [True: 2.27k, False: 162]
  ------------------
  775|  2.27k|		    next = next->next;
  776|  2.11k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 1.94k, False: 162]
  ------------------
  777|  1.94k|		    cur->prev = doc->last;
  778|  1.94k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  1.94k|		    cur->next = NULL;
  780|  1.94k|		    doc->last = (xmlNodePtr) cur;
  781|  1.94k|		} else {
  782|    162|		    cur->next = next;
  783|    162|		    cur->prev = next->prev;
  784|    162|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 152, False: 10]
  ------------------
  785|    152|			doc->children = (xmlNodePtr) cur;
  786|     10|		    else
  787|     10|			cur->prev->next = (xmlNodePtr) cur;
  788|    162|		    next->prev = (xmlNodePtr) cur;
  789|    162|		}
  790|  2.11k|	    }
  791|  2.11k|	}
  792|  20.8k|    }
  793|       |
  794|  20.8k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 20.8k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  20.8k|    return(cur);
  797|       |
  798|      7|error:
  799|      7|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  20.8k|}
xmlFreeDtd:
  820|  31.7k|xmlFreeDtd(xmlDtd *cur) {
  821|  31.7k|    xmlDictPtr dict = NULL;
  822|       |
  823|  31.7k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 31.7k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  31.7k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 22.5k, False: 9.19k]
  ------------------
  827|       |
  828|  31.7k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 31.7k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  31.7k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 21.5k, False: 10.2k]
  ------------------
  832|  21.5k|	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|   260k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 238k, False: 21.5k]
  ------------------
  839|   238k|	    next = c->next;
  840|   238k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 221k, False: 16.8k]
  ------------------
  841|   221k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 185k, False: 36.3k]
  ------------------
  842|   185k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 159k, False: 25.9k]
  ------------------
  843|   159k|		xmlUnlinkNodeInternal(c);
  844|   159k|		xmlFreeNode(c);
  845|   159k|	    }
  846|   238k|	    c = next;
  847|   238k|	}
  848|  21.5k|    }
  849|       |
  850|  31.7k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  31.7k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 30.6k, False: 1.14k]
  |  |  |  Branch (810:16): [True: 18.3k, False: 12.2k]
  |  |  ------------------
  |  |  811|  30.6k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 12.2k, False: 0]
  |  |  ------------------
  |  |  812|  31.7k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  31.7k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 5.65k, False: 26.1k]
  ------------------
  853|  5.65k|        xmlFree(cur->SystemID);
  854|  31.7k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 1.14k, False: 30.6k]
  ------------------
  855|  1.14k|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  31.7k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 1.33k, False: 30.4k]
  ------------------
  859|  1.33k|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  31.7k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 14.7k, False: 16.9k]
  ------------------
  862|  14.7k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  31.7k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 9.47k, False: 22.2k]
  ------------------
  864|  9.47k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  31.7k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 7.56k, False: 24.1k]
  ------------------
  866|  7.56k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  31.7k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 3.90k, False: 27.8k]
  ------------------
  868|  3.90k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  31.7k|    xmlFree(cur);
  871|  31.7k|}
xmlNewDoc:
  880|  48.5k|xmlNewDoc(const xmlChar *version) {
  881|  48.5k|    xmlDocPtr cur;
  882|       |
  883|  48.5k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 537, False: 48.0k]
  ------------------
  884|    537|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  48.5k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  48.5k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 3, False: 48.5k]
  ------------------
  891|      3|	return(NULL);
  892|  48.5k|    memset(cur, 0, sizeof(xmlDoc));
  893|  48.5k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  48.5k|    cur->version = xmlStrdup(version);
  896|  48.5k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 22, False: 48.5k]
  ------------------
  897|     22|	xmlFree(cur);
  898|     22|	return(NULL);
  899|     22|    }
  900|  48.5k|    cur->standalone = -1;
  901|  48.5k|    cur->compression = -1; /* not initialized */
  902|  48.5k|    cur->doc = cur;
  903|  48.5k|    cur->parseFlags = 0;
  904|  48.5k|    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|  48.5k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  48.5k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 48.5k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  48.5k|    return(cur);
  915|  48.5k|}
xmlFreeDoc:
  923|  14.4k|xmlFreeDoc(xmlDoc *cur) {
  924|  14.4k|    xmlDtdPtr extSubset, intSubset;
  925|  14.4k|    xmlDictPtr dict = NULL;
  926|       |
  927|  14.4k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 1.78k, False: 12.6k]
  ------------------
  928|  1.78k|	return;
  929|  1.78k|    }
  930|       |
  931|  12.6k|    dict = cur->dict;
  932|       |
  933|  12.6k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 12.6k]
  |  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|  12.6k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 215, False: 12.4k]
  ------------------
  940|  12.6k|    cur->ids = NULL;
  941|  12.6k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 336, False: 12.2k]
  ------------------
  942|  12.6k|    cur->refs = NULL;
  943|  12.6k|    extSubset = cur->extSubset;
  944|  12.6k|    intSubset = cur->intSubset;
  945|  12.6k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 8.13k, False: 4.49k]
  ------------------
  946|  8.13k|	extSubset = NULL;
  947|  12.6k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 259, False: 12.3k]
  ------------------
  948|    259|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    259|	cur->extSubset = NULL;
  950|    259|	xmlFreeDtd(extSubset);
  951|    259|    }
  952|  12.6k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 4.51k, False: 8.11k]
  ------------------
  953|  4.51k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  4.51k|	cur->intSubset = NULL;
  955|  4.51k|	xmlFreeDtd(intSubset);
  956|  4.51k|    }
  957|       |
  958|  12.6k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 11.9k, False: 653]
  ------------------
  959|  12.6k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.55k, False: 11.0k]
  ------------------
  960|       |
  961|  12.6k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  12.6k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 12.6k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  12.6k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  12.6k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 12.6k, False: 0]
  ------------------
  964|  12.6k|        xmlFree(cur->version);
  965|  12.6k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 89, False: 12.5k]
  ------------------
  966|     89|        xmlFree(cur->encoding);
  967|  12.6k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 8.76k, False: 3.86k]
  ------------------
  968|  8.76k|        xmlFree(cur->URL);
  969|       |
  970|  12.6k|    xmlFree(cur);
  971|  12.6k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 6.73k, False: 5.90k]
  ------------------
  972|  12.6k|}
xmlNodeParseAttValue:
  998|   100k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|   100k|    xmlNodePtr head = NULL, last = NULL;
 1000|   100k|    xmlNodePtr node;
 1001|   100k|    xmlChar *val = NULL;
 1002|   100k|    const xmlChar *cur;
 1003|   100k|    const xmlChar *q;
 1004|   100k|    xmlEntityPtr ent;
 1005|   100k|    xmlBufPtr buf;
 1006|   100k|    size_t remaining = len;
 1007|       |
 1008|   100k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 100k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|   100k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 100k]
  |  Branch (1011:28): [True: 3.75k, False: 96.4k]
  ------------------
 1012|  3.75k|        goto done;
 1013|       |
 1014|  96.4k|    cur = value;
 1015|       |
 1016|  96.4k|    buf = xmlBufCreate(50);
 1017|  96.4k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 28, False: 96.3k]
  ------------------
 1018|     28|        return(-1);
 1019|       |
 1020|  96.3k|    q = cur;
 1021|  94.9M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 94.8M, False: 70.7k]
  |  Branch (1021:31): [True: 94.8M, False: 25.5k]
  ------------------
 1022|  94.8M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 65.7k, False: 94.7M]
  ------------------
 1023|  65.7k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  65.7k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 50.4k, False: 15.3k]
  ------------------
 1029|  50.4k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 1, False: 50.4k]
  ------------------
 1030|      1|		    goto out;
 1031|  50.4k|	        q = cur;
 1032|  50.4k|	    }
 1033|       |
 1034|  65.7k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 65.7k, False: 0]
  |  Branch (1034:29): [True: 29.5k, False: 36.2k]
  |  Branch (1034:48): [True: 6.55k, False: 22.9k]
  ------------------
 1035|  6.55k|	        int tmp = 0;
 1036|       |
 1037|  6.55k|		cur += 3;
 1038|  6.55k|                remaining -= 3;
 1039|  27.4k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 27.4k, False: 0]
  |  Branch (1039:29): [True: 20.9k, False: 6.55k]
  ------------------
 1040|  20.9k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 20.9k, False: 0]
  |  Branch (1040:27): [True: 1.19k, False: 19.7k]
  ------------------
 1041|  1.19k|			charval = charval * 16 + (tmp - '0');
 1042|  19.7k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 6.13k, False: 13.5k]
  |  Branch (1042:32): [True: 6.13k, False: 0]
  ------------------
 1043|  6.13k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  13.5k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 13.5k, False: 0]
  |  Branch (1044:32): [True: 13.5k, False: 0]
  ------------------
 1045|  13.5k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  20.9k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 20.9k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  20.9k|		    cur++;
 1053|  20.9k|                    remaining--;
 1054|  20.9k|		}
 1055|  6.55k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 6.55k, False: 0]
  ------------------
 1056|  6.55k|		    cur++;
 1057|  6.55k|                    remaining--;
 1058|  6.55k|                }
 1059|  6.55k|		q = cur;
 1060|  59.2k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 59.2k, False: 0]
  |  Branch (1060:36): [True: 22.9k, False: 36.2k]
  ------------------
 1061|  22.9k|	        int tmp = 0;
 1062|       |
 1063|  22.9k|		cur += 2;
 1064|  22.9k|                remaining -= 2;
 1065|  68.9k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 68.9k, False: 0]
  |  Branch (1065:29): [True: 46.0k, False: 22.9k]
  ------------------
 1066|  46.0k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 46.0k, False: 0]
  |  Branch (1066:27): [True: 46.0k, False: 0]
  ------------------
 1067|  46.0k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  46.0k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 46.0k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  46.0k|		    cur++;
 1075|  46.0k|                    remaining--;
 1076|  46.0k|		}
 1077|  22.9k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 22.9k, False: 0]
  ------------------
 1078|  22.9k|		    cur++;
 1079|  22.9k|                    remaining--;
 1080|  22.9k|                }
 1081|  22.9k|		q = cur;
 1082|  36.2k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  36.2k|		cur++;
 1087|  36.2k|                remaining--;
 1088|  36.2k|		q = cur;
 1089|   156k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 156k, False: 0]
  |  Branch (1089:29): [True: 156k, False: 0]
  |  Branch (1089:44): [True: 119k, False: 36.2k]
  ------------------
 1090|   119k|                    cur++;
 1091|   119k|                    remaining--;
 1092|   119k|                }
 1093|  36.2k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 36.2k]
  |  Branch (1093:27): [True: 0, False: 36.2k]
  ------------------
 1094|      0|		    break;
 1095|  36.2k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 36.2k, False: 0]
  ------------------
 1096|  36.2k|		    val = xmlStrndup(q, cur - q);
 1097|  36.2k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 6, False: 36.2k]
  ------------------
 1098|      6|                        goto out;
 1099|  36.2k|		    ent = xmlGetDocEntity(doc, val);
 1100|  36.2k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 29.3k, False: 6.88k]
  ------------------
 1101|  29.3k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 341, False: 29.0k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    341|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 1, False: 340]
  ------------------
 1106|      1|			    goto out;
 1107|  35.8k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 6.88k, False: 29.0k]
  ------------------
 1108|  35.8k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  29.0k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 29.0k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  35.8k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 27.3k, False: 8.53k]
  ------------------
 1113|  27.3k|			    node = xmlNewDocText(doc, NULL);
 1114|  27.3k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 5, False: 27.3k]
  ------------------
 1115|      5|				goto out;
 1116|  27.3k|			    node->content = xmlBufDetach(buf);
 1117|  27.3k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  27.3k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 938, False: 26.4k]
  ------------------
 1120|    938|				head = node;
 1121|  26.4k|			    } else {
 1122|  26.4k|                                last->next = node;
 1123|  26.4k|                                node->prev = last;
 1124|  26.4k|			    }
 1125|  27.3k|                            last = node;
 1126|  27.3k|			}
 1127|       |
 1128|  35.8k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 29.0k, False: 6.88k]
  ------------------
 1129|  29.0k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  29.0k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 1.14k, False: 27.8k]
  ------------------
 1130|  1.14k|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 1.06k, False: 84]
  ------------------
 1131|  1.06k|                            int res;
 1132|       |
 1133|  1.06k|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.06k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|  1.06k|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|  1.06k|                                                       ent->content, SIZE_MAX,
 1136|  1.06k|                                                       NULL);
 1137|  1.06k|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.06k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|  1.06k|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 133, False: 930]
  ------------------
 1139|    133|                                goto out;
 1140|    930|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    930|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    930|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|  35.7k|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|  35.7k|                        val = NULL;
 1148|  35.7k|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 8, False: 35.7k]
  ------------------
 1149|      8|			    goto out;
 1150|  35.7k|                        node->parent = (xmlNode *) attr;
 1151|  35.7k|                        node->last = (xmlNodePtr) ent;
 1152|  35.7k|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 28.8k, False: 6.87k]
  ------------------
 1153|  28.8k|                            node->children = (xmlNodePtr) ent;
 1154|  28.8k|                            node->content = ent->content;
 1155|  28.8k|                        }
 1156|       |
 1157|  35.7k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.55k, False: 34.1k]
  ------------------
 1158|  1.55k|			    head = node;
 1159|  34.1k|			} else {
 1160|  34.1k|                            last->next = node;
 1161|  34.1k|                            node->prev = last;
 1162|  34.1k|			}
 1163|  35.7k|                        last = node;
 1164|  35.7k|		    }
 1165|  36.0k|		    xmlFree(val);
 1166|  36.0k|                    val = NULL;
 1167|  36.0k|		}
 1168|  36.0k|		cur++;
 1169|  36.0k|                remaining--;
 1170|  36.0k|		q = cur;
 1171|  36.0k|	    }
 1172|  65.6k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 29.5k, False: 36.0k]
  ------------------
 1173|  29.5k|		xmlChar buffer[10];
 1174|  29.5k|		int l;
 1175|       |
 1176|  29.5k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 29.5k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  29.5k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  29.5k|		buffer[l] = 0;
 1181|       |
 1182|  29.5k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 29.5k]
  ------------------
 1183|      1|		    goto out;
 1184|  29.5k|	    }
 1185|  94.7M|	} else {
 1186|  94.7M|	    cur++;
 1187|  94.7M|            remaining--;
 1188|  94.7M|        }
 1189|  94.8M|    }
 1190|       |
 1191|  96.2k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 94.3k, False: 1.89k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  94.3k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 6, False: 94.3k]
  ------------------
 1196|      6|	    goto out;
 1197|  94.3k|    }
 1198|       |
 1199|  96.2k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 95.2k, False: 963]
  ------------------
 1200|  95.2k|	node = xmlNewDocText(doc, NULL);
 1201|  95.2k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 21, False: 95.2k]
  ------------------
 1202|     21|            goto out;
 1203|  95.2k|        node->parent = (xmlNode *) attr;
 1204|  95.2k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  95.2k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 93.7k, False: 1.46k]
  ------------------
 1207|  93.7k|	    head = node;
 1208|  93.7k|	} else {
 1209|  1.46k|            last->next = node;
 1210|  1.46k|            node->prev = last;
 1211|  1.46k|	}
 1212|  95.2k|        last = node;
 1213|  95.2k|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 963]
  ------------------
 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|  96.2k|    xmlBufFree(buf);
 1222|       |
 1223|  99.9k|done:
 1224|  99.9k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 99.9k, False: 0]
  ------------------
 1225|  99.9k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 99.9k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  99.9k|        attr->children = head;
 1228|  99.9k|        attr->last = last;
 1229|  99.9k|    }
 1230|       |
 1231|  99.9k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 99.9k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  99.9k|    return(0);
 1235|       |
 1236|    182|out:
 1237|    182|    xmlBufFree(buf);
 1238|    182|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 139, False: 43]
  ------------------
 1239|    139|        xmlFree(val);
 1240|    182|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 62, False: 120]
  ------------------
 1241|     62|        xmlFreeNodeList(head);
 1242|    182|    return(-1);
 1243|  96.2k|}
xmlNodeListGetStringInternal:
 1297|  1.10k|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|  1.10k|    xmlBufPtr buf;
 1299|  1.10k|    xmlChar *ret;
 1300|       |
 1301|  1.10k|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.10k]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|  1.10k|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 1.10k, False: 0]
  ------------------
 1305|  1.10k|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 834, False: 274]
  ------------------
 1306|    274|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 274]
  ------------------
 1307|    834|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 501, False: 333]
  ------------------
 1308|    501|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 501]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    501|        return(xmlStrdup(node->content));
 1311|    501|    }
 1312|       |
 1313|    607|    buf = xmlBufCreate(50);
 1314|    607|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 8, False: 599]
  ------------------
 1315|      8|        return(NULL);
 1316|       |
 1317|  1.78k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 1.18k, False: 599]
  ------------------
 1318|  1.18k|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 470, False: 712]
  ------------------
 1319|    712|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 712]
  ------------------
 1320|    470|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 470, False: 0]
  ------------------
 1321|    470|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 470, False: 0]
  ------------------
 1322|    470|                    xmlBufCat(buf, node->content);
 1323|    470|                } 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|    470|            }
 1333|    712|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 712, False: 0]
  ------------------
 1334|    712|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 712, False: 0]
  ------------------
 1335|    712|                xmlBufGetNodeContent(buf, node);
 1336|    712|            } 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|    712|        }
 1342|       |
 1343|  1.18k|        node = node->next;
 1344|  1.18k|    }
 1345|       |
 1346|    599|    ret = xmlBufDetach(buf);
 1347|    599|    xmlBufFree(buf);
 1348|    599|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    599|}
xmlNodeListGetString:
 1374|  1.10k|{
 1375|  1.10k|    int flags = 0;
 1376|  1.10k|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|  1.10k|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 1.10k]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|  1.10k|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 1.10k]
  ------------------
 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.10k|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|  1.10k|}
xmlNewNsProp:
 1572|  65.1k|           const xmlChar *value) {
 1573|       |
 1574|  65.1k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 65.1k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  65.1k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  65.1k|}
xmlNewDocProp:
 1621|  1.74M|xmlNewDocProp(xmlDoc *doc, const xmlChar *name, const xmlChar *value) {
 1622|  1.74M|    xmlAttrPtr cur;
 1623|       |
 1624|  1.74M|    if (name == NULL) {
  ------------------
  |  Branch (1624:9): [True: 4.90k, False: 1.74M]
  ------------------
 1625|  4.90k|	return(NULL);
 1626|  4.90k|    }
 1627|       |
 1628|       |    /*
 1629|       |     * Allocate a new property and fill the fields.
 1630|       |     */
 1631|  1.74M|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1632|  1.74M|    if (cur == NULL)
  ------------------
  |  Branch (1632:9): [True: 22, False: 1.74M]
  ------------------
 1633|     22|	return(NULL);
 1634|  1.74M|    memset(cur, 0, sizeof(xmlAttr));
 1635|  1.74M|    cur->type = XML_ATTRIBUTE_NODE;
 1636|       |
 1637|  1.74M|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1637:9): [True: 1.74M, False: 246]
  |  Branch (1637:26): [True: 465k, False: 1.27M]
  ------------------
 1638|   465k|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|  1.27M|    else
 1640|  1.27M|	cur->name = xmlStrdup(name);
 1641|  1.74M|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 15, False: 1.74M]
  ------------------
 1642|     15|        goto error;
 1643|  1.74M|    cur->doc = doc;
 1644|  1.74M|    if (value != NULL) {
  ------------------
  |  Branch (1644:9): [True: 0, False: 1.74M]
  ------------------
 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|  1.74M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1653:9): [True: 0, False: 1.74M]
  |  Branch (1653:35): [True: 0, False: 0]
  ------------------
 1654|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1655|  1.74M|    return(cur);
 1656|       |
 1657|     15|error:
 1658|     15|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|  1.74M|}
xmlFreePropList:
 1668|   630k|xmlFreePropList(xmlAttr *cur) {
 1669|   630k|    xmlAttrPtr next;
 1670|   630k|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.35k, False: 629k]
  ------------------
 1671|  2.29M|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 1.66M, False: 629k]
  ------------------
 1672|  1.66M|        next = cur->next;
 1673|  1.66M|        xmlFreeProp(cur);
 1674|  1.66M|	cur = next;
 1675|  1.66M|    }
 1676|   629k|}
xmlFreeProp:
 1684|  1.66M|xmlFreeProp(xmlAttr *cur) {
 1685|  1.66M|    xmlDictPtr dict = NULL;
 1686|  1.66M|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 1.66M]
  ------------------
 1687|       |
 1688|  1.66M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 1.66M, False: 261]
  ------------------
 1689|       |
 1690|  1.66M|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 1.66M]
  |  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.66M|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 1.66M, False: 261]
  |  Branch (1694:29): [True: 2.10k, False: 1.66M]
  ------------------
 1695|  2.10k|        xmlRemoveID(cur->doc, cur);
 1696|  2.10k|    }
 1697|  1.66M|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 1.65M, False: 8.64k]
  ------------------
 1698|  1.66M|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  1.66M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 1.66M, False: 50]
  |  |  |  Branch (810:16): [True: 1.36M, False: 304k]
  |  |  ------------------
  |  |  811|  1.66M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 304k]
  |  |  ------------------
  |  |  812|  1.66M|	    xmlFree((char *)(str));
  ------------------
 1699|  1.66M|    xmlFree(cur);
 1700|  1.66M|}
xmlNewDocPI:
 1753|   192k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|   192k|    xmlNodePtr cur;
 1755|       |
 1756|   192k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 192k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|   192k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|   192k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 2, False: 192k]
  ------------------
 1765|      2|	return(NULL);
 1766|   192k|    memset(cur, 0, sizeof(xmlNode));
 1767|   192k|    cur->type = XML_PI_NODE;
 1768|   192k|    cur->doc = doc;
 1769|       |
 1770|   192k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 192k, False: 0]
  |  Branch (1770:26): [True: 120k, False: 71.5k]
  ------------------
 1771|   120k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  71.5k|    else
 1773|  71.5k|	cur->name = xmlStrdup(name);
 1774|   192k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 1, False: 192k]
  ------------------
 1775|      1|        goto error;
 1776|   192k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 28.6k, False: 163k]
  ------------------
 1777|  28.6k|	cur->content = xmlStrdup(content);
 1778|  28.6k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 1, False: 28.6k]
  ------------------
 1779|      1|            goto error;
 1780|  28.6k|    }
 1781|       |
 1782|   192k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 192k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|   192k|    return(cur);
 1785|       |
 1786|      2|error:
 1787|      2|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|   192k|}
xmlNewDocNode:
 1900|   518k|              const xmlChar *name, const xmlChar *content) {
 1901|   518k|    xmlNodePtr cur;
 1902|   518k|    xmlChar *copy;
 1903|       |
 1904|   518k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 518k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   518k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 518k, False: 0]
  |  Branch (1907:26): [True: 123k, False: 394k]
  ------------------
 1908|   123k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|   123k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 1, False: 123k]
  ------------------
 1911|      1|            return(NULL);
 1912|   123k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|   123k|    }
 1914|       |
 1915|   394k|    copy = xmlStrdup(name);
 1916|   394k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 39, False: 394k]
  ------------------
 1917|     39|        return(NULL);
 1918|       |
 1919|   394k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   394k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 35, False: 394k]
  ------------------
 1921|     35|        xmlFree(copy);
 1922|     35|        return(NULL);
 1923|     35|    }
 1924|       |
 1925|   394k|    return(cur);
 1926|   394k|}
xmlNewDocNodeEatName:
 1944|   322k|                     xmlChar *name, const xmlChar *content) {
 1945|   322k|    xmlNodePtr cur;
 1946|       |
 1947|   322k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 322k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   322k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   322k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 36, False: 322k]
  ------------------
 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: 1, False: 35]
  ------------------
 1955|     35|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 35]
  ------------------
 1956|      1|            xmlFree(name);
 1957|     36|        return(NULL);
 1958|     36|    }
 1959|       |
 1960|   322k|    return(cur);
 1961|   322k|}
xmlNewText:
 2037|   162k|xmlNewText(const xmlChar *content) {
 2038|   162k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   162k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   162k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 47, False: 162k]
  ------------------
 2045|     47|	return(NULL);
 2046|   162k|    memset(cur, 0, sizeof(xmlNode));
 2047|   162k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   162k|    cur->name = xmlStringText;
 2050|   162k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 39.5k, False: 122k]
  ------------------
 2051|  39.5k|	cur->content = xmlStrdup(content);
 2052|  39.5k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 24, False: 39.5k]
  ------------------
 2053|     24|            goto error;
 2054|  39.5k|    }
 2055|       |
 2056|   162k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 162k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   162k|    return(cur);
 2059|       |
 2060|     24|error:
 2061|     24|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   162k|}
xmlNewReference:
 2209|  26.4k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  26.4k|    xmlNodePtr cur;
 2211|  26.4k|    xmlEntityPtr ent;
 2212|       |
 2213|  26.4k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 26.4k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  26.4k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  26.4k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 6, False: 26.4k]
  ------------------
 2221|      6|	return(NULL);
 2222|  26.4k|    memset(cur, 0, sizeof(xmlNode));
 2223|  26.4k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  26.4k|    cur->doc = (xmlDoc *)doc;
 2226|  26.4k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 26.4k]
  ------------------
 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|  26.4k|	cur->name = xmlStrdup(name);
 2236|  26.4k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 2, False: 26.4k]
  ------------------
 2237|      2|        goto error;
 2238|       |
 2239|  26.4k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  26.4k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 6.04k, False: 20.4k]
  ------------------
 2241|  6.04k|	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.04k|	cur->children = (xmlNodePtr) ent;
 2248|  6.04k|	cur->last = (xmlNodePtr) ent;
 2249|  6.04k|    }
 2250|       |
 2251|  26.4k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 26.4k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  26.4k|    return(cur);
 2254|       |
 2255|      2|error:
 2256|      2|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  26.4k|}
xmlNewDocText:
 2269|   162k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   162k|    xmlNodePtr cur;
 2271|       |
 2272|   162k|    cur = xmlNewText(content);
 2273|   162k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 162k, False: 71]
  ------------------
 2274|   162k|    return(cur);
 2275|   162k|}
xmlNewComment:
 2342|   281k|xmlNewComment(const xmlChar *content) {
 2343|   281k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   281k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   281k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 8, False: 281k]
  ------------------
 2350|      8|	return(NULL);
 2351|   281k|    memset(cur, 0, sizeof(xmlNode));
 2352|   281k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   281k|    cur->name = xmlStringComment;
 2355|   281k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 281k, False: 0]
  ------------------
 2356|   281k|	cur->content = xmlStrdup(content);
 2357|   281k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 8, False: 281k]
  ------------------
 2358|      8|            goto error;
 2359|   281k|    }
 2360|       |
 2361|   281k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 281k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   281k|    return(cur);
 2364|       |
 2365|      8|error:
 2366|      8|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   281k|}
xmlNewCDataBlock:
 2380|  77.3k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  77.3k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  77.3k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  77.3k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 1, False: 77.3k]
  ------------------
 2388|      1|	return(NULL);
 2389|  77.3k|    memset(cur, 0, sizeof(xmlNode));
 2390|  77.3k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  77.3k|    cur->doc = doc;
 2392|       |
 2393|  77.3k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 77.3k, False: 0]
  ------------------
 2394|  77.3k|	cur->content = xmlStrndup(content, len);
 2395|  77.3k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 3, False: 77.3k]
  ------------------
 2396|      3|            xmlFree(cur);
 2397|      3|            return(NULL);
 2398|      3|        }
 2399|  77.3k|    }
 2400|       |
 2401|  77.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 77.3k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  77.3k|    return(cur);
 2404|  77.3k|}
xmlNewDocComment:
 2415|   281k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   281k|    xmlNodePtr cur;
 2417|       |
 2418|   281k|    cur = xmlNewComment(content);
 2419|   281k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 281k, False: 16]
  ------------------
 2420|   281k|    return(cur);
 2421|   281k|}
xmlAddNextSibling:
 2893|  12.7k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  12.7k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 12.7k]
  |  Branch (2894:27): [True: 0, False: 12.7k]
  ------------------
 2895|  12.7k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 12.7k]
  |  Branch (2895:26): [True: 0, False: 12.7k]
  ------------------
 2896|  12.7k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 12.7k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  12.7k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 12.7k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  12.7k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  12.7k|}
xmlAddPrevSibling:
 2922|   234k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   234k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 234k]
  |  Branch (2923:27): [True: 0, False: 234k]
  ------------------
 2924|   234k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 234k]
  |  Branch (2924:26): [True: 0, False: 234k]
  ------------------
 2925|   234k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 234k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   234k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 234k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   234k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   234k|}
xmlGetLastChild:
 3141|  10.8k|xmlGetLastChild(const xmlNode *parent) {
 3142|  10.8k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3142:9): [True: 0, False: 10.8k]
  |  Branch (3142:29): [True: 0, False: 10.8k]
  ------------------
 3143|      0|	return(NULL);
 3144|      0|    }
 3145|  10.8k|    return(parent->last);
 3146|  10.8k|}
xmlFreeNodeList:
 3328|  1.69M|xmlFreeNodeList(xmlNode *cur) {
 3329|  1.69M|    xmlNodePtr next;
 3330|  1.69M|    xmlNodePtr parent;
 3331|  1.69M|    xmlDictPtr dict = NULL;
 3332|  1.69M|    size_t depth = 0;
 3333|       |
 3334|  1.69M|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 8.66k, False: 1.68M]
  ------------------
 3335|  1.68M|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 1.68M]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|  1.68M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 1.68M, False: 1.16k]
  ------------------
 3340|  14.5M|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 14.5M, Folded]
  ------------------
 3341|  19.7M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 5.20M, False: 14.5M]
  ------------------
 3342|  5.20M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 5.20M, False: 0]
  ------------------
 3343|  5.20M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 5.20M, False: 0]
  ------------------
 3344|  5.20M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 5.20M, False: 0]
  ------------------
 3345|  5.20M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 5.19M, False: 5.78k]
  ------------------
 3346|  5.19M|            cur = cur->children;
 3347|  5.19M|            depth += 1;
 3348|  5.19M|        }
 3349|       |
 3350|  14.5M|        next = cur->next;
 3351|  14.5M|        parent = cur->parent;
 3352|  14.5M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 14.5M]
  ------------------
 3353|  14.5M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 14.5M]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|  14.5M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 14.5M]
  ------------------
 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|  14.5M|        } else {
 3363|  14.5M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 14.5M]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|  14.5M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 5.95M, False: 8.54M]
  ------------------
 3367|  8.54M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 140k, False: 8.40M]
  ------------------
 3368|  8.40M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 2.26M, False: 6.14M]
  ------------------
 3369|  8.36M|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 620k, False: 7.73M]
  ------------------
 3370|   620k|		xmlFreePropList(cur->properties);
 3371|  14.5M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 8.54M, False: 5.95M]
  ------------------
 3372|  8.54M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 8.40M, False: 140k]
  ------------------
 3373|  8.40M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 6.14M, False: 2.26M]
  ------------------
 3374|  6.14M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 6.10M, False: 41.7k]
  ------------------
 3375|  6.10M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 5.89M, False: 206k]
  ------------------
 3376|  5.89M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  5.89M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 5.56M, False: 333k]
  |  |  |  Branch (810:16): [True: 2.34M, False: 3.21M]
  |  |  ------------------
  |  |  811|  5.56M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 3.21M, False: 409]
  |  |  ------------------
  |  |  812|  5.89M|	    xmlFree((char *)(str));
  ------------------
 3377|  5.89M|	    }
 3378|  14.5M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 5.95M, False: 8.54M]
  ------------------
 3379|  8.54M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 140k, False: 8.40M]
  ------------------
 3380|  8.40M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 2.26M, False: 6.14M]
  ------------------
 3381|  8.36M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 2.83M, False: 5.52M]
  ------------------
 3382|  2.83M|		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|  14.5M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 14.2M, False: 217k]
  ------------------
 3391|  14.2M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 8.83M, False: 5.44M]
  ------------------
 3392|  8.83M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 8.73M, False: 102k]
  ------------------
 3393|  8.73M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  8.73M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 8.73M, False: 0]
  |  |  |  Branch (810:16): [True: 1.18M, False: 7.55M]
  |  |  ------------------
  |  |  811|  8.73M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 16.4k, False: 7.53M]
  |  |  ------------------
  |  |  812|  8.73M|	    xmlFree((char *)(str));
  ------------------
 3394|  14.5M|	    xmlFree(cur);
 3395|  14.5M|	}
 3396|       |
 3397|  14.5M|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 7.62M, False: 6.88M]
  ------------------
 3398|  7.62M|	    cur = next;
 3399|  7.62M|        } else {
 3400|  6.88M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 1.68M, False: 5.19M]
  |  Branch (3400:33): [True: 0, False: 5.19M]
  ------------------
 3401|  1.68M|                break;
 3402|  5.19M|            depth -= 1;
 3403|  5.19M|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|  5.19M|        }
 3406|  14.5M|    }
 3407|  1.68M|}
xmlFreeNode:
 3418|   225k|xmlFreeNode(xmlNode *cur) {
 3419|   225k|    xmlDictPtr dict = NULL;
 3420|       |
 3421|   225k|    if (cur == NULL) return;
  ------------------
  |  Branch (3421:9): [True: 119, False: 225k]
  ------------------
 3422|       |
 3423|       |    /* use xmlFreeDtd for DTD nodes */
 3424|   225k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3424:9): [True: 8.84k, False: 216k]
  ------------------
 3425|  8.84k|	xmlFreeDtd((xmlDtdPtr) cur);
 3426|  8.84k|	return;
 3427|  8.84k|    }
 3428|   216k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3428:9): [True: 0, False: 216k]
  ------------------
 3429|      0|	xmlFreeNs((xmlNsPtr) cur);
 3430|      0|        return;
 3431|      0|    }
 3432|   216k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 216k]
  ------------------
 3433|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3434|      0|	return;
 3435|      0|    }
 3436|   216k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3436:9): [True: 0, False: 216k]
  ------------------
 3437|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3438|      0|        return;
 3439|      0|    }
 3440|       |
 3441|   216k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3441:9): [True: 0, False: 216k]
  |  Branch (3441:35): [True: 0, False: 0]
  ------------------
 3442|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3443|       |
 3444|   216k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3444:9): [True: 216k, False: 196]
  ------------------
 3445|       |
 3446|   216k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3446:9): [True: 10.6k, False: 205k]
  ------------------
 3447|  10.6k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3447:2): [True: 10.1k, False: 489]
  ------------------
 3448|  10.1k|	xmlFreeNodeList(cur->children);
 3449|       |
 3450|   216k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3450:9): [True: 34.7k, False: 181k]
  ------------------
 3451|   181k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3451:9): [True: 1.15k, False: 180k]
  ------------------
 3452|   180k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3452:9): [True: 269, False: 180k]
  ------------------
 3453|  36.1k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3453:13): [True: 5.35k, False: 30.8k]
  ------------------
 3454|  5.35k|            xmlFreePropList(cur->properties);
 3455|  36.1k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3455:13): [True: 7.68k, False: 28.5k]
  ------------------
 3456|  7.68k|            xmlFreeNsList(cur->nsDef);
 3457|   180k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3457:16): [True: 176k, False: 3.78k]
  ------------------
 3458|   176k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3458:16): [True: 176k, False: 268]
  ------------------
 3459|   176k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3459:16): [True: 175k, False: 881]
  ------------------
 3460|   175k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   175k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 175k, False: 0]
  |  |  |  Branch (810:16): [True: 50.6k, False: 124k]
  |  |  ------------------
  |  |  811|   175k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 124k, False: 68]
  |  |  ------------------
  |  |  812|   175k|	    xmlFree((char *)(str));
  ------------------
 3461|   175k|    }
 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|   216k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3468:9): [True: 215k, False: 737]
  ------------------
 3469|   215k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3469:9): [True: 201k, False: 13.6k]
  ------------------
 3470|   201k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3470:9): [True: 61.3k, False: 140k]
  ------------------
 3471|  61.3k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  61.3k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 61.3k, False: 0]
  |  |  |  Branch (810:16): [True: 28.1k, False: 33.1k]
  |  |  ------------------
  |  |  811|  61.3k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 230, False: 32.9k]
  |  |  ------------------
  |  |  812|  61.3k|	    xmlFree((char *)(str));
  ------------------
 3472|       |
 3473|   216k|    xmlFree(cur);
 3474|   216k|}
xmlUnlinkNode:
 3518|   278k|xmlUnlinkNode(xmlNode *cur) {
 3519|   278k|    if (cur == NULL)
  ------------------
  |  Branch (3519:9): [True: 0, False: 278k]
  ------------------
 3520|      0|	return;
 3521|       |
 3522|   278k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3522:9): [True: 0, False: 278k]
  ------------------
 3523|      0|        return;
 3524|       |
 3525|   278k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3525:9): [True: 17.7k, False: 260k]
  ------------------
 3526|  17.7k|	xmlDocPtr doc = cur->doc;
 3527|       |
 3528|  17.7k|	if (doc != NULL) {
  ------------------
  |  Branch (3528:6): [True: 17.7k, False: 0]
  ------------------
 3529|  17.7k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3529:10): [True: 16.3k, False: 1.47k]
  ------------------
 3530|  16.3k|		doc->intSubset = NULL;
 3531|  17.7k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3531:10): [True: 1.47k, False: 16.3k]
  ------------------
 3532|  1.47k|		doc->extSubset = NULL;
 3533|  17.7k|	}
 3534|  17.7k|    }
 3535|       |
 3536|   278k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3536:9): [True: 0, False: 278k]
  ------------------
 3537|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3538|       |
 3539|   278k|    xmlUnlinkNodeInternal(cur);
 3540|   278k|}
xmlCopyNamespace:
 3616|  7.44M|xmlCopyNamespace(xmlNs *cur) {
 3617|  7.44M|    xmlNsPtr ret;
 3618|       |
 3619|  7.44M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3619:9): [True: 0, False: 7.44M]
  ------------------
 3620|  7.44M|    switch (cur->type) {
 3621|  7.44M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  7.44M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3621:2): [True: 7.44M, False: 0]
  ------------------
 3622|  7.44M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3623|  7.44M|	    break;
 3624|      0|	default:
  ------------------
  |  Branch (3624:2): [True: 0, False: 7.44M]
  ------------------
 3625|      0|	    return(NULL);
 3626|  7.44M|    }
 3627|  7.44M|    return(ret);
 3628|  7.44M|}
xmlCopyNamespaceList:
 3638|  5.79M|xmlCopyNamespaceList(xmlNs *cur) {
 3639|  5.79M|    xmlNsPtr ret = NULL;
 3640|  5.79M|    xmlNsPtr p = NULL,q;
 3641|       |
 3642|  13.2M|    while (cur != NULL) {
  ------------------
  |  Branch (3642:12): [True: 7.44M, False: 5.79M]
  ------------------
 3643|  7.44M|        q = xmlCopyNamespace(cur);
 3644|  7.44M|        if (q == NULL) {
  ------------------
  |  Branch (3644:13): [True: 56, False: 7.44M]
  ------------------
 3645|     56|            xmlFreeNsList(ret);
 3646|     56|            return(NULL);
 3647|     56|        }
 3648|  7.44M|	if (p == NULL) {
  ------------------
  |  Branch (3648:6): [True: 5.79M, False: 1.64M]
  ------------------
 3649|  5.79M|	    ret = p = q;
 3650|  5.79M|	} else {
 3651|  1.64M|	    p->next = q;
 3652|  1.64M|	    p = q;
 3653|  1.64M|	}
 3654|  7.44M|	cur = cur->next;
 3655|  7.44M|    }
 3656|  5.79M|    return(ret);
 3657|  5.79M|}
xmlCopyProp:
 3792|  1.74M|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3793|       |	return xmlCopyPropInternal(NULL, target, cur);
 3794|  1.74M|}
xmlCopyPropList:
 3807|   792k|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3808|   792k|    xmlAttrPtr ret = NULL;
 3809|   792k|    xmlAttrPtr p = NULL,q;
 3810|       |
 3811|   792k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3811:9): [True: 792k, False: 0]
  |  Branch (3811:29): [True: 0, False: 792k]
  ------------------
 3812|      0|        return(NULL);
 3813|  2.53M|    while (cur != NULL) {
  ------------------
  |  Branch (3813:12): [True: 1.74M, False: 787k]
  ------------------
 3814|  1.74M|        q = xmlCopyProp(target, cur);
 3815|  1.74M|	if (q == NULL) {
  ------------------
  |  Branch (3815:6): [True: 5.00k, False: 1.74M]
  ------------------
 3816|  5.00k|            xmlFreePropList(ret);
 3817|  5.00k|	    return(NULL);
 3818|  5.00k|        }
 3819|  1.74M|	if (p == NULL) {
  ------------------
  |  Branch (3819:6): [True: 790k, False: 950k]
  ------------------
 3820|   790k|	    ret = p = q;
 3821|   950k|	} else {
 3822|   950k|	    p->next = q;
 3823|   950k|	    q->prev = p;
 3824|   950k|	    p = q;
 3825|   950k|	}
 3826|  1.74M|	cur = cur->next;
 3827|  1.74M|    }
 3828|   787k|    return(ret);
 3829|   792k|}
xmlStaticCopyNode:
 3861|  25.8M|                  int extended) {
 3862|  25.8M|    xmlNodePtr ret;
 3863|       |
 3864|  25.8M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 25.8M]
  ------------------
 3865|  25.8M|    switch (node->type) {
 3866|  8.08M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 8.08M, False: 17.7M]
  ------------------
 3867|  8.23M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 150k, False: 25.6M]
  ------------------
 3868|  20.0M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 11.7M, False: 14.0M]
  ------------------
 3869|  20.0M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 25.8M]
  ------------------
 3870|  20.0M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 10.9k, False: 25.7M]
  ------------------
 3871|  20.2M|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 225k, False: 25.5M]
  ------------------
 3872|  20.3M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 37.0k, False: 25.7M]
  ------------------
 3873|  20.4M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 141k, False: 25.6M]
  ------------------
 3874|  25.7M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 5.34M, False: 20.4M]
  ------------------
 3875|  25.7M|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 25.8M]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 25.8M]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|  9.19k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 9.19k, False: 25.7M]
  ------------------
 3881|  9.19k|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 25.8M]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 25.8M]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 25.8M]
  ------------------
 3886|      0|            return(NULL);
 3887|  25.8M|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|  25.7M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|  25.7M|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 194, False: 25.7M]
  ------------------
 3894|    194|	return(NULL);
 3895|  25.7M|    memset(ret, 0, sizeof(xmlNode));
 3896|  25.7M|    ret->type = node->type;
 3897|       |
 3898|  25.7M|    ret->doc = doc;
 3899|  25.7M|    ret->parent = parent;
 3900|  25.7M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 8.08M, False: 17.7M]
  ------------------
 3901|  8.08M|	ret->name = xmlStringText;
 3902|  17.7M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 17.7M]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|  17.7M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 37.0k, False: 17.6M]
  ------------------
 3905|  37.0k|	ret->name = xmlStringComment;
 3906|  17.6M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 17.5M, False: 150k]
  ------------------
 3907|  17.5M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 17.5M, False: 2.91k]
  |  Branch (3907:30): [True: 16.6M, False: 903k]
  ------------------
 3908|  16.6M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|   906k|	else
 3910|   906k|	    ret->name = xmlStrdup(node->name);
 3911|  17.5M|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 46, False: 17.5M]
  ------------------
 3912|     46|            goto error;
 3913|  17.5M|    }
 3914|  25.7M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 13.9M, False: 11.7M]
  ------------------
 3915|  13.9M|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 8.27M, False: 5.71M]
  ------------------
 3916|  8.27M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 8.27M, False: 1.68k]
  ------------------
 3917|  8.27M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 8.27M, False: 0]
  ------------------
 3918|  8.27M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 8.27M, False: 0]
  ------------------
 3919|  8.27M|	ret->content = xmlStrdup(node->content);
 3920|  8.27M|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 98, False: 8.27M]
  ------------------
 3921|     98|            goto error;
 3922|  17.5M|    }else{
 3923|  17.5M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 11.7M, False: 5.71M]
  ------------------
 3924|  11.7M|        ret->line = node->line;
 3925|  17.5M|    }
 3926|       |
 3927|  25.7M|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 157, False: 25.7M]
  ------------------
 3928|    157|	goto out;
 3929|  25.7M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 11.7M, False: 13.9M]
  ------------------
 3930|  13.9M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 141k, False: 13.8M]
  |  Branch (3930:49): [True: 5.79M, False: 6.14M]
  ------------------
 3931|  5.79M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|  5.79M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 56, False: 5.79M]
  ------------------
 3933|     56|            goto error;
 3934|  5.79M|    }
 3935|       |
 3936|  25.7M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 11.7M, False: 13.9M]
  |  Branch (3936:45): [True: 812k, False: 10.9M]
  ------------------
 3937|   812k|        xmlNsPtr ns = NULL;
 3938|   812k|        int res;
 3939|       |
 3940|   812k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|   812k|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 1, False: 812k]
  ------------------
 3942|      1|            goto error;
 3943|   812k|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 1.34k, False: 810k]
  ------------------
 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|  1.34k|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|  1.34k|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 1.34k]
  ------------------
 3954|      0|                goto error;
 3955|  1.34k|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 1.34k, False: 0]
  ------------------
 3956|  1.34k|	        xmlNodePtr root = ret;
 3957|       |
 3958|  4.10k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 2.75k, False: 1.34k]
  ------------------
 3959|  1.34k|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|  1.34k|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|  1.34k|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 2, False: 1.34k]
  ------------------
 3964|      2|                goto error;
 3965|   810k|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|   810k|	    ret->ns = ns;
 3970|   810k|	}
 3971|   812k|    }
 3972|  25.7M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 11.7M, False: 13.9M]
  |  Branch (3972:45): [True: 792k, False: 11.0M]
  ------------------
 3973|   792k|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|   792k|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 5.00k, False: 787k]
  ------------------
 3975|  5.00k|            goto error;
 3976|   792k|    }
 3977|  25.7M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 10.9k, False: 25.7M]
  ------------------
 3978|  10.9k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 1.02k, False: 9.97k]
  |  Branch (3978:23): [True: 111, False: 9.86k]
  ------------------
 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.13k|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|  9.86k|	} else {
 3987|  9.86k|            ret->children = node->children;
 3988|  9.86k|	}
 3989|  10.9k|	ret->last = ret->children;
 3990|  25.7M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 11.0M, False: 14.6M]
  |  Branch (3990:44): [True: 16.6k, False: 11.0M]
  ------------------
 3991|  16.6k|        xmlNodePtr cur, insert;
 3992|       |
 3993|  16.6k|        cur = node->children;
 3994|  16.6k|        insert = ret;
 3995|  22.5M|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 22.4M, False: 12.1k]
  ------------------
 3996|  22.4M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|  22.4M|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 4.54k, False: 22.4M]
  ------------------
 3998|  4.54k|                goto error;
 3999|       |
 4000|       |            /* Check for coalesced text nodes */
 4001|  22.4M|            if (insert->last != copy) {
  ------------------
  |  Branch (4001:17): [True: 22.4M, False: 0]
  ------------------
 4002|  22.4M|                if (insert->last == NULL) {
  ------------------
  |  Branch (4002:21): [True: 10.9M, False: 11.5M]
  ------------------
 4003|  10.9M|                    insert->children = copy;
 4004|  11.5M|                } else {
 4005|  11.5M|                    copy->prev = insert->last;
 4006|  11.5M|                    insert->last->next = copy;
 4007|  11.5M|                }
 4008|  22.4M|                insert->last = copy;
 4009|  22.4M|            }
 4010|       |
 4011|  22.4M|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4011:17): [True: 22.4M, False: 8.86k]
  ------------------
 4012|  22.4M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 10.8M, False: 11.5M]
  ------------------
 4013|  10.8M|                cur = cur->children;
 4014|  10.8M|                insert = copy;
 4015|  10.8M|                continue;
 4016|  10.8M|            }
 4017|       |
 4018|  22.2M|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 22.2M, Folded]
  ------------------
 4019|  22.2M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 11.5M, False: 10.6M]
  ------------------
 4020|  11.5M|                    cur = cur->next;
 4021|  11.5M|                    break;
 4022|  11.5M|                }
 4023|       |
 4024|  10.6M|                cur = cur->parent;
 4025|  10.6M|                insert = insert->parent;
 4026|  10.6M|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 12.1k, False: 10.6M]
  ------------------
 4027|  12.1k|                    cur = NULL;
 4028|  12.1k|                    break;
 4029|  12.1k|                }
 4030|  10.6M|            }
 4031|  11.5M|        }
 4032|  16.6k|    }
 4033|       |
 4034|  25.7M|out:
 4035|  25.7M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 25.7M]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|  25.7M|    return(ret);
 4038|       |
 4039|  9.75k|error:
 4040|  9.75k|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|  25.7M|}
xmlStaticCopyNodeList:
 4055|  1.73M|xmlStaticCopyNodeList(xmlNode *node, xmlDoc *doc, xmlNode *parent) {
 4056|  1.73M|    xmlNodePtr ret = NULL;
 4057|  1.73M|    xmlNodePtr p = NULL,q;
 4058|  1.73M|    xmlDtdPtr newSubset = NULL;
 4059|  1.73M|    int linkedSubset = 0;
 4060|       |
 4061|  3.46M|    while (node != NULL) {
  ------------------
  |  Branch (4061:12): [True: 1.73M, False: 1.73M]
  ------------------
 4062|  1.73M|        xmlNodePtr next = node->next;
 4063|       |
 4064|  1.73M|	if (node->type == XML_DTD_NODE ) {
  ------------------
  |  Branch (4064:6): [True: 0, False: 1.73M]
  ------------------
 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.73M|	    q = xmlStaticCopyNode(node, doc, parent, 1);
 4102|  1.73M|	if (q == NULL) goto error;
  ------------------
  |  Branch (4102:6): [True: 54, False: 1.73M]
  ------------------
 4103|  1.73M|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 1.73M, False: 3.50k]
  ------------------
 4104|  1.73M|	    q->prev = NULL;
 4105|  1.73M|	    ret = p = q;
 4106|  1.73M|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 3.50k, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|  3.50k|	    p->next = q;
 4109|  3.50k|	    q->prev = p;
 4110|  3.50k|	    p = q;
 4111|  3.50k|	}
 4112|  1.73M|	node = next;
 4113|  1.73M|    }
 4114|  1.73M|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 1.73M, False: 1.16k]
  |  Branch (4114:26): [True: 0, False: 1.73M]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|  1.73M|    return(ret);
 4117|     54|error:
 4118|     54|    xmlFreeNodeList(ret);
 4119|     54|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 54]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|     54|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 54]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|  1.73M|}
xmlCopyNode:
 4146|    159|xmlCopyNode(xmlNode *node, int extended) {
 4147|    159|    xmlNodePtr ret;
 4148|       |
 4149|    159|    ret = xmlStaticCopyNode(node, NULL, NULL, extended);
 4150|    159|    return(ret);
 4151|    159|}
xmlDocCopyNode:
 4170|   109k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4171|   109k|    xmlNodePtr ret;
 4172|       |
 4173|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4174|   109k|    return(ret);
 4175|   109k|}
xmlCopyDtd:
 4211|  9.19k|xmlCopyDtd(xmlDtd *dtd) {
 4212|  9.19k|    xmlDtdPtr ret;
 4213|  9.19k|    xmlNodePtr cur, p = NULL, q;
 4214|       |
 4215|  9.19k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (4215:9): [True: 0, False: 9.19k]
  ------------------
 4216|  9.19k|    ret = xmlNewDtd(NULL, dtd->name, dtd->ExternalID, dtd->SystemID);
 4217|  9.19k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4217:9): [True: 25, False: 9.16k]
  ------------------
 4218|  9.16k|    if (dtd->entities != NULL) {
  ------------------
  |  Branch (4218:9): [True: 2.21k, False: 6.95k]
  ------------------
 4219|  2.21k|        ret->entities = (void *) xmlCopyEntitiesTable(
 4220|  2.21k|	                    (xmlEntitiesTablePtr) dtd->entities);
 4221|  2.21k|        if (ret->entities == NULL)
  ------------------
  |  Branch (4221:13): [True: 57, False: 2.15k]
  ------------------
 4222|     57|            goto error;
 4223|  2.21k|    }
 4224|  9.11k|    if (dtd->notations != NULL) {
  ------------------
  |  Branch (4224:9): [True: 1.10k, False: 8.00k]
  ------------------
 4225|  1.10k|        ret->notations = (void *) xmlCopyNotationTable(
 4226|  1.10k|	                    (xmlNotationTablePtr) dtd->notations);
 4227|  1.10k|        if (ret->notations == NULL)
  ------------------
  |  Branch (4227:13): [True: 20, False: 1.08k]
  ------------------
 4228|     20|            goto error;
 4229|  1.10k|    }
 4230|  9.09k|    if (dtd->elements != NULL) {
  ------------------
  |  Branch (4230:9): [True: 6.44k, False: 2.64k]
  ------------------
 4231|  6.44k|        ret->elements = (void *) xmlCopyElementTable(
 4232|  6.44k|	                    (xmlElementTablePtr) dtd->elements);
 4233|  6.44k|        if (ret->elements == NULL)
  ------------------
  |  Branch (4233:13): [True: 137, False: 6.31k]
  ------------------
 4234|    137|            goto error;
 4235|  6.44k|    }
 4236|  8.95k|    if (dtd->attributes != NULL) {
  ------------------
  |  Branch (4236:9): [True: 4.15k, False: 4.79k]
  ------------------
 4237|  4.15k|        ret->attributes = (void *) xmlCopyAttributeTable(
 4238|  4.15k|	                    (xmlAttributeTablePtr) dtd->attributes);
 4239|  4.15k|        if (ret->attributes == NULL)
  ------------------
  |  Branch (4239:13): [True: 103, False: 4.05k]
  ------------------
 4240|    103|            goto error;
 4241|  4.15k|    }
 4242|  8.85k|    if (dtd->pentities != NULL) {
  ------------------
  |  Branch (4242:9): [True: 426, False: 8.42k]
  ------------------
 4243|    426|	ret->pentities = (void *) xmlCopyEntitiesTable(
 4244|    426|			    (xmlEntitiesTablePtr) dtd->pentities);
 4245|    426|        if (ret->pentities == NULL)
  ------------------
  |  Branch (4245:13): [True: 9, False: 417]
  ------------------
 4246|      9|            goto error;
 4247|    426|    }
 4248|       |
 4249|  8.84k|    cur = dtd->children;
 4250|  25.9k|    while (cur != NULL) {
  ------------------
  |  Branch (4250:12): [True: 17.0k, False: 8.84k]
  ------------------
 4251|  17.0k|	q = NULL;
 4252|       |
 4253|  17.0k|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (4253:6): [True: 3.74k, False: 13.3k]
  ------------------
 4254|  3.74k|	    xmlEntityPtr tmp = (xmlEntityPtr) cur;
 4255|  3.74k|	    switch (tmp->etype) {
  ------------------
  |  Branch (4255:14): [True: 3.74k, False: 0]
  ------------------
 4256|  1.58k|		case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (4256:3): [True: 1.58k, False: 2.16k]
  ------------------
 4257|  2.95k|		case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (4257:3): [True: 1.37k, False: 2.37k]
  ------------------
 4258|  3.32k|		case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (4258:3): [True: 372, False: 3.37k]
  ------------------
 4259|  3.32k|		    q = (xmlNodePtr) xmlGetEntityFromDtd(ret, tmp->name);
 4260|  3.32k|		    break;
 4261|    355|		case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4261:3): [True: 355, False: 3.39k]
  ------------------
 4262|    421|		case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4262:3): [True: 66, False: 3.68k]
  ------------------
 4263|    421|		    q = (xmlNodePtr)
 4264|    421|			xmlGetParameterEntityFromDtd(ret, tmp->name);
 4265|    421|		    break;
 4266|      0|		case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (4266:3): [True: 0, False: 3.74k]
  ------------------
 4267|      0|		    break;
 4268|  3.74k|	    }
 4269|  13.3k|	} else if (cur->type == XML_ELEMENT_DECL) {
  ------------------
  |  Branch (4269:13): [True: 5.66k, False: 7.65k]
  ------------------
 4270|  5.66k|	    xmlElementPtr tmp = (xmlElementPtr) cur;
 4271|  5.66k|	    q = (xmlNodePtr)
 4272|  5.66k|		xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
 4273|  7.65k|	} else if (cur->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (4273:13): [True: 7.31k, False: 341]
  ------------------
 4274|  7.31k|	    xmlAttributePtr tmp = (xmlAttributePtr) cur;
 4275|  7.31k|	    q = (xmlNodePtr)
 4276|  7.31k|		xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
 4277|  7.31k|	} else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4277:13): [True: 159, False: 182]
  ------------------
 4278|    159|	    q = xmlCopyNode(cur, 0);
 4279|    159|            if (q == NULL)
  ------------------
  |  Branch (4279:17): [True: 2, False: 157]
  ------------------
 4280|      2|                goto error;
 4281|    159|	}
 4282|       |
 4283|  17.0k|	if (q == NULL) {
  ------------------
  |  Branch (4283:6): [True: 182, False: 16.8k]
  ------------------
 4284|    182|	    cur = cur->next;
 4285|    182|	    continue;
 4286|    182|	}
 4287|       |
 4288|  16.8k|	if (p == NULL)
  ------------------
  |  Branch (4288:6): [True: 7.44k, False: 9.43k]
  ------------------
 4289|  7.44k|	    ret->children = q;
 4290|  9.43k|	else
 4291|  9.43k|	    p->next = q;
 4292|       |
 4293|  16.8k|	q->prev = p;
 4294|  16.8k|	q->parent = (xmlNodePtr) ret;
 4295|  16.8k|	q->next = NULL;
 4296|  16.8k|	ret->last = q;
 4297|  16.8k|	p = q;
 4298|  16.8k|	cur = cur->next;
 4299|  16.8k|    }
 4300|       |
 4301|  8.84k|    return(ret);
 4302|       |
 4303|    328|error:
 4304|    328|    xmlFreeDtd(ret);
 4305|       |    return(NULL);
 4306|  8.84k|}
xmlGetLineNo:
 4446|  28.1k|{
 4447|  28.1k|    return(xmlGetLineNoInternal(node, 0));
 4448|  28.1k|}
xmlDocGetRootElement:
 4674|   248k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   248k|    xmlNodePtr ret;
 4676|       |
 4677|   248k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 248k]
  ------------------
 4678|   248k|    ret = doc->children;
 4679|   334k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 334k, False: 1]
  ------------------
 4680|   334k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 248k, False: 86.5k]
  ------------------
 4681|   248k|	    return(ret);
 4682|  86.5k|        ret = ret->next;
 4683|  86.5k|    }
 4684|      1|    return(ret);
 4685|   248k|}
xmlNodeGetLang:
 4771|  9.03k|xmlNodeGetLang(const xmlNode *cur) {
 4772|  9.03k|    xmlChar *lang;
 4773|  9.03k|    int res;
 4774|       |
 4775|  9.03k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4775:9): [True: 0, False: 9.03k]
  |  Branch (4775:26): [True: 0, False: 9.03k]
  ------------------
 4776|      0|        return(NULL);
 4777|       |
 4778|   140k|    while (cur != NULL) {
  ------------------
  |  Branch (4778:12): [True: 132k, False: 8.52k]
  ------------------
 4779|   132k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   132k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   132k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4780|   132k|                                  &lang);
 4781|   132k|        if (res < 0)
  ------------------
  |  Branch (4781:13): [True: 2, False: 132k]
  ------------------
 4782|      2|            return(NULL);
 4783|   132k|	if (lang != NULL)
  ------------------
  |  Branch (4783:6): [True: 505, False: 131k]
  ------------------
 4784|    505|	    return(lang);
 4785|       |
 4786|   131k|	cur = cur->parent;
 4787|   131k|    }
 4788|       |
 4789|  8.52k|    return(NULL);
 4790|  9.03k|}
xmlNodeGetSpacePreserve:
 4837|    821|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4838|    821|    xmlChar *space;
 4839|    821|        int res;
 4840|       |
 4841|    821|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4841:9): [True: 0, False: 821]
  |  Branch (4841:26): [True: 821, False: 0]
  ------------------
 4842|    821|        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.76k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4922|  2.76k|    xmlNsPtr ns;
 4923|  2.76k|    xmlChar* fixed;
 4924|       |
 4925|  2.76k|    if (cur == NULL)
  ------------------
  |  Branch (4925:9): [True: 0, False: 2.76k]
  ------------------
 4926|      0|        return(-1);
 4927|  2.76k|    switch(cur->type) {
 4928|  2.76k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4928:9): [True: 2.76k, False: 0]
  ------------------
 4929|  2.76k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 2.76k]
  ------------------
 4930|  2.76k|	    break;
 4931|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4931:9): [True: 0, False: 2.76k]
  ------------------
 4932|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4932:9): [True: 0, False: 2.76k]
  ------------------
 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.76k]
  ------------------
 4947|      0|	    return(-1);
 4948|  2.76k|    }
 4949|       |
 4950|  2.76k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  2.76k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4951|  2.76k|    if (ns == NULL)
  ------------------
  |  Branch (4951:9): [True: 2, False: 2.76k]
  ------------------
 4952|      2|	return(-1);
 4953|  2.76k|    fixed = xmlPathToURI(uri);
 4954|  2.76k|    if (fixed == NULL)
  ------------------
  |  Branch (4954:9): [True: 3, False: 2.76k]
  ------------------
 4955|      3|        return(-1);
 4956|  2.76k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  2.76k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4956:9): [True: 16, False: 2.74k]
  ------------------
 4957|     16|        xmlFree(fixed);
 4958|     16|        return(-1);
 4959|     16|    }
 4960|  2.74k|    xmlFree(fixed);
 4961|       |
 4962|  2.74k|    return(0);
 4963|  2.76k|}
xmlNodeGetBaseSafe:
 4982|   102k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4983|   102k|    xmlChar *ret = NULL;
 4984|   102k|    xmlChar *base, *newbase;
 4985|   102k|    int res;
 4986|       |
 4987|   102k|    if (baseOut == NULL)
  ------------------
  |  Branch (4987:9): [True: 0, False: 102k]
  ------------------
 4988|      0|        return(1);
 4989|   102k|    *baseOut = NULL;
 4990|   102k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4990:9): [True: 0, False: 102k]
  |  Branch (4990:26): [True: 0, False: 0]
  ------------------
 4991|      0|        return(1);
 4992|   102k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4992:9): [True: 102k, False: 0]
  |  Branch (4992:26): [True: 0, False: 102k]
  ------------------
 4993|      0|        return(1);
 4994|   102k|    if (doc == NULL)
  ------------------
  |  Branch (4994:9): [True: 45.5k, False: 56.9k]
  ------------------
 4995|  45.5k|        doc = cur->doc;
 4996|       |
 4997|   102k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4997:9): [True: 102k, False: 0]
  |  Branch (4997:26): [True: 0, False: 102k]
  ------------------
 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|  11.2M|    while (cur != NULL) {
  ------------------
  |  Branch (5024:12): [True: 11.1M, False: 89.3k]
  ------------------
 5025|  11.1M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5025:6): [True: 289, False: 11.1M]
  ------------------
 5026|    289|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5027|       |
 5028|    289|            if (ent->URI == NULL)
  ------------------
  |  Branch (5028:17): [True: 200, False: 89]
  ------------------
 5029|    200|                break;
 5030|     89|            xmlFree(ret);
 5031|     89|	    ret = xmlStrdup(ent->URI);
 5032|     89|            if (ret == NULL)
  ------------------
  |  Branch (5032:17): [True: 1, False: 88]
  ------------------
 5033|      1|                return(-1);
 5034|     88|            goto found;
 5035|     89|	}
 5036|  11.1M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5036:6): [True: 11.0M, False: 91.3k]
  ------------------
 5037|  11.0M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  11.0M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  11.0M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5037:10): [True: 179, False: 11.0M]
  ------------------
 5038|  11.0M|                                    &base) < 0) {
 5039|    179|                xmlFree(ret);
 5040|    179|                return(-1);
 5041|    179|            }
 5042|  11.0M|	    if (base != NULL) {
  ------------------
  |  Branch (5042:10): [True: 252k, False: 10.7M]
  ------------------
 5043|   252k|		if (ret != NULL) {
  ------------------
  |  Branch (5043:7): [True: 204k, False: 47.9k]
  ------------------
 5044|   204k|		    res = xmlBuildURISafe(ret, base, &newbase);
 5045|   204k|                    xmlFree(ret);
 5046|   204k|                    xmlFree(base);
 5047|   204k|                    if (res != 0)
  ------------------
  |  Branch (5047:25): [True: 9.43k, False: 194k]
  ------------------
 5048|  9.43k|                        return(res);
 5049|   194k|		    ret = newbase;
 5050|   194k|		} else {
 5051|  47.9k|		    ret = base;
 5052|  47.9k|		}
 5053|   242k|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|   242k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 785, False: 242k]
  ------------------
 5054|   242k|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|   242k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5054:7): [True: 876, False: 241k]
  ------------------
 5055|   241k|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|   241k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5055:7): [True: 1.61k, False: 239k]
  ------------------
 5056|  3.27k|                    goto found;
 5057|   242k|	    }
 5058|  11.0M|	}
 5059|  11.1M|	cur = cur->parent;
 5060|  11.1M|    }
 5061|       |
 5062|  89.5k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5062:9): [True: 89.5k, False: 0]
  |  Branch (5062:26): [True: 37.6k, False: 51.9k]
  ------------------
 5063|  37.6k|	if (ret == NULL) {
  ------------------
  |  Branch (5063:6): [True: 36.2k, False: 1.36k]
  ------------------
 5064|  36.2k|	    ret = xmlStrdup(doc->URL);
 5065|  36.2k|            if (ret == NULL)
  ------------------
  |  Branch (5065:17): [True: 30, False: 36.2k]
  ------------------
 5066|     30|                return(-1);
 5067|  36.2k|        } else {
 5068|  1.36k|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5069|  1.36k|            xmlFree(ret);
 5070|  1.36k|            if (res != 0)
  ------------------
  |  Branch (5070:17): [True: 425, False: 942]
  ------------------
 5071|    425|                return(res);
 5072|    942|            ret = newbase;
 5073|    942|        }
 5074|  37.6k|    }
 5075|       |
 5076|  92.4k|found:
 5077|  92.4k|    *baseOut = ret;
 5078|  92.4k|    return(0);
 5079|  89.5k|}
xmlBufGetNodeContent:
 5205|   147k|{
 5206|   147k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5206:9): [True: 0, False: 147k]
  |  Branch (5206:26): [True: 0, False: 147k]
  ------------------
 5207|      0|        return(-1);
 5208|       |
 5209|   147k|    switch (cur->type) {
 5210|  80.9k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 80.9k, False: 66.5k]
  ------------------
 5211|  80.9k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5211:9): [True: 0, False: 147k]
  ------------------
 5212|  80.9k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5212:9): [True: 0, False: 147k]
  ------------------
 5213|   145k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5213:9): [True: 64.6k, False: 82.9k]
  ------------------
 5214|   145k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5214:9): [True: 0, False: 147k]
  ------------------
 5215|   145k|            xmlBufGetChildContent(buf, cur, 0);
 5216|   145k|            break;
 5217|  1.23k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5217:9): [True: 1.23k, False: 146k]
  ------------------
 5218|  1.23k|            xmlBufGetChildContent(buf, cur, 1);
 5219|  1.23k|            break;
 5220|       |
 5221|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5221:9): [True: 0, False: 147k]
  ------------------
 5222|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5222:9): [True: 0, False: 147k]
  ------------------
 5223|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5223:9): [True: 0, False: 147k]
  ------------------
 5224|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5224:9): [True: 0, False: 147k]
  ------------------
 5225|      0|	    xmlBufCat(buf, cur->content);
 5226|      0|            break;
 5227|       |
 5228|    712|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5228:9): [True: 712, False: 146k]
  ------------------
 5229|    712|            xmlBufGetEntityRefContent(buf, cur, 0);
 5230|    712|            break;
 5231|       |
 5232|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5232:9): [True: 0, False: 147k]
  ------------------
 5233|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5234|      0|	    break;
 5235|       |
 5236|      0|        default:
  ------------------
  |  Branch (5236:9): [True: 0, False: 147k]
  ------------------
 5237|      0|            break;
 5238|   147k|    }
 5239|       |
 5240|   147k|    return(0);
 5241|   147k|}
xmlNodeGetContent:
 5258|   685k|{
 5259|   685k|    xmlBufPtr buf;
 5260|   685k|    xmlChar *ret;
 5261|       |
 5262|   685k|    if (cur == NULL)
  ------------------
  |  Branch (5262:9): [True: 0, False: 685k]
  ------------------
 5263|      0|        return (NULL);
 5264|       |
 5265|   685k|    switch (cur->type) {
 5266|  81.0k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5266:9): [True: 81.0k, False: 604k]
  ------------------
 5267|  81.0k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 0, False: 685k]
  ------------------
 5268|  81.0k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5268:9): [True: 0, False: 685k]
  ------------------
 5269|  81.0k|            break;
 5270|       |
 5271|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5271:9): [True: 0, False: 685k]
  ------------------
 5272|   283k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5272:9): [True: 283k, False: 402k]
  ------------------
 5273|   574k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5273:9): [True: 291k, False: 394k]
  ------------------
 5274|   574k|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5274:9): [True: 0, False: 685k]
  ------------------
 5275|   574k|            xmlNodePtr children = cur->children;
 5276|       |
 5277|   574k|            if (children == NULL)
  ------------------
  |  Branch (5277:17): [True: 217k, False: 356k]
  ------------------
 5278|   217k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   217k|#define BAD_CAST (xmlChar *)
  ------------------
 5279|       |
 5280|       |            /* Optimization for single text children */
 5281|   356k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5281:18): [True: 321k, False: 35.5k]
  ------------------
 5282|  35.5k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5282:18): [True: 3.25k, False: 32.3k]
  ------------------
 5283|   324k|                (children->next == NULL)) {
  ------------------
  |  Branch (5283:17): [True: 291k, False: 32.6k]
  ------------------
 5284|   291k|                if (children->content == NULL)
  ------------------
  |  Branch (5284:21): [True: 0, False: 291k]
  ------------------
 5285|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5286|   291k|                return(xmlStrdup(children->content));
 5287|   291k|            }
 5288|       |
 5289|  64.9k|            break;
 5290|   356k|        }
 5291|       |
 5292|  64.9k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5292:9): [True: 1.92k, False: 683k]
  ------------------
 5293|  27.4k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5293:9): [True: 25.5k, False: 659k]
  ------------------
 5294|  28.7k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5294:9): [True: 1.30k, False: 684k]
  ------------------
 5295|  29.3k|        case XML_PI_NODE:
  ------------------
  |  Branch (5295:9): [True: 589, False: 684k]
  ------------------
 5296|  29.3k|            if (cur->content != NULL)
  ------------------
  |  Branch (5296:17): [True: 28.7k, False: 589]
  ------------------
 5297|  28.7k|                return(xmlStrdup(cur->content));
 5298|    589|            else
 5299|    589|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    589|#define BAD_CAST (xmlChar *)
  ------------------
 5300|       |
 5301|    625|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5301:9): [True: 625, False: 684k]
  ------------------
 5302|    625|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5303|       |
 5304|      0|        default:
  ------------------
  |  Branch (5304:9): [True: 0, False: 685k]
  ------------------
 5305|      0|            return(NULL);
 5306|   685k|    }
 5307|       |
 5308|   145k|    buf = xmlBufCreate(50);
 5309|   145k|    if (buf == NULL)
  ------------------
  |  Branch (5309:9): [True: 62, False: 145k]
  ------------------
 5310|     62|        return (NULL);
 5311|   145k|    xmlBufGetNodeContent(buf, cur);
 5312|   145k|    ret = xmlBufDetach(buf);
 5313|   145k|    xmlBufFree(buf);
 5314|       |
 5315|   145k|    return(ret);
 5316|   145k|}
xmlNodeAddContentLen:
 5419|     59|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5420|     59|    if (cur == NULL)
  ------------------
  |  Branch (5420:9): [True: 0, False: 59]
  ------------------
 5421|      0|	return(1);
 5422|     59|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5422:9): [True: 0, False: 59]
  |  Branch (5422:30): [True: 19, False: 40]
  ------------------
 5423|     19|        return(0);
 5424|       |
 5425|     40|    switch (cur->type) {
 5426|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5426:9): [True: 0, False: 40]
  ------------------
 5427|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5427:9): [True: 0, False: 40]
  ------------------
 5428|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5428:9): [True: 0, False: 40]
  ------------------
 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|     40|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5442:9): [True: 40, False: 0]
  ------------------
 5443|     40|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5443:9): [True: 0, False: 40]
  ------------------
 5444|     40|        case XML_PI_NODE:
  ------------------
  |  Branch (5444:9): [True: 0, False: 40]
  ------------------
 5445|     40|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5445:9): [True: 0, False: 40]
  ------------------
 5446|     40|            return(xmlTextAddContent(cur, content, len));
 5447|      0|        default:
  ------------------
  |  Branch (5447:9): [True: 0, False: 40]
  ------------------
 5448|      0|            break;
 5449|     40|    }
 5450|       |
 5451|      0|    return(0);
 5452|     40|}
xmlGetNsListSafe:
 5518|  31.8k|{
 5519|  31.8k|    xmlNsPtr cur;
 5520|  31.8k|    xmlNsPtr *namespaces = NULL;
 5521|  31.8k|    int nbns = 0;
 5522|  31.8k|    int maxns = 0;
 5523|  31.8k|    int i;
 5524|       |
 5525|  31.8k|    if (out == NULL)
  ------------------
  |  Branch (5525:9): [True: 0, False: 31.8k]
  ------------------
 5526|      0|        return(1);
 5527|  31.8k|    *out = NULL;
 5528|  31.8k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5528:9): [True: 0, False: 31.8k]
  |  Branch (5528:27): [True: 0, False: 31.8k]
  ------------------
 5529|      0|        return(1);
 5530|       |
 5531|   274k|    while (node != NULL) {
  ------------------
  |  Branch (5531:12): [True: 242k, False: 31.8k]
  ------------------
 5532|   242k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5532:13): [True: 210k, False: 31.8k]
  ------------------
 5533|   210k|            cur = node->nsDef;
 5534|   262k|            while (cur != NULL) {
  ------------------
  |  Branch (5534:20): [True: 51.8k, False: 210k]
  ------------------
 5535|  74.0k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5535:29): [True: 22.9k, False: 51.1k]
  ------------------
 5536|  22.9k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5536:25): [True: 227, False: 22.7k]
  ------------------
 5537|  22.7k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5537:25): [True: 520, False: 22.1k]
  ------------------
 5538|    747|                        break;
 5539|  22.9k|                }
 5540|  51.8k|                if (i >= nbns) {
  ------------------
  |  Branch (5540:21): [True: 51.1k, False: 747]
  ------------------
 5541|  51.1k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5541:25): [True: 31.9k, False: 19.2k]
  ------------------
 5542|  31.9k|                        xmlNsPtr *tmp;
 5543|  31.9k|                        int newSize;
 5544|       |
 5545|  31.9k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5546|  31.9k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  31.9k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5547|  31.9k|                        if (newSize < 0) {
  ------------------
  |  Branch (5547:29): [True: 0, False: 31.9k]
  ------------------
 5548|      0|                            xmlFree(namespaces);
 5549|      0|                            return(-1);
 5550|      0|                        }
 5551|  31.9k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5552|  31.9k|                        if (newSize < 2)
  ------------------
  |  Branch (5552:29): [True: 30.4k, False: 1.47k]
  ------------------
 5553|  30.4k|                            newSize = 2;
 5554|  31.9k|#endif
 5555|  31.9k|                        tmp = xmlRealloc(namespaces,
 5556|  31.9k|                                         (newSize + 1) * sizeof(tmp[0]));
 5557|  31.9k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5557:29): [True: 5, False: 31.9k]
  ------------------
 5558|      5|                            xmlFree(namespaces);
 5559|      5|                            return(-1);
 5560|      5|                        }
 5561|  31.9k|                        namespaces = tmp;
 5562|  31.9k|                        maxns = newSize;
 5563|  31.9k|                    }
 5564|  51.1k|                    namespaces[nbns++] = cur;
 5565|  51.1k|                    namespaces[nbns] = NULL;
 5566|  51.1k|                }
 5567|       |
 5568|  51.8k|                cur = cur->next;
 5569|  51.8k|            }
 5570|   210k|        }
 5571|   242k|        node = node->parent;
 5572|   242k|    }
 5573|       |
 5574|  31.8k|    *out = namespaces;
 5575|  31.8k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5575:12): [True: 1.37k, False: 30.4k]
  ------------------
 5576|  31.8k|}
xmlSearchNsSafe:
 5655|  1.63M|                xmlNs **out) {
 5656|  1.63M|    xmlNsPtr cur;
 5657|  1.63M|    xmlDocPtr doc;
 5658|  1.63M|    xmlNodePtr orig = node;
 5659|  1.63M|    xmlNodePtr parent;
 5660|       |
 5661|  1.63M|    if (out == NULL)
  ------------------
  |  Branch (5661:9): [True: 0, False: 1.63M]
  ------------------
 5662|      0|        return(1);
 5663|  1.63M|    *out = NULL;
 5664|  1.63M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5664:9): [True: 0, False: 1.63M]
  |  Branch (5664:27): [True: 0, False: 1.63M]
  ------------------
 5665|      0|        return(1);
 5666|       |
 5667|  1.63M|    doc = node->doc;
 5668|       |
 5669|  1.63M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  1.63M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 848k, False: 786k]
  |  |  |  Branch (100:43): [True: 618k, False: 229k]
  |  |  ------------------
  |  |  101|  1.63M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 294k, False: 324k]
  |  |  |  Branch (101:22): [True: 293k, False: 1.37k]
  |  |  |  Branch (101:41): [True: 290k, False: 2.42k]
  |  |  ------------------
  ------------------
  |  Branch (5669:9): [True: 1.63M, False: 364]
  ------------------
 5670|   290k|        cur = xmlTreeEnsureXMLDecl(doc);
 5671|   290k|        if (cur == NULL)
  ------------------
  |  Branch (5671:13): [True: 29, False: 290k]
  ------------------
 5672|     29|            return(-1);
 5673|   290k|        *out = cur;
 5674|   290k|        return(0);
 5675|   290k|    }
 5676|       |
 5677|  1.34M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5677:12): [True: 15.0k, False: 1.33M]
  ------------------
 5678|  15.0k|        node = node->parent;
 5679|  15.0k|        if (node == NULL)
  ------------------
  |  Branch (5679:13): [True: 13.3k, False: 1.68k]
  ------------------
 5680|  13.3k|            return(0);
 5681|  15.0k|    }
 5682|       |
 5683|  1.33M|    parent = node;
 5684|       |
 5685|  40.0M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5685:12): [True: 39.9M, False: 61.9k]
  |  Branch (5685:30): [True: 39.6M, False: 361k]
  ------------------
 5686|  39.6M|        cur = node->nsDef;
 5687|  43.0M|        while (cur != NULL) {
  ------------------
  |  Branch (5687:16): [True: 4.23M, False: 38.8M]
  ------------------
 5688|  4.23M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5688:17): [True: 935k, False: 3.30M]
  ------------------
 5689|   935k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5689:17): [True: 807k, False: 127k]
  ------------------
 5690|   807k|                *out = cur;
 5691|   807k|                return(0);
 5692|   807k|            }
 5693|  3.42M|            cur = cur->next;
 5694|  3.42M|        }
 5695|  38.8M|        if (orig != node) {
  ------------------
  |  Branch (5695:13): [True: 37.9M, False: 841k]
  ------------------
 5696|  37.9M|            cur = node->ns;
 5697|  37.9M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5697:17): [True: 1.15M, False: 36.8M]
  ------------------
 5698|  1.15M|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5698:17): [True: 99.4k, False: 1.05M]
  ------------------
 5699|  99.4k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5699:17): [True: 99.4k, False: 0]
  ------------------
 5700|  99.4k|                *out = cur;
 5701|  99.4k|                return(0);
 5702|  99.4k|            }
 5703|  37.9M|        }
 5704|       |
 5705|  38.7M|	node = node->parent;
 5706|  38.7M|    }
 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|   423k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|    220|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 220, False: 0]
  |  |  |  Branch (100:43): [True: 220, False: 0]
  |  |  ------------------
  |  |  101|    220|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 220, False: 0]
  |  |  |  Branch (101:22): [True: 220, False: 0]
  |  |  |  Branch (101:41): [True: 220, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5713:9): [True: 220, False: 423k]
  ------------------
 5714|    220|        cur = xmlNewXmlNs();
 5715|    220|        if (cur == NULL)
  ------------------
  |  Branch (5715:13): [True: 1, False: 219]
  ------------------
 5716|      1|            return(-1);
 5717|    219|        cur->next = parent->nsDef;
 5718|    219|        parent->nsDef = cur;
 5719|    219|        *out = cur;
 5720|    219|    }
 5721|       |
 5722|   423k|    return(0);
 5723|   423k|}
xmlSearchNsByHrefSafe:
 5802|  4.81k|                      xmlNs **out) {
 5803|  4.81k|    xmlNsPtr cur;
 5804|  4.81k|    xmlDocPtr doc;
 5805|  4.81k|    xmlNodePtr orig = node;
 5806|  4.81k|    xmlNodePtr parent;
 5807|  4.81k|    int is_attr;
 5808|       |
 5809|  4.81k|    if (out == NULL)
  ------------------
  |  Branch (5809:9): [True: 0, False: 4.81k]
  ------------------
 5810|      0|        return(1);
 5811|  4.81k|    *out = NULL;
 5812|  4.81k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5812:9): [True: 0, False: 4.81k]
  |  Branch (5812:27): [True: 0, False: 4.81k]
  ------------------
 5813|      0|        return(1);
 5814|       |
 5815|  4.81k|    doc = node->doc;
 5816|       |
 5817|  4.81k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  4.81k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5817:9): [True: 4.81k, False: 0]
  |  Branch (5817:26): [True: 2.76k, False: 2.05k]
  ------------------
 5818|  2.76k|        cur = xmlTreeEnsureXMLDecl(doc);
 5819|  2.76k|        if (cur == NULL)
  ------------------
  |  Branch (5819:13): [True: 2, False: 2.76k]
  ------------------
 5820|      2|            return(-1);
 5821|  2.76k|        *out = cur;
 5822|  2.76k|        return(0);
 5823|  2.76k|    }
 5824|       |
 5825|  2.05k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5826|       |
 5827|  2.05k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5827:12): [True: 0, False: 2.05k]
  ------------------
 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|  2.05k|    parent = node;
 5834|       |
 5835|  37.9k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5835:12): [True: 37.2k, False: 728]
  |  Branch (5835:30): [True: 37.2k, False: 0]
  ------------------
 5836|  37.2k|        cur = node->nsDef;
 5837|  58.0k|        while (cur != NULL) {
  ------------------
  |  Branch (5837:16): [True: 21.7k, False: 36.2k]
  ------------------
 5838|  21.7k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5838:17): [True: 5.69k, False: 16.0k]
  ------------------
 5839|  5.69k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5839:22): [True: 5.69k, False: 0]
  |  Branch (5839:36): [True: 0, False: 0]
  ------------------
 5840|  5.69k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5840:21): [True: 908, False: 4.79k]
  ------------------
 5841|    908|                    *out = cur;
 5842|    908|                    return(0);
 5843|    908|                }
 5844|  5.69k|            }
 5845|  20.8k|            cur = cur->next;
 5846|  20.8k|        }
 5847|  36.2k|        if (orig != node) {
  ------------------
  |  Branch (5847:13): [True: 34.3k, False: 1.90k]
  ------------------
 5848|  34.3k|            cur = node->ns;
 5849|  34.3k|            if (cur != NULL) {
  ------------------
  |  Branch (5849:17): [True: 31.3k, False: 3.06k]
  ------------------
 5850|  31.3k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5850:21): [True: 7.39k, False: 23.9k]
  ------------------
 5851|  7.39k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5851:26): [True: 7.39k, False: 0]
  |  Branch (5851:40): [True: 0, False: 0]
  ------------------
 5852|  7.39k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5852:25): [True: 416, False: 6.97k]
  ------------------
 5853|  7.39k|                                      cur->prefix) == 1)) {
 5854|    416|                        *out = cur;
 5855|    416|                        return(0);
 5856|    416|                    }
 5857|  7.39k|                }
 5858|  31.3k|            }
 5859|  34.3k|        }
 5860|       |
 5861|  35.8k|        node = node->parent;
 5862|  35.8k|    }
 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|    728|    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: 728]
  |  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|    728|    return(0);
 5879|    728|}
xmlNodeGetAttrValue:
 6356|  11.3M|                    const xmlChar *nsUri, xmlChar **out) {
 6357|  11.3M|    xmlAttrPtr prop;
 6358|       |
 6359|  11.3M|    if (out == NULL)
  ------------------
  |  Branch (6359:9): [True: 0, False: 11.3M]
  ------------------
 6360|      0|        return(1);
 6361|  11.3M|    *out = NULL;
 6362|       |
 6363|  11.3M|    prop = xmlGetPropNodeInternal(node, name, nsUri, 0);
 6364|  11.3M|    if (prop == NULL)
  ------------------
  |  Branch (6364:9): [True: 11.1M, False: 286k]
  ------------------
 6365|  11.1M|	return(1);
 6366|       |
 6367|   286k|    *out = xmlGetPropNodeValueInternal(prop);
 6368|   286k|    if (*out == NULL)
  ------------------
  |  Branch (6368:9): [True: 241, False: 286k]
  ------------------
 6369|    241|        return(-1);
 6370|   286k|    return(0);
 6371|   286k|}
xmlUnsetProp:
 6473|    162|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6474|    162|    xmlAttrPtr prop;
 6475|       |
 6476|    162|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6477|    162|    if (prop == NULL)
  ------------------
  |  Branch (6477:9): [True: 30, False: 132]
  ------------------
 6478|     30|	return(-1);
 6479|    132|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6480|    132|    xmlFreeProp(prop);
 6481|    132|    return(0);
 6482|    162|}
xmlUnsetNsProp:
 6493|  33.7k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6494|  33.7k|    xmlAttrPtr prop;
 6495|       |
 6496|  33.7k|    prop = xmlGetPropNodeInternal(node, name,
 6497|  33.7k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6497:35): [True: 33.7k, False: 0]
  ------------------
 6498|  33.7k|    if (prop == NULL)
  ------------------
  |  Branch (6498:9): [True: 32.3k, False: 1.35k]
  ------------------
 6499|  32.3k|	return(-1);
 6500|  1.35k|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6501|  1.35k|    xmlFreeProp(prop);
 6502|  1.35k|    return(0);
 6503|  33.7k|}
xmlSetNsProp:
 6558|  2.76k|{
 6559|  2.76k|    xmlAttrPtr prop;
 6560|       |
 6561|  2.76k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6561:9): [True: 2.76k, False: 0]
  |  Branch (6561:15): [True: 0, False: 2.76k]
  ------------------
 6562|      0|	return(NULL);
 6563|  2.76k|    if (name == NULL)
  ------------------
  |  Branch (6563:9): [True: 0, False: 2.76k]
  ------------------
 6564|      0|        return(NULL);
 6565|  2.76k|    prop = xmlGetPropNodeInternal(node, name,
 6566|  2.76k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6566:35): [True: 2.76k, False: 0]
  ------------------
 6567|  2.76k|    if (prop != NULL) {
  ------------------
  |  Branch (6567:9): [True: 1.60k, False: 1.15k]
  ------------------
 6568|  1.60k|        xmlNodePtr children = NULL;
 6569|       |
 6570|       |	/*
 6571|       |	* Modify the attribute's value.
 6572|       |	*/
 6573|  1.60k|        if (value != NULL) {
  ------------------
  |  Branch (6573:13): [True: 1.60k, False: 0]
  ------------------
 6574|  1.60k|	    children = xmlNewDocText(node->doc, value);
 6575|  1.60k|            if (children == NULL)
  ------------------
  |  Branch (6575:17): [True: 7, False: 1.59k]
  ------------------
 6576|      7|                return(NULL);
 6577|  1.60k|        }
 6578|       |
 6579|  1.59k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6579:6): [True: 0, False: 1.59k]
  ------------------
 6580|      0|	    xmlRemoveID(node->doc, prop);
 6581|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6582|      0|	}
 6583|  1.59k|	if (prop->children != NULL)
  ------------------
  |  Branch (6583:6): [True: 1.57k, False: 21]
  ------------------
 6584|  1.57k|	    xmlFreeNodeList(prop->children);
 6585|  1.59k|	prop->children = NULL;
 6586|  1.59k|	prop->last = NULL;
 6587|  1.59k|	prop->ns = ns;
 6588|  1.59k|	if (value != NULL) {
  ------------------
  |  Branch (6588:6): [True: 1.59k, False: 0]
  ------------------
 6589|  1.59k|	    xmlNodePtr tmp;
 6590|       |
 6591|  1.59k|	    prop->children = children;
 6592|  1.59k|	    prop->last = NULL;
 6593|  1.59k|	    tmp = prop->children;
 6594|  3.19k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6594:13): [True: 1.59k, False: 1.59k]
  ------------------
 6595|  1.59k|		tmp->parent = (xmlNodePtr) prop;
 6596|  1.59k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6596:7): [True: 1.59k, False: 0]
  ------------------
 6597|  1.59k|		    prop->last = tmp;
 6598|  1.59k|		tmp = tmp->next;
 6599|  1.59k|	    }
 6600|  1.59k|	}
 6601|  1.59k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6601:6): [True: 0, False: 1.59k]
  ------------------
 6602|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6602:6): [True: 0, False: 0]
  ------------------
 6603|      0|            return(NULL);
 6604|      0|        }
 6605|  1.59k|	return(prop);
 6606|  1.59k|    }
 6607|       |    /*
 6608|       |    * No equal attr found; create a new one.
 6609|       |    */
 6610|  1.15k|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6611|  2.76k|}
xmlNodeIsText:
 6620|  5.05k|xmlNodeIsText(const xmlNode *node) {
 6621|  5.05k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6621:9): [True: 0, False: 5.05k]
  ------------------
 6622|       |
 6623|  5.05k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6623:9): [True: 1.02k, False: 4.03k]
  ------------------
 6624|  4.03k|    return(0);
 6625|  5.05k|}
xmlIsBlankNode:
 6635|  9.77k|xmlIsBlankNode(const xmlNode *node) {
 6636|  9.77k|    const xmlChar *cur;
 6637|  9.77k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6637:9): [True: 0, False: 9.77k]
  ------------------
 6638|       |
 6639|  9.77k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6639:9): [True: 295, False: 9.48k]
  ------------------
 6640|    295|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6640:9): [True: 295, False: 0]
  ------------------
 6641|    295|	return(0);
 6642|  9.48k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6642:9): [True: 88, False: 9.39k]
  ------------------
 6643|  9.39k|    cur = node->content;
 6644|  57.1k|    while (*cur != 0) {
  ------------------
  |  Branch (6644:12): [True: 54.3k, False: 2.87k]
  ------------------
 6645|  54.3k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  54.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  54.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 39.2k, False: 15.0k]
  |  |  |  |  ------------------
  |  |  |  |   91|  54.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 14.8k, False: 239]
  |  |  |  |  |  Branch (91:23): [True: 8.17k, False: 6.67k]
  |  |  |  |  ------------------
  |  |  |  |   92|  54.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 400, False: 6.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|  47.7k|	cur++;
 6647|  47.7k|    }
 6648|       |
 6649|  2.87k|    return(1);
 6650|  9.39k|}
xmlIsXHTML:
 8851|  27.0k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8852|  27.0k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8852:9): [True: 8.97k, False: 18.0k]
  |  Branch (8852:31): [True: 8.97k, False: 0]
  ------------------
 8853|  8.97k|	return(-1);
 8854|  18.0k|    if (publicID != NULL) {
  ------------------
  |  Branch (8854:9): [True: 17.2k, False: 815]
  ------------------
 8855|  17.2k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8830|  17.2k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  17.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8831|  17.2k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8855:6): [True: 452, False: 16.7k]
  ------------------
 8856|  16.7k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8834|  16.7k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  16.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8835|  16.7k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8856:6): [True: 6.18k, False: 10.5k]
  ------------------
 8857|  10.5k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8838|  10.5k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.5k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8839|  10.5k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8857:6): [True: 1.10k, False: 9.49k]
  ------------------
 8858|  10.5k|    }
 8859|  10.3k|    if (systemID != NULL) {
  ------------------
  |  Branch (8859:9): [True: 10.3k, False: 0]
  ------------------
 8860|  10.3k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8832|  10.3k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.3k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8833|  10.3k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8860:6): [True: 7.67k, False: 2.63k]
  ------------------
 8861|  2.63k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8836|  2.63k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  2.63k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8837|  2.63k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8861:6): [True: 719, False: 1.91k]
  ------------------
 8862|  1.91k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8840|  1.91k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.91k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8841|  1.91k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8862:6): [True: 539, False: 1.37k]
  ------------------
 8863|  1.91k|    }
 8864|  1.37k|    return(0);
 8865|  10.3k|}
tree.c:xmlNewPropInternal:
 1435|  66.2k|{
 1436|  66.2k|    xmlAttrPtr cur;
 1437|  66.2k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  66.2k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 66.2k, False: 0]
  |  Branch (1439:27): [True: 0, False: 66.2k]
  ------------------
 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|  66.2k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  66.2k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 24, False: 66.2k]
  ------------------
 1452|     24|        if ((eatname == 1) &&
  ------------------
  |  Branch (1452:13): [True: 0, False: 24]
  ------------------
 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|     24|        return (NULL);
 1458|     24|    }
 1459|  66.2k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  66.2k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  66.2k|    cur->parent = node;
 1463|  66.2k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 66.2k, False: 0]
  ------------------
 1464|  66.2k|        doc = node->doc;
 1465|  66.2k|        cur->doc = doc;
 1466|  66.2k|    }
 1467|  66.2k|    cur->ns = ns;
 1468|       |
 1469|  66.2k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 66.2k, False: 0]
  ------------------
 1470|  66.2k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 66.2k, False: 0]
  |  Branch (1470:30): [True: 30.5k, False: 35.7k]
  ------------------
 1471|  30.5k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  35.7k|        else
 1473|  35.7k|            cur->name = xmlStrdup(name);
 1474|  66.2k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 10, False: 66.2k]
  ------------------
 1475|     10|            goto error;
 1476|  66.2k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  66.2k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 1.15k, False: 65.1k]
  ------------------
 1480|  1.15k|        xmlNodePtr tmp;
 1481|       |
 1482|  1.15k|        cur->children = xmlNewDocText(doc, value);
 1483|  1.15k|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 5, False: 1.15k]
  ------------------
 1484|      5|            goto error;
 1485|  1.15k|        cur->last = NULL;
 1486|  1.15k|        tmp = cur->children;
 1487|  2.30k|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 1.15k, False: 1.15k]
  ------------------
 1488|  1.15k|            tmp->parent = (xmlNodePtr) cur;
 1489|  1.15k|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 1.15k, False: 0]
  ------------------
 1490|  1.15k|                cur->last = tmp;
 1491|  1.15k|            tmp = tmp->next;
 1492|  1.15k|        }
 1493|       |
 1494|  1.15k|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 1.15k, False: 0]
  ------------------
 1495|  1.15k|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|  1.15k|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 2, False: 1.14k]
  ------------------
 1498|      2|                goto error;
 1499|  1.14k|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 1.14k]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|  1.14k|        }
 1502|  1.15k|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  66.2k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 66.2k, False: 0]
  ------------------
 1508|  66.2k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 46.9k, False: 19.3k]
  ------------------
 1509|  46.9k|            node->properties = cur;
 1510|  46.9k|        } else {
 1511|  19.3k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   100k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 81.3k, False: 19.3k]
  ------------------
 1514|  81.3k|                prev = prev->next;
 1515|  19.3k|            prev->next = cur;
 1516|  19.3k|            cur->prev = prev;
 1517|  19.3k|        }
 1518|  66.2k|    }
 1519|       |
 1520|  66.2k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 66.2k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  66.2k|    return (cur);
 1523|       |
 1524|     17|error:
 1525|     17|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  66.2k|}
tree.c:xmlNewElem:
 1842|   840k|           const xmlChar *content) {
 1843|   840k|    xmlNodePtr cur;
 1844|       |
 1845|   840k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   840k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 103, False: 840k]
  ------------------
 1847|    103|	return(NULL);
 1848|   840k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   840k|    cur->type = XML_ELEMENT_NODE;
 1851|   840k|    cur->doc = doc;
 1852|   840k|    cur->name = name;
 1853|   840k|    cur->ns = ns;
 1854|       |
 1855|   840k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 840k]
  ------------------
 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|   840k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 840k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   840k|    return(cur);
 1872|   840k|}
tree.c:xmlNewEntityRef:
 2137|  35.7k|xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) {
 2138|  35.7k|    xmlNodePtr cur;
 2139|       |
 2140|       |    /*
 2141|       |     * Allocate a new node and fill the fields.
 2142|       |     */
 2143|  35.7k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2144|  35.7k|    if (cur == NULL) {
  ------------------
  |  Branch (2144:9): [True: 8, False: 35.7k]
  ------------------
 2145|      8|        xmlFree(name);
 2146|      8|	return(NULL);
 2147|      8|    }
 2148|  35.7k|    memset(cur, 0, sizeof(xmlNode));
 2149|  35.7k|    cur->type = XML_ENTITY_REF_NODE;
 2150|  35.7k|    cur->doc = doc;
 2151|  35.7k|    cur->name = name;
 2152|       |
 2153|  35.7k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2153:9): [True: 0, False: 35.7k]
  |  Branch (2153:35): [True: 0, False: 0]
  ------------------
 2154|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2155|       |
 2156|  35.7k|    return(cur);
 2157|  35.7k|}
tree.c:xmlInsertNode:
 2791|   247k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   247k|    xmlNodePtr oldParent;
 2793|       |
 2794|   247k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 247k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   247k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 247k]
  |  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|   247k|    oldParent = cur->parent;
 2829|   247k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 247k]
  ------------------
 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|   247k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 229k, False: 18.4k]
  ------------------
 2836|   229k|        cur->next->prev = cur->prev;
 2837|   247k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 247k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   247k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 247k]
  ------------------
 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|   247k|    cur->parent = parent;
 2857|   247k|    cur->prev = prev;
 2858|   247k|    cur->next = next;
 2859|       |
 2860|   247k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 247k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   247k|    } else {
 2864|   247k|        prev->next = cur;
 2865|   247k|    }
 2866|   247k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 1.12k, False: 246k]
  ------------------
 2867|  1.12k|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 1.12k, False: 0]
  ------------------
 2868|  1.12k|            parent->last = cur;
 2869|   246k|    } else {
 2870|   246k|        next->prev = cur;
 2871|   246k|    }
 2872|       |
 2873|   247k|    return(cur);
 2874|   247k|}
tree.c:xmlTextSetContent:
 2717|     39|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     39|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 39]
  ------------------
 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|     39|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     39|}
tree.c:xmlTextAddContent:
 2733|     40|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     40|    xmlChar *merged;
 2735|       |
 2736|     40|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 40]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     40|    merged = xmlStrncatNew(text->content, content, len);
 2740|     40|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 1, False: 39]
  ------------------
 2741|      1|        return(-1);
 2742|       |
 2743|     39|    xmlTextSetContent(text, merged);
 2744|     39|    return(0);
 2745|     40|}
tree.c:xmlUnlinkNodeInternal:
 3485|   443k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|   443k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 402k, False: 41.4k]
  ------------------
 3487|   402k|	xmlNodePtr parent;
 3488|   402k|	parent = cur->parent;
 3489|   402k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 1.48k, False: 400k]
  ------------------
 3490|  1.48k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 1.41k, False: 71]
  ------------------
 3491|  1.41k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|   400k|	} else {
 3493|   400k|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 200k, False: 200k]
  ------------------
 3494|   200k|		parent->children = cur->next;
 3495|   400k|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 42.2k, False: 358k]
  ------------------
 3496|  42.2k|		parent->last = cur->prev;
 3497|   400k|	}
 3498|   402k|	cur->parent = NULL;
 3499|   402k|    }
 3500|       |
 3501|   443k|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 359k, False: 84.7k]
  ------------------
 3502|   359k|        cur->next->prev = cur->prev;
 3503|   443k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 200k, False: 243k]
  ------------------
 3504|   200k|        cur->prev->next = cur->next;
 3505|   443k|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|   443k|}
tree.c:xmlCopyPropInternal:
 3660|  1.74M|xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
 3661|  1.74M|    xmlAttrPtr ret = NULL;
 3662|       |
 3663|  1.74M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3663:9): [True: 0, False: 1.74M]
  ------------------
 3664|  1.74M|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3664:9): [True: 1.74M, False: 0]
  |  Branch (3664:29): [True: 0, False: 1.74M]
  ------------------
 3665|      0|        return(NULL);
 3666|  1.74M|    if (target != NULL)
  ------------------
  |  Branch (3666:9): [True: 1.74M, False: 0]
  ------------------
 3667|  1.74M|	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|  1.74M|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (3676:9): [True: 4.93k, False: 1.74M]
  ------------------
 3677|  1.74M|    ret->parent = target;
 3678|       |
 3679|  1.74M|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3679:9): [True: 180k, False: 1.56M]
  |  Branch (3679:30): [True: 180k, False: 0]
  ------------------
 3680|   180k|      xmlNsPtr ns;
 3681|   180k|      int res;
 3682|       |
 3683|   180k|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3684|   180k|      if (res < 0)
  ------------------
  |  Branch (3684:11): [True: 2, False: 180k]
  ------------------
 3685|      2|          goto error;
 3686|   180k|      if (ns == NULL) {
  ------------------
  |  Branch (3686:11): [True: 627, False: 179k]
  ------------------
 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|    627|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3693|    627|        if (res < 0)
  ------------------
  |  Branch (3693:13): [True: 0, False: 627]
  ------------------
 3694|      0|          goto error;
 3695|    627|        if (ns != NULL) {
  ------------------
  |  Branch (3695:13): [True: 627, False: 0]
  ------------------
 3696|    627|          xmlNodePtr root = target;
 3697|    627|          xmlNodePtr pred = NULL;
 3698|       |
 3699|    839|          while (root->parent != NULL) {
  ------------------
  |  Branch (3699:18): [True: 212, False: 627]
  ------------------
 3700|    212|            pred = root;
 3701|    212|            root = root->parent;
 3702|    212|          }
 3703|    627|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3703:15): [True: 0, False: 627]
  ------------------
 3704|       |            /* correct possibly cycling above the document elt */
 3705|      0|            root = pred;
 3706|      0|          }
 3707|    627|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3708|    627|          if (ret->ns == NULL)
  ------------------
  |  Branch (3708:15): [True: 1, False: 626]
  ------------------
 3709|      1|              goto error;
 3710|    627|        }
 3711|   179k|      } 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|   179k|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3717:13): [True: 177k, False: 2.05k]
  ------------------
 3718|       |          /* this is the nice case */
 3719|   177k|          ret->ns = ns;
 3720|   177k|        } else {
 3721|       |          /*
 3722|       |           * we are in trouble: we need a new reconciled namespace.
 3723|       |           * This is expensive
 3724|       |           */
 3725|  2.05k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3726|  2.05k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3726:15): [True: 1, False: 2.05k]
  ------------------
 3727|      1|              goto error;
 3728|  2.05k|        }
 3729|   179k|      }
 3730|       |
 3731|   180k|    } else
 3732|  1.56M|        ret->ns = NULL;
 3733|       |
 3734|  1.74M|    if (cur->children != NULL) {
  ------------------
  |  Branch (3734:9): [True: 1.73M, False: 9.31k]
  ------------------
 3735|  1.73M|	xmlNodePtr tmp;
 3736|       |
 3737|  1.73M|	ret->children = xmlStaticCopyNodeList(cur->children, ret->doc, (xmlNodePtr) ret);
 3738|  1.73M|        if (ret->children == NULL)
  ------------------
  |  Branch (3738:13): [True: 47, False: 1.73M]
  ------------------
 3739|     47|            goto error;
 3740|  1.73M|	ret->last = NULL;
 3741|  1.73M|	tmp = ret->children;
 3742|  3.46M|	while (tmp != NULL) {
  ------------------
  |  Branch (3742:9): [True: 1.73M, False: 1.73M]
  ------------------
 3743|       |	    /* tmp->parent = (xmlNodePtr)ret; */
 3744|  1.73M|	    if (tmp->next == NULL)
  ------------------
  |  Branch (3744:10): [True: 1.73M, False: 561]
  ------------------
 3745|  1.73M|	        ret->last = tmp;
 3746|  1.73M|	    tmp = tmp->next;
 3747|  1.73M|	}
 3748|  1.73M|    }
 3749|       |    /*
 3750|       |     * Try to handle IDs
 3751|       |     */
 3752|  1.74M|    if ((target != NULL) && (cur != NULL) &&
  ------------------
  |  Branch (3752:9): [True: 1.74M, False: 0]
  |  Branch (3752:29): [True: 1.74M, False: 0]
  ------------------
 3753|  1.74M|	(target->doc != NULL) && (cur->doc != NULL) &&
  ------------------
  |  Branch (3753:2): [True: 1.74M, False: 245]
  |  Branch (3753:27): [True: 1.74M, False: 0]
  ------------------
 3754|  1.74M|        (cur->parent != NULL) &&
  ------------------
  |  Branch (3754:9): [True: 1.74M, False: 0]
  ------------------
 3755|  1.74M|        (cur->children != NULL)) {
  ------------------
  |  Branch (3755:9): [True: 1.73M, False: 9.31k]
  ------------------
 3756|  1.73M|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3757|       |
 3758|  1.73M|        if (res < 0)
  ------------------
  |  Branch (3758:13): [True: 4, False: 1.73M]
  ------------------
 3759|      4|            goto error;
 3760|  1.73M|	if (res != 0) {
  ------------------
  |  Branch (3760:6): [True: 3.79k, False: 1.72M]
  ------------------
 3761|  3.79k|	    xmlChar *id;
 3762|       |
 3763|  3.79k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3764|  3.79k|	    if (id == NULL)
  ------------------
  |  Branch (3764:10): [True: 3, False: 3.79k]
  ------------------
 3765|      3|                goto error;
 3766|  3.79k|            res = xmlAddIDSafe(ret, id);
 3767|  3.79k|	    xmlFree(id);
 3768|  3.79k|            if (res < 0)
  ------------------
  |  Branch (3768:17): [True: 11, False: 3.78k]
  ------------------
 3769|     11|                goto error;
 3770|  3.79k|	}
 3771|  1.73M|    }
 3772|  1.74M|    return(ret);
 3773|       |
 3774|     69|error:
 3775|     69|    xmlFreeProp(ret);
 3776|       |    return(NULL);
 3777|  1.74M|}
tree.c:xmlGetEntityFromDtd:
  119|  3.32k|xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  120|  3.32k|    xmlEntitiesTablePtr table;
  121|       |
  122|  3.32k|    if((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (122:8): [True: 3.32k, False: 0]
  |  Branch (122:25): [True: 3.32k, False: 0]
  ------------------
  123|  3.32k|	table = (xmlEntitiesTablePtr) dtd->entities;
  124|  3.32k|	return((xmlEntityPtr) xmlHashLookup(table, name));
  125|       |	/* return(xmlGetEntityFromTable(table, name)); */
  126|  3.32k|    }
  127|      0|    return(NULL);
  128|  3.32k|}
tree.c:xmlGetParameterEntityFromDtd:
  137|    421|xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  138|    421|    xmlEntitiesTablePtr table;
  139|       |
  140|    421|    if ((dtd != NULL) && (dtd->pentities != NULL)) {
  ------------------
  |  Branch (140:9): [True: 421, False: 0]
  |  Branch (140:26): [True: 421, False: 0]
  ------------------
  141|    421|	table = (xmlEntitiesTablePtr) dtd->pentities;
  142|    421|	return((xmlEntityPtr) xmlHashLookup(table, name));
  143|       |	/* return(xmlGetEntityFromTable(table, name)); */
  144|    421|    }
  145|      0|    return(NULL);
  146|    421|}
tree.c:xmlGetLineNoInternal:
 4398|  60.5k|{
 4399|  60.5k|    long result = -1;
 4400|       |
 4401|  60.5k|    if (depth >= 5)
  ------------------
  |  Branch (4401:9): [True: 5.53k, False: 55.0k]
  ------------------
 4402|  5.53k|        return(-1);
 4403|       |
 4404|  55.0k|    if (!node)
  ------------------
  |  Branch (4404:9): [True: 0, False: 55.0k]
  ------------------
 4405|      0|        return result;
 4406|  55.0k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4406:9): [True: 44.7k, False: 10.3k]
  ------------------
 4407|  10.3k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4407:9): [True: 8.82k, False: 1.51k]
  ------------------
 4408|  1.51k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4408:2): [True: 212, False: 1.29k]
  ------------------
 4409|  54.1k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4409:2): [True: 446, False: 852]
  ------------------
 4410|  54.1k|	if (node->line == 65535) {
  ------------------
  |  Branch (4410:6): [True: 39.7k, False: 14.4k]
  ------------------
 4411|  39.7k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4411:10): [True: 8.82k, False: 30.8k]
  |  Branch (4411:43): [True: 2.72k, False: 6.09k]
  ------------------
 4412|  2.72k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  2.72k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4413|  36.9k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4413:15): [True: 30.2k, False: 6.75k]
  ------------------
 4414|  30.2k|	             (node->children != NULL))
  ------------------
  |  Branch (4414:15): [True: 2.99k, False: 27.2k]
  ------------------
 4415|  2.99k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4416|  33.9k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4416:15): [True: 10.8k, False: 23.1k]
  ------------------
 4417|  10.8k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4418|  23.1k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4418:15): [True: 17.7k, False: 5.34k]
  ------------------
 4419|  17.7k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4420|  39.7k|	}
 4421|  54.1k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4421:6): [True: 25.3k, False: 28.8k]
  |  Branch (4421:24): [True: 22.6k, False: 6.13k]
  ------------------
 4422|  48.0k|	    result = node->line;
 4423|  54.1k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4423:16): [True: 757, False: 95]
  ------------------
 4424|    757|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4424:15): [True: 224, False: 533]
  ------------------
 4425|    533|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4425:8): [True: 267, False: 266]
  ------------------
 4426|    266|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4426:8): [True: 0, False: 266]
  ------------------
 4427|    266|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4427:8): [True: 69, False: 197]
  ------------------
 4428|    560|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4429|    292|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4429:14): [True: 292, False: 0]
  ------------------
 4430|    292|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4430:14): [True: 280, False: 12]
  ------------------
 4431|    280|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4432|       |
 4433|  55.0k|    return result;
 4434|  55.0k|}
tree.c:xmlBufGetChildContent:
 5157|   149k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree, int normalize) {
 5158|   149k|    const xmlNode *cur = tree->children;
 5159|       |
 5160|  33.6M|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 33.6M, False: 1.47k]
  ------------------
 5161|  33.6M|        switch (cur->type) {
 5162|  4.35M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 4.35M, False: 29.2M]
  ------------------
 5163|  4.39M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 38.9k, False: 33.5M]
  ------------------
 5164|  4.39M|                if (normalize)
  ------------------
  |  Branch (5164:21): [True: 2.06k, False: 4.39M]
  ------------------
 5165|  2.06k|                    xmlBufCat(buf, xmlAttrNormalize(cur->content));
 5166|  4.39M|                else
 5167|  4.39M|                    xmlBufCat(buf, cur->content);
 5168|  4.39M|                break;
 5169|       |
 5170|  2.44k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5170:13): [True: 2.44k, False: 33.6M]
  ------------------
 5171|  2.44k|                xmlBufGetEntityRefContent(buf, cur, normalize);
 5172|  2.44k|                break;
 5173|       |
 5174|  29.2M|            default:
  ------------------
  |  Branch (5174:13): [True: 29.2M, False: 4.39M]
  ------------------
 5175|  29.2M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5175:21): [True: 14.1M, False: 15.0M]
  ------------------
 5176|  14.1M|                    cur = cur->children;
 5177|  14.1M|                    continue;
 5178|  14.1M|                }
 5179|  15.0M|                break;
 5180|  33.6M|        }
 5181|       |
 5182|  33.6M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5182:16): [True: 14.3M, False: 19.2M]
  ------------------
 5183|  14.3M|            cur = cur->parent;
 5184|  14.3M|            if (cur == tree)
  ------------------
  |  Branch (5184:17): [True: 148k, False: 14.1M]
  ------------------
 5185|   148k|                return;
 5186|  14.3M|        }
 5187|  19.2M|        cur = cur->next;
 5188|  19.2M|    }
 5189|   149k|}
tree.c:xmlBufGetEntityRefContent:
 5126|  3.15k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref, int normalize) {
 5127|  3.15k|    xmlEntityPtr ent;
 5128|       |
 5129|  3.15k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5129:9): [True: 2.68k, False: 471]
  ------------------
 5130|  2.68k|        ent = (xmlEntityPtr) ref->children;
 5131|  2.68k|    } else {
 5132|       |        /* lookup entity declaration */
 5133|    471|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5134|    471|        if (ent == NULL)
  ------------------
  |  Branch (5134:13): [True: 471, False: 0]
  ------------------
 5135|    471|            return;
 5136|    471|    }
 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.68k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5143:9): [True: 0, False: 2.68k]
  ------------------
 5144|      0|        xmlBufCat(buf, ent->content);
 5145|      0|        return;
 5146|      0|    }
 5147|       |
 5148|  2.68k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.68k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5148:9): [True: 0, False: 2.68k]
  ------------------
 5149|      0|        return;
 5150|       |
 5151|  2.68k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.68k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.68k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent, normalize);
 5153|  2.68k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.68k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5154|  2.68k|}
tree.c:xmlTreeEnsureXMLDecl:
 5631|   293k|{
 5632|   293k|    xmlNsPtr ns;
 5633|       |
 5634|   293k|    ns = doc->oldNs;
 5635|   293k|    if (ns != NULL)
  ------------------
  |  Branch (5635:9): [True: 287k, False: 5.76k]
  ------------------
 5636|   287k|	return (ns);
 5637|       |
 5638|  5.76k|    ns = xmlNewXmlNs();
 5639|  5.76k|    doc->oldNs = ns;
 5640|       |
 5641|  5.76k|    return(ns);
 5642|   293k|}
tree.c:xmlNewXmlNs:
 5599|  5.98k|xmlNewXmlNs(void) {
 5600|  5.98k|    xmlNsPtr ns;
 5601|       |
 5602|  5.98k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5603|  5.98k|    if (ns == NULL)
  ------------------
  |  Branch (5603:9): [True: 9, False: 5.97k]
  ------------------
 5604|      9|        return(NULL);
 5605|  5.97k|    memset(ns, 0, sizeof(xmlNs));
 5606|  5.97k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  5.97k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5607|  5.97k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  5.97k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5608|  5.97k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5608:9): [True: 13, False: 5.95k]
  ------------------
 5609|     13|        xmlFreeNs(ns);
 5610|     13|        return(NULL);
 5611|     13|    }
 5612|  5.95k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  5.95k|#define BAD_CAST (xmlChar *)
  ------------------
 5613|  5.95k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5613:9): [True: 10, False: 5.94k]
  ------------------
 5614|     10|        xmlFreeNs(ns);
 5615|     10|        return(NULL);
 5616|     10|    }
 5617|       |
 5618|  5.94k|    return(ns);
 5619|  5.95k|}
tree.c:xmlNsInScope:
 5764|  13.0k|{
 5765|  13.0k|    xmlNsPtr tst;
 5766|       |
 5767|  56.3k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5767:12): [True: 56.3k, False: 0]
  |  Branch (5767:30): [True: 55.0k, False: 1.32k]
  ------------------
 5768|  55.0k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5768:13): [True: 0, False: 55.0k]
  ------------------
 5769|  55.0k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5769:13): [True: 0, False: 55.0k]
  ------------------
 5770|      0|            return (-1);
 5771|  55.0k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5771:13): [True: 55.0k, False: 0]
  ------------------
 5772|  55.0k|            tst = node->nsDef;
 5773|  77.8k|            while (tst != NULL) {
  ------------------
  |  Branch (5773:20): [True: 34.5k, False: 43.2k]
  ------------------
 5774|  34.5k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5774:21): [True: 4.48k, False: 30.0k]
  ------------------
 5775|  4.48k|                    && (prefix == NULL))
  ------------------
  |  Branch (5775:24): [True: 2.02k, False: 2.46k]
  ------------------
 5776|  2.02k|                    return (0);
 5777|  32.4k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5777:21): [True: 30.0k, False: 2.46k]
  ------------------
 5778|  30.0k|                    && (prefix != NULL)
  ------------------
  |  Branch (5778:24): [True: 20.6k, False: 9.33k]
  ------------------
 5779|  20.6k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5779:24): [True: 9.74k, False: 10.9k]
  ------------------
 5780|  9.74k|                    return (0);
 5781|  22.7k|                tst = tst->next;
 5782|  22.7k|            }
 5783|  55.0k|        }
 5784|  43.2k|        node = node->parent;
 5785|  43.2k|    }
 5786|  1.32k|    if (node != ancestor)
  ------------------
  |  Branch (5786:9): [True: 0, False: 1.32k]
  ------------------
 5787|      0|        return (-1);
 5788|  1.32k|    return (1);
 5789|  1.32k|}
tree.c:xmlNewReconciledNs:
 5914|  2.05k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5915|  2.05k|    xmlNsPtr def;
 5916|  2.05k|    xmlChar prefix[50];
 5917|  2.05k|    int counter = 1;
 5918|  2.05k|    int res;
 5919|       |
 5920|  2.05k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5920:9): [True: 0, False: 2.05k]
  |  Branch (5920:27): [True: 0, False: 2.05k]
  ------------------
 5921|      0|	return(NULL);
 5922|      0|    }
 5923|  2.05k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5923:9): [True: 0, False: 2.05k]
  |  Branch (5923:25): [True: 0, False: 2.05k]
  ------------------
 5924|      0|	return(NULL);
 5925|      0|    }
 5926|       |    /*
 5927|       |     * Search an existing namespace definition inherited.
 5928|       |     */
 5929|  2.05k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5930|  2.05k|    if (res < 0)
  ------------------
  |  Branch (5930:9): [True: 0, False: 2.05k]
  ------------------
 5931|      0|        return(NULL);
 5932|  2.05k|    if (def != NULL)
  ------------------
  |  Branch (5932:9): [True: 1.32k, False: 728]
  ------------------
 5933|  1.32k|        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|    728|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5939:9): [True: 0, False: 728]
  ------------------
 5940|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5941|    728|    else
 5942|    728|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5943|       |
 5944|    728|    res = xmlSearchNsSafe(tree, prefix, &def);
 5945|    728|    if (res < 0)
  ------------------
  |  Branch (5945:9): [True: 0, False: 728]
  ------------------
 5946|      0|        return(NULL);
 5947|  2.30k|    while (def != NULL) {
  ------------------
  |  Branch (5947:12): [True: 1.57k, False: 728]
  ------------------
 5948|  1.57k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5948:13): [True: 0, False: 1.57k]
  ------------------
 5949|  1.57k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5949:6): [True: 0, False: 1.57k]
  ------------------
 5950|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5951|  1.57k|	else
 5952|  1.57k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5953|  1.57k|		(char *)ns->prefix, counter++);
 5954|  1.57k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5955|  1.57k|        if (res < 0)
  ------------------
  |  Branch (5955:13): [True: 0, False: 1.57k]
  ------------------
 5956|      0|            return(NULL);
 5957|  1.57k|    }
 5958|       |
 5959|       |    /*
 5960|       |     * OK, now we are ready to create a new one.
 5961|       |     */
 5962|    728|    def = xmlNewNs(tree, ns->href, prefix);
 5963|    728|    return(def);
 5964|    728|}
tree.c:xmlGetPropNodeInternal:
 6124|  11.4M|{
 6125|  11.4M|    xmlAttrPtr prop;
 6126|       |
 6127|       |    /* Avoid unused variable warning if features are disabled. */
 6128|  11.4M|    (void) useDTD;
 6129|       |
 6130|  11.4M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6130:9): [True: 0, False: 11.4M]
  |  Branch (6130:27): [True: 17.0k, False: 11.4M]
  |  Branch (6130:63): [True: 0, False: 11.4M]
  ------------------
 6131|  17.0k|	return(NULL);
 6132|       |
 6133|  11.4M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6133:9): [True: 495k, False: 10.9M]
  ------------------
 6134|   495k|	prop = node->properties;
 6135|   495k|	if (nsName == NULL) {
  ------------------
  |  Branch (6135:6): [True: 65.7k, False: 429k]
  ------------------
 6136|       |	    /*
 6137|       |	    * We want the attr to be in no namespace.
 6138|       |	    */
 6139|   107k|	    do {
 6140|   107k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6140:7): [True: 98.2k, False: 9.39k]
  |  Branch (6140:29): [True: 32.9k, False: 65.3k]
  ------------------
 6141|  32.9k|		    return(prop);
 6142|  32.9k|		}
 6143|  74.7k|		prop = prop->next;
 6144|  74.7k|	    } while (prop != NULL);
  ------------------
  |  Branch (6144:15): [True: 41.9k, False: 32.8k]
  ------------------
 6145|   429k|	} else {
 6146|       |	    /*
 6147|       |	    * We want the attr to be in the specified namespace.
 6148|       |	    */
 6149|   531k|	    do {
 6150|   531k|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6150:7): [True: 272k, False: 258k]
  |  Branch (6150:29): [True: 257k, False: 15.6k]
  ------------------
 6151|   257k|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6151:8): [True: 1.82k, False: 255k]
  ------------------
 6152|   255k|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6152:8): [True: 254k, False: 684]
  ------------------
 6153|   256k|		{
 6154|   256k|		    return(prop);
 6155|   256k|		}
 6156|   274k|		prop = prop->next;
 6157|   274k|	    } while (prop != NULL);
  ------------------
  |  Branch (6157:15): [True: 101k, False: 172k]
  ------------------
 6158|   429k|	}
 6159|   495k|    }
 6160|       |
 6161|  11.1M|    if (! useDTD)
  ------------------
  |  Branch (6161:9): [True: 11.1M, False: 0]
  ------------------
 6162|  11.1M|	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|   286k|{
 6254|   286k|    if (prop == NULL)
  ------------------
  |  Branch (6254:9): [True: 0, False: 286k]
  ------------------
 6255|      0|	return(NULL);
 6256|   286k|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6256:9): [True: 286k, False: 0]
  ------------------
 6257|   286k|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6258|   286k|    } 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|   286k|}

xmlParseURISafe:
  962|   373k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   373k|    xmlURIPtr uri;
  964|   373k|    int ret;
  965|       |
  966|   373k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 373k]
  ------------------
  967|      0|        return(1);
  968|   373k|    *uriOut = NULL;
  969|   373k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 373k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   373k|    uri = xmlCreateURI();
  973|   373k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 149, False: 373k]
  ------------------
  974|    149|        return(-1);
  975|       |
  976|   373k|    ret = xmlParse3986URIReference(uri, str);
  977|   373k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 26.3k, False: 346k]
  ------------------
  978|  26.3k|        xmlFreeURI(uri);
  979|  26.3k|        return(ret);
  980|  26.3k|    }
  981|       |
  982|   346k|    *uriOut = uri;
  983|   346k|    return(0);
  984|   373k|}
xmlParseURIReference:
 1012|  1.06k|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|  1.06k|    return(xmlParse3986URIReference(uri, str));
 1014|  1.06k|}
xmlCreateURI:
 1058|   422k|xmlCreateURI(void) {
 1059|   422k|    xmlURIPtr ret;
 1060|       |
 1061|   422k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|   422k|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 198, False: 422k]
  ------------------
 1063|    198|	return(NULL);
 1064|   422k|    memset(ret, 0, sizeof(xmlURI));
 1065|   422k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|   422k|#define PORT_EMPTY           0
  ------------------
 1066|   422k|    return(ret);
 1067|   422k|}
xmlSaveUri:
 1095|  73.7k|xmlSaveUri(xmlURI *uri) {
 1096|  73.7k|    xmlChar *ret = NULL;
 1097|  73.7k|    xmlChar *temp;
 1098|  73.7k|    const char *p;
 1099|  73.7k|    int len;
 1100|  73.7k|    int max;
 1101|       |
 1102|  73.7k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 73.7k]
  ------------------
 1103|       |
 1104|       |
 1105|  73.7k|    max = 80;
 1106|  73.7k|    ret = xmlMalloc(max + 1);
 1107|  73.7k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 86, False: 73.6k]
  ------------------
 1108|     86|	return(NULL);
 1109|  73.6k|    len = 0;
 1110|       |
 1111|  73.6k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 13.2k, False: 60.4k]
  ------------------
 1112|  13.2k|	p = uri->scheme;
 1113|   103k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 90.1k, False: 13.2k]
  ------------------
 1114|  90.1k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 220, False: 89.9k]
  ------------------
 1115|    220|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    220|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 1, False: 219]
  ------------------
 1117|    219|		ret = temp;
 1118|    219|	    }
 1119|  90.1k|	    ret[len++] = *p++;
 1120|  90.1k|	}
 1121|  13.2k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 202, False: 13.0k]
  ------------------
 1122|    202|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    202|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 2, False: 200]
  ------------------
 1124|    200|            ret = temp;
 1125|    200|	}
 1126|  13.2k|	ret[len++] = ':';
 1127|  13.2k|    }
 1128|  73.6k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 73.6k]
  ------------------
 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|  73.6k|    } else {
 1147|  73.6k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  63.4k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 10.1k, False: 63.4k]
  |  Branch (1147:31): [True: 2.31k, False: 61.1k]
  ------------------
 1148|  12.4k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 208, False: 12.2k]
  ------------------
 1149|    208|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    208|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 2, False: 206]
  ------------------
 1151|    206|                ret = temp;
 1152|    206|	    }
 1153|  12.4k|	    ret[len++] = '/';
 1154|  12.4k|	    ret[len++] = '/';
 1155|  12.4k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 4.45k, False: 8.03k]
  ------------------
 1156|  4.45k|		p = uri->user;
 1157|  40.0M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 40.0M, False: 4.44k]
  ------------------
 1158|  40.0M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 3.14k, False: 40.0M]
  ------------------
 1159|  3.14k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  3.14k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 12, False: 3.13k]
  ------------------
 1161|  3.13k|                        ret = temp;
 1162|  3.13k|		    }
 1163|  40.0M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  40.0M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  80.1M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  80.1M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  80.1M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 19.4k, False: 40.0M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 17.8k, False: 1.64k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  40.0M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 38.4M, False: 1.62M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 38.4M, False: 3.01k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.62M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 62.3k, False: 1.56M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 38.7k, False: 23.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.58M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.16k, False: 1.58M]
  |  |  |  |  |  Branch (79:37): [True: 1.31k, False: 1.58M]
  |  |  |  |  |  Branch (79:53): [True: 2.47k, False: 1.58M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.58M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.03k, False: 1.58M]
  |  |  |  |  |  Branch (80:21): [True: 1.53k, False: 1.57M]
  |  |  |  |  |  Branch (80:37): [True: 1.19k, False: 1.57M]
  |  |  |  |  |  Branch (80:53): [True: 1.16k, False: 1.57M]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.58M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.36k, False: 1.57M]
  |  |  |  |  |  Branch (81:21): [True: 1.25k, False: 1.57M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|  1.57M|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 4.13k, False: 1.57M]
  |  Branch (1164:23): [True: 3.92k, False: 1.56M]
  ------------------
 1165|  1.56M|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 295, False: 1.56M]
  |  Branch (1165:23): [True: 1.61k, False: 1.56M]
  ------------------
 1166|  1.56M|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.57k, False: 1.56M]
  |  Branch (1166:23): [True: 1.71k, False: 1.56M]
  ------------------
 1167|  1.56M|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 793, False: 1.56M]
  ------------------
 1168|  38.5M|			ret[len++] = *p++;
 1169|  1.56M|		    else {
 1170|  1.56M|			int val = *(unsigned char *)p++;
 1171|  1.56M|			int hi = val / 0x10, lo = val % 0x10;
 1172|  1.56M|			ret[len++] = '%';
 1173|  1.56M|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 3.42k, False: 1.55M]
  ------------------
 1174|  1.56M|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 31.5k, False: 1.52M]
  ------------------
 1175|  1.56M|		    }
 1176|  40.0M|		}
 1177|  4.44k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 208, False: 4.23k]
  ------------------
 1178|    208|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    208|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 1, False: 207]
  ------------------
 1180|    207|                    ret = temp;
 1181|    207|		}
 1182|  4.44k|		ret[len++] = '@';
 1183|  4.44k|	    }
 1184|  12.4k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 10.1k, False: 2.31k]
  ------------------
 1185|  10.1k|		p = uri->server;
 1186|  8.94M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 8.93M, False: 10.1k]
  ------------------
 1187|  8.93M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 306, False: 8.93M]
  ------------------
 1188|    306|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    306|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 8, False: 298]
  ------------------
 1190|    298|			ret = temp;
 1191|    298|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  8.93M|		    ret[len++] = (xmlChar) *p++;
 1194|  8.93M|		}
 1195|  10.1k|	    }
 1196|  12.4k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.38k, False: 11.0k]
  ------------------
 1197|  1.38k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 206, False: 1.17k]
  ------------------
 1198|    206|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    206|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 2, False: 204]
  ------------------
 1200|    204|                    ret = temp;
 1201|    204|                }
 1202|  1.38k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.38k|            }
 1204|  61.1k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 61.1k]
  ------------------
 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|  61.1k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 923, False: 60.2k]
  ------------------
 1233|    923|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 223, False: 700]
  ------------------
 1234|    223|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    223|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 1, False: 222]
  ------------------
 1236|    222|                ret = temp;
 1237|    222|	    }
 1238|    923|	}
 1239|  73.6k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 67.2k, False: 6.35k]
  ------------------
 1240|  67.2k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|  67.2k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 9.06k, False: 58.1k]
  ------------------
 1246|  9.06k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 8.27k, False: 792]
  ------------------
 1247|  8.27k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 1.87k, False: 6.39k]
  |  Branch (1247:22): [True: 1.47k, False: 405]
  ------------------
 1248|  6.79k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 1.18k, False: 5.61k]
  |  Branch (1248:22): [True: 641, False: 539]
  ------------------
 1249|  2.11k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 882, False: 1.23k]
  ------------------
 1250|    882|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    882|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    882|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 408, False: 474]
  ------------------
 1251|    408|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 206, False: 202]
  ------------------
 1252|    206|                    temp = xmlSaveUriRealloc(ret, &max);
 1253|    206|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1253:25): [True: 2, False: 204]
  ------------------
 1254|    204|                    ret = temp;
 1255|    204|		}
 1256|    406|		ret[len++] = *p++;
 1257|    406|		ret[len++] = *p++;
 1258|    406|		ret[len++] = *p++;
 1259|    406|	    }
 1260|  5.67M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 5.60M, False: 67.2k]
  ------------------
 1261|  5.60M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 2.34k, False: 5.60M]
  ------------------
 1262|  2.34k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  2.34k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 7, False: 2.33k]
  ------------------
 1264|  2.33k|                    ret = temp;
 1265|  2.33k|		}
 1266|  5.60M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  5.60M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  11.2M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.2M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  11.2M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 365k, False: 5.24M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 363k, False: 2.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  5.24M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 4.46M, False: 783k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 4.45M, False: 3.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|   786k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 44.7k, False: 741k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 31.4k, False: 13.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|   755k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 11.0k, False: 744k]
  |  |  |  |  |  Branch (79:37): [True: 655, False: 743k]
  |  |  |  |  |  Branch (79:53): [True: 81.7k, False: 661k]
  |  |  |  |  ------------------
  |  |  |  |   80|   755k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.86k, False: 658k]
  |  |  |  |  |  Branch (80:21): [True: 1.46k, False: 657k]
  |  |  |  |  |  Branch (80:37): [True: 549k, False: 107k]
  |  |  |  |  |  Branch (80:53): [True: 1.52k, False: 106k]
  |  |  |  |  ------------------
  |  |  |  |   81|   755k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.73k, False: 104k]
  |  |  |  |  |  Branch (81:21): [True: 2.43k, False: 101k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 74.5k, False: 27.3k]
  ------------------
 1267|  27.3k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 2.24k, False: 25.0k]
  |  Branch (1267:40): [True: 2.61k, False: 22.4k]
  |  Branch (1267:59): [True: 270, False: 22.1k]
  ------------------
 1268|  22.1k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 899, False: 21.2k]
  |  Branch (1268:33): [True: 2.89k, False: 18.3k]
  |  Branch (1268:52): [True: 2.47k, False: 15.9k]
  ------------------
 1269|  15.9k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.29k, False: 13.6k]
  ------------------
 1270|  5.59M|		    ret[len++] = *p++;
 1271|  13.6k|		else {
 1272|  13.6k|		    int val = *(unsigned char *)p++;
 1273|  13.6k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  13.6k|		    ret[len++] = '%';
 1275|  13.6k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.75k, False: 11.8k]
  ------------------
 1276|  13.6k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 7.11k, False: 6.50k]
  ------------------
 1277|  13.6k|		}
 1278|  5.60M|	    }
 1279|  67.2k|	}
 1280|  73.6k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 4.61k, False: 68.9k]
  ------------------
 1281|  4.61k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 204, False: 4.40k]
  ------------------
 1282|    204|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    204|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 2, False: 202]
  ------------------
 1284|    202|                ret = temp;
 1285|    202|	    }
 1286|  4.60k|	    ret[len++] = '?';
 1287|  4.60k|	    p = uri->query_raw;
 1288|  6.79M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 6.79M, False: 4.59k]
  ------------------
 1289|  6.79M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 809, False: 6.79M]
  ------------------
 1290|    809|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|    809|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 12, False: 797]
  ------------------
 1292|    797|                    ret = temp;
 1293|    797|		}
 1294|  6.79M|		ret[len++] = *p++;
 1295|  6.79M|	    }
 1296|  68.9k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 68.9k]
  ------------------
 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|  73.6k|    }
 1322|  73.5k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 6.49k, False: 67.0k]
  ------------------
 1323|  6.49k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 377, False: 6.11k]
  ------------------
 1324|    377|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    377|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 2, False: 375]
  ------------------
 1326|    375|            ret = temp;
 1327|    375|	}
 1328|  6.49k|	ret[len++] = '#';
 1329|  6.49k|	p = uri->fragment;
 1330|  39.9k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 33.4k, False: 6.49k]
  ------------------
 1331|  33.4k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 316, False: 33.1k]
  ------------------
 1332|    316|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    316|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 2, False: 314]
  ------------------
 1334|    314|                ret = temp;
 1335|    314|	    }
 1336|  33.4k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  33.4k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  66.9k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  66.9k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  66.9k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 2.65k, False: 30.7k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 2.26k, False: 392]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  31.1k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 12.4k, False: 18.7k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 10.7k, False: 1.66k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  20.4k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 8.29k, False: 12.1k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 3.73k, False: 4.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  16.7k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 584, False: 16.1k]
  |  |  |  |  |  Branch (79:37): [True: 339, False: 15.7k]
  |  |  |  |  |  Branch (79:53): [True: 466, False: 15.3k]
  |  |  |  |  ------------------
  |  |  |  |   80|  16.7k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 871, False: 14.4k]
  |  |  |  |  |  Branch (80:21): [True: 389, False: 14.0k]
  |  |  |  |  |  Branch (80:37): [True: 1.01k, False: 13.0k]
  |  |  |  |  |  Branch (80:53): [True: 569, False: 12.4k]
  |  |  |  |  ------------------
  |  |  |  |   81|  16.7k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 436, False: 12.0k]
  |  |  |  |  |  Branch (81:21): [True: 296, False: 11.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  11.7k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 808, False: 10.9k]
  |  |  |  Branch (95:41): [True: 505, False: 10.4k]
  |  |  |  Branch (95:57): [True: 807, False: 9.62k]
  |  |  ------------------
  |  |   96|  11.7k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 376, False: 9.24k]
  |  |  |  Branch (96:25): [True: 464, False: 8.78k]
  |  |  |  Branch (96:41): [True: 235, False: 8.54k]
  |  |  |  Branch (96:57): [True: 425, False: 8.12k]
  |  |  ------------------
  |  |   97|  11.7k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 1.11k, False: 7.01k]
  |  |  |  Branch (97:25): [True: 447, False: 6.56k]
  |  |  |  Branch (97:41): [True: 4.89k, False: 1.67k]
  |  |  |  Branch (97:57): [True: 636, False: 1.03k]
  |  |  ------------------
  |  |   98|  11.7k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 301, False: 734]
  |  |  ------------------
  ------------------
 1337|  32.7k|		ret[len++] = *p++;
 1338|    734|	    else {
 1339|    734|		int val = *(unsigned char *)p++;
 1340|    734|		int hi = val / 0x10, lo = val % 0x10;
 1341|    734|		ret[len++] = '%';
 1342|    734|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 663, False: 71]
  ------------------
 1343|    734|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 599, False: 135]
  ------------------
 1344|    734|	    }
 1345|  33.4k|	}
 1346|  6.49k|    }
 1347|  73.5k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 202, False: 73.3k]
  ------------------
 1348|    202|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    202|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 1, False: 201]
  ------------------
 1350|    201|        ret = temp;
 1351|    201|    }
 1352|  73.5k|    ret[len] = 0;
 1353|  73.5k|    return(ret);
 1354|       |
 1355|     57|mem_error:
 1356|     57|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|  73.5k|}
xmlFreeURI:
 1412|   458k|xmlFreeURI(xmlURI *uri) {
 1413|   458k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 35.9k, False: 422k]
  ------------------
 1414|       |
 1415|   422k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 42.2k, False: 380k]
  ------------------
 1416|   422k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 31.4k, False: 390k]
  ------------------
 1417|   422k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 8.28k, False: 414k]
  ------------------
 1418|   422k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 213k, False: 208k]
  ------------------
 1419|   422k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 175k, False: 246k]
  ------------------
 1420|   422k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 422k]
  ------------------
 1421|   422k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 422k]
  ------------------
 1422|   422k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 7.95k, False: 414k]
  ------------------
 1423|   422k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 11.0k, False: 411k]
  ------------------
 1424|   422k|    xmlFree(uri);
 1425|   422k|}
xmlNormalizeURIPath:
 1555|  7.63k|xmlNormalizeURIPath(char *path) {
 1556|  7.63k|    return(xmlNormalizePath(path, 0));
 1557|  7.63k|}
xmlURIUnescapeString:
 1580|   583k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|   583k|    char *ret, *out;
 1582|   583k|    const char *in;
 1583|       |
 1584|   583k|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 583k]
  ------------------
 1585|      0|	return(NULL);
 1586|   583k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 188k, False: 395k]
  ------------------
 1587|   583k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 583k]
  ------------------
 1588|       |
 1589|   583k|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 583k, False: 0]
  ------------------
 1590|   583k|	ret = xmlMalloc(len + 1);
 1591|   583k|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 342, False: 583k]
  ------------------
 1592|    342|	    return(NULL);
 1593|   583k|    } else
 1594|      0|	ret = target;
 1595|   583k|    in = str;
 1596|   583k|    out = ret;
 1597|   128M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 127M, False: 583k]
  ------------------
 1598|   127M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 126M, False: 709k]
  |  Branch (1598:19): [True: 1.60M, False: 125M]
  |  Branch (1598:35): [True: 1.60M, False: 1.92k]
  |  Branch (1598:54): [True: 1.59M, False: 3.17k]
  ------------------
 1599|  1.59M|            int c = 0;
 1600|  1.59M|	    in++;
 1601|  1.59M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 1.59M, False: 0]
  |  Branch (1601:26): [True: 1.57M, False: 17.7k]
  ------------------
 1602|  1.57M|	        c = (*in - '0');
 1603|  17.7k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 7.31k, False: 10.3k]
  |  Branch (1603:31): [True: 7.31k, False: 0]
  ------------------
 1604|  7.31k|	        c = (*in - 'a') + 10;
 1605|  10.3k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 10.3k, False: 0]
  |  Branch (1605:31): [True: 10.3k, False: 0]
  ------------------
 1606|  10.3k|	        c = (*in - 'A') + 10;
 1607|  1.59M|	    in++;
 1608|  1.59M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 1.59M, False: 0]
  |  Branch (1608:26): [True: 1.57M, False: 18.2k]
  ------------------
 1609|  1.57M|	        c = c * 16 + (*in - '0');
 1610|  18.2k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 6.81k, False: 11.4k]
  |  Branch (1610:31): [True: 6.81k, False: 0]
  ------------------
 1611|  6.81k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  11.4k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 11.4k, False: 0]
  |  Branch (1612:31): [True: 11.4k, False: 0]
  ------------------
 1613|  11.4k|	        c = c * 16 + (*in - 'A') + 10;
 1614|  1.59M|	    in++;
 1615|  1.59M|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|  1.59M|	    *out++ = (char) c;
 1618|   126M|	} else {
 1619|   126M|	    *out++ = *in++;
 1620|   126M|	    len--;
 1621|   126M|	}
 1622|   127M|    }
 1623|   583k|    *out = 0;
 1624|   583k|    return(ret);
 1625|   583k|}
xmlURIEscapeStr:
 1637|  2.19k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  2.19k|    xmlChar *ret, ch;
 1639|  2.19k|    const xmlChar *in;
 1640|  2.19k|    int len, out;
 1641|       |
 1642|  2.19k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2.19k]
  ------------------
 1643|      0|	return(NULL);
 1644|  2.19k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.19k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  2.19k|    len = xmlStrlen(str);
 1647|  2.19k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 2.19k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  2.19k|    len += 20;
 1651|  2.19k|    ret = xmlMalloc(len);
 1652|  2.19k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 3, False: 2.18k]
  ------------------
 1653|      3|	return(NULL);
 1654|  2.18k|    in = (const xmlChar *) str;
 1655|  2.18k|    out = 0;
 1656|  9.27M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 9.27M, False: 2.18k]
  ------------------
 1657|  9.27M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 937, False: 9.27M]
  ------------------
 1658|    937|            xmlChar *temp;
 1659|    937|            int newSize;
 1660|       |
 1661|    937|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    937|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    937|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 937]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    937|            temp = xmlRealloc(ret, newSize);
 1667|    937|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 1, False: 936]
  ------------------
 1668|      1|		xmlFree(ret);
 1669|      1|		return(NULL);
 1670|      1|	    }
 1671|    936|	    ret = temp;
 1672|    936|            len = newSize;
 1673|    936|	}
 1674|       |
 1675|  9.27M|	ch = *in;
 1676|       |
 1677|  9.27M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  9.27M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  18.5M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  18.5M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  18.5M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 209k, False: 9.06M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 154k, False: 55.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  9.11M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 206k, False: 8.90M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 147k, False: 58.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  8.96M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 103k, False: 8.86M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 27.2k, False: 75.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  8.94M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 20.3k, False: 8.92M]
  |  |  |  |  |  Branch (79:37): [True: 631, False: 8.91M]
  |  |  |  |  |  Branch (79:53): [True: 127k, False: 8.79M]
  |  |  |  |  ------------------
  |  |  |  |   80|  8.94M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 12.7k, False: 8.77M]
  |  |  |  |  |  Branch (80:21): [True: 1.05k, False: 8.77M]
  |  |  |  |  |  Branch (80:37): [True: 747k, False: 8.03M]
  |  |  |  |  |  Branch (80:53): [True: 5.65k, False: 8.02M]
  |  |  |  |  ------------------
  |  |  |  |   81|  8.94M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 16.4k, False: 8.00M]
  |  |  |  |  |  Branch (81:21): [True: 18.4k, False: 7.99M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 9.27M, False: 920]
  |  Branch (1677:45): [True: 7.88M, False: 101k]
  ------------------
 1678|  7.88M|	    unsigned char val;
 1679|  7.88M|	    ret[out++] = '%';
 1680|  7.88M|	    val = ch >> 4;
 1681|  7.88M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 7.87M, False: 16.9k]
  ------------------
 1682|  7.87M|		ret[out++] = '0' + val;
 1683|  16.9k|	    else
 1684|  16.9k|		ret[out++] = 'A' + val - 0xA;
 1685|  7.88M|	    val = ch & 0xF;
 1686|  7.88M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 7.84M, False: 39.5k]
  ------------------
 1687|  7.84M|		ret[out++] = '0' + val;
 1688|  39.5k|	    else
 1689|  39.5k|		ret[out++] = 'A' + val - 0xA;
 1690|  7.88M|	    in++;
 1691|  7.88M|	} else {
 1692|  1.38M|	    ret[out++] = *in++;
 1693|  1.38M|	}
 1694|       |
 1695|  9.27M|    }
 1696|  2.18k|    ret[out] = 0;
 1697|  2.18k|    return(ret);
 1698|  2.18k|}
xmlBuildURISafe:
 1972|   235k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   235k|    xmlChar *val = NULL;
 1974|   235k|    int ret, len, indx, cur, out;
 1975|   235k|    xmlURIPtr ref = NULL;
 1976|   235k|    xmlURIPtr bas = NULL;
 1977|   235k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   235k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 235k]
  ------------------
 1980|      0|        return(1);
 1981|   235k|    *valPtr = NULL;
 1982|       |
 1983|   235k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 235k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   235k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 20.1k, False: 215k]
  ------------------
 1987|  20.1k|        val = xmlStrdup(URI);
 1988|  20.1k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 6, False: 20.1k]
  ------------------
 1989|      6|            return(-1);
 1990|  20.1k|        *valPtr = val;
 1991|  20.1k|        return(0);
 1992|  20.1k|    }
 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|   215k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 211k, False: 3.85k]
  ------------------
 2003|   211k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  3.85k|    else
 2005|  3.85k|        ret = 0;
 2006|   215k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.32k, False: 206k]
  ------------------
 2007|  8.32k|	goto done;
 2008|   206k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 202k, False: 3.85k]
  |  Branch (2008:26): [True: 5.34k, False: 197k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  5.34k|	val = xmlStrdup(URI);
 2013|  5.34k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 27, False: 5.31k]
  ------------------
 2014|     27|            ret = -1;
 2015|  5.34k|	goto done;
 2016|  5.34k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   201k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   201k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 177k, False: 23.5k]
  ------------------
 2023|   177k|        xmlFreeURI(ref);
 2024|   177k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   177k|    }
 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|  23.5k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  23.5k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 153, False: 23.4k]
  ------------------
 2046|    153|        goto done;
 2047|  23.4k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 7.02k, False: 16.3k]
  ------------------
 2048|  7.02k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.10k, False: 917]
  ------------------
 2049|  6.10k|            ret = 0;
 2050|  6.10k|	    val = xmlSaveUri(ref);
 2051|  6.10k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 20, False: 6.08k]
  ------------------
 2052|     20|                ret = -1;
 2053|  6.10k|        }
 2054|  7.02k|	goto done;
 2055|  7.02k|    }
 2056|  16.3k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 2.24k, False: 14.1k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  2.24k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 279, False: 1.96k]
  ------------------
 2061|    279|	    xmlFree(bas->fragment);
 2062|    279|	    bas->fragment = NULL;
 2063|    279|	}
 2064|  2.24k|	val = xmlSaveUri(bas);
 2065|  2.24k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 13, False: 2.23k]
  ------------------
 2066|     13|            ret = -1;
 2067|  2.24k|	goto done;
 2068|  2.24k|    }
 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|  14.1k|    ret = -1;
 2083|  14.1k|    res = xmlCreateURI();
 2084|  14.1k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 29, False: 14.1k]
  ------------------
 2085|     29|	goto done;
 2086|  14.1k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 14.1k, False: 0]
  |  Branch (2086:34): [True: 5.27k, False: 8.84k]
  ------------------
 2087|  5.27k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.27k, False: 0]
  |  Branch (2087:31): [True: 4.57k, False: 703]
  ------------------
 2088|  4.57k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  4.57k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.35k, False: 218]
  ------------------
 2089|  4.35k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 3.89k, False: 458]
  ------------------
 2090|  3.89k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  3.89k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 6, False: 3.89k]
  ------------------
 2092|      6|                goto done;
 2093|  3.89k|        }
 2094|  4.34k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.34k]
  ------------------
 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.34k|        } else {
 2099|  4.34k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 3.03k, False: 1.31k]
  ------------------
 2100|  3.03k|		res->server = xmlMemStrdup(bas->server);
 2101|  3.03k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 5, False: 3.02k]
  ------------------
 2102|      5|                    goto done;
 2103|  3.03k|            }
 2104|  4.34k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 2.23k, False: 2.10k]
  ------------------
 2105|  2.23k|		res->user = xmlMemStrdup(bas->user);
 2106|  2.23k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 3, False: 2.23k]
  ------------------
 2107|      3|                    goto done;
 2108|  2.23k|            }
 2109|  4.34k|	    res->port = bas->port;
 2110|  4.34k|	}
 2111|  4.34k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.40k, False: 1.93k]
  ------------------
 2112|  2.40k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.40k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 7, False: 2.39k]
  ------------------
 2114|      7|                goto done;
 2115|  2.40k|        }
 2116|  4.33k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 696, False: 3.63k]
  ------------------
 2117|    696|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    696|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 5, False: 691]
  ------------------
 2119|      5|                goto done;
 2120|  3.63k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 3.63k]
  ------------------
 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.63k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.68k, False: 1.95k]
  ------------------
 2125|  1.68k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.68k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 3, False: 1.68k]
  ------------------
 2127|      3|                goto done;
 2128|  1.95k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 1.95k]
  ------------------
 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.32k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 3.74k, False: 582]
  ------------------
 2134|  3.74k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  3.74k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 7, False: 3.73k]
  ------------------
 2136|      7|                goto done;
 2137|  3.74k|        }
 2138|  4.31k|	goto step_7;
 2139|  4.32k|    }
 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|  9.76k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 9.76k]
  ------------------
 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|  9.76k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 7.28k, False: 2.47k]
  ------------------
 2154|  7.28k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  7.28k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 22, False: 7.26k]
  ------------------
 2156|     22|            goto done;
 2157|  7.28k|    }
 2158|       |
 2159|  9.74k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 756, False: 8.98k]
  ------------------
 2160|    756|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|    756|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 3, False: 753]
  ------------------
 2162|      3|            goto done;
 2163|  8.98k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 8.98k]
  ------------------
 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|  9.73k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.11k, False: 8.62k]
  ------------------
 2169|  1.11k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.11k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 7, False: 1.10k]
  ------------------
 2171|      7|            goto done;
 2172|  1.11k|    }
 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|  9.73k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 9.73k]
  |  Branch (2181:37): [True: 913, False: 8.81k]
  ------------------
 2182|  8.81k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  8.81k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 218, False: 8.60k]
  ------------------
 2183|  1.13k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.13k]
  ------------------
 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.13k|        } else {
 2188|  1.13k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 913, False: 218]
  ------------------
 2189|    913|                res->server = xmlMemStrdup(ref->server);
 2190|    913|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 2, False: 911]
  ------------------
 2191|      2|                    goto done;
 2192|    913|            }
 2193|  1.12k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 213, False: 916]
  ------------------
 2194|    213|		res->user = xmlMemStrdup(ref->user);
 2195|    213|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 1, False: 212]
  ------------------
 2196|      1|                    goto done;
 2197|    213|            }
 2198|  1.12k|            res->port = ref->port;
 2199|  1.12k|	}
 2200|  1.12k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 210, False: 918]
  ------------------
 2201|    210|	    res->path = xmlMemStrdup(ref->path);
 2202|    210|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 2, False: 208]
  ------------------
 2203|      2|                goto done;
 2204|    210|        }
 2205|  1.12k|	goto step_7;
 2206|  1.12k|    }
 2207|  8.60k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 8.60k]
  ------------------
 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|  8.60k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  4.15k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 4.45k, False: 4.15k]
  |  Branch (2211:41): [True: 1.05k, False: 3.09k]
  ------------------
 2212|  5.50k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 4.45k, False: 1.05k]
  ------------------
 2213|  4.45k|	    res->server = xmlMemStrdup(bas->server);
 2214|  4.45k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 10, False: 4.44k]
  ------------------
 2215|     10|                goto done;
 2216|  4.45k|        }
 2217|  5.49k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 1.15k, False: 4.34k]
  ------------------
 2218|  1.15k|	    res->user = xmlMemStrdup(bas->user);
 2219|  1.15k|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 5, False: 1.14k]
  ------------------
 2220|      5|                goto done;
 2221|  1.15k|        }
 2222|  5.48k|	res->port = bas->port;
 2223|  5.48k|    }
 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|  8.58k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 8.58k, False: 0]
  |  Branch (2229:32): [True: 932, False: 7.65k]
  ------------------
 2230|    932|	res->path = xmlMemStrdup(ref->path);
 2231|    932|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 3, False: 929]
  ------------------
 2232|      3|            goto done;
 2233|    929|	goto step_7;
 2234|    932|    }
 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|  7.65k|    len = 2; /* extra / and 0 */
 2246|  7.65k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 7.65k, False: 0]
  ------------------
 2247|  7.65k|	len += strlen(ref->path);
 2248|  7.65k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 3.78k, False: 3.86k]
  ------------------
 2249|  3.78k|	len += strlen(bas->path);
 2250|  7.65k|    res->path = xmlMalloc(len);
 2251|  7.65k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 18, False: 7.63k]
  ------------------
 2252|     18|	goto done;
 2253|  7.63k|    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|  7.63k|    cur = 0;
 2261|  7.63k|    out = 0;
 2262|  7.63k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 3.78k, False: 3.85k]
  ------------------
 2263|  26.2k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 24.4k, False: 1.84k]
  ------------------
 2264|   585k|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 583k, False: 1.94k]
  |  Branch (2264:38): [True: 561k, False: 22.4k]
  ------------------
 2265|   561k|		cur++;
 2266|  24.4k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 1.94k, False: 22.4k]
  ------------------
 2267|  1.94k|		break;
 2268|       |
 2269|  22.4k|	    cur++;
 2270|   556k|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 533k, False: 22.4k]
  ------------------
 2271|   533k|		res->path[out] = bas->path[out];
 2272|   533k|		out++;
 2273|   533k|	    }
 2274|  22.4k|	}
 2275|  3.78k|    }
 2276|  7.63k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  7.63k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 7.63k, False: 0]
  |  Branch (2282:30): [True: 7.43k, False: 198]
  ------------------
 2283|  7.43k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  7.43k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  1.45k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 4.14k, False: 3.29k]
  |  Branch (2287:21): [True: 2.69k, False: 1.45k]
  |  Branch (2287:46): [True: 537, False: 915]
  ------------------
 2288|  3.22k|	    res->path[out++] = '/';
 2289|   101k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 94.3k, False: 7.43k]
  ------------------
 2290|  94.3k|	    res->path[out++] = ref->path[indx++];
 2291|  94.3k|	}
 2292|  7.43k|    }
 2293|  7.63k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  7.63k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  14.0k|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|  14.0k|    val = xmlSaveUri(res);
 2308|  14.0k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 13.9k, False: 86]
  ------------------
 2309|  13.9k|        ret = 0;
 2310|       |
 2311|  37.2k|done:
 2312|  37.2k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 25.7k, False: 11.5k]
  ------------------
 2313|  25.7k|	xmlFreeURI(ref);
 2314|  37.2k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 16.3k, False: 20.8k]
  ------------------
 2315|  16.3k|	xmlFreeURI(bas);
 2316|  37.2k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 14.1k, False: 23.1k]
  ------------------
 2317|  14.1k|	xmlFreeURI(res);
 2318|  37.2k|    *valPtr = val;
 2319|  37.2k|    return(ret);
 2320|  14.0k|}
xmlBuildRelativeURISafe:
 2493|  33.2k|{
 2494|  33.2k|    xmlChar *val = NULL;
 2495|  33.2k|    int ret = 0;
 2496|  33.2k|    size_t ix = 0;
 2497|  33.2k|    size_t nbslash = 0;
 2498|  33.2k|    size_t len = 0;
 2499|  33.2k|    xmlURIPtr ref = NULL;
 2500|  33.2k|    xmlURIPtr bas = NULL;
 2501|  33.2k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  33.2k|    xmlChar *vptr;
 2503|  33.2k|    int remove_path = 0;
 2504|  33.2k|    int refDrive, baseDrive;
 2505|       |
 2506|  33.2k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 33.2k]
  ------------------
 2507|      0|        return(1);
 2508|  33.2k|    *valPtr = NULL;
 2509|  33.2k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 33.2k]
  |  Branch (2509:26): [True: 278, False: 33.0k]
  ------------------
 2510|    278|	return(1);
 2511|       |
 2512|  33.0k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  33.0k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 49, False: 32.9k]
  ------------------
 2514|     49|        goto done;
 2515|  32.9k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 339, False: 32.6k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    339|        ret = 0;
 2518|    339|        val = xmlStrdup(URI);
 2519|    339|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 338]
  ------------------
 2520|      1|            ret = -1;
 2521|    339|        goto done;
 2522|    339|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  32.6k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 32.6k]
  |  Branch (2525:27): [True: 30.3k, False: 2.29k]
  ------------------
 2526|  30.3k|        goto done;
 2527|       |
 2528|  2.29k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  2.29k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 7, False: 2.29k]
  ------------------
 2530|      7|        goto done;
 2531|  2.29k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 230, False: 2.06k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    230|        ret = 0;
 2534|    230|        goto done;
 2535|    230|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  2.06k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 298, False: 1.76k]
  ------------------
 2542|  1.76k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 66, False: 1.69k]
  ------------------
 2543|  1.69k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.69k]
  ------------------
 2544|  1.69k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.69k]
  ------------------
 2545|    364|	goto done;
 2546|    364|    }
 2547|  1.69k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 94, False: 1.60k]
  ------------------
 2548|     94|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|     94|#define BAD_CAST (xmlChar *)
  ------------------
 2549|     94|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 2, False: 92]
  ------------------
 2550|      2|            ret = -1;
 2551|     94|	goto done;
 2552|     94|    }
 2553|  1.60k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 10, False: 1.59k]
  ------------------
 2554|     10|	val = xmlStrdup((xmlChar *)ref->path);
 2555|     10|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 9]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      9|	goto escape;
 2560|     10|    }
 2561|  1.59k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 66, False: 1.52k]
  ------------------
 2562|     66|        ref->path = (char *) "/";
 2563|     66|	remove_path = 1;
 2564|     66|    }
 2565|       |
 2566|  1.59k|    bptr = (xmlChar *) bas->path;
 2567|  1.59k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.59k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 321, False: 1.27k]
  ------------------
 2573|    321|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|  1.27k|    {
 2579|  1.27k|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  4.09k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.82k, False: 1.27k]
  |  Branch (2584:37): [True: 2.82k, False: 0]
  ------------------
 2585|  2.82k|	    pos++;
 2586|       |
 2587|  1.27k|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 1.27k]
  ------------------
 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.27k|	ix = pos;
 2599|  2.24k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.19k, False: 1.05k]
  ------------------
 2600|  1.19k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 214, False: 977]
  ------------------
 2601|    214|		break;
 2602|  1.19k|	}
 2603|  1.27k|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   220k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 219k, False: 1.27k]
  ------------------
 2609|   219k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 55.6k, False: 163k]
  ------------------
 2610|  55.6k|		nbslash++;
 2611|   219k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|  1.27k|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 285, False: 986]
  |  Branch (2616:22): [True: 20, False: 265]
  ------------------
 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.25k|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|  1.25k|    }
 2625|       |
 2626|  1.25k|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 265, False: 986]
  ------------------
 2627|    265|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 265, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    265|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    265|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    265|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 1, False: 264]
  ------------------
 2631|      1|                ret = -1;
 2632|    265|        }
 2633|    265|	goto done;
 2634|    265|    }
 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|    986|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 986]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|    986|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|    986|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 1, False: 985]
  ------------------
 2647|      1|        ret = -1;
 2648|      1|	goto done;
 2649|      1|    }
 2650|    985|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  56.6k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 55.6k, False: 985]
  ------------------
 2655|  55.6k|	*vptr++ = '.';
 2656|  55.6k|	*vptr++ = '.';
 2657|  55.6k|	*vptr++ = '/';
 2658|  55.6k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|    985|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 985, False: 0]
  ------------------
 2663|    985|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 985, False: 0]
  |  Branch (2663:29): [True: 985, False: 0]
  ------------------
 2664|    985|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 985]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|    985|	} else {
 2668|    985|	    memcpy (vptr, uptr, len);
 2669|    985|	    vptr[len - 1] = 0;
 2670|    985|	}
 2671|    985|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|    994|escape:
 2676|       |    /* escape the freshly-built path */
 2677|    994|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|    994|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    994|#define BAD_CAST (xmlChar *)
  ------------------
 2680|    994|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 3, False: 991]
  ------------------
 2681|      3|        ret = -1;
 2682|    991|    else
 2683|    991|        ret = 0;
 2684|    994|    xmlFree(vptr);
 2685|       |
 2686|  33.0k|done:
 2687|  33.0k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 32.9k, False: 66]
  |  Branch (2687:23): [True: 31.2k, False: 1.70k]
  ------------------
 2688|  31.2k|        val = xmlSaveUri(ref);
 2689|  31.2k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 8, False: 31.2k]
  ------------------
 2690|      8|            ret = -1;
 2691|  31.2k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  33.0k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 66, False: 32.9k]
  ------------------
 2697|     66|        ref->path = NULL;
 2698|  33.0k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 32.6k, False: 388]
  ------------------
 2699|  32.6k|	xmlFreeURI (ref);
 2700|  33.0k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 2.06k, False: 30.9k]
  ------------------
 2701|  2.06k|	xmlFreeURI (bas);
 2702|  33.0k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 74, False: 32.9k]
  ------------------
 2703|     74|        xmlFree(val);
 2704|     74|        val = NULL;
 2705|     74|    }
 2706|       |
 2707|  33.0k|    *valPtr = val;
 2708|  33.0k|    return(ret);
 2709|    994|}
xmlCanonicPath:
 2747|  11.5k|{
 2748|  11.5k|    xmlChar *ret;
 2749|       |
 2750|  11.5k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 11.5k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  11.5k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  11.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 933, False: 10.6k]
  ------------------
 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|    933|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    933|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  10.6k|    } else {
 2764|  10.6k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  10.6k|    }
 2766|       |
 2767|  11.5k|    return(ret);
 2768|  11.5k|}
xmlPathToURI:
 2781|  11.5k|{
 2782|  11.5k|    return(xmlCanonicPath(path));
 2783|  11.5k|}
uri.c:xmlParse3986URIReference:
  924|   374k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   374k|    int ret;
  926|       |
  927|   374k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 374k]
  ------------------
  928|      0|	return(-1);
  929|   374k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   374k|    ret = xmlParse3986URI(uri, str);
  936|   374k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 155, False: 373k]
  ------------------
  937|    155|        return(ret);
  938|   373k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 342k, False: 31.0k]
  ------------------
  939|   342k|	xmlCleanURI(uri);
  940|   342k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   342k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 26.7k, False: 316k]
  ------------------
  942|  26.7k|	    xmlCleanURI(uri);
  943|  26.7k|	    return(ret);
  944|  26.7k|	}
  945|   342k|    }
  946|   347k|    return(0);
  947|   373k|}
uri.c:xmlCleanURI:
 1383|   775k|xmlCleanURI(xmlURIPtr uri) {
 1384|   775k|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 775k]
  ------------------
 1385|       |
 1386|   775k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 109k, False: 665k]
  ------------------
 1387|   775k|    uri->scheme = NULL;
 1388|   775k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 4.07k, False: 771k]
  ------------------
 1389|   775k|    uri->server = NULL;
 1390|   775k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 761, False: 774k]
  ------------------
 1391|   775k|    uri->user = NULL;
 1392|   775k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 20.4k, False: 755k]
  ------------------
 1393|   775k|    uri->path = NULL;
 1394|   775k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 2.03k, False: 773k]
  ------------------
 1395|   775k|    uri->fragment = NULL;
 1396|   775k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 775k]
  ------------------
 1397|   775k|    uri->opaque = NULL;
 1398|   775k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 775k]
  ------------------
 1399|   775k|    uri->authority = NULL;
 1400|   775k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 2.20k, False: 773k]
  ------------------
 1401|   775k|    uri->query = NULL;
 1402|   775k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 2.18k, False: 773k]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|   775k|}
uri.c:xmlParse3986URI:
  885|   374k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   374k|    int ret;
  887|       |
  888|   374k|    ret = xmlParse3986Scheme(uri, &str);
  889|   374k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 233k, False: 141k]
  ------------------
  890|   141k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 101k, False: 39.2k]
  ------------------
  891|   101k|	return(1);
  892|   101k|    }
  893|  39.2k|    str++;
  894|  39.2k|    ret = xmlParse3986HierPart(uri, &str);
  895|  39.2k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.29k, False: 37.9k]
  ------------------
  896|  37.9k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 3.49k, False: 34.4k]
  ------------------
  897|  3.49k|	str++;
  898|  3.49k|	ret = xmlParse3986Query(uri, &str);
  899|  3.49k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 16, False: 3.47k]
  ------------------
  900|  3.49k|    }
  901|  37.9k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.49k, False: 36.4k]
  ------------------
  902|  1.49k|	str++;
  903|  1.49k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.49k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 4, False: 1.49k]
  ------------------
  905|  1.49k|    }
  906|  37.9k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 6.87k, False: 31.0k]
  ------------------
  907|  6.87k|	xmlCleanURI(uri);
  908|  6.87k|	return(1);
  909|  6.87k|    }
  910|  31.0k|    return(0);
  911|  37.9k|}
uri.c:xmlParse3986Scheme:
  224|   374k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   374k|    const char *cur;
  226|       |
  227|   374k|    cur = *str;
  228|   374k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   374k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 137k, False: 236k]
  |  |  |  Branch (128:41): [True: 135k, False: 1.67k]
  |  |  ------------------
  |  |  129|   374k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.58k, False: 230k]
  |  |  |  Branch (129:41): [True: 5.24k, False: 2.34k]
  |  |  ------------------
  ------------------
  229|   232k|	return(1);
  230|   141k|    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|   627k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 104k, False: 209k]
  |  |  |  Branch (128:41): [True: 103k, False: 318]
  |  |  ------------------
  |  |  129|   627k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 42.5k, False: 166k]
  |  |  |  Branch (129:41): [True: 42.1k, False: 441]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   480k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 49.7k, False: 117k]
  |  |  |  Branch (127:40): [True: 8.07k, False: 41.6k]
  |  |  ------------------
  ------------------
  241|   172k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 6.65k, False: 152k]
  |  Branch (241:29): [True: 6.51k, False: 146k]
  |  Branch (241:46): [True: 5.06k, False: 141k]
  ------------------
  242|   141k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 141k, False: 0]
  ------------------
  243|   141k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 141k]
  ------------------
  244|   141k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|   141k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|   141k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 66, False: 141k]
  ------------------
  246|     66|            return(-1);
  247|   141k|    }
  248|   141k|    *str = cur;
  249|   141k|    return(0);
  250|   141k|}
uri.c:xmlParse3986HierPart:
  782|  39.2k|{
  783|  39.2k|    const char *cur;
  784|  39.2k|    int ret;
  785|       |
  786|  39.2k|    cur = *str;
  787|       |
  788|  39.2k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 30.1k, False: 9.12k]
  |  Branch (788:26): [True: 28.9k, False: 1.10k]
  ------------------
  789|  28.9k|        cur += 2;
  790|  28.9k|	ret = xmlParse3986Authority(uri, &cur);
  791|  28.9k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.26k, False: 27.7k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  27.7k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  3.33k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 3.33k, False: 24.3k]
  |  Branch (795:31): [True: 3.04k, False: 286]
  ------------------
  796|  3.04k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  3.04k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  27.7k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  27.7k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 9, False: 27.7k]
  ------------------
  799|  27.7k|	*str = cur;
  800|  27.7k|	return(0);
  801|  27.7k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 1.10k, False: 9.12k]
  ------------------
  802|  1.10k|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|  1.10k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 1, False: 1.10k]
  ------------------
  804|  9.12k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  9.12k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  18.2k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.31k, False: 6.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  15.9k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.14k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  4.29k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.80k, False: 340]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 696, False: 1.11k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 827, False: 626]
  |  |  |  |  |  |  |  Branch (131:43): [True: 633, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.14k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 472, False: 348]
  |  |  |  |  |  |  |  Branch (132:27): [True: 278, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.60k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.21k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.37k, False: 229]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 202, False: 1.17k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 861, False: 544]
  |  |  |  |  |  |  |  Branch (131:43): [True: 640, False: 221]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.60k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 532, False: 233]
  |  |  |  |  |  |  |  Branch (132:27): [True: 298, False: 234]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 2.14k, False: 4.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  14.8k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 247, False: 5.42k]
  |  |  |  |  |  Branch (139:27): [True: 214, False: 5.21k]
  |  |  |  |  |  Branch (139:46): [True: 222, False: 4.98k]
  |  |  |  |  ------------------
  |  |  |  |  140|  5.67k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 207, False: 4.78k]
  |  |  |  |  |  Branch (140:27): [True: 207, False: 4.57k]
  |  |  |  |  |  Branch (140:46): [True: 198, False: 4.37k]
  |  |  |  |  ------------------
  |  |  |  |  141|  5.67k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 378, False: 3.99k]
  |  |  |  |  |  Branch (141:27): [True: 269, False: 3.73k]
  |  |  |  |  |  Branch (141:46): [True: 377, False: 3.35k]
  |  |  |  |  ------------------
  |  |  |  |  142|  5.67k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 227, False: 3.12k]
  |  |  |  |  |  Branch (142:27): [True: 201, False: 2.92k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  9.12k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 586, False: 2.33k]
  |  |  |  Branch (175:26): [True: 208, False: 2.13k]
  |  |  ------------------
  ------------------
  805|  6.99k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  6.99k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 18, False: 6.97k]
  ------------------
  807|  6.99k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  2.13k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 2.13k, False: 0]
  ------------------
  810|  2.13k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 2.13k]
  ------------------
  811|  2.13k|	    uri->path = NULL;
  812|  2.13k|	}
  813|  2.13k|    }
  814|  10.2k|    *str = cur;
  815|  10.2k|    return (0);
  816|  39.2k|}
uri.c:xmlParse3986Authority:
  529|  32.1k|{
  530|  32.1k|    const char *cur;
  531|  32.1k|    int ret;
  532|       |
  533|  32.1k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  32.1k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  32.1k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 12, False: 32.1k]
  ------------------
  539|     12|        return(ret);
  540|  32.1k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 26.6k, False: 5.45k]
  |  Branch (540:23): [True: 0, False: 5.45k]
  ------------------
  541|  26.6k|        cur = *str;
  542|  5.45k|    else
  543|  5.45k|        cur++;
  544|  32.1k|    ret = xmlParse3986Host(uri, &cur);
  545|  32.1k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 311, False: 31.8k]
  ------------------
  546|  31.8k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.32k, False: 28.4k]
  ------------------
  547|  3.32k|        cur++;
  548|  3.32k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.32k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.22k, False: 2.10k]
  ------------------
  550|  3.32k|    }
  551|  30.5k|    *str = cur;
  552|  30.5k|    return(0);
  553|  31.8k|}
uri.c:xmlParse3986Userinfo:
  379|  32.1k|{
  380|  32.1k|    const char *cur;
  381|       |
  382|  32.1k|    cur = *str;
  383|  4.26M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  8.53M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 208k, False: 4.06M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  8.33M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  4.00M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  8.00M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 4.00M, False: 259]
  |  |  |  |  |  |  |  Branch (127:40): [True: 3.99M, False: 9.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.76k, False: 8.45k]
  |  |  |  |  |  Branch (131:43): [True: 1.52k, False: 245]
  |  |  |  |  ------------------
  |  |  |  |  132|  4.00M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 8.43k, False: 262]
  |  |  |  |  |  Branch (132:27): [True: 8.12k, False: 312]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  4.00M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  8.00M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 4.00M, False: 312]
  |  |  |  |  |  |  |  Branch (127:40): [True: 4.00M, False: 2.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 909, False: 2.03k]
  |  |  |  |  |  Branch (131:43): [True: 649, False: 260]
  |  |  |  |  ------------------
  |  |  |  |  132|  4.00M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.78k, False: 513]
  |  |  |  |  |  Branch (132:27): [True: 1.48k, False: 296]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 4.00M, False: 56.8k]
  |  |  ------------------
  ------------------
  384|  58.2k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  4.32M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 6.27k, False: 51.9k]
  |  |  |  Branch (139:27): [True: 505, False: 51.4k]
  |  |  |  Branch (139:46): [True: 416, False: 51.0k]
  |  |  ------------------
  |  |  140|  58.2k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 915, False: 50.1k]
  |  |  |  Branch (140:27): [True: 2.34k, False: 47.8k]
  |  |  |  Branch (140:46): [True: 1.65k, False: 46.1k]
  |  |  ------------------
  |  |  141|  58.2k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.39k, False: 44.7k]
  |  |  |  Branch (141:27): [True: 713, False: 44.0k]
  |  |  |  Branch (141:46): [True: 839, False: 43.2k]
  |  |  ------------------
  |  |  142|  58.2k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.17k, False: 42.0k]
  |  |  |  Branch (142:27): [True: 3.71k, False: 38.3k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 6.17k, False: 32.1k]
  ------------------
  385|  4.23M|	NEXT(cur);
  ------------------
  |  |  108|  4.23M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 4.00M, False: 235k]
  |  |  ------------------
  ------------------
  386|  32.1k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 5.47k, False: 26.6k]
  ------------------
  387|  5.47k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 5.47k, False: 0]
  ------------------
  388|  5.47k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 5.47k]
  ------------------
  389|  5.47k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  5.47k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 5.47k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  5.47k|	    else
  392|  5.47k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  5.47k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 12, False: 5.45k]
  ------------------
  394|     12|                return(-1);
  395|  5.47k|	}
  396|  5.45k|	*str = cur;
  397|  5.45k|	return(0);
  398|  5.47k|    }
  399|  26.6k|    return(1);
  400|  32.1k|}
uri.c:xmlParse3986Host:
  452|  32.1k|{
  453|  32.1k|    const char *cur = *str;
  454|  32.1k|    const char *host;
  455|       |
  456|  32.1k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  32.1k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 469, False: 31.6k]
  ------------------
  461|    469|        cur++;
  462|  3.01k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 2.82k, False: 197]
  |  Branch (462:26): [True: 2.55k, False: 272]
  ------------------
  463|  2.55k|	    cur++;
  464|    469|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 272, False: 197]
  ------------------
  465|    272|	    return(1);
  466|    197|	cur++;
  467|    197|	goto found;
  468|    469|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  31.6k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  31.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 24.0k, False: 7.56k]
  |  |  |  Branch (127:40): [True: 8.09k, False: 15.9k]
  |  |  ------------------
  ------------------
  473|  8.09k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 1.29k, False: 6.79k]
  ------------------
  474|  1.29k|	    goto not_ipv4;
  475|  6.79k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.89k, False: 2.90k]
  ------------------
  476|  3.89k|	    goto not_ipv4;
  477|  2.90k|	cur++;
  478|  2.90k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.16k, False: 1.73k]
  ------------------
  479|  1.16k|	    goto not_ipv4;
  480|  1.73k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.53k, False: 206]
  ------------------
  481|  1.53k|	    goto not_ipv4;
  482|    206|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 206, False: 0]
  ------------------
  483|    206|	    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|  8.09k|not_ipv4:
  490|  8.09k|        cur = *str;
  491|  8.09k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  10.4M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  20.8M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 10.3M, False: 85.0k]
  |  |  ------------------
  ------------------
  496|  85.0k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  10.4M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  27.9k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  55.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 27.6k, False: 346]
  |  |  |  |  |  |  |  Branch (127:40): [True: 24.6k, False: 2.92k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.90k, False: 1.36k]
  |  |  |  |  |  Branch (131:43): [True: 1.66k, False: 245]
  |  |  |  |  ------------------
  |  |  |  |  132|  27.9k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.25k, False: 349]
  |  |  |  |  |  Branch (132:27): [True: 1.01k, False: 248]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  27.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  54.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 27.0k, False: 316]
  |  |  |  |  |  |  |  Branch (127:40): [True: 24.9k, False: 2.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.10k, False: 1.34k]
  |  |  |  |  |  Branch (131:43): [True: 844, False: 260]
  |  |  |  |  ------------------
  |  |  |  |  132|  27.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.08k, False: 521]
  |  |  |  |  |  Branch (132:27): [True: 789, False: 296]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 27.9k, False: 57.0k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  58.4k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 6.88k, False: 51.5k]
  |  |  |  Branch (139:27): [True: 1.48k, False: 50.0k]
  |  |  |  Branch (139:46): [True: 556, False: 49.5k]
  |  |  ------------------
  |  |  140|  58.4k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.74k, False: 47.7k]
  |  |  |  Branch (140:27): [True: 2.31k, False: 45.4k]
  |  |  |  Branch (140:46): [True: 1.37k, False: 44.1k]
  |  |  ------------------
  |  |  141|  58.4k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.79k, False: 42.3k]
  |  |  |  Branch (141:27): [True: 732, False: 41.5k]
  |  |  |  Branch (141:46): [True: 5.86k, False: 35.7k]
  |  |  ------------------
  |  |  142|  58.4k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.75k, False: 33.9k]
  |  |  |  Branch (142:27): [True: 2.30k, False: 31.6k]
  |  |  ------------------
  ------------------
  497|  10.3M|        NEXT(cur);
  ------------------
  |  |  108|  10.4M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 26.5k, False: 10.3M]
  |  |  ------------------
  ------------------
  498|  31.8k|found:
  499|  31.8k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 31.8k, False: 0]
  ------------------
  500|  31.8k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 31.8k]
  ------------------
  501|  31.8k|	uri->authority = NULL;
  502|  31.8k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 31.8k]
  ------------------
  503|  31.8k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 27.1k, False: 4.70k]
  ------------------
  504|  27.1k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  27.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 27.1k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  27.1k|	    else
  507|  27.1k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  27.1k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 39, False: 27.1k]
  ------------------
  509|     39|                return(-1);
  510|  27.1k|	} else
  511|  4.70k|	    uri->server = NULL;
  512|  31.8k|    }
  513|  31.8k|    *str = cur;
  514|  31.8k|    return(0);
  515|  31.8k|}
uri.c:xmlParse3986DecOctet:
  415|  11.2k|xmlParse3986DecOctet(const char **str) {
  416|  11.2k|    const char *cur = *str;
  417|       |
  418|  11.2k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  11.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 10.5k, False: 673]
  |  |  |  Branch (127:40): [True: 10.2k, False: 267]
  |  |  ------------------
  ------------------
  419|    940|        return(1);
  420|  10.2k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  10.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 6.51k, False: 3.75k]
  |  |  |  Branch (127:40): [True: 5.01k, False: 1.49k]
  |  |  ------------------
  ------------------
  421|  5.24k|	cur++;
  422|  5.01k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.30k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 4.30k, False: 0]
  |  |  |  Branch (127:40): [True: 4.30k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.30k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.21k, False: 1.09k]
  |  |  |  Branch (127:40): [True: 2.46k, False: 746]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 4.30k, False: 706]
  ------------------
  423|  1.84k|	cur += 2;
  424|  3.17k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    456|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 456, False: 0]
  |  |  |  Branch (127:40): [True: 456, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    456|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 456, False: 0]
  |  |  |  Branch (127:40): [True: 456, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 456, False: 2.71k]
  ------------------
  425|    456|	cur += 3;
  426|  2.71k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.38k, False: 1.32k]
  |  Branch (426:31): [True: 1.38k, False: 0]
  ------------------
  427|  1.38k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    423|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 423, False: 0]
  |  |  |  Branch (127:40): [True: 423, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 423, False: 962]
  ------------------
  428|    423|	cur += 3;
  429|  2.29k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 962, False: 1.32k]
  |  Branch (429:31): [True: 562, False: 400]
  ------------------
  430|    562|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 562, False: 0]
  |  Branch (430:30): [True: 562, False: 0]
  ------------------
  431|    562|	cur += 3;
  432|  1.72k|    else
  433|  1.72k|        return(1);
  434|  8.53k|    *str = cur;
  435|  8.53k|    return(0);
  436|  10.2k|}
uri.c:xmlParse3986Port:
  342|  3.32k|{
  343|  3.32k|    const char *cur = *str;
  344|  3.32k|    int port = 0;
  345|       |
  346|  3.32k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.32k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 2.93k, False: 393]
  |  |  |  Branch (127:40): [True: 2.51k, False: 414]
  |  |  ------------------
  ------------------
  347|  10.7k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  10.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 8.93k, False: 1.78k]
  |  |  |  Branch (127:40): [True: 8.61k, False: 321]
  |  |  ------------------
  ------------------
  348|  8.61k|            int digit = *cur - '0';
  349|       |
  350|  8.61k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 209, False: 8.40k]
  ------------------
  351|    209|                return(1);
  352|  8.40k|            port *= 10;
  353|  8.40k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 209, False: 8.19k]
  ------------------
  354|    209|                return(1);
  355|  8.19k|	    port += digit;
  356|       |
  357|  8.19k|	    cur++;
  358|  8.19k|	}
  359|  2.10k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 2.10k, False: 0]
  ------------------
  360|  2.10k|	    uri->port = port;
  361|  2.10k|	*str = cur;
  362|  2.10k|	return(0);
  363|  2.51k|    }
  364|    807|    return(1);
  365|  3.32k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  30.5k|{
  610|  30.5k|    const char *cur;
  611|  30.5k|    int ret;
  612|       |
  613|  30.5k|    cur = *str;
  614|       |
  615|  93.1k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 62.5k, False: 30.5k]
  ------------------
  616|  62.5k|        cur++;
  617|  62.5k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  62.5k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 62.5k]
  ------------------
  619|  62.5k|    }
  620|  30.5k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 30.5k, False: 0]
  ------------------
  621|  30.5k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 30.5k]
  ------------------
  622|  30.5k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 16.7k, False: 13.8k]
  ------------------
  623|  16.7k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  16.7k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 16.7k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  16.7k|            else
  626|  16.7k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  16.7k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 10, False: 16.7k]
  ------------------
  628|     10|                return (-1);
  629|  16.7k|        } else {
  630|  13.8k|            uri->path = NULL;
  631|  13.8k|        }
  632|  30.5k|    }
  633|  30.5k|    *str = cur;
  634|  30.5k|    return (0);
  635|  30.5k|}
uri.c:xmlParse3986Segment:
  572|   302k|{
  573|   302k|    const char *cur;
  574|       |
  575|   302k|    cur = *str;
  576|   302k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   605k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   605k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 218k, False: 83.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   386k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  6.19k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  12.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.97k, False: 219]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.87k, False: 4.10k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.26k, False: 2.06k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 2.02k, False: 239]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  6.19k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.90k, False: 396]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.49k, False: 412]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.38k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  10.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.17k, False: 208]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.16k, False: 4.01k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.48k, False: 2.74k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.28k, False: 195]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.38k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.69k, False: 244]
  |  |  |  |  |  |  |  Branch (132:27): [True: 2.33k, False: 360]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 6.19k, False: 77.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   381k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.27k, False: 76.5k]
  |  |  |  |  |  Branch (139:27): [True: 2.70k, False: 73.7k]
  |  |  |  |  |  Branch (139:46): [True: 579, False: 73.2k]
  |  |  |  |  ------------------
  |  |  |  |  140|  78.7k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.08k, False: 72.1k]
  |  |  |  |  |  Branch (140:27): [True: 1.29k, False: 70.8k]
  |  |  |  |  |  Branch (140:46): [True: 24.2k, False: 46.6k]
  |  |  |  |  ------------------
  |  |  |  |  141|  78.7k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 3.00k, False: 43.6k]
  |  |  |  |  |  Branch (141:27): [True: 902, False: 42.7k]
  |  |  |  |  |  Branch (141:46): [True: 2.71k, False: 39.9k]
  |  |  |  |  ------------------
  |  |  |  |  142|  78.7k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 5.21k, False: 34.7k]
  |  |  |  |  |  Branch (142:27): [True: 2.10k, False: 32.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   302k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 4.26k, False: 28.4k]
  |  |  |  Branch (175:26): [True: 2.11k, False: 26.2k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 1.38k, False: 274k]
  ------------------
  577|  27.6k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 23.9k, False: 3.72k]
  ------------------
  578|  23.9k|	    return(0);
  579|  3.72k|	return(1);
  580|  27.6k|    }
  581|   274k|    NEXT(cur);
  ------------------
  |  |  108|   274k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 4.78k, False: 270k]
  |  |  ------------------
  ------------------
  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|  10.1M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  20.2M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  20.2M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 8.76M, False: 1.33M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  11.4M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  9.76k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  19.5k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 9.38k, False: 378]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 6.12k, False: 3.25k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.28k, False: 2.34k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.03k, False: 250]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  9.76k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.07k, False: 519]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.68k, False: 392]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  8.84k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  17.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 8.56k, False: 284]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 5.86k, False: 2.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.33k, False: 1.65k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.07k, False: 254]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  8.84k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.55k, False: 362]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.15k, False: 398]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 9.76k, False: 1.32M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  11.4M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 3.10k, False: 1.32M]
  |  |  |  |  |  Branch (139:27): [True: 1.78k, False: 1.32M]
  |  |  |  |  |  Branch (139:46): [True: 481, False: 1.31M]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.32M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.31k, False: 1.31M]
  |  |  |  |  |  Branch (140:27): [True: 1.96k, False: 1.31M]
  |  |  |  |  |  Branch (140:46): [True: 1.02M, False: 292k]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.32M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.50k, False: 289k]
  |  |  |  |  |  Branch (141:27): [True: 2.91k, False: 286k]
  |  |  |  |  |  Branch (141:46): [True: 2.47k, False: 284k]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.32M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.97k, False: 282k]
  |  |  |  |  |  Branch (142:27): [True: 1.44k, False: 281k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  10.1M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 13.5k, False: 267k]
  |  |  |  Branch (175:26): [True: 1.83k, False: 265k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 9.82M, False: 9.28k]
  ------------------
  592|  9.82M|        NEXT(cur);
  ------------------
  |  |  108|  10.1M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 8.08k, False: 9.81M]
  |  |  ------------------
  ------------------
  593|   274k|    *str = cur;
  594|   274k|    return (0);
  595|   302k|}
uri.c:xmlParse3986PathAbsolute:
  649|  8.81k|{
  650|  8.81k|    const char *cur;
  651|  8.81k|    int ret;
  652|       |
  653|  8.81k|    cur = *str;
  654|       |
  655|  8.81k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 8.81k]
  ------------------
  656|      0|        return(1);
  657|  8.81k|    cur++;
  658|  8.81k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  8.81k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 6.47k, False: 2.34k]
  ------------------
  660|  19.5k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 13.0k, False: 6.47k]
  ------------------
  661|  13.0k|	    cur++;
  662|  13.0k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  13.0k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 13.0k]
  ------------------
  664|  13.0k|	}
  665|  6.47k|    }
  666|  8.81k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 8.81k, False: 0]
  ------------------
  667|  8.81k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 8.81k]
  ------------------
  668|  8.81k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 8.81k, False: 0]
  ------------------
  669|  8.81k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  8.81k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 8.81k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  8.81k|            else
  672|  8.81k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  8.81k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 18, False: 8.79k]
  ------------------
  674|     18|                return (-1);
  675|  8.81k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  8.81k|    }
  679|  8.79k|    *str = cur;
  680|  8.79k|    return (0);
  681|  8.81k|}
uri.c:xmlIsUnreserved:
  196|  52.2M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  52.2M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 52.2M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  52.2M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  52.2M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  52.2M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 1.92M, False: 50.3M]
  |  |  |  |  |  Branch (128:41): [True: 1.91M, False: 11.9k]
  |  |  |  |  ------------------
  |  |  |  |  129|  52.2M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 43.0M, False: 7.27M]
  |  |  |  |  |  Branch (129:41): [True: 43.0M, False: 19.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  7.29M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 728k, False: 6.56M]
  |  |  |  |  |  Branch (127:40): [True: 425k, False: 302k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 49.9k, False: 6.81M]
  |  |  ------------------
  |  |  162|  52.2M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 155k, False: 6.66M]
  |  |  |  Branch (162:27): [True: 2.93k, False: 6.65M]
  |  |  |  Branch (162:46): [True: 11.3k, False: 6.64M]
  |  |  ------------------
  ------------------
  201|  45.5M|        return(1);
  202|       |
  203|  6.64M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  6.64M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 6.64M]
  ------------------
  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|  6.64M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  6.64M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 6.64M]
  ------------------
  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|  6.64M|    return(0);
  212|  6.64M|}
uri.c:xmlParse3986PathRootless:
  695|  6.99k|{
  696|  6.99k|    const char *cur;
  697|  6.99k|    int ret;
  698|       |
  699|  6.99k|    cur = *str;
  700|       |
  701|  6.99k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  6.99k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 6.99k]
  ------------------
  703|  9.96k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 2.97k, False: 6.99k]
  ------------------
  704|  2.97k|        cur++;
  705|  2.97k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  2.97k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 2.97k]
  ------------------
  707|  2.97k|    }
  708|  6.99k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 6.99k, False: 0]
  ------------------
  709|  6.99k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 6.99k]
  ------------------
  710|  6.99k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 6.99k, False: 0]
  ------------------
  711|  6.99k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  6.99k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 6.99k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  6.99k|            else
  714|  6.99k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  6.99k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 18, False: 6.97k]
  ------------------
  716|     18|                return (-1);
  717|  6.99k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  6.99k|    }
  721|  6.97k|    *str = cur;
  722|  6.97k|    return (0);
  723|  6.99k|}
uri.c:xmlParse3986Query:
  300|  10.1k|{
  301|  10.1k|    const char *cur;
  302|       |
  303|  10.1k|    cur = *str;
  304|       |
  305|  24.6M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  24.6M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  49.2M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 24.5M, False: 141k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  24.7M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  21.1k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  42.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 20.8k, False: 347]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 17.6k, False: 3.18k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.00k, False: 1.52k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.73k, False: 271]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  21.1k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.41k, False: 380]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.06k, False: 352]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  20.4k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  40.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 20.1k, False: 304]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 15.9k, False: 4.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.18k, False: 3.27k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 890, False: 291]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  20.4k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 3.20k, False: 366]
  |  |  |  |  |  |  |  Branch (132:27): [True: 2.76k, False: 434]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 21.1k, False: 119k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  24.7M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.56k, False: 119k]
  |  |  |  |  |  Branch (139:27): [True: 854, False: 119k]
  |  |  |  |  |  Branch (139:46): [True: 256, False: 118k]
  |  |  |  |  ------------------
  |  |  |  |  140|   121k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.43k, False: 117k]
  |  |  |  |  |  Branch (140:27): [True: 1.84k, False: 115k]
  |  |  |  |  |  Branch (140:46): [True: 51.3k, False: 64.2k]
  |  |  |  |  ------------------
  |  |  |  |  141|   121k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 754, False: 63.4k]
  |  |  |  |  |  Branch (141:27): [True: 444, False: 63.0k]
  |  |  |  |  |  Branch (141:46): [True: 1.04k, False: 61.9k]
  |  |  |  |  ------------------
  |  |  |  |  142|   121k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 937, False: 61.0k]
  |  |  |  |  |  Branch (142:27): [True: 953, False: 60.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  24.6M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.97k, False: 56.1k]
  |  |  |  Branch (175:26): [True: 3.27k, False: 52.8k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 19.6k, False: 33.1k]
  |  Branch (305:54): [True: 22.9k, False: 10.1k]
  ------------------
  306|  24.6M|        NEXT(cur);
  ------------------
  |  |  108|  24.6M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 19.6k, False: 24.6M]
  |  |  ------------------
  ------------------
  307|  10.1k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 10.1k, False: 0]
  ------------------
  308|  10.1k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 10.1k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  10.1k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  10.1k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 10.1k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  10.1k|	else
  313|  10.1k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  10.1k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 21, False: 10.1k]
  ------------------
  315|     21|            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|  10.1k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 10.1k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  10.1k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  10.1k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  10.1k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 32, False: 10.1k]
  ------------------
  324|     32|            return (-1);
  325|  10.1k|    }
  326|  10.1k|    *str = cur;
  327|  10.1k|    return (0);
  328|  10.1k|}
uri.c:xmlParse3986Fragment:
  267|   174k|{
  268|   174k|    const char *cur;
  269|       |
  270|   174k|    cur = *str;
  271|       |
  272|  2.15M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  2.15M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  4.31M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 1.41M, False: 742k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  2.89M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.9k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  21.9k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.7k, False: 219]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.85k, False: 2.90k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.20k, False: 1.92k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.00k, False: 196]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.9k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.73k, False: 383]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.45k, False: 278]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  20.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.0k, False: 240]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.35k, False: 2.71k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.21k, False: 1.73k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.02k, False: 196]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.48k, False: 446]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.11k, False: 374]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 10.9k, False: 731k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  2.88M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 181k, False: 551k]
  |  |  |  |  |  Branch (139:27): [True: 732, False: 550k]
  |  |  |  |  |  Branch (139:46): [True: 625, False: 549k]
  |  |  |  |  ------------------
  |  |  |  |  140|   732k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 6.12k, False: 543k]
  |  |  |  |  |  Branch (140:27): [True: 7.77k, False: 535k]
  |  |  |  |  |  Branch (140:46): [True: 3.53k, False: 532k]
  |  |  |  |  ------------------
  |  |  |  |  141|   732k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.57k, False: 530k]
  |  |  |  |  |  Branch (141:27): [True: 13.7k, False: 517k]
  |  |  |  |  |  Branch (141:46): [True: 5.76k, False: 511k]
  |  |  |  |  ------------------
  |  |  |  |  142|   732k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.20k, False: 510k]
  |  |  |  |  |  Branch (142:27): [True: 1.10k, False: 509k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  2.15M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 156k, False: 352k]
  |  |  |  Branch (175:26): [True: 2.99k, False: 349k]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 168k, False: 180k]
  |  Branch (272:54): [True: 2.54k, False: 178k]
  ------------------
  273|   178k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 1.95k, False: 176k]
  |  Branch (273:29): [True: 1.36k, False: 174k]
  ------------------
  274|  1.98M|        NEXT(cur);
  ------------------
  |  |  108|  1.98M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 9.49k, False: 1.97M]
  |  |  ------------------
  ------------------
  275|   174k|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 174k, False: 0]
  ------------------
  276|   174k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 174k]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|   174k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   174k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 174k]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|   174k|	else
  281|   174k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|   174k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 39, False: 174k]
  ------------------
  283|     39|            return (-1);
  284|   174k|    }
  285|   174k|    *str = cur;
  286|   174k|    return (0);
  287|   174k|}
uri.c:xmlParse3986RelativeRef:
  833|   342k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   342k|    int ret;
  835|       |
  836|   342k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 10.8k, False: 332k]
  |  Branch (836:26): [True: 3.14k, False: 7.70k]
  ------------------
  837|  3.14k|        str += 2;
  838|  3.14k|	ret = xmlParse3986Authority(uri, &str);
  839|  3.14k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 283, False: 2.86k]
  ------------------
  840|  2.86k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  2.86k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 1, False: 2.86k]
  ------------------
  842|   339k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.70k, False: 332k]
  ------------------
  843|  7.70k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.70k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 17, False: 7.69k]
  ------------------
  845|   332k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   332k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   664k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 136k, False: 195k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   527k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.04k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  8.08k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.69k, False: 351]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 925, False: 2.76k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.50k, False: 1.61k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.29k, False: 212]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.04k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.44k, False: 386]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.05k, False: 387]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.27k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  6.54k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.96k, False: 302]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 884, False: 2.08k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 711, False: 1.67k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 501, False: 210]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.27k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.44k, False: 440]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.10k, False: 342]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 4.04k, False: 191k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   524k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.63k, False: 191k]
  |  |  |  |  |  Branch (139:27): [True: 2.10k, False: 189k]
  |  |  |  |  |  Branch (139:46): [True: 322, False: 188k]
  |  |  |  |  ------------------
  |  |  |  |  140|   192k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 765, False: 188k]
  |  |  |  |  |  Branch (140:27): [True: 502, False: 187k]
  |  |  |  |  |  Branch (140:46): [True: 1.46k, False: 186k]
  |  |  |  |  ------------------
  |  |  |  |  141|   192k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.49k, False: 184k]
  |  |  |  |  |  Branch (141:27): [True: 472, False: 184k]
  |  |  |  |  |  Branch (141:46): [True: 1.45k, False: 182k]
  |  |  |  |  ------------------
  |  |  |  |  142|   192k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 4.89k, False: 177k]
  |  |  |  |  |  Branch (142:27): [True: 1.06k, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   332k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 1.38k, False: 175k]
  |  |  |  Branch (175:26): [True: 841, False: 174k]
  |  |  ------------------
  ------------------
  846|   157k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   157k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.52k, False: 156k]
  ------------------
  848|   174k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   174k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 174k, False: 0]
  ------------------
  851|   174k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 174k]
  ------------------
  852|   174k|	    uri->path = NULL;
  853|   174k|	}
  854|   174k|    }
  855|       |
  856|   341k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 6.68k, False: 334k]
  ------------------
  857|  6.68k|	str++;
  858|  6.68k|	ret = xmlParse3986Query(uri, &str);
  859|  6.68k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 37, False: 6.64k]
  ------------------
  860|  6.68k|    }
  861|   341k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 173k, False: 167k]
  ------------------
  862|   173k|	str++;
  863|   173k|	ret = xmlParse3986Fragment(uri, &str);
  864|   173k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 35, False: 173k]
  ------------------
  865|   173k|    }
  866|   340k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 24.8k, False: 316k]
  ------------------
  867|  24.8k|	xmlCleanURI(uri);
  868|  24.8k|	return(1);
  869|  24.8k|    }
  870|   316k|    return(0);
  871|   340k|}
uri.c:xmlParse3986PathNoScheme:
  737|   157k|{
  738|   157k|    const char *cur;
  739|   157k|    int ret;
  740|       |
  741|   157k|    cur = *str;
  742|       |
  743|   157k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   157k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 1.38k, False: 156k]
  ------------------
  745|   206k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 50.6k, False: 156k]
  ------------------
  746|  50.6k|        cur++;
  747|  50.6k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  50.6k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 50.6k]
  ------------------
  749|  50.6k|    }
  750|   156k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 156k, False: 0]
  ------------------
  751|   156k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 156k]
  ------------------
  752|   156k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 156k, False: 0]
  ------------------
  753|   156k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   156k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 156k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   156k|            else
  756|   156k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   156k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 133, False: 156k]
  ------------------
  758|    133|                return (-1);
  759|   156k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   156k|    }
  763|   156k|    *str = cur;
  764|   156k|    return (0);
  765|   156k|}
uri.c:xmlSaveUriRealloc:
 1074|  9.17k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  9.17k|    xmlChar *temp;
 1076|  9.17k|    int newSize;
 1077|       |
 1078|  9.17k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  9.17k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  9.17k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 27, False: 9.14k]
  ------------------
 1080|     27|        return(NULL);
 1081|  9.14k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  9.14k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 30, False: 9.11k]
  ------------------
 1083|     30|        return(NULL);
 1084|  9.11k|    *max = newSize;
 1085|  9.11k|    return(temp);
 1086|  9.14k|}
uri.c:xmlNormalizePath:
 1456|  53.5k|xmlNormalizePath(char *path, int isFile) {
 1457|  53.5k|    char *cur, *out;
 1458|  53.5k|    int numSeg = 0;
 1459|       |
 1460|  53.5k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.52k, False: 51.9k]
  ------------------
 1461|  1.52k|	return(-1);
 1462|       |
 1463|  51.9k|    cur = path;
 1464|  51.9k|    out = path;
 1465|       |
 1466|  51.9k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 198, False: 51.7k]
  ------------------
 1467|    198|        return(0);
 1468|       |
 1469|  51.7k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 7.47k, False: 44.3k]
  ------------------
 1470|  7.47k|        cur++;
 1471|  7.47k|        *out++ = '/';
 1472|  7.47k|    }
 1473|       |
 1474|   243k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 193k, False: 50.6k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   225k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 32.0k, False: 193k]
  ------------------
 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|  32.0k|            cur++;
 1486|  32.0k|        }
 1487|       |
 1488|   193k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 94.9k, False: 98.2k]
  ------------------
 1489|  94.9k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 701, False: 94.2k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|    701|                break;
 1492|  94.2k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 33.4k, False: 60.8k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  33.4k|                cur += 2;
 1495|  33.4k|                continue;
 1496|  60.8k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 59.9k, False: 942]
  ------------------
 1497|  59.9k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 609, False: 59.3k]
  |  Branch (1497:42): [True: 58.8k, False: 474]
  ------------------
 1498|  59.4k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 4.78k, False: 54.6k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  24.3k|                    do {
 1501|  24.3k|                        out--;
 1502|  24.3k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 23.8k, False: 502]
  ------------------
 1503|  23.8k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 19.5k, False: 4.28k]
  ------------------
 1504|  4.78k|                    numSeg--;
 1505|       |
 1506|  4.78k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 235, False: 4.55k]
  ------------------
 1507|    235|                        break;
 1508|  4.55k|                    cur += 3;
 1509|  4.55k|                    continue;
 1510|  54.6k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 604, False: 54.0k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    604|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 199, False: 405]
  ------------------
 1513|    199|                        break;
 1514|    405|                    cur += 3;
 1515|    405|                    continue;
 1516|  54.0k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  54.0k|                    numSeg--;
 1519|  54.0k|                }
 1520|  59.4k|            }
 1521|  94.9k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  1.32M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 1.27M, False: 49.5k]
  |  Branch (1524:31): [True: 1.17M, False: 104k]
  ------------------
 1525|  1.17M|            *out++ = *cur++;
 1526|  1.17M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   153k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 104k, False: 49.5k]
  ------------------
 1530|   104k|            cur++;
 1531|   104k|            *out++ = '/';
 1532|   104k|        }
 1533|       |
 1534|   153k|        numSeg++;
 1535|   153k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|  51.7k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 43.9k, False: 7.83k]
  |  Branch (1538:21): [True: 603, False: 43.3k]
  ------------------
 1539|    603|        *out++ = '.';
 1540|  51.7k|    *out = 0;
 1541|       |
 1542|  51.7k|    return(0);
 1543|  51.9k|}
uri.c:xmlIsPathSeparator:
 1434|  1.85M|xmlIsPathSeparator(int c, int isFile) {
 1435|  1.85M|    (void) isFile;
 1436|       |
 1437|  1.85M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 253k, False: 1.60M]
  ------------------
 1438|   253k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  1.60M|    return(0);
 1446|  1.85M|}
uri.c:is_hex:
 1559|  3.20M|static int is_hex(char c) {
 1560|  3.20M|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 3.20M, False: 1.67k]
  |  Branch (1560:24): [True: 3.15M, False: 42.0k]
  ------------------
 1561|  43.6k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 17.4k, False: 26.2k]
  |  Branch (1561:24): [True: 16.7k, False: 713]
  ------------------
 1562|  26.9k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 22.9k, False: 4.06k]
  |  Branch (1562:24): [True: 21.8k, False: 1.03k]
  ------------------
 1563|  3.19M|	return(1);
 1564|  5.10k|    return(0);
 1565|  3.20M|}
uri.c:xmlResolvePath:
 1863|   177k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   177k|    const xmlChar *fragment;
 1865|   177k|    xmlChar *tmp = NULL;
 1866|   177k|    xmlChar *ref = NULL;
 1867|   177k|    xmlChar *result = NULL;
 1868|   177k|    int ret = -1;
 1869|   177k|    int i;
 1870|       |
 1871|   177k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 177k]
  ------------------
 1872|      0|        return(1);
 1873|   177k|    *out = NULL;
 1874|       |
 1875|   177k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 177k]
  |  Branch (1875:29): [True: 650, False: 177k]
  ------------------
 1876|    650|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 650]
  |  Branch (1876:31): [True: 302, False: 348]
  ------------------
 1877|    302|            return(1);
 1878|    348|        ref = xmlStrdup(base);
 1879|    348|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 345]
  ------------------
 1880|      3|            goto err_memory;
 1881|    345|        *out = ref;
 1882|    345|        return(0);
 1883|    348|    }
 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|   177k|    fragment = xmlStrchr(escRef, '#');
 1891|   177k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 162k, False: 14.5k]
  ------------------
 1892|   162k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   162k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 8, False: 162k]
  ------------------
 1894|      8|            goto err_memory;
 1895|   162k|        escRef = tmp;
 1896|   162k|    }
 1897|       |
 1898|   177k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   177k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 52, False: 177k]
  ------------------
 1900|     52|        goto err_memory;
 1901|       |
 1902|   177k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 177k]
  |  Branch (1902:27): [True: 163k, False: 13.7k]
  ------------------
 1903|   163k|        goto done;
 1904|       |
 1905|  13.7k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 2.54k, False: 11.2k]
  ------------------
 1906|  2.54k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  11.2k|    i = xmlStrlen(base);
 1912|  75.0k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 73.5k, False: 1.43k]
  |  Branch (1912:23): [True: 63.7k, False: 9.78k]
  ------------------
 1913|  63.7k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  11.2k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 9.78k, False: 1.43k]
  ------------------
 1919|  9.78k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  9.78k|        result = xmlMalloc(i + refLen + 1);
 1922|  9.78k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 33, False: 9.74k]
  ------------------
 1923|     33|            goto err_memory;
 1924|       |
 1925|  9.74k|        memcpy(result, base, i);
 1926|  9.74k|        memcpy(result + i, ref, refLen + 1);
 1927|  9.74k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  11.1k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   177k|done:
 1935|   177k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 167k, False: 9.74k]
  ------------------
 1936|   167k|        result = ref;
 1937|   167k|        ref = NULL;
 1938|   167k|    }
 1939|       |
 1940|   177k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 162k, False: 14.4k]
  ------------------
 1941|   162k|        result = xmlStrcat(result, fragment);
 1942|   162k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 9, False: 162k]
  ------------------
 1943|      9|            goto err_memory;
 1944|   162k|    }
 1945|       |
 1946|   177k|    *out = result;
 1947|   177k|    ret = 0;
 1948|       |
 1949|   177k|err_memory:
 1950|   177k|    xmlFree(tmp);
 1951|   177k|    xmlFree(ref);
 1952|   177k|    return(ret);
 1953|   177k|}
uri.c:xmlIsAbsolutePath:
 1837|  47.9k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|  47.9k|    int c = path[0];
 1839|       |
 1840|  47.9k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 3.44k, False: 44.5k]
  ------------------
 1841|  3.44k|        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|  44.5k|    return(0);
 1851|  47.9k|}
uri.c:xmlParseUriOrPath:
 2344|  35.3k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  35.3k|    xmlURIPtr uri;
 2346|  35.3k|    char *buf = NULL;
 2347|  35.3k|    int ret;
 2348|       |
 2349|  35.3k|    *out = NULL;
 2350|  35.3k|    *drive = 0;
 2351|       |
 2352|  35.3k|    uri = xmlCreateURI();
 2353|  35.3k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 20, False: 35.2k]
  ------------------
 2354|     20|        ret = -1;
 2355|     20|	goto done;
 2356|     20|    }
 2357|       |
 2358|  35.2k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  35.2k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  35.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 34.2k, False: 1.06k]
  ------------------
 2359|  34.2k|        const char *path;
 2360|  34.2k|        size_t pathSize;
 2361|  34.2k|        int prependSlash = 0;
 2362|       |
 2363|  34.2k|        buf = xmlMemStrdup(str);
 2364|  34.2k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 11, False: 34.2k]
  ------------------
 2365|     11|            ret = -1;
 2366|     11|            goto done;
 2367|     11|        }
 2368|  34.2k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  34.2k|        path = buf;
 2371|       |
 2372|  34.2k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  34.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 903, False: 33.3k]
  ------------------
 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|    903|        }
 2426|       |
 2427|  34.2k|        pathSize = strlen(path);
 2428|  34.2k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  34.2k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 19, False: 34.1k]
  ------------------
 2430|     19|            ret = -1;
 2431|     19|            goto done;
 2432|     19|        }
 2433|  34.1k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 34.1k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  34.1k|        } else {
 2437|  34.1k|            memcpy(uri->path, path, pathSize + 1);
 2438|  34.1k|        }
 2439|  34.1k|    } else {
 2440|  1.06k|	ret = xmlParseURIReference(uri, str);
 2441|  1.06k|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 575, False: 487]
  ------------------
 2442|    575|	    goto done;
 2443|       |
 2444|    487|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    487|    }
 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|  34.6k|    *out = uri;
 2456|  34.6k|    uri = NULL;
 2457|  34.6k|    ret = 0;
 2458|       |
 2459|  35.3k|done:
 2460|  35.3k|    xmlFreeURI(uri);
 2461|  35.3k|    xmlFree(buf);
 2462|       |
 2463|  35.3k|    return(ret);
 2464|  34.6k|}

xmlValidBuildContentModel:
  597|  1.91k|xmlValidBuildContentModel(xmlValidCtxt *ctxt, xmlElement *elem) {
  598|  1.91k|    int ret = 0;
  599|       |
  600|  1.91k|    if ((ctxt == NULL) || (elem == NULL))
  ------------------
  |  Branch (600:9): [True: 0, False: 1.91k]
  |  Branch (600:27): [True: 0, False: 1.91k]
  ------------------
  601|      0|	return(0);
  602|  1.91k|    if (elem->type != XML_ELEMENT_DECL)
  ------------------
  |  Branch (602:9): [True: 0, False: 1.91k]
  ------------------
  603|      0|	return(0);
  604|  1.91k|    if (elem->etype != XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (604:9): [True: 0, False: 1.91k]
  ------------------
  605|      0|	return(1);
  606|       |    /* TODO: should we rebuild in this case ? */
  607|  1.91k|    if (elem->contModel != NULL) {
  ------------------
  |  Branch (607:9): [True: 0, False: 1.91k]
  ------------------
  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|  1.91k|    ctxt->am = xmlNewAutomata();
  616|  1.91k|    if (ctxt->am == NULL) {
  ------------------
  |  Branch (616:9): [True: 14, False: 1.89k]
  ------------------
  617|     14|        xmlVErrMemory(ctxt);
  618|     14|	return(0);
  619|     14|    }
  620|  1.89k|    ctxt->state = xmlAutomataGetInitState(ctxt->am);
  621|  1.89k|    if (xmlValidBuildAContentModel(elem->content, ctxt, elem->name) == 0)
  ------------------
  |  Branch (621:9): [True: 16, False: 1.88k]
  ------------------
  622|     16|        goto done;
  623|  1.88k|    xmlAutomataSetFinalState(ctxt->am, ctxt->state);
  624|  1.88k|    elem->contModel = xmlAutomataCompile(ctxt->am);
  625|  1.88k|    if (elem->contModel == NULL) {
  ------------------
  |  Branch (625:9): [True: 509, False: 1.37k]
  ------------------
  626|    509|        xmlVErrMemory(ctxt);
  627|    509|        goto done;
  628|    509|    }
  629|  1.37k|    if (xmlRegexpIsDeterminist(elem->contModel) != 1) {
  ------------------
  |  Branch (629:9): [True: 440, False: 933]
  ------------------
  630|    440|	char expr[5000];
  631|    440|	expr[0] = 0;
  632|    440|	xmlSnprintfElementContent(expr, 5000, elem->content, 1);
  633|    440|	xmlErrValidNode(ctxt, (xmlNodePtr) elem,
  634|    440|	                XML_DTD_CONTENT_NOT_DETERMINIST,
  635|    440|	       "Content model of %s is not deterministic: %s\n",
  636|    440|	       elem->name, BAD_CAST expr, NULL);
  ------------------
  |  |   34|    440|#define BAD_CAST (xmlChar *)
  ------------------
  637|    440|        ctxt->valid = 0;
  638|    440|	goto done;
  639|    440|    }
  640|       |
  641|    933|    ret = 1;
  642|       |
  643|  1.89k|done:
  644|  1.89k|    ctxt->state = NULL;
  645|  1.89k|    xmlFreeAutomata(ctxt->am);
  646|       |    ctxt->am = NULL;
  647|  1.89k|    return(ret);
  648|    933|}
xmlNewDocElementContent:
  708|   434k|                        xmlElementContentType type) {
  709|   434k|    xmlElementContentPtr ret;
  710|   434k|    xmlDictPtr dict = NULL;
  711|       |
  712|   434k|    if (doc != NULL)
  ------------------
  |  Branch (712:9): [True: 434k, False: 233]
  ------------------
  713|   434k|        dict = doc->dict;
  714|       |
  715|   434k|    ret = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  716|   434k|    if (ret == NULL)
  ------------------
  |  Branch (716:9): [True: 14, False: 434k]
  ------------------
  717|     14|	return(NULL);
  718|   434k|    memset(ret, 0, sizeof(xmlElementContent));
  719|   434k|    ret->type = type;
  720|   434k|    ret->ocur = XML_ELEMENT_CONTENT_ONCE;
  721|   434k|    if (name != NULL) {
  ------------------
  |  Branch (721:9): [True: 219k, False: 214k]
  ------------------
  722|   219k|        int l;
  723|   219k|	const xmlChar *tmp;
  724|       |
  725|   219k|	tmp = xmlSplitQName3(name, &l);
  726|   219k|	if (tmp == NULL) {
  ------------------
  |  Branch (726:6): [True: 211k, False: 8.25k]
  ------------------
  727|   211k|	    if (dict == NULL)
  ------------------
  |  Branch (727:10): [True: 33.6k, False: 177k]
  ------------------
  728|  33.6k|		ret->name = xmlStrdup(name);
  729|   177k|	    else
  730|   177k|	        ret->name = xmlDictLookup(dict, name, -1);
  731|   211k|	} else {
  732|  8.25k|	    if (dict == NULL) {
  ------------------
  |  Branch (732:10): [True: 2.86k, False: 5.38k]
  ------------------
  733|  2.86k|		ret->prefix = xmlStrndup(name, l);
  734|  2.86k|		ret->name = xmlStrdup(tmp);
  735|  5.38k|	    } else {
  736|  5.38k|	        ret->prefix = xmlDictLookup(dict, name, l);
  737|  5.38k|		ret->name = xmlDictLookup(dict, tmp, -1);
  738|  5.38k|	    }
  739|  8.25k|            if (ret->prefix == NULL)
  ------------------
  |  Branch (739:17): [True: 1, False: 8.25k]
  ------------------
  740|      1|                goto error;
  741|  8.25k|	}
  742|   219k|        if (ret->name == NULL)
  ------------------
  |  Branch (742:13): [True: 1, False: 219k]
  ------------------
  743|      1|            goto error;
  744|   219k|    }
  745|   434k|    return(ret);
  746|       |
  747|      2|error:
  748|      2|    xmlFreeDocElementContent(doc, ret);
  749|       |    return(NULL);
  750|   434k|}
xmlCopyDocElementContent:
  778|  25.9k|xmlCopyDocElementContent(xmlDoc *doc, xmlElementContent *cur) {
  779|  25.9k|    xmlElementContentPtr ret = NULL, prev = NULL, tmp;
  780|  25.9k|    xmlDictPtr dict = NULL;
  781|       |
  782|  25.9k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (782:9): [True: 0, False: 25.9k]
  ------------------
  783|       |
  784|  25.9k|    if (doc != NULL)
  ------------------
  |  Branch (784:9): [True: 0, False: 25.9k]
  ------------------
  785|      0|        dict = doc->dict;
  786|       |
  787|  25.9k|    ret = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  788|  25.9k|    if (ret == NULL)
  ------------------
  |  Branch (788:9): [True: 19, False: 25.9k]
  ------------------
  789|     19|	return(NULL);
  790|  25.9k|    memset(ret, 0, sizeof(xmlElementContent));
  791|  25.9k|    ret->type = cur->type;
  792|  25.9k|    ret->ocur = cur->ocur;
  793|  25.9k|    if (cur->name != NULL) {
  ------------------
  |  Branch (793:9): [True: 20.6k, False: 5.23k]
  ------------------
  794|  20.6k|	if (dict)
  ------------------
  |  Branch (794:6): [True: 0, False: 20.6k]
  ------------------
  795|      0|	    ret->name = xmlDictLookup(dict, cur->name, -1);
  796|  20.6k|	else
  797|  20.6k|	    ret->name = xmlStrdup(cur->name);
  798|  20.6k|        if (ret->name == NULL)
  ------------------
  |  Branch (798:13): [True: 15, False: 20.6k]
  ------------------
  799|     15|            goto error;
  800|  20.6k|    }
  801|       |
  802|  25.9k|    if (cur->prefix != NULL) {
  ------------------
  |  Branch (802:9): [True: 2.03k, False: 23.8k]
  ------------------
  803|  2.03k|	if (dict)
  ------------------
  |  Branch (803:6): [True: 0, False: 2.03k]
  ------------------
  804|      0|	    ret->prefix = xmlDictLookup(dict, cur->prefix, -1);
  805|  2.03k|	else
  806|  2.03k|	    ret->prefix = xmlStrdup(cur->prefix);
  807|  2.03k|        if (ret->prefix == NULL)
  ------------------
  |  Branch (807:13): [True: 3, False: 2.03k]
  ------------------
  808|      3|            goto error;
  809|  2.03k|    }
  810|  25.9k|    if (cur->c1 != NULL) {
  ------------------
  |  Branch (810:9): [True: 4.71k, False: 21.1k]
  ------------------
  811|  4.71k|        ret->c1 = xmlCopyDocElementContent(doc, cur->c1);
  812|  4.71k|        if (ret->c1 == NULL)
  ------------------
  |  Branch (812:13): [True: 9, False: 4.70k]
  ------------------
  813|      9|            goto error;
  814|  4.70k|	ret->c1->parent = ret;
  815|  4.70k|    }
  816|  25.8k|    if (cur->c2 != NULL) {
  ------------------
  |  Branch (816:9): [True: 4.70k, False: 21.1k]
  ------------------
  817|  4.70k|        prev = ret;
  818|  4.70k|	cur = cur->c2;
  819|  26.1k|	while (cur != NULL) {
  ------------------
  |  Branch (819:9): [True: 21.4k, False: 4.62k]
  ------------------
  820|  21.4k|	    tmp = (xmlElementContentPtr) xmlMalloc(sizeof(xmlElementContent));
  821|  21.4k|	    if (tmp == NULL)
  ------------------
  |  Branch (821:10): [True: 16, False: 21.4k]
  ------------------
  822|     16|                goto error;
  823|  21.4k|	    memset(tmp, 0, sizeof(xmlElementContent));
  824|  21.4k|	    tmp->type = cur->type;
  825|  21.4k|	    tmp->ocur = cur->ocur;
  826|  21.4k|	    prev->c2 = tmp;
  827|  21.4k|	    tmp->parent = prev;
  828|  21.4k|	    if (cur->name != NULL) {
  ------------------
  |  Branch (828:10): [True: 4.63k, False: 16.8k]
  ------------------
  829|  4.63k|		if (dict)
  ------------------
  |  Branch (829:7): [True: 0, False: 4.63k]
  ------------------
  830|      0|		    tmp->name = xmlDictLookup(dict, cur->name, -1);
  831|  4.63k|		else
  832|  4.63k|		    tmp->name = xmlStrdup(cur->name);
  833|  4.63k|                if (tmp->name == NULL)
  ------------------
  |  Branch (833:21): [True: 11, False: 4.62k]
  ------------------
  834|     11|                    goto error;
  835|  4.63k|	    }
  836|       |
  837|  21.4k|	    if (cur->prefix != NULL) {
  ------------------
  |  Branch (837:10): [True: 425, False: 21.0k]
  ------------------
  838|    425|		if (dict)
  ------------------
  |  Branch (838:7): [True: 0, False: 425]
  ------------------
  839|      0|		    tmp->prefix = xmlDictLookup(dict, cur->prefix, -1);
  840|    425|		else
  841|    425|		    tmp->prefix = xmlStrdup(cur->prefix);
  842|    425|                if (tmp->prefix == NULL)
  ------------------
  |  Branch (842:21): [True: 3, False: 422]
  ------------------
  843|      3|                    goto error;
  844|    425|	    }
  845|  21.4k|	    if (cur->c1 != NULL) {
  ------------------
  |  Branch (845:10): [True: 16.8k, False: 4.62k]
  ------------------
  846|  16.8k|	        tmp->c1 = xmlCopyDocElementContent(doc,cur->c1);
  847|  16.8k|	        if (tmp->c1 == NULL)
  ------------------
  |  Branch (847:14): [True: 47, False: 16.7k]
  ------------------
  848|     47|                    goto error;
  849|  16.7k|		tmp->c1->parent = tmp;
  850|  16.7k|            }
  851|  21.4k|	    prev = tmp;
  852|  21.4k|	    cur = cur->c2;
  853|  21.4k|	}
  854|  4.70k|    }
  855|  25.8k|    return(ret);
  856|       |
  857|    104|error:
  858|    104|    xmlFreeElementContent(ret);
  859|       |    return(NULL);
  860|  25.8k|}
xmlCopyElementContent:
  872|  4.39k|xmlCopyElementContent(xmlElementContent *cur) {
  873|       |    return(xmlCopyDocElementContent(NULL, cur));
  874|  4.39k|}
xmlFreeDocElementContent:
  885|  38.3k|xmlFreeDocElementContent(xmlDoc *doc, xmlElementContent *cur) {
  886|  38.3k|    xmlDictPtr dict = NULL;
  887|  38.3k|    size_t depth = 0;
  888|       |
  889|  38.3k|    if (cur == NULL)
  ------------------
  |  Branch (889:9): [True: 15.0k, False: 23.2k]
  ------------------
  890|  15.0k|        return;
  891|  23.2k|    if (doc != NULL)
  ------------------
  |  Branch (891:9): [True: 18.8k, False: 4.46k]
  ------------------
  892|  18.8k|        dict = doc->dict;
  893|       |
  894|   481k|    while (1) {
  ------------------
  |  Branch (894:12): [True: 481k, Folded]
  ------------------
  895|   481k|        xmlElementContentPtr parent;
  896|       |
  897|   711k|        while ((cur->c1 != NULL) || (cur->c2 != NULL)) {
  ------------------
  |  Branch (897:16): [True: 230k, False: 481k]
  |  Branch (897:37): [True: 0, False: 481k]
  ------------------
  898|   230k|            cur = (cur->c1 != NULL) ? cur->c1 : cur->c2;
  ------------------
  |  Branch (898:19): [True: 230k, False: 0]
  ------------------
  899|   230k|            depth += 1;
  900|   230k|        }
  901|       |
  902|   481k|	if (dict) {
  ------------------
  |  Branch (902:6): [True: 361k, False: 120k]
  ------------------
  903|   361k|	    if ((cur->name != NULL) && (!xmlDictOwns(dict, cur->name)))
  ------------------
  |  Branch (903:10): [True: 182k, False: 178k]
  |  Branch (903:33): [True: 0, False: 182k]
  ------------------
  904|      0|	        xmlFree((xmlChar *) cur->name);
  905|   361k|	    if ((cur->prefix != NULL) && (!xmlDictOwns(dict, cur->prefix)))
  ------------------
  |  Branch (905:10): [True: 5.38k, False: 356k]
  |  Branch (905:35): [True: 0, False: 5.38k]
  ------------------
  906|      0|	        xmlFree((xmlChar *) cur->prefix);
  907|   361k|	} else {
  908|   120k|	    if (cur->name != NULL) xmlFree((xmlChar *) cur->name);
  ------------------
  |  Branch (908:10): [True: 61.8k, False: 58.3k]
  ------------------
  909|   120k|	    if (cur->prefix != NULL) xmlFree((xmlChar *) cur->prefix);
  ------------------
  |  Branch (909:10): [True: 5.32k, False: 114k]
  ------------------
  910|   120k|	}
  911|   481k|        parent = cur->parent;
  912|   481k|        if ((depth == 0) || (parent == NULL)) {
  ------------------
  |  Branch (912:13): [True: 23.2k, False: 458k]
  |  Branch (912:29): [True: 0, False: 458k]
  ------------------
  913|  23.2k|            xmlFree(cur);
  914|  23.2k|            break;
  915|  23.2k|        }
  916|   458k|        if (cur == parent->c1)
  ------------------
  |  Branch (916:13): [True: 230k, False: 228k]
  ------------------
  917|   230k|            parent->c1 = NULL;
  918|   228k|        else
  919|   228k|            parent->c2 = NULL;
  920|   458k|	xmlFree(cur);
  921|       |
  922|   458k|        if (parent->c2 != NULL) {
  ------------------
  |  Branch (922:13): [True: 228k, False: 230k]
  ------------------
  923|   228k|	    cur = parent->c2;
  924|   230k|        } else {
  925|   230k|            depth -= 1;
  926|   230k|            cur = parent;
  927|   230k|        }
  928|   458k|    }
  929|  23.2k|}
xmlFreeElementContent:
  940|    104|xmlFreeElementContent(xmlElementContent *cur) {
  941|       |    xmlFreeDocElementContent(NULL, cur);
  942|    104|}
xmlSnprintfElementContent:
  973|   134k|xmlSnprintfElementContent(char *buf, int size, xmlElementContent *content, int englob) {
  974|   134k|    int len;
  975|       |
  976|   134k|    if (content == NULL) return;
  ------------------
  |  Branch (976:9): [True: 0, False: 134k]
  ------------------
  977|   134k|    len = strlen(buf);
  978|   134k|    if (size - len < 50) {
  ------------------
  |  Branch (978:9): [True: 92, False: 134k]
  ------------------
  979|     92|	if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (979:6): [True: 92, False: 0]
  |  Branch (979:26): [True: 92, False: 0]
  ------------------
  980|     92|	    strcat(buf, " ...");
  981|     92|	return;
  982|     92|    }
  983|   134k|    if (englob) strcat(buf, "(");
  ------------------
  |  Branch (983:9): [True: 13.0k, False: 121k]
  ------------------
  984|   134k|    switch (content->type) {
  ------------------
  |  Branch (984:13): [True: 134k, False: 0]
  ------------------
  985|      0|        case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (985:9): [True: 0, False: 134k]
  ------------------
  986|      0|            strcat(buf, "#PCDATA");
  987|      0|	    break;
  988|  69.0k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (988:2): [True: 69.0k, False: 65.2k]
  ------------------
  989|  69.0k|            int qnameLen = xmlStrlen(content->name);
  990|       |
  991|  69.0k|	    if (content->prefix != NULL)
  ------------------
  |  Branch (991:10): [True: 2.60k, False: 66.4k]
  ------------------
  992|  2.60k|                qnameLen += xmlStrlen(content->prefix) + 1;
  993|  69.0k|	    if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (993:10): [True: 394, False: 68.6k]
  ------------------
  994|    394|		strcat(buf, " ...");
  995|    394|		return;
  996|    394|	    }
  997|  68.6k|	    if (content->prefix != NULL) {
  ------------------
  |  Branch (997:10): [True: 2.60k, False: 66.0k]
  ------------------
  998|  2.60k|		strcat(buf, (char *) content->prefix);
  999|  2.60k|		strcat(buf, ":");
 1000|  2.60k|	    }
 1001|  68.6k|	    if (content->name != NULL)
  ------------------
  |  Branch (1001:10): [True: 68.6k, False: 0]
  ------------------
 1002|  68.6k|		strcat(buf, (char *) content->name);
 1003|  68.6k|	    break;
 1004|  69.0k|        }
 1005|  33.2k|	case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (1005:2): [True: 33.2k, False: 101k]
  ------------------
 1006|  33.2k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1006:10): [True: 4.41k, False: 28.8k]
  ------------------
 1007|  28.8k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1007:10): [True: 1.81k, False: 27.0k]
  ------------------
 1008|  6.22k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1009|  27.0k|	    else
 1010|  27.0k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1011|  33.2k|	    len = strlen(buf);
 1012|  33.2k|	    if (size - len < 50) {
  ------------------
  |  Branch (1012:10): [True: 201, False: 33.0k]
  ------------------
 1013|    201|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1013:7): [True: 190, False: 11]
  |  Branch (1013:27): [True: 112, False: 78]
  ------------------
 1014|    112|		    strcat(buf, " ...");
 1015|    201|		return;
 1016|    201|	    }
 1017|  33.0k|            strcat(buf, " , ");
 1018|  33.0k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1018:11): [True: 86, False: 33.0k]
  ------------------
 1019|  33.0k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1019:4): [True: 1.59k, False: 31.4k]
  ------------------
 1020|  1.67k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1020:3): [True: 105, False: 1.57k]
  ------------------
 1021|    105|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1022|  32.9k|	    else
 1023|  32.9k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1024|  33.0k|	    break;
 1025|  31.9k|	case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (1025:2): [True: 31.9k, False: 102k]
  ------------------
 1026|  31.9k|	    if ((content->c1->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (1026:10): [True: 1.99k, False: 29.9k]
  ------------------
 1027|  29.9k|	        (content->c1->type == XML_ELEMENT_CONTENT_SEQ))
  ------------------
  |  Branch (1027:10): [True: 320, False: 29.6k]
  ------------------
 1028|  2.31k|		xmlSnprintfElementContent(buf, size, content->c1, 1);
 1029|  29.6k|	    else
 1030|  29.6k|		xmlSnprintfElementContent(buf, size, content->c1, 0);
 1031|  31.9k|	    len = strlen(buf);
 1032|  31.9k|	    if (size - len < 50) {
  ------------------
  |  Branch (1032:10): [True: 175, False: 31.8k]
  ------------------
 1033|    175|		if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (1033:7): [True: 175, False: 0]
  |  Branch (1033:27): [True: 99, False: 76]
  ------------------
 1034|     99|		    strcat(buf, " ...");
 1035|    175|		return;
 1036|    175|	    }
 1037|  31.8k|            strcat(buf, " | ");
 1038|  31.8k|	    if (((content->c2->type == XML_ELEMENT_CONTENT_SEQ) ||
  ------------------
  |  Branch (1038:11): [True: 112, False: 31.6k]
  ------------------
 1039|  31.6k|		 (content->c2->ocur != XML_ELEMENT_CONTENT_ONCE)) &&
  ------------------
  |  Branch (1039:4): [True: 2.39k, False: 29.2k]
  ------------------
 1040|  2.51k|		(content->c2->type != XML_ELEMENT_CONTENT_ELEMENT))
  ------------------
  |  Branch (1040:3): [True: 118, False: 2.39k]
  ------------------
 1041|    118|		xmlSnprintfElementContent(buf, size, content->c2, 1);
 1042|  31.6k|	    else
 1043|  31.6k|		xmlSnprintfElementContent(buf, size, content->c2, 0);
 1044|  31.8k|	    break;
 1045|   134k|    }
 1046|   133k|    if (size - strlen(buf) <= 2) return;
  ------------------
  |  Branch (1046:9): [True: 53, False: 133k]
  ------------------
 1047|   133k|    if (englob)
  ------------------
  |  Branch (1047:9): [True: 12.9k, False: 120k]
  ------------------
 1048|  12.9k|        strcat(buf, ")");
 1049|   133k|    switch (content->ocur) {
  ------------------
  |  Branch (1049:13): [True: 133k, False: 0]
  ------------------
 1050|   110k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (1050:9): [True: 110k, False: 22.6k]
  ------------------
 1051|   110k|	    break;
 1052|  7.21k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (1052:9): [True: 7.21k, False: 126k]
  ------------------
 1053|  7.21k|	    strcat(buf, "?");
 1054|  7.21k|	    break;
 1055|  9.81k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (1055:9): [True: 9.81k, False: 123k]
  ------------------
 1056|  9.81k|	    strcat(buf, "*");
 1057|  9.81k|	    break;
 1058|  5.62k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (1058:9): [True: 5.62k, False: 127k]
  ------------------
 1059|  5.62k|	    strcat(buf, "+");
 1060|  5.62k|	    break;
 1061|   133k|    }
 1062|   133k|}
xmlAddElementDecl:
 1106|  18.7k|		  xmlElementContent *content) {
 1107|  18.7k|    xmlElementPtr ret;
 1108|  18.7k|    xmlElementTablePtr table;
 1109|  18.7k|    xmlAttributePtr oldAttributes = NULL;
 1110|  18.7k|    const xmlChar *localName;
 1111|  18.7k|    xmlChar *prefix = NULL;
 1112|       |
 1113|  18.7k|    if ((dtd == NULL) || (name == NULL))
  ------------------
  |  Branch (1113:9): [True: 0, False: 18.7k]
  |  Branch (1113:26): [True: 0, False: 18.7k]
  ------------------
 1114|      0|	return(NULL);
 1115|       |
 1116|  18.7k|    switch (type) {
 1117|  5.27k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (1117:9): [True: 5.27k, False: 13.4k]
  ------------------
 1118|  6.24k|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (1118:9): [True: 969, False: 17.7k]
  ------------------
 1119|  6.24k|            if (content != NULL)
  ------------------
  |  Branch (1119:17): [True: 0, False: 6.24k]
  ------------------
 1120|      0|                return(NULL);
 1121|  6.24k|            break;
 1122|  6.24k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (1122:9): [True: 4.90k, False: 13.8k]
  ------------------
 1123|  12.4k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (1123:9): [True: 7.56k, False: 11.1k]
  ------------------
 1124|  12.4k|            if (content == NULL)
  ------------------
  |  Branch (1124:17): [True: 0, False: 12.4k]
  ------------------
 1125|      0|                return(NULL);
 1126|  12.4k|            break;
 1127|  12.4k|        default:
  ------------------
  |  Branch (1127:9): [True: 0, False: 18.7k]
  ------------------
 1128|      0|            return(NULL);
 1129|  18.7k|    }
 1130|       |
 1131|       |    /*
 1132|       |     * check if name is a QName
 1133|       |     */
 1134|  18.7k|    localName = xmlSplitQName4(name, &prefix);
 1135|  18.7k|    if (localName == NULL)
  ------------------
  |  Branch (1135:9): [True: 1, False: 18.7k]
  ------------------
 1136|      1|        goto mem_error;
 1137|       |
 1138|       |    /*
 1139|       |     * Create the Element table if needed.
 1140|       |     */
 1141|  18.7k|    table = (xmlElementTablePtr) dtd->elements;
 1142|  18.7k|    if (table == NULL) {
  ------------------
  |  Branch (1142:9): [True: 4.48k, False: 14.2k]
  ------------------
 1143|  4.48k|	xmlDictPtr dict = NULL;
 1144|       |
 1145|  4.48k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1145:6): [True: 4.48k, False: 0]
  ------------------
 1146|  4.48k|	    dict = dtd->doc->dict;
 1147|  4.48k|        table = xmlHashCreateDict(0, dict);
 1148|  4.48k|        if (table == NULL)
  ------------------
  |  Branch (1148:13): [True: 1, False: 4.48k]
  ------------------
 1149|      1|            goto mem_error;
 1150|  4.48k|	dtd->elements = (void *) table;
 1151|  4.48k|    }
 1152|       |
 1153|       |    /*
 1154|       |     * lookup old attributes inserted on an undefined element in the
 1155|       |     * internal subset.
 1156|       |     */
 1157|  18.7k|    if ((dtd->doc != NULL) && (dtd->doc->intSubset != NULL)) {
  ------------------
  |  Branch (1157:9): [True: 18.7k, False: 0]
  |  Branch (1157:31): [True: 18.7k, False: 0]
  ------------------
 1158|  18.7k|	ret = xmlHashLookup2(dtd->doc->intSubset->elements, localName, prefix);
 1159|  18.7k|	if ((ret != NULL) && (ret->etype == XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (1159:6): [True: 4.55k, False: 14.1k]
  |  Branch (1159:23): [True: 202, False: 4.34k]
  ------------------
 1160|    202|	    oldAttributes = ret->attributes;
 1161|    202|	    ret->attributes = NULL;
 1162|    202|	    xmlHashRemoveEntry2(dtd->doc->intSubset->elements, localName, prefix,
 1163|    202|                                NULL);
 1164|    202|	    xmlFreeElement(ret);
 1165|    202|	}
 1166|  18.7k|    }
 1167|       |
 1168|       |    /*
 1169|       |     * The element may already be present if one of its attribute
 1170|       |     * was registered first
 1171|       |     */
 1172|  18.7k|    ret = xmlHashLookup2(table, localName, prefix);
 1173|  18.7k|    if (ret != NULL) {
  ------------------
  |  Branch (1173:9): [True: 7.58k, False: 11.1k]
  ------------------
 1174|  7.58k|	if (ret->etype != XML_ELEMENT_TYPE_UNDEFINED) {
  ------------------
  |  Branch (1174:6): [True: 7.55k, False: 24]
  ------------------
 1175|  7.55k|#ifdef LIBXML_VALID_ENABLED
 1176|       |	    /*
 1177|       |	     * The element is already defined in this DTD.
 1178|       |	     */
 1179|  7.55k|            if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  7.55k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1179:17): [True: 7.55k, False: 0]
  |  Branch (1179:35): [True: 5.04k, False: 2.51k]
  ------------------
 1180|  5.04k|                xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ELEM_REDEFINED,
 1181|  5.04k|                                "Redefinition of element %s\n",
 1182|  5.04k|                                name, NULL, NULL);
 1183|  7.55k|#endif /* LIBXML_VALID_ENABLED */
 1184|  7.55k|            if (prefix != NULL)
  ------------------
  |  Branch (1184:17): [True: 365, False: 7.19k]
  ------------------
 1185|    365|	        xmlFree(prefix);
 1186|  7.55k|	    return(NULL);
 1187|  7.55k|	}
 1188|     24|	if (prefix != NULL) {
  ------------------
  |  Branch (1188:6): [True: 1, False: 23]
  ------------------
 1189|      1|	    xmlFree(prefix);
 1190|      1|	    prefix = NULL;
 1191|      1|	}
 1192|  11.1k|    } else {
 1193|  11.1k|        int res;
 1194|       |
 1195|  11.1k|	ret = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 1196|  11.1k|	if (ret == NULL)
  ------------------
  |  Branch (1196:6): [True: 1, False: 11.1k]
  ------------------
 1197|      1|            goto mem_error;
 1198|  11.1k|	memset(ret, 0, sizeof(xmlElement));
 1199|  11.1k|	ret->type = XML_ELEMENT_DECL;
 1200|       |
 1201|       |	/*
 1202|       |	 * fill the structure.
 1203|       |	 */
 1204|  11.1k|	ret->name = xmlStrdup(localName);
 1205|  11.1k|	if (ret->name == NULL) {
  ------------------
  |  Branch (1205:6): [True: 2, False: 11.1k]
  ------------------
 1206|      2|	    xmlFree(ret);
 1207|      2|	    goto mem_error;
 1208|      2|	}
 1209|  11.1k|	ret->prefix = prefix;
 1210|  11.1k|        prefix = NULL;
 1211|       |
 1212|       |	/*
 1213|       |	 * Validity Check:
 1214|       |	 * Insertion must not fail
 1215|       |	 */
 1216|  11.1k|        res = xmlHashAdd2(table, localName, ret->prefix, ret);
 1217|  11.1k|        if (res <= 0) {
  ------------------
  |  Branch (1217:13): [True: 4, False: 11.1k]
  ------------------
 1218|      4|	    xmlFreeElement(ret);
 1219|      4|            goto mem_error;
 1220|      4|	}
 1221|       |	/*
 1222|       |	 * For new element, may have attributes from earlier
 1223|       |	 * definition in internal subset
 1224|       |	 */
 1225|  11.1k|	ret->attributes = oldAttributes;
 1226|  11.1k|    }
 1227|       |
 1228|       |    /*
 1229|       |     * Finish to fill the structure.
 1230|       |     */
 1231|  11.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|  11.1k|    if (content != NULL) {
  ------------------
  |  Branch (1237:9): [True: 8.14k, False: 3.00k]
  ------------------
 1238|  8.14k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_USE_PCTXT)) {
  ------------------
  |  |   20|  8.14k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (1238:13): [True: 8.14k, False: 0]
  |  Branch (1238:31): [True: 8.14k, False: 0]
  ------------------
 1239|  8.14k|            ret->content = content;
 1240|  8.14k|            content->parent = (xmlElementContentPtr) 1;
 1241|  8.14k|        } 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|  8.14k|    }
 1247|       |
 1248|       |    /*
 1249|       |     * Link it to the DTD
 1250|       |     */
 1251|  11.1k|    ret->parent = dtd;
 1252|  11.1k|    ret->doc = dtd->doc;
 1253|  11.1k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1253:9): [True: 4.12k, False: 7.02k]
  ------------------
 1254|  4.12k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1255|  7.02k|    } else {
 1256|  7.02k|        dtd->last->next = (xmlNodePtr) ret;
 1257|  7.02k|	ret->prev = dtd->last;
 1258|  7.02k|	dtd->last = (xmlNodePtr) ret;
 1259|  7.02k|    }
 1260|  11.1k|    if (prefix != NULL)
  ------------------
  |  Branch (1260:9): [True: 0, False: 11.1k]
  ------------------
 1261|      0|	xmlFree(prefix);
 1262|  11.1k|    return(ret);
 1263|       |
 1264|      9|mem_error:
 1265|      9|    xmlVErrMemory(ctxt);
 1266|      9|    if (prefix != NULL)
  ------------------
  |  Branch (1266:9): [True: 1, False: 8]
  ------------------
 1267|      1|        xmlFree(prefix);
 1268|       |    return(NULL);
 1269|  11.1k|}
xmlFreeElementTable:
 1284|  14.7k|xmlFreeElementTable(xmlElementTable *table) {
 1285|  14.7k|    xmlHashFree(table, xmlFreeElementTableEntry);
 1286|  14.7k|}
xmlCopyElementTable:
 1339|  6.44k|xmlCopyElementTable(xmlElementTable *table) {
 1340|  6.44k|    return(xmlHashCopySafe(table, xmlCopyElement, xmlFreeElementTableEntry));
 1341|  6.44k|}
xmlCreateEnumeration:
 1413|  30.6k|xmlCreateEnumeration(const xmlChar *name) {
 1414|  30.6k|    xmlEnumerationPtr ret;
 1415|       |
 1416|  30.6k|    ret = (xmlEnumerationPtr) xmlMalloc(sizeof(xmlEnumeration));
 1417|  30.6k|    if (ret == NULL)
  ------------------
  |  Branch (1417:9): [True: 8, False: 30.6k]
  ------------------
 1418|      8|        return(NULL);
 1419|  30.6k|    memset(ret, 0, sizeof(xmlEnumeration));
 1420|       |
 1421|  30.6k|    if (name != NULL) {
  ------------------
  |  Branch (1421:9): [True: 30.6k, False: 0]
  ------------------
 1422|  30.6k|        ret->name = xmlStrdup(name);
 1423|  30.6k|        if (ret->name == NULL) {
  ------------------
  |  Branch (1423:13): [True: 12, False: 30.6k]
  ------------------
 1424|     12|            xmlFree(ret);
 1425|     12|            return(NULL);
 1426|     12|        }
 1427|  30.6k|    }
 1428|       |
 1429|  30.6k|    return(ret);
 1430|  30.6k|}
xmlFreeEnumeration:
 1438|  23.7k|xmlFreeEnumeration(xmlEnumeration *cur) {
 1439|  54.3k|    while (cur != NULL) {
  ------------------
  |  Branch (1439:12): [True: 30.6k, False: 23.7k]
  ------------------
 1440|  30.6k|        xmlEnumerationPtr next = cur->next;
 1441|       |
 1442|  30.6k|        xmlFree((xmlChar *) cur->name);
 1443|  30.6k|        xmlFree(cur);
 1444|       |
 1445|  30.6k|        cur = next;
 1446|  30.6k|    }
 1447|  23.7k|}
xmlCopyEnumeration:
 1459|  2.90k|xmlCopyEnumeration(xmlEnumeration *cur) {
 1460|  2.90k|    xmlEnumerationPtr ret = NULL;
 1461|  2.90k|    xmlEnumerationPtr last = NULL;
 1462|       |
 1463|  6.84k|    while (cur != NULL) {
  ------------------
  |  Branch (1463:12): [True: 3.95k, False: 2.88k]
  ------------------
 1464|  3.95k|        xmlEnumerationPtr copy = xmlCreateEnumeration(cur->name);
 1465|       |
 1466|  3.95k|        if (copy == NULL) {
  ------------------
  |  Branch (1466:13): [True: 15, False: 3.94k]
  ------------------
 1467|     15|            xmlFreeEnumeration(ret);
 1468|     15|            return(NULL);
 1469|     15|        }
 1470|       |
 1471|  3.94k|        if (ret == NULL) {
  ------------------
  |  Branch (1471:13): [True: 2.89k, False: 1.04k]
  ------------------
 1472|  2.89k|            ret = last = copy;
 1473|  2.89k|        } else {
 1474|  1.04k|            last->next = copy;
 1475|  1.04k|            last = copy;
 1476|  1.04k|        }
 1477|       |
 1478|  3.94k|        cur = cur->next;
 1479|  3.94k|    }
 1480|       |
 1481|  2.88k|    return(ret);
 1482|  2.90k|}
xmlAddAttributeDecl:
 1572|  60.5k|		    const xmlChar *defaultValue, xmlEnumeration *tree) {
 1573|  60.5k|    xmlAttributePtr ret = NULL;
 1574|  60.5k|    xmlAttributeTablePtr table;
 1575|  60.5k|    xmlElementPtr elemDef;
 1576|  60.5k|    xmlDictPtr dict = NULL;
 1577|  60.5k|    int res;
 1578|       |
 1579|  60.5k|    if (dtd == NULL) {
  ------------------
  |  Branch (1579:9): [True: 0, False: 60.5k]
  ------------------
 1580|      0|	xmlFreeEnumeration(tree);
 1581|      0|	return(NULL);
 1582|      0|    }
 1583|  60.5k|    if (name == NULL) {
  ------------------
  |  Branch (1583:9): [True: 8, False: 60.5k]
  ------------------
 1584|      8|	xmlFreeEnumeration(tree);
 1585|      8|	return(NULL);
 1586|      8|    }
 1587|  60.5k|    if (elem == NULL) {
  ------------------
  |  Branch (1587:9): [True: 0, False: 60.5k]
  ------------------
 1588|      0|	xmlFreeEnumeration(tree);
 1589|      0|	return(NULL);
 1590|      0|    }
 1591|  60.5k|    if (dtd->doc != NULL)
  ------------------
  |  Branch (1591:9): [True: 60.5k, False: 0]
  ------------------
 1592|  60.5k|	dict = dtd->doc->dict;
 1593|       |
 1594|  60.5k|#ifdef LIBXML_VALID_ENABLED
 1595|  60.5k|    if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE) &&
  ------------------
  |  |   24|  60.5k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1595:9): [True: 60.5k, False: 0]
  |  Branch (1595:27): [True: 48.5k, False: 11.9k]
  ------------------
 1596|  48.5k|        (defaultValue != NULL) &&
  ------------------
  |  Branch (1596:9): [True: 25.6k, False: 22.9k]
  ------------------
 1597|  25.6k|        (!xmlValidateAttributeValueInternal(dtd->doc, type, defaultValue))) {
  ------------------
  |  Branch (1597:9): [True: 12.5k, False: 13.0k]
  ------------------
 1598|  12.5k|	xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT,
 1599|  12.5k|	                "Attribute %s of %s: invalid default value\n",
 1600|  12.5k|	                elem, name, defaultValue);
 1601|  12.5k|	defaultValue = NULL;
 1602|  12.5k|	if (ctxt != NULL)
  ------------------
  |  Branch (1602:6): [True: 12.5k, False: 0]
  ------------------
 1603|  12.5k|	    ctxt->valid = 0;
 1604|  12.5k|    }
 1605|  60.5k|#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|  60.5k|    if ((dtd->doc != NULL) && (dtd->doc->extSubset == dtd) &&
  ------------------
  |  Branch (1611:9): [True: 60.5k, False: 0]
  |  Branch (1611:31): [True: 20.8k, False: 39.7k]
  ------------------
 1612|  20.8k|	(dtd->doc->intSubset != NULL) &&
  ------------------
  |  Branch (1612:2): [True: 20.8k, False: 0]
  ------------------
 1613|  20.8k|	(dtd->doc->intSubset->attributes != NULL)) {
  ------------------
  |  Branch (1613:2): [True: 4.71k, False: 16.1k]
  ------------------
 1614|  4.71k|        ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
 1615|  4.71k|	if (ret != NULL) {
  ------------------
  |  Branch (1615:6): [True: 2.03k, False: 2.68k]
  ------------------
 1616|  2.03k|	    xmlFreeEnumeration(tree);
 1617|  2.03k|	    return(NULL);
 1618|  2.03k|	}
 1619|  4.71k|    }
 1620|       |
 1621|       |    /*
 1622|       |     * Create the Attribute table if needed.
 1623|       |     */
 1624|  58.5k|    table = (xmlAttributeTablePtr) dtd->attributes;
 1625|  58.5k|    if (table == NULL) {
  ------------------
  |  Branch (1625:9): [True: 5.41k, False: 53.1k]
  ------------------
 1626|  5.41k|        table = xmlHashCreateDict(0, dict);
 1627|  5.41k|	dtd->attributes = (void *) table;
 1628|  5.41k|    }
 1629|  58.5k|    if (table == NULL)
  ------------------
  |  Branch (1629:9): [True: 2, False: 58.5k]
  ------------------
 1630|      2|        goto mem_error;
 1631|       |
 1632|  58.5k|    ret = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
 1633|  58.5k|    if (ret == NULL)
  ------------------
  |  Branch (1633:9): [True: 5, False: 58.5k]
  ------------------
 1634|      5|        goto mem_error;
 1635|  58.5k|    memset(ret, 0, sizeof(xmlAttribute));
 1636|  58.5k|    ret->type = XML_ATTRIBUTE_DECL;
 1637|       |
 1638|       |    /*
 1639|       |     * fill the structure.
 1640|       |     */
 1641|  58.5k|    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|  58.5k|    ret->doc = dtd->doc;
 1648|  58.5k|    if (dict) {
  ------------------
  |  Branch (1648:9): [True: 41.2k, False: 17.3k]
  ------------------
 1649|  41.2k|	ret->name = xmlDictLookup(dict, name, -1);
 1650|  41.2k|	ret->elem = xmlDictLookup(dict, elem, -1);
 1651|  41.2k|    } else {
 1652|  17.3k|	ret->name = xmlStrdup(name);
 1653|  17.3k|	ret->elem = xmlStrdup(elem);
 1654|  17.3k|    }
 1655|  58.5k|    if ((ret->name == NULL) || (ret->elem == NULL))
  ------------------
  |  Branch (1655:9): [True: 8, False: 58.5k]
  |  Branch (1655:32): [True: 2, False: 58.5k]
  ------------------
 1656|     10|        goto mem_error;
 1657|  58.5k|    if (ns != NULL) {
  ------------------
  |  Branch (1657:9): [True: 5.90k, False: 52.6k]
  ------------------
 1658|  5.90k|        if (dict)
  ------------------
  |  Branch (1658:13): [True: 2.99k, False: 2.90k]
  ------------------
 1659|  2.99k|            ret->prefix = xmlDictLookup(dict, ns, -1);
 1660|  2.90k|        else
 1661|  2.90k|            ret->prefix = xmlStrdup(ns);
 1662|  5.90k|        if (ret->prefix == NULL)
  ------------------
  |  Branch (1662:13): [True: 1, False: 5.90k]
  ------------------
 1663|      1|            goto mem_error;
 1664|  5.90k|    }
 1665|  58.5k|    ret->def = def;
 1666|  58.5k|    ret->tree = tree;
 1667|  58.5k|    tree = NULL;
 1668|  58.5k|    if (defaultValue != NULL) {
  ------------------
  |  Branch (1668:9): [True: 20.7k, False: 37.7k]
  ------------------
 1669|  20.7k|	ret->defaultValue = xmlStrdup(defaultValue);
 1670|  20.7k|        if (ret->defaultValue == NULL)
  ------------------
  |  Branch (1670:13): [True: 1, False: 20.7k]
  ------------------
 1671|      1|            goto mem_error;
 1672|  20.7k|    }
 1673|       |
 1674|  58.5k|    elemDef = xmlGetDtdElementDesc2(ctxt, dtd, elem);
 1675|  58.5k|    if (elemDef == NULL)
  ------------------
  |  Branch (1675:9): [True: 11, False: 58.5k]
  ------------------
 1676|     11|        goto mem_error;
 1677|       |
 1678|       |    /*
 1679|       |     * Validity Check:
 1680|       |     * Search the DTD for previous declarations of the ATTLIST
 1681|       |     */
 1682|  58.5k|    res = xmlHashAdd3(table, ret->name, ret->prefix, ret->elem, ret);
 1683|  58.5k|    if (res <= 0) {
  ------------------
  |  Branch (1683:9): [True: 29.4k, False: 29.0k]
  ------------------
 1684|  29.4k|        if (res < 0)
  ------------------
  |  Branch (1684:13): [True: 7, False: 29.4k]
  ------------------
 1685|      7|            goto mem_error;
 1686|  29.4k|#ifdef LIBXML_VALID_ENABLED
 1687|       |        /*
 1688|       |         * The attribute is already defined in this DTD.
 1689|       |         */
 1690|  29.4k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  29.4k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1690:13): [True: 29.4k, False: 0]
  |  Branch (1690:31): [True: 24.1k, False: 5.32k]
  ------------------
 1691|  24.1k|            xmlErrValidWarning(ctxt, (xmlNodePtr) dtd,
 1692|  24.1k|                    XML_DTD_ATTRIBUTE_REDEFINED,
 1693|  24.1k|                    "Attribute %s of element %s: already defined\n",
 1694|  24.1k|                    name, elem, NULL);
 1695|  29.4k|#endif /* LIBXML_VALID_ENABLED */
 1696|  29.4k|	xmlFreeAttribute(ret);
 1697|  29.4k|	return(NULL);
 1698|  29.4k|    }
 1699|       |
 1700|       |    /*
 1701|       |     * Insert namespace default def first they need to be
 1702|       |     * processed first.
 1703|       |     */
 1704|  29.0k|    if ((xmlStrEqual(ret->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  29.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1704:9): [True: 651, False: 28.4k]
  ------------------
 1705|  28.4k|        ((ret->prefix != NULL &&
  ------------------
  |  Branch (1705:11): [True: 4.55k, False: 23.8k]
  ------------------
 1706|  4.55k|         (xmlStrEqual(ret->prefix, BAD_CAST "xmlns"))))) {
  ------------------
  |  |   34|  4.55k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1706:10): [True: 2.15k, False: 2.39k]
  ------------------
 1707|  2.81k|        ret->nexth = elemDef->attributes;
 1708|  2.81k|        elemDef->attributes = ret;
 1709|  26.2k|    } else {
 1710|  26.2k|        xmlAttributePtr tmp = elemDef->attributes;
 1711|       |
 1712|  27.1k|        while ((tmp != NULL) &&
  ------------------
  |  Branch (1712:16): [True: 18.2k, False: 8.92k]
  ------------------
 1713|  18.2k|               ((xmlStrEqual(tmp->name, BAD_CAST "xmlns")) ||
  ------------------
  |  |   34|  18.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1713:17): [True: 983, False: 17.2k]
  ------------------
 1714|  17.2k|                ((ret->prefix != NULL &&
  ------------------
  |  Branch (1714:19): [True: 1.30k, False: 15.9k]
  ------------------
 1715|  1.30k|                 (xmlStrEqual(ret->prefix, BAD_CAST "xmlns")))))) {
  ------------------
  |  |   34|  1.30k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1715:18): [True: 0, False: 1.30k]
  ------------------
 1716|    983|            if (tmp->nexth == NULL)
  ------------------
  |  Branch (1716:17): [True: 42, False: 941]
  ------------------
 1717|     42|                break;
 1718|    941|            tmp = tmp->nexth;
 1719|    941|        }
 1720|  26.2k|        if (tmp != NULL) {
  ------------------
  |  Branch (1720:13): [True: 17.3k, False: 8.92k]
  ------------------
 1721|  17.3k|            ret->nexth = tmp->nexth;
 1722|  17.3k|            tmp->nexth = ret;
 1723|  17.3k|        } else {
 1724|  8.92k|            ret->nexth = elemDef->attributes;
 1725|  8.92k|            elemDef->attributes = ret;
 1726|  8.92k|        }
 1727|  26.2k|    }
 1728|       |
 1729|       |    /*
 1730|       |     * Link it to the DTD
 1731|       |     */
 1732|  29.0k|    ret->parent = dtd;
 1733|  29.0k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (1733:9): [True: 3.56k, False: 25.5k]
  ------------------
 1734|  3.56k|	dtd->children = dtd->last = (xmlNodePtr) ret;
 1735|  25.5k|    } else {
 1736|  25.5k|        dtd->last->next = (xmlNodePtr) ret;
 1737|  25.5k|	ret->prev = dtd->last;
 1738|  25.5k|	dtd->last = (xmlNodePtr) ret;
 1739|  25.5k|    }
 1740|  29.0k|    return(ret);
 1741|       |
 1742|     37|mem_error:
 1743|     37|    xmlVErrMemory(ctxt);
 1744|     37|    xmlFreeEnumeration(tree);
 1745|     37|    xmlFreeAttribute(ret);
 1746|       |    return(NULL);
 1747|  58.5k|}
xmlFreeAttributeTable:
 1762|  9.47k|xmlFreeAttributeTable(xmlAttributeTable *table) {
 1763|  9.47k|    xmlHashFree(table, xmlFreeAttributeTableEntry);
 1764|  9.47k|}
xmlCopyAttributeTable:
 1826|  4.15k|xmlCopyAttributeTable(xmlAttributeTable *table) {
 1827|  4.15k|    return(xmlHashCopySafe(table, xmlCopyAttribute,
 1828|  4.15k|                           xmlFreeAttributeTableEntry));
 1829|  4.15k|}
xmlAddNotationDecl:
 1926|  1.63k|                   const xmlChar *publicId, const xmlChar *systemId) {
 1927|  1.63k|    xmlNotationPtr ret = NULL;
 1928|  1.63k|    xmlNotationTablePtr table;
 1929|  1.63k|    int res;
 1930|       |
 1931|  1.63k|    if (dtd == NULL) {
  ------------------
  |  Branch (1931:9): [True: 0, False: 1.63k]
  ------------------
 1932|      0|	return(NULL);
 1933|      0|    }
 1934|  1.63k|    if (name == NULL) {
  ------------------
  |  Branch (1934:9): [True: 0, False: 1.63k]
  ------------------
 1935|      0|	return(NULL);
 1936|      0|    }
 1937|  1.63k|    if ((publicId == NULL) && (systemId == NULL)) {
  ------------------
  |  Branch (1937:9): [True: 569, False: 1.06k]
  |  Branch (1937:31): [True: 0, False: 569]
  ------------------
 1938|      0|	return(NULL);
 1939|      0|    }
 1940|       |
 1941|       |    /*
 1942|       |     * Create the Notation table if needed.
 1943|       |     */
 1944|  1.63k|    table = (xmlNotationTablePtr) dtd->notations;
 1945|  1.63k|    if (table == NULL) {
  ------------------
  |  Branch (1945:9): [True: 251, False: 1.38k]
  ------------------
 1946|    251|	xmlDictPtr dict = NULL;
 1947|    251|	if (dtd->doc != NULL)
  ------------------
  |  Branch (1947:6): [True: 251, False: 0]
  ------------------
 1948|    251|	    dict = dtd->doc->dict;
 1949|       |
 1950|    251|        dtd->notations = table = xmlHashCreateDict(0, dict);
 1951|    251|        if (table == NULL)
  ------------------
  |  Branch (1951:13): [True: 1, False: 250]
  ------------------
 1952|      1|            goto mem_error;
 1953|    251|    }
 1954|       |
 1955|  1.63k|    ret = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
 1956|  1.63k|    if (ret == NULL)
  ------------------
  |  Branch (1956:9): [True: 1, False: 1.62k]
  ------------------
 1957|      1|        goto mem_error;
 1958|  1.62k|    memset(ret, 0, sizeof(xmlNotation));
 1959|       |
 1960|       |    /*
 1961|       |     * fill the structure.
 1962|       |     */
 1963|  1.62k|    ret->name = xmlStrdup(name);
 1964|  1.62k|    if (ret->name == NULL)
  ------------------
  |  Branch (1964:9): [True: 2, False: 1.62k]
  ------------------
 1965|      2|        goto mem_error;
 1966|  1.62k|    if (systemId != NULL) {
  ------------------
  |  Branch (1966:9): [True: 591, False: 1.03k]
  ------------------
 1967|    591|        ret->SystemID = xmlStrdup(systemId);
 1968|    591|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (1968:13): [True: 1, False: 590]
  ------------------
 1969|      1|            goto mem_error;
 1970|    591|    }
 1971|  1.62k|    if (publicId != NULL) {
  ------------------
  |  Branch (1971:9): [True: 1.06k, False: 565]
  ------------------
 1972|  1.06k|        ret->PublicID = xmlStrdup(publicId);
 1973|  1.06k|        if (ret->PublicID == NULL)
  ------------------
  |  Branch (1973:13): [True: 2, False: 1.05k]
  ------------------
 1974|      2|            goto mem_error;
 1975|  1.06k|    }
 1976|       |
 1977|       |    /*
 1978|       |     * Validity Check:
 1979|       |     * Check the DTD for previous declarations of the ATTLIST
 1980|       |     */
 1981|  1.62k|    res = xmlHashAdd(table, name, ret);
 1982|  1.62k|    if (res <= 0) {
  ------------------
  |  Branch (1982:9): [True: 1.37k, False: 253]
  ------------------
 1983|  1.37k|        if (res < 0)
  ------------------
  |  Branch (1983:13): [True: 2, False: 1.36k]
  ------------------
 1984|      2|            goto mem_error;
 1985|  1.36k|#ifdef LIBXML_VALID_ENABLED
 1986|  1.36k|        if ((ctxt != NULL) && (ctxt->flags & XML_VCTXT_VALIDATE))
  ------------------
  |  |   24|  1.36k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  |  Branch (1986:13): [True: 1.36k, False: 0]
  |  Branch (1986:31): [True: 935, False: 434]
  ------------------
 1987|    935|            xmlErrValid(ctxt, XML_DTD_NOTATION_REDEFINED,
 1988|    935|                        "xmlAddNotationDecl: %s already defined\n",
 1989|    935|                        (const char *) name);
 1990|  1.36k|#endif /* LIBXML_VALID_ENABLED */
 1991|  1.36k|	xmlFreeNotation(ret);
 1992|  1.36k|	return(NULL);
 1993|  1.37k|    }
 1994|    253|    return(ret);
 1995|       |
 1996|      9|mem_error:
 1997|      9|    xmlVErrMemory(ctxt);
 1998|      9|    xmlFreeNotation(ret);
 1999|       |    return(NULL);
 2000|  1.62k|}
xmlFreeNotationTable:
 2015|  1.33k|xmlFreeNotationTable(xmlNotationTable *table) {
 2016|  1.33k|    xmlHashFree(table, xmlFreeNotationTableEntry);
 2017|  1.33k|}
xmlCopyNotationTable:
 2066|  1.10k|xmlCopyNotationTable(xmlNotationTable *table) {
 2067|  1.10k|    return(xmlHashCopySafe(table, xmlCopyNotation, xmlFreeNotationTableEntry));
 2068|  1.10k|}
xmlAddIDSafe:
 2259|  3.79k|xmlAddIDSafe(xmlAttr *attr, const xmlChar *value) {
 2260|       |    return(xmlAddIDInternal(attr, value, NULL));
 2261|  3.79k|}
xmlAddID:
 2274|  11.0k|         xmlAttr *attr) {
 2275|  11.0k|    xmlIDPtr id;
 2276|  11.0k|    int res;
 2277|       |
 2278|  11.0k|    if ((attr == NULL) || (doc != attr->doc))
  ------------------
  |  Branch (2278:9): [True: 0, False: 11.0k]
  |  Branch (2278:27): [True: 0, False: 11.0k]
  ------------------
 2279|      0|        return(NULL);
 2280|       |
 2281|  11.0k|    res = xmlAddIDInternal(attr, value, &id);
 2282|  11.0k|    if (res < 0) {
  ------------------
  |  Branch (2282:9): [True: 17, False: 11.0k]
  ------------------
 2283|     17|        xmlVErrMemory(ctxt);
 2284|     17|    }
 2285|  11.0k|    else if (res == 0) {
  ------------------
  |  Branch (2285:14): [True: 9.92k, False: 1.13k]
  ------------------
 2286|  9.92k|        if (ctxt != NULL) {
  ------------------
  |  Branch (2286:13): [True: 9.92k, False: 0]
  ------------------
 2287|       |            /*
 2288|       |             * The id is already defined in this DTD.
 2289|       |             */
 2290|  9.92k|            xmlErrValidNode(ctxt, attr->parent, XML_DTD_ID_REDEFINED,
 2291|  9.92k|                            "ID %s already defined\n", value, NULL, NULL);
 2292|  9.92k|        }
 2293|  9.92k|    }
 2294|       |
 2295|  11.0k|    return(id);
 2296|  11.0k|}
xmlFreeIDTable:
 2309|    799|xmlFreeIDTable(xmlIDTable *table) {
 2310|    799|    xmlHashFree(table, xmlFreeIDTableEntry);
 2311|    799|}
xmlIsID:
 2326|  1.87M|xmlIsID(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2327|  1.87M|    if ((attr == NULL) || (attr->name == NULL))
  ------------------
  |  Branch (2327:9): [True: 0, False: 1.87M]
  |  Branch (2327:27): [True: 20, False: 1.87M]
  ------------------
 2328|     20|        return(0);
 2329|       |
 2330|  1.87M|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (2330:9): [True: 1.87M, False: 0]
  |  Branch (2330:26): [True: 0, False: 1.87M]
  ------------------
 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.87M|    } else {
 2341|  1.87M|	xmlAttributePtr attrDecl = NULL;
 2342|  1.87M|	xmlChar felem[50];
 2343|  1.87M|	xmlChar *fullelemname;
 2344|  1.87M|        const xmlChar *aprefix;
 2345|       |
 2346|  1.87M|        if ((attr->ns != NULL) && (attr->ns->prefix != NULL) &&
  ------------------
  |  Branch (2346:13): [True: 214k, False: 1.65M]
  |  Branch (2346:35): [True: 214k, False: 0]
  ------------------
 2347|   214k|            (!strcmp((char *) attr->name, "id")) &&
  ------------------
  |  Branch (2347:13): [True: 2.82k, False: 211k]
  ------------------
 2348|  2.82k|            (!strcmp((char *) attr->ns->prefix, "xml")))
  ------------------
  |  Branch (2348:13): [True: 2.59k, False: 223]
  ------------------
 2349|  2.59k|            return(1);
 2350|       |
 2351|  1.86M|        if ((doc == NULL) ||
  ------------------
  |  Branch (2351:13): [True: 0, False: 1.86M]
  ------------------
 2352|  1.86M|            ((doc->intSubset == NULL) && (doc->extSubset == NULL)))
  ------------------
  |  Branch (2352:14): [True: 494k, False: 1.37M]
  |  Branch (2352:42): [True: 494k, False: 0]
  ------------------
 2353|   494k|            return(0);
 2354|       |
 2355|  1.37M|        if ((elem == NULL) ||
  ------------------
  |  Branch (2355:13): [True: 0, False: 1.37M]
  ------------------
 2356|  1.37M|            (elem->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (2356:13): [True: 0, False: 1.37M]
  ------------------
 2357|  1.37M|            (elem->name == NULL))
  ------------------
  |  Branch (2357:13): [True: 0, False: 1.37M]
  ------------------
 2358|      0|            return(0);
 2359|       |
 2360|  1.37M|	fullelemname = (elem->ns != NULL && elem->ns->prefix != NULL) ?
  ------------------
  |  Branch (2360:18): [True: 1.24M, False: 127k]
  |  Branch (2360:38): [True: 11.6k, False: 1.23M]
  ------------------
 2361|  11.6k|	    xmlBuildQName(elem->name, elem->ns->prefix, felem, 50) :
 2362|  1.37M|	    (xmlChar *)elem->name;
 2363|  1.37M|        if (fullelemname == NULL)
  ------------------
  |  Branch (2363:13): [True: 8, False: 1.37M]
  ------------------
 2364|      8|            return(-1);
 2365|       |
 2366|  1.37M|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2366:19): [True: 35.5k, False: 1.33M]
  ------------------
 2367|       |
 2368|  1.37M|	if (fullelemname != NULL) {
  ------------------
  |  Branch (2368:6): [True: 1.37M, False: 0]
  ------------------
 2369|  1.37M|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullelemname,
 2370|  1.37M|		                          attr->name, aprefix);
 2371|  1.37M|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2371:10): [True: 672k, False: 702k]
  |  Branch (2371:32): [True: 2.11k, False: 670k]
  ------------------
 2372|  2.11k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullelemname,
 2373|  2.11k|					      attr->name, aprefix);
 2374|  1.37M|	}
 2375|       |
 2376|  1.37M|	if ((fullelemname != felem) && (fullelemname != elem->name))
  ------------------
  |  Branch (2376:6): [True: 1.37M, False: 3.74k]
  |  Branch (2376:33): [True: 7.92k, False: 1.36M]
  ------------------
 2377|  7.92k|	    xmlFree(fullelemname);
 2378|       |
 2379|  1.37M|        if ((attrDecl != NULL) && (attrDecl->atype == XML_ATTRIBUTE_ID))
  ------------------
  |  Branch (2379:13): [True: 703k, False: 671k]
  |  Branch (2379:35): [True: 6.24k, False: 697k]
  ------------------
 2380|  6.24k|	    return(1);
 2381|  1.37M|    }
 2382|       |
 2383|  1.36M|    return(0);
 2384|  1.87M|}
xmlRemoveID:
 2394|  2.10k|xmlRemoveID(xmlDoc *doc, xmlAttr *attr) {
 2395|  2.10k|    xmlIDTablePtr table;
 2396|       |
 2397|  2.10k|    if (doc == NULL) return(-1);
  ------------------
  |  Branch (2397:9): [True: 0, False: 2.10k]
  ------------------
 2398|  2.10k|    if ((attr == NULL) || (attr->id == NULL)) return(-1);
  ------------------
  |  Branch (2398:9): [True: 0, False: 2.10k]
  |  Branch (2398:27): [True: 0, False: 2.10k]
  ------------------
 2399|       |
 2400|  2.10k|    table = (xmlIDTablePtr) doc->ids;
 2401|  2.10k|    if (table == NULL)
  ------------------
  |  Branch (2401:9): [True: 0, False: 2.10k]
  ------------------
 2402|      0|        return(-1);
 2403|       |
 2404|  2.10k|    if (xmlHashRemoveEntry(table, attr->id->value, xmlFreeIDTableEntry) < 0)
  ------------------
  |  Branch (2404:9): [True: 0, False: 2.10k]
  ------------------
 2405|      0|        return(-1);
 2406|       |
 2407|  2.10k|    return(0);
 2408|  2.10k|}
xmlGetID:
 2419|  13.1k|xmlGetID(xmlDoc *doc, const xmlChar *ID) {
 2420|  13.1k|    xmlIDTablePtr table;
 2421|  13.1k|    xmlIDPtr id;
 2422|       |
 2423|  13.1k|    if (doc == NULL) {
  ------------------
  |  Branch (2423:9): [True: 0, False: 13.1k]
  ------------------
 2424|      0|	return(NULL);
 2425|      0|    }
 2426|       |
 2427|  13.1k|    if (ID == NULL) {
  ------------------
  |  Branch (2427:9): [True: 0, False: 13.1k]
  ------------------
 2428|      0|	return(NULL);
 2429|      0|    }
 2430|       |
 2431|  13.1k|    table = (xmlIDTablePtr) doc->ids;
 2432|  13.1k|    if (table == NULL)
  ------------------
  |  Branch (2432:9): [True: 7.51k, False: 5.61k]
  ------------------
 2433|  7.51k|        return(NULL);
 2434|       |
 2435|  5.61k|    id = xmlHashLookup(table, ID);
 2436|  5.61k|    if (id == NULL)
  ------------------
  |  Branch (2436:9): [True: 2.80k, False: 2.81k]
  ------------------
 2437|  2.80k|	return(NULL);
 2438|  2.81k|    if (id->attr == NULL) {
  ------------------
  |  Branch (2438:9): [True: 168, False: 2.64k]
  ------------------
 2439|       |	/*
 2440|       |	 * We are operating on a stream, return a well known reference
 2441|       |	 * since the attribute node doesn't exist anymore
 2442|       |	 */
 2443|    168|	return((xmlAttrPtr) doc);
 2444|    168|    }
 2445|  2.64k|    return(id->attr);
 2446|  2.81k|}
xmlAddRef:
 2545|  24.7k|    xmlAttr *attr) {
 2546|  24.7k|    xmlRefPtr ret = NULL;
 2547|  24.7k|    xmlRefTablePtr table;
 2548|  24.7k|    xmlListPtr ref_list;
 2549|       |
 2550|  24.7k|    if (doc == NULL) {
  ------------------
  |  Branch (2550:9): [True: 0, False: 24.7k]
  ------------------
 2551|      0|        return(NULL);
 2552|      0|    }
 2553|  24.7k|    if (value == NULL) {
  ------------------
  |  Branch (2553:9): [True: 1, False: 24.7k]
  ------------------
 2554|      1|        return(NULL);
 2555|      1|    }
 2556|  24.7k|    if (attr == NULL) {
  ------------------
  |  Branch (2556:9): [True: 0, False: 24.7k]
  ------------------
 2557|      0|        return(NULL);
 2558|      0|    }
 2559|       |
 2560|       |    /*
 2561|       |     * Create the Ref table if needed.
 2562|       |     */
 2563|  24.7k|    table = (xmlRefTablePtr) doc->refs;
 2564|  24.7k|    if (table == NULL) {
  ------------------
  |  Branch (2564:9): [True: 570, False: 24.1k]
  ------------------
 2565|    570|        doc->refs = table = xmlHashCreate(0);
 2566|    570|        if (table == NULL)
  ------------------
  |  Branch (2566:13): [True: 1, False: 569]
  ------------------
 2567|      1|            goto failed;
 2568|    570|    }
 2569|       |
 2570|  24.7k|    ret = (xmlRefPtr) xmlMalloc(sizeof(xmlRef));
 2571|  24.7k|    if (ret == NULL)
  ------------------
  |  Branch (2571:9): [True: 2, False: 24.7k]
  ------------------
 2572|      2|        goto failed;
 2573|  24.7k|    memset(ret, 0, sizeof(*ret));
 2574|       |
 2575|       |    /*
 2576|       |     * fill the structure.
 2577|       |     */
 2578|  24.7k|    ret->value = xmlStrdup(value);
 2579|  24.7k|    if (ret->value == NULL)
  ------------------
  |  Branch (2579:9): [True: 2, False: 24.7k]
  ------------------
 2580|      2|        goto failed;
 2581|  24.7k|    if (xmlIsStreaming(ctxt)) {
  ------------------
  |  Branch (2581:9): [True: 4.13k, False: 20.6k]
  ------------------
 2582|       |	/*
 2583|       |	 * Operating in streaming mode, attr is gonna disappear
 2584|       |	 */
 2585|  4.13k|	ret->name = xmlStrdup(attr->name);
 2586|  4.13k|        if (ret->name == NULL)
  ------------------
  |  Branch (2586:13): [True: 2, False: 4.13k]
  ------------------
 2587|      2|            goto failed;
 2588|  4.13k|	ret->attr = NULL;
 2589|  20.6k|    } else {
 2590|  20.6k|	ret->name = NULL;
 2591|  20.6k|	ret->attr = attr;
 2592|  20.6k|    }
 2593|  24.7k|    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|  24.7k|    ref_list = xmlHashLookup(table, value);
 2603|  24.7k|    if (ref_list == NULL) {
  ------------------
  |  Branch (2603:9): [True: 772, False: 23.9k]
  ------------------
 2604|    772|        int res;
 2605|       |
 2606|    772|        ref_list = xmlListCreate(xmlFreeRef, xmlDummyCompare);
 2607|    772|        if (ref_list == NULL)
  ------------------
  |  Branch (2607:13): [True: 3, False: 769]
  ------------------
 2608|      3|	    goto failed;
 2609|    769|        res = xmlHashAdd(table, value, ref_list);
 2610|    769|        if (res <= 0) {
  ------------------
  |  Branch (2610:13): [True: 1, False: 768]
  ------------------
 2611|      1|            xmlListDelete(ref_list);
 2612|      1|	    goto failed;
 2613|      1|        }
 2614|    769|    }
 2615|  24.7k|    if (xmlListAppend(ref_list, ret) != 0)
  ------------------
  |  Branch (2615:9): [True: 3, False: 24.7k]
  ------------------
 2616|      3|        goto failed;
 2617|  24.7k|    return(ret);
 2618|       |
 2619|     14|failed:
 2620|     14|    xmlVErrMemory(ctxt);
 2621|     14|    if (ret != NULL) {
  ------------------
  |  Branch (2621:9): [True: 11, False: 3]
  ------------------
 2622|     11|        if (ret->value != NULL)
  ------------------
  |  Branch (2622:13): [True: 9, False: 2]
  ------------------
 2623|      9|	    xmlFree((char *)ret->value);
 2624|     11|        if (ret->name != NULL)
  ------------------
  |  Branch (2624:13): [True: 7, False: 4]
  ------------------
 2625|      7|	    xmlFree((char *)ret->name);
 2626|     11|        xmlFree(ret);
 2627|     11|    }
 2628|       |    return(NULL);
 2629|  24.7k|}
xmlFreeRefTable:
 2640|    569|xmlFreeRefTable(xmlRefTable *table) {
 2641|    569|    xmlHashFree(table, xmlFreeRefTableEntry);
 2642|    569|}
xmlIsRef:
 2658|   133k|xmlIsRef(xmlDoc *doc, xmlNode *elem, xmlAttr *attr) {
 2659|   133k|    if (attr == NULL)
  ------------------
  |  Branch (2659:9): [True: 0, False: 133k]
  ------------------
 2660|      0|        return(0);
 2661|   133k|    if (doc == NULL) {
  ------------------
  |  Branch (2661:9): [True: 0, False: 133k]
  ------------------
 2662|      0|        doc = attr->doc;
 2663|      0|	if (doc == NULL) return(0);
  ------------------
  |  Branch (2663:6): [True: 0, False: 0]
  ------------------
 2664|      0|    }
 2665|       |
 2666|   133k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL)) {
  ------------------
  |  Branch (2666:9): [True: 33.9k, False: 100k]
  |  Branch (2666:37): [True: 33.9k, False: 0]
  ------------------
 2667|  33.9k|        return(0);
 2668|   100k|    } else if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (2668:16): [True: 0, False: 100k]
  ------------------
 2669|       |        /* TODO @@@ */
 2670|      0|        return(0);
 2671|   100k|    } else {
 2672|   100k|        xmlAttributePtr attrDecl;
 2673|   100k|        const xmlChar *aprefix;
 2674|       |
 2675|   100k|        if (elem == NULL) return(0);
  ------------------
  |  Branch (2675:13): [True: 0, False: 100k]
  ------------------
 2676|   100k|        aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (2676:19): [True: 20.4k, False: 79.5k]
  ------------------
 2677|   100k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name, attr->name,
 2678|   100k|                                      aprefix);
 2679|   100k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2679:13): [True: 37.4k, False: 62.5k]
  |  Branch (2679:35): [True: 1.24k, False: 36.2k]
  ------------------
 2680|  1.24k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name, attr->name,
 2681|  1.24k|                                          aprefix);
 2682|       |
 2683|   100k|	if ((attrDecl != NULL) &&
  ------------------
  |  Branch (2683:6): [True: 63.4k, False: 36.6k]
  ------------------
 2684|  63.4k|	    (attrDecl->atype == XML_ATTRIBUTE_IDREF ||
  ------------------
  |  Branch (2684:7): [True: 743, False: 62.6k]
  ------------------
 2685|  62.6k|	     attrDecl->atype == XML_ATTRIBUTE_IDREFS))
  ------------------
  |  Branch (2685:7): [True: 19.5k, False: 43.1k]
  ------------------
 2686|  20.3k|	return(1);
 2687|   100k|    }
 2688|  79.7k|    return(0);
 2689|   133k|}
xmlGetDtdQElementDesc:
 2898|   503k|	              const xmlChar *prefix) {
 2899|   503k|    xmlElementTablePtr table;
 2900|       |
 2901|   503k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2901:9): [True: 105k, False: 397k]
  ------------------
 2902|   397k|    if (dtd->elements == NULL) return(NULL);
  ------------------
  |  Branch (2902:9): [True: 66.9k, False: 330k]
  ------------------
 2903|   330k|    table = (xmlElementTablePtr) dtd->elements;
 2904|       |
 2905|   330k|    return(xmlHashLookup2(table, name, prefix));
 2906|   397k|}
xmlGetDtdQAttrDesc:
 2955|  1.64M|	          const xmlChar *prefix) {
 2956|  1.64M|    xmlAttributeTablePtr table;
 2957|       |
 2958|  1.64M|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2958:9): [True: 0, False: 1.64M]
  ------------------
 2959|  1.64M|    if (dtd->attributes == NULL) return(NULL);
  ------------------
  |  Branch (2959:9): [True: 53.7k, False: 1.58M]
  ------------------
 2960|  1.58M|    table = (xmlAttributeTablePtr) dtd->attributes;
 2961|       |
 2962|  1.58M|    return(xmlHashLookup3(table, name, prefix, elem));
 2963|  1.64M|}
xmlGetDtdNotationDesc:
 2974|  7.72k|xmlGetDtdNotationDesc(xmlDtd *dtd, const xmlChar *name) {
 2975|  7.72k|    xmlNotationTablePtr table;
 2976|       |
 2977|  7.72k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2977:9): [True: 1.25k, False: 6.46k]
  ------------------
 2978|  6.46k|    if (dtd->notations == NULL) return(NULL);
  ------------------
  |  Branch (2978:9): [True: 4.32k, False: 2.14k]
  ------------------
 2979|  2.14k|    table = (xmlNotationTablePtr) dtd->notations;
 2980|       |
 2981|  2.14k|    return(xmlHashLookup(table, name));
 2982|  6.46k|}
xmlValidateNotationUse:
 2999|    113|                       const xmlChar *notationName) {
 3000|    113|    xmlNotationPtr notaDecl;
 3001|    113|    if ((doc == NULL) || (doc->intSubset == NULL) ||
  ------------------
  |  Branch (3001:9): [True: 0, False: 113]
  |  Branch (3001:26): [True: 0, False: 113]
  ------------------
 3002|    113|        (notationName == NULL)) return(-1);
  ------------------
  |  Branch (3002:9): [True: 0, False: 113]
  ------------------
 3003|       |
 3004|    113|    notaDecl = xmlGetDtdNotationDesc(doc->intSubset, notationName);
 3005|    113|    if ((notaDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3005:9): [True: 103, False: 10]
  |  Branch (3005:31): [True: 16, False: 87]
  ------------------
 3006|     16|	notaDecl = xmlGetDtdNotationDesc(doc->extSubset, notationName);
 3007|       |
 3008|    113|    if (notaDecl == NULL) {
  ------------------
  |  Branch (3008:9): [True: 103, False: 10]
  ------------------
 3009|    103|	xmlErrValidNode(ctxt, (xmlNodePtr) doc, XML_DTD_UNKNOWN_NOTATION,
 3010|    103|	                "NOTATION %s is not declared\n",
 3011|    103|		        notationName, NULL, NULL);
 3012|    103|	return(0);
 3013|    103|    }
 3014|     10|    return(1);
 3015|    113|}
xmlValidateNotationDecl:
 3266|    333|                         xmlNotation *nota ATTRIBUTE_UNUSED) {
 3267|    333|    int ret = 1;
 3268|       |
 3269|    333|    return(ret);
 3270|    333|}
xmlValidCtxtNormalizeAttributeValue:
 3484|  5.47k|	     xmlNode *elem, const xmlChar *name, const xmlChar *value) {
 3485|  5.47k|    xmlChar *ret;
 3486|  5.47k|    xmlAttributePtr attrDecl = NULL;
 3487|  5.47k|    const xmlChar *localName;
 3488|  5.47k|    xmlChar *prefix = NULL;
 3489|  5.47k|    int extsubset = 0;
 3490|       |
 3491|  5.47k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (3491:9): [True: 0, False: 5.47k]
  ------------------
 3492|  5.47k|    if (elem == NULL) return(NULL);
  ------------------
  |  Branch (3492:9): [True: 0, False: 5.47k]
  ------------------
 3493|  5.47k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (3493:9): [True: 0, False: 5.47k]
  ------------------
 3494|  5.47k|    if (value == NULL) return(NULL);
  ------------------
  |  Branch (3494:9): [True: 0, False: 5.47k]
  ------------------
 3495|       |
 3496|  5.47k|    localName = xmlSplitQName4(name, &prefix);
 3497|  5.47k|    if (localName == NULL)
  ------------------
  |  Branch (3497:9): [True: 1, False: 5.47k]
  ------------------
 3498|      1|        goto mem_error;
 3499|       |
 3500|  5.47k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3500:9): [True: 1.97k, False: 3.50k]
  |  Branch (3500:31): [True: 1.15k, False: 817]
  ------------------
 3501|  1.15k|	xmlChar buf[50];
 3502|  1.15k|	xmlChar *elemname;
 3503|       |
 3504|  1.15k|	elemname = xmlBuildQName(elem->name, elem->ns->prefix, buf, 50);
 3505|  1.15k|	if (elemname == NULL)
  ------------------
  |  Branch (3505:6): [True: 1, False: 1.15k]
  ------------------
 3506|      1|	    goto mem_error;
 3507|  1.15k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3507:13): [True: 1.15k, False: 0]
  ------------------
 3508|  1.15k|            attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3509|  1.15k|                                      prefix, elemname);
 3510|  1.15k|	if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3510:6): [True: 928, False: 224]
  |  Branch (3510:28): [True: 502, False: 426]
  ------------------
 3511|    502|	    attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3512|    502|                                      prefix, elemname);
 3513|    502|	    if (attrDecl != NULL)
  ------------------
  |  Branch (3513:10): [True: 202, False: 300]
  ------------------
 3514|    202|		extsubset = 1;
 3515|    502|	}
 3516|  1.15k|	if ((elemname != buf) && (elemname != elem->name))
  ------------------
  |  Branch (3516:6): [True: 616, False: 536]
  |  Branch (3516:27): [True: 616, False: 0]
  ------------------
 3517|    616|	    xmlFree(elemname);
 3518|  1.15k|    }
 3519|  5.47k|    if ((attrDecl == NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (3519:9): [True: 5.04k, False: 426]
  |  Branch (3519:31): [True: 5.04k, False: 0]
  ------------------
 3520|  5.04k|	attrDecl = xmlHashLookup3(doc->intSubset->attributes, localName,
 3521|  5.04k|                                  prefix, elem->name);
 3522|  5.47k|    if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (3522:9): [True: 1.94k, False: 3.52k]
  |  Branch (3522:31): [True: 1.03k, False: 913]
  ------------------
 3523|  1.03k|	attrDecl = xmlHashLookup3(doc->extSubset->attributes, localName,
 3524|  1.03k|                                  prefix, elem->name);
 3525|  1.03k|	if (attrDecl != NULL)
  ------------------
  |  Branch (3525:6): [True: 601, False: 429]
  ------------------
 3526|    601|	    extsubset = 1;
 3527|  1.03k|    }
 3528|       |
 3529|  5.47k|    if (attrDecl == NULL)
  ------------------
  |  Branch (3529:9): [True: 1.34k, False: 4.12k]
  ------------------
 3530|  1.34k|	goto done;
 3531|  4.12k|    if (attrDecl->atype == XML_ATTRIBUTE_CDATA)
  ------------------
  |  Branch (3531:9): [True: 263, False: 3.86k]
  ------------------
 3532|    263|	goto done;
 3533|       |
 3534|  3.86k|    ret = xmlStrdup(value);
 3535|  3.86k|    if (ret == NULL)
  ------------------
  |  Branch (3535:9): [True: 3, False: 3.86k]
  ------------------
 3536|      3|	goto mem_error;
 3537|  3.86k|    xmlValidNormalizeString(ret);
 3538|  3.86k|    if ((doc->standalone) && (extsubset == 1) && (!xmlStrEqual(value, ret))) {
  ------------------
  |  Branch (3538:9): [True: 3.60k, False: 262]
  |  Branch (3538:30): [True: 537, False: 3.06k]
  |  Branch (3538:50): [True: 266, False: 271]
  ------------------
 3539|    266|	xmlErrValidNode(ctxt, elem, XML_DTD_NOT_STANDALONE,
 3540|    266|"standalone: %s on %s value had to be normalized based on external subset declaration\n",
 3541|    266|	       name, elem->name, NULL);
 3542|    266|	ctxt->valid = 0;
 3543|    266|    }
 3544|       |
 3545|  3.86k|    xmlFree(prefix);
 3546|  3.86k|    return(ret);
 3547|       |
 3548|      5|mem_error:
 3549|      5|    xmlVErrMemory(ctxt);
 3550|       |
 3551|  1.61k|done:
 3552|  1.61k|    xmlFree(prefix);
 3553|       |    return(NULL);
 3554|      5|}
xmlValidateAttributeDecl:
 3641|  17.6k|                         xmlAttribute *attr) {
 3642|  17.6k|    int ret = 1;
 3643|  17.6k|    int val;
 3644|  17.6k|    CHECK_DTD;
  ------------------
  |  |  418|  17.6k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 17.6k]
  |  |  ------------------
  |  |  419|  17.6k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 17.6k]
  |  |  ------------------
  |  |  420|  17.6k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3645|  17.6k|    if(attr == NULL) return(1);
  ------------------
  |  Branch (3645:8): [True: 0, False: 17.6k]
  ------------------
 3646|       |
 3647|       |    /* Attribute Default Legal */
 3648|       |    /* Enumeration */
 3649|  17.6k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (3649:9): [True: 3.76k, False: 13.8k]
  ------------------
 3650|  3.76k|	val = xmlValidateAttributeValueInternal(doc, attr->atype,
 3651|  3.76k|	                                        attr->defaultValue);
 3652|  3.76k|	if (val == 0) {
  ------------------
  |  Branch (3652:6): [True: 0, False: 3.76k]
  ------------------
 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.76k|        ret &= val;
 3658|  3.76k|    }
 3659|       |
 3660|       |    /* ID Attribute Default */
 3661|  17.6k|    if ((attr->atype == XML_ATTRIBUTE_ID)&&
  ------------------
  |  Branch (3661:9): [True: 3.79k, False: 13.8k]
  ------------------
 3662|  3.79k|        (attr->def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (3662:9): [True: 958, False: 2.83k]
  ------------------
 3663|    958|	(attr->def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (3663:2): [True: 932, False: 26]
  ------------------
 3664|    932|	xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ID_FIXED,
 3665|    932|          "ID attribute %s of %s is not valid must be #IMPLIED or #REQUIRED\n",
 3666|    932|	       attr->name, attr->elem, NULL);
 3667|    932|	ret = 0;
 3668|    932|    }
 3669|       |
 3670|       |    /* One ID per Element Type */
 3671|  17.6k|    if (attr->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (3671:9): [True: 3.79k, False: 13.8k]
  ------------------
 3672|  3.79k|        xmlElementPtr elem = NULL;
 3673|  3.79k|        const xmlChar *elemLocalName;
 3674|  3.79k|        xmlChar *elemPrefix;
 3675|  3.79k|        int nbId;
 3676|       |
 3677|  3.79k|        elemLocalName = xmlSplitQName4(attr->elem, &elemPrefix);
 3678|  3.79k|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (3678:13): [True: 1, False: 3.79k]
  ------------------
 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|  3.79k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (3684:13): [True: 3.79k, False: 0]
  ------------------
 3685|  3.79k|            elem = xmlHashLookup2(doc->intSubset->elements,
 3686|  3.79k|                                  elemLocalName, elemPrefix);
 3687|  3.79k|	if (elem != NULL) {
  ------------------
  |  Branch (3687:6): [True: 2.88k, False: 906]
  ------------------
 3688|  2.88k|	    nbId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3689|  2.88k|	} else {
 3690|    906|	    xmlAttributeTablePtr table;
 3691|       |
 3692|       |	    /*
 3693|       |	     * The attribute may be declared in the internal subset and the
 3694|       |	     * element in the external subset.
 3695|       |	     */
 3696|    906|	    nbId = 0;
 3697|    906|	    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3697:10): [True: 906, False: 0]
  ------------------
 3698|    906|		table = (xmlAttributeTablePtr) doc->intSubset->attributes;
 3699|    906|		xmlHashScan3(table, NULL, NULL, attr->elem,
 3700|    906|			     xmlValidateAttributeIdCallback, &nbId);
 3701|    906|	    }
 3702|    906|	}
 3703|  3.79k|	if (nbId > 1) {
  ------------------
  |  Branch (3703:6): [True: 153, False: 3.63k]
  ------------------
 3704|       |
 3705|    153|	    xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3706|    153|       "Element %s has %d ID attribute defined in the internal subset : %s\n",
 3707|    153|		   attr->elem, nbId, attr->name);
 3708|    153|            ret = 0;
 3709|  3.63k|	} else if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3709:13): [True: 1.18k, False: 2.45k]
  ------------------
 3710|  1.18k|	    int extId = 0;
 3711|  1.18k|	    elem = xmlHashLookup2(doc->extSubset->elements,
 3712|  1.18k|                                  elemLocalName, elemPrefix);
 3713|  1.18k|	    if (elem != NULL) {
  ------------------
  |  Branch (3713:10): [True: 1.18k, False: 0]
  ------------------
 3714|  1.18k|		extId = xmlScanIDAttributeDecl(ctxt, elem, 0);
 3715|  1.18k|	    }
 3716|  1.18k|	    if (extId > 1) {
  ------------------
  |  Branch (3716:10): [True: 73, False: 1.11k]
  ------------------
 3717|     73|		xmlErrValidNodeNr(ctxt, (xmlNodePtr) attr, XML_DTD_ID_SUBSET,
 3718|     73|       "Element %s has %d ID attribute defined in the external subset : %s\n",
 3719|     73|		       attr->elem, extId, attr->name);
 3720|     73|                ret = 0;
 3721|  1.11k|	    } else if (extId + nbId > 1) {
  ------------------
  |  Branch (3721:17): [True: 1, False: 1.11k]
  ------------------
 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.18k|	}
 3728|       |
 3729|  3.79k|        xmlFree(elemPrefix);
 3730|  3.79k|    }
 3731|       |
 3732|       |    /* Validity Constraint: Enumeration */
 3733|  17.6k|    if ((attr->defaultValue != NULL) && (attr->tree != NULL)) {
  ------------------
  |  Branch (3733:9): [True: 3.76k, False: 13.8k]
  |  Branch (3733:41): [True: 1.88k, False: 1.87k]
  ------------------
 3734|  1.88k|        xmlEnumerationPtr tree = attr->tree;
 3735|  2.45k|	while (tree != NULL) {
  ------------------
  |  Branch (3735:9): [True: 2.12k, False: 327]
  ------------------
 3736|  2.12k|	    if (xmlStrEqual(tree->name, attr->defaultValue)) break;
  ------------------
  |  Branch (3736:10): [True: 1.55k, False: 570]
  ------------------
 3737|    570|	    tree = tree->next;
 3738|    570|	}
 3739|  1.88k|	if (tree == NULL) {
  ------------------
  |  Branch (3739:6): [True: 327, False: 1.55k]
  ------------------
 3740|    327|	    xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_VALUE,
 3741|    327|"Default value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 3742|    327|		   attr->defaultValue, attr->name, attr->elem);
 3743|    327|	    ret = 0;
 3744|    327|	}
 3745|  1.88k|    }
 3746|       |
 3747|  17.6k|    return(ret);
 3748|  17.6k|}
xmlValidateElementDecl:
 3769|  8.94k|                       xmlElement *elem) {
 3770|  8.94k|    int ret = 1;
 3771|  8.94k|    xmlElementPtr tst;
 3772|  8.94k|    const xmlChar *localName;
 3773|  8.94k|    xmlChar *prefix;
 3774|       |
 3775|  8.94k|    CHECK_DTD;
  ------------------
  |  |  418|  8.94k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 8.94k]
  |  |  ------------------
  |  |  419|  8.94k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 8.94k]
  |  |  ------------------
  |  |  420|  8.94k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3776|       |
 3777|  8.94k|    if (elem == NULL) return(1);
  ------------------
  |  Branch (3777:9): [True: 671, False: 8.27k]
  ------------------
 3778|       |
 3779|       |    /* No Duplicate Types */
 3780|  8.27k|    if (elem->etype == XML_ELEMENT_TYPE_MIXED) {
  ------------------
  |  Branch (3780:9): [True: 2.95k, False: 5.32k]
  ------------------
 3781|  2.95k|	xmlElementContentPtr cur, next;
 3782|  2.95k|        const xmlChar *name;
 3783|       |
 3784|  2.95k|	cur = elem->content;
 3785|  17.0k|	while (cur != NULL) {
  ------------------
  |  Branch (3785:9): [True: 17.0k, False: 0]
  ------------------
 3786|  17.0k|	    if (cur->type != XML_ELEMENT_CONTENT_OR) break;
  ------------------
  |  Branch (3786:10): [True: 2.95k, False: 14.1k]
  ------------------
 3787|  14.1k|	    if (cur->c1 == NULL) break;
  ------------------
  |  Branch (3787:10): [True: 0, False: 14.1k]
  ------------------
 3788|  14.1k|	    if (cur->c1->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3788:10): [True: 12.8k, False: 1.33k]
  ------------------
 3789|  12.8k|		name = cur->c1->name;
 3790|  12.8k|		next = cur->c2;
 3791|   508k|		while (next != NULL) {
  ------------------
  |  Branch (3791:10): [True: 508k, False: 0]
  ------------------
 3792|   508k|		    if (next->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (3792:11): [True: 12.8k, False: 495k]
  ------------------
 3793|  12.8k|		        if ((xmlStrEqual(next->name, name)) &&
  ------------------
  |  Branch (3793:15): [True: 1.42k, False: 11.3k]
  ------------------
 3794|  1.42k|			    (xmlStrEqual(next->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3794:8): [True: 1.11k, False: 305]
  ------------------
 3795|  1.11k|			    if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3795:12): [True: 997, False: 122]
  ------------------
 3796|    997|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3797|    997|		   "Definition of %s has duplicate references of %s\n",
 3798|    997|				       elem->name, name, NULL);
 3799|    997|			    } else {
 3800|    122|				xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3801|    122|		   "Definition of %s has duplicate references of %s:%s\n",
 3802|    122|				       elem->name, cur->c1->prefix, name);
 3803|    122|			    }
 3804|  1.11k|			    ret = 0;
 3805|  1.11k|			}
 3806|  12.8k|			break;
 3807|  12.8k|		    }
 3808|   495k|		    if (next->c1 == NULL) break;
  ------------------
  |  Branch (3808:11): [True: 0, False: 495k]
  ------------------
 3809|   495k|		    if (next->c1->type != XML_ELEMENT_CONTENT_ELEMENT) break;
  ------------------
  |  Branch (3809:11): [True: 0, False: 495k]
  ------------------
 3810|   495k|		    if ((xmlStrEqual(next->c1->name, name)) &&
  ------------------
  |  Branch (3810:11): [True: 162k, False: 332k]
  ------------------
 3811|   162k|		        (xmlStrEqual(next->c1->prefix, cur->c1->prefix))) {
  ------------------
  |  Branch (3811:11): [True: 111k, False: 51.5k]
  ------------------
 3812|   111k|			if (cur->c1->prefix == NULL) {
  ------------------
  |  Branch (3812:8): [True: 103k, False: 7.40k]
  ------------------
 3813|   103k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3814|   103k|	       "Definition of %s has duplicate references to %s\n",
 3815|   103k|				   elem->name, name, NULL);
 3816|   103k|			} else {
 3817|  7.40k|			    xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_CONTENT_ERROR,
 3818|  7.40k|	       "Definition of %s has duplicate references to %s:%s\n",
 3819|  7.40k|				   elem->name, cur->c1->prefix, name);
 3820|  7.40k|			}
 3821|   111k|			ret = 0;
 3822|   111k|		    }
 3823|   495k|		    next = next->c2;
 3824|   495k|		}
 3825|  12.8k|	    }
 3826|  14.1k|	    cur = cur->c2;
 3827|  14.1k|	}
 3828|  2.95k|    }
 3829|       |
 3830|  8.27k|    localName = xmlSplitQName4(elem->name, &prefix);
 3831|  8.27k|    if (localName == NULL) {
  ------------------
  |  Branch (3831:9): [True: 1, False: 8.27k]
  ------------------
 3832|      1|        xmlVErrMemory(ctxt);
 3833|      1|        return(0);
 3834|      1|    }
 3835|       |
 3836|       |    /* VC: Unique Element Type Declaration */
 3837|  8.27k|    if (doc->intSubset != NULL) {
  ------------------
  |  Branch (3837:9): [True: 8.27k, False: 0]
  ------------------
 3838|  8.27k|        tst = xmlHashLookup2(doc->intSubset->elements, localName, prefix);
 3839|       |
 3840|  8.27k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3840:13): [True: 6.73k, False: 1.54k]
  |  Branch (3840:31): [True: 535, False: 6.19k]
  ------------------
 3841|    535|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3841:14): [True: 530, False: 5]
  ------------------
 3842|      5|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3842:14): [True: 1, False: 4]
  ------------------
 3843|    531|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3843:13): [True: 530, False: 1]
  ------------------
 3844|    530|            xmlErrValidNode(ctxt, (xmlNodePtr) elem, XML_DTD_ELEM_REDEFINED,
 3845|    530|                            "Redefinition of element %s\n",
 3846|    530|                           elem->name, NULL, NULL);
 3847|    530|            ret = 0;
 3848|    530|        }
 3849|  8.27k|    }
 3850|  8.27k|    if (doc->extSubset != NULL) {
  ------------------
  |  Branch (3850:9): [True: 1.67k, False: 6.59k]
  ------------------
 3851|  1.67k|        tst = xmlHashLookup2(doc->extSubset->elements, localName, prefix);
 3852|       |
 3853|  1.67k|        if ((tst != NULL ) && (tst != elem) &&
  ------------------
  |  Branch (3853:13): [True: 1.65k, False: 23]
  |  Branch (3853:31): [True: 1, False: 1.65k]
  ------------------
 3854|      1|            ((tst->prefix == elem->prefix) ||
  ------------------
  |  Branch (3854:14): [True: 0, False: 1]
  ------------------
 3855|      1|             (xmlStrEqual(tst->prefix, elem->prefix))) &&
  ------------------
  |  Branch (3855:14): [True: 0, False: 1]
  ------------------
 3856|      0|            (tst->etype != XML_ELEMENT_TYPE_UNDEFINED)) {
  ------------------
  |  Branch (3856:13): [True: 0, False: 0]
  ------------------
 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|  1.67k|    }
 3863|       |
 3864|  8.27k|    xmlFree(prefix);
 3865|  8.27k|    return(ret);
 3866|  8.27k|}
xmlValidateOneAttribute:
 3897|  62.1k|{
 3898|  62.1k|    xmlAttributePtr attrDecl =  NULL;
 3899|  62.1k|    const xmlChar *aprefix;
 3900|  62.1k|    int val;
 3901|  62.1k|    int ret = 1;
 3902|       |
 3903|  62.1k|    CHECK_DTD;
  ------------------
  |  |  418|  62.1k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 62.1k]
  |  |  ------------------
  |  |  419|  62.1k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 62.1k]
  |  |  ------------------
  |  |  420|  62.1k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 3904|  62.1k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (3904:9): [True: 0, False: 62.1k]
  |  Branch (3904:27): [True: 0, False: 62.1k]
  ------------------
 3905|  62.1k|    if ((attr == NULL) || (attr->name == NULL)) return(0);
  ------------------
  |  Branch (3905:9): [True: 0, False: 62.1k]
  |  Branch (3905:27): [True: 0, False: 62.1k]
  ------------------
 3906|       |
 3907|  62.1k|    aprefix = (attr->ns != NULL) ? attr->ns->prefix : NULL;
  ------------------
  |  Branch (3907:15): [True: 5.78k, False: 56.3k]
  ------------------
 3908|       |
 3909|  62.1k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL)) {
  ------------------
  |  Branch (3909:9): [True: 7.51k, False: 54.6k]
  |  Branch (3909:31): [True: 3.47k, False: 4.03k]
  ------------------
 3910|  3.47k|	xmlChar fn[50];
 3911|  3.47k|	xmlChar *fullname;
 3912|       |
 3913|  3.47k|	fullname = xmlBuildQName(elem->name, elem->ns->prefix, fn, 50);
 3914|  3.47k|	if (fullname == NULL) {
  ------------------
  |  Branch (3914:6): [True: 1, False: 3.47k]
  ------------------
 3915|      1|            xmlVErrMemory(ctxt);
 3916|      1|	    return(0);
 3917|      1|        }
 3918|  3.47k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 3919|  3.47k|                                      attr->name, aprefix);
 3920|  3.47k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3920:13): [True: 2.99k, False: 483]
  |  Branch (3920:35): [True: 1.19k, False: 1.79k]
  ------------------
 3921|  1.19k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 3922|  1.19k|                                          attr->name, aprefix);
 3923|  3.47k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (3923:6): [True: 2.10k, False: 1.37k]
  |  Branch (3923:26): [True: 2.10k, False: 0]
  ------------------
 3924|  2.10k|	    xmlFree(fullname);
 3925|  3.47k|    }
 3926|  62.1k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3926:9): [True: 61.1k, False: 1.01k]
  ------------------
 3927|  61.1k|        attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 3928|  61.1k|                                      attr->name, aprefix);
 3929|  61.1k|        if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3929:13): [True: 11.2k, False: 49.8k]
  |  Branch (3929:35): [True: 2.14k, False: 9.08k]
  ------------------
 3930|  2.14k|            attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 3931|  2.14k|                                          attr->name, aprefix);
 3932|  61.1k|    }
 3933|       |
 3934|       |
 3935|       |    /* Validity Constraint: Attribute Value Type */
 3936|  62.1k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (3936:9): [True: 9.98k, False: 52.1k]
  ------------------
 3937|  9.98k|	xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 3938|  9.98k|	       "No declaration for attribute %s of element %s\n",
 3939|  9.98k|	       attr->name, elem->name, NULL);
 3940|  9.98k|	return(0);
 3941|  9.98k|    }
 3942|  52.1k|    if (attr->id != NULL)
  ------------------
  |  Branch (3942:9): [True: 0, False: 52.1k]
  ------------------
 3943|      0|        xmlRemoveID(doc, attr);
 3944|  52.1k|    attr->atype = attrDecl->atype;
 3945|       |
 3946|  52.1k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 3947|  52.1k|    if (val == 0) {
  ------------------
  |  Branch (3947:9): [True: 7.33k, False: 44.7k]
  ------------------
 3948|  7.33k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 3949|  7.33k|	   "Syntax of value for attribute %s of %s is not valid\n",
 3950|  7.33k|	       attr->name, elem->name, NULL);
 3951|  7.33k|        ret = 0;
 3952|  7.33k|    }
 3953|       |
 3954|       |    /* Validity constraint: Fixed Attribute Default */
 3955|  52.1k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (3955:9): [True: 3.20k, False: 48.9k]
  ------------------
 3956|  3.20k|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (3956:6): [True: 957, False: 2.24k]
  ------------------
 3957|    957|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 3958|    957|	   "Value for attribute %s of %s is different from default \"%s\"\n",
 3959|    957|		   attr->name, elem->name, attrDecl->defaultValue);
 3960|    957|	    ret = 0;
 3961|    957|	}
 3962|  3.20k|    }
 3963|       |
 3964|       |    /* Validity Constraint: ID uniqueness */
 3965|  52.1k|    if (attrDecl->atype == XML_ATTRIBUTE_ID &&
  ------------------
  |  Branch (3965:9): [True: 3.35k, False: 48.7k]
  ------------------
 3966|  3.35k|        (ctxt == NULL || (ctxt->flags & XML_VCTXT_IN_ENTITY) == 0)) {
  ------------------
  |  |   28|  3.35k|#define XML_VCTXT_IN_ENTITY (1u << 3)
  ------------------
  |  Branch (3966:10): [True: 0, False: 3.35k]
  |  Branch (3966:26): [True: 3.07k, False: 283]
  ------------------
 3967|  3.07k|        if (xmlAddID(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3967:13): [True: 2.66k, False: 409]
  ------------------
 3968|  2.66k|	    ret = 0;
 3969|  3.07k|    }
 3970|       |
 3971|  52.1k|    if ((attrDecl->atype == XML_ATTRIBUTE_IDREF) ||
  ------------------
  |  Branch (3971:9): [True: 2.48k, False: 49.6k]
  ------------------
 3972|  49.6k|	(attrDecl->atype == XML_ATTRIBUTE_IDREFS)) {
  ------------------
  |  Branch (3972:2): [True: 1.95k, False: 47.6k]
  ------------------
 3973|  4.43k|        if (xmlAddRef(ctxt, doc, value, attr) == NULL)
  ------------------
  |  Branch (3973:13): [True: 12, False: 4.42k]
  ------------------
 3974|     12|	    ret = 0;
 3975|  4.43k|    }
 3976|       |
 3977|       |    /* Validity Constraint: Notation Attributes */
 3978|  52.1k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (3978:9): [True: 1.24k, False: 50.8k]
  ------------------
 3979|  1.24k|        xmlEnumerationPtr tree = attrDecl->tree;
 3980|  1.24k|        xmlNotationPtr nota;
 3981|       |
 3982|       |        /* First check that the given NOTATION was declared */
 3983|  1.24k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3984|  1.24k|	if (nota == NULL)
  ------------------
  |  Branch (3984:6): [True: 1.02k, False: 225]
  ------------------
 3985|  1.02k|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3986|       |
 3987|  1.24k|	if (nota == NULL) {
  ------------------
  |  Branch (3987:6): [True: 982, False: 265]
  ------------------
 3988|    982|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 3989|    982|       "Value \"%s\" for attribute %s of %s is not a declared Notation\n",
 3990|    982|		   value, attr->name, elem->name);
 3991|    982|	    ret = 0;
 3992|    982|        }
 3993|       |
 3994|       |	/* Second, verify that it's among the list */
 3995|  2.11k|	while (tree != NULL) {
  ------------------
  |  Branch (3995:9): [True: 1.45k, False: 657]
  ------------------
 3996|  1.45k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (3996:10): [True: 590, False: 867]
  ------------------
 3997|    867|	    tree = tree->next;
 3998|    867|	}
 3999|  1.24k|	if (tree == NULL) {
  ------------------
  |  Branch (3999:6): [True: 657, False: 590]
  ------------------
 4000|    657|	    xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4001|    657|"Value \"%s\" for attribute %s of %s is not among the enumerated notations\n",
 4002|    657|		   value, attr->name, elem->name);
 4003|    657|	    ret = 0;
 4004|    657|	}
 4005|  1.24k|    }
 4006|       |
 4007|       |    /* Validity Constraint: Enumeration */
 4008|  52.1k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4008:9): [True: 38.5k, False: 13.5k]
  ------------------
 4009|  38.5k|        xmlEnumerationPtr tree = attrDecl->tree;
 4010|  51.0k|	while (tree != NULL) {
  ------------------
  |  Branch (4010:9): [True: 39.0k, False: 11.9k]
  ------------------
 4011|  39.0k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4011:10): [True: 26.5k, False: 12.4k]
  ------------------
 4012|  12.4k|	    tree = tree->next;
 4013|  12.4k|	}
 4014|  38.5k|	if (tree == NULL) {
  ------------------
  |  Branch (4014:6): [True: 11.9k, False: 26.5k]
  ------------------
 4015|  11.9k|	    xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4016|  11.9k|       "Value \"%s\" for attribute %s of %s is not among the enumerated set\n",
 4017|  11.9k|		   value, attr->name, elem->name);
 4018|  11.9k|	    ret = 0;
 4019|  11.9k|	}
 4020|  38.5k|    }
 4021|       |
 4022|       |    /* Fixed Attribute Default */
 4023|  52.1k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4023:9): [True: 3.20k, False: 48.9k]
  ------------------
 4024|  3.20k|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4024:9): [True: 957, False: 2.24k]
  ------------------
 4025|    957|	xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4026|    957|	   "Value for attribute %s of %s must be \"%s\"\n",
 4027|    957|	       attr->name, elem->name, attrDecl->defaultValue);
 4028|    957|        ret = 0;
 4029|    957|    }
 4030|       |
 4031|       |    /* Extra check for the attribute value */
 4032|  52.1k|    ret &= xmlValidateAttributeValue2(ctxt, doc, attr->name,
 4033|  52.1k|				      attrDecl->atype, value);
 4034|       |
 4035|  52.1k|    return(ret);
 4036|  62.1k|}
xmlValidateOneNamespace:
 4067|  20.9k|xmlNode *elem, const xmlChar *prefix, xmlNs *ns, const xmlChar *value) {
 4068|       |    /* xmlElementPtr elemDecl; */
 4069|  20.9k|    xmlAttributePtr attrDecl =  NULL;
 4070|  20.9k|    int val;
 4071|  20.9k|    int ret = 1;
 4072|       |
 4073|  20.9k|    CHECK_DTD;
  ------------------
  |  |  418|  20.9k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 20.9k]
  |  |  ------------------
  |  |  419|  20.9k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 20.9k]
  |  |  ------------------
  |  |  420|  20.9k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4074|  20.9k|    if ((elem == NULL) || (elem->name == NULL)) return(0);
  ------------------
  |  Branch (4074:9): [True: 0, False: 20.9k]
  |  Branch (4074:27): [True: 0, False: 20.9k]
  ------------------
 4075|  20.9k|    if ((ns == NULL) || (ns->href == NULL)) return(0);
  ------------------
  |  Branch (4075:9): [True: 0, False: 20.9k]
  |  Branch (4075:25): [True: 0, False: 20.9k]
  ------------------
 4076|       |
 4077|  20.9k|    if (prefix != NULL) {
  ------------------
  |  Branch (4077:9): [True: 12.7k, False: 8.23k]
  ------------------
 4078|  12.7k|	xmlChar fn[50];
 4079|  12.7k|	xmlChar *fullname;
 4080|       |
 4081|  12.7k|	fullname = xmlBuildQName(elem->name, prefix, fn, 50);
 4082|  12.7k|	if (fullname == NULL) {
  ------------------
  |  Branch (4082:6): [True: 2, False: 12.7k]
  ------------------
 4083|      2|	    xmlVErrMemory(ctxt);
 4084|      2|	    return(0);
 4085|      2|	}
 4086|  12.7k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4086:6): [True: 11.7k, False: 960]
  ------------------
 4087|  11.7k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4088|  11.7k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  11.7k|#define BAD_CAST (xmlChar *)
  ------------------
 4089|  11.7k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4089:10): [True: 11.5k, False: 252]
  |  Branch (4089:32): [True: 644, False: 10.8k]
  ------------------
 4090|    644|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4091|    644|					  ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|    644|#define BAD_CAST (xmlChar *)
  ------------------
 4092|  11.7k|	} else {
 4093|    960|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, fullname,
 4094|    960|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|    960|#define BAD_CAST (xmlChar *)
  ------------------
 4095|    960|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4095:10): [True: 760, False: 200]
  |  Branch (4095:32): [True: 499, False: 261]
  ------------------
 4096|    499|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, fullname,
 4097|    499|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|    499|#define BAD_CAST (xmlChar *)
  ------------------
 4098|    960|	}
 4099|  12.7k|	if ((fullname != fn) && (fullname != elem->name))
  ------------------
  |  Branch (4099:6): [True: 1.37k, False: 11.3k]
  |  Branch (4099:26): [True: 1.37k, False: 0]
  ------------------
 4100|  1.37k|	    xmlFree(fullname);
 4101|  12.7k|    }
 4102|  20.9k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4102:9): [True: 20.5k, False: 452]
  ------------------
 4103|  20.5k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4103:6): [True: 16.5k, False: 3.96k]
  ------------------
 4104|  16.5k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4105|  16.5k|		                          ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  16.5k|#define BAD_CAST (xmlChar *)
  ------------------
 4106|  16.5k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4106:10): [True: 12.3k, False: 4.16k]
  |  Branch (4106:32): [True: 1.60k, False: 10.7k]
  ------------------
 4107|  1.60k|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4108|  1.60k|					      ns->prefix, BAD_CAST "xmlns");
  ------------------
  |  |   34|  1.60k|#define BAD_CAST (xmlChar *)
  ------------------
 4109|  16.5k|	} else {
 4110|  3.96k|	    attrDecl = xmlGetDtdQAttrDesc(doc->intSubset, elem->name,
 4111|  3.96k|                                          BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|  3.96k|#define BAD_CAST (xmlChar *)
  ------------------
 4112|  3.96k|	    if ((attrDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (4112:10): [True: 1.42k, False: 2.54k]
  |  Branch (4112:32): [True: 776, False: 647]
  ------------------
 4113|    776|		attrDecl = xmlGetDtdQAttrDesc(doc->extSubset, elem->name,
 4114|    776|                                              BAD_CAST "xmlns", NULL);
  ------------------
  |  |   34|    776|#define BAD_CAST (xmlChar *)
  ------------------
 4115|  3.96k|	}
 4116|  20.5k|    }
 4117|       |
 4118|       |
 4119|       |    /* Validity Constraint: Attribute Value Type */
 4120|  20.9k|    if (attrDecl == NULL) {
  ------------------
  |  Branch (4120:9): [True: 12.8k, False: 8.13k]
  ------------------
 4121|  12.8k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4121:6): [True: 11.4k, False: 1.35k]
  ------------------
 4122|  11.4k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4123|  11.4k|		   "No declaration for attribute xmlns:%s of element %s\n",
 4124|  11.4k|		   ns->prefix, elem->name, NULL);
 4125|  11.4k|	} else {
 4126|  1.35k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ATTRIBUTE,
 4127|  1.35k|		   "No declaration for attribute xmlns of element %s\n",
 4128|  1.35k|		   elem->name, NULL, NULL);
 4129|  1.35k|	}
 4130|  12.8k|	return(0);
 4131|  12.8k|    }
 4132|       |
 4133|  8.13k|    val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
 4134|  8.13k|    if (val == 0) {
  ------------------
  |  Branch (4134:9): [True: 3.21k, False: 4.91k]
  ------------------
 4135|  3.21k|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4135:6): [True: 2.35k, False: 863]
  ------------------
 4136|  2.35k|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4137|  2.35k|	       "Syntax of value for attribute xmlns:%s of %s is not valid\n",
 4138|  2.35k|		   ns->prefix, elem->name, NULL);
 4139|  2.35k|	} else {
 4140|    863|	    xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
 4141|    863|	       "Syntax of value for attribute xmlns of %s is not valid\n",
 4142|    863|		   elem->name, NULL, NULL);
 4143|    863|	}
 4144|  3.21k|        ret = 0;
 4145|  3.21k|    }
 4146|       |
 4147|       |    /* Validity constraint: Fixed Attribute Default */
 4148|  8.13k|    if (attrDecl->def == XML_ATTRIBUTE_FIXED) {
  ------------------
  |  Branch (4148:9): [True: 779, False: 7.35k]
  ------------------
 4149|    779|	if (!xmlStrEqual(value, attrDecl->defaultValue)) {
  ------------------
  |  Branch (4149:6): [True: 321, False: 458]
  ------------------
 4150|    321|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4150:10): [True: 206, False: 115]
  ------------------
 4151|    206|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4152|    206|       "Value for attribute xmlns:%s of %s is different from default \"%s\"\n",
 4153|    206|		       ns->prefix, elem->name, attrDecl->defaultValue);
 4154|    206|	    } else {
 4155|    115|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_DEFAULT,
 4156|    115|       "Value for attribute xmlns of %s is different from default \"%s\"\n",
 4157|    115|		       elem->name, attrDecl->defaultValue, NULL);
 4158|    115|	    }
 4159|    321|	    ret = 0;
 4160|    321|	}
 4161|    779|    }
 4162|       |
 4163|       |    /* Validity Constraint: Notation Attributes */
 4164|  8.13k|    if (attrDecl->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (4164:9): [True: 1.18k, False: 6.94k]
  ------------------
 4165|  1.18k|        xmlEnumerationPtr tree = attrDecl->tree;
 4166|  1.18k|        xmlNotationPtr nota;
 4167|       |
 4168|       |        /* First check that the given NOTATION was declared */
 4169|  1.18k|	nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 4170|  1.18k|	if (nota == NULL)
  ------------------
  |  Branch (4170:6): [True: 971, False: 213]
  ------------------
 4171|    971|	    nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 4172|       |
 4173|  1.18k|	if (nota == NULL) {
  ------------------
  |  Branch (4173:6): [True: 759, False: 425]
  ------------------
 4174|    759|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4174:10): [True: 349, False: 410]
  ------------------
 4175|    349|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4176|    349|       "Value \"%s\" for attribute xmlns:%s of %s is not a declared Notation\n",
 4177|    349|		       value, ns->prefix, elem->name);
 4178|    410|	    } else {
 4179|    410|		xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_NOTATION,
 4180|    410|       "Value \"%s\" for attribute xmlns of %s is not a declared Notation\n",
 4181|    410|		       value, elem->name, NULL);
 4182|    410|	    }
 4183|    759|	    ret = 0;
 4184|    759|        }
 4185|       |
 4186|       |	/* Second, verify that it's among the list */
 4187|  3.27k|	while (tree != NULL) {
  ------------------
  |  Branch (4187:9): [True: 2.37k, False: 893]
  ------------------
 4188|  2.37k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4188:10): [True: 291, False: 2.08k]
  ------------------
 4189|  2.08k|	    tree = tree->next;
 4190|  2.08k|	}
 4191|  1.18k|	if (tree == NULL) {
  ------------------
  |  Branch (4191:6): [True: 893, False: 291]
  ------------------
 4192|    893|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4192:10): [True: 483, False: 410]
  ------------------
 4193|    483|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4194|    483|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated notations\n",
 4195|    483|		       value, ns->prefix, elem->name);
 4196|    483|	    } else {
 4197|    410|		xmlErrValidNode(ctxt, elem, XML_DTD_NOTATION_VALUE,
 4198|    410|"Value \"%s\" for attribute xmlns of %s is not among the enumerated notations\n",
 4199|    410|		       value, elem->name, NULL);
 4200|    410|	    }
 4201|    893|	    ret = 0;
 4202|    893|	}
 4203|  1.18k|    }
 4204|       |
 4205|       |    /* Validity Constraint: Enumeration */
 4206|  8.13k|    if (attrDecl->atype == XML_ATTRIBUTE_ENUMERATION) {
  ------------------
  |  Branch (4206:9): [True: 3.89k, False: 4.23k]
  ------------------
 4207|  3.89k|        xmlEnumerationPtr tree = attrDecl->tree;
 4208|  7.84k|	while (tree != NULL) {
  ------------------
  |  Branch (4208:9): [True: 4.70k, False: 3.14k]
  ------------------
 4209|  4.70k|	    if (xmlStrEqual(tree->name, value)) break;
  ------------------
  |  Branch (4209:10): [True: 752, False: 3.95k]
  ------------------
 4210|  3.95k|	    tree = tree->next;
 4211|  3.95k|	}
 4212|  3.89k|	if (tree == NULL) {
  ------------------
  |  Branch (4212:6): [True: 3.14k, False: 752]
  ------------------
 4213|  3.14k|	    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4213:10): [True: 2.20k, False: 941]
  ------------------
 4214|  2.20k|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4215|  2.20k|"Value \"%s\" for attribute xmlns:%s of %s is not among the enumerated set\n",
 4216|  2.20k|		       value, ns->prefix, elem->name);
 4217|  2.20k|	    } else {
 4218|    941|		xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
 4219|    941|"Value \"%s\" for attribute xmlns of %s is not among the enumerated set\n",
 4220|    941|		       value, elem->name, NULL);
 4221|    941|	    }
 4222|  3.14k|	    ret = 0;
 4223|  3.14k|	}
 4224|  3.89k|    }
 4225|       |
 4226|       |    /* Fixed Attribute Default */
 4227|  8.13k|    if ((attrDecl->def == XML_ATTRIBUTE_FIXED) &&
  ------------------
  |  Branch (4227:9): [True: 779, False: 7.35k]
  ------------------
 4228|    779|        (!xmlStrEqual(attrDecl->defaultValue, value))) {
  ------------------
  |  Branch (4228:9): [True: 321, False: 458]
  ------------------
 4229|    321|	if (ns->prefix != NULL) {
  ------------------
  |  Branch (4229:6): [True: 206, False: 115]
  ------------------
 4230|    206|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4231|    206|		   "Value for attribute xmlns:%s of %s must be \"%s\"\n",
 4232|    206|		   ns->prefix, elem->name, attrDecl->defaultValue);
 4233|    206|	} else {
 4234|    115|	    xmlErrValidNode(ctxt, elem, XML_DTD_ELEM_NAMESPACE,
 4235|    115|		   "Value for attribute xmlns of %s must be \"%s\"\n",
 4236|    115|		   elem->name, attrDecl->defaultValue, NULL);
 4237|    115|	}
 4238|    321|        ret = 0;
 4239|    321|    }
 4240|       |
 4241|       |    /* Extra check for the attribute value */
 4242|  8.13k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (4242:9): [True: 5.31k, False: 2.81k]
  ------------------
 4243|  5.31k|	ret &= xmlValidateAttributeValue2(ctxt, doc, ns->prefix,
 4244|  5.31k|					  attrDecl->atype, value);
 4245|  5.31k|    } 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|  8.13k|    return(ret);
 4251|  20.9k|}
xmlValidatePushElement:
 5222|   128k|                       xmlNode *elem, const xmlChar *qname) {
 5223|   128k|    int ret = 1;
 5224|   128k|    xmlElementPtr eDecl;
 5225|   128k|    int extsubset = 0;
 5226|       |
 5227|   128k|    if (ctxt == NULL)
  ------------------
  |  Branch (5227:9): [True: 0, False: 128k]
  ------------------
 5228|      0|        return(0);
 5229|       |
 5230|   128k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5230:9): [True: 125k, False: 3.00k]
  |  Branch (5230:33): [True: 125k, False: 0]
  ------------------
 5231|   125k|	xmlValidStatePtr state = ctxt->vstate;
 5232|   125k|	xmlElementPtr elemDecl;
 5233|       |
 5234|       |	/*
 5235|       |	 * Check the new element against the content model of the new elem.
 5236|       |	 */
 5237|   125k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5237:6): [True: 84.4k, False: 41.0k]
  ------------------
 5238|  84.4k|	    elemDecl = state->elemDecl;
 5239|       |
 5240|  84.4k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5240:13): [True: 84.4k, False: 0]
  ------------------
 5241|  4.89k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5241:3): [True: 4.89k, False: 79.5k]
  ------------------
 5242|  4.89k|		    ret = 0;
 5243|  4.89k|		    break;
 5244|    308|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5244:3): [True: 308, False: 84.1k]
  ------------------
 5245|    308|		    xmlErrValidNode(ctxt, state->node,
 5246|    308|				    XML_DTD_NOT_EMPTY,
 5247|    308|	       "Element %s was declared EMPTY this one has content\n",
 5248|    308|			   state->node->name, NULL, NULL);
 5249|    308|		    ret = 0;
 5250|    308|		    break;
 5251|    462|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5251:3): [True: 462, False: 83.9k]
  ------------------
 5252|       |		    /* I don't think anything is required then */
 5253|    462|		    break;
 5254|  4.19k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5254:3): [True: 4.19k, False: 80.2k]
  ------------------
 5255|       |		    /* simple case of declared as #PCDATA */
 5256|  4.19k|		    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5256:11): [True: 4.19k, False: 0]
  ------------------
 5257|  4.19k|			(elemDecl->content->type ==
  ------------------
  |  Branch (5257:4): [True: 1.33k, False: 2.86k]
  ------------------
 5258|  4.19k|			 XML_ELEMENT_CONTENT_PCDATA)) {
 5259|  1.33k|			xmlErrValidNode(ctxt, state->node,
 5260|  1.33k|					XML_DTD_NOT_PCDATA,
 5261|  1.33k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5262|  1.33k|				state->node->name, NULL, NULL);
 5263|  1.33k|			ret = 0;
 5264|  2.86k|		    } else {
 5265|  2.86k|			ret = xmlValidateCheckMixed(ctxt, elemDecl->content,
 5266|  2.86k|				                    qname);
 5267|  2.86k|			if (ret != 1) {
  ------------------
  |  Branch (5267:8): [True: 1.98k, False: 879]
  ------------------
 5268|  1.98k|			    xmlErrValidNode(ctxt, state->node,
 5269|  1.98k|					    XML_DTD_INVALID_CHILD,
 5270|  1.98k|	       "Element %s is not declared in %s list of possible children\n",
 5271|  1.98k|				    qname, state->node->name, NULL);
 5272|  1.98k|			}
 5273|  2.86k|		    }
 5274|  4.19k|		    break;
 5275|  74.5k|		case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5275:3): [True: 74.5k, False: 9.86k]
  ------------------
 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|  74.5k|		    if (state->exec != NULL) {
  ------------------
  |  Branch (5282:11): [True: 74.0k, False: 497]
  ------------------
 5283|  74.0k|			ret = xmlRegExecPushString(state->exec, qname, NULL);
 5284|  74.0k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY) {
  ------------------
  |  |   14|  74.0k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5284:29): [True: 287, False: 73.7k]
  ------------------
 5285|    287|                            xmlVErrMemory(ctxt);
 5286|    287|                            return(0);
 5287|    287|                        }
 5288|  73.7k|			if (ret < 0) {
  ------------------
  |  Branch (5288:8): [True: 8.30k, False: 65.4k]
  ------------------
 5289|  8.30k|			    xmlErrValidNode(ctxt, state->node,
 5290|  8.30k|					    XML_DTD_CONTENT_MODEL,
 5291|  8.30k|	       "Element %s content does not follow the DTD, Misplaced %s\n",
 5292|  8.30k|				   state->node->name, qname, NULL);
 5293|  8.30k|			    ret = 0;
 5294|  65.4k|			} else {
 5295|  65.4k|			    ret = 1;
 5296|  65.4k|			}
 5297|  73.7k|		    }
 5298|  74.2k|		    break;
 5299|  84.4k|	    }
 5300|  84.4k|	}
 5301|   125k|    }
 5302|   128k|    eDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5303|   128k|    vstateVPush(ctxt, eDecl, elem);
 5304|   128k|    return(ret);
 5305|   128k|}
xmlValidatePushCData:
 5318|  35.9k|xmlValidatePushCData(xmlValidCtxt *ctxt, const xmlChar *data, int len) {
 5319|  35.9k|    int ret = 1;
 5320|       |
 5321|  35.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (5321:9): [True: 0, False: 35.9k]
  ------------------
 5322|      0|        return(0);
 5323|  35.9k|    if (len <= 0)
  ------------------
  |  Branch (5323:9): [True: 274, False: 35.6k]
  ------------------
 5324|    274|	return(ret);
 5325|  35.6k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5325:9): [True: 35.2k, False: 400]
  |  Branch (5325:33): [True: 35.2k, False: 0]
  ------------------
 5326|  35.2k|	xmlValidStatePtr state = ctxt->vstate;
 5327|  35.2k|	xmlElementPtr elemDecl;
 5328|       |
 5329|       |	/*
 5330|       |	 * Check the new element against the content model of the new elem.
 5331|       |	 */
 5332|  35.2k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5332:6): [True: 16.0k, False: 19.2k]
  ------------------
 5333|  16.0k|	    elemDecl = state->elemDecl;
 5334|       |
 5335|  16.0k|	    switch(elemDecl->etype) {
  ------------------
  |  Branch (5335:13): [True: 16.0k, False: 0]
  ------------------
 5336|  2.78k|		case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5336:3): [True: 2.78k, False: 13.2k]
  ------------------
 5337|  2.78k|		    ret = 0;
 5338|  2.78k|		    break;
 5339|    306|		case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5339:3): [True: 306, False: 15.7k]
  ------------------
 5340|    306|		    xmlErrValidNode(ctxt, state->node,
 5341|    306|				    XML_DTD_NOT_EMPTY,
 5342|    306|	       "Element %s was declared EMPTY this one has content\n",
 5343|    306|			   state->node->name, NULL, NULL);
 5344|    306|		    ret = 0;
 5345|    306|		    break;
 5346|    299|		case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5346:3): [True: 299, False: 15.7k]
  ------------------
 5347|    299|		    break;
 5348|  8.88k|		case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5348:3): [True: 8.88k, False: 7.18k]
  ------------------
 5349|  8.88k|		    break;
 5350|  3.80k|		case XML_ELEMENT_TYPE_ELEMENT: {
  ------------------
  |  Branch (5350:3): [True: 3.80k, False: 12.2k]
  ------------------
 5351|  3.80k|                    int i;
 5352|       |
 5353|  5.73k|                    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (5353:32): [True: 4.91k, False: 815]
  ------------------
 5354|  4.91k|                        if (!IS_BLANK_CH(data[i])) {
  ------------------
  |  |  137|  4.91k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  4.91k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 754, False: 4.16k]
  |  |  |  |  ------------------
  |  |  |  |   91|  4.91k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 4.16k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 908, False: 3.25k]
  |  |  |  |  ------------------
  |  |  |  |   92|  4.91k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 267, False: 2.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5355|  2.98k|                            xmlErrValidNode(ctxt, state->node,
 5356|  2.98k|                                            XML_DTD_CONTENT_MODEL,
 5357|  2.98k|       "Element %s content does not follow the DTD, Text not allowed\n",
 5358|  2.98k|                                   state->node->name, NULL, NULL);
 5359|  2.98k|                            ret = 0;
 5360|  2.98k|                            goto done;
 5361|  2.98k|                        }
 5362|  4.91k|                    }
 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|    815|                    break;
 5370|  3.80k|                }
 5371|  16.0k|	    }
 5372|  16.0k|	}
 5373|  35.2k|    }
 5374|  35.6k|done:
 5375|  35.6k|    return(ret);
 5376|  35.6k|}
xmlValidatePopElement:
 5392|   128k|		      const xmlChar *qname ATTRIBUTE_UNUSED) {
 5393|   128k|    int ret = 1;
 5394|       |
 5395|   128k|    if (ctxt == NULL)
  ------------------
  |  Branch (5395:9): [True: 0, False: 128k]
  ------------------
 5396|      0|        return(0);
 5397|       |
 5398|   128k|    if ((ctxt->vstateNr > 0) && (ctxt->vstate != NULL)) {
  ------------------
  |  Branch (5398:9): [True: 128k, False: 314]
  |  Branch (5398:33): [True: 128k, False: 0]
  ------------------
 5399|   128k|	xmlValidStatePtr state = ctxt->vstate;
 5400|   128k|	xmlElementPtr elemDecl;
 5401|       |
 5402|       |	/*
 5403|       |	 * Check the new element against the content model of the new elem.
 5404|       |	 */
 5405|   128k|	if (state->elemDecl != NULL) {
  ------------------
  |  Branch (5405:6): [True: 30.2k, False: 97.7k]
  ------------------
 5406|  30.2k|	    elemDecl = state->elemDecl;
 5407|       |
 5408|  30.2k|	    if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
  ------------------
  |  Branch (5408:10): [True: 9.89k, False: 20.3k]
  ------------------
 5409|  9.89k|		if (state->exec != NULL) {
  ------------------
  |  Branch (5409:7): [True: 9.36k, False: 535]
  ------------------
 5410|  9.36k|		    ret = xmlRegExecPushString(state->exec, NULL, NULL);
 5411|  9.36k|		    if (ret <= 0) {
  ------------------
  |  Branch (5411:11): [True: 7.08k, False: 2.27k]
  ------------------
 5412|  7.08k|                        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  7.08k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (5412:29): [True: 22, False: 7.06k]
  ------------------
 5413|     22|                            xmlVErrMemory(ctxt);
 5414|  7.06k|                        else
 5415|  7.06k|			    xmlErrValidNode(ctxt, state->node,
 5416|  7.06k|			                    XML_DTD_CONTENT_MODEL,
 5417|  7.06k|	   "Element %s content does not follow the DTD, Expecting more children\n",
 5418|  7.06k|			       state->node->name, NULL,NULL);
 5419|  7.08k|			ret = 0;
 5420|  7.08k|		    } else {
 5421|       |			/*
 5422|       |			 * previous validation errors should not generate
 5423|       |			 * a new one here
 5424|       |			 */
 5425|  2.27k|			ret = 1;
 5426|  2.27k|		    }
 5427|  9.36k|		}
 5428|  9.89k|	    }
 5429|  30.2k|	}
 5430|   128k|	vstateVPop(ctxt);
 5431|   128k|    }
 5432|   128k|    return(ret);
 5433|   128k|}
xmlValidateOneElement:
 5458|   114k|                      xmlNode *elem) {
 5459|   114k|    xmlElementPtr elemDecl = NULL;
 5460|   114k|    xmlElementContentPtr cont;
 5461|   114k|    xmlAttributePtr attr;
 5462|   114k|    xmlNodePtr child;
 5463|   114k|    int ret = 1, tmp;
 5464|   114k|    const xmlChar *name;
 5465|   114k|    int extsubset = 0;
 5466|       |
 5467|   114k|    CHECK_DTD;
  ------------------
  |  |  418|   114k|   if (doc == NULL) return(0);					\
  |  |  ------------------
  |  |  |  Branch (418:8): [True: 0, False: 114k]
  |  |  ------------------
  |  |  419|   114k|   else if ((doc->intSubset == NULL) &&				\
  |  |  ------------------
  |  |  |  Branch (419:13): [True: 0, False: 114k]
  |  |  ------------------
  |  |  420|   114k|	    (doc->extSubset == NULL)) return(0)
  |  |  ------------------
  |  |  |  Branch (420:6): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 5468|       |
 5469|   114k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (5469:9): [True: 0, False: 114k]
  ------------------
 5470|   114k|    switch (elem->type) {
 5471|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5471:9): [True: 0, False: 114k]
  ------------------
 5472|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5472:9): [True: 0, False: 114k]
  ------------------
 5473|      0|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5473:9): [True: 0, False: 114k]
  ------------------
 5474|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5474:9): [True: 0, False: 114k]
  ------------------
 5475|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5475:9): [True: 0, False: 114k]
  ------------------
 5476|      0|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (5476:9): [True: 0, False: 114k]
  ------------------
 5477|      0|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (5477:9): [True: 0, False: 114k]
  ------------------
 5478|      0|	    return(1);
 5479|   114k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5479:9): [True: 114k, False: 0]
  ------------------
 5480|   114k|	    break;
 5481|      0|	default:
  ------------------
  |  Branch (5481:2): [True: 0, False: 114k]
  ------------------
 5482|      0|	    xmlErrValidNode(ctxt, elem, XML_ERR_INTERNAL_ERROR,
 5483|      0|		   "unexpected element type\n", NULL, NULL ,NULL);
 5484|      0|	    return(0);
 5485|   114k|    }
 5486|       |
 5487|       |    /*
 5488|       |     * Fetch the declaration
 5489|       |     */
 5490|   114k|    elemDecl = xmlValidGetElemDecl(ctxt, doc, elem, &extsubset);
 5491|   114k|    if (elemDecl == NULL)
  ------------------
  |  Branch (5491:9): [True: 84.6k, False: 29.8k]
  ------------------
 5492|  84.6k|	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|  29.8k|    if (ctxt->vstateNr == 0) {
  ------------------
  |  Branch (5498:9): [True: 12.0k, False: 17.7k]
  ------------------
 5499|       |    /* Check that the element content matches the definition */
 5500|  12.0k|    switch (elemDecl->etype) {
  ------------------
  |  Branch (5500:13): [True: 12.0k, False: 0]
  ------------------
 5501|  2.86k|        case XML_ELEMENT_TYPE_UNDEFINED:
  ------------------
  |  Branch (5501:9): [True: 2.86k, False: 9.23k]
  ------------------
 5502|  2.86k|	    xmlErrValidNode(ctxt, elem, XML_DTD_UNKNOWN_ELEM,
 5503|  2.86k|	                    "No declaration for element %s\n",
 5504|  2.86k|		   elem->name, NULL, NULL);
 5505|  2.86k|	    return(0);
 5506|  1.58k|        case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (5506:9): [True: 1.58k, False: 10.5k]
  ------------------
 5507|  1.58k|	    if (elem->children != NULL) {
  ------------------
  |  Branch (5507:10): [True: 250, False: 1.33k]
  ------------------
 5508|    250|		xmlErrValidNode(ctxt, elem, XML_DTD_NOT_EMPTY,
 5509|    250|	       "Element %s was declared EMPTY this one has content\n",
 5510|    250|	               elem->name, NULL, NULL);
 5511|    250|		ret = 0;
 5512|    250|	    }
 5513|  1.58k|	    break;
 5514|    256|        case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (5514:9): [True: 256, False: 11.8k]
  ------------------
 5515|       |	    /* I don't think anything is required then */
 5516|    256|	    break;
 5517|  2.69k|        case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (5517:9): [True: 2.69k, False: 9.40k]
  ------------------
 5518|       |
 5519|       |	    /* simple case of declared as #PCDATA */
 5520|  2.69k|	    if ((elemDecl->content != NULL) &&
  ------------------
  |  Branch (5520:10): [True: 2.69k, False: 0]
  ------------------
 5521|  2.69k|		(elemDecl->content->type == XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5521:3): [True: 2.13k, False: 553]
  ------------------
 5522|  2.13k|		ret = xmlValidateOneCdataElement(ctxt, doc, elem);
 5523|  2.13k|		if (!ret) {
  ------------------
  |  Branch (5523:7): [True: 1.16k, False: 979]
  ------------------
 5524|  1.16k|		    xmlErrValidNode(ctxt, elem, XML_DTD_NOT_PCDATA,
 5525|  1.16k|	       "Element %s was declared #PCDATA but contains non text nodes\n",
 5526|  1.16k|			   elem->name, NULL, NULL);
 5527|  1.16k|		}
 5528|  2.13k|		break;
 5529|  2.13k|	    }
 5530|    553|	    child = elem->children;
 5531|       |	    /* Hum, this start to get messy */
 5532|  1.87k|	    while (child != NULL) {
  ------------------
  |  Branch (5532:13): [True: 1.31k, False: 552]
  ------------------
 5533|  1.31k|	        if (child->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5533:14): [True: 830, False: 488]
  ------------------
 5534|    830|		    name = child->name;
 5535|    830|		    if ((child->ns != NULL) && (child->ns->prefix != NULL)) {
  ------------------
  |  Branch (5535:11): [True: 361, False: 469]
  |  Branch (5535:34): [True: 284, False: 77]
  ------------------
 5536|    284|			xmlChar fn[50];
 5537|    284|			xmlChar *fullname;
 5538|       |
 5539|    284|			fullname = xmlBuildQName(child->name, child->ns->prefix,
 5540|    284|				                 fn, 50);
 5541|    284|			if (fullname == NULL) {
  ------------------
  |  Branch (5541:8): [True: 1, False: 283]
  ------------------
 5542|      1|                            xmlVErrMemory(ctxt);
 5543|      1|			    return(0);
 5544|      1|                        }
 5545|    283|			cont = elemDecl->content;
 5546|  1.49k|			while (cont != NULL) {
  ------------------
  |  Branch (5546:11): [True: 1.30k, False: 188]
  ------------------
 5547|  1.30k|			    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5547:12): [True: 249, False: 1.06k]
  ------------------
 5548|    249|				if (xmlStrEqual(cont->name, fullname))
  ------------------
  |  Branch (5548:9): [True: 61, False: 188]
  ------------------
 5549|     61|				    break;
 5550|  1.06k|			    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5550:19): [True: 1.06k, False: 0]
  ------------------
 5551|  1.06k|			       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5551:11): [True: 1.06k, False: 0]
  ------------------
 5552|  1.06k|			       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5552:11): [True: 777, False: 283]
  ------------------
 5553|    777|				if (xmlStrEqual(cont->c1->name, fullname))
  ------------------
  |  Branch (5553:9): [True: 34, False: 743]
  ------------------
 5554|     34|				    break;
 5555|    777|			    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5555:19): [True: 0, False: 283]
  ------------------
 5556|    283|				(cont->c1 == NULL) ||
  ------------------
  |  Branch (5556:5): [True: 0, False: 283]
  ------------------
 5557|    283|				(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5557:5): [True: 0, False: 283]
  ------------------
 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.21k|			    cont = cont->c2;
 5564|  1.21k|			}
 5565|    283|			if ((fullname != fn) && (fullname != child->name))
  ------------------
  |  Branch (5565:8): [True: 37, False: 246]
  |  Branch (5565:28): [True: 37, False: 0]
  ------------------
 5566|     37|			    xmlFree(fullname);
 5567|    283|			if (cont != NULL)
  ------------------
  |  Branch (5567:8): [True: 95, False: 188]
  ------------------
 5568|     95|			    goto child_ok;
 5569|    283|		    }
 5570|    734|		    cont = elemDecl->content;
 5571|  3.49k|		    while (cont != NULL) {
  ------------------
  |  Branch (5571:14): [True: 3.12k, False: 366]
  ------------------
 5572|  3.12k|		        if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5572:15): [True: 628, False: 2.49k]
  ------------------
 5573|    628|			    if (xmlStrEqual(cont->name, name)) break;
  ------------------
  |  Branch (5573:12): [True: 262, False: 366]
  ------------------
 5574|  2.49k|			} else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5574:15): [True: 2.49k, False: 0]
  ------------------
 5575|  2.49k|			   (cont->c1 != NULL) &&
  ------------------
  |  Branch (5575:7): [True: 2.49k, False: 0]
  ------------------
 5576|  2.49k|			   (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)) {
  ------------------
  |  Branch (5576:7): [True: 1.76k, False: 734]
  ------------------
 5577|  1.76k|			    if (xmlStrEqual(cont->c1->name, name)) break;
  ------------------
  |  Branch (5577:12): [True: 106, False: 1.65k]
  ------------------
 5578|  1.76k|			} else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5578:15): [True: 0, False: 734]
  ------------------
 5579|    734|			    (cont->c1 == NULL) ||
  ------------------
  |  Branch (5579:8): [True: 0, False: 734]
  ------------------
 5580|    734|			    (cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)) {
  ------------------
  |  Branch (5580:8): [True: 0, False: 734]
  ------------------
 5581|      0|			    xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5582|      0|				    "Internal: MIXED struct corrupted\n",
 5583|      0|				    NULL);
 5584|      0|			    break;
 5585|      0|			}
 5586|  2.75k|			cont = cont->c2;
 5587|  2.75k|		    }
 5588|    734|		    if (cont == NULL) {
  ------------------
  |  Branch (5588:11): [True: 366, False: 368]
  ------------------
 5589|    366|			xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_CHILD,
 5590|    366|	       "Element %s is not declared in %s list of possible children\n",
 5591|    366|			       name, elem->name, NULL);
 5592|    366|			ret = 0;
 5593|    366|		    }
 5594|    734|		}
 5595|  1.31k|child_ok:
 5596|  1.31k|	        child = child->next;
 5597|  1.31k|	    }
 5598|    552|	    break;
 5599|  4.69k|        case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (5599:9): [True: 4.69k, False: 7.40k]
  ------------------
 5600|  4.69k|	    if ((doc->standalone == 1) && (extsubset == 1)) {
  ------------------
  |  Branch (5600:10): [True: 342, False: 4.35k]
  |  Branch (5600:36): [True: 304, False: 38]
  ------------------
 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|    304|		child = elem->children;
 5607|    726|		while (child != NULL) {
  ------------------
  |  Branch (5607:10): [True: 460, False: 266]
  ------------------
 5608|    460|		    if ((child->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (5608:11): [True: 226, False: 234]
  ------------------
 5609|    226|                        (child->content != NULL)) {
  ------------------
  |  Branch (5609:25): [True: 226, False: 0]
  ------------------
 5610|    226|			const xmlChar *content = child->content;
 5611|       |
 5612|    226|			while (IS_BLANK_CH(*content))
 5613|  1.09k|			    content++;
 5614|    226|			if (*content == 0) {
  ------------------
  |  Branch (5614:8): [True: 38, False: 188]
  ------------------
 5615|     38|			    xmlErrValidNode(ctxt, elem,
 5616|     38|			                    XML_DTD_STANDALONE_WHITE_SPACE,
 5617|     38|"standalone: %s declared in the external subset contains white spaces nodes\n",
 5618|     38|				   elem->name, NULL, NULL);
 5619|     38|			    ret = 0;
 5620|     38|			    break;
 5621|     38|			}
 5622|    226|		    }
 5623|    422|		    child =child->next;
 5624|    422|		}
 5625|    304|	    }
 5626|  4.69k|	    child = elem->children;
 5627|  4.69k|	    cont = elemDecl->content;
 5628|  4.69k|	    tmp = xmlValidateElementContent(ctxt, child, elemDecl, 1, elem);
 5629|  4.69k|	    if (tmp <= 0)
  ------------------
  |  Branch (5629:10): [True: 3.91k, False: 785]
  ------------------
 5630|  3.91k|		ret = 0;
 5631|  4.69k|	    break;
 5632|  12.0k|    }
 5633|  12.0k|    } /* not continuous */
 5634|       |
 5635|       |    /* [ VC: Required Attribute ] */
 5636|  27.0k|    attr = elemDecl->attributes;
 5637|   100k|    while (attr != NULL) {
  ------------------
  |  Branch (5637:12): [True: 73.9k, False: 27.0k]
  ------------------
 5638|  73.9k|	if (attr->def == XML_ATTRIBUTE_REQUIRED) {
  ------------------
  |  Branch (5638:6): [True: 2.72k, False: 71.2k]
  ------------------
 5639|  2.72k|	    int qualified = -1;
 5640|       |
 5641|  2.72k|	    if ((attr->prefix == NULL) &&
  ------------------
  |  Branch (5641:10): [True: 1.51k, False: 1.20k]
  ------------------
 5642|  1.51k|		(xmlStrEqual(attr->name, BAD_CAST "xmlns"))) {
  ------------------
  |  |   34|  1.51k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5642:3): [True: 392, False: 1.12k]
  ------------------
 5643|    392|		xmlNsPtr ns;
 5644|       |
 5645|    392|		ns = elem->nsDef;
 5646|    628|		while (ns != NULL) {
  ------------------
  |  Branch (5646:10): [True: 303, False: 325]
  ------------------
 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|  2.32k|	    } else if (xmlStrEqual(attr->prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.32k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5651:17): [True: 605, False: 1.72k]
  ------------------
 5652|    605|		xmlNsPtr ns;
 5653|       |
 5654|    605|		ns = elem->nsDef;
 5655|    641|		while (ns != NULL) {
  ------------------
  |  Branch (5655:10): [True: 37, False: 604]
  ------------------
 5656|     37|		    if (xmlStrEqual(attr->name, ns->prefix))
  ------------------
  |  Branch (5656:11): [True: 1, False: 36]
  ------------------
 5657|      1|			goto found;
 5658|     36|		    ns = ns->next;
 5659|     36|		}
 5660|  1.72k|	    } else {
 5661|  1.72k|		xmlAttrPtr attrib;
 5662|       |
 5663|  1.72k|		attrib = elem->properties;
 5664|  3.11k|		while (attrib != NULL) {
  ------------------
  |  Branch (5664:10): [True: 1.66k, False: 1.44k]
  ------------------
 5665|  1.66k|		    if (xmlStrEqual(attrib->name, attr->name)) {
  ------------------
  |  Branch (5665:11): [True: 607, False: 1.05k]
  ------------------
 5666|    607|			if (attr->prefix != NULL) {
  ------------------
  |  Branch (5666:8): [True: 406, False: 201]
  ------------------
 5667|    406|			    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|    406|			    if (nameSpace == NULL) {
  ------------------
  |  Branch (5674:12): [True: 110, False: 296]
  ------------------
 5675|    110|				if (qualified < 0)
  ------------------
  |  Branch (5675:9): [True: 100, False: 10]
  ------------------
 5676|    100|				    qualified = 0;
 5677|    296|			    } else if (!xmlStrEqual(nameSpace->prefix,
  ------------------
  |  Branch (5677:19): [True: 222, False: 74]
  ------------------
 5678|    296|						    attr->prefix)) {
 5679|    222|				if (qualified < 1)
  ------------------
  |  Branch (5679:9): [True: 222, False: 0]
  ------------------
 5680|    222|				    qualified = 1;
 5681|    222|			    } else
 5682|     74|				goto found;
 5683|    406|			} 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|    607|		    }
 5693|  1.39k|		    attrib = attrib->next;
 5694|  1.39k|		}
 5695|  1.72k|	    }
 5696|  2.37k|	    if (qualified == -1) {
  ------------------
  |  Branch (5696:10): [True: 2.05k, False: 322]
  ------------------
 5697|  2.05k|		if (attr->prefix == NULL) {
  ------------------
  |  Branch (5697:7): [True: 1.24k, False: 812]
  ------------------
 5698|  1.24k|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5699|  1.24k|		       "Element %s does not carry attribute %s\n",
 5700|  1.24k|			   elem->name, attr->name, NULL);
 5701|  1.24k|		    ret = 0;
 5702|  1.24k|	        } else {
 5703|    812|		    xmlErrValidNode(ctxt, elem, XML_DTD_MISSING_ATTRIBUTE,
 5704|    812|		       "Element %s does not carry attribute %s:%s\n",
 5705|    812|			   elem->name, attr->prefix,attr->name);
 5706|    812|		    ret = 0;
 5707|    812|		}
 5708|  2.05k|	    } else if (qualified == 0) {
  ------------------
  |  Branch (5708:17): [True: 100, False: 222]
  ------------------
 5709|    100|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_NO_PREFIX,
  ------------------
  |  Branch (5709:7): [True: 11, False: 89]
  ------------------
 5710|    100|		                       "Element %s required attribute %s:%s "
 5711|    100|                                       "has no prefix\n",
 5712|    100|		                       elem->name, attr->prefix,
 5713|    100|                                       attr->name) < 0)
 5714|     11|                    ret = 0;
 5715|    222|	    } else if (qualified == 1) {
  ------------------
  |  Branch (5715:17): [True: 222, False: 0]
  ------------------
 5716|    222|		if (xmlErrValidWarning(ctxt, elem, XML_DTD_DIFFERENT_PREFIX,
  ------------------
  |  Branch (5716:7): [True: 12, False: 210]
  ------------------
 5717|    222|		                       "Element %s required attribute %s:%s "
 5718|    222|                                       "has different prefix\n",
 5719|    222|		                       elem->name, attr->prefix,
 5720|    222|                                       attr->name) < 0)
 5721|     12|                    ret = 0;
 5722|    222|	    }
 5723|  2.37k|	}
 5724|  73.9k|found:
 5725|  73.9k|        attr = attr->nexth;
 5726|  73.9k|    }
 5727|  27.0k|    return(ret);
 5728|  27.0k|}
xmlValidateRoot:
 5747|  6.78k|xmlValidateRoot(xmlValidCtxt *ctxt, xmlDoc *doc) {
 5748|  6.78k|    xmlNodePtr root;
 5749|  6.78k|    int ret;
 5750|       |
 5751|  6.78k|    if (doc == NULL) return(0);
  ------------------
  |  Branch (5751:9): [True: 0, False: 6.78k]
  ------------------
 5752|       |
 5753|  6.78k|    root = xmlDocGetRootElement(doc);
 5754|  6.78k|    if ((root == NULL) || (root->name == NULL)) {
  ------------------
  |  Branch (5754:9): [True: 0, False: 6.78k]
  |  Branch (5754:27): [True: 0, False: 6.78k]
  ------------------
 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|  6.78k|    if ((doc->intSubset != NULL) &&
  ------------------
  |  Branch (5764:9): [True: 6.78k, False: 0]
  ------------------
 5765|  6.78k|	(doc->intSubset->name != NULL)) {
  ------------------
  |  Branch (5765:2): [True: 6.53k, False: 251]
  ------------------
 5766|       |	/*
 5767|       |	 * Check first the document root against the NQName
 5768|       |	 */
 5769|  6.53k|	if (!xmlStrEqual(doc->intSubset->name, root->name)) {
  ------------------
  |  Branch (5769:6): [True: 4.60k, False: 1.92k]
  ------------------
 5770|  4.60k|	    if ((root->ns != NULL) && (root->ns->prefix != NULL)) {
  ------------------
  |  Branch (5770:10): [True: 286, False: 4.31k]
  |  Branch (5770:32): [True: 76, False: 210]
  ------------------
 5771|     76|		xmlChar fn[50];
 5772|     76|		xmlChar *fullname;
 5773|       |
 5774|     76|		fullname = xmlBuildQName(root->name, root->ns->prefix, fn, 50);
 5775|     76|		if (fullname == NULL) {
  ------------------
  |  Branch (5775:7): [True: 1, False: 75]
  ------------------
 5776|      1|		    xmlVErrMemory(ctxt);
 5777|      1|		    return(0);
 5778|      1|		}
 5779|     75|		ret = xmlStrEqual(doc->intSubset->name, fullname);
 5780|     75|		if ((fullname != fn) && (fullname != root->name))
  ------------------
  |  Branch (5780:7): [True: 41, False: 34]
  |  Branch (5780:27): [True: 41, False: 0]
  ------------------
 5781|     41|		    xmlFree(fullname);
 5782|     75|		if (ret == 1)
  ------------------
  |  Branch (5782:7): [True: 26, False: 49]
  ------------------
 5783|     26|		    goto name_ok;
 5784|     75|	    }
 5785|  4.57k|	    if ((xmlStrEqual(doc->intSubset->name, BAD_CAST "HTML")) &&
  ------------------
  |  |   34|  4.57k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5785:10): [True: 5, False: 4.57k]
  ------------------
 5786|      5|		(xmlStrEqual(root->name, BAD_CAST "html")))
  ------------------
  |  |   34|      5|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5786:3): [True: 1, False: 4]
  ------------------
 5787|      1|		goto name_ok;
 5788|  4.57k|	    xmlErrValidNode(ctxt, root, XML_DTD_ROOT_NAME,
 5789|  4.57k|		   "root and DTD name do not match '%s' and '%s'\n",
 5790|  4.57k|		   root->name, doc->intSubset->name, NULL);
 5791|  4.57k|	    return(0);
 5792|  4.57k|	}
 5793|  6.53k|    }
 5794|  2.20k|name_ok:
 5795|  2.20k|    return(1);
 5796|  6.78k|}
xmlValidateDocumentFinal:
 6004|    616|xmlValidateDocumentFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6005|    616|    xmlRefTablePtr table;
 6006|    616|    xmlParserCtxtPtr pctxt = NULL;
 6007|    616|    xmlParserInputPtr oldInput = NULL;
 6008|       |
 6009|    616|    if (ctxt == NULL)
  ------------------
  |  Branch (6009:9): [True: 0, False: 616]
  ------------------
 6010|      0|        return(0);
 6011|    616|    if (doc == NULL) {
  ------------------
  |  Branch (6011:9): [True: 0, False: 616]
  ------------------
 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|    616|    if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|    616|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6030:9): [True: 616, False: 0]
  ------------------
 6031|    616|        pctxt = ctxt->userData;
 6032|    616|        oldInput = pctxt->input;
 6033|    616|        pctxt->input = NULL;
 6034|    616|    }
 6035|       |
 6036|    616|    table = (xmlRefTablePtr) doc->refs;
 6037|    616|    ctxt->doc = doc;
 6038|    616|    ctxt->valid = 1;
 6039|    616|    xmlHashScan(table, xmlValidateCheckRefCallback, ctxt);
 6040|       |
 6041|    616|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|    616|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (6041:9): [True: 616, False: 0]
  ------------------
 6042|    616|        pctxt->input = oldInput;
 6043|       |
 6044|    616|    return(ctxt->valid);
 6045|    616|}
xmlValidateDtdFinal:
 6223|  6.78k|xmlValidateDtdFinal(xmlValidCtxt *ctxt, xmlDoc *doc) {
 6224|  6.78k|    xmlDtdPtr dtd;
 6225|  6.78k|    xmlAttributeTablePtr table;
 6226|  6.78k|    xmlEntitiesTablePtr entities;
 6227|       |
 6228|  6.78k|    if ((doc == NULL) || (ctxt == NULL)) return(0);
  ------------------
  |  Branch (6228:9): [True: 0, False: 6.78k]
  |  Branch (6228:26): [True: 0, False: 6.78k]
  ------------------
 6229|  6.78k|    if ((doc->intSubset == NULL) && (doc->extSubset == NULL))
  ------------------
  |  Branch (6229:9): [True: 0, False: 6.78k]
  |  Branch (6229:37): [True: 0, False: 0]
  ------------------
 6230|      0|	return(0);
 6231|  6.78k|    ctxt->doc = doc;
 6232|  6.78k|    ctxt->valid = 1;
 6233|  6.78k|    dtd = doc->intSubset;
 6234|  6.78k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6234:9): [True: 6.78k, False: 0]
  |  Branch (6234:26): [True: 2.85k, False: 3.92k]
  ------------------
 6235|  2.85k|	table = (xmlAttributeTablePtr) dtd->attributes;
 6236|  2.85k|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6237|  2.85k|    }
 6238|  6.78k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6238:9): [True: 6.78k, False: 0]
  |  Branch (6238:26): [True: 2.42k, False: 4.35k]
  ------------------
 6239|  2.42k|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6240|  2.42k|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6241|  2.42k|    }
 6242|  6.78k|    dtd = doc->extSubset;
 6243|  6.78k|    if ((dtd != NULL) && (dtd->attributes != NULL)) {
  ------------------
  |  Branch (6243:9): [True: 699, False: 6.08k]
  |  Branch (6243:26): [True: 375, False: 324]
  ------------------
 6244|    375|	table = (xmlAttributeTablePtr) dtd->attributes;
 6245|    375|	xmlHashScan(table, xmlValidateAttributeCallback, ctxt);
 6246|    375|    }
 6247|  6.78k|    if ((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (6247:9): [True: 699, False: 6.08k]
  |  Branch (6247:26): [True: 75, False: 624]
  ------------------
 6248|     75|	entities = (xmlEntitiesTablePtr) dtd->entities;
 6249|     75|	xmlHashScan(entities, xmlValidateNotationCallback, ctxt);
 6250|     75|    }
 6251|  6.78k|    return(ctxt->valid);
 6252|  6.78k|}
valid.c:xmlVErrMemory:
   54|  1.16k|{
   55|  1.16k|    if (ctxt != NULL) {
  ------------------
  |  Branch (55:9): [True: 1.16k, False: 0]
  ------------------
   56|  1.16k|        if (ctxt->flags & XML_VCTXT_USE_PCTXT) {
  ------------------
  |  |   20|  1.16k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (56:13): [True: 1.16k, False: 0]
  ------------------
   57|  1.16k|            xmlCtxtErrMemory(ctxt->userData);
   58|  1.16k|        } else {
   59|      0|            xmlRaiseMemoryError(NULL, ctxt->error, ctxt->userData,
   60|      0|                                XML_FROM_VALID, NULL);
   61|      0|        }
   62|  1.16k|    } else {
   63|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_VALID, NULL);
   64|      0|    }
   65|  1.16k|}
valid.c:xmlValidBuildAContentModel:
  441|   312k|		           const xmlChar *name) {
  442|   312k|    if (content == NULL) {
  ------------------
  |  Branch (442:9): [True: 0, False: 312k]
  ------------------
  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|   312k|    switch (content->type) {
  449|      0|	case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (449:2): [True: 0, False: 312k]
  ------------------
  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|   271k|	case XML_ELEMENT_CONTENT_ELEMENT: {
  ------------------
  |  Branch (455:2): [True: 271k, False: 41.1k]
  ------------------
  456|   271k|	    xmlAutomataStatePtr oldstate = ctxt->state;
  457|   271k|	    xmlChar fn[50];
  458|   271k|	    xmlChar *fullname;
  459|       |
  460|   271k|	    fullname = xmlBuildQName(content->name, content->prefix, fn, 50);
  461|   271k|	    if (fullname == NULL) {
  ------------------
  |  Branch (461:10): [True: 16, False: 271k]
  ------------------
  462|     16|	        xmlVErrMemory(ctxt);
  463|     16|		return(0);
  464|     16|	    }
  465|       |
  466|   271k|	    switch (content->ocur) {
  ------------------
  |  Branch (466:14): [True: 271k, False: 0]
  ------------------
  467|   211k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (467:3): [True: 211k, False: 60.4k]
  ------------------
  468|   211k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  469|   211k|			    ctxt->state, NULL, fullname, NULL);
  470|   211k|		    break;
  471|  19.0k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (471:3): [True: 19.0k, False: 252k]
  ------------------
  472|  19.0k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  473|  19.0k|			    ctxt->state, NULL, fullname, NULL);
  474|  19.0k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  475|  19.0k|		    break;
  476|  23.7k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (476:3): [True: 23.7k, False: 247k]
  ------------------
  477|  23.7k|		    ctxt->state = xmlAutomataNewTransition(ctxt->am,
  478|  23.7k|			    ctxt->state, NULL, fullname, NULL);
  479|  23.7k|		    xmlAutomataNewTransition(ctxt->am, ctxt->state,
  480|  23.7k|			                     ctxt->state, fullname, NULL);
  481|  23.7k|		    break;
  482|  17.7k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (482:3): [True: 17.7k, False: 253k]
  ------------------
  483|  17.7k|		    ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  484|  17.7k|					    ctxt->state, NULL);
  485|  17.7k|		    xmlAutomataNewTransition(ctxt->am,
  486|  17.7k|			    ctxt->state, ctxt->state, fullname, NULL);
  487|  17.7k|		    break;
  488|   271k|	    }
  489|   271k|	    if ((fullname != fn) && (fullname != content->name))
  ------------------
  |  Branch (489:10): [True: 264k, False: 7.17k]
  |  Branch (489:30): [True: 2.24k, False: 262k]
  ------------------
  490|  2.24k|		xmlFree(fullname);
  491|   271k|	    break;
  492|   271k|	}
  493|  9.70k|	case XML_ELEMENT_CONTENT_SEQ: {
  ------------------
  |  Branch (493:2): [True: 9.70k, False: 303k]
  ------------------
  494|  9.70k|	    xmlAutomataStatePtr oldstate, oldend;
  495|  9.70k|	    xmlElementContentOccur ocur;
  496|       |
  497|       |	    /*
  498|       |	     * Simply iterate over the content
  499|       |	     */
  500|  9.70k|	    oldstate = ctxt->state;
  501|  9.70k|	    ocur = content->ocur;
  502|  9.70k|	    if (ocur != XML_ELEMENT_CONTENT_ONCE) {
  ------------------
  |  Branch (502:10): [True: 8.96k, False: 743]
  ------------------
  503|  8.96k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldstate, NULL);
  504|  8.96k|		oldstate = ctxt->state;
  505|  8.96k|	    }
  506|   168k|	    do {
  507|   168k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (507:7): [True: 18, False: 168k]
  ------------------
  508|     18|                    return(0);
  509|   168k|		content = content->c2;
  510|   168k|	    } while ((content->type == XML_ELEMENT_CONTENT_SEQ) &&
  ------------------
  |  Branch (510:15): [True: 158k, False: 9.64k]
  ------------------
  511|   158k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (511:8): [True: 158k, False: 44]
  ------------------
  512|  9.68k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (512:10): [True: 3, False: 9.68k]
  ------------------
  513|      3|                return(0);
  514|  9.68k|	    oldend = ctxt->state;
  515|  9.68k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  516|  9.68k|	    switch (ocur) {
  ------------------
  |  Branch (516:14): [True: 9.68k, False: 0]
  ------------------
  517|    737|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (517:3): [True: 737, False: 8.94k]
  ------------------
  518|    737|		    break;
  519|  7.59k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (519:3): [True: 7.59k, False: 2.09k]
  ------------------
  520|  7.59k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  521|  7.59k|		    break;
  522|  1.00k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (522:3): [True: 1.00k, False: 8.68k]
  ------------------
  523|  1.00k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  524|  1.00k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  525|  1.00k|		    break;
  526|    353|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (526:3): [True: 353, False: 9.33k]
  ------------------
  527|    353|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  528|    353|		    break;
  529|  9.68k|	    }
  530|  9.68k|	    break;
  531|  9.68k|	}
  532|  31.4k|	case XML_ELEMENT_CONTENT_OR: {
  ------------------
  |  Branch (532:2): [True: 31.4k, False: 281k]
  ------------------
  533|  31.4k|	    xmlAutomataStatePtr oldstate, oldend;
  534|  31.4k|	    xmlElementContentOccur ocur;
  535|       |
  536|  31.4k|	    ocur = content->ocur;
  537|  31.4k|	    if ((ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (537:10): [True: 5.27k, False: 26.1k]
  ------------------
  538|  26.1k|		(ocur == XML_ELEMENT_CONTENT_MULT)) {
  ------------------
  |  Branch (538:3): [True: 17.4k, False: 8.65k]
  ------------------
  539|  22.7k|		ctxt->state = xmlAutomataNewEpsilon(ctxt->am,
  540|  22.7k|			ctxt->state, NULL);
  541|  22.7k|	    }
  542|  31.4k|	    oldstate = ctxt->state;
  543|  31.4k|	    oldend = xmlAutomataNewState(ctxt->am);
  544|       |
  545|       |	    /*
  546|       |	     * iterate over the subtypes and remerge the end with an
  547|       |	     * epsilon transition
  548|       |	     */
  549|   101k|	    do {
  550|   101k|		ctxt->state = oldstate;
  551|   101k|		if (xmlValidBuildAContentModel(content->c1, ctxt, name) == 0)
  ------------------
  |  Branch (551:7): [True: 15, False: 101k]
  ------------------
  552|     15|                    return(0);
  553|   101k|		xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  554|   101k|		content = content->c2;
  555|   101k|	    } while ((content->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (555:15): [True: 70.1k, False: 31.3k]
  ------------------
  556|  70.1k|		     (content->ocur == XML_ELEMENT_CONTENT_ONCE));
  ------------------
  |  Branch (556:8): [True: 70.1k, False: 11]
  ------------------
  557|  31.4k|	    ctxt->state = oldstate;
  558|  31.4k|	    if (xmlValidBuildAContentModel(content, ctxt, name) == 0)
  ------------------
  |  Branch (558:10): [True: 4, False: 31.3k]
  ------------------
  559|      4|                return(0);
  560|  31.3k|	    xmlAutomataNewEpsilon(ctxt->am, ctxt->state, oldend);
  561|  31.3k|	    ctxt->state = xmlAutomataNewEpsilon(ctxt->am, oldend, NULL);
  562|  31.3k|	    switch (ocur) {
  ------------------
  |  Branch (562:14): [True: 31.3k, False: 0]
  ------------------
  563|  6.17k|		case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (563:3): [True: 6.17k, False: 25.2k]
  ------------------
  564|  6.17k|		    break;
  565|  2.46k|		case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (565:3): [True: 2.46k, False: 28.9k]
  ------------------
  566|  2.46k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  567|  2.46k|		    break;
  568|  17.4k|		case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (568:3): [True: 17.4k, False: 13.9k]
  ------------------
  569|  17.4k|		    xmlAutomataNewEpsilon(ctxt->am, oldstate, ctxt->state);
  570|  17.4k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  571|  17.4k|		    break;
  572|  5.26k|		case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (572:3): [True: 5.26k, False: 26.1k]
  ------------------
  573|  5.26k|		    xmlAutomataNewEpsilon(ctxt->am, oldend, oldstate);
  574|  5.26k|		    break;
  575|  31.3k|	    }
  576|  31.3k|	    break;
  577|  31.3k|	}
  578|  31.3k|	default:
  ------------------
  |  Branch (578:2): [True: 0, False: 312k]
  ------------------
  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|   312k|    }
  584|   312k|    return(1);
  585|   312k|}
valid.c:xmlErrValidNode:
  131|   428k|{
  132|   428k|    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str2, str3, 0,
  133|   428k|                  msg, str1, str2, str3);
  134|   428k|}
valid.c:xmlDoErrValid:
   75|   455k|              const char *msg, ...) {
   76|   455k|    xmlParserCtxtPtr pctxt = NULL;
   77|   455k|    va_list ap;
   78|   455k|    int ret = 0;
   79|       |
   80|   455k|    if (ctxt == NULL)
  ------------------
  |  Branch (80:9): [True: 0, False: 455k]
  ------------------
   81|      0|        return -1;
   82|   455k|    if (ctxt->flags & XML_VCTXT_USE_PCTXT)
  ------------------
  |  |   20|   455k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (82:9): [True: 455k, False: 0]
  ------------------
   83|   455k|        pctxt = ctxt->userData;
   84|       |
   85|   455k|    va_start(ap, msg);
   86|   455k|    if (pctxt != NULL) {
  ------------------
  |  Branch (86:9): [True: 455k, False: 0]
  ------------------
   87|   455k|        xmlCtxtVErr(pctxt, node, XML_FROM_VALID, code, level,
   88|   455k|                    str1, str2, str3, int1, msg, ap);
   89|   455k|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (89:13): [True: 97.6k, False: 358k]
  ------------------
   90|  97.6k|            ret = -1;
   91|   455k|    } 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|   455k|    va_end(ap);
  111|       |
  112|   455k|    return ret;
  113|   455k|}
valid.c:xmlFreeElement:
 1076|  26.7k|xmlFreeElement(xmlElementPtr elem) {
 1077|  26.7k|    if (elem == NULL) return;
  ------------------
  |  Branch (1077:9): [True: 6, False: 26.7k]
  ------------------
 1078|  26.7k|    xmlUnlinkNode((xmlNodePtr) elem);
 1079|  26.7k|    xmlFreeDocElementContent(elem->doc, elem->content);
 1080|  26.7k|    if (elem->name != NULL)
  ------------------
  |  Branch (1080:9): [True: 26.7k, False: 15]
  ------------------
 1081|  26.7k|	xmlFree((xmlChar *) elem->name);
 1082|  26.7k|    if (elem->prefix != NULL)
  ------------------
  |  Branch (1082:9): [True: 2.76k, False: 23.9k]
  ------------------
 1083|  2.76k|	xmlFree((xmlChar *) elem->prefix);
 1084|  26.7k|#ifdef LIBXML_REGEXP_ENABLED
 1085|  26.7k|    if (elem->contModel != NULL)
  ------------------
  |  Branch (1085:9): [True: 1.37k, False: 25.3k]
  ------------------
 1086|  1.37k|	xmlRegFreeRegexp(elem->contModel);
 1087|  26.7k|#endif
 1088|  26.7k|    xmlFree(elem);
 1089|  26.7k|}
valid.c:xmlFreeElementTableEntry:
 1272|  26.4k|xmlFreeElementTableEntry(void *elem, const xmlChar *name ATTRIBUTE_UNUSED) {
 1273|  26.4k|    xmlFreeElement((xmlElementPtr) elem);
 1274|  26.4k|}
valid.c:xmlCopyElement:
 1296|  10.2k|xmlCopyElement(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 1297|  10.2k|    xmlElementPtr elem = (xmlElementPtr) payload;
 1298|  10.2k|    xmlElementPtr cur;
 1299|       |
 1300|  10.2k|    cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 1301|  10.2k|    if (cur == NULL)
  ------------------
  |  Branch (1301:9): [True: 18, False: 10.1k]
  ------------------
 1302|     18|	return(NULL);
 1303|  10.1k|    memset(cur, 0, sizeof(xmlElement));
 1304|  10.1k|    cur->type = XML_ELEMENT_DECL;
 1305|  10.1k|    cur->etype = elem->etype;
 1306|  10.1k|    if (elem->name != NULL) {
  ------------------
  |  Branch (1306:9): [True: 10.1k, False: 0]
  ------------------
 1307|  10.1k|	cur->name = xmlStrdup(elem->name);
 1308|  10.1k|        if (cur->name == NULL)
  ------------------
  |  Branch (1308:13): [True: 13, False: 10.1k]
  ------------------
 1309|     13|            goto error;
 1310|  10.1k|    }
 1311|  10.1k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (1311:9): [True: 1.62k, False: 8.56k]
  ------------------
 1312|  1.62k|	cur->prefix = xmlStrdup(elem->prefix);
 1313|  1.62k|        if (cur->prefix == NULL)
  ------------------
  |  Branch (1313:13): [True: 2, False: 1.61k]
  ------------------
 1314|      2|            goto error;
 1315|  1.62k|    }
 1316|  10.1k|    if (elem->content != NULL) {
  ------------------
  |  Branch (1316:9): [True: 4.39k, False: 5.78k]
  ------------------
 1317|  4.39k|        cur->content = xmlCopyElementContent(elem->content);
 1318|  4.39k|        if (cur->content == NULL)
  ------------------
  |  Branch (1318:13): [True: 67, False: 4.32k]
  ------------------
 1319|     67|            goto error;
 1320|  4.39k|    }
 1321|       |    /* TODO : rebuild the attribute list on the copy */
 1322|  10.1k|    cur->attributes = NULL;
 1323|  10.1k|    return(cur);
 1324|       |
 1325|     82|error:
 1326|     82|    xmlFreeElement(cur);
 1327|       |    return(NULL);
 1328|  10.1k|}
valid.c:xmlErrValidWarning:
  191|  24.4k|{
  192|  24.4k|    return xmlDoErrValid(ctxt, node, error, XML_ERR_WARNING, str1, str2, str3,
  193|  24.4k|                         0, msg, str1, str2, str3);
  194|  24.4k|}
valid.c:xmlFreeAttribute:
 1521|  66.1k|xmlFreeAttribute(xmlAttributePtr attr) {
 1522|  66.1k|    xmlDictPtr dict;
 1523|       |
 1524|  66.1k|    if (attr == NULL) return;
  ------------------
  |  Branch (1524:9): [True: 7, False: 66.1k]
  ------------------
 1525|  66.1k|    if (attr->doc != NULL)
  ------------------
  |  Branch (1525:9): [True: 58.5k, False: 7.61k]
  ------------------
 1526|  58.5k|	dict = attr->doc->dict;
 1527|  7.61k|    else
 1528|  7.61k|	dict = NULL;
 1529|  66.1k|    xmlUnlinkNode((xmlNodePtr) attr);
 1530|  66.1k|    if (attr->tree != NULL)
  ------------------
  |  Branch (1530:9): [True: 16.6k, False: 49.5k]
  ------------------
 1531|  16.6k|        xmlFreeEnumeration(attr->tree);
 1532|  66.1k|    if (dict) {
  ------------------
  |  Branch (1532:9): [True: 41.2k, False: 24.9k]
  ------------------
 1533|  41.2k|        if ((attr->elem != NULL) && (!xmlDictOwns(dict, attr->elem)))
  ------------------
  |  Branch (1533:13): [True: 41.2k, False: 0]
  |  Branch (1533:37): [True: 0, False: 41.2k]
  ------------------
 1534|      0|	    xmlFree((xmlChar *) attr->elem);
 1535|  41.2k|        if ((attr->name != NULL) && (!xmlDictOwns(dict, attr->name)))
  ------------------
  |  Branch (1535:13): [True: 41.2k, False: 1]
  |  Branch (1535:37): [True: 0, False: 41.2k]
  ------------------
 1536|      0|	    xmlFree((xmlChar *) attr->name);
 1537|  41.2k|        if ((attr->prefix != NULL) && (!xmlDictOwns(dict, attr->prefix)))
  ------------------
  |  Branch (1537:13): [True: 2.99k, False: 38.2k]
  |  Branch (1537:39): [True: 0, False: 2.99k]
  ------------------
 1538|      0|	    xmlFree((xmlChar *) attr->prefix);
 1539|  41.2k|    } else {
 1540|  24.9k|	if (attr->elem != NULL)
  ------------------
  |  Branch (1540:6): [True: 24.8k, False: 33]
  ------------------
 1541|  24.8k|	    xmlFree((xmlChar *) attr->elem);
 1542|  24.9k|	if (attr->name != NULL)
  ------------------
  |  Branch (1542:6): [True: 24.8k, False: 53]
  ------------------
 1543|  24.8k|	    xmlFree((xmlChar *) attr->name);
 1544|  24.9k|	if (attr->prefix != NULL)
  ------------------
  |  Branch (1544:6): [True: 5.40k, False: 19.5k]
  ------------------
 1545|  5.40k|	    xmlFree((xmlChar *) attr->prefix);
 1546|  24.9k|    }
 1547|  66.1k|    if (attr->defaultValue != NULL)
  ------------------
  |  Branch (1547:9): [True: 24.2k, False: 41.9k]
  ------------------
 1548|  24.2k|        xmlFree(attr->defaultValue);
 1549|  66.1k|    xmlFree(attr);
 1550|  66.1k|}
valid.c:xmlFreeAttributeTableEntry:
 1750|  36.6k|xmlFreeAttributeTableEntry(void *attr, const xmlChar *name ATTRIBUTE_UNUSED) {
 1751|  36.6k|    xmlFreeAttribute((xmlAttributePtr) attr);
 1752|  36.6k|}
valid.c:xmlCopyAttribute:
 1774|  7.61k|xmlCopyAttribute(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 1775|  7.61k|    xmlAttributePtr attr = (xmlAttributePtr) payload;
 1776|  7.61k|    xmlAttributePtr cur;
 1777|       |
 1778|  7.61k|    cur = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
 1779|  7.61k|    if (cur == NULL)
  ------------------
  |  Branch (1779:9): [True: 6, False: 7.61k]
  ------------------
 1780|      6|	return(NULL);
 1781|  7.61k|    memset(cur, 0, sizeof(xmlAttribute));
 1782|  7.61k|    cur->type = XML_ATTRIBUTE_DECL;
 1783|  7.61k|    cur->atype = attr->atype;
 1784|  7.61k|    cur->def = attr->def;
 1785|  7.61k|    if (attr->tree != NULL) {
  ------------------
  |  Branch (1785:9): [True: 2.90k, False: 4.70k]
  ------------------
 1786|  2.90k|        cur->tree = xmlCopyEnumeration(attr->tree);
 1787|  2.90k|        if (cur->tree == NULL)
  ------------------
  |  Branch (1787:13): [True: 15, False: 2.88k]
  ------------------
 1788|     15|            goto error;
 1789|  2.90k|    }
 1790|  7.59k|    if (attr->elem != NULL) {
  ------------------
  |  Branch (1790:9): [True: 7.59k, False: 0]
  ------------------
 1791|  7.59k|	cur->elem = xmlStrdup(attr->elem);
 1792|  7.59k|        if (cur->elem == NULL)
  ------------------
  |  Branch (1792:13): [True: 16, False: 7.57k]
  ------------------
 1793|     16|            goto error;
 1794|  7.59k|    }
 1795|  7.57k|    if (attr->name != NULL) {
  ------------------
  |  Branch (1795:9): [True: 7.57k, False: 0]
  ------------------
 1796|  7.57k|	cur->name = xmlStrdup(attr->name);
 1797|  7.57k|        if (cur->name == NULL)
  ------------------
  |  Branch (1797:13): [True: 15, False: 7.56k]
  ------------------
 1798|     15|            goto error;
 1799|  7.57k|    }
 1800|  7.56k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (1800:9): [True: 2.49k, False: 5.06k]
  ------------------
 1801|  2.49k|	cur->prefix = xmlStrdup(attr->prefix);
 1802|  2.49k|        if (cur->prefix == NULL)
  ------------------
  |  Branch (1802:13): [True: 3, False: 2.49k]
  ------------------
 1803|      3|            goto error;
 1804|  2.49k|    }
 1805|  7.56k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (1805:9): [True: 3.48k, False: 4.07k]
  ------------------
 1806|  3.48k|	cur->defaultValue = xmlStrdup(attr->defaultValue);
 1807|  3.48k|        if (cur->defaultValue == NULL)
  ------------------
  |  Branch (1807:13): [True: 4, False: 3.48k]
  ------------------
 1808|      4|            goto error;
 1809|  3.48k|    }
 1810|  7.55k|    return(cur);
 1811|       |
 1812|     53|error:
 1813|     53|    xmlFreeAttribute(cur);
 1814|       |    return(NULL);
 1815|  7.56k|}
valid.c:xmlErrValid:
  148|    935|{
  149|    935|    xmlDoErrValid(ctxt, NULL, error, XML_ERR_ERROR, (const xmlChar *) extra,
  150|    935|                  NULL, NULL, 0, msg, extra);
  151|    935|}
valid.c:xmlFreeNotation:
 1902|  2.73k|xmlFreeNotation(xmlNotationPtr nota) {
 1903|  2.73k|    if (nota == NULL) return;
  ------------------
  |  Branch (1903:9): [True: 2, False: 2.73k]
  ------------------
 1904|  2.73k|    if (nota->name != NULL)
  ------------------
  |  Branch (1904:9): [True: 2.72k, False: 6]
  ------------------
 1905|  2.72k|	xmlFree((xmlChar *) nota->name);
 1906|  2.73k|    if (nota->PublicID != NULL)
  ------------------
  |  Branch (1906:9): [True: 1.75k, False: 978]
  ------------------
 1907|  1.75k|	xmlFree((xmlChar *) nota->PublicID);
 1908|  2.73k|    if (nota->SystemID != NULL)
  ------------------
  |  Branch (1908:9): [True: 1.07k, False: 1.66k]
  ------------------
 1909|  1.07k|	xmlFree((xmlChar *) nota->SystemID);
 1910|  2.73k|    xmlFree(nota);
 1911|  2.73k|}
valid.c:xmlFreeNotationTableEntry:
 2003|  1.34k|xmlFreeNotationTableEntry(void *nota, const xmlChar *name ATTRIBUTE_UNUSED) {
 2004|  1.34k|    xmlFreeNotation((xmlNotationPtr) nota);
 2005|  1.34k|}
valid.c:xmlCopyNotation:
 2027|  1.10k|xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 2028|  1.10k|    xmlNotationPtr nota = (xmlNotationPtr) payload;
 2029|  1.10k|    xmlNotationPtr cur;
 2030|       |
 2031|  1.10k|    cur = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
 2032|  1.10k|    if (cur == NULL)
  ------------------
  |  Branch (2032:9): [True: 3, False: 1.10k]
  ------------------
 2033|      3|	return(NULL);
 2034|  1.10k|    memset(cur, 0, sizeof(*cur));
 2035|  1.10k|    if (nota->name != NULL) {
  ------------------
  |  Branch (2035:9): [True: 1.10k, False: 0]
  ------------------
 2036|  1.10k|	cur->name = xmlStrdup(nota->name);
 2037|  1.10k|        if (cur->name == NULL)
  ------------------
  |  Branch (2037:13): [True: 4, False: 1.10k]
  ------------------
 2038|      4|            goto error;
 2039|  1.10k|    }
 2040|  1.10k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (2040:9): [True: 699, False: 402]
  ------------------
 2041|    699|	cur->PublicID = xmlStrdup(nota->PublicID);
 2042|    699|        if (cur->PublicID == NULL)
  ------------------
  |  Branch (2042:13): [True: 2, False: 697]
  ------------------
 2043|      2|            goto error;
 2044|    699|    }
 2045|  1.09k|    if (nota->SystemID != NULL) {
  ------------------
  |  Branch (2045:9): [True: 489, False: 610]
  ------------------
 2046|    489|	cur->SystemID = xmlStrdup(nota->SystemID);
 2047|    489|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (2047:13): [True: 5, False: 484]
  ------------------
 2048|      5|            goto error;
 2049|    489|    }
 2050|  1.09k|    return(cur);
 2051|       |
 2052|     11|error:
 2053|     11|    xmlFreeNotation(cur);
 2054|       |    return(NULL);
 2055|  1.09k|}
valid.c:xmlAddIDInternal:
 2182|  14.8k|xmlAddIDInternal(xmlAttrPtr attr, const xmlChar *value, xmlIDPtr *idPtr) {
 2183|  14.8k|    xmlDocPtr doc;
 2184|  14.8k|    xmlIDPtr id;
 2185|  14.8k|    xmlIDTablePtr table;
 2186|  14.8k|    int ret;
 2187|       |
 2188|  14.8k|    if (idPtr != NULL)
  ------------------
  |  Branch (2188:9): [True: 11.0k, False: 3.79k]
  ------------------
 2189|  11.0k|        *idPtr = NULL;
 2190|  14.8k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (2190:9): [True: 2, False: 14.8k]
  |  Branch (2190:28): [True: 1.01k, False: 13.8k]
  ------------------
 2191|  1.01k|	return(0);
 2192|  13.8k|    if (attr == NULL)
  ------------------
  |  Branch (2192:9): [True: 0, False: 13.8k]
  ------------------
 2193|      0|	return(0);
 2194|       |
 2195|  13.8k|    doc = attr->doc;
 2196|  13.8k|    if (doc == NULL)
  ------------------
  |  Branch (2196:9): [True: 0, False: 13.8k]
  ------------------
 2197|      0|        return(0);
 2198|       |
 2199|       |    /*
 2200|       |     * Create the ID table if needed.
 2201|       |     */
 2202|  13.8k|    table = (xmlIDTablePtr) doc->ids;
 2203|  13.8k|    if (table == NULL)  {
  ------------------
  |  Branch (2203:9): [True: 803, False: 13.0k]
  ------------------
 2204|    803|        doc->ids = table = xmlHashCreate(0);
 2205|    803|        if (table == NULL)
  ------------------
  |  Branch (2205:13): [True: 4, False: 799]
  ------------------
 2206|      4|            return(-1);
 2207|  13.0k|    } else {
 2208|  13.0k|        id = xmlHashLookup(table, value);
 2209|  13.0k|        if (id != NULL)
  ------------------
  |  Branch (2209:13): [True: 10.4k, False: 2.55k]
  ------------------
 2210|  10.4k|            return(0);
 2211|  13.0k|    }
 2212|       |
 2213|  3.35k|    id = (xmlIDPtr) xmlMalloc(sizeof(xmlID));
 2214|  3.35k|    if (id == NULL)
  ------------------
  |  Branch (2214:9): [True: 7, False: 3.34k]
  ------------------
 2215|      7|	return(-1);
 2216|  3.34k|    memset(id, 0, sizeof(*id));
 2217|       |
 2218|       |    /*
 2219|       |     * fill the structure.
 2220|       |     */
 2221|  3.34k|    id->doc = doc;
 2222|  3.34k|    id->value = xmlStrdup(value);
 2223|  3.34k|    if (id->value == NULL) {
  ------------------
  |  Branch (2223:9): [True: 9, False: 3.34k]
  ------------------
 2224|      9|        xmlFreeID(id);
 2225|      9|        return(-1);
 2226|      9|    }
 2227|       |
 2228|  3.34k|    if (attr->id != NULL)
  ------------------
  |  Branch (2228:9): [True: 0, False: 3.34k]
  ------------------
 2229|      0|        xmlRemoveID(doc, attr);
 2230|       |
 2231|  3.34k|    if (xmlHashAddEntry(table, value, id) < 0) {
  ------------------
  |  Branch (2231:9): [True: 8, False: 3.33k]
  ------------------
 2232|      8|	xmlFreeID(id);
 2233|      8|	return(-1);
 2234|      8|    }
 2235|       |
 2236|  3.33k|    ret = 1;
 2237|  3.33k|    if (idPtr != NULL)
  ------------------
  |  Branch (2237:9): [True: 1.13k, False: 2.20k]
  ------------------
 2238|  1.13k|        *idPtr = id;
 2239|       |
 2240|  3.33k|    id->attr = attr;
 2241|  3.33k|    id->lineno = xmlGetLineNo(attr->parent);
 2242|  3.33k|    attr->atype = XML_ATTRIBUTE_ID;
 2243|  3.33k|    attr->id = id;
 2244|       |
 2245|  3.33k|    return(ret);
 2246|  3.34k|}
valid.c:xmlFreeID:
 2151|  3.34k|xmlFreeID(xmlIDPtr id) {
 2152|  3.34k|    xmlDictPtr dict = NULL;
 2153|       |
 2154|  3.34k|    if (id == NULL) return;
  ------------------
  |  Branch (2154:9): [True: 0, False: 3.34k]
  ------------------
 2155|       |
 2156|  3.34k|    if (id->doc != NULL)
  ------------------
  |  Branch (2156:9): [True: 3.34k, False: 0]
  ------------------
 2157|  3.34k|        dict = id->doc->dict;
 2158|       |
 2159|  3.34k|    if (id->value != NULL)
  ------------------
  |  Branch (2159:9): [True: 3.34k, False: 9]
  ------------------
 2160|  3.34k|	xmlFree(id->value);
 2161|  3.34k|    if (id->name != NULL)
  ------------------
  |  Branch (2161:9): [True: 123, False: 3.22k]
  ------------------
 2162|    123|	DICT_FREE(id->name)
  ------------------
  |  | 2129|    123|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (2129:6): [True: 123, False: 0]
  |  |  |  Branch (2129:16): [True: 68, False: 55]
  |  |  ------------------
  |  | 2130|    123|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (2130:6): [True: 0, False: 55]
  |  |  ------------------
  |  | 2131|    123|	    xmlFree((char *)(str));
  ------------------
 2163|  3.34k|    if (id->attr != NULL) {
  ------------------
  |  Branch (2163:9): [True: 3.20k, False: 140]
  ------------------
 2164|  3.20k|        id->attr->id = NULL;
 2165|  3.20k|        id->attr->atype = 0;
 2166|  3.20k|    }
 2167|       |
 2168|  3.34k|    xmlFree(id);
 2169|  3.34k|}
valid.c:xmlFreeIDTableEntry:
 2299|  3.33k|xmlFreeIDTableEntry(void *id, const xmlChar *name ATTRIBUTE_UNUSED) {
 2300|  3.33k|    xmlFreeID((xmlIDPtr) id);
 2301|  3.33k|}
valid.c:xmlIsStreaming:
 2134|  24.7k|xmlIsStreaming(xmlValidCtxtPtr ctxt) {
 2135|  24.7k|    xmlParserCtxtPtr pctxt;
 2136|       |
 2137|  24.7k|    if (ctxt == NULL)
  ------------------
  |  Branch (2137:9): [True: 0, False: 24.7k]
  ------------------
 2138|      0|        return(0);
 2139|  24.7k|    if ((ctxt->flags & XML_VCTXT_USE_PCTXT) == 0)
  ------------------
  |  |   20|  24.7k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
  |  Branch (2139:9): [True: 0, False: 24.7k]
  ------------------
 2140|      0|        return(0);
 2141|  24.7k|    pctxt = ctxt->userData;
 2142|  24.7k|    return(pctxt->parseMode == XML_PARSE_READER);
 2143|  24.7k|}
valid.c:xmlFreeRef:
 2475|  24.7k|xmlFreeRef(xmlLinkPtr lk) {
 2476|  24.7k|    xmlRefPtr ref = (xmlRefPtr)xmlLinkGetData(lk);
 2477|  24.7k|    if (ref == NULL) return;
  ------------------
  |  Branch (2477:9): [True: 0, False: 24.7k]
  ------------------
 2478|  24.7k|    if (ref->value != NULL)
  ------------------
  |  Branch (2478:9): [True: 24.7k, False: 0]
  ------------------
 2479|  24.7k|        xmlFree((xmlChar *)ref->value);
 2480|  24.7k|    if (ref->name != NULL)
  ------------------
  |  Branch (2480:9): [True: 4.12k, False: 20.6k]
  ------------------
 2481|  4.12k|        xmlFree((xmlChar *)ref->name);
 2482|  24.7k|    xmlFree(ref);
 2483|  24.7k|}
valid.c:xmlDummyCompare:
 2527|  23.9k|{
 2528|  23.9k|    return (0);
 2529|  23.9k|}
valid.c:xmlFreeRefTableEntry:
 2492|    768|xmlFreeRefTableEntry(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
 2493|    768|    xmlListPtr list_ref = (xmlListPtr) payload;
 2494|    768|    if (list_ref == NULL) return;
  ------------------
  |  Branch (2494:9): [True: 0, False: 768]
  ------------------
 2495|    768|    xmlListDelete(list_ref);
 2496|    768|}
valid.c:xmlGetDtdElementDesc2:
 2827|  58.5k|xmlGetDtdElementDesc2(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name) {
 2828|  58.5k|    xmlElementTablePtr table;
 2829|  58.5k|    xmlElementPtr cur = NULL;
 2830|  58.5k|    const xmlChar *localName;
 2831|  58.5k|    xmlChar *prefix = NULL;
 2832|       |
 2833|  58.5k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (2833:9): [True: 0, False: 58.5k]
  ------------------
 2834|       |
 2835|       |    /*
 2836|       |     * Create the Element table if needed.
 2837|       |     */
 2838|  58.5k|    if (dtd->elements == NULL) {
  ------------------
  |  Branch (2838:9): [True: 4.00k, False: 54.5k]
  ------------------
 2839|  4.00k|	xmlDictPtr dict = NULL;
 2840|       |
 2841|  4.00k|	if (dtd->doc != NULL)
  ------------------
  |  Branch (2841:6): [True: 4.00k, False: 0]
  ------------------
 2842|  4.00k|	    dict = dtd->doc->dict;
 2843|       |
 2844|  4.00k|	dtd->elements = xmlHashCreateDict(0, dict);
 2845|  4.00k|	if (dtd->elements == NULL)
  ------------------
  |  Branch (2845:6): [True: 2, False: 3.99k]
  ------------------
 2846|      2|            goto mem_error;
 2847|  4.00k|    }
 2848|  58.5k|    table = (xmlElementTablePtr) dtd->elements;
 2849|       |
 2850|  58.5k|    localName = xmlSplitQName4(name, &prefix);
 2851|  58.5k|    if (localName == NULL)
  ------------------
  |  Branch (2851:9): [True: 1, False: 58.5k]
  ------------------
 2852|      1|        goto mem_error;
 2853|  58.5k|    cur = xmlHashLookup2(table, localName, prefix);
 2854|  58.5k|    if (cur == NULL) {
  ------------------
  |  Branch (2854:9): [True: 5.41k, False: 53.1k]
  ------------------
 2855|  5.41k|	cur = (xmlElementPtr) xmlMalloc(sizeof(xmlElement));
 2856|  5.41k|	if (cur == NULL)
  ------------------
  |  Branch (2856:6): [True: 3, False: 5.41k]
  ------------------
 2857|      3|            goto mem_error;
 2858|  5.41k|	memset(cur, 0, sizeof(xmlElement));
 2859|  5.41k|	cur->type = XML_ELEMENT_DECL;
 2860|  5.41k|        cur->doc = dtd->doc;
 2861|       |
 2862|       |	/*
 2863|       |	 * fill the structure.
 2864|       |	 */
 2865|  5.41k|	cur->name = xmlStrdup(localName);
 2866|  5.41k|        if (cur->name == NULL)
  ------------------
  |  Branch (2866:13): [True: 2, False: 5.41k]
  ------------------
 2867|      2|            goto mem_error;
 2868|  5.41k|	cur->prefix = prefix;
 2869|  5.41k|        prefix = NULL;
 2870|  5.41k|	cur->etype = XML_ELEMENT_TYPE_UNDEFINED;
 2871|       |
 2872|  5.41k|	if (xmlHashAdd2(table, localName, cur->prefix, cur) <= 0)
  ------------------
  |  Branch (2872:6): [True: 3, False: 5.40k]
  ------------------
 2873|      3|            goto mem_error;
 2874|  5.41k|    }
 2875|       |
 2876|  58.5k|    if (prefix != NULL)
  ------------------
  |  Branch (2876:9): [True: 975, False: 57.5k]
  ------------------
 2877|    975|        xmlFree(prefix);
 2878|  58.5k|    return(cur);
 2879|       |
 2880|     11|mem_error:
 2881|     11|    xmlVErrMemory(ctxt);
 2882|     11|    xmlFree(prefix);
 2883|     11|    xmlFreeElement(cur);
 2884|       |    return(NULL);
 2885|  58.5k|}
valid.c:xmlValidateNameValueInternal:
 3096|  21.9k|xmlValidateNameValueInternal(const xmlChar *value, int flags) {
 3097|  21.9k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3097:9): [True: 8, False: 21.9k]
  |  Branch (3097:28): [True: 594, False: 21.3k]
  ------------------
 3098|    602|        return(0);
 3099|       |
 3100|  21.3k|    value = xmlScanName(value, SIZE_MAX, flags);
 3101|  21.3k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3101:12): [True: 21.3k, False: 0]
  |  Branch (3101:31): [True: 12.4k, False: 8.83k]
  ------------------
 3102|  21.9k|}
valid.c:xmlValidateNamesValueInternal:
 3125|  11.4k|xmlValidateNamesValueInternal(const xmlChar *value, int flags) {
 3126|  11.4k|    const xmlChar *cur;
 3127|       |
 3128|  11.4k|    if (value == NULL)
  ------------------
  |  Branch (3128:9): [True: 1, False: 11.4k]
  ------------------
 3129|      1|        return(0);
 3130|       |
 3131|  11.4k|    cur = xmlScanName(value, SIZE_MAX, flags);
 3132|  11.4k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3132:9): [True: 0, False: 11.4k]
  |  Branch (3132:26): [True: 3.78k, False: 7.69k]
  ------------------
 3133|  3.78k|        return(0);
 3134|       |
 3135|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3136|  9.44k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3136:12): [True: 2.73k, False: 6.71k]
  ------------------
 3137|  5.48k|	while (*cur == 0x20)
  ------------------
  |  Branch (3137:9): [True: 2.74k, False: 2.73k]
  ------------------
 3138|  2.74k|	    cur += 1;
 3139|       |
 3140|  2.73k|        value = cur;
 3141|  2.73k|        cur = xmlScanName(value, SIZE_MAX, flags);
 3142|  2.73k|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3142:13): [True: 0, False: 2.73k]
  |  Branch (3142:30): [True: 987, False: 1.75k]
  ------------------
 3143|    987|            return(0);
 3144|  2.73k|    }
 3145|       |
 3146|  6.71k|    return(*cur == 0);
 3147|  7.69k|}
valid.c:xmlValidateNmtokenValueInternal:
 3172|  1.44k|xmlValidateNmtokenValueInternal(const xmlChar *value, int flags) {
 3173|  1.44k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (3173:9): [True: 1, False: 1.43k]
  |  Branch (3173:28): [True: 101, False: 1.33k]
  ------------------
 3174|    102|        return(0);
 3175|       |
 3176|  1.33k|    value = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  1.33k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3177|  1.33k|    return((value != NULL) && (*value == 0));
  ------------------
  |  Branch (3177:12): [True: 1.33k, False: 0]
  |  Branch (3177:31): [True: 993, False: 345]
  ------------------
 3178|  1.44k|}
valid.c:xmlValidateNmtokensValueInternal:
 3205|  52.0k|xmlValidateNmtokensValueInternal(const xmlChar *value, int flags) {
 3206|  52.0k|    const xmlChar *cur;
 3207|       |
 3208|  52.0k|    if (value == NULL)
  ------------------
  |  Branch (3208:9): [True: 1, False: 52.0k]
  ------------------
 3209|      1|        return(0);
 3210|       |
 3211|  52.0k|    cur = value;
 3212|  52.0k|    while (IS_BLANK_CH(*cur))
 3213|    302|	cur += 1;
 3214|       |
 3215|  52.0k|    value = cur;
 3216|  52.0k|    cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|  52.0k|#define XML_SCAN_NMTOKEN    2
  ------------------
 3217|  52.0k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3217:9): [True: 0, False: 52.0k]
  |  Branch (3217:26): [True: 4.68k, False: 47.3k]
  ------------------
 3218|  4.68k|        return(0);
 3219|       |
 3220|       |    /* Should not test IS_BLANK(val) here -- see erratum E20*/
 3221|  47.8k|    while (*cur == 0x20) {
  ------------------
  |  Branch (3221:12): [True: 954, False: 46.8k]
  ------------------
 3222|  1.91k|	while (*cur == 0x20)
  ------------------
  |  Branch (3222:9): [True: 957, False: 954]
  ------------------
 3223|    957|	    cur += 1;
 3224|    954|        if (*cur == 0)
  ------------------
  |  Branch (3224:13): [True: 42, False: 912]
  ------------------
 3225|     42|            return(1);
 3226|       |
 3227|    912|        value = cur;
 3228|    912|        cur = xmlScanName(value, SIZE_MAX, flags | XML_SCAN_NMTOKEN);
  ------------------
  |  |   70|    912|#define XML_SCAN_NMTOKEN    2
  ------------------
 3229|    912|        if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (3229:13): [True: 0, False: 912]
  |  Branch (3229:30): [True: 407, False: 505]
  ------------------
 3230|    407|            return(0);
 3231|    912|    }
 3232|       |
 3233|  46.8k|    return(*cur == 0);
 3234|  47.3k|}
valid.c:xmlValidateAttributeValueInternal:
 3283|  89.6k|                                  const xmlChar *value) {
 3284|  89.6k|    int flags = 0;
 3285|       |
 3286|  89.6k|    if ((doc != NULL) && (doc->properties & XML_DOC_OLD10))
  ------------------
  |  Branch (3286:9): [True: 89.6k, False: 0]
  |  Branch (3286:26): [True: 20.5k, False: 69.1k]
  ------------------
 3287|  20.5k|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  20.5k|#define XML_SCAN_OLD10      4
  ------------------
 3288|       |
 3289|  89.6k|    switch (type) {
  ------------------
  |  Branch (3289:13): [True: 89.6k, False: 0]
  ------------------
 3290|  2.22k|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (3290:2): [True: 2.22k, False: 87.3k]
  ------------------
 3291|  11.4k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3291:2): [True: 9.25k, False: 80.3k]
  ------------------
 3292|  11.4k|	    return(xmlValidateNamesValueInternal(value, flags));
 3293|  6.11k|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (3293:2): [True: 6.11k, False: 83.5k]
  ------------------
 3294|  9.31k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3294:2): [True: 3.20k, False: 86.4k]
  ------------------
 3295|  18.9k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3295:2): [True: 9.65k, False: 79.9k]
  ------------------
 3296|  21.9k|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (3296:2): [True: 2.94k, False: 86.6k]
  ------------------
 3297|  21.9k|	    return(xmlValidateNameValueInternal(value, flags));
 3298|  2.28k|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3298:2): [True: 2.28k, False: 87.3k]
  ------------------
 3299|  52.0k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3299:2): [True: 49.7k, False: 39.8k]
  ------------------
 3300|  52.0k|	    return(xmlValidateNmtokensValueInternal(value, flags));
 3301|  1.44k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3301:2): [True: 1.44k, False: 88.1k]
  ------------------
 3302|  1.44k|	    return(xmlValidateNmtokenValueInternal(value, flags));
 3303|  2.76k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3303:9): [True: 2.76k, False: 86.8k]
  ------------------
 3304|  2.76k|	    break;
 3305|  89.6k|    }
 3306|  2.76k|    return(1);
 3307|  89.6k|}
valid.c:xmlValidNormalizeString:
 3065|  3.86k|xmlValidNormalizeString(xmlChar *str) {
 3066|  3.86k|    xmlChar *dst;
 3067|  3.86k|    const xmlChar *src;
 3068|       |
 3069|  3.86k|    if (str == NULL)
  ------------------
  |  Branch (3069:9): [True: 0, False: 3.86k]
  ------------------
 3070|      0|        return;
 3071|  3.86k|    src = str;
 3072|  3.86k|    dst = str;
 3073|       |
 3074|  4.13k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (3074:12): [True: 269, False: 3.86k]
  ------------------
 3075|  49.0k|    while (*src != 0) {
  ------------------
  |  Branch (3075:12): [True: 45.1k, False: 3.86k]
  ------------------
 3076|  45.1k|	if (*src == 0x20) {
  ------------------
  |  Branch (3076:6): [True: 1.65k, False: 43.5k]
  ------------------
 3077|  3.93k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (3077:13): [True: 2.28k, False: 1.65k]
  ------------------
 3078|  1.65k|	    if (*src != 0)
  ------------------
  |  Branch (3078:10): [True: 1.20k, False: 452]
  ------------------
 3079|  1.20k|		*dst++ = 0x20;
 3080|  43.5k|	} else {
 3081|  43.5k|	    *dst++ = *src++;
 3082|  43.5k|	}
 3083|  45.1k|    }
 3084|  3.86k|    *dst = 0;
 3085|  3.86k|}
valid.c:xmlScanIDAttributeDecl:
 1495|  4.07k|xmlScanIDAttributeDecl(xmlValidCtxtPtr ctxt, xmlElementPtr elem, int err) {
 1496|  4.07k|    xmlAttributePtr cur;
 1497|  4.07k|    int ret = 0;
 1498|       |
 1499|  4.07k|    if (elem == NULL) return(0);
  ------------------
  |  Branch (1499:9): [True: 0, False: 4.07k]
  ------------------
 1500|  4.07k|    cur = elem->attributes;
 1501|  9.24k|    while (cur != NULL) {
  ------------------
  |  Branch (1501:12): [True: 5.17k, False: 4.07k]
  ------------------
 1502|  5.17k|        if (cur->atype == XML_ATTRIBUTE_ID) {
  ------------------
  |  Branch (1502:13): [True: 4.22k, False: 947]
  ------------------
 1503|  4.22k|	    ret ++;
 1504|  4.22k|	    if ((ret > 1) && (err))
  ------------------
  |  Branch (1504:10): [True: 450, False: 3.77k]
  |  Branch (1504:23): [True: 0, False: 450]
  ------------------
 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|  4.22k|	}
 1509|  5.17k|	cur = cur->nexth;
 1510|  5.17k|    }
 1511|  4.07k|    return(ret);
 1512|  4.07k|}
valid.c:xmlValidateAttributeIdCallback:
 3614|     97|	                       const xmlChar *name ATTRIBUTE_UNUSED) {
 3615|     97|    xmlAttributePtr attr = (xmlAttributePtr) payload;
 3616|     97|    int *count = (int *) data;
 3617|     97|    if (attr->atype == XML_ATTRIBUTE_ID) (*count)++;
  ------------------
  |  Branch (3617:9): [True: 65, False: 32]
  ------------------
 3618|     97|}
valid.c:xmlErrValidNodeNr:
  169|  1.97k|{
  170|       |    xmlDoErrValid(ctxt, node, error, XML_ERR_ERROR, str1, str3, NULL, int2,
  171|  1.97k|                  msg, str1, int2, str3);
  172|  1.97k|}
valid.c:xmlValidateAttributeValue2:
 3367|  60.2k|      const xmlChar *name, xmlAttributeType type, const xmlChar *value) {
 3368|  60.2k|    int ret = 1;
 3369|  60.2k|    switch (type) {
  ------------------
  |  Branch (3369:13): [True: 60.2k, False: 0]
  ------------------
 3370|  1.95k|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (3370:2): [True: 1.95k, False: 58.3k]
  ------------------
 3371|  4.50k|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (3371:2): [True: 2.55k, False: 57.7k]
  ------------------
 3372|  9.08k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (3372:2): [True: 4.57k, False: 55.6k]
  ------------------
 3373|  9.52k|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (3373:2): [True: 439, False: 59.8k]
  ------------------
 3374|  51.9k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (3374:2): [True: 42.4k, False: 17.8k]
  ------------------
 3375|  52.2k|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (3375:2): [True: 296, False: 59.9k]
  ------------------
 3376|  53.2k|        case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (3376:9): [True: 979, False: 59.2k]
  ------------------
 3377|  53.2k|	    break;
 3378|  3.00k|	case XML_ATTRIBUTE_ENTITY: {
  ------------------
  |  Branch (3378:2): [True: 3.00k, False: 57.2k]
  ------------------
 3379|  3.00k|	    xmlEntityPtr ent;
 3380|       |
 3381|  3.00k|	    ent = xmlGetDocEntity(doc, value);
 3382|       |	    /* yeah it's a bit messy... */
 3383|  3.00k|	    if ((ent == NULL) && (doc->standalone == 1)) {
  ------------------
  |  Branch (3383:10): [True: 2.45k, False: 544]
  |  Branch (3383:27): [True: 32, False: 2.42k]
  ------------------
 3384|     32|		doc->standalone = 0;
 3385|     32|		ent = xmlGetDocEntity(doc, value);
 3386|     32|	    }
 3387|  3.00k|	    if (ent == NULL) {
  ------------------
  |  Branch (3387:10): [True: 2.45k, False: 544]
  ------------------
 3388|  2.45k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3389|  2.45k|				XML_DTD_UNKNOWN_ENTITY,
 3390|  2.45k|   "ENTITY attribute %s reference an unknown entity \"%s\"\n",
 3391|  2.45k|		       name, value, NULL);
 3392|  2.45k|		ret = 0;
 3393|  2.45k|	    } else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3393:17): [True: 200, False: 344]
  ------------------
 3394|    200|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3395|    200|				XML_DTD_ENTITY_TYPE,
 3396|    200|   "ENTITY attribute %s reference an entity \"%s\" of wrong type\n",
 3397|    200|		       name, value, NULL);
 3398|    200|		ret = 0;
 3399|    200|	    }
 3400|  3.00k|	    break;
 3401|  52.2k|        }
 3402|  1.57k|	case XML_ATTRIBUTE_ENTITIES: {
  ------------------
  |  Branch (3402:2): [True: 1.57k, False: 58.6k]
  ------------------
 3403|  1.57k|	    xmlChar *dup, *nam = NULL, *cur, save;
 3404|  1.57k|	    xmlEntityPtr ent;
 3405|       |
 3406|  1.57k|	    dup = xmlStrdup(value);
 3407|  1.57k|	    if (dup == NULL) {
  ------------------
  |  Branch (3407:10): [True: 1, False: 1.57k]
  ------------------
 3408|      1|                xmlVErrMemory(ctxt);
 3409|      1|		return(0);
 3410|      1|            }
 3411|  1.57k|	    cur = dup;
 3412|  5.18k|	    while (*cur != 0) {
  ------------------
  |  Branch (3412:13): [True: 4.75k, False: 428]
  ------------------
 3413|  4.75k|		nam = cur;
 3414|  31.8k|		while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  30.6k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  30.6k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.99k, False: 27.6k]
  |  |  |  |  ------------------
  |  |  |  |   91|  30.6k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 27.6k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 333, False: 27.3k]
  |  |  |  |  ------------------
  |  |  |  |   92|  30.6k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 279, False: 27.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3414:10): [True: 30.6k, False: 1.14k]
  ------------------
 3415|  4.75k|		save = *cur;
 3416|  4.75k|		*cur = 0;
 3417|  4.75k|		ent = xmlGetDocEntity(doc, nam);
 3418|  4.75k|		if (ent == NULL) {
  ------------------
  |  Branch (3418:7): [True: 4.29k, False: 460]
  ------------------
 3419|  4.29k|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3420|  4.29k|				    XML_DTD_UNKNOWN_ENTITY,
 3421|  4.29k|       "ENTITIES attribute %s reference an unknown entity \"%s\"\n",
 3422|  4.29k|			   name, nam, NULL);
 3423|  4.29k|		    ret = 0;
 3424|  4.29k|		} else if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (3424:14): [True: 247, False: 213]
  ------------------
 3425|    247|		    xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3426|    247|				    XML_DTD_ENTITY_TYPE,
 3427|    247|       "ENTITIES attribute %s reference an entity \"%s\" of wrong type\n",
 3428|    247|			   name, nam, NULL);
 3429|    247|		    ret = 0;
 3430|    247|		}
 3431|  4.75k|		if (save == 0)
  ------------------
  |  Branch (3431:7): [True: 1.14k, False: 3.60k]
  ------------------
 3432|  1.14k|		    break;
 3433|  3.60k|		*cur = save;
 3434|  3.67k|		while (IS_BLANK_CH(*cur)) cur++;
 3435|  3.60k|	    }
 3436|  1.57k|	    xmlFree(dup);
 3437|  1.57k|	    break;
 3438|  1.57k|	}
 3439|  2.43k|	case XML_ATTRIBUTE_NOTATION: {
  ------------------
  |  Branch (3439:2): [True: 2.43k, False: 57.8k]
  ------------------
 3440|  2.43k|	    xmlNotationPtr nota;
 3441|       |
 3442|  2.43k|	    nota = xmlGetDtdNotationDesc(doc->intSubset, value);
 3443|  2.43k|	    if ((nota == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (3443:10): [True: 1.99k, False: 438]
  |  Branch (3443:28): [True: 739, False: 1.25k]
  ------------------
 3444|    739|		nota = xmlGetDtdNotationDesc(doc->extSubset, value);
 3445|       |
 3446|  2.43k|	    if (nota == NULL) {
  ------------------
  |  Branch (3446:10): [True: 1.74k, False: 690]
  ------------------
 3447|  1.74k|		xmlErrValidNode(ctxt, (xmlNodePtr) doc,
 3448|  1.74k|		                XML_DTD_UNKNOWN_NOTATION,
 3449|  1.74k|       "NOTATION attribute %s reference an unknown notation \"%s\"\n",
 3450|  1.74k|		       name, value, NULL);
 3451|  1.74k|		ret = 0;
 3452|  1.74k|	    }
 3453|  2.43k|	    break;
 3454|  1.57k|        }
 3455|  60.2k|    }
 3456|  60.2k|    return(ret);
 3457|  60.2k|}
valid.c:xmlValidateCheckMixed:
 5092|  2.86k|	              xmlElementContentPtr cont, const xmlChar *qname) {
 5093|  2.86k|    const xmlChar *name;
 5094|  2.86k|    int plen;
 5095|  2.86k|    name = xmlSplitQName3(qname, &plen);
 5096|       |
 5097|  2.86k|    if (name == NULL) {
  ------------------
  |  Branch (5097:9): [True: 1.62k, False: 1.24k]
  ------------------
 5098|  7.70k|	while (cont != NULL) {
  ------------------
  |  Branch (5098:9): [True: 6.55k, False: 1.14k]
  ------------------
 5099|  6.55k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5099:10): [True: 1.40k, False: 5.14k]
  ------------------
 5100|  1.40k|		if ((cont->prefix == NULL) && (xmlStrEqual(cont->name, qname)))
  ------------------
  |  Branch (5100:7): [True: 680, False: 728]
  |  Branch (5100:33): [True: 260, False: 420]
  ------------------
 5101|    260|		    return(1);
 5102|  5.14k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5102:17): [True: 5.14k, False: 0]
  ------------------
 5103|  5.14k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5103:9): [True: 5.14k, False: 0]
  ------------------
 5104|  5.14k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5104:9): [True: 3.52k, False: 1.62k]
  ------------------
 5105|  3.52k|		if ((cont->c1->prefix == NULL) &&
  ------------------
  |  Branch (5105:7): [True: 1.87k, False: 1.64k]
  ------------------
 5106|  1.87k|		    (xmlStrEqual(cont->c1->name, qname)))
  ------------------
  |  Branch (5106:7): [True: 217, False: 1.66k]
  ------------------
 5107|    217|		    return(1);
 5108|  3.52k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5108:17): [True: 0, False: 1.62k]
  ------------------
 5109|  1.62k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5109:3): [True: 0, False: 1.62k]
  ------------------
 5110|  1.62k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5110:3): [True: 0, False: 1.62k]
  ------------------
 5111|      0|		xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5112|      0|			"Internal: MIXED struct corrupted\n",
 5113|      0|			NULL);
 5114|      0|		break;
 5115|      0|	    }
 5116|  6.08k|	    cont = cont->c2;
 5117|  6.08k|	}
 5118|  1.62k|    } else {
 5119|  7.76k|	while (cont != NULL) {
  ------------------
  |  Branch (5119:9): [True: 6.92k, False: 841]
  ------------------
 5120|  6.92k|	    if (cont->type == XML_ELEMENT_CONTENT_ELEMENT) {
  ------------------
  |  Branch (5120:10): [True: 1.04k, False: 5.88k]
  ------------------
 5121|  1.04k|		if ((cont->prefix != NULL) &&
  ------------------
  |  Branch (5121:7): [True: 806, False: 239]
  ------------------
 5122|    806|		    (xmlStrncmp(cont->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5122:7): [True: 484, False: 322]
  ------------------
 5123|    484|		    (xmlStrEqual(cont->name, name)))
  ------------------
  |  Branch (5123:7): [True: 204, False: 280]
  ------------------
 5124|    204|		    return(1);
 5125|  5.88k|	    } else if ((cont->type == XML_ELEMENT_CONTENT_OR) &&
  ------------------
  |  Branch (5125:17): [True: 5.88k, False: 0]
  ------------------
 5126|  5.88k|	       (cont->c1 != NULL) &&
  ------------------
  |  Branch (5126:9): [True: 5.88k, False: 0]
  ------------------
 5127|  5.88k|	       (cont->c1->type == XML_ELEMENT_CONTENT_ELEMENT)){
  ------------------
  |  Branch (5127:9): [True: 4.63k, False: 1.24k]
  ------------------
 5128|  4.63k|		if ((cont->c1->prefix != NULL) &&
  ------------------
  |  Branch (5128:7): [True: 3.54k, False: 1.09k]
  ------------------
 5129|  3.54k|		    (xmlStrncmp(cont->c1->prefix, qname, plen) == 0) &&
  ------------------
  |  Branch (5129:7): [True: 2.62k, False: 917]
  ------------------
 5130|  2.62k|		    (xmlStrEqual(cont->c1->name, name)))
  ------------------
  |  Branch (5130:7): [True: 198, False: 2.42k]
  ------------------
 5131|    198|		    return(1);
 5132|  4.63k|	    } else if ((cont->type != XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (5132:17): [True: 0, False: 1.24k]
  ------------------
 5133|  1.24k|		(cont->c1 == NULL) ||
  ------------------
  |  Branch (5133:3): [True: 0, False: 1.24k]
  ------------------
 5134|  1.24k|		(cont->c1->type != XML_ELEMENT_CONTENT_PCDATA)){
  ------------------
  |  Branch (5134:3): [True: 0, False: 1.24k]
  ------------------
 5135|      0|		xmlErrValid(ctxt, XML_DTD_MIXED_CORRUPT,
 5136|      0|			"Internal: MIXED struct corrupted\n",
 5137|      0|			NULL);
 5138|      0|		break;
 5139|      0|	    }
 5140|  6.52k|	    cont = cont->c2;
 5141|  6.52k|	}
 5142|  1.24k|    }
 5143|  1.98k|    return(0);
 5144|  2.86k|}
valid.c:xmlValidGetElemDecl:
 5159|   242k|	            xmlNodePtr elem, int *extsubset) {
 5160|   242k|    xmlElementPtr elemDecl = NULL;
 5161|   242k|    const xmlChar *prefix = NULL;
 5162|       |
 5163|   242k|    if ((ctxt == NULL) || (doc == NULL) ||
  ------------------
  |  Branch (5163:9): [True: 0, False: 242k]
  |  Branch (5163:27): [True: 0, False: 242k]
  ------------------
 5164|   242k|        (elem == NULL) || (elem->name == NULL))
  ------------------
  |  Branch (5164:9): [True: 0, False: 242k]
  |  Branch (5164:27): [True: 0, False: 242k]
  ------------------
 5165|      0|        return(NULL);
 5166|   242k|    if (extsubset != NULL)
  ------------------
  |  Branch (5166:9): [True: 242k, False: 0]
  ------------------
 5167|   242k|	*extsubset = 0;
 5168|       |
 5169|       |    /*
 5170|       |     * Fetch the declaration for the qualified name
 5171|       |     */
 5172|   242k|    if ((elem->ns != NULL) && (elem->ns->prefix != NULL))
  ------------------
  |  Branch (5172:9): [True: 34.0k, False: 208k]
  |  Branch (5172:31): [True: 20.0k, False: 13.9k]
  ------------------
 5173|  20.0k|	prefix = elem->ns->prefix;
 5174|       |
 5175|   242k|    if (prefix != NULL) {
  ------------------
  |  Branch (5175:9): [True: 20.0k, False: 222k]
  ------------------
 5176|  20.0k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset,
 5177|  20.0k|		                         elem->name, prefix);
 5178|  20.0k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5178:6): [True: 17.5k, False: 2.47k]
  |  Branch (5178:28): [True: 2.87k, False: 14.7k]
  ------------------
 5179|  2.87k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset,
 5180|  2.87k|		                             elem->name, prefix);
 5181|  2.87k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5181:10): [True: 2.09k, False: 783]
  |  Branch (5181:32): [True: 2.09k, False: 0]
  ------------------
 5182|  2.09k|		*extsubset = 1;
 5183|  2.87k|	}
 5184|  20.0k|    }
 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|   242k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5191:9): [True: 238k, False: 4.56k]
  ------------------
 5192|   238k|	elemDecl = xmlGetDtdQElementDesc(doc->intSubset, elem->name, NULL);
 5193|   238k|	if ((elemDecl == NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (5193:6): [True: 184k, False: 53.9k]
  |  Branch (5193:28): [True: 5.96k, False: 178k]
  ------------------
 5194|  5.96k|	    elemDecl = xmlGetDtdQElementDesc(doc->extSubset, elem->name, NULL);
 5195|  5.96k|	    if ((elemDecl != NULL) && (extsubset != NULL))
  ------------------
  |  Branch (5195:10): [True: 1.71k, False: 4.25k]
  |  Branch (5195:32): [True: 1.71k, False: 0]
  ------------------
 5196|  1.71k|		*extsubset = 1;
 5197|  5.96k|	}
 5198|   238k|    }
 5199|   242k|    if (elemDecl == NULL) {
  ------------------
  |  Branch (5199:9): [True: 182k, False: 60.2k]
  ------------------
 5200|   182k|	xmlErrValidNode(ctxt, elem,
 5201|   182k|			XML_DTD_UNKNOWN_ELEM,
 5202|   182k|	       "No declaration for element %s\n",
 5203|   182k|	       elem->name, NULL, NULL);
 5204|   182k|    }
 5205|   242k|    return(elemDecl);
 5206|   242k|}
valid.c:vstateVPush:
  216|   128k|vstateVPush(xmlValidCtxtPtr ctxt, xmlElementPtr elemDecl, xmlNodePtr node) {
  217|   128k|    if (ctxt->vstateNr >= ctxt->vstateMax) {
  ------------------
  |  Branch (217:9): [True: 7.99k, False: 120k]
  ------------------
  218|  7.99k|        xmlValidState *tmp;
  219|  7.99k|        int newSize;
  220|       |
  221|  7.99k|        newSize = xmlGrowCapacity(ctxt->vstateMax, sizeof(tmp[0]),
  222|  7.99k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  7.99k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  223|  7.99k|        if (newSize < 0) {
  ------------------
  |  Branch (223:13): [True: 0, False: 7.99k]
  ------------------
  224|      0|	    xmlVErrMemory(ctxt);
  225|      0|	    return(-1);
  226|      0|	}
  227|  7.99k|	tmp = xmlRealloc(ctxt->vstateTab, newSize * sizeof(tmp[0]));
  228|  7.99k|        if (tmp == NULL) {
  ------------------
  |  Branch (228:13): [True: 78, False: 7.91k]
  ------------------
  229|     78|	    xmlVErrMemory(ctxt);
  230|     78|	    return(-1);
  231|     78|	}
  232|  7.91k|	ctxt->vstateTab = tmp;
  233|  7.91k|	ctxt->vstateMax = newSize;
  234|  7.91k|    }
  235|   128k|    ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr];
  236|   128k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = elemDecl;
  237|   128k|    ctxt->vstateTab[ctxt->vstateNr].node = node;
  238|   128k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (238:9): [True: 30.3k, False: 97.8k]
  |  Branch (238:31): [True: 9.92k, False: 20.3k]
  ------------------
  239|  9.92k|	if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (239:6): [True: 1.40k, False: 8.51k]
  ------------------
  240|  1.40k|	    xmlValidBuildContentModel(ctxt, elemDecl);
  241|  9.92k|	if (elemDecl->contModel != NULL) {
  ------------------
  |  Branch (241:6): [True: 9.39k, False: 531]
  ------------------
  242|  9.39k|	    ctxt->vstateTab[ctxt->vstateNr].exec =
  243|  9.39k|		xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
  244|  9.39k|            if (ctxt->vstateTab[ctxt->vstateNr].exec == NULL) {
  ------------------
  |  Branch (244:17): [True: 27, False: 9.36k]
  ------------------
  245|     27|                xmlVErrMemory(ctxt);
  246|     27|                return(-1);
  247|     27|            }
  248|  9.39k|	} else {
  249|    531|	    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  250|    531|	    xmlErrValidNode(ctxt, (xmlNodePtr) elemDecl,
  251|    531|	                    XML_ERR_INTERNAL_ERROR,
  252|    531|			    "Failed to build content model regexp for %s\n",
  253|    531|			    node->name, NULL, NULL);
  254|    531|	}
  255|  9.92k|    }
  256|   128k|    return(ctxt->vstateNr++);
  257|   128k|}
valid.c:vstateVPop:
  260|   128k|vstateVPop(xmlValidCtxtPtr ctxt) {
  261|   128k|    xmlElementPtr elemDecl;
  262|       |
  263|   128k|    if (ctxt->vstateNr < 1) return(-1);
  ------------------
  |  Branch (263:9): [True: 0, False: 128k]
  ------------------
  264|   128k|    ctxt->vstateNr--;
  265|   128k|    elemDecl = ctxt->vstateTab[ctxt->vstateNr].elemDecl;
  266|   128k|    ctxt->vstateTab[ctxt->vstateNr].elemDecl = NULL;
  267|   128k|    ctxt->vstateTab[ctxt->vstateNr].node = NULL;
  268|   128k|    if ((elemDecl != NULL) && (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)) {
  ------------------
  |  Branch (268:9): [True: 30.2k, False: 97.8k]
  |  Branch (268:31): [True: 9.89k, False: 20.3k]
  ------------------
  269|  9.89k|	xmlRegFreeExecCtxt(ctxt->vstateTab[ctxt->vstateNr].exec);
  270|  9.89k|    }
  271|   128k|    ctxt->vstateTab[ctxt->vstateNr].exec = NULL;
  272|   128k|    if (ctxt->vstateNr >= 1)
  ------------------
  |  Branch (272:9): [True: 125k, False: 2.94k]
  ------------------
  273|   125k|	ctxt->vstate = &ctxt->vstateTab[ctxt->vstateNr - 1];
  274|  2.94k|    else
  275|  2.94k|	ctxt->vstate = NULL;
  276|   128k|    return(ctxt->vstateNr);
  277|   128k|}
valid.c:xmlValidateOneCdataElement:
 5023|  2.13k|                           xmlNodePtr elem) {
 5024|  2.13k|    int ret = 1;
 5025|  2.13k|    xmlNodePtr cur, child;
 5026|       |
 5027|  2.13k|    if ((ctxt == NULL) || (doc == NULL) || (elem == NULL) ||
  ------------------
  |  Branch (5027:9): [True: 0, False: 2.13k]
  |  Branch (5027:27): [True: 0, False: 2.13k]
  |  Branch (5027:44): [True: 0, False: 2.13k]
  ------------------
 5028|  2.13k|        (elem->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (5028:9): [True: 0, False: 2.13k]
  ------------------
 5029|      0|	return(0);
 5030|       |
 5031|  2.13k|    child = elem->children;
 5032|       |
 5033|  2.13k|    cur = child;
 5034|  10.7k|    while (cur != NULL) {
  ------------------
  |  Branch (5034:12): [True: 9.73k, False: 979]
  ------------------
 5035|  9.73k|	switch (cur->type) {
 5036|  3.15k|	    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5036:6): [True: 3.15k, False: 6.57k]
  ------------------
 5037|       |		/*
 5038|       |		 * Push the current node to be able to roll back
 5039|       |		 * and process within the entity
 5040|       |		 */
 5041|  3.15k|		if ((cur->children != NULL) &&
  ------------------
  |  Branch (5041:7): [True: 2.82k, False: 331]
  ------------------
 5042|  2.82k|		    (cur->children->children != NULL)) {
  ------------------
  |  Branch (5042:7): [True: 2.32k, False: 494]
  ------------------
 5043|  2.32k|		    if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (5043:11): [True: 1, False: 2.32k]
  ------------------
 5044|      1|                        ret = 0;
 5045|      1|                        goto done;
 5046|      1|                    }
 5047|  2.32k|		    cur = cur->children->children;
 5048|  2.32k|		    continue;
 5049|  2.32k|		}
 5050|    825|		break;
 5051|    825|	    case XML_COMMENT_NODE:
  ------------------
  |  Branch (5051:6): [True: 592, False: 9.13k]
  ------------------
 5052|    936|	    case XML_PI_NODE:
  ------------------
  |  Branch (5052:6): [True: 344, False: 9.38k]
  ------------------
 5053|  4.84k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (5053:6): [True: 3.90k, False: 5.82k]
  ------------------
 5054|  5.41k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5054:6): [True: 577, False: 9.15k]
  ------------------
 5055|  5.41k|		break;
 5056|  1.15k|	    default:
  ------------------
  |  Branch (5056:6): [True: 1.15k, False: 8.57k]
  ------------------
 5057|  1.15k|		ret = 0;
 5058|  1.15k|		goto done;
 5059|  9.73k|	}
 5060|       |	/*
 5061|       |	 * Switch to next element
 5062|       |	 */
 5063|  6.24k|	cur = cur->next;
 5064|  8.55k|	while (cur == NULL) {
  ------------------
  |  Branch (5064:9): [True: 2.80k, False: 5.74k]
  ------------------
 5065|  2.80k|	    cur = nodeVPop(ctxt);
 5066|  2.80k|	    if (cur == NULL)
  ------------------
  |  Branch (5066:10): [True: 495, False: 2.31k]
  ------------------
 5067|    495|		break;
 5068|  2.31k|	    cur = cur->next;
 5069|  2.31k|	}
 5070|  6.24k|    }
 5071|  2.13k|done:
 5072|  2.13k|    ctxt->nodeMax = 0;
 5073|  2.13k|    ctxt->nodeNr = 0;
 5074|  2.13k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5074:9): [True: 221, False: 1.91k]
  ------------------
 5075|    221|	xmlFree(ctxt->nodeTab);
 5076|       |	ctxt->nodeTab = NULL;
 5077|    221|    }
 5078|  2.13k|    return(ret);
 5079|  2.13k|}
valid.c:nodeVPush:
  374|  2.99k|{
  375|  2.99k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (375:9): [True: 586, False: 2.41k]
  ------------------
  376|    586|        xmlNodePtr *tmp;
  377|    586|        int newSize;
  378|       |
  379|    586|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
  380|    586|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|    586|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  381|    586|        if (newSize < 0) {
  ------------------
  |  Branch (381:13): [True: 0, False: 586]
  ------------------
  382|      0|	    xmlVErrMemory(ctxt);
  383|      0|            return (-1);
  384|      0|        }
  385|    586|        tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
  386|    586|        if (tmp == NULL) {
  ------------------
  |  Branch (386:13): [True: 2, False: 584]
  ------------------
  387|      2|	    xmlVErrMemory(ctxt);
  388|      2|            return (-1);
  389|      2|        }
  390|    584|	ctxt->nodeTab = tmp;
  391|    584|        ctxt->nodeMax = newSize;
  392|    584|    }
  393|  2.99k|    ctxt->nodeTab[ctxt->nodeNr] = value;
  394|  2.99k|    ctxt->node = value;
  395|  2.99k|    return (ctxt->nodeNr++);
  396|  2.99k|}
valid.c:nodeVPop:
  399|  5.36k|{
  400|  5.36k|    xmlNodePtr ret;
  401|       |
  402|  5.36k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (402:9): [True: 2.43k, False: 2.93k]
  ------------------
  403|  2.43k|        return (NULL);
  404|  2.93k|    ctxt->nodeNr--;
  405|  2.93k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (405:9): [True: 2.44k, False: 493]
  ------------------
  406|  2.44k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
  407|    493|    else
  408|    493|        ctxt->node = NULL;
  409|  2.93k|    ret = ctxt->nodeTab[ctxt->nodeNr];
  410|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
  411|  2.93k|    return (ret);
  412|  5.36k|}
valid.c:xmlValidateElementContent:
 4720|  4.69k|       xmlElementPtr elemDecl, int warn, xmlNodePtr parent) {
 4721|  4.69k|    int ret = 1;
 4722|       |#ifndef  LIBXML_REGEXP_ENABLED
 4723|       |    xmlNodePtr repl = NULL, last = NULL, tmp;
 4724|       |#endif
 4725|  4.69k|    xmlNodePtr cur;
 4726|  4.69k|    xmlElementContentPtr cont;
 4727|  4.69k|    const xmlChar *name;
 4728|       |
 4729|  4.69k|    if ((elemDecl == NULL) || (parent == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (4729:9): [True: 0, False: 4.69k]
  |  Branch (4729:31): [True: 0, False: 4.69k]
  |  Branch (4729:51): [True: 0, False: 4.69k]
  ------------------
 4730|      0|	return(-1);
 4731|  4.69k|    cont = elemDecl->content;
 4732|  4.69k|    name = elemDecl->name;
 4733|       |
 4734|  4.69k|#ifdef LIBXML_REGEXP_ENABLED
 4735|       |    /* Build the regexp associated to the content model */
 4736|  4.69k|    if (elemDecl->contModel == NULL)
  ------------------
  |  Branch (4736:9): [True: 505, False: 4.19k]
  ------------------
 4737|    505|	ret = xmlValidBuildContentModel(ctxt, elemDecl);
 4738|  4.69k|    if (elemDecl->contModel == NULL) {
  ------------------
  |  Branch (4738:9): [True: 8, False: 4.68k]
  ------------------
 4739|      8|	return(-1);
 4740|  4.68k|    } else {
 4741|  4.68k|	xmlRegExecCtxtPtr exec;
 4742|       |
 4743|  4.68k|	if (!xmlRegexpIsDeterminist(elemDecl->contModel)) {
  ------------------
  |  Branch (4743:6): [True: 74, False: 4.61k]
  ------------------
 4744|     74|	    return(-1);
 4745|     74|	}
 4746|  4.61k|	ctxt->nodeMax = 0;
 4747|  4.61k|	ctxt->nodeNr = 0;
 4748|  4.61k|	ctxt->nodeTab = NULL;
 4749|  4.61k|	exec = xmlRegNewExecCtxt(elemDecl->contModel, NULL, NULL);
 4750|  4.61k|	if (exec == NULL) {
  ------------------
  |  Branch (4750:6): [True: 2, False: 4.61k]
  ------------------
 4751|      2|            xmlVErrMemory(ctxt);
 4752|      2|            return(-1);
 4753|      2|        }
 4754|  4.61k|        cur = child;
 4755|  13.7k|        while (cur != NULL) {
  ------------------
  |  Branch (4755:16): [True: 10.2k, False: 3.53k]
  ------------------
 4756|  10.2k|            switch (cur->type) {
 4757|  3.82k|                case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4757:17): [True: 3.82k, False: 6.42k]
  ------------------
 4758|       |                    /*
 4759|       |                     * Push the current node to be able to roll back
 4760|       |                     * and process within the entity
 4761|       |                     */
 4762|  3.82k|                    if ((cur->children != NULL) &&
  ------------------
  |  Branch (4762:25): [True: 3.78k, False: 38]
  ------------------
 4763|  3.78k|                        (cur->children->children != NULL)) {
  ------------------
  |  Branch (4763:25): [True: 669, False: 3.11k]
  ------------------
 4764|    669|                        if (nodeVPush(ctxt, cur) < 0) {
  ------------------
  |  Branch (4764:29): [True: 1, False: 668]
  ------------------
 4765|      1|                            ret = -1;
 4766|      1|                            goto fail;
 4767|      1|                        }
 4768|    668|                        cur = cur->children->children;
 4769|    668|                        continue;
 4770|    669|                    }
 4771|  3.15k|                    break;
 4772|  3.15k|                case XML_TEXT_NODE:
  ------------------
  |  Branch (4772:17): [True: 2.25k, False: 7.99k]
  ------------------
 4773|  2.25k|                    if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4773:25): [True: 1.23k, False: 1.01k]
  ------------------
 4774|  1.23k|                        break;
 4775|  1.01k|                    ret = 0;
 4776|  1.01k|                    goto fail;
 4777|     62|                case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4777:17): [True: 62, False: 10.1k]
  ------------------
 4778|       |                    /* TODO */
 4779|     62|                    ret = 0;
 4780|     62|                    goto fail;
 4781|  3.61k|                case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4781:17): [True: 3.61k, False: 6.63k]
  ------------------
 4782|  3.61k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4782:25): [True: 739, False: 2.87k]
  |  Branch (4782:46): [True: 184, False: 555]
  ------------------
 4783|    184|                        xmlChar fn[50];
 4784|    184|                        xmlChar *fullname;
 4785|       |
 4786|    184|                        fullname = xmlBuildQName(cur->name,
 4787|    184|                                                 cur->ns->prefix, fn, 50);
 4788|    184|                        if (fullname == NULL) {
  ------------------
  |  Branch (4788:29): [True: 3, False: 181]
  ------------------
 4789|      3|                            xmlVErrMemory(ctxt);
 4790|      3|                            ret = -1;
 4791|      3|                            goto fail;
 4792|      3|                        }
 4793|    181|                        ret = xmlRegExecPushString(exec, fullname, NULL);
 4794|    181|                        if ((fullname != fn) && (fullname != cur->name))
  ------------------
  |  Branch (4794:29): [True: 89, False: 92]
  |  Branch (4794:49): [True: 89, False: 0]
  ------------------
 4795|     89|                            xmlFree(fullname);
 4796|  3.43k|                    } else {
 4797|  3.43k|                        ret = xmlRegExecPushString(exec, cur->name, NULL);
 4798|  3.43k|                    }
 4799|  3.61k|                    break;
 4800|  3.61k|                default:
  ------------------
  |  Branch (4800:17): [True: 497, False: 9.75k]
  ------------------
 4801|    497|                    break;
 4802|  10.2k|            }
 4803|  8.50k|            if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  8.50k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4803:17): [True: 81, False: 8.42k]
  ------------------
 4804|     81|                xmlVErrMemory(ctxt);
 4805|       |            /*
 4806|       |             * Switch to next element
 4807|       |             */
 4808|  8.50k|            cur = cur->next;
 4809|  9.12k|            while (cur == NULL) {
  ------------------
  |  Branch (4809:20): [True: 2.56k, False: 6.56k]
  ------------------
 4810|  2.56k|                cur = nodeVPop(ctxt);
 4811|  2.56k|                if (cur == NULL)
  ------------------
  |  Branch (4811:21): [True: 1.94k, False: 623]
  ------------------
 4812|  1.94k|                    break;
 4813|    623|                cur = cur->next;
 4814|    623|            }
 4815|  8.50k|        }
 4816|  3.53k|        ret = xmlRegExecPushString(exec, NULL, NULL);
 4817|  3.53k|        if (ret == XML_REGEXP_OUT_OF_MEMORY)
  ------------------
  |  |   14|  3.53k|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
  |  Branch (4817:13): [True: 5, False: 3.52k]
  ------------------
 4818|      5|            xmlVErrMemory(ctxt);
 4819|  4.61k|fail:
 4820|  4.61k|        xmlRegFreeExecCtxt(exec);
 4821|  4.61k|    }
 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|  4.61k|    if ((warn) && ((ret != 1) && (ret != -3))) {
  ------------------
  |  Branch (4947:9): [True: 4.61k, False: 0]
  |  Branch (4947:20): [True: 3.82k, False: 785]
  |  Branch (4947:34): [True: 3.82k, False: 0]
  ------------------
 4948|  3.82k|	if (ctxt != NULL) {
  ------------------
  |  Branch (4948:6): [True: 3.82k, False: 0]
  ------------------
 4949|  3.82k|	    char expr[5000];
 4950|  3.82k|	    char list[5000];
 4951|       |
 4952|  3.82k|	    expr[0] = 0;
 4953|  3.82k|	    xmlSnprintfElementContent(&expr[0], 5000, cont, 1);
 4954|  3.82k|	    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|  3.82k|		xmlSnprintfElements(&list[0], 5000, child, 1);
 4961|       |
 4962|  3.82k|	    if (name != NULL) {
  ------------------
  |  Branch (4962:10): [True: 3.82k, False: 0]
  ------------------
 4963|  3.82k|		xmlErrValidNode(ctxt, parent, XML_DTD_CONTENT_MODEL,
 4964|  3.82k|	   "Element %s content does not follow the DTD, expecting %s, got %s\n",
 4965|  3.82k|		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  3.82k|#define BAD_CAST (xmlChar *)
  ------------------
              		       name, BAD_CAST expr, BAD_CAST list);
  ------------------
  |  |   34|  3.82k|#define BAD_CAST (xmlChar *)
  ------------------
 4966|  3.82k|	    } 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|  3.82k|	} 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|  3.82k|	ret = 0;
 4983|  3.82k|    }
 4984|  4.61k|    if (ret == -3)
  ------------------
  |  Branch (4984:9): [True: 0, False: 4.61k]
  ------------------
 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|  4.61k|    ctxt->nodeMax = 0;
 5004|  4.61k|    ctxt->nodeNr = 0;
 5005|  4.61k|    if (ctxt->nodeTab != NULL) {
  ------------------
  |  Branch (5005:9): [True: 225, False: 4.38k]
  ------------------
 5006|    225|	xmlFree(ctxt->nodeTab);
 5007|    225|	ctxt->nodeTab = NULL;
 5008|    225|    }
 5009|  4.61k|    return(ret);
 5010|       |
 5011|  4.69k|}
valid.c:xmlSnprintfElements:
 4623|  3.82k|xmlSnprintfElements(char *buf, int size, xmlNodePtr node, int glob) {
 4624|  3.82k|    xmlNodePtr cur;
 4625|  3.82k|    int len;
 4626|       |
 4627|  3.82k|    if (node == NULL) return;
  ------------------
  |  Branch (4627:9): [True: 1.12k, False: 2.70k]
  ------------------
 4628|  2.70k|    len = strlen(buf);
 4629|  2.70k|    if (glob) {
  ------------------
  |  Branch (4629:9): [True: 2.70k, False: 0]
  ------------------
 4630|  2.70k|        if (size - len < 50) {
  ------------------
  |  Branch (4630:13): [True: 0, False: 2.70k]
  ------------------
 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|  2.70k|        strcat(buf, "(");
 4636|  2.70k|    }
 4637|  2.70k|    cur = node;
 4638|  16.7k|    while (cur != NULL) {
  ------------------
  |  Branch (4638:12): [True: 14.1k, False: 2.62k]
  ------------------
 4639|  14.1k|	len = strlen(buf);
 4640|  14.1k|	if (size - len < 50) {
  ------------------
  |  Branch (4640:6): [True: 38, False: 14.0k]
  ------------------
 4641|     38|	    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4641:10): [True: 38, False: 0]
  |  Branch (4641:30): [True: 38, False: 0]
  ------------------
 4642|     38|		strcat(buf, " ...");
 4643|     38|	    return;
 4644|     38|	}
 4645|  14.0k|        switch (cur->type) {
  ------------------
  |  Branch (4645:17): [True: 14.0k, False: 0]
  ------------------
 4646|  3.85k|            case XML_ELEMENT_NODE: {
  ------------------
  |  Branch (4646:13): [True: 3.85k, False: 10.2k]
  ------------------
 4647|  3.85k|                int qnameLen = xmlStrlen(cur->name);
 4648|       |
 4649|  3.85k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL))
  ------------------
  |  Branch (4649:21): [True: 990, False: 2.86k]
  |  Branch (4649:42): [True: 342, False: 648]
  ------------------
 4650|    342|                    qnameLen += xmlStrlen(cur->ns->prefix) + 1;
 4651|  3.85k|                if (size - len < qnameLen + 10) {
  ------------------
  |  Branch (4651:21): [True: 36, False: 3.82k]
  ------------------
 4652|     36|                    if ((size - len > 4) && (buf[len - 1] != '.'))
  ------------------
  |  Branch (4652:25): [True: 36, False: 0]
  |  Branch (4652:45): [True: 36, False: 0]
  ------------------
 4653|     36|                        strcat(buf, " ...");
 4654|     36|                    return;
 4655|     36|                }
 4656|  3.82k|		if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (4656:7): [True: 990, False: 2.83k]
  |  Branch (4656:28): [True: 342, False: 648]
  ------------------
 4657|    342|		    strcat(buf, (char *) cur->ns->prefix);
 4658|    342|		    strcat(buf, ":");
 4659|    342|		}
 4660|  3.82k|                if (cur->name != NULL)
  ------------------
  |  Branch (4660:21): [True: 3.82k, False: 0]
  ------------------
 4661|  3.82k|	            strcat(buf, (char *) cur->name);
 4662|  3.82k|		if (cur->next != NULL)
  ------------------
  |  Branch (4662:7): [True: 2.57k, False: 1.24k]
  ------------------
 4663|  2.57k|		    strcat(buf, " ");
 4664|  3.82k|		break;
 4665|  3.85k|            }
 4666|  5.29k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (4666:13): [True: 5.29k, False: 8.79k]
  ------------------
 4667|  5.29k|		if (xmlIsBlankNode(cur))
  ------------------
  |  Branch (4667:7): [True: 909, False: 4.38k]
  ------------------
 4668|    909|		    break;
 4669|       |                /* Falls through. */
 4670|  5.86k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4670:13): [True: 1.48k, False: 12.6k]
  ------------------
 4671|  6.26k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (4671:13): [True: 400, False: 13.6k]
  ------------------
 4672|  6.26k|	        strcat(buf, "CDATA");
 4673|  6.26k|		if (cur->next != NULL)
  ------------------
  |  Branch (4673:7): [True: 5.15k, False: 1.11k]
  ------------------
 4674|  5.15k|		    strcat(buf, " ");
 4675|  6.26k|		break;
 4676|      0|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4676:13): [True: 0, False: 14.0k]
  ------------------
 4677|      0|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4677:13): [True: 0, False: 14.0k]
  ------------------
 4678|      0|	    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (4678:6): [True: 0, False: 14.0k]
  ------------------
 4679|      0|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (4679:13): [True: 0, False: 14.0k]
  ------------------
 4680|      0|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (4680:13): [True: 0, False: 14.0k]
  ------------------
 4681|      0|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (4681:13): [True: 0, False: 14.0k]
  ------------------
 4682|      0|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4682:6): [True: 0, False: 14.0k]
  ------------------
 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: 14.0k]
  ------------------
 4688|    529|            case XML_PI_NODE:
  ------------------
  |  Branch (4688:13): [True: 529, False: 13.5k]
  ------------------
 4689|    529|            case XML_DTD_NODE:
  ------------------
  |  Branch (4689:13): [True: 0, False: 14.0k]
  ------------------
 4690|  3.05k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (4690:13): [True: 2.52k, False: 11.5k]
  ------------------
 4691|  3.05k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (4691:6): [True: 0, False: 14.0k]
  ------------------
 4692|  3.05k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (4692:6): [True: 0, False: 14.0k]
  ------------------
 4693|  3.05k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (4693:6): [True: 0, False: 14.0k]
  ------------------
 4694|  3.05k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (4694:6): [True: 0, False: 14.0k]
  ------------------
 4695|  3.05k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (4695:6): [True: 0, False: 14.0k]
  ------------------
 4696|  3.05k|		break;
 4697|  14.0k|	}
 4698|  14.0k|	cur = cur->next;
 4699|  14.0k|    }
 4700|  2.62k|    if (glob) {
  ------------------
  |  Branch (4700:9): [True: 2.62k, False: 0]
  ------------------
 4701|  2.62k|        len = strlen(buf);
 4702|  2.62k|        if (size - len > 1)
  ------------------
  |  Branch (4702:13): [True: 2.62k, False: 0]
  ------------------
 4703|  2.62k|            strcat(buf, ")");
 4704|  2.62k|    }
 4705|  2.62k|}
valid.c:xmlValidateCheckRefCallback:
 5974|    259|xmlValidateCheckRefCallback(void *payload, void *data, const xmlChar *name) {
 5975|    259|    xmlListPtr ref_list = (xmlListPtr) payload;
 5976|    259|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 5977|    259|    xmlValidateMemo memo;
 5978|       |
 5979|    259|    if (ref_list == NULL)
  ------------------
  |  Branch (5979:9): [True: 0, False: 259]
  ------------------
 5980|      0|	return;
 5981|    259|    memo.ctxt = ctxt;
 5982|    259|    memo.name = name;
 5983|       |
 5984|    259|    xmlListWalk(ref_list, xmlWalkValidateList, &memo);
 5985|       |
 5986|    259|}
valid.c:xmlWalkValidateList:
 5962|  2.26k|{
 5963|  2.26k|	xmlValidateMemoPtr memo = (xmlValidateMemoPtr)user;
 5964|  2.26k|	xmlValidateRef((xmlRefPtr)data, memo->ctxt, memo->name);
 5965|  2.26k|	return 1;
 5966|  2.26k|}
valid.c:xmlValidateRef:
 5880|  2.26k|	                   const xmlChar *name) {
 5881|  2.26k|    xmlAttrPtr id;
 5882|  2.26k|    xmlAttrPtr attr;
 5883|       |
 5884|  2.26k|    if (ref == NULL)
  ------------------
  |  Branch (5884:9): [True: 0, False: 2.26k]
  ------------------
 5885|      0|	return;
 5886|  2.26k|    if ((ref->attr == NULL) && (ref->name == NULL))
  ------------------
  |  Branch (5886:9): [True: 1.09k, False: 1.16k]
  |  Branch (5886:32): [True: 0, False: 1.09k]
  ------------------
 5887|      0|	return;
 5888|  2.26k|    attr = ref->attr;
 5889|  2.26k|    if (attr == NULL) {
  ------------------
  |  Branch (5889:9): [True: 1.09k, False: 1.16k]
  ------------------
 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: 2, False: 1.09k]
  ------------------
 5894|      2|            xmlVErrMemory(ctxt);
 5895|      2|	    return;
 5896|      2|	}
 5897|  1.09k|	cur = dup;
 5898|  2.20k|	while (*cur != 0) {
  ------------------
  |  Branch (5898:9): [True: 2.00k, False: 199]
  ------------------
 5899|  2.00k|	    str = cur;
 5900|  10.2k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  9.38k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  9.38k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 863, False: 8.52k]
  |  |  |  |  ------------------
  |  |  |  |   91|  9.38k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 8.52k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 194, False: 8.32k]
  |  |  |  |  ------------------
  |  |  |  |   92|  9.38k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 56, False: 8.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5900:13): [True: 9.38k, False: 896]
  ------------------
 5901|  2.00k|	    save = *cur;
 5902|  2.00k|	    *cur = 0;
 5903|  2.00k|	    id = xmlGetID(ctxt->doc, str);
 5904|  2.00k|	    if (id == NULL) {
  ------------------
  |  Branch (5904:10): [True: 1.75k, False: 257]
  ------------------
 5905|  1.75k|		xmlErrValidNodeNr(ctxt, NULL, XML_DTD_UNKNOWN_ID,
 5906|  1.75k|	   "attribute %s line %d references an unknown ID \"%s\"\n",
 5907|  1.75k|		       ref->name, ref->lineno, str);
 5908|  1.75k|		ctxt->valid = 0;
 5909|  1.75k|	    }
 5910|  2.00k|	    if (save == 0)
  ------------------
  |  Branch (5910:10): [True: 896, False: 1.11k]
  ------------------
 5911|    896|		break;
 5912|  1.11k|	    *cur = save;
 5913|  1.64k|	    while (IS_BLANK_CH(*cur)) cur++;
 5914|  1.11k|	}
 5915|  1.09k|	xmlFree(dup);
 5916|  1.16k|    } else if (attr->atype == XML_ATTRIBUTE_IDREF) {
  ------------------
  |  Branch (5916:16): [True: 859, False: 309]
  ------------------
 5917|    859|	id = xmlGetID(ctxt->doc, name);
 5918|    859|	if (id == NULL) {
  ------------------
  |  Branch (5918:6): [True: 600, False: 259]
  ------------------
 5919|    600|	    xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5920|    600|	   "IDREF attribute %s references an unknown ID \"%s\"\n",
 5921|    600|		   attr->name, name, NULL);
 5922|    600|	    ctxt->valid = 0;
 5923|    600|	}
 5924|    859|    } else if (attr->atype == XML_ATTRIBUTE_IDREFS) {
  ------------------
  |  Branch (5924:16): [True: 309, False: 0]
  ------------------
 5925|    309|	xmlChar *dup, *str = NULL, *cur, save;
 5926|       |
 5927|    309|	dup = xmlStrdup(name);
 5928|    309|	if (dup == NULL) {
  ------------------
  |  Branch (5928:6): [True: 2, False: 307]
  ------------------
 5929|      2|	    xmlVErrMemory(ctxt);
 5930|      2|	    ctxt->valid = 0;
 5931|      2|	    return;
 5932|      2|	}
 5933|    307|	cur = dup;
 5934|  1.50k|	while (*cur != 0) {
  ------------------
  |  Branch (5934:9): [True: 1.45k, False: 50]
  ------------------
 5935|  1.45k|	    str = cur;
 5936|  7.66k|	    while ((*cur != 0) && (!IS_BLANK_CH(*cur))) cur++;
  ------------------
  |  |  137|  7.41k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  7.41k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 905, False: 6.50k]
  |  |  |  |  ------------------
  |  |  |  |   91|  7.41k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 6.50k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 199, False: 6.30k]
  |  |  |  |  ------------------
  |  |  |  |   92|  7.41k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 89, False: 6.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (5936:13): [True: 7.41k, False: 257]
  ------------------
 5937|  1.45k|	    save = *cur;
 5938|  1.45k|	    *cur = 0;
 5939|  1.45k|	    id = xmlGetID(ctxt->doc, str);
 5940|  1.45k|	    if (id == NULL) {
  ------------------
  |  Branch (5940:10): [True: 1.45k, False: 0]
  ------------------
 5941|  1.45k|		xmlErrValidNode(ctxt, attr->parent, XML_DTD_UNKNOWN_ID,
 5942|  1.45k|	   "IDREFS attribute %s references an unknown ID \"%s\"\n",
 5943|  1.45k|			     attr->name, str, NULL);
 5944|  1.45k|		ctxt->valid = 0;
 5945|  1.45k|	    }
 5946|  1.45k|	    if (save == 0)
  ------------------
  |  Branch (5946:10): [True: 257, False: 1.19k]
  ------------------
 5947|    257|		break;
 5948|  1.19k|	    *cur = save;
 5949|  1.77k|	    while (IS_BLANK_CH(*cur)) cur++;
 5950|  1.19k|	}
 5951|    307|	xmlFree(dup);
 5952|    307|    }
 5953|  2.26k|}
valid.c:xmlValidateAttributeCallback:
 6150|  11.9k|	                     const xmlChar *name ATTRIBUTE_UNUSED) {
 6151|  11.9k|    xmlAttributePtr cur = (xmlAttributePtr) payload;
 6152|  11.9k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6153|  11.9k|    xmlDocPtr doc;
 6154|  11.9k|    xmlElementPtr elem = NULL;
 6155|       |
 6156|  11.9k|    if (cur == NULL)
  ------------------
  |  Branch (6156:9): [True: 0, False: 11.9k]
  ------------------
 6157|      0|	return;
 6158|  11.9k|    if (cur->atype == XML_ATTRIBUTE_NOTATION) {
  ------------------
  |  Branch (6158:9): [True: 187, False: 11.7k]
  ------------------
 6159|    187|        const xmlChar *elemLocalName;
 6160|    187|        xmlChar *elemPrefix;
 6161|       |
 6162|    187|	doc = cur->doc;
 6163|    187|	if (cur->elem == NULL) {
  ------------------
  |  Branch (6163:6): [True: 0, False: 187]
  ------------------
 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|    187|        elemLocalName = xmlSplitQName4(cur->elem, &elemPrefix);
 6171|    187|        if (elemLocalName == NULL) {
  ------------------
  |  Branch (6171:13): [True: 1, False: 186]
  ------------------
 6172|      1|            xmlVErrMemory(ctxt);
 6173|      1|            return;
 6174|      1|        }
 6175|       |
 6176|    186|	if ((doc != NULL) && (doc->intSubset != NULL))
  ------------------
  |  Branch (6176:6): [True: 186, False: 0]
  |  Branch (6176:23): [True: 186, False: 0]
  ------------------
 6177|    186|	    elem = xmlHashLookup2(doc->intSubset->elements,
 6178|    186|                                  elemLocalName, elemPrefix);
 6179|    186|	if ((elem == NULL) && (doc != NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (6179:6): [True: 55, False: 131]
  |  Branch (6179:24): [True: 55, False: 0]
  |  Branch (6179:41): [True: 55, False: 0]
  ------------------
 6180|     55|	    elem = xmlHashLookup2(doc->extSubset->elements,
 6181|     55|                                  elemLocalName, elemPrefix);
 6182|    186|	if ((elem == NULL) && (cur->parent != NULL) &&
  ------------------
  |  Branch (6182:6): [True: 0, False: 186]
  |  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|    186|        xmlFree(elemPrefix);
 6188|       |
 6189|    186|	if (elem == NULL) {
  ------------------
  |  Branch (6189:6): [True: 0, False: 186]
  ------------------
 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|    186|	if (elem->etype == XML_ELEMENT_TYPE_EMPTY) {
  ------------------
  |  Branch (6195:6): [True: 19, False: 167]
  ------------------
 6196|     19|	    xmlErrValidNode(ctxt, NULL, XML_DTD_EMPTY_NOTATION,
 6197|     19|		   "NOTATION attribute %s declared for EMPTY element %s\n",
 6198|       |		   cur->name, cur->elem, NULL);
 6199|     19|	    ctxt->valid = 0;
 6200|     19|	}
 6201|    186|    }
 6202|  11.9k|}
valid.c:xmlValidateNotationCallback:
 6129|  4.37k|	                    const xmlChar *name ATTRIBUTE_UNUSED) {
 6130|  4.37k|    xmlEntityPtr cur = (xmlEntityPtr) payload;
 6131|  4.37k|    xmlValidCtxtPtr ctxt = (xmlValidCtxtPtr) data;
 6132|  4.37k|    if (cur == NULL)
  ------------------
  |  Branch (6132:9): [True: 0, False: 4.37k]
  ------------------
 6133|      0|	return;
 6134|  4.37k|    if (cur->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (6134:9): [True: 130, False: 4.24k]
  ------------------
 6135|    130|	xmlChar *notation = cur->content;
 6136|       |
 6137|    130|	if (notation != NULL) {
  ------------------
  |  Branch (6137:6): [True: 113, False: 17]
  ------------------
 6138|    113|	    int ret;
 6139|       |
 6140|    113|	    ret = xmlValidateNotationUse(ctxt, cur->doc, notation);
 6141|    113|	    if (ret != 1) {
  ------------------
  |  Branch (6141:10): [True: 103, False: 10]
  ------------------
 6142|    103|		ctxt->valid = 0;
 6143|    103|	    }
 6144|    113|	}
 6145|    130|    }
 6146|  4.37k|}

xmlXIncludeNewContext:
  258|  8.94k|xmlXIncludeNewContext(xmlDoc *doc) {
  259|  8.94k|    xmlXIncludeCtxtPtr ret;
  260|       |
  261|  8.94k|    if (doc == NULL)
  ------------------
  |  Branch (261:9): [True: 0, False: 8.94k]
  ------------------
  262|      0|	return(NULL);
  263|  8.94k|    ret = (xmlXIncludeCtxtPtr) xmlMalloc(sizeof(xmlXIncludeCtxt));
  264|  8.94k|    if (ret == NULL)
  ------------------
  |  Branch (264:9): [True: 1, False: 8.93k]
  ------------------
  265|      1|	return(NULL);
  266|  8.93k|    memset(ret, 0, sizeof(xmlXIncludeCtxt));
  267|  8.93k|    ret->doc = doc;
  268|  8.93k|    ret->incNr = 0;
  269|  8.93k|    ret->incMax = 0;
  270|       |    ret->incTab = NULL;
  271|  8.93k|    ret->nbErrors = 0;
  272|  8.93k|    return(ret);
  273|  8.94k|}
xmlXIncludeFreeContext:
  281|  8.93k|xmlXIncludeFreeContext(xmlXIncludeCtxt *ctxt) {
  282|  8.93k|    int i;
  283|       |
  284|  8.93k|    if (ctxt == NULL)
  ------------------
  |  Branch (284:9): [True: 0, False: 8.93k]
  ------------------
  285|      0|	return;
  286|  8.93k|    if (ctxt->urlTab != NULL) {
  ------------------
  |  Branch (286:9): [True: 8.58k, False: 350]
  ------------------
  287|  18.2k|	for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (287:14): [True: 9.65k, False: 8.58k]
  ------------------
  288|  9.65k|	    xmlFreeDoc(ctxt->urlTab[i].doc);
  289|  9.65k|	    xmlFree(ctxt->urlTab[i].url);
  290|  9.65k|	}
  291|  8.58k|	xmlFree(ctxt->urlTab);
  292|  8.58k|    }
  293|  8.93k|    for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (293:16): [True: 0, False: 8.93k]
  ------------------
  294|      0|	if (ctxt->incTab[i] != NULL)
  ------------------
  |  Branch (294:6): [True: 0, False: 0]
  ------------------
  295|      0|	    xmlXIncludeFreeRef(ctxt->incTab[i]);
  296|      0|    }
  297|  8.93k|    if (ctxt->incTab != NULL)
  ------------------
  |  Branch (297:9): [True: 8.86k, False: 74]
  ------------------
  298|  8.86k|	xmlFree(ctxt->incTab);
  299|  8.93k|    if (ctxt->txtTab != NULL) {
  ------------------
  |  Branch (299:9): [True: 57, False: 8.88k]
  ------------------
  300|    112|	for (i = 0;i < ctxt->txtNr;i++) {
  ------------------
  |  Branch (300:13): [True: 55, False: 57]
  ------------------
  301|     55|	    xmlFree(ctxt->txtTab[i].text);
  302|     55|	    xmlFree(ctxt->txtTab[i].url);
  303|     55|	}
  304|     57|	xmlFree(ctxt->txtTab);
  305|     57|    }
  306|  8.93k|#ifdef LIBXML_XPTR_ENABLED
  307|  8.93k|    if (ctxt->xpctxt != NULL)
  ------------------
  |  Branch (307:9): [True: 7.15k, False: 1.78k]
  ------------------
  308|  7.15k|	xmlXPathFreeContext(ctxt->xpctxt);
  309|  8.93k|#endif
  310|  8.93k|    xmlFree(ctxt);
  311|  8.93k|}
xmlXIncludeGetLastError:
 1978|  13.3k|xmlXIncludeGetLastError(xmlXIncludeCtxt *ctxt) {
 1979|  13.3k|    if (ctxt == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 13.3k]
  ------------------
 1980|      0|        return(XML_ERR_ARGUMENT);
 1981|  13.3k|    return(ctxt->errNo);
 1982|  13.3k|}
xmlXIncludeSetErrorHandler:
 1995|  8.93k|                           xmlStructuredErrorFunc handler, void *data) {
 1996|  8.93k|    if (ctxt == NULL)
  ------------------
  |  Branch (1996:9): [True: 0, False: 8.93k]
  ------------------
 1997|      0|        return;
 1998|  8.93k|    ctxt->errorHandler = handler;
 1999|  8.93k|    ctxt->errorCtxt = data;
 2000|  8.93k|}
xmlXIncludeSetResourceLoader:
 2013|  8.93k|                             xmlResourceLoader loader, void *data) {
 2014|  8.93k|    if (ctxt == NULL)
  ------------------
  |  Branch (2014:9): [True: 0, False: 8.93k]
  ------------------
 2015|      0|        return;
 2016|  8.93k|    ctxt->resourceLoader = loader;
 2017|  8.93k|    ctxt->resourceCtxt = data;
 2018|  8.93k|}
xmlXIncludeSetFlags:
 2028|  8.93k|xmlXIncludeSetFlags(xmlXIncludeCtxt *ctxt, int flags) {
 2029|  8.93k|    if (ctxt == NULL)
  ------------------
  |  Branch (2029:9): [True: 0, False: 8.93k]
  ------------------
 2030|      0|        return(-1);
 2031|  8.93k|    ctxt->parseFlags = flags;
 2032|  8.93k|    return(0);
 2033|  8.93k|}
xmlXIncludeSetStreamingMode:
 2043|  8.93k|xmlXIncludeSetStreamingMode(xmlXIncludeCtxt *ctxt, int mode) {
 2044|  8.93k|    if (ctxt == NULL)
  ------------------
  |  Branch (2044:9): [True: 0, False: 8.93k]
  ------------------
 2045|      0|        return(-1);
 2046|  8.93k|    ctxt->isStream = !!mode;
 2047|  8.93k|    return(0);
 2048|  8.93k|}
xmlXIncludeProcessNode:
 2180|  15.6k|xmlXIncludeProcessNode(xmlXIncludeCtxt *ctxt, xmlNode *node) {
 2181|  15.6k|    int ret = 0;
 2182|       |
 2183|  15.6k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2183:9): [True: 0, False: 15.6k]
  |  Branch (2183:27): [True: 0, False: 15.6k]
  ------------------
 2184|  15.6k|        (node->doc == NULL) || (ctxt == NULL))
  ------------------
  |  Branch (2184:9): [True: 0, False: 15.6k]
  |  Branch (2184:32): [True: 0, False: 15.6k]
  ------------------
 2185|      0|	return(-1);
 2186|  15.6k|    ret = xmlXIncludeDoProcessRoot(ctxt, node);
 2187|  15.6k|    if ((ret >= 0) && (ctxt->nbErrors > 0))
  ------------------
  |  Branch (2187:9): [True: 15.6k, False: 0]
  |  Branch (2187:23): [True: 13.3k, False: 2.32k]
  ------------------
 2188|  13.3k|	ret = -1;
 2189|  15.6k|    return(ret);
 2190|  15.6k|}
xinclude.c:xmlXIncludeFreeRef:
  239|  40.1k|xmlXIncludeFreeRef(xmlXIncludeRefPtr ref) {
  240|  40.1k|    if (ref == NULL)
  ------------------
  |  Branch (240:9): [True: 20.7k, False: 19.3k]
  ------------------
  241|  20.7k|	return;
  242|  19.3k|    if (ref->URI != NULL)
  ------------------
  |  Branch (242:9): [True: 19.3k, False: 0]
  ------------------
  243|  19.3k|	xmlFree(ref->URI);
  244|  19.3k|    if (ref->fragment != NULL)
  ------------------
  |  Branch (244:9): [True: 12.3k, False: 7.02k]
  ------------------
  245|  12.3k|	xmlFree(ref->fragment);
  246|  19.3k|    if (ref->base != NULL)
  ------------------
  |  Branch (246:9): [True: 10.5k, False: 8.79k]
  ------------------
  247|  10.5k|	xmlFree(ref->base);
  248|  19.3k|    xmlFree(ref);
  249|  19.3k|}
xinclude.c:xmlXIncludeDoProcessRoot:
 1962|  15.6k|xmlXIncludeDoProcessRoot(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1963|  15.6k|    if ((tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1963:9): [True: 0, False: 15.6k]
  |  Branch (1963:27): [True: 0, False: 15.6k]
  ------------------
 1964|      0|	return(-1);
 1965|  15.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (1965:9): [True: 0, False: 15.6k]
  ------------------
 1966|      0|	return(-1);
 1967|       |
 1968|  15.6k|    return(xmlXIncludeDoProcess(ctxt, tree));
 1969|  15.6k|}
xinclude.c:xmlXIncludeDoProcess:
 1881|  23.5k|xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlNodePtr tree) {
 1882|  23.5k|    xmlXIncludeRefPtr ref;
 1883|  23.5k|    xmlNodePtr cur;
 1884|  23.5k|    int ret = 0;
 1885|  23.5k|    int i, start;
 1886|       |
 1887|       |    /*
 1888|       |     * First phase: lookup the elements in the document
 1889|       |     */
 1890|  23.5k|    start = ctxt->incNr;
 1891|  23.5k|    cur = tree;
 1892|   896k|    do {
 1893|       |	/* TODO: need to work on entities -> stack */
 1894|   896k|        if (xmlXIncludeTestNode(ctxt, cur) == 1) {
  ------------------
  |  Branch (1894:13): [True: 23.4k, False: 872k]
  ------------------
 1895|  23.4k|            ref = xmlXIncludeExpandNode(ctxt, cur);
 1896|       |            /*
 1897|       |             * Mark direct includes.
 1898|       |             */
 1899|  23.4k|            if (ref != NULL)
  ------------------
  |  Branch (1899:17): [True: 18.9k, False: 4.45k]
  ------------------
 1900|  18.9k|                ref->replace = 1;
 1901|   872k|        } else if ((cur->children != NULL) &&
  ------------------
  |  Branch (1901:20): [True: 161k, False: 711k]
  ------------------
 1902|   161k|                   ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1902:21): [True: 0, False: 161k]
  ------------------
 1903|   161k|                    (cur->type == XML_ELEMENT_NODE))) {
  ------------------
  |  Branch (1903:21): [True: 160k, False: 274]
  ------------------
 1904|   160k|            cur = cur->children;
 1905|   160k|            continue;
 1906|   160k|        }
 1907|   896k|        do {
 1908|   896k|            if (cur == tree)
  ------------------
  |  Branch (1908:17): [True: 23.5k, False: 872k]
  ------------------
 1909|  23.5k|                break;
 1910|   872k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1910:17): [True: 711k, False: 160k]
  ------------------
 1911|   711k|                cur = cur->next;
 1912|   711k|                break;
 1913|   711k|            }
 1914|   160k|            cur = cur->parent;
 1915|   160k|        } while (cur != NULL);
  ------------------
  |  Branch (1915:18): [True: 160k, False: 0]
  ------------------
 1916|   896k|    } while ((cur != NULL) && (cur != tree));
  ------------------
  |  Branch (1916:14): [True: 896k, False: 0]
  |  Branch (1916:31): [True: 872k, False: 23.5k]
  ------------------
 1917|       |
 1918|       |    /*
 1919|       |     * Second phase: extend the original document infoset.
 1920|       |     */
 1921|  42.9k|    for (i = start; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1921:21): [True: 19.3k, False: 23.5k]
  ------------------
 1922|  19.3k|	if (ctxt->incTab[i]->replace != 0) {
  ------------------
  |  Branch (1922:6): [True: 18.9k, False: 365]
  ------------------
 1923|  18.9k|            xmlXIncludeIncludeNode(ctxt, ctxt->incTab[i]);
 1924|  18.9k|            ctxt->incTab[i]->replace = 0;
 1925|  18.9k|        } else {
 1926|       |            /*
 1927|       |             * Ignore includes which were added indirectly, for example
 1928|       |             * inside xi:fallback elements.
 1929|       |             */
 1930|    365|            if (ctxt->incTab[i]->inc != NULL) {
  ------------------
  |  Branch (1930:17): [True: 248, False: 117]
  ------------------
 1931|    248|                xmlFreeNodeList(ctxt->incTab[i]->inc);
 1932|    248|                ctxt->incTab[i]->inc = NULL;
 1933|    248|            }
 1934|    365|        }
 1935|  19.3k|	ret++;
 1936|  19.3k|    }
 1937|       |
 1938|  23.5k|    if (ctxt->isStream) {
  ------------------
  |  Branch (1938:9): [True: 15.6k, False: 7.87k]
  ------------------
 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|  30.1k|        for (i = 0;i < ctxt->incNr;i++) {
  ------------------
  |  Branch (1944:20): [True: 14.4k, False: 15.6k]
  ------------------
 1945|  14.4k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
 1946|  14.4k|        }
 1947|  15.6k|        ctxt->incNr = 0;
 1948|  15.6k|    }
 1949|       |
 1950|  23.5k|    return(ret);
 1951|  23.5k|}
xinclude.c:xmlXIncludeTestNode:
 1811|   896k|xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1812|   896k|    if (node == NULL)
  ------------------
  |  Branch (1812:9): [True: 0, False: 896k]
  ------------------
 1813|      0|	return(0);
 1814|   896k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1814:9): [True: 562k, False: 333k]
  ------------------
 1815|   562k|	return(0);
 1816|   333k|    if (node->ns == NULL)
  ------------------
  |  Branch (1816:9): [True: 237k, False: 96.1k]
  ------------------
 1817|   237k|	return(0);
 1818|  96.1k|    if ((xmlStrEqual(node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  96.1k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1818:9): [True: 10.4k, False: 85.6k]
  ------------------
 1819|  85.6k|        (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS))) {
  ------------------
  |  |   34|  85.6k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1819:9): [True: 18.4k, False: 67.2k]
  ------------------
 1820|  28.8k|	if (xmlStrEqual(node->ns->href, XINCLUDE_OLD_NS)) {
  ------------------
  |  |   34|  28.8k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1820:6): [True: 18.4k, False: 10.4k]
  ------------------
 1821|  18.4k|	    if (ctxt->legacy == 0) {
  ------------------
  |  Branch (1821:10): [True: 5.53k, False: 12.9k]
  ------------------
 1822|  5.53k|	        ctxt->legacy = 1;
 1823|  5.53k|	    }
 1824|  18.4k|	}
 1825|  28.8k|	if (xmlStrEqual(node->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  28.8k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1825:6): [True: 25.4k, False: 3.47k]
  ------------------
 1826|  25.4k|	    xmlNodePtr child = node->children;
 1827|  25.4k|	    int nb_fallback = 0;
 1828|       |
 1829|  47.6k|	    while (child != NULL) {
  ------------------
  |  Branch (1829:13): [True: 24.0k, False: 23.6k]
  ------------------
 1830|  24.0k|		if ((child->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1830:7): [True: 11.1k, False: 12.9k]
  ------------------
 1831|  11.1k|		    (child->ns != NULL) &&
  ------------------
  |  Branch (1831:7): [True: 9.98k, False: 1.16k]
  ------------------
 1832|  9.98k|		    ((xmlStrEqual(child->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  9.98k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1832:8): [True: 6.96k, False: 3.01k]
  ------------------
 1833|  9.41k|		     (xmlStrEqual(child->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  3.01k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1833:8): [True: 2.44k, False: 569]
  ------------------
 1834|  9.41k|		    if (xmlStrEqual(child->name, XINCLUDE_NODE)) {
  ------------------
  |  |   38|  9.41k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1834:11): [True: 1.79k, False: 7.61k]
  ------------------
 1835|  1.79k|			xmlXIncludeErr(ctxt, node,
 1836|  1.79k|			               XML_XINCLUDE_INCLUDE_IN_INCLUDE,
 1837|  1.79k|				       "%s has an 'include' child\n",
 1838|  1.79k|				       XINCLUDE_NODE);
  ------------------
  |  |   38|  1.79k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1839|  1.79k|			return(0);
 1840|  1.79k|		    }
 1841|  7.61k|		    if (xmlStrEqual(child->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  7.61k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1841:11): [True: 726, False: 6.89k]
  ------------------
 1842|    726|			nb_fallback++;
 1843|    726|		    }
 1844|  7.61k|		}
 1845|  22.2k|		child = child->next;
 1846|  22.2k|	    }
 1847|  23.6k|	    if (nb_fallback > 1) {
  ------------------
  |  Branch (1847:10): [True: 185, False: 23.4k]
  ------------------
 1848|    185|		xmlXIncludeErr(ctxt, node, XML_XINCLUDE_FALLBACKS_IN_INCLUDE,
 1849|    185|			       "%s has multiple fallback children\n",
 1850|    185|		               XINCLUDE_NODE);
  ------------------
  |  |   38|    185|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
 1851|    185|		return(0);
 1852|    185|	    }
 1853|  23.4k|	    return(1);
 1854|  23.6k|	}
 1855|  3.47k|	if (xmlStrEqual(node->name, XINCLUDE_FALLBACK)) {
  ------------------
  |  |   42|  3.47k|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1855:6): [True: 1.31k, False: 2.15k]
  ------------------
 1856|  1.31k|	    if ((node->parent == NULL) ||
  ------------------
  |  Branch (1856:10): [True: 0, False: 1.31k]
  ------------------
 1857|  1.31k|		(node->parent->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (1857:3): [True: 3, False: 1.31k]
  ------------------
 1858|  1.31k|		(node->parent->ns == NULL) ||
  ------------------
  |  Branch (1858:3): [True: 191, False: 1.12k]
  ------------------
 1859|  1.12k|		((!xmlStrEqual(node->parent->ns->href, XINCLUDE_NS)) &&
  ------------------
  |  |   30|  1.12k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1859:4): [True: 710, False: 414]
  ------------------
 1860|    710|		 (!xmlStrEqual(node->parent->ns->href, XINCLUDE_OLD_NS))) ||
  ------------------
  |  |   34|    710|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1860:4): [True: 74, False: 636]
  ------------------
 1861|  1.05k|		(!xmlStrEqual(node->parent->name, XINCLUDE_NODE))) {
  ------------------
  |  |   38|  1.05k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (1861:3): [True: 486, False: 564]
  ------------------
 1862|    754|		xmlXIncludeErr(ctxt, node,
 1863|    754|		               XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE,
 1864|    754|			       "%s is not the child of an 'include'\n",
 1865|    754|			       XINCLUDE_FALLBACK);
  ------------------
  |  |   42|    754|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
 1866|    754|	    }
 1867|  1.31k|	}
 1868|  3.47k|    }
 1869|  70.6k|    return(0);
 1870|  96.1k|}
xinclude.c:xmlXIncludeErr:
  161|  26.3k|{
  162|  26.3k|    xmlStructuredErrorFunc schannel = NULL;
  163|  26.3k|    xmlGenericErrorFunc channel = NULL;
  164|  26.3k|    void *data = NULL;
  165|  26.3k|    int res;
  166|       |
  167|  26.3k|    if (error == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (167:9): [True: 142, False: 26.1k]
  ------------------
  168|    142|        xmlXIncludeErrMemory(ctxt);
  169|    142|        return;
  170|    142|    }
  171|       |
  172|  26.1k|    if (ctxt->fatalErr != 0)
  ------------------
  |  Branch (172:9): [True: 6.83k, False: 19.3k]
  ------------------
  173|  6.83k|        return;
  174|  19.3k|    ctxt->nbErrors++;
  175|       |
  176|  19.3k|    schannel = ctxt->errorHandler;
  177|  19.3k|    data = ctxt->errorCtxt;
  178|       |
  179|  19.3k|    if (schannel == NULL) {
  ------------------
  |  Branch (179:9): [True: 0, False: 19.3k]
  ------------------
  180|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  181|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  182|      0|    }
  183|       |
  184|  19.3k|    res = xmlRaiseError(schannel, channel, data, ctxt, node,
  185|  19.3k|                        XML_FROM_XINCLUDE, error, XML_ERR_ERROR,
  186|  19.3k|                        NULL, 0, (const char *) extra, NULL, NULL, 0, 0,
  187|  19.3k|                        msg, (const char *) extra);
  188|  19.3k|    if (res < 0) {
  ------------------
  |  Branch (188:9): [True: 146, False: 19.2k]
  ------------------
  189|    146|        ctxt->errNo = XML_ERR_NO_MEMORY;
  190|    146|        ctxt->fatalErr = 1;
  191|  19.2k|    } else {
  192|  19.2k|        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|  19.2k|        if (xmlIsCatastrophicError(XML_ERR_FATAL, error))
  ------------------
  |  Branch (199:13): [True: 3, False: 19.2k]
  ------------------
  200|      3|            ctxt->fatalErr = 1;
  201|  19.2k|    }
  202|  19.3k|}
xinclude.c:xmlXIncludeErrMemory:
  140|  3.29k|{
  141|  3.29k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  142|  3.29k|    ctxt->fatalErr = 1;
  143|  3.29k|    ctxt->nbErrors++;
  144|       |
  145|  3.29k|    xmlRaiseMemoryError(ctxt->errorHandler, NULL, ctxt->errorCtxt,
  146|       |                        XML_FROM_XINCLUDE, NULL);
  147|  3.29k|}
xinclude.c:xmlXIncludeExpandNode:
 1575|  24.0k|xmlXIncludeExpandNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
 1576|  24.0k|    xmlXIncludeRefPtr ref;
 1577|  24.0k|    int i;
 1578|       |
 1579|  24.0k|    if (ctxt->fatalErr)
  ------------------
  |  Branch (1579:9): [True: 292, False: 23.7k]
  ------------------
 1580|    292|        return(NULL);
 1581|  23.7k|    if (ctxt->depth >= XINCLUDE_MAX_DEPTH) {
  ------------------
  |  |   36|  23.7k|#define XINCLUDE_MAX_DEPTH 40
  ------------------
  |  Branch (1581:9): [True: 0, False: 23.7k]
  ------------------
 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|  23.7k|#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|  23.7k|    if (ctxt->incTotal >= 20)
  ------------------
  |  Branch (1608:9): [True: 2.74k, False: 21.0k]
  ------------------
 1609|  2.74k|        return(NULL);
 1610|  21.0k|    ctxt->incTotal++;
 1611|  21.0k|#endif
 1612|       |
 1613|  31.6k|    for (i = 0; i < ctxt->incNr; i++) {
  ------------------
  |  Branch (1613:17): [True: 10.8k, False: 20.8k]
  ------------------
 1614|  10.8k|        if (ctxt->incTab[i]->elem == node) {
  ------------------
  |  Branch (1614:13): [True: 190, False: 10.6k]
  ------------------
 1615|    190|            if (ctxt->incTab[i]->expanding) {
  ------------------
  |  Branch (1615:17): [True: 117, False: 73]
  ------------------
 1616|    117|                xmlXIncludeErr(ctxt, node, XML_XINCLUDE_RECURSION,
 1617|    117|                               "inclusion loop detected\n", NULL);
 1618|    117|                return(NULL);
 1619|    117|            }
 1620|     73|            return(ctxt->incTab[i]);
 1621|    190|        }
 1622|  10.8k|    }
 1623|       |
 1624|  20.8k|    ref = xmlXIncludeAddNode(ctxt, node);
 1625|  20.8k|    if (ref == NULL)
  ------------------
  |  Branch (1625:9): [True: 1.47k, False: 19.3k]
  ------------------
 1626|  1.47k|        return(NULL);
 1627|  19.3k|    ref->expanding = 1;
 1628|  19.3k|    ctxt->depth++;
 1629|  19.3k|    xmlXIncludeLoadNode(ctxt, ref);
 1630|  19.3k|    ctxt->depth--;
 1631|  19.3k|    ref->expanding = 0;
 1632|       |
 1633|  19.3k|    return(ref);
 1634|  20.8k|}
xinclude.c:xmlXIncludeAddNode:
  396|  20.8k|xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
  397|  20.8k|    xmlXIncludeRefPtr ref = NULL;
  398|  20.8k|    xmlXIncludeRefPtr ret = NULL;
  399|  20.8k|    xmlURIPtr uri = NULL;
  400|  20.8k|    xmlChar *href = NULL;
  401|  20.8k|    xmlChar *parse = NULL;
  402|  20.8k|    xmlChar *fragment = NULL;
  403|  20.8k|    xmlChar *base = NULL;
  404|  20.8k|    xmlChar *tmp;
  405|  20.8k|    int xml = 1;
  406|  20.8k|    int local = 0;
  407|  20.8k|    int res;
  408|       |
  409|  20.8k|    if (ctxt == NULL)
  ------------------
  |  Branch (409:9): [True: 0, False: 20.8k]
  ------------------
  410|      0|	return(NULL);
  411|  20.8k|    if (cur == NULL)
  ------------------
  |  Branch (411:9): [True: 0, False: 20.8k]
  ------------------
  412|      0|	return(NULL);
  413|       |
  414|       |    /*
  415|       |     * read the attributes
  416|       |     */
  417|       |
  418|  20.8k|    fragment = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE_XPOINTER);
  ------------------
  |  |   66|  20.8k|#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
  ------------------
  419|       |
  420|  20.8k|    href = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_HREF);
  ------------------
  |  |   46|  20.8k|#define XINCLUDE_HREF (const xmlChar *) "href"
  ------------------
  421|  20.8k|    if (href == NULL) {
  ------------------
  |  Branch (421:9): [True: 546, False: 20.2k]
  ------------------
  422|    546|        if (fragment == NULL) {
  ------------------
  |  Branch (422:13): [True: 412, False: 134]
  ------------------
  423|    412|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_HREF,
  424|    412|	                   "href or xpointer must be present\n", parse);
  425|    412|	    goto error;
  426|    412|        }
  427|       |
  428|    134|	href = xmlStrdup(BAD_CAST ""); /* @@@@ href is now optional */
  ------------------
  |  |   34|    134|#define BAD_CAST (xmlChar *)
  ------------------
  429|    134|	if (href == NULL) {
  ------------------
  |  Branch (429:6): [True: 3, False: 131]
  ------------------
  430|      3|            xmlXIncludeErrMemory(ctxt);
  431|      3|	    goto error;
  432|      3|        }
  433|  20.2k|    } else if (xmlStrlen(href) > XML_MAX_URI_LENGTH) {
  ------------------
  |  |   11|  20.2k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (433:16): [True: 20, False: 20.2k]
  ------------------
  434|     20|        xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI, "URI too long\n",
  435|     20|                       NULL);
  436|     20|        goto error;
  437|     20|    }
  438|       |
  439|  20.3k|    parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE);
  ------------------
  |  |   50|  20.3k|#define XINCLUDE_PARSE (const xmlChar *) "parse"
  ------------------
  440|  20.3k|    if (parse != NULL) {
  ------------------
  |  Branch (440:9): [True: 428, False: 19.9k]
  ------------------
  441|    428|	if (xmlStrEqual(parse, XINCLUDE_PARSE_XML))
  ------------------
  |  |   54|    428|#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
  ------------------
  |  Branch (441:6): [True: 197, False: 231]
  ------------------
  442|    197|	    xml = 1;
  443|    231|	else if (xmlStrEqual(parse, XINCLUDE_PARSE_TEXT))
  ------------------
  |  |   58|    231|#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
  ------------------
  |  Branch (443:11): [True: 193, False: 38]
  ------------------
  444|    193|	    xml = 0;
  445|     38|	else {
  446|     38|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_PARSE_VALUE,
  447|     38|	                   "invalid value %s for 'parse'\n", parse);
  448|     38|	    goto error;
  449|     38|	}
  450|    428|    }
  451|       |
  452|       |    /*
  453|       |     * Check the URL and remove any fragment identifier
  454|       |     */
  455|  20.3k|    res = xmlParseURISafe((const char *)href, &uri);
  456|  20.3k|    if (uri == NULL) {
  ------------------
  |  Branch (456:9): [True: 176, False: 20.1k]
  ------------------
  457|    176|        if (res < 0)
  ------------------
  |  Branch (457:13): [True: 44, False: 132]
  ------------------
  458|     44|            xmlXIncludeErrMemory(ctxt);
  459|    132|        else
  460|    132|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  461|    132|                           "invalid value href %s\n", href);
  462|    176|        goto error;
  463|    176|    }
  464|       |
  465|  20.1k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (465:9): [True: 1.58k, False: 18.5k]
  ------------------
  466|  1.58k|        if (ctxt->legacy != 0) {
  ------------------
  |  Branch (466:13): [True: 1.54k, False: 37]
  ------------------
  467|  1.54k|	    if (fragment == NULL) {
  ------------------
  |  Branch (467:10): [True: 1.40k, False: 144]
  ------------------
  468|  1.40k|		fragment = (xmlChar *) uri->fragment;
  469|  1.40k|	    } else {
  470|    144|		xmlFree(uri->fragment);
  471|    144|	    }
  472|  1.54k|	} else {
  473|     37|	    xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_FRAGMENT_ID,
  474|     37|       "Invalid fragment identifier in URI %s use the xpointer attribute\n",
  475|     37|                           href);
  476|     37|	    goto error;
  477|     37|	}
  478|  1.54k|	uri->fragment = NULL;
  479|  1.54k|    }
  480|  20.1k|    tmp = xmlSaveUri(uri);
  481|  20.1k|    if (tmp == NULL) {
  ------------------
  |  Branch (481:9): [True: 16, False: 20.1k]
  ------------------
  482|     16|	xmlXIncludeErrMemory(ctxt);
  483|     16|	goto error;
  484|     16|    }
  485|  20.1k|    xmlFree(href);
  486|  20.1k|    href = tmp;
  487|       |
  488|       |    /*
  489|       |     * Resolve URI
  490|       |     */
  491|       |
  492|  20.1k|    if (xmlNodeGetBaseSafe(ctxt->doc, cur, &base) < 0) {
  ------------------
  |  Branch (492:9): [True: 23, False: 20.0k]
  ------------------
  493|     23|        xmlXIncludeErrMemory(ctxt);
  494|     23|        goto error;
  495|     23|    }
  496|       |
  497|  20.0k|    if (href[0] != 0) {
  ------------------
  |  Branch (497:9): [True: 19.2k, False: 842]
  ------------------
  498|  19.2k|        if (xmlBuildURISafe(href, base, &tmp) < 0) {
  ------------------
  |  Branch (498:13): [True: 87, False: 19.1k]
  ------------------
  499|     87|            xmlXIncludeErrMemory(ctxt);
  500|     87|            goto error;
  501|     87|        }
  502|  19.1k|        if (tmp == NULL) {
  ------------------
  |  Branch (502:13): [True: 1, False: 19.1k]
  ------------------
  503|      1|            xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_HREF_URI,
  504|      1|                           "failed build URL\n", NULL);
  505|      1|            goto error;
  506|      1|        }
  507|  19.1k|        xmlFree(href);
  508|  19.1k|        href = tmp;
  509|       |
  510|  19.1k|        if (xmlStrEqual(href, ctxt->doc->URL))
  ------------------
  |  Branch (510:13): [True: 3.63k, False: 15.5k]
  ------------------
  511|  3.63k|            local = 1;
  512|  19.1k|    } else {
  513|    842|        local = 1;
  514|    842|    }
  515|       |
  516|       |    /*
  517|       |     * If local and xml then we need a fragment
  518|       |     */
  519|  20.0k|    if ((local == 1) && (xml == 1) &&
  ------------------
  |  Branch (519:9): [True: 4.47k, False: 15.5k]
  |  Branch (519:25): [True: 4.46k, False: 12]
  ------------------
  520|  4.46k|        ((fragment == NULL) || (fragment[0] == 0))) {
  ------------------
  |  Branch (520:10): [True: 579, False: 3.88k]
  |  Branch (520:32): [True: 35, False: 3.84k]
  ------------------
  521|    614|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
  522|    614|	               "detected a local recursion with no xpointer in %s\n",
  523|    614|		       href);
  524|    614|	goto error;
  525|    614|    }
  526|       |
  527|  19.3k|    ref = (xmlXIncludeRefPtr) xmlMalloc(sizeof(xmlXIncludeRef));
  528|  19.3k|    if (ref == NULL) {
  ------------------
  |  Branch (528:9): [True: 20, False: 19.3k]
  ------------------
  529|     20|        xmlXIncludeErrMemory(ctxt);
  530|     20|        goto error;
  531|     20|    }
  532|  19.3k|    memset(ref, 0, sizeof(xmlXIncludeRef));
  533|       |
  534|  19.3k|    ref->elem = cur;
  535|  19.3k|    ref->xml = xml;
  536|  19.3k|    ref->URI = href;
  537|  19.3k|    href = NULL;
  538|  19.3k|    ref->fragment = fragment;
  539|  19.3k|    fragment = NULL;
  540|       |
  541|       |    /*
  542|       |     * xml:base fixup
  543|       |     */
  544|  19.3k|    if (((ctxt->parseFlags & XML_PARSE_NOBASEFIX) == 0) &&
  ------------------
  |  Branch (544:9): [True: 10.5k, False: 8.79k]
  ------------------
  545|  10.5k|        (cur->doc != NULL) &&
  ------------------
  |  Branch (545:9): [True: 10.5k, False: 0]
  ------------------
  546|  10.5k|        ((cur->doc->parseFlags & XML_PARSE_NOBASEFIX) == 0)) {
  ------------------
  |  Branch (546:9): [True: 10.5k, False: 0]
  ------------------
  547|  10.5k|        if (base != NULL) {
  ------------------
  |  Branch (547:13): [True: 5.66k, False: 4.91k]
  ------------------
  548|  5.66k|            ref->base = base;
  549|  5.66k|            base = NULL;
  550|  5.66k|        } else {
  551|  4.91k|            ref->base = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|  4.91k|#define BAD_CAST (xmlChar *)
  ------------------
  552|  4.91k|            if (ref->base == NULL) {
  ------------------
  |  Branch (552:17): [True: 2, False: 4.91k]
  ------------------
  553|      2|	        xmlXIncludeErrMemory(ctxt);
  554|      2|                goto error;
  555|      2|            }
  556|  4.91k|        }
  557|  10.5k|    }
  558|       |
  559|  19.3k|    if (ctxt->incNr >= ctxt->incMax) {
  ------------------
  |  Branch (559:9): [True: 13.5k, False: 5.78k]
  ------------------
  560|  13.5k|        xmlXIncludeRefPtr *table;
  561|  13.5k|        int newSize;
  562|       |
  563|  13.5k|        newSize = xmlGrowCapacity(ctxt->incMax, sizeof(table[0]),
  564|  13.5k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  13.5k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  565|  13.5k|        if (newSize < 0) {
  ------------------
  |  Branch (565:13): [True: 0, False: 13.5k]
  ------------------
  566|      0|	    xmlXIncludeErrMemory(ctxt);
  567|      0|	    goto error;
  568|      0|	}
  569|  13.5k|        table = xmlRealloc(ctxt->incTab, newSize * sizeof(table[0]));
  570|  13.5k|        if (table == NULL) {
  ------------------
  |  Branch (570:13): [True: 27, False: 13.5k]
  ------------------
  571|     27|	    xmlXIncludeErrMemory(ctxt);
  572|     27|	    goto error;
  573|     27|	}
  574|  13.5k|        ctxt->incTab = table;
  575|  13.5k|        ctxt->incMax = newSize;
  576|  13.5k|    }
  577|  19.3k|    ctxt->incTab[ctxt->incNr++] = ref;
  578|       |
  579|  19.3k|    ret = ref;
  580|  19.3k|    ref = NULL;
  581|       |
  582|  20.8k|error:
  583|  20.8k|    xmlXIncludeFreeRef(ref);
  584|  20.8k|    xmlFreeURI(uri);
  585|  20.8k|    xmlFree(href);
  586|  20.8k|    xmlFree(parse);
  587|  20.8k|    xmlFree(fragment);
  588|  20.8k|    xmlFree(base);
  589|  20.8k|    return(ret);
  590|  19.3k|}
xinclude.c:xmlXIncludeGetProp:
  214|  62.1k|                   const xmlChar *name) {
  215|  62.1k|    xmlChar *ret;
  216|       |
  217|  62.1k|    if (xmlNodeGetAttrValue(cur, name, XINCLUDE_NS, &ret) < 0)
  ------------------
  |  |   30|  62.1k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (217:9): [True: 2, False: 62.1k]
  ------------------
  218|      2|        xmlXIncludeErrMemory(ctxt);
  219|  62.1k|    if (ret != NULL)
  ------------------
  |  Branch (219:9): [True: 38, False: 62.1k]
  ------------------
  220|     38|        return(ret);
  221|       |
  222|  62.1k|    if (ctxt->legacy != 0) {
  ------------------
  |  Branch (222:9): [True: 34.0k, False: 28.0k]
  ------------------
  223|  34.0k|        if (xmlNodeGetAttrValue(cur, name, XINCLUDE_OLD_NS, &ret) < 0)
  ------------------
  |  |   34|  34.0k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (223:13): [True: 1, False: 34.0k]
  ------------------
  224|      1|            xmlXIncludeErrMemory(ctxt);
  225|  34.0k|        if (ret != NULL)
  ------------------
  |  Branch (225:13): [True: 39, False: 34.0k]
  ------------------
  226|     39|            return(ret);
  227|  34.0k|    }
  228|       |
  229|  62.0k|    if (xmlNodeGetAttrValue(cur, name, NULL, &ret) < 0)
  ------------------
  |  Branch (229:9): [True: 39, False: 62.0k]
  ------------------
  230|     39|        xmlXIncludeErrMemory(ctxt);
  231|  62.0k|    return(ret);
  232|  62.1k|}
xinclude.c:xmlXIncludeLoadNode:
 1644|  19.3k|xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1645|  19.3k|    xmlNodePtr cur;
 1646|  19.3k|    int ret;
 1647|       |
 1648|  19.3k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1648:9): [True: 0, False: 19.3k]
  |  Branch (1648:27): [True: 0, False: 19.3k]
  ------------------
 1649|      0|	return(-1);
 1650|  19.3k|    cur = ref->elem;
 1651|  19.3k|    if (cur == NULL)
  ------------------
  |  Branch (1651:9): [True: 0, False: 19.3k]
  ------------------
 1652|      0|	return(-1);
 1653|       |
 1654|  19.3k|    if (ref->xml) {
  ------------------
  |  Branch (1654:9): [True: 19.1k, False: 176]
  ------------------
 1655|  19.1k|	ret = xmlXIncludeLoadDoc(ctxt, ref);
 1656|       |	/* xmlXIncludeGetFragment(ctxt, cur, URI); */
 1657|  19.1k|    } else {
 1658|    176|	ret = xmlXIncludeLoadTxt(ctxt, ref);
 1659|    176|    }
 1660|       |
 1661|  19.3k|    if (ret < 0) {
  ------------------
  |  Branch (1661:9): [True: 10.3k, False: 8.95k]
  ------------------
 1662|  10.3k|	xmlNodePtr children;
 1663|       |
 1664|       |	/*
 1665|       |	 * Time to try a fallback if available
 1666|       |	 */
 1667|  10.3k|	children = cur->children;
 1668|  12.5k|	while (children != NULL) {
  ------------------
  |  Branch (1668:9): [True: 2.66k, False: 9.86k]
  ------------------
 1669|  2.66k|	    if ((children->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1669:10): [True: 1.14k, False: 1.52k]
  ------------------
 1670|  1.14k|		(children->ns != NULL) &&
  ------------------
  |  Branch (1670:3): [True: 819, False: 321]
  ------------------
 1671|    819|		(xmlStrEqual(children->name, XINCLUDE_FALLBACK)) &&
  ------------------
  |  |   42|    819|#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
  ------------------
  |  Branch (1671:3): [True: 518, False: 301]
  ------------------
 1672|    518|		((xmlStrEqual(children->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    518|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1672:4): [True: 331, False: 187]
  ------------------
 1673|    518|		 (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    187|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1673:4): [True: 187, False: 0]
  ------------------
 1674|    518|		ret = xmlXIncludeLoadFallback(ctxt, children, ref);
 1675|    518|		break;
 1676|    518|	    }
 1677|  2.14k|	    children = children->next;
 1678|  2.14k|	}
 1679|  10.3k|    }
 1680|  19.3k|    if (ret < 0) {
  ------------------
  |  Branch (1680:9): [True: 10.0k, False: 9.31k]
  ------------------
 1681|  10.0k|	xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_NO_FALLBACK,
 1682|  10.0k|		       "could not load %s, and no fallback was found\n",
 1683|  10.0k|		       ref->URI);
 1684|  10.0k|    }
 1685|       |
 1686|  19.3k|    return(0);
 1687|  19.3k|}
xinclude.c:xmlXIncludeLoadDoc:
 1061|  19.1k|xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1062|  19.1k|    xmlXIncludeDocPtr cache;
 1063|  19.1k|    xmlDocPtr doc;
 1064|  19.1k|    const xmlChar *url = ref->URI;
 1065|  19.1k|    const xmlChar *fragment = ref->fragment;
 1066|  19.1k|    int i = 0;
 1067|  19.1k|    int ret = -1;
 1068|  19.1k|    int cacheNr;
 1069|  19.1k|#ifdef LIBXML_XPTR_ENABLED
 1070|  19.1k|    int saveFlags;
 1071|  19.1k|#endif
 1072|       |
 1073|       |    /*
 1074|       |     * Handling of references to the local document are done
 1075|       |     * directly through ctxt->doc.
 1076|       |     */
 1077|  19.1k|    if ((url[0] == 0) || (url[0] == '#') ||
  ------------------
  |  Branch (1077:9): [True: 806, False: 18.3k]
  |  Branch (1077:26): [True: 1.24k, False: 17.1k]
  ------------------
 1078|  17.1k|	((ctxt->doc != NULL) && (xmlStrEqual(url, ctxt->doc->URL)))) {
  ------------------
  |  Branch (1078:3): [True: 17.1k, False: 0]
  |  Branch (1078:26): [True: 3.00k, False: 14.1k]
  ------------------
 1079|  5.04k|	doc = ctxt->doc;
 1080|  5.04k|        goto loaded;
 1081|  5.04k|    }
 1082|       |
 1083|       |    /*
 1084|       |     * Prevent reloading the document twice.
 1085|       |     */
 1086|  17.9k|    for (i = 0; i < ctxt->urlNr; i++) {
  ------------------
  |  Branch (1086:17): [True: 8.28k, False: 9.66k]
  ------------------
 1087|  8.28k|	if (xmlStrEqual(url, ctxt->urlTab[i].url)) {
  ------------------
  |  Branch (1087:6): [True: 4.45k, False: 3.83k]
  ------------------
 1088|  4.45k|            if (ctxt->urlTab[i].expanding) {
  ------------------
  |  Branch (1088:17): [True: 78, False: 4.37k]
  ------------------
 1089|     78|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_RECURSION,
 1090|     78|                               "inclusion loop detected\n", NULL);
 1091|     78|                goto error;
 1092|     78|            }
 1093|  4.37k|	    doc = ctxt->urlTab[i].doc;
 1094|  4.37k|            if (doc == NULL)
  ------------------
  |  Branch (1094:17): [True: 458, False: 3.91k]
  ------------------
 1095|    458|                goto error;
 1096|  3.91k|	    goto loaded;
 1097|  4.37k|	}
 1098|  8.28k|    }
 1099|       |
 1100|       |    /*
 1101|       |     * Load it.
 1102|       |     */
 1103|  9.66k|#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|  9.66k|    saveFlags = ctxt->parseFlags;
 1110|  9.66k|    if (fragment != NULL) {	/* if this is an XPointer eval */
  ------------------
  |  Branch (1110:9): [True: 7.52k, False: 2.13k]
  ------------------
 1111|  7.52k|	ctxt->parseFlags |= XML_PARSE_NOENT;
 1112|  7.52k|    }
 1113|  9.66k|#endif
 1114|       |
 1115|  9.66k|    doc = xmlXIncludeParseFile(ctxt, (const char *)url);
 1116|  9.66k|#ifdef LIBXML_XPTR_ENABLED
 1117|  9.66k|    ctxt->parseFlags = saveFlags;
 1118|  9.66k|#endif
 1119|       |
 1120|       |    /* Also cache NULL docs */
 1121|  9.66k|    if (ctxt->urlNr >= ctxt->urlMax) {
  ------------------
  |  Branch (1121:9): [True: 9.47k, False: 182]
  ------------------
 1122|  9.47k|        xmlXIncludeDoc *tmp;
 1123|  9.47k|        int newSize;
 1124|       |
 1125|  9.47k|        newSize = xmlGrowCapacity(ctxt->urlMax, sizeof(tmp[0]),
 1126|  9.47k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|  9.47k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1127|  9.47k|        if (newSize < 0) {
  ------------------
  |  Branch (1127:13): [True: 0, False: 9.47k]
  ------------------
 1128|      0|            xmlXIncludeErrMemory(ctxt);
 1129|      0|            xmlFreeDoc(doc);
 1130|      0|            goto error;
 1131|      0|        }
 1132|  9.47k|        tmp = xmlRealloc(ctxt->urlTab, newSize * sizeof(tmp[0]));
 1133|  9.47k|        if (tmp == NULL) {
  ------------------
  |  Branch (1133:13): [True: 1, False: 9.47k]
  ------------------
 1134|      1|            xmlXIncludeErrMemory(ctxt);
 1135|      1|            xmlFreeDoc(doc);
 1136|      1|            goto error;
 1137|      1|        }
 1138|  9.47k|        ctxt->urlMax = newSize;
 1139|  9.47k|        ctxt->urlTab = tmp;
 1140|  9.47k|    }
 1141|  9.66k|    cache = &ctxt->urlTab[ctxt->urlNr];
 1142|  9.66k|    cache->doc = doc;
 1143|  9.66k|    cache->url = xmlStrdup(url);
 1144|  9.66k|    if (cache->url == NULL) {
  ------------------
  |  Branch (1144:9): [True: 3, False: 9.65k]
  ------------------
 1145|      3|        xmlXIncludeErrMemory(ctxt);
 1146|      3|        xmlFreeDoc(doc);
 1147|      3|        goto error;
 1148|      3|    }
 1149|  9.65k|    cache->expanding = 0;
 1150|  9.65k|    cacheNr = ctxt->urlNr++;
 1151|       |
 1152|  9.65k|    if (doc == NULL)
  ------------------
  |  Branch (1152:9): [True: 1.78k, False: 7.87k]
  ------------------
 1153|  1.78k|        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|  7.87k|    if ((doc->URL != NULL) && (!xmlStrEqual(url, doc->URL)))
  ------------------
  |  Branch (1160:9): [True: 7.87k, False: 0]
  |  Branch (1160:31): [True: 0, False: 7.87k]
  ------------------
 1161|      0|        url = doc->URL;
 1162|       |
 1163|       |    /*
 1164|       |     * Make sure we have all entities fixed up
 1165|       |     */
 1166|  7.87k|    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|  7.87k|    cache->expanding = 1;
 1182|  7.87k|    xmlXIncludeRecurseDoc(ctxt, doc);
 1183|       |    /* urlTab might be reallocated. */
 1184|  7.87k|    cache = &ctxt->urlTab[cacheNr];
 1185|  7.87k|    cache->expanding = 0;
 1186|       |
 1187|  16.8k|loaded:
 1188|  16.8k|    if (fragment == NULL) {
  ------------------
  |  Branch (1188:9): [True: 5.07k, False: 11.7k]
  ------------------
 1189|  5.07k|        xmlNodePtr root;
 1190|       |
 1191|  5.07k|        root = xmlDocGetRootElement(doc);
 1192|  5.07k|        if (root == NULL) {
  ------------------
  |  Branch (1192:13): [True: 1, False: 5.07k]
  ------------------
 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.07k|        ref->inc = xmlDocCopyNode(root, ctxt->doc, 1);
 1199|  5.07k|        if (ref->inc == NULL) {
  ------------------
  |  Branch (1199:13): [True: 105, False: 4.97k]
  ------------------
 1200|    105|            xmlXIncludeErrMemory(ctxt);
 1201|    105|            goto error;
 1202|    105|        }
 1203|       |
 1204|  4.97k|        if (ref->base != NULL)
  ------------------
  |  Branch (1204:13): [True: 4.11k, False: 854]
  ------------------
 1205|  4.11k|            xmlXIncludeBaseFixup(ctxt, root, ref->inc, ref->base);
 1206|  4.97k|    }
 1207|  11.7k|#ifdef LIBXML_XPTR_ENABLED
 1208|  11.7k|    else {
 1209|       |	/*
 1210|       |	 * Computes the XPointer expression and make a copy used
 1211|       |	 * as the replacement copy.
 1212|       |	 */
 1213|  11.7k|	xmlXPathObjectPtr xptr;
 1214|  11.7k|	xmlNodeSetPtr set;
 1215|       |
 1216|  11.7k|        if (ctxt->isStream && doc == ctxt->doc) {
  ------------------
  |  Branch (1216:13): [True: 7.98k, False: 3.77k]
  |  Branch (1216:31): [True: 78, False: 7.90k]
  ------------------
 1217|     78|	    xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1218|     78|			   "XPointer expressions not allowed in streaming"
 1219|     78|                           " mode\n", NULL);
 1220|     78|            goto error;
 1221|     78|        }
 1222|       |
 1223|  11.6k|        if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1223:13): [True: 7.18k, False: 4.50k]
  ------------------
 1224|  7.18k|            ctxt->xpctxt = xmlXPathNewContext(doc);
 1225|  7.18k|            if (ctxt->xpctxt == NULL) {
  ------------------
  |  Branch (1225:17): [True: 28, False: 7.15k]
  ------------------
 1226|     28|                xmlXIncludeErrMemory(ctxt);
 1227|     28|                goto error;
 1228|     28|            }
 1229|  7.15k|            if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1229:17): [True: 7.15k, False: 0]
  ------------------
 1230|  7.15k|                xmlXPathSetErrorHandler(ctxt->xpctxt, ctxt->errorHandler,
 1231|  7.15k|                                        ctxt->errorCtxt);
 1232|  7.15k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 1233|  7.15k|            ctxt->xpctxt->opLimit = 100000;
 1234|  7.15k|#endif
 1235|  7.15k|        } else {
 1236|  4.50k|            ctxt->xpctxt->doc = doc;
 1237|  4.50k|        }
 1238|  11.6k|	xptr = xmlXPtrEval(fragment, ctxt->xpctxt);
 1239|  11.6k|	if (ctxt->xpctxt->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (1239:6): [True: 7.75k, False: 3.90k]
  ------------------
 1240|  7.75k|            if (ctxt->xpctxt->lastError.code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1240:17): [True: 2.39k, False: 5.36k]
  ------------------
 1241|  2.39k|                xmlXIncludeErrMemory(ctxt);
 1242|  5.36k|            else
 1243|  5.36k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_XPTR_FAILED,
 1244|  5.36k|                               "XPointer evaluation failed: #%s\n",
 1245|  5.36k|                               fragment);
 1246|  7.75k|            goto error;
 1247|  7.75k|	}
 1248|  3.90k|        if (xptr == NULL)
  ------------------
  |  Branch (1248:13): [True: 2.67k, False: 1.23k]
  ------------------
 1249|  2.67k|            goto done;
 1250|  1.23k|	switch (xptr->type) {
  ------------------
  |  Branch (1250:10): [True: 1.23k, False: 0]
  ------------------
 1251|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1251:6): [True: 0, False: 1.23k]
  ------------------
 1252|      0|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1252:6): [True: 0, False: 1.23k]
  ------------------
 1253|      0|	    case XPATH_NUMBER:
  ------------------
  |  Branch (1253:6): [True: 0, False: 1.23k]
  ------------------
 1254|      0|	    case XPATH_STRING:
  ------------------
  |  Branch (1254:6): [True: 0, False: 1.23k]
  ------------------
 1255|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (1255:6): [True: 0, False: 1.23k]
  ------------------
 1256|      0|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (1256:6): [True: 0, False: 1.23k]
  ------------------
 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.23k|	    case XPATH_NODESET:
  ------------------
  |  Branch (1262:6): [True: 1.23k, False: 0]
  ------------------
 1263|  1.23k|                break;
 1264|       |
 1265|  1.23k|	}
 1266|  1.23k|	set = xptr->nodesetval;
 1267|  1.23k|	if (set != NULL) {
  ------------------
  |  Branch (1267:6): [True: 1.23k, False: 0]
  ------------------
 1268|   609k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (1268:17): [True: 608k, False: 1.20k]
  ------------------
 1269|   608k|		if (set->nodeTab[i] == NULL) /* shouldn't happen */
  ------------------
  |  Branch (1269:7): [True: 0, False: 608k]
  ------------------
 1270|      0|		    continue;
 1271|   608k|		switch (set->nodeTab[i]->type) {
  ------------------
  |  Branch (1271:11): [True: 608k, False: 0]
  ------------------
 1272|   202k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1272:7): [True: 202k, False: 405k]
  ------------------
 1273|   449k|		    case XML_TEXT_NODE:
  ------------------
  |  Branch (1273:7): [True: 246k, False: 361k]
  ------------------
 1274|   509k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1274:7): [True: 60.3k, False: 547k]
  ------------------
 1275|   509k|		    case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1275:7): [True: 0, False: 608k]
  ------------------
 1276|   509k|		    case XML_ENTITY_NODE:
  ------------------
  |  Branch (1276:7): [True: 0, False: 608k]
  ------------------
 1277|   603k|		    case XML_PI_NODE:
  ------------------
  |  Branch (1277:7): [True: 93.9k, False: 514k]
  ------------------
 1278|   607k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (1278:7): [True: 4.21k, False: 603k]
  ------------------
 1279|   607k|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1279:7): [True: 346, False: 607k]
  ------------------
 1280|   607k|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1280:7): [True: 0, False: 608k]
  ------------------
 1281|   607k|			continue;
 1282|       |
 1283|     24|		    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1283:7): [True: 24, False: 607k]
  ------------------
 1284|     24|			xmlXIncludeErr(ctxt, ref->elem,
 1285|     24|			               XML_XINCLUDE_XPTR_RESULT,
 1286|     24|				       "XPointer selects an attribute: #%s\n",
 1287|     24|				       fragment);
 1288|     24|			goto xptr_error;
 1289|      4|		    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1289:7): [True: 4, False: 607k]
  ------------------
 1290|      4|			xmlXIncludeErr(ctxt, ref->elem,
 1291|      4|			               XML_XINCLUDE_XPTR_RESULT,
 1292|      4|				       "XPointer selects a namespace: #%s\n",
 1293|      4|				       fragment);
 1294|      4|			goto xptr_error;
 1295|      0|		    case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (1295:7): [True: 0, False: 608k]
  ------------------
 1296|      0|		    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1296:7): [True: 0, False: 608k]
  ------------------
 1297|      0|		    case XML_NOTATION_NODE:
  ------------------
  |  Branch (1297:7): [True: 0, False: 608k]
  ------------------
 1298|      0|		    case XML_DTD_NODE:
  ------------------
  |  Branch (1298:7): [True: 0, False: 608k]
  ------------------
 1299|      0|		    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (1299:7): [True: 0, False: 608k]
  ------------------
 1300|      0|		    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1300:7): [True: 0, False: 608k]
  ------------------
 1301|      0|		    case XML_ENTITY_DECL:
  ------------------
  |  Branch (1301:7): [True: 0, False: 608k]
  ------------------
 1302|      0|		    case XML_XINCLUDE_START:
  ------------------
  |  Branch (1302:7): [True: 0, False: 608k]
  ------------------
 1303|      0|		    case XML_XINCLUDE_END:
  ------------------
  |  Branch (1303:7): [True: 0, False: 608k]
  ------------------
 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|   608k|		}
 1311|   608k|	    }
 1312|  1.23k|	}
 1313|  1.20k|        ref->inc = xmlXIncludeCopyXPointer(ctxt, xptr, ref->base);
 1314|  1.23k|xptr_error:
 1315|  1.23k|        xmlXPathFreeObject(xptr);
 1316|  1.23k|    }
 1317|       |
 1318|  8.87k|done:
 1319|  8.87k|#endif
 1320|       |
 1321|  8.87k|    ret = 0;
 1322|       |
 1323|  19.1k|error:
 1324|  19.1k|    return(ret);
 1325|  8.87k|}
xinclude.c:xmlXIncludeParseFile:
  320|  9.66k|xmlXIncludeParseFile(xmlXIncludeCtxtPtr ctxt, const char *URL) {
  321|  9.66k|    xmlDocPtr ret = NULL;
  322|  9.66k|    xmlParserCtxtPtr pctxt;
  323|  9.66k|    xmlParserInputPtr inputStream;
  324|       |
  325|  9.66k|    xmlInitParser();
  326|       |
  327|  9.66k|    pctxt = xmlNewParserCtxt();
  328|  9.66k|    if (pctxt == NULL) {
  ------------------
  |  Branch (328:9): [True: 12, False: 9.64k]
  ------------------
  329|     12|	xmlXIncludeErrMemory(ctxt);
  330|     12|	return(NULL);
  331|     12|    }
  332|  9.64k|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (332:9): [True: 9.64k, False: 0]
  ------------------
  333|  9.64k|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
  334|  9.64k|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (334:9): [True: 9.64k, False: 0]
  ------------------
  335|  9.64k|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
  336|  9.64k|                                 ctxt->resourceCtxt);
  337|       |
  338|       |    /*
  339|       |     * pass in the application data to the parser context.
  340|       |     */
  341|  9.64k|    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|  9.64k|    if ((ctxt->doc != NULL) && (ctxt->doc->dict != NULL)) {
  ------------------
  |  Branch (347:9): [True: 9.64k, False: 0]
  |  Branch (347:32): [True: 5.13k, False: 4.51k]
  ------------------
  348|  5.13k|       if (pctxt->dict != NULL)
  ------------------
  |  Branch (348:12): [True: 5.13k, False: 0]
  ------------------
  349|  5.13k|            xmlDictFree(pctxt->dict);
  350|  5.13k|	pctxt->dict = ctxt->doc->dict;
  351|  5.13k|	xmlDictReference(pctxt->dict);
  352|  5.13k|    }
  353|       |
  354|       |    /*
  355|       |     * We set DTDLOAD to make sure that ID attributes declared in
  356|       |     * external DTDs are detected.
  357|       |     */
  358|  9.64k|    xmlCtxtUseOptions(pctxt, ctxt->parseFlags | XML_PARSE_DTDLOAD);
  359|       |
  360|  9.64k|    inputStream = xmlLoadResource(pctxt, URL, NULL, XML_RESOURCE_XINCLUDE);
  361|  9.64k|    if (inputStream == NULL)
  ------------------
  |  Branch (361:9): [True: 811, False: 8.83k]
  ------------------
  362|    811|        goto error;
  363|       |
  364|  8.83k|    if (xmlCtxtPushInput(pctxt, inputStream) < 0) {
  ------------------
  |  Branch (364:9): [True: 1, False: 8.83k]
  ------------------
  365|      1|        xmlFreeInputStream(inputStream);
  366|      1|        goto error;
  367|      1|    }
  368|       |
  369|  8.83k|    xmlParseDocument(pctxt);
  370|       |
  371|  8.83k|    if (pctxt->wellFormed) {
  ------------------
  |  Branch (371:9): [True: 7.87k, False: 962]
  ------------------
  372|  7.87k|        ret = pctxt->myDoc;
  373|  7.87k|    }
  374|    962|    else {
  375|    962|        ret = NULL;
  376|    962|	if (pctxt->myDoc != NULL)
  ------------------
  |  Branch (376:6): [True: 899, False: 63]
  ------------------
  377|    899|	    xmlFreeDoc(pctxt->myDoc);
  378|    962|        pctxt->myDoc = NULL;
  379|    962|    }
  380|       |
  381|  9.64k|error:
  382|  9.64k|    if (xmlCtxtIsCatastrophicError(pctxt))
  ------------------
  |  Branch (382:9): [True: 143, False: 9.50k]
  ------------------
  383|    143|        xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "parser error", NULL);
  384|  9.64k|    xmlFreeParserCtxt(pctxt);
  385|       |
  386|  9.64k|    return(ret);
  387|  8.83k|}
xinclude.c:xmlXIncludeMergeEntities:
 1002|  7.87k|	                 xmlDocPtr from) {
 1003|  7.87k|    xmlNodePtr cur;
 1004|  7.87k|    xmlDtdPtr target, source;
 1005|       |
 1006|  7.87k|    if (ctxt == NULL)
  ------------------
  |  Branch (1006:9): [True: 0, False: 7.87k]
  ------------------
 1007|      0|	return(-1);
 1008|       |
 1009|  7.87k|    if ((from == NULL) || (from->intSubset == NULL))
  ------------------
  |  Branch (1009:9): [True: 0, False: 7.87k]
  |  Branch (1009:27): [True: 5.95k, False: 1.91k]
  ------------------
 1010|  5.95k|	return(0);
 1011|       |
 1012|  1.91k|    target = doc->intSubset;
 1013|  1.91k|    if (target == NULL) {
  ------------------
  |  Branch (1013:9): [True: 163, False: 1.75k]
  ------------------
 1014|    163|	cur = xmlDocGetRootElement(doc);
 1015|    163|	if (cur == NULL)
  ------------------
  |  Branch (1015:6): [True: 0, False: 163]
  ------------------
 1016|      0|	    return(-1);
 1017|    163|        target = xmlCreateIntSubset(doc, cur->name, NULL, NULL);
 1018|    163|	if (target == NULL) {
  ------------------
  |  Branch (1018:6): [True: 1, False: 162]
  ------------------
 1019|      1|            xmlXIncludeErrMemory(ctxt);
 1020|      1|	    return(-1);
 1021|      1|        }
 1022|    163|    }
 1023|       |
 1024|  1.91k|    source = from->intSubset;
 1025|  1.91k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1025:9): [True: 1.91k, False: 0]
  |  Branch (1025:29): [True: 108, False: 1.80k]
  ------------------
 1026|    108|	xmlXIncludeMergeData data;
 1027|       |
 1028|    108|	data.ctxt = ctxt;
 1029|    108|	data.doc = doc;
 1030|       |
 1031|    108|	xmlHashScan((xmlHashTablePtr) source->entities,
 1032|    108|		    xmlXIncludeMergeEntity, &data);
 1033|    108|    }
 1034|  1.91k|    source = from->extSubset;
 1035|  1.91k|    if ((source != NULL) && (source->entities != NULL)) {
  ------------------
  |  Branch (1035:9): [True: 44, False: 1.87k]
  |  Branch (1035:29): [True: 6, False: 38]
  ------------------
 1036|      6|	xmlXIncludeMergeData data;
 1037|       |
 1038|      6|	data.ctxt = ctxt;
 1039|      6|	data.doc = doc;
 1040|       |
 1041|       |	/*
 1042|       |	 * don't duplicate existing stuff when external subsets are the same
 1043|       |	 */
 1044|      6|	if ((!xmlStrEqual(target->ExternalID, source->ExternalID)) &&
  ------------------
  |  Branch (1044:6): [True: 0, False: 6]
  ------------------
 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|      6|    }
 1050|  1.91k|    return(0);
 1051|  1.91k|}
xinclude.c:xmlXIncludeMergeEntity:
  921|    307|	               const xmlChar *name ATTRIBUTE_UNUSED) {
  922|    307|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  923|    307|    xmlXIncludeMergeDataPtr data = (xmlXIncludeMergeDataPtr) vdata;
  924|    307|    xmlEntityPtr ret, prev;
  925|    307|    xmlDocPtr doc;
  926|    307|    xmlXIncludeCtxtPtr ctxt;
  927|       |
  928|    307|    if ((ent == NULL) || (data == NULL))
  ------------------
  |  Branch (928:9): [True: 0, False: 307]
  |  Branch (928:26): [True: 0, False: 307]
  ------------------
  929|      0|	return;
  930|    307|    ctxt = data->ctxt;
  931|    307|    doc = data->doc;
  932|    307|    if ((ctxt == NULL) || (doc == NULL))
  ------------------
  |  Branch (932:9): [True: 0, False: 307]
  |  Branch (932:27): [True: 0, False: 307]
  ------------------
  933|      0|	return;
  934|    307|    switch (ent->etype) {
  ------------------
  |  Branch (934:13): [True: 307, False: 0]
  ------------------
  935|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (935:9): [True: 0, False: 307]
  ------------------
  936|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (936:9): [True: 0, False: 307]
  ------------------
  937|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (937:9): [True: 0, False: 307]
  ------------------
  938|      0|	    return;
  939|     67|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (939:9): [True: 67, False: 240]
  ------------------
  940|    305|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (940:9): [True: 238, False: 69]
  ------------------
  941|    307|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (941:9): [True: 2, False: 305]
  ------------------
  942|    307|	    break;
  943|    307|    }
  944|    307|    prev = xmlGetDocEntity(doc, ent->name);
  945|    307|    if (prev == NULL) {
  ------------------
  |  Branch (945:9): [True: 146, False: 161]
  ------------------
  946|    146|        ret = xmlAddDocEntity(doc, ent->name, ent->etype, ent->ExternalID,
  947|    146|                              ent->SystemID, ent->content);
  948|    146|        if (ret == NULL) {
  ------------------
  |  Branch (948:13): [True: 2, False: 144]
  ------------------
  949|      2|            xmlXIncludeErrMemory(ctxt);
  950|      2|            return;
  951|      2|        }
  952|    144|	if (ent->URI != NULL) {
  ------------------
  |  Branch (952:6): [True: 87, False: 57]
  ------------------
  953|     87|	    ret->URI = xmlStrdup(ent->URI);
  954|     87|            if (ret->URI == 0)
  ------------------
  |  Branch (954:17): [True: 3, False: 84]
  ------------------
  955|      3|                xmlXIncludeErrMemory(ctxt);
  956|     87|        }
  957|    161|    } else {
  958|    161|        if (ent->etype != prev->etype)
  ------------------
  |  Branch (958:13): [True: 21, False: 140]
  ------------------
  959|     21|            goto error;
  960|       |
  961|    140|        if ((ent->SystemID != NULL) && (prev->SystemID != NULL)) {
  ------------------
  |  Branch (961:13): [True: 124, False: 16]
  |  Branch (961:40): [True: 124, False: 0]
  ------------------
  962|    124|            if (!xmlStrEqual(ent->SystemID, prev->SystemID))
  ------------------
  |  Branch (962:17): [True: 9, False: 115]
  ------------------
  963|      9|                goto error;
  964|    124|        } else if ((ent->ExternalID != NULL) &&
  ------------------
  |  Branch (964:20): [True: 0, False: 16]
  ------------------
  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|     16|        } else if ((ent->content != NULL) && (prev->content != NULL)) {
  ------------------
  |  Branch (968:20): [True: 16, False: 0]
  |  Branch (968:46): [True: 16, False: 0]
  ------------------
  969|     16|            if (!xmlStrEqual(ent->content, prev->content))
  ------------------
  |  Branch (969:17): [True: 6, False: 10]
  ------------------
  970|      6|                goto error;
  971|     16|        } else {
  972|      0|            goto error;
  973|      0|        }
  974|    140|    }
  975|    269|    return;
  976|    269|error:
  977|     36|    switch (ent->etype) {
  ------------------
  |  Branch (977:13): [True: 36, False: 0]
  ------------------
  978|      0|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (978:9): [True: 0, False: 36]
  ------------------
  979|      0|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (979:9): [True: 0, False: 36]
  ------------------
  980|      0|        case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (980:9): [True: 0, False: 36]
  ------------------
  981|     25|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (981:9): [True: 25, False: 11]
  ------------------
  982|     36|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (982:9): [True: 11, False: 25]
  ------------------
  983|     36|	    return;
  984|      0|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (984:9): [True: 0, False: 36]
  ------------------
  985|      0|	    break;
  986|     36|    }
  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|  7.87k|xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc) {
  600|  7.87k|    xmlDocPtr oldDoc;
  601|  7.87k|    xmlXIncludeRefPtr *oldIncTab;
  602|  7.87k|    int oldIncMax, oldIncNr, oldIsStream;
  603|  7.87k|    int i;
  604|       |
  605|  7.87k|    oldDoc = ctxt->doc;
  606|  7.87k|    oldIncMax = ctxt->incMax;
  607|  7.87k|    oldIncNr = ctxt->incNr;
  608|  7.87k|    oldIncTab = ctxt->incTab;
  609|  7.87k|    oldIsStream = ctxt->isStream;
  610|  7.87k|    ctxt->doc = doc;
  611|  7.87k|    ctxt->incMax = 0;
  612|  7.87k|    ctxt->incNr = 0;
  613|  7.87k|    ctxt->incTab = NULL;
  614|  7.87k|    ctxt->isStream = 0;
  615|       |
  616|  7.87k|    xmlXIncludeDoProcess(ctxt, xmlDocGetRootElement(doc));
  617|       |
  618|  7.87k|    if (ctxt->incTab != NULL) {
  ------------------
  |  Branch (618:9): [True: 3.30k, False: 4.57k]
  ------------------
  619|  8.19k|        for (i = 0; i < ctxt->incNr; i++)
  ------------------
  |  Branch (619:21): [True: 4.89k, False: 3.30k]
  ------------------
  620|  4.89k|            xmlXIncludeFreeRef(ctxt->incTab[i]);
  621|  3.30k|        xmlFree(ctxt->incTab);
  622|  3.30k|    }
  623|       |
  624|  7.87k|    ctxt->doc = oldDoc;
  625|  7.87k|    ctxt->incMax = oldIncMax;
  626|  7.87k|    ctxt->incNr = oldIncNr;
  627|  7.87k|    ctxt->incTab = oldIncTab;
  628|  7.87k|    ctxt->isStream = oldIsStream;
  629|  7.87k|}
xinclude.c:xmlXIncludeBaseFixup:
  639|   151k|                     const xmlChar *targetBase) {
  640|   151k|    xmlChar *base = NULL;
  641|   151k|    xmlChar *relBase = NULL;
  642|   151k|    xmlNs ns;
  643|   151k|    int res;
  644|       |
  645|   151k|    if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (645:9): [True: 114k, False: 36.8k]
  ------------------
  646|   114k|        return;
  647|       |
  648|  36.8k|    if (xmlNodeGetBaseSafe(cur->doc, cur, &base) < 0)
  ------------------
  |  Branch (648:9): [True: 23, False: 36.8k]
  ------------------
  649|     23|        xmlXIncludeErrMemory(ctxt);
  650|       |
  651|  36.8k|    if ((base != NULL) && !xmlStrEqual(base, targetBase)) {
  ------------------
  |  Branch (651:9): [True: 35.3k, False: 1.51k]
  |  Branch (651:27): [True: 33.5k, False: 1.80k]
  ------------------
  652|  33.5k|        if ((xmlStrlen(base) > XML_MAX_URI_LENGTH) ||
  ------------------
  |  |   11|  33.5k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (652:13): [True: 188, False: 33.3k]
  ------------------
  653|  33.3k|            (xmlStrlen(targetBase) > XML_MAX_URI_LENGTH)) {
  ------------------
  |  |   11|  33.3k|#define XML_MAX_URI_LENGTH 2000
  ------------------
  |  Branch (653:13): [True: 51, False: 33.2k]
  ------------------
  654|    239|            relBase = xmlStrdup(base);
  655|    239|            if (relBase == NULL) {
  ------------------
  |  Branch (655:17): [True: 1, False: 238]
  ------------------
  656|      1|                xmlXIncludeErrMemory(ctxt);
  657|      1|                goto done;
  658|      1|            }
  659|  33.2k|        } else if (xmlBuildRelativeURISafe(base, targetBase, &relBase) < 0) {
  ------------------
  |  Branch (659:20): [True: 74, False: 33.2k]
  ------------------
  660|     74|            xmlXIncludeErrMemory(ctxt);
  661|     74|            goto done;
  662|     74|        }
  663|  33.4k|        if (relBase == NULL) {
  ------------------
  |  Branch (663:13): [True: 278, False: 33.1k]
  ------------------
  664|    278|            xmlXIncludeErr(ctxt, cur,
  665|    278|                    XML_XINCLUDE_HREF_URI,
  666|    278|                    "Building relative URI failed: %s\n",
  667|    278|                    base);
  668|    278|            goto done;
  669|    278|        }
  670|       |
  671|       |        /*
  672|       |         * If the new base doesn't contain a slash, it can be omitted.
  673|       |         */
  674|  33.1k|        if (xmlStrchr(relBase, '/') != NULL) {
  ------------------
  |  Branch (674:13): [True: 2.76k, False: 30.4k]
  ------------------
  675|  2.76k|            res = xmlNodeSetBase(copy, relBase);
  676|  2.76k|            if (res < 0)
  ------------------
  |  Branch (676:17): [True: 21, False: 2.74k]
  ------------------
  677|     21|                xmlXIncludeErrMemory(ctxt);
  678|  2.76k|            goto done;
  679|  2.76k|        }
  680|  33.1k|    }
  681|       |
  682|       |    /*
  683|       |     * Delete existing xml:base if bases are equal
  684|       |     */
  685|  33.7k|    memset(&ns, 0, sizeof(ns));
  686|  33.7k|    ns.href = XML_XML_NAMESPACE;
  ------------------
  |  |  146|  33.7k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  687|  33.7k|    xmlUnsetNsProp(copy, &ns, BAD_CAST "base");
  ------------------
  |  |   34|  33.7k|#define BAD_CAST (xmlChar *)
  ------------------
  688|       |
  689|  36.8k|done:
  690|  36.8k|    xmlFree(base);
  691|  36.8k|    xmlFree(relBase);
  692|  36.8k|}
xinclude.c:xmlXIncludeCopyXPointer:
  827|  1.20k|                        const xmlChar *targetBase) {
  828|  1.20k|    xmlNodePtr list = NULL, last = NULL, copy;
  829|  1.20k|    int i;
  830|       |
  831|  1.20k|    if ((ctxt == NULL) || (obj == NULL))
  ------------------
  |  Branch (831:9): [True: 0, False: 1.20k]
  |  Branch (831:27): [True: 0, False: 1.20k]
  ------------------
  832|      0|	return(NULL);
  833|  1.20k|    switch (obj->type) {
  834|  1.20k|        case XPATH_NODESET: {
  ------------------
  |  Branch (834:9): [True: 1.20k, False: 0]
  ------------------
  835|  1.20k|	    xmlNodeSetPtr set = obj->nodesetval;
  836|  1.20k|	    if (set == NULL)
  ------------------
  |  Branch (836:10): [True: 0, False: 1.20k]
  ------------------
  837|      0|		break;
  838|   297k|	    for (i = 0;i < set->nodeNr;i++) {
  ------------------
  |  Branch (838:17): [True: 296k, False: 851]
  ------------------
  839|   296k|                xmlNodePtr node;
  840|       |
  841|   296k|		if (set->nodeTab[i] == NULL)
  ------------------
  |  Branch (841:7): [True: 0, False: 296k]
  ------------------
  842|      0|		    continue;
  843|   296k|		switch (set->nodeTab[i]->type) {
  844|    346|		    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (844:7): [True: 346, False: 296k]
  ------------------
  845|    346|		    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (845:7): [True: 0, False: 296k]
  ------------------
  846|    346|                        node = xmlDocGetRootElement(
  847|    346|                                (xmlDocPtr) set->nodeTab[i]);
  848|    346|                        if (node == NULL) {
  ------------------
  |  Branch (848:29): [True: 0, False: 346]
  ------------------
  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|    346|                        break;
  855|   143k|                    case XML_TEXT_NODE:
  ------------------
  |  Branch (855:21): [True: 143k, False: 153k]
  ------------------
  856|   178k|		    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (856:7): [True: 34.9k, False: 261k]
  ------------------
  857|   239k|		    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (857:7): [True: 61.0k, False: 235k]
  ------------------
  858|   293k|		    case XML_PI_NODE:
  ------------------
  |  Branch (858:7): [True: 54.4k, False: 241k]
  ------------------
  859|   296k|		    case XML_COMMENT_NODE:
  ------------------
  |  Branch (859:7): [True: 2.49k, False: 293k]
  ------------------
  860|   296k|                        node = set->nodeTab[i];
  861|   296k|			break;
  862|      0|                    default:
  ------------------
  |  Branch (862:21): [True: 0, False: 296k]
  ------------------
  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|   296k|		}
  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|   296k|		copy = xmlXIncludeCopyNode(ctxt, node, 0, targetBase);
  876|   296k|                if (copy == NULL) {
  ------------------
  |  Branch (876:21): [True: 355, False: 296k]
  ------------------
  877|    355|                    xmlFreeNodeList(list);
  878|    355|                    return(NULL);
  879|    355|                }
  880|   296k|		if (last == NULL) {
  ------------------
  |  Branch (880:7): [True: 686, False: 295k]
  ------------------
  881|    686|                    list = copy;
  882|   295k|                } else {
  883|   295k|                    while (last->next != NULL)
  ------------------
  |  Branch (883:28): [True: 0, False: 295k]
  ------------------
  884|      0|                        last = last->next;
  885|   295k|                    copy->prev = last;
  886|   295k|                    last->next = copy;
  887|   295k|		}
  888|   296k|                last = copy;
  889|   296k|	    }
  890|    851|	    break;
  891|  1.20k|	}
  892|    851|	default:
  ------------------
  |  Branch (892:2): [True: 0, False: 1.20k]
  ------------------
  893|      0|	    break;
  894|  1.20k|    }
  895|    851|    return(list);
  896|  1.20k|}
xinclude.c:xmlXIncludeCopyNode:
  705|   296k|                    int copyChildren, const xmlChar *targetBase) {
  706|   296k|    xmlNodePtr result = NULL;
  707|   296k|    xmlNodePtr insertParent = NULL;
  708|   296k|    xmlNodePtr insertLast = NULL;
  709|   296k|    xmlNodePtr cur;
  710|   296k|    xmlNodePtr item;
  711|   296k|    int depth = 0;
  712|       |
  713|   296k|    if (copyChildren) {
  ------------------
  |  Branch (713:9): [True: 480, False: 296k]
  ------------------
  714|    480|        cur = elem->children;
  715|    480|        if (cur == NULL)
  ------------------
  |  Branch (715:13): [True: 0, False: 480]
  ------------------
  716|      0|            return(NULL);
  717|   296k|    } else {
  718|   296k|        cur = elem;
  719|   296k|    }
  720|       |
  721|  1.46M|    while (1) {
  ------------------
  |  Branch (721:12): [True: 1.46M, Folded]
  ------------------
  722|  1.46M|        xmlNodePtr copy = NULL;
  723|  1.46M|        int recurse = 0;
  724|       |
  725|  1.46M|        if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (725:13): [True: 0, False: 1.46M]
  ------------------
  726|  1.46M|            (cur->type == XML_DTD_NODE)) {
  ------------------
  |  Branch (726:13): [True: 0, False: 1.46M]
  ------------------
  727|      0|            ;
  728|  1.46M|        } else if ((cur->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (728:20): [True: 424k, False: 1.04M]
  ------------------
  729|   424k|                   (cur->ns != NULL) &&
  ------------------
  |  Branch (729:20): [True: 135k, False: 288k]
  ------------------
  730|   135k|                   (xmlStrEqual(cur->name, XINCLUDE_NODE)) &&
  ------------------
  |  |   38|   135k|#define XINCLUDE_NODE (const xmlChar *) "include"
  ------------------
  |  Branch (730:20): [True: 851, False: 134k]
  ------------------
  731|    851|                   ((xmlStrEqual(cur->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|    851|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (731:21): [True: 395, False: 456]
  ------------------
  732|    614|                    (xmlStrEqual(cur->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|    456|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (732:21): [True: 219, False: 237]
  ------------------
  733|    614|            xmlXIncludeRefPtr ref = xmlXIncludeExpandNode(ctxt, cur);
  734|       |
  735|    614|            if (ref == NULL)
  ------------------
  |  Branch (735:17): [True: 176, False: 438]
  ------------------
  736|    176|                goto error;
  737|       |            /*
  738|       |             * TODO: Insert XML_XINCLUDE_START and XML_XINCLUDE_END nodes
  739|       |             */
  740|  3.50k|            for (item = ref->inc; item != NULL; item = item->next) {
  ------------------
  |  Branch (740:35): [True: 3.07k, False: 432]
  ------------------
  741|  3.07k|                copy = xmlStaticCopyNode(item, ctxt->doc, insertParent, 1);
  742|  3.07k|                if (copy == NULL) {
  ------------------
  |  Branch (742:21): [True: 6, False: 3.07k]
  ------------------
  743|      6|                    xmlXIncludeErrMemory(ctxt);
  744|      6|                    goto error;
  745|      6|                }
  746|       |
  747|  3.07k|                if (result == NULL)
  ------------------
  |  Branch (747:21): [True: 24, False: 3.04k]
  ------------------
  748|     24|                    result = copy;
  749|  3.07k|                if (insertLast != NULL) {
  ------------------
  |  Branch (749:21): [True: 2.98k, False: 87]
  ------------------
  750|  2.98k|                    insertLast->next = copy;
  751|  2.98k|                    copy->prev = insertLast;
  752|  2.98k|                } else if (insertParent != NULL) {
  ------------------
  |  Branch (752:28): [True: 63, False: 24]
  ------------------
  753|     63|                    insertParent->children = copy;
  754|     63|                }
  755|  3.07k|                insertLast = copy;
  756|       |
  757|  3.07k|                if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (757:21): [True: 1.89k, False: 1.17k]
  |  Branch (757:37): [True: 845, False: 1.04k]
  ------------------
  758|    845|                    xmlXIncludeBaseFixup(ctxt, item, copy, targetBase);
  759|  3.07k|            }
  760|  1.46M|        } else {
  761|  1.46M|            copy = xmlStaticCopyNode(cur, ctxt->doc, insertParent, 2);
  762|  1.46M|            if (copy == NULL) {
  ------------------
  |  Branch (762:17): [True: 166, False: 1.46M]
  ------------------
  763|    166|                xmlXIncludeErrMemory(ctxt);
  764|    166|                goto error;
  765|    166|            }
  766|       |
  767|  1.46M|            if (result == NULL)
  ------------------
  |  Branch (767:17): [True: 296k, False: 1.16M]
  ------------------
  768|   296k|                result = copy;
  769|  1.46M|            if (insertLast != NULL) {
  ------------------
  |  Branch (769:17): [True: 986k, False: 477k]
  ------------------
  770|   986k|                insertLast->next = copy;
  771|   986k|                copy->prev = insertLast;
  772|   986k|            } else if (insertParent != NULL) {
  ------------------
  |  Branch (772:24): [True: 180k, False: 296k]
  ------------------
  773|   180k|                insertParent->children = copy;
  774|   180k|            }
  775|  1.46M|            insertLast = copy;
  776|       |
  777|  1.46M|            if ((depth == 0) && (targetBase != NULL))
  ------------------
  |  Branch (777:17): [True: 299k, False: 1.16M]
  |  Branch (777:33): [True: 146k, False: 153k]
  ------------------
  778|   146k|                xmlXIncludeBaseFixup(ctxt, cur, copy, targetBase);
  779|       |
  780|  1.46M|            recurse = (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (780:23): [True: 1.46M, False: 224]
  ------------------
  781|  1.46M|                      (cur->children != NULL);
  ------------------
  |  Branch (781:23): [True: 180k, False: 1.28M]
  ------------------
  782|  1.46M|        }
  783|       |
  784|  1.46M|        if (recurse) {
  ------------------
  |  Branch (784:13): [True: 180k, False: 1.28M]
  ------------------
  785|   180k|            cur = cur->children;
  786|   180k|            insertParent = insertLast;
  787|   180k|            insertLast = NULL;
  788|   180k|            depth += 1;
  789|   180k|            continue;
  790|   180k|        }
  791|       |
  792|  1.28M|        if (cur == elem)
  ------------------
  |  Branch (792:13): [True: 291k, False: 991k]
  ------------------
  793|   291k|            return(result);
  794|       |
  795|  1.16M|        while (cur->next == NULL) {
  ------------------
  |  Branch (795:16): [True: 178k, False: 986k]
  ------------------
  796|   178k|            if (insertParent != NULL)
  ------------------
  |  Branch (796:17): [True: 177k, False: 442]
  ------------------
  797|   177k|                insertParent->last = insertLast;
  798|   178k|            cur = cur->parent;
  799|   178k|            if (cur == elem)
  ------------------
  |  Branch (799:17): [True: 4.90k, False: 173k]
  ------------------
  800|  4.90k|                return(result);
  801|   173k|            insertLast = insertParent;
  802|   173k|            insertParent = insertParent->parent;
  803|   173k|            depth -= 1;
  804|   173k|        }
  805|       |
  806|   986k|        cur = cur->next;
  807|   986k|    }
  808|       |
  809|    348|error:
  810|    348|    xmlFreeNodeList(result);
  811|       |    return(NULL);
  812|   296k|}
xinclude.c:xmlXIncludeLoadTxt:
 1335|    176|xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1336|    176|    xmlParserInputBufferPtr buf;
 1337|    176|    xmlNodePtr node = NULL;
 1338|    176|    const xmlChar *url = ref->URI;
 1339|    176|    int i;
 1340|    176|    int ret = -1;
 1341|    176|    xmlChar *encoding = NULL;
 1342|    176|    xmlCharEncodingHandlerPtr handler = NULL;
 1343|    176|    xmlParserCtxtPtr pctxt = NULL;
 1344|    176|    xmlParserInputPtr inputStream = NULL;
 1345|    176|    int len;
 1346|    176|    int res;
 1347|    176|    const xmlChar *content;
 1348|       |
 1349|       |    /*
 1350|       |     * Handling of references to the local document are done
 1351|       |     * directly through ctxt->doc.
 1352|       |     */
 1353|    176|    if (url[0] == 0) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 170]
  ------------------
 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|    172|    for (i = 0; i < ctxt->txtNr; i++) {
  ------------------
  |  Branch (1362:17): [True: 24, False: 148]
  ------------------
 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|    148|    if (ref->elem != NULL) {
  ------------------
  |  Branch (1374:9): [True: 148, False: 0]
  ------------------
 1375|    148|	encoding = xmlXIncludeGetProp(ctxt, ref->elem, XINCLUDE_PARSE_ENCODING);
  ------------------
  |  |   62|    148|#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
  ------------------
 1376|    148|    }
 1377|    148|    if (encoding != NULL) {
  ------------------
  |  Branch (1377:9): [True: 27, False: 121]
  ------------------
 1378|     27|        xmlParserErrors code;
 1379|       |
 1380|     27|        code = xmlOpenCharEncodingHandler((const char *) encoding,
 1381|     27|                                          /* output */ 0, &handler);
 1382|       |
 1383|     27|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1383:13): [True: 12, False: 15]
  ------------------
 1384|     12|            if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (1384:17): [True: 3, False: 9]
  ------------------
 1385|      3|                xmlXIncludeErrMemory(ctxt);
 1386|      9|            } else if (code == XML_ERR_UNSUPPORTED_ENCODING) {
  ------------------
  |  Branch (1386:24): [True: 9, False: 0]
  ------------------
 1387|      9|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_UNKNOWN_ENCODING,
 1388|      9|                               "encoding %s not supported\n", encoding);
 1389|      9|                goto error;
 1390|      9|            } 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|     12|        }
 1396|     27|    }
 1397|       |
 1398|       |    /*
 1399|       |     * Load it.
 1400|       |     */
 1401|    139|    pctxt = xmlNewParserCtxt();
 1402|    139|    if (pctxt == NULL) {
  ------------------
  |  Branch (1402:9): [True: 2, False: 137]
  ------------------
 1403|      2|        xmlXIncludeErrMemory(ctxt);
 1404|      2|        goto error;
 1405|      2|    }
 1406|    137|    if (ctxt->errorHandler != NULL)
  ------------------
  |  Branch (1406:9): [True: 137, False: 0]
  ------------------
 1407|    137|        xmlCtxtSetErrorHandler(pctxt, ctxt->errorHandler, ctxt->errorCtxt);
 1408|    137|    if (ctxt->resourceLoader != NULL)
  ------------------
  |  Branch (1408:9): [True: 137, False: 0]
  ------------------
 1409|    137|        xmlCtxtSetResourceLoader(pctxt, ctxt->resourceLoader,
 1410|    137|                                 ctxt->resourceCtxt);
 1411|       |
 1412|    137|    xmlCtxtUseOptions(pctxt, ctxt->parseFlags);
 1413|       |
 1414|    137|    inputStream = xmlLoadResource(pctxt, (const char*) url, NULL,
 1415|    137|                                  XML_RESOURCE_XINCLUDE_TEXT);
 1416|    137|    if (inputStream == NULL) {
  ------------------
  |  Branch (1416:9): [True: 23, False: 114]
  ------------------
 1417|       |        /*
 1418|       |         * ENOENT only produces a warning which isn't reflected in errNo.
 1419|       |         */
 1420|     23|        if (pctxt->errNo == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (1420:13): [True: 1, False: 22]
  ------------------
 1421|      1|            xmlXIncludeErrMemory(ctxt);
 1422|     22|        else if ((pctxt->errNo != XML_ERR_OK) &&
  ------------------
  |  Branch (1422:18): [True: 11, False: 11]
  ------------------
 1423|     11|                 (pctxt->errNo != XML_IO_ENOENT) &&
  ------------------
  |  Branch (1423:18): [True: 2, False: 9]
  ------------------
 1424|      2|                 (pctxt->errNo != XML_IO_UNKNOWN) &&
  ------------------
  |  Branch (1424:18): [True: 2, False: 0]
  ------------------
 1425|      2|                 (pctxt->errNo != XML_IO_NETWORK_ATTEMPT))
  ------------------
  |  Branch (1425:18): [True: 2, False: 0]
  ------------------
 1426|      2|            xmlXIncludeErr(ctxt, NULL, pctxt->errNo, "load error", NULL);
 1427|     23|	goto error;
 1428|     23|    }
 1429|    114|    buf = inputStream->buf;
 1430|    114|    if (buf == NULL)
  ------------------
  |  Branch (1430:9): [True: 0, False: 114]
  ------------------
 1431|      0|	goto error;
 1432|    114|    if (buf->encoder)
  ------------------
  |  Branch (1432:9): [True: 0, False: 114]
  ------------------
 1433|      0|	xmlCharEncCloseFunc(buf->encoder);
 1434|    114|    buf->encoder = handler;
 1435|    114|    handler = NULL;
 1436|       |
 1437|    114|    node = xmlNewDocText(ctxt->doc, NULL);
 1438|    114|    if (node == NULL) {
  ------------------
  |  Branch (1438:9): [True: 1, False: 113]
  ------------------
 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|    113|    do {
 1447|    113|        res = xmlParserInputBufferRead(buf, 4096);
 1448|    113|    } while (res > 0);
  ------------------
  |  Branch (1448:14): [True: 0, False: 113]
  ------------------
 1449|    113|    if (res < 0) {
  ------------------
  |  Branch (1449:9): [True: 0, False: 113]
  ------------------
 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|    113|    content = xmlBufContent(buf->buffer);
 1458|    113|    len = xmlBufUse(buf->buffer);
 1459|  26.0k|    for (i = 0; i < len;) {
  ------------------
  |  Branch (1459:17): [True: 26.0k, False: 59]
  ------------------
 1460|  26.0k|        int cur;
 1461|  26.0k|        int l;
 1462|       |
 1463|  26.0k|        l = len - i;
 1464|  26.0k|        cur = xmlGetUTF8Char(&content[i], &l);
 1465|  26.0k|        if ((cur < 0) || (!IS_CHAR(cur))) {
  ------------------
  |  |  115|  25.9k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  25.9k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 25.6k, False: 368]
  |  |  |  |  ------------------
  |  |  |  |  118|  25.9k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  25.6k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 25.6k, False: 15]
  |  |  |  |  |  |  |  Branch (108:44): [True: 794, False: 24.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  25.6k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 662, False: 24.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  25.6k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 24.1k, False: 25]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  25.9k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 368, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 82, False: 286]
  |  |  |  |  ------------------
  |  |  |  |  120|    368|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 286, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 24, False: 262]
  |  |  |  |  ------------------
  |  |  |  |  121|    368|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 260, False: 2]
  |  |  |  |  |  Branch (121:27): [True: 260, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1465:13): [True: 27, False: 25.9k]
  |  Branch (1465:26): [True: 27, False: 25.9k]
  ------------------
 1466|     54|            xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_INVALID_CHAR,
 1467|     54|                           "%s contains invalid char\n", url);
 1468|     54|            goto error;
 1469|     54|        }
 1470|       |
 1471|  25.9k|        i += l;
 1472|  25.9k|    }
 1473|       |
 1474|     59|    if (xmlNodeAddContentLen(node, content, len) < 0)
  ------------------
  |  Branch (1474:9): [True: 1, False: 58]
  ------------------
 1475|      1|        xmlXIncludeErrMemory(ctxt);
 1476|       |
 1477|     59|    if (ctxt->txtNr >= ctxt->txtMax) {
  ------------------
  |  Branch (1477:9): [True: 59, False: 0]
  ------------------
 1478|     59|        xmlXIncludeTxt *tmp;
 1479|     59|        int newSize;
 1480|       |
 1481|     59|        newSize = xmlGrowCapacity(ctxt->txtMax, sizeof(tmp[0]),
 1482|     59|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|     59|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1483|     59|        if (newSize < 0) {
  ------------------
  |  Branch (1483:13): [True: 0, False: 59]
  ------------------
 1484|      0|            xmlXIncludeErrMemory(ctxt);
 1485|      0|	    goto error;
 1486|      0|        }
 1487|     59|        tmp = xmlRealloc(ctxt->txtTab, newSize * sizeof(tmp[0]));
 1488|     59|        if (tmp == NULL) {
  ------------------
  |  Branch (1488:13): [True: 2, False: 57]
  ------------------
 1489|      2|            xmlXIncludeErrMemory(ctxt);
 1490|      2|	    goto error;
 1491|      2|        }
 1492|     57|        ctxt->txtMax = newSize;
 1493|     57|        ctxt->txtTab = tmp;
 1494|     57|    }
 1495|     57|    ctxt->txtTab[ctxt->txtNr].text = xmlStrdup(node->content);
 1496|     57|    if ((node->content != NULL) &&
  ------------------
  |  Branch (1496:9): [True: 37, False: 20]
  ------------------
 1497|     37|        (ctxt->txtTab[ctxt->txtNr].text == NULL)) {
  ------------------
  |  Branch (1497:9): [True: 1, False: 36]
  ------------------
 1498|      1|        xmlXIncludeErrMemory(ctxt);
 1499|      1|        goto error;
 1500|      1|    }
 1501|     56|    ctxt->txtTab[ctxt->txtNr].url = xmlStrdup(url);
 1502|     56|    if (ctxt->txtTab[ctxt->txtNr].url == NULL) {
  ------------------
  |  Branch (1502:9): [True: 1, False: 55]
  ------------------
 1503|      1|        xmlXIncludeErrMemory(ctxt);
 1504|      1|        xmlFree(ctxt->txtTab[ctxt->txtNr].text);
 1505|      1|        goto error;
 1506|      1|    }
 1507|     55|    ctxt->txtNr++;
 1508|       |
 1509|     77|loaded:
 1510|       |    /*
 1511|       |     * Add the element as the replacement copy.
 1512|       |     */
 1513|     77|    ref->inc = node;
 1514|     77|    node = NULL;
 1515|     77|    ret = 0;
 1516|       |
 1517|    176|error:
 1518|    176|    xmlFreeNode(node);
 1519|    176|    xmlFreeInputStream(inputStream);
 1520|    176|    xmlFreeParserCtxt(pctxt);
 1521|    176|    xmlCharEncCloseFunc(handler);
 1522|    176|    xmlFree(encoding);
 1523|    176|    return(ret);
 1524|     77|}
xinclude.c:xmlXIncludeLoadFallback:
 1537|    518|                        xmlXIncludeRefPtr ref) {
 1538|    518|    int ret = 0;
 1539|    518|    int oldNbErrors;
 1540|       |
 1541|    518|    if ((fallback == NULL) || (fallback->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (1541:9): [True: 0, False: 518]
  |  Branch (1541:31): [True: 0, False: 518]
  ------------------
 1542|    518|        (ctxt == NULL))
  ------------------
  |  Branch (1542:9): [True: 0, False: 518]
  ------------------
 1543|      0|	return(-1);
 1544|    518|    if (fallback->children != NULL) {
  ------------------
  |  Branch (1544:9): [True: 480, 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|    480|        oldNbErrors = ctxt->nbErrors;
 1550|    480|	ref->inc = xmlXIncludeCopyNode(ctxt, fallback, 1, ref->base);
 1551|    480|	if (ctxt->nbErrors > oldNbErrors)
  ------------------
  |  Branch (1551:6): [True: 158, False: 322]
  ------------------
 1552|    158|	    ret = -1;
 1553|    480|    } else {
 1554|       |        ref->inc = NULL;
 1555|     38|    }
 1556|    518|    ref->fallback = 1;
 1557|    518|    return(ret);
 1558|    518|}
xinclude.c:xmlXIncludeIncludeNode:
 1697|  18.9k|xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, xmlXIncludeRefPtr ref) {
 1698|  18.9k|    xmlNodePtr cur, end, list, tmp;
 1699|       |
 1700|  18.9k|    if ((ctxt == NULL) || (ref == NULL))
  ------------------
  |  Branch (1700:9): [True: 0, False: 18.9k]
  |  Branch (1700:27): [True: 0, False: 18.9k]
  ------------------
 1701|      0|	return(-1);
 1702|  18.9k|    cur = ref->elem;
 1703|  18.9k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (1703:9): [True: 0, False: 18.9k]
  |  Branch (1703:26): [True: 0, False: 18.9k]
  ------------------
 1704|      0|	return(-1);
 1705|       |
 1706|  18.9k|    list = ref->inc;
 1707|  18.9k|    ref->inc = NULL;
 1708|       |
 1709|       |    /*
 1710|       |     * Check against the risk of generating a multi-rooted document
 1711|       |     */
 1712|  18.9k|    if ((cur->parent != NULL) &&
  ------------------
  |  Branch (1712:9): [True: 18.9k, False: 0]
  ------------------
 1713|  18.9k|	(cur->parent->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1713:2): [True: 9.21k, False: 9.76k]
  ------------------
 1714|  9.21k|	int nb_elem = 0;
 1715|       |
 1716|  9.21k|	tmp = list;
 1717|  13.3k|	while (tmp != NULL) {
  ------------------
  |  Branch (1717:9): [True: 4.13k, False: 9.21k]
  ------------------
 1718|  4.13k|	    if (tmp->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (1718:10): [True: 3.52k, False: 610]
  ------------------
 1719|  3.52k|		nb_elem++;
 1720|  4.13k|	    tmp = tmp->next;
 1721|  4.13k|	}
 1722|  9.21k|        if (nb_elem != 1) {
  ------------------
  |  Branch (1722:13): [True: 6.15k, False: 3.05k]
  ------------------
 1723|  6.15k|            if (nb_elem > 1)
  ------------------
  |  Branch (1723:17): [True: 66, False: 6.09k]
  ------------------
 1724|     66|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1725|     66|                               "XInclude error: would result in multiple root "
 1726|     66|                               "nodes\n", NULL);
 1727|  6.09k|            else
 1728|  6.09k|                xmlXIncludeErr(ctxt, ref->elem, XML_XINCLUDE_MULTIPLE_ROOT,
 1729|  6.09k|                               "XInclude error: would result in no root "
 1730|  6.09k|                               "node\n", NULL);
 1731|  6.15k|            xmlFreeNodeList(list);
 1732|  6.15k|	    return(-1);
 1733|  6.15k|	}
 1734|  9.21k|    }
 1735|       |
 1736|  12.8k|    if (ctxt->parseFlags & XML_PARSE_NOXINCNODE) {
  ------------------
  |  Branch (1736:9): [True: 0, False: 12.8k]
  ------------------
 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|  12.8k|    } else {
 1755|  12.8k|        xmlNodePtr child, next;
 1756|       |
 1757|       |	/*
 1758|       |	 * Change the current node as an XInclude start one, and add an
 1759|       |	 * XInclude end one
 1760|       |	 */
 1761|  12.8k|        if (ref->fallback)
  ------------------
  |  Branch (1761:13): [True: 162, False: 12.6k]
  ------------------
 1762|    162|            xmlUnsetProp(cur, BAD_CAST "href");
  ------------------
  |  |   34|    162|#define BAD_CAST (xmlChar *)
  ------------------
 1763|  12.8k|	cur->type = XML_XINCLUDE_START;
 1764|       |        /* Remove fallback children */
 1765|  23.4k|        for (child = cur->children; child != NULL; child = next) {
  ------------------
  |  Branch (1765:37): [True: 10.6k, False: 12.8k]
  ------------------
 1766|  10.6k|            next = child->next;
 1767|  10.6k|            xmlUnlinkNode(child);
 1768|  10.6k|            xmlFreeNode(child);
 1769|  10.6k|        }
 1770|  12.8k|	end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
 1771|  12.8k|	if (end == NULL)
  ------------------
  |  Branch (1771:6): [True: 40, False: 12.7k]
  ------------------
 1772|     40|            goto err_memory;
 1773|  12.7k|	end->type = XML_XINCLUDE_END;
 1774|  12.7k|	if (xmlAddNextSibling(cur, end) == NULL) {
  ------------------
  |  Branch (1774:6): [True: 0, False: 12.7k]
  ------------------
 1775|      0|            xmlFreeNode(end);
 1776|      0|            goto err_memory;
 1777|      0|        }
 1778|       |
 1779|       |	/*
 1780|       |	 * Add the list of nodes
 1781|       |	 */
 1782|   247k|	while (list != NULL) {
  ------------------
  |  Branch (1782:9): [True: 234k, False: 12.7k]
  ------------------
 1783|   234k|	    cur = list;
 1784|   234k|	    list = list->next;
 1785|       |
 1786|   234k|	    if (xmlAddPrevSibling(end, cur) == NULL) {
  ------------------
  |  Branch (1786:10): [True: 0, False: 234k]
  ------------------
 1787|      0|                xmlUnlinkNode(cur);
 1788|      0|                xmlFreeNode(cur);
 1789|      0|                goto err_memory;
 1790|      0|            }
 1791|   234k|	}
 1792|  12.7k|    }
 1793|       |
 1794|       |
 1795|  12.7k|    return(0);
 1796|       |
 1797|     40|err_memory:
 1798|     40|    xmlXIncludeErrMemory(ctxt);
 1799|     40|    xmlFreeNodeList(list);
 1800|     40|    return(-1);
 1801|  12.8k|}

xmlSerializeText:
  306|  1.87M|                 unsigned flags) {
  307|  1.87M|    const xmlChar *cur;
  308|  1.87M|    const signed char *tab;
  309|       |
  310|  1.87M|    if (string == NULL)
  ------------------
  |  Branch (310:9): [True: 0, False: 1.87M]
  ------------------
  311|      0|        return;
  312|       |
  313|  1.87M|#ifdef LIBXML_HTML_ENABLED
  314|  1.87M|    if (flags & XML_ESCAPE_HTML) {
  ------------------
  |  |   24|  1.87M|#define XML_ESCAPE_HTML             (1u << 2)
  ------------------
  |  Branch (314:9): [True: 0, False: 1.87M]
  ------------------
  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.87M|    else
  321|  1.87M|#endif
  322|  1.87M|    {
  323|  1.87M|        if (flags & XML_ESCAPE_QUOT)
  ------------------
  |  |   25|  1.87M|#define XML_ESCAPE_QUOT             (1u << 3)
  ------------------
  |  Branch (323:13): [True: 0, False: 1.87M]
  ------------------
  324|      0|            tab = xmlEscapeTabQuot;
  325|  1.87M|        else if (flags & XML_ESCAPE_ATTR)
  ------------------
  |  |   22|  1.87M|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  |  Branch (325:18): [True: 967k, False: 903k]
  ------------------
  326|   967k|            tab = xmlEscapeTabAttr;
  327|   903k|        else
  328|   903k|            tab = xmlEscapeTab;
  329|  1.87M|    }
  330|       |
  331|  1.87M|    cur = string;
  332|       |
  333|  5.63M|    while (1) {
  ------------------
  |  Branch (333:12): [True: 5.63M, Folded]
  ------------------
  334|  5.63M|        const xmlChar *base;
  335|  5.63M|        int c;
  336|  5.63M|        int offset;
  337|       |
  338|  5.63M|        base = cur;
  339|  5.63M|        offset = -1;
  340|       |
  341|   138M|        while (1) {
  ------------------
  |  Branch (341:16): [True: 138M, Folded]
  ------------------
  342|   138M|            if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (342:17): [True: 0, False: 138M]
  ------------------
  343|      0|                break;
  344|       |
  345|   138M|            c = (unsigned char) *cur;
  346|       |
  347|   138M|            if (c < 0x80) {
  ------------------
  |  Branch (347:17): [True: 135M, False: 2.94M]
  ------------------
  348|   135M|                offset = tab[c];
  349|   135M|                if (offset >= 0)
  ------------------
  |  Branch (349:21): [True: 5.63M, False: 129M]
  ------------------
  350|  5.63M|                    break;
  351|   135M|            } else if (flags & XML_ESCAPE_NON_ASCII) {
  ------------------
  |  |   23|  2.94M|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  |  Branch (351:24): [True: 0, False: 2.94M]
  ------------------
  352|      0|                break;
  353|      0|            }
  354|       |
  355|   132M|            cur += 1;
  356|   132M|        }
  357|       |
  358|  5.63M|        if (cur > base)
  ------------------
  |  Branch (358:13): [True: 2.18M, False: 3.45M]
  ------------------
  359|  2.18M|            xmlOutputBufferWrite(buf, cur - base, (char *) base);
  360|       |
  361|  5.63M|        if ((size_t) (cur - string) >= maxSize)
  ------------------
  |  Branch (361:13): [True: 0, False: 5.63M]
  ------------------
  362|      0|            break;
  363|       |
  364|  5.63M|        if (offset >= 0) {
  ------------------
  |  Branch (364:13): [True: 5.63M, False: 0]
  ------------------
  365|  5.63M|            if (c == 0)
  ------------------
  |  Branch (365:17): [True: 1.87M, False: 3.76M]
  ------------------
  366|  1.87M|                break;
  367|       |
  368|  3.76M|            xmlOutputBufferWrite(buf, xmlEscapeContent[offset],
  369|  3.76M|                                 &xmlEscapeContent[offset+1]);
  370|  3.76M|            cur += 1;
  371|  3.76M|        } 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|  5.63M|    }
  390|  1.87M|}
xmlAllocParserInputBuffer:
 1332|  40.8k|xmlAllocParserInputBuffer(xmlCharEncoding enc) {
 1333|  40.8k|    xmlParserInputBufferPtr ret;
 1334|       |
 1335|  40.8k|    ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
 1336|  40.8k|    if (ret == NULL) {
  ------------------
  |  Branch (1336:9): [True: 5, False: 40.8k]
  ------------------
 1337|      5|	return(NULL);
 1338|      5|    }
 1339|  40.8k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 1340|  40.8k|    ret->buffer = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  40.8k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1341|  40.8k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1341:9): [True: 2, False: 40.8k]
  ------------------
 1342|      2|        xmlFree(ret);
 1343|      2|	return(NULL);
 1344|      2|    }
 1345|  40.8k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1345:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|    if (ret->encoder != NULL)
  ------------------
  |  Branch (1352:9): [True: 0, False: 40.8k]
  ------------------
 1353|      0|        ret->raw = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|      0|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1354|  40.8k|    else
 1355|  40.8k|        ret->raw = NULL;
 1356|  40.8k|    ret->readcallback = NULL;
 1357|  40.8k|    ret->closecallback = NULL;
 1358|  40.8k|    ret->context = NULL;
 1359|  40.8k|    ret->compressed = -1;
 1360|  40.8k|    ret->rawconsumed = 0;
 1361|       |
 1362|  40.8k|    return(ret);
 1363|  40.8k|}
xmlAllocOutputBuffer:
 1375|  37.2k|xmlAllocOutputBuffer(xmlCharEncodingHandler *encoder) {
 1376|  37.2k|    xmlOutputBufferPtr ret;
 1377|       |
 1378|  37.2k|    ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
 1379|  37.2k|    if (ret == NULL) {
  ------------------
  |  Branch (1379:9): [True: 28, False: 37.1k]
  ------------------
 1380|     28|	return(NULL);
 1381|     28|    }
 1382|  37.1k|    memset(ret, 0, sizeof(xmlOutputBuffer));
 1383|  37.1k|    ret->buffer = xmlBufCreate(MINLEN);
  ------------------
  |  |   52|  37.1k|#define MINLEN 4000
  ------------------
 1384|  37.1k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (1384:9): [True: 81, False: 37.1k]
  ------------------
 1385|     81|        xmlFree(ret);
 1386|     81|	return(NULL);
 1387|     81|    }
 1388|       |
 1389|  37.1k|    ret->encoder = encoder;
 1390|  37.1k|    if (encoder != NULL) {
  ------------------
  |  Branch (1390:9): [True: 0, False: 37.1k]
  ------------------
 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|  37.1k|        ret->conv = NULL;
 1404|  37.1k|    ret->writecallback = NULL;
 1405|  37.1k|    ret->closecallback = NULL;
 1406|  37.1k|    ret->context = NULL;
 1407|  37.1k|    ret->written = 0;
 1408|       |
 1409|  37.1k|    return(ret);
 1410|  37.1k|}
xmlFreeParserInputBuffer:
 1419|   386k|xmlFreeParserInputBuffer(xmlParserInputBuffer *in) {
 1420|   386k|    if (in == NULL) return;
  ------------------
  |  Branch (1420:9): [True: 2.73k, False: 384k]
  ------------------
 1421|       |
 1422|   384k|    if (in->raw) {
  ------------------
  |  Branch (1422:9): [True: 14.7k, False: 369k]
  ------------------
 1423|  14.7k|        xmlBufFree(in->raw);
 1424|  14.7k|	in->raw = NULL;
 1425|  14.7k|    }
 1426|   384k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1426:9): [True: 14.7k, False: 369k]
  ------------------
 1427|  14.7k|        xmlCharEncCloseFunc(in->encoder);
 1428|  14.7k|    }
 1429|   384k|    if (in->closecallback != NULL) {
  ------------------
  |  Branch (1429:9): [True: 0, False: 384k]
  ------------------
 1430|      0|	in->closecallback(in->context);
 1431|      0|    }
 1432|   384k|    if (in->buffer != NULL) {
  ------------------
  |  Branch (1432:9): [True: 384k, False: 0]
  ------------------
 1433|   384k|        xmlBufFree(in->buffer);
 1434|   384k|	in->buffer = NULL;
 1435|   384k|    }
 1436|       |
 1437|   384k|    xmlFree(in);
 1438|   384k|}
xmlOutputBufferClose:
 1451|  37.1k|{
 1452|  37.1k|    int ret;
 1453|       |
 1454|  37.1k|    if (out == NULL)
  ------------------
  |  Branch (1454:9): [True: 0, False: 37.1k]
  ------------------
 1455|      0|        return (-1);
 1456|       |
 1457|  37.1k|    if (out->writecallback != NULL)
  ------------------
  |  Branch (1457:9): [True: 0, False: 37.1k]
  ------------------
 1458|      0|        xmlOutputBufferFlush(out);
 1459|       |
 1460|  37.1k|    if (out->closecallback != NULL) {
  ------------------
  |  Branch (1460:9): [True: 0, False: 37.1k]
  ------------------
 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|  37.1k|    if (out->error != XML_ERR_OK)
  ------------------
  |  Branch (1472:9): [True: 23, False: 37.0k]
  ------------------
 1473|     23|        ret = -out->error;
 1474|  37.0k|    else
 1475|  37.0k|        ret = out->written;
 1476|       |
 1477|  37.1k|    if (out->conv) {
  ------------------
  |  Branch (1477:9): [True: 0, False: 37.1k]
  ------------------
 1478|      0|        xmlBufFree(out->conv);
 1479|      0|        out->conv = NULL;
 1480|      0|    }
 1481|  37.1k|    if (out->encoder != NULL) {
  ------------------
  |  Branch (1481:9): [True: 0, False: 37.1k]
  ------------------
 1482|      0|        xmlCharEncCloseFunc(out->encoder);
 1483|      0|    }
 1484|  37.1k|    if (out->buffer != NULL) {
  ------------------
  |  Branch (1484:9): [True: 37.1k, False: 0]
  ------------------
 1485|  37.1k|        xmlBufFree(out->buffer);
 1486|  37.1k|        out->buffer = NULL;
 1487|  37.1k|    }
 1488|       |
 1489|  37.1k|    xmlFree(out);
 1490|       |
 1491|  37.1k|    return(ret);
 1492|  37.1k|}
xmlNewInputBufferMemory:
 1940|   331k|                        xmlParserInputFlags flags, xmlCharEncoding enc) {
 1941|   331k|    xmlParserInputBufferPtr ret;
 1942|       |
 1943|   331k|    if ((flags & XML_INPUT_BUF_STATIC) &&
  ------------------
  |  Branch (1943:9): [True: 290k, False: 40.8k]
  ------------------
 1944|   290k|        ((flags & XML_INPUT_BUF_ZERO_TERMINATED) == 0)) {
  ------------------
  |  Branch (1944:9): [True: 0, False: 290k]
  ------------------
 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|   331k|    } else {
 1968|   331k|        ret = xmlMalloc(sizeof(*ret));
 1969|   331k|        if (ret == NULL)
  ------------------
  |  Branch (1969:13): [True: 18, False: 331k]
  ------------------
 1970|     18|            return(NULL);
 1971|   331k|        memset(ret, 0, sizeof(xmlParserInputBuffer));
 1972|   331k|        ret->compressed = -1;
 1973|       |
 1974|   331k|        ret->buffer = xmlBufCreateMem((const xmlChar *) mem, size,
 1975|   331k|                                      (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (1975:40): [True: 290k, False: 40.8k]
  ------------------
 1976|   331k|        if (ret->buffer == NULL) {
  ------------------
  |  Branch (1976:13): [True: 17, False: 331k]
  ------------------
 1977|     17|            xmlFree(ret);
 1978|     17|            return(NULL);
 1979|     17|        }
 1980|   331k|    }
 1981|       |
 1982|   331k|    return(ret);
 1983|   331k|}
xmlParserInputBufferCreateMem:
 2005|  40.8k|xmlParserInputBufferCreateMem(const char *mem, int size, xmlCharEncoding enc) {
 2006|  40.8k|    if ((mem == NULL) || (size < 0))
  ------------------
  |  Branch (2006:9): [True: 0, False: 40.8k]
  |  Branch (2006:26): [True: 0, False: 40.8k]
  ------------------
 2007|      0|        return(NULL);
 2008|       |
 2009|  40.8k|    return(xmlNewInputBufferMemory(mem, size, 0, enc));
 2010|  40.8k|}
xmlNewInputBufferString:
 2049|  11.6k|xmlNewInputBufferString(const char *str, xmlParserInputFlags flags) {
 2050|  11.6k|    xmlParserInputBufferPtr ret;
 2051|       |
 2052|  11.6k|    ret = xmlMalloc(sizeof(*ret));
 2053|  11.6k|    if (ret == NULL)
  ------------------
  |  Branch (2053:9): [True: 1, False: 11.6k]
  ------------------
 2054|      1|	return(NULL);
 2055|  11.6k|    memset(ret, 0, sizeof(xmlParserInputBuffer));
 2056|  11.6k|    ret->compressed = -1;
 2057|       |
 2058|  11.6k|    ret->buffer = xmlBufCreateMem((const xmlChar *) str, strlen(str),
 2059|  11.6k|                                  (flags & XML_INPUT_BUF_STATIC ? 1 : 0));
  ------------------
  |  Branch (2059:36): [True: 11.6k, False: 0]
  ------------------
 2060|  11.6k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2060:9): [True: 5, False: 11.6k]
  ------------------
 2061|      5|        xmlFree(ret);
 2062|      5|	return(NULL);
 2063|      5|    }
 2064|       |
 2065|  11.6k|    return(ret);
 2066|  11.6k|}
xmlParserInputBufferPush:
 2231|   490k|	                 int len, const char *buf) {
 2232|   490k|    size_t nbchars = 0;
 2233|   490k|    int ret;
 2234|       |
 2235|   490k|    if (len < 0) return(0);
  ------------------
  |  Branch (2235:9): [True: 0, False: 490k]
  ------------------
 2236|   490k|    if ((in == NULL) || (in->error)) return(-1);
  ------------------
  |  Branch (2236:9): [True: 0, False: 490k]
  |  Branch (2236:25): [True: 213, False: 489k]
  ------------------
 2237|   489k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2237:9): [True: 28.7k, False: 461k]
  ------------------
 2238|       |        /*
 2239|       |	 * Store the data in the incoming raw buffer
 2240|       |	 */
 2241|  28.7k|        if (in->raw == NULL) {
  ------------------
  |  Branch (2241:13): [True: 0, False: 28.7k]
  ------------------
 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|  28.7k|	ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
 2249|  28.7k|	if (ret != 0) {
  ------------------
  |  Branch (2249:6): [True: 0, False: 28.7k]
  ------------------
 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|  28.7k|        nbchars = SIZE_MAX;
 2258|  28.7k|	if (xmlCharEncInput(in, &nbchars, /* flush */ 0) !=
  ------------------
  |  Branch (2258:6): [True: 13, False: 28.7k]
  ------------------
 2259|  28.7k|            XML_ENC_ERR_SUCCESS)
 2260|     13|            return(-1);
 2261|  28.7k|        if (nbchars > INT_MAX)
  ------------------
  |  Branch (2261:13): [True: 0, False: 28.7k]
  ------------------
 2262|      0|            nbchars = INT_MAX;
 2263|   461k|    } else {
 2264|   461k|	nbchars = len;
 2265|   461k|        ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
 2266|   461k|	if (ret != 0) {
  ------------------
  |  Branch (2266:6): [True: 1, False: 461k]
  ------------------
 2267|      1|            in->error = XML_ERR_NO_MEMORY;
 2268|      1|	    return(-1);
 2269|      1|        }
 2270|   461k|    }
 2271|   489k|    return(nbchars);
 2272|   489k|}
xmlParserInputBufferGrow:
 2298|   605k|xmlParserInputBufferGrow(xmlParserInputBuffer *in, int len) {
 2299|   605k|    int res = 0;
 2300|       |
 2301|   605k|    if ((in == NULL) || (in->error))
  ------------------
  |  Branch (2301:9): [True: 0, False: 605k]
  |  Branch (2301:25): [True: 746, False: 604k]
  ------------------
 2302|    746|        return(-1);
 2303|       |
 2304|   604k|    if (len < MINLEN)
  ------------------
  |  |   52|   604k|#define MINLEN 4000
  ------------------
  |  Branch (2304:9): [True: 367k, False: 236k]
  ------------------
 2305|   367k|        len = MINLEN;
  ------------------
  |  |   52|   367k|#define MINLEN 4000
  ------------------
 2306|       |
 2307|       |    /*
 2308|       |     * Call the read method for this I/O type.
 2309|       |     */
 2310|   604k|    if (in->readcallback != NULL) {
  ------------------
  |  Branch (2310:9): [True: 0, False: 604k]
  ------------------
 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|   604k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (2355:9): [True: 373k, False: 231k]
  ------------------
 2356|   373k|        size_t sizeOut;
 2357|       |
 2358|       |        /*
 2359|       |         * Don't convert whole buffer when reading from memory.
 2360|       |         */
 2361|   373k|        if (in->readcallback == NULL)
  ------------------
  |  Branch (2361:13): [True: 373k, False: 0]
  ------------------
 2362|   373k|            sizeOut = len;
 2363|      0|        else
 2364|      0|            sizeOut = SIZE_MAX;
 2365|       |
 2366|   373k|	if (xmlCharEncInput(in, &sizeOut, /* flush */ 0) !=
  ------------------
  |  Branch (2366:6): [True: 613, False: 372k]
  ------------------
 2367|   373k|            XML_ENC_ERR_SUCCESS)
 2368|    613|	    return(-1);
 2369|   372k|        res = sizeOut;
 2370|   372k|    }
 2371|   603k|    return(res);
 2372|   604k|}
xmlParserInputBufferRead:
 2385|  73.0k|xmlParserInputBufferRead(xmlParserInputBuffer *in, int len) {
 2386|  73.0k|    return(xmlParserInputBufferGrow(in, len));
 2387|  73.0k|}
xmlOutputBufferWrite:
 2403|  21.9M|xmlOutputBufferWrite(xmlOutputBuffer *out, int len, const char *data) {
 2404|  21.9M|    xmlBufPtr buf = NULL;
 2405|  21.9M|    size_t written = 0;
 2406|  21.9M|    int ret;
 2407|       |
 2408|  21.9M|    if ((out == NULL) || (out->error))
  ------------------
  |  Branch (2408:9): [True: 0, False: 21.9M]
  |  Branch (2408:26): [True: 7.79k, False: 21.9M]
  ------------------
 2409|  7.79k|        return(-1);
 2410|  21.9M|    if (len < 0)
  ------------------
  |  Branch (2410:9): [True: 0, False: 21.9M]
  ------------------
 2411|      0|        return(0);
 2412|       |
 2413|  21.9M|    ret = xmlBufAdd(out->buffer, (const xmlChar *) data, len);
 2414|  21.9M|    if (ret != 0) {
  ------------------
  |  Branch (2414:9): [True: 23, False: 21.9M]
  ------------------
 2415|     23|        out->error = XML_ERR_NO_MEMORY;
 2416|     23|        return(-1);
 2417|     23|    }
 2418|       |
 2419|       |    /*
 2420|       |     * first handle encoding stuff.
 2421|       |     */
 2422|  21.9M|    if (out->encoder != NULL) {
  ------------------
  |  Branch (2422:9): [True: 0, False: 21.9M]
  ------------------
 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|  21.9M|    } else {
 2450|  21.9M|        if (out->writecallback)
  ------------------
  |  Branch (2450:13): [True: 0, False: 21.9M]
  ------------------
 2451|      0|            buf = out->buffer;
 2452|  21.9M|        else
 2453|  21.9M|            written = len;
 2454|  21.9M|    }
 2455|       |
 2456|  21.9M|    if ((buf != NULL) && (out->writecallback)) {
  ------------------
  |  Branch (2456:9): [True: 0, False: 21.9M]
  |  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|  21.9M|    return(written <= INT_MAX ? written : INT_MAX);
  ------------------
  |  Branch (2491:12): [True: 21.9M, False: 0]
  ------------------
 2492|  21.9M|}
xmlOutputBufferWriteString:
 2580|  4.70M|xmlOutputBufferWriteString(xmlOutputBuffer *out, const char *str) {
 2581|  4.70M|    int len;
 2582|       |
 2583|  4.70M|    if ((out == NULL) || (out->error)) return(-1);
  ------------------
  |  Branch (2583:9): [True: 0, False: 4.70M]
  |  Branch (2583:26): [True: 1.14k, False: 4.70M]
  ------------------
 2584|  4.70M|    if (str == NULL)
  ------------------
  |  Branch (2584:9): [True: 0, False: 4.70M]
  ------------------
 2585|      0|        return(-1);
 2586|  4.70M|    len = strlen(str);
 2587|       |
 2588|  4.70M|    if (len > 0)
  ------------------
  |  Branch (2588:9): [True: 4.70M, False: 3.79k]
  ------------------
 2589|  4.70M|	return(xmlOutputBufferWrite(out, len, str));
 2590|  3.79k|    return(len);
 2591|  4.70M|}
xmlOutputBufferWriteQuotedString:
 2609|  8.08k|                                 const xmlChar *string) {
 2610|  8.08k|    const xmlChar *cur, *base;
 2611|       |
 2612|  8.08k|    if ((buf == NULL) || (buf->error))
  ------------------
  |  Branch (2612:9): [True: 0, False: 8.08k]
  |  Branch (2612:26): [True: 0, False: 8.08k]
  ------------------
 2613|      0|        return;
 2614|       |
 2615|  8.08k|    if (xmlStrchr(string, '\"')) {
  ------------------
  |  Branch (2615:9): [True: 76, False: 8.01k]
  ------------------
 2616|     76|        if (xmlStrchr(string, '\'')) {
  ------------------
  |  Branch (2616:13): [True: 0, False: 76]
  ------------------
 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|     76|        else{
 2637|     76|	    xmlOutputBufferWrite(buf, 1, "'");
 2638|     76|            xmlOutputBufferWriteString(buf, (const char *) string);
 2639|     76|	    xmlOutputBufferWrite(buf, 1, "'");
 2640|     76|        }
 2641|  8.01k|    } else {
 2642|  8.01k|        xmlOutputBufferWrite(buf, 1, "\"");
 2643|  8.01k|        xmlOutputBufferWriteString(buf, (const char *) string);
 2644|  8.01k|        xmlOutputBufferWrite(buf, 1, "\"");
 2645|  8.01k|    }
 2646|  8.08k|}
xmlParserGetDirectory:
 2720|   173k|xmlParserGetDirectory(const char *filename) {
 2721|   173k|    char *ret = NULL;
 2722|   173k|    char dir[1024];
 2723|   173k|    char *cur;
 2724|       |
 2725|   173k|    if (filename == NULL) return(NULL);
  ------------------
  |  Branch (2725:9): [True: 0, False: 173k]
  ------------------
 2726|       |
 2727|       |#if defined(LIBXML_WINPATH_ENABLED)
 2728|       |#   define IS_XMLPGD_SEP(ch) ((ch=='/')||(ch=='\\'))
 2729|       |#else
 2730|   173k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
 2731|   173k|#endif
 2732|       |
 2733|   173k|    strncpy(dir, filename, 1023);
 2734|   173k|    dir[1023] = 0;
 2735|   173k|    cur = &dir[strlen(dir)];
 2736|  1.23M|    while (cur > dir) {
  ------------------
  |  Branch (2736:12): [True: 1.07M, False: 163k]
  ------------------
 2737|  1.07M|         if (IS_XMLPGD_SEP(*cur)) break;
  ------------------
  |  | 2730|  1.07M|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 9.36k, False: 1.06M]
  |  |  ------------------
  ------------------
 2738|  1.06M|	 cur --;
 2739|  1.06M|    }
 2740|   173k|    if (IS_XMLPGD_SEP(*cur)) {
  ------------------
  |  | 2730|   173k|#   define IS_XMLPGD_SEP(ch) (ch=='/')
  |  |  ------------------
  |  |  |  Branch (2730:30): [True: 9.49k, False: 163k]
  |  |  ------------------
  ------------------
 2741|  9.49k|        if (cur == dir) dir[1] = 0;
  ------------------
  |  Branch (2741:13): [True: 131, False: 9.36k]
  ------------------
 2742|  9.36k|	else *cur = 0;
 2743|  9.49k|	ret = xmlMemStrdup(dir);
 2744|   163k|    } else {
 2745|   163k|        ret = xmlMemStrdup(".");
 2746|   163k|    }
 2747|   173k|    return(ret);
 2748|   173k|#undef IS_XMLPGD_SEP
 2749|   173k|}
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|  7.28M|xmlTextReaderRead(xmlTextReader *reader) {
 1201|  7.28M|    int val, olddepth = 0;
 1202|  7.28M|    xmlTextReaderState oldstate = XML_TEXTREADER_START;
 1203|  7.28M|    xmlNodePtr oldnode = NULL;
 1204|       |
 1205|  7.28M|    if (reader == NULL)
  ------------------
  |  Branch (1205:9): [True: 0, False: 7.28M]
  ------------------
 1206|      0|	return(-1);
 1207|  7.28M|    if (reader->state == XML_TEXTREADER_ERROR)
  ------------------
  |  Branch (1207:9): [True: 161k, False: 7.12M]
  ------------------
 1208|   161k|        return(-1);
 1209|       |
 1210|  7.12M|    reader->curnode = NULL;
 1211|  7.12M|    if (reader->doc != NULL)
  ------------------
  |  Branch (1211:9): [True: 0, False: 7.12M]
  ------------------
 1212|      0|        return(xmlTextReaderReadTree(reader));
 1213|  7.12M|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1213:9): [True: 0, False: 7.12M]
  ------------------
 1214|      0|	return(-1);
 1215|       |
 1216|  7.12M|    if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
  ------------------
  |  Branch (1216:9): [True: 40.2k, False: 7.08M]
  ------------------
 1217|  40.2k|	reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
 1218|       |	/*
 1219|       |	 * Initial state
 1220|       |	 */
 1221|  57.3k|	do {
 1222|  57.3k|	    val = xmlTextReaderPushData(reader);
 1223|  57.3k|            if (val < 0) {
  ------------------
  |  Branch (1223:17): [True: 19.2k, False: 38.1k]
  ------------------
 1224|  19.2k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1225|  19.2k|                reader->state = XML_TEXTREADER_ERROR;
 1226|  19.2k|                return(-1);
 1227|  19.2k|            }
 1228|  57.3k|	} while ((reader->ctxt->node == NULL) &&
  ------------------
  |  Branch (1228:11): [True: 21.8k, False: 16.2k]
  ------------------
 1229|  21.8k|		 ((reader->mode != XML_TEXTREADER_MODE_EOF) &&
  ------------------
  |  Branch (1229:5): [True: 17.0k, False: 4.82k]
  ------------------
 1230|  17.0k|		  (reader->state != XML_TEXTREADER_DONE)));
  ------------------
  |  Branch (1230:5): [True: 17.0k, False: 0]
  ------------------
 1231|  21.0k|	if (reader->ctxt->node == NULL) {
  ------------------
  |  Branch (1231:6): [True: 4.82k, False: 16.2k]
  ------------------
 1232|  4.82k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1232:10): [True: 4.82k, False: 0]
  ------------------
 1233|  4.82k|		reader->node = reader->ctxt->myDoc->children;
 1234|  4.82k|	    }
 1235|  4.82k|	    if (reader->node == NULL) {
  ------------------
  |  Branch (1235:10): [True: 0, False: 4.82k]
  ------------------
 1236|      0|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1237|      0|                reader->state = XML_TEXTREADER_ERROR;
 1238|      0|		return(-1);
 1239|      0|	    }
 1240|  4.82k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1241|  16.2k|	} else {
 1242|  16.2k|	    if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (1242:10): [True: 16.2k, False: 0]
  ------------------
 1243|  16.2k|		reader->node = reader->ctxt->myDoc->children;
 1244|  16.2k|	    }
 1245|  16.2k|	    if (reader->node == NULL)
  ------------------
  |  Branch (1245:10): [True: 0, False: 16.2k]
  ------------------
 1246|      0|		reader->node = reader->ctxt->nodeTab[0];
 1247|  16.2k|	    reader->state = XML_TEXTREADER_ELEMENT;
 1248|  16.2k|	}
 1249|  21.0k|	reader->depth = 0;
 1250|  21.0k|	reader->ctxt->parseMode = XML_PARSE_READER;
 1251|  21.0k|	goto node_found;
 1252|  21.0k|    }
 1253|  7.08M|    oldstate = reader->state;
 1254|  7.08M|    olddepth = reader->ctxt->nodeNr;
 1255|  7.08M|    oldnode = reader->node;
 1256|       |
 1257|  7.50M|get_next_node:
 1258|  7.50M|    if (reader->node == NULL) {
  ------------------
  |  Branch (1258:9): [True: 9.07k, False: 7.49M]
  ------------------
 1259|  9.07k|	if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1259:6): [True: 8.98k, False: 93]
  ------------------
 1260|  8.98k|	    return(0);
 1261|  8.98k|        } else {
 1262|     93|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1263|     93|            reader->state = XML_TEXTREADER_ERROR;
 1264|     93|	    return(-1);
 1265|     93|        }
 1266|  9.07k|    }
 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|  7.50M|    while ((reader->node != NULL) && (reader->node->next == NULL) &&
  ------------------
  |  Branch (1273:12): [True: 7.50M, False: 0]
  |  Branch (1273:38): [True: 3.26M, False: 4.23M]
  ------------------
 1274|  3.26M|	   (reader->ctxt->nodeNr == olddepth) &&
  ------------------
  |  Branch (1274:5): [True: 3.26M, False: 1.25k]
  ------------------
 1275|  3.26M|           ((oldstate == XML_TEXTREADER_BACKTRACK) ||
  ------------------
  |  Branch (1275:13): [True: 378k, False: 2.88M]
  ------------------
 1276|  2.88M|            (reader->node->children == NULL) ||
  ------------------
  |  Branch (1276:13): [True: 401k, False: 2.48M]
  ------------------
 1277|  2.48M|	    (reader->node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (1277:6): [True: 617, False: 2.48M]
  ------------------
 1278|  2.48M|	    ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1278:7): [True: 2.48M, False: 0]
  ------------------
 1279|  2.48M|	     (reader->node->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (1279:7): [True: 84.8k, False: 2.40M]
  ------------------
 1280|  84.8k|	     (reader->node->children->next == NULL)) ||
  ------------------
  |  Branch (1280:7): [True: 5.48k, False: 79.3k]
  ------------------
 1281|  2.48M|	    (reader->node->type == XML_DTD_NODE) ||
  ------------------
  |  Branch (1281:6): [True: 0, False: 2.48M]
  ------------------
 1282|  2.48M|	    (reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1282:6): [True: 0, False: 2.48M]
  ------------------
 1283|  2.48M|	    (reader->node->type == XML_HTML_DOCUMENT_NODE)) &&
  ------------------
  |  Branch (1283:6): [True: 0, False: 2.48M]
  ------------------
 1284|   786k|	   ((reader->ctxt->node == NULL) ||
  ------------------
  |  Branch (1284:6): [True: 7.55k, False: 779k]
  ------------------
 1285|   779k|	    (reader->ctxt->node == reader->node) ||
  ------------------
  |  Branch (1285:6): [True: 7.61k, False: 771k]
  ------------------
 1286|   771k|	    (reader->ctxt->node == reader->node->parent)) &&
  ------------------
  |  Branch (1286:6): [True: 2.04k, False: 769k]
  ------------------
 1287|  17.2k|	   (reader->ctxt->instate != XML_PARSER_EOF) &&
  ------------------
  |  Branch (1287:5): [True: 8.38k, False: 8.83k]
  ------------------
 1288|  8.38k|	   (PARSER_STOPPED(reader->ctxt) == 0)) {
  ------------------
  |  |   44|  8.38k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (1288:5): [True: 8.38k, False: 0]
  ------------------
 1289|  8.38k|	val = xmlTextReaderPushData(reader);
 1290|  8.38k|	if (val < 0) {
  ------------------
  |  Branch (1290:6): [True: 4.49k, False: 3.89k]
  ------------------
 1291|  4.49k|            reader->mode = XML_TEXTREADER_MODE_ERROR;
 1292|  4.49k|            reader->state = XML_TEXTREADER_ERROR;
 1293|  4.49k|	    return(-1);
 1294|  4.49k|        }
 1295|  3.89k|	if (reader->node == NULL)
  ------------------
  |  Branch (1295:6): [True: 0, False: 3.89k]
  ------------------
 1296|      0|	    goto node_end;
 1297|  3.89k|    }
 1298|  7.49M|    if (oldstate != XML_TEXTREADER_BACKTRACK) {
  ------------------
  |  Branch (1298:9): [True: 6.43M, False: 1.06M]
  ------------------
 1299|  6.43M|	if ((reader->node->children != NULL) &&
  ------------------
  |  Branch (1299:6): [True: 5.01M, False: 1.41M]
  ------------------
 1300|  5.01M|	    (reader->node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1300:6): [True: 5.01M, False: 2.56k]
  ------------------
 1301|  5.01M|	    (reader->node->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1301:6): [True: 5.01M, False: 0]
  ------------------
 1302|  5.01M|	    (reader->node->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1302:6): [True: 5.01M, False: 2.98k]
  ------------------
 1303|  5.01M|	    reader->node = reader->node->children;
 1304|  5.01M|	    reader->depth++;
 1305|  5.01M|	    reader->state = XML_TEXTREADER_ELEMENT;
 1306|  5.01M|	    goto node_found;
 1307|  5.01M|	}
 1308|  6.43M|    }
 1309|  2.48M|    if (reader->node->next != NULL) {
  ------------------
  |  Branch (1309:9): [True: 1.70M, False: 775k]
  ------------------
 1310|  1.70M|	if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1310:6): [True: 1.00M, False: 697k]
  ------------------
 1311|  1.00M|            (reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1311:13): [True: 235k, False: 774k]
  ------------------
 1312|   235k|	    (reader->node->children == NULL) &&
  ------------------
  |  Branch (1312:6): [True: 235k, False: 0]
  ------------------
 1313|   235k|	    ((reader->node->extra & NODE_IS_EMPTY) == 0)
  ------------------
  |  |  169|   235k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1313:6): [True: 145k, False: 89.3k]
  ------------------
 1314|   145k|#ifdef LIBXML_XINCLUDE_ENABLED
 1315|   145k|	    && (reader->in_xinclude <= 0)
  ------------------
  |  Branch (1315:9): [True: 13.9k, False: 131k]
  ------------------
 1316|  1.70M|#endif
 1317|  1.70M|	    ) {
 1318|  13.9k|	    reader->state = XML_TEXTREADER_END;
 1319|  13.9k|	    goto node_found;
 1320|  13.9k|	}
 1321|  1.69M|#ifdef LIBXML_REGEXP_ENABLED
 1322|  1.69M|	if ((reader->validate) &&
  ------------------
  |  Branch (1322:6): [True: 1.15M, False: 536k]
  ------------------
 1323|  1.15M|	    (reader->node->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (1323:6): [True: 468k, False: 687k]
  ------------------
 1324|   468k|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1324:10): [True: 1, False: 468k]
  ------------------
 1325|      1|                return(-1);
 1326|  1.69M|#endif /* LIBXML_REGEXP_ENABLED */
 1327|  1.69M|        if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1327:13): [True: 1.21M, False: 473k]
  ------------------
 1328|  1.21M|	    (reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|  1.21M|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1328:6): [True: 614, False: 1.21M]
  ------------------
 1329|    614|	    reader->preserves--;
 1330|  1.69M|	reader->node = reader->node->next;
 1331|  1.69M|	reader->state = XML_TEXTREADER_ELEMENT;
 1332|       |
 1333|       |	/*
 1334|       |	 * Cleanup of the old node
 1335|       |	 */
 1336|  1.69M|	if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1336:6): [True: 473k, False: 1.21M]
  ------------------
 1337|   473k|#ifdef LIBXML_XINCLUDE_ENABLED
 1338|   473k|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1338:6): [True: 145k, False: 328k]
  ------------------
 1339|   145k|#endif
 1340|   145k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1340:6): [True: 145k, False: 0]
  ------------------
 1341|   145k|	    (reader->node->prev != NULL) &&
  ------------------
  |  Branch (1341:6): [True: 145k, False: 0]
  ------------------
 1342|   145k|            (reader->node->prev->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (1342:13): [True: 139k, False: 5.47k]
  ------------------
 1343|   139k|	    xmlNodePtr tmp = reader->node->prev;
 1344|   139k|	    if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
  ------------------
  |  |  170|   139k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1344:10): [True: 139k, False: 492]
  ------------------
 1345|   139k|                if (oldnode == tmp)
  ------------------
  |  Branch (1345:21): [True: 137k, False: 1.88k]
  ------------------
 1346|   137k|                    oldnode = NULL;
 1347|   139k|		xmlUnlinkNode(tmp);
 1348|   139k|		xmlTextReaderFreeNode(reader, tmp);
 1349|   139k|	    }
 1350|   139k|	}
 1351|       |
 1352|  1.69M|	goto node_found;
 1353|  1.69M|    }
 1354|   775k|    if ((oldstate == XML_TEXTREADER_ELEMENT) &&
  ------------------
  |  Branch (1354:9): [True: 340k, False: 434k]
  ------------------
 1355|   340k|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1355:2): [True: 56.9k, False: 284k]
  ------------------
 1356|  56.9k|	(reader->node->children == NULL) &&
  ------------------
  |  Branch (1356:2): [True: 56.9k, False: 0]
  ------------------
 1357|  56.9k|	((reader->node->extra & NODE_IS_EMPTY) == 0)) {;
  ------------------
  |  |  169|  56.9k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1357:2): [True: 55.5k, False: 1.41k]
  ------------------
 1358|  55.5k|	reader->state = XML_TEXTREADER_END;
 1359|  55.5k|	goto node_found;
 1360|  55.5k|    }
 1361|   719k|#ifdef LIBXML_REGEXP_ENABLED
 1362|   719k|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) &&
  ------------------
  |  Branch (1362:9): [True: 574k, False: 144k]
  ------------------
 1363|   574k|        (reader->node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1363:9): [True: 293k, False: 281k]
  ------------------
 1364|   293k|        if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1364:13): [True: 1, False: 293k]
  ------------------
 1365|      1|            return(-1);
 1366|   293k|    }
 1367|   719k|#endif /* LIBXML_REGEXP_ENABLED */
 1368|   719k|    if ((reader->preserves > 0) &&
  ------------------
  |  Branch (1368:9): [True: 405k, False: 314k]
  ------------------
 1369|   405k|	(reader->node->extra & NODE_IS_SPRESERVED))
  ------------------
  |  |  171|   405k|#define NODE_IS_SPRESERVED	0x4
  ------------------
  |  Branch (1369:2): [True: 199, False: 404k]
  ------------------
 1370|    199|	reader->preserves--;
 1371|   719k|    reader->node = reader->node->parent;
 1372|   719k|    if ((reader->node == NULL) ||
  ------------------
  |  Branch (1372:9): [True: 0, False: 719k]
  ------------------
 1373|   719k|	(reader->node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1373:2): [True: 1.95k, False: 717k]
  ------------------
 1374|   717k|	(reader->node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1374:2): [True: 0, False: 717k]
  ------------------
 1375|  1.95k|	if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (1375:6): [True: 482, False: 1.47k]
  ------------------
 1376|    482|	    val = xmlParseChunk(reader->ctxt, "", 0, 1);
 1377|    482|	    reader->state = XML_TEXTREADER_DONE;
 1378|    482|	    if (val != 0) {
  ------------------
  |  Branch (1378:10): [True: 475, False: 7]
  ------------------
 1379|    475|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1380|    475|                reader->state = XML_TEXTREADER_ERROR;
 1381|    475|	        return(-1);
 1382|    475|            }
 1383|    482|	}
 1384|  1.48k|	reader->node = NULL;
 1385|  1.48k|	reader->depth = -1;
 1386|       |
 1387|       |	/*
 1388|       |	 * Cleanup of the old node
 1389|       |	 */
 1390|  1.48k|	if ((oldnode != NULL) && (reader->preserves == 0) &&
  ------------------
  |  Branch (1390:6): [True: 1.40k, False: 75]
  |  Branch (1390:27): [True: 1.39k, False: 18]
  ------------------
 1391|  1.39k|#ifdef LIBXML_XINCLUDE_ENABLED
 1392|  1.39k|	    (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1392:6): [True: 1.25k, False: 132]
  ------------------
 1393|  1.25k|#endif
 1394|  1.25k|	    (reader->entNr == 0) &&
  ------------------
  |  Branch (1394:6): [True: 1.25k, False: 0]
  ------------------
 1395|  1.25k|	    (oldnode->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (1395:6): [True: 1.25k, False: 0]
  ------------------
 1396|  1.25k|	    ((oldnode->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  1.25k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1396:6): [True: 1.21k, False: 40]
  ------------------
 1397|  1.21k|	    xmlUnlinkNode(oldnode);
 1398|  1.21k|	    xmlTextReaderFreeNode(reader, oldnode);
 1399|  1.21k|	}
 1400|       |
 1401|  1.48k|	goto node_end;
 1402|  1.95k|    }
 1403|   717k|    if ((reader->preserves == 0) &&
  ------------------
  |  Branch (1403:9): [True: 312k, False: 405k]
  ------------------
 1404|   312k|#ifdef LIBXML_XINCLUDE_ENABLED
 1405|   312k|        (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1405:9): [True: 16.4k, False: 296k]
  ------------------
 1406|  16.4k|#endif
 1407|  16.4k|	(reader->entNr == 0) &&
  ------------------
  |  Branch (1407:2): [True: 16.4k, False: 0]
  ------------------
 1408|  16.4k|        (reader->node->last != NULL) &&
  ------------------
  |  Branch (1408:9): [True: 16.4k, False: 0]
  ------------------
 1409|  16.4k|        ((reader->node->last->extra & NODE_IS_PRESERVED) == 0)) {
  ------------------
  |  |  170|  16.4k|#define NODE_IS_PRESERVED	0x2
  ------------------
  |  Branch (1409:9): [True: 16.2k, False: 162]
  ------------------
 1410|  16.2k|	xmlNodePtr tmp = reader->node->last;
 1411|  16.2k|	xmlUnlinkNode(tmp);
 1412|  16.2k|	xmlTextReaderFreeNode(reader, tmp);
 1413|  16.2k|    }
 1414|   717k|    reader->depth--;
 1415|   717k|    reader->state = XML_TEXTREADER_BACKTRACK;
 1416|       |
 1417|  7.51M|node_found:
 1418|       |    /*
 1419|       |     * If we are in the middle of a piece of CDATA make sure it's finished
 1420|       |     */
 1421|  7.51M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1421:9): [True: 7.51M, False: 0]
  ------------------
 1422|  7.51M|        (reader->node->next == NULL) &&
  ------------------
  |  Branch (1422:9): [True: 3.27M, False: 4.23M]
  ------------------
 1423|  3.27M|        ((reader->node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1423:10): [True: 286k, False: 2.99M]
  ------------------
 1424|  2.99M|	 (reader->node->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (1424:3): [True: 433, False: 2.99M]
  ------------------
 1425|   286k|            if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1425:17): [True: 2.66k, False: 283k]
  ------------------
 1426|  2.66k|	        return -1;
 1427|   286k|    }
 1428|       |
 1429|  7.50M|#ifdef LIBXML_XINCLUDE_ENABLED
 1430|       |    /*
 1431|       |     * Handle XInclude if asked for
 1432|       |     */
 1433|  7.50M|    if ((reader->xinclude) && (reader->in_xinclude == 0) &&
  ------------------
  |  Branch (1433:9): [True: 7.42M, False: 82.3k]
  |  Branch (1433:31): [True: 4.63M, False: 2.79M]
  ------------------
 1434|  4.63M|        (reader->state != XML_TEXTREADER_BACKTRACK) &&
  ------------------
  |  Branch (1434:9): [True: 4.62M, False: 13.1k]
  ------------------
 1435|  4.62M|        (reader->node != NULL) &&
  ------------------
  |  Branch (1435:9): [True: 4.62M, False: 0]
  ------------------
 1436|  4.62M|	(reader->node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1436:2): [True: 4.58M, False: 38.1k]
  ------------------
 1437|  4.58M|	(reader->node->ns != NULL) &&
  ------------------
  |  Branch (1437:2): [True: 35.3k, False: 4.54M]
  ------------------
 1438|  35.3k|	((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
  ------------------
  |  |   30|  35.3k|#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
  ------------------
  |  Branch (1438:3): [True: 6.61k, False: 28.7k]
  ------------------
 1439|  28.7k|	 (xmlStrEqual(reader->node->ns->href, XINCLUDE_OLD_NS)))) {
  ------------------
  |  |   34|  28.7k|#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
  ------------------
  |  Branch (1439:3): [True: 9.08k, False: 19.6k]
  ------------------
 1440|  15.7k|	if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1440:6): [True: 8.94k, False: 6.76k]
  ------------------
 1441|  8.94k|	    reader->xincctxt = xmlXIncludeNewContext(reader->ctxt->myDoc);
 1442|  8.94k|            if (reader->xincctxt == NULL) {
  ------------------
  |  Branch (1442:17): [True: 1, False: 8.93k]
  ------------------
 1443|      1|                xmlTextReaderErrMemory(reader);
 1444|      1|                return(-1);
 1445|      1|            }
 1446|  8.93k|	    xmlXIncludeSetFlags(reader->xincctxt,
 1447|  8.93k|	                        reader->parserFlags & (~XML_PARSE_NOXINCNODE));
 1448|  8.93k|            xmlXIncludeSetStreamingMode(reader->xincctxt, 1);
 1449|  8.93k|            if ((reader->errorFunc != NULL) || (reader->sErrorFunc != NULL))
  ------------------
  |  Branch (1449:17): [True: 0, False: 8.93k]
  |  Branch (1449:48): [True: 8.93k, False: 0]
  ------------------
 1450|  8.93k|                xmlXIncludeSetErrorHandler(reader->xincctxt,
 1451|  8.93k|                        xmlTextReaderStructuredRelay, reader);
 1452|  8.93k|            if (reader->resourceLoader != NULL)
  ------------------
  |  Branch (1452:17): [True: 8.93k, False: 0]
  ------------------
 1453|  8.93k|                xmlXIncludeSetResourceLoader(reader->xincctxt,
 1454|  8.93k|                        reader->resourceLoader, reader->resourceCtxt);
 1455|  8.93k|	}
 1456|       |	/*
 1457|       |	 * expand that node and process it
 1458|       |	 */
 1459|  15.7k|	if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1459:6): [True: 16, False: 15.6k]
  ------------------
 1460|     16|	    return(-1);
 1461|  15.6k|        if (xmlXIncludeProcessNode(reader->xincctxt, reader->node) < 0) {
  ------------------
  |  Branch (1461:13): [True: 13.3k, False: 2.32k]
  ------------------
 1462|  13.3k|            int err = xmlXIncludeGetLastError(reader->xincctxt);
 1463|       |
 1464|  13.3k|            if (xmlIsCatastrophicError(XML_ERR_FATAL, err)) {
  ------------------
  |  Branch (1464:17): [True: 3.44k, False: 9.91k]
  ------------------
 1465|  3.44k|                xmlFatalErr(reader->ctxt, err, NULL);
 1466|  3.44k|                reader->mode = XML_TEXTREADER_MODE_ERROR;
 1467|  3.44k|                reader->state = XML_TEXTREADER_ERROR;
 1468|  3.44k|            }
 1469|  13.3k|            return(-1);
 1470|  13.3k|        }
 1471|  15.6k|    }
 1472|  7.49M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_START)) {
  ------------------
  |  Branch (1472:9): [True: 7.49M, False: 0]
  |  Branch (1472:35): [True: 73.4k, False: 7.42M]
  ------------------
 1473|  73.4k|        reader->in_xinclude++;
 1474|  73.4k|	goto get_next_node;
 1475|  73.4k|    }
 1476|  7.42M|    if ((reader->node != NULL) && (reader->node->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (1476:9): [True: 7.42M, False: 0]
  |  Branch (1476:35): [True: 348k, False: 7.07M]
  ------------------
 1477|   348k|        reader->in_xinclude--;
 1478|   348k|	goto get_next_node;
 1479|   348k|    }
 1480|  7.07M|#endif
 1481|       |    /*
 1482|       |     * Handle entities enter and exit when in entity replacement mode
 1483|       |     */
 1484|  7.07M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1484:9): [True: 7.07M, False: 0]
  ------------------
 1485|  7.07M|	(reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1485:2): [True: 2.89k, False: 7.07M]
  ------------------
 1486|  2.89k|	(reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
  ------------------
  |  Branch (1486:2): [True: 2.89k, False: 0]
  |  Branch (1486:28): [True: 0, False: 2.89k]
  ------------------
 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|  7.07M|    } else if ((reader->node != NULL) &&
  ------------------
  |  Branch (1495:16): [True: 7.07M, False: 0]
  ------------------
 1496|  7.07M|	       (reader->node->type == XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (1496:9): [True: 2.89k, False: 7.07M]
  ------------------
 1497|  2.89k|	       (reader->ctxt != NULL) && (reader->validate)) {
  ------------------
  |  Branch (1497:9): [True: 2.89k, False: 0]
  |  Branch (1497:35): [True: 1.64k, False: 1.25k]
  ------------------
 1498|  1.64k|	if (xmlTextReaderValidateEntity(reader) < 0)
  ------------------
  |  Branch (1498:6): [True: 17, False: 1.63k]
  ------------------
 1499|     17|            return(-1);
 1500|  1.64k|#endif /* LIBXML_REGEXP_ENABLED */
 1501|  1.64k|    }
 1502|  7.07M|    if ((reader->node != NULL) &&
  ------------------
  |  Branch (1502:9): [True: 7.07M, False: 0]
  ------------------
 1503|  7.07M|	(reader->node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1503:2): [True: 0, False: 7.07M]
  ------------------
 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|  7.07M|#ifdef LIBXML_REGEXP_ENABLED
 1510|  7.07M|    if ((reader->validate != XML_TEXTREADER_NOT_VALIDATE) && (reader->node != NULL)) {
  ------------------
  |  Branch (1510:9): [True: 6.14M, False: 926k]
  |  Branch (1510:62): [True: 6.14M, False: 0]
  ------------------
 1511|  6.14M|	xmlNodePtr node = reader->node;
 1512|       |
 1513|  6.14M|	if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (1513:6): [True: 5.46M, False: 686k]
  ------------------
 1514|  5.46M|            ((reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1514:14): [True: 5.44M, False: 11.2k]
  ------------------
 1515|  5.44M|	     (reader->state != XML_TEXTREADER_BACKTRACK))) {
  ------------------
  |  Branch (1515:7): [True: 4.87M, False: 573k]
  ------------------
 1516|  4.87M|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1516:10): [True: 2, False: 4.87M]
  ------------------
 1517|      2|                return(-1);
 1518|  4.87M|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1518:13): [True: 533k, False: 738k]
  ------------------
 1519|   738k|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1519:6): [True: 55.3k, False: 683k]
  ------------------
 1520|   588k|            xmlTextReaderValidateCData(reader, node->content,
 1521|   588k|	                               xmlStrlen(node->content));
 1522|   588k|	}
 1523|  6.14M|    }
 1524|  7.07M|#endif /* LIBXML_REGEXP_ENABLED */
 1525|  7.07M|#ifdef LIBXML_PATTERN_ENABLED
 1526|  7.07M|    if ((reader->patternNr > 0) && (reader->state != XML_TEXTREADER_END) &&
  ------------------
  |  Branch (1526:9): [True: 0, False: 7.07M]
  |  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|  7.07M|#endif /* LIBXML_PATTERN_ENABLED */
 1537|  7.07M|#ifdef LIBXML_SCHEMAS_ENABLED
 1538|  7.07M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_XSD) &&
  ------------------
  |  Branch (1538:9): [True: 0, False: 7.07M]
  ------------------
 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|  7.07M|#endif /* LIBXML_PATTERN_ENABLED */
 1544|  7.07M|    return(1);
 1545|  1.48k|node_end:
 1546|  1.48k|    reader->state = XML_TEXTREADER_DONE;
 1547|  1.48k|    return(0);
 1548|  7.07M|}
xmlTextReaderReadState:
 1557|  4.72k|xmlTextReaderReadState(xmlTextReader *reader) {
 1558|  4.72k|    if (reader == NULL)
  ------------------
  |  Branch (1558:9): [True: 0, False: 4.72k]
  ------------------
 1559|      0|	return(-1);
 1560|  4.72k|    return(reader->mode);
 1561|  4.72k|}
xmlTextReaderExpand:
 1572|   359k|xmlTextReaderExpand(xmlTextReader *reader) {
 1573|   359k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1573:9): [True: 0, False: 359k]
  |  Branch (1573:29): [True: 8.18k, False: 351k]
  ------------------
 1574|  8.18k|        return(NULL);
 1575|   351k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1575:9): [True: 0, False: 351k]
  ------------------
 1576|      0|        return(reader->node);
 1577|   351k|    if (reader->ctxt == NULL)
  ------------------
  |  Branch (1577:9): [True: 0, False: 351k]
  ------------------
 1578|      0|        return(NULL);
 1579|   351k|    if (xmlTextReaderDoExpand(reader) < 0)
  ------------------
  |  Branch (1579:9): [True: 11.6k, False: 340k]
  ------------------
 1580|  11.6k|        return(NULL);
 1581|   340k|    return(reader->node);
 1582|   351k|}
xmlTextReaderNext:
 1593|  19.5k|xmlTextReaderNext(xmlTextReader *reader) {
 1594|  19.5k|    int ret;
 1595|  19.5k|    xmlNodePtr cur;
 1596|       |
 1597|  19.5k|    if (reader == NULL)
  ------------------
  |  Branch (1597:9): [True: 0, False: 19.5k]
  ------------------
 1598|      0|	return(-1);
 1599|  19.5k|    if (reader->doc != NULL)
  ------------------
  |  Branch (1599:9): [True: 0, False: 19.5k]
  ------------------
 1600|      0|        return(xmlTextReaderNextTree(reader));
 1601|  19.5k|    cur = reader->node;
 1602|  19.5k|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (1602:9): [True: 5.82k, False: 13.7k]
  |  Branch (1602:26): [True: 4.06k, False: 9.71k]
  ------------------
 1603|  9.88k|        return(xmlTextReaderRead(reader));
 1604|  9.71k|    if (reader->state == XML_TEXTREADER_END || reader->state == XML_TEXTREADER_BACKTRACK)
  ------------------
  |  Branch (1604:9): [True: 156, False: 9.55k]
  |  Branch (1604:48): [True: 658, False: 8.90k]
  ------------------
 1605|    814|        return(xmlTextReaderRead(reader));
 1606|  8.90k|    if (cur->extra & NODE_IS_EMPTY)
  ------------------
  |  |  169|  8.90k|#define NODE_IS_EMPTY		0x1
  ------------------
  |  Branch (1606:9): [True: 935, False: 7.96k]
  ------------------
 1607|    935|        return(xmlTextReaderRead(reader));
 1608|  7.01M|    do {
 1609|  7.01M|        ret = xmlTextReaderRead(reader);
 1610|  7.01M|	if (ret != 1)
  ------------------
  |  Branch (1610:6): [True: 7.36k, False: 7.00M]
  ------------------
 1611|  7.36k|	    return(ret);
 1612|  7.01M|    } while (reader->node != cur);
  ------------------
  |  Branch (1612:14): [True: 7.00M, False: 605]
  ------------------
 1613|    605|    return(xmlTextReaderRead(reader));
 1614|  7.96k|}
xmlTextReaderReadInnerXml:
 1657|  12.8k|{
 1658|  12.8k|    xmlOutputBufferPtr output;
 1659|  12.8k|    xmlNodePtr cur;
 1660|  12.8k|    xmlChar *ret;
 1661|       |
 1662|  12.8k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1662:9): [True: 4.50k, False: 8.33k]
  ------------------
 1663|  4.50k|        return(NULL);
 1664|       |
 1665|  8.33k|    if (reader->node == NULL)
  ------------------
  |  Branch (1665:9): [True: 0, False: 8.33k]
  ------------------
 1666|      0|        return(NULL);
 1667|       |
 1668|  8.33k|    output = xmlAllocOutputBuffer(NULL);
 1669|  8.33k|    if (output == NULL) {
  ------------------
  |  Branch (1669:9): [True: 25, False: 8.31k]
  ------------------
 1670|     25|        xmlTextReaderErrMemory(reader);
 1671|     25|        return(NULL);
 1672|     25|    }
 1673|       |
 1674|  26.3k|    for (cur = reader->node->children; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (1674:40): [True: 18.0k, False: 8.31k]
  ------------------
 1675|  18.0k|        xmlTextReaderDumpCopy(reader, output, cur);
 1676|       |
 1677|  8.31k|    if (output->error)
  ------------------
  |  Branch (1677:9): [True: 1, False: 8.31k]
  ------------------
 1678|      1|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1679|       |
 1680|  8.31k|    ret = xmlBufDetach(output->buffer);
 1681|  8.31k|    xmlOutputBufferClose(output);
 1682|       |
 1683|  8.31k|    return(ret);
 1684|  8.33k|}
xmlTextReaderReadOuterXml:
 1696|  36.9k|{
 1697|  36.9k|    xmlOutputBufferPtr output;
 1698|  36.9k|    xmlNodePtr node;
 1699|  36.9k|    xmlChar *ret;
 1700|       |
 1701|  36.9k|    if (xmlTextReaderExpand(reader) == NULL)
  ------------------
  |  Branch (1701:9): [True: 8.06k, False: 28.8k]
  ------------------
 1702|  8.06k|        return(NULL);
 1703|       |
 1704|  28.8k|    node = reader->node;
 1705|  28.8k|    if (node == NULL)
  ------------------
  |  Branch (1705:9): [True: 0, False: 28.8k]
  ------------------
 1706|      0|        return(NULL);
 1707|       |
 1708|  28.8k|    output = xmlAllocOutputBuffer(NULL);
 1709|  28.8k|    if (output == NULL) {
  ------------------
  |  Branch (1709:9): [True: 84, False: 28.7k]
  ------------------
 1710|     84|        xmlTextReaderErrMemory(reader);
 1711|     84|        return(NULL);
 1712|     84|    }
 1713|       |
 1714|  28.7k|    xmlTextReaderDumpCopy(reader, output, node);
 1715|  28.7k|    if (output->error)
  ------------------
  |  Branch (1715:9): [True: 22, False: 28.7k]
  ------------------
 1716|     22|        xmlCtxtErrIO(reader->ctxt, output->error, NULL);
 1717|       |
 1718|  28.7k|    ret = xmlBufDetach(output->buffer);
 1719|  28.7k|    xmlOutputBufferClose(output);
 1720|       |
 1721|  28.7k|    return(ret);
 1722|  28.8k|}
xmlTextReaderReadString:
 1736|  9.40k|{
 1737|  9.40k|    xmlNodePtr node, cur;
 1738|  9.40k|    xmlBufPtr buf;
 1739|  9.40k|    xmlChar *ret;
 1740|       |
 1741|  9.40k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (1741:9): [True: 0, False: 9.40k]
  |  Branch (1741:29): [True: 2.47k, False: 6.93k]
  ------------------
 1742|  2.47k|       return(NULL);
 1743|       |
 1744|  6.93k|    node = (reader->curnode != NULL) ? reader->curnode : reader->node;
  ------------------
  |  Branch (1744:12): [True: 784, False: 6.15k]
  ------------------
 1745|  6.93k|    switch (node->type) {
 1746|  1.08k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1746:9): [True: 1.08k, False: 5.85k]
  ------------------
 1747|  1.35k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1747:9): [True: 270, False: 6.66k]
  ------------------
 1748|  1.35k|            break;
 1749|  4.06k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1749:9): [True: 4.06k, False: 2.87k]
  ------------------
 1750|  4.06k|            if ((xmlTextReaderDoExpand(reader) == -1) ||
  ------------------
  |  Branch (1750:17): [True: 1.41k, False: 2.64k]
  ------------------
 1751|  2.64k|                (node->children == NULL))
  ------------------
  |  Branch (1751:17): [True: 1.49k, False: 1.15k]
  ------------------
 1752|  2.91k|                return(NULL);
 1753|  1.15k|            break;
 1754|  1.52k|        default:
  ------------------
  |  Branch (1754:9): [True: 1.52k, False: 5.41k]
  ------------------
 1755|  1.52k|            return(NULL);
 1756|  6.93k|    }
 1757|       |
 1758|  2.50k|    buf = xmlBufCreate(50);
 1759|  2.50k|    if (buf == NULL) {
  ------------------
  |  Branch (1759:9): [True: 15, False: 2.49k]
  ------------------
 1760|     15|        xmlTextReaderErrMemory(reader);
 1761|     15|        return(NULL);
 1762|     15|    }
 1763|       |
 1764|  2.49k|    cur = node;
 1765|  4.63M|    while (cur != NULL) {
  ------------------
  |  Branch (1765:12): [True: 4.63M, False: 0]
  ------------------
 1766|  4.63M|        switch (cur->type) {
 1767|  1.15M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (1767:13): [True: 1.15M, False: 3.47M]
  ------------------
 1768|  1.15M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1768:13): [True: 375, False: 4.63M]
  ------------------
 1769|  1.15M|                xmlBufCat(buf, cur->content);
 1770|  1.15M|                break;
 1771|       |
 1772|  2.32M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1772:13): [True: 2.32M, False: 2.31M]
  ------------------
 1773|  2.32M|                if (cur->children != NULL) {
  ------------------
  |  Branch (1773:21): [True: 2.31M, False: 3.82k]
  ------------------
 1774|  2.31M|                    cur = cur->children;
 1775|  2.31M|                    continue;
 1776|  2.31M|                }
 1777|  3.82k|                break;
 1778|       |
 1779|  1.15M|            default:
  ------------------
  |  Branch (1779:13): [True: 1.15M, False: 3.47M]
  ------------------
 1780|  1.15M|                break;
 1781|  4.63M|        }
 1782|       |
 1783|  2.31M|        if (cur == node)
  ------------------
  |  Branch (1783:13): [True: 1.34k, False: 2.31M]
  ------------------
 1784|  1.34k|            goto done;
 1785|       |
 1786|  4.62M|        while (cur->next == NULL) {
  ------------------
  |  Branch (1786:16): [True: 2.31M, False: 2.31M]
  ------------------
 1787|  2.31M|            cur = cur->parent;
 1788|  2.31M|            if (cur == node)
  ------------------
  |  Branch (1788:17): [True: 1.15k, False: 2.31M]
  ------------------
 1789|  1.15k|                goto done;
 1790|  2.31M|        }
 1791|  2.31M|        cur = cur->next;
 1792|  2.31M|    }
 1793|       |
 1794|  2.49k|done:
 1795|  2.49k|    ret = xmlBufDetach(buf);
 1796|  2.49k|    if (ret == NULL)
  ------------------
  |  Branch (1796:9): [True: 1, False: 2.49k]
  ------------------
 1797|      1|        xmlTextReaderErrMemory(reader);
 1798|       |
 1799|  2.49k|    xmlBufFree(buf);
 1800|  2.49k|    return(ret);
 1801|  2.49k|}
xmlTextReaderNextSibling:
 1950|  7.54k|xmlTextReaderNextSibling(xmlTextReader *reader) {
 1951|  7.54k|    if (reader == NULL)
  ------------------
  |  Branch (1951:9): [True: 0, False: 7.54k]
  ------------------
 1952|      0|        return(-1);
 1953|  7.54k|    if (reader->doc == NULL) {
  ------------------
  |  Branch (1953:9): [True: 7.54k, False: 0]
  ------------------
 1954|       |        /* TODO */
 1955|  7.54k|	return(-1);
 1956|  7.54k|    }
 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|  40.8k|xmlNewTextReader(xmlParserInputBuffer *input, const char *URI) {
 1987|  40.8k|    xmlTextReaderPtr ret;
 1988|       |
 1989|  40.8k|    if (input == NULL)
  ------------------
  |  Branch (1989:9): [True: 0, False: 40.8k]
  ------------------
 1990|      0|	return(NULL);
 1991|  40.8k|    ret = xmlMalloc(sizeof(xmlTextReader));
 1992|  40.8k|    if (ret == NULL)
  ------------------
  |  Branch (1992:9): [True: 6, False: 40.8k]
  ------------------
 1993|      6|	return(NULL);
 1994|  40.8k|    memset(ret, 0, sizeof(xmlTextReader));
 1995|  40.8k|    ret->doc = NULL;
 1996|  40.8k|    ret->entTab = NULL;
 1997|  40.8k|    ret->entMax = 0;
 1998|  40.8k|    ret->entNr = 0;
 1999|  40.8k|    ret->input = input;
 2000|  40.8k|    ret->buffer = xmlBufCreate(50);
 2001|  40.8k|    if (ret->buffer == NULL) {
  ------------------
  |  Branch (2001:9): [True: 5, False: 40.8k]
  ------------------
 2002|      5|        xmlFree(ret);
 2003|      5|	return(NULL);
 2004|      5|    }
 2005|  40.8k|    ret->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2006|  40.8k|    if (ret->sax == NULL) {
  ------------------
  |  Branch (2006:9): [True: 2, False: 40.8k]
  ------------------
 2007|      2|	xmlBufFree(ret->buffer);
 2008|      2|	xmlFree(ret);
 2009|      2|	return(NULL);
 2010|      2|    }
 2011|  40.8k|    xmlSAXVersion(ret->sax, 2);
 2012|  40.8k|    ret->startElement = ret->sax->startElement;
 2013|  40.8k|    ret->sax->startElement = xmlTextReaderStartElement;
 2014|  40.8k|    ret->endElement = ret->sax->endElement;
 2015|  40.8k|    ret->sax->endElement = xmlTextReaderEndElement;
 2016|  40.8k|#ifdef LIBXML_SAX1_ENABLED
 2017|  40.8k|    if (ret->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  40.8k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2017:9): [True: 40.8k, False: 0]
  ------------------
 2018|  40.8k|#endif /* LIBXML_SAX1_ENABLED */
 2019|  40.8k|	ret->startElementNs = ret->sax->startElementNs;
 2020|  40.8k|	ret->sax->startElementNs = xmlTextReaderStartElementNs;
 2021|  40.8k|	ret->endElementNs = ret->sax->endElementNs;
 2022|  40.8k|	ret->sax->endElementNs = xmlTextReaderEndElementNs;
 2023|  40.8k|#ifdef LIBXML_SAX1_ENABLED
 2024|  40.8k|    } else {
 2025|      0|	ret->startElementNs = NULL;
 2026|      0|	ret->endElementNs = NULL;
 2027|      0|    }
 2028|  40.8k|#endif /* LIBXML_SAX1_ENABLED */
 2029|  40.8k|    ret->characters = ret->sax->characters;
 2030|  40.8k|    ret->sax->characters = xmlTextReaderCharacters;
 2031|  40.8k|    ret->sax->ignorableWhitespace = xmlTextReaderCharacters;
 2032|  40.8k|    ret->cdataBlock = ret->sax->cdataBlock;
 2033|  40.8k|    ret->sax->cdataBlock = xmlTextReaderCDataBlock;
 2034|       |
 2035|  40.8k|    ret->mode = XML_TEXTREADER_MODE_INITIAL;
 2036|  40.8k|    ret->node = NULL;
 2037|  40.8k|    ret->curnode = NULL;
 2038|  40.8k|    if (xmlBufUse(ret->input->buffer) < 4) {
  ------------------
  |  Branch (2038:9): [True: 1.11k, False: 39.7k]
  ------------------
 2039|  1.11k|	xmlParserInputBufferRead(input, 4);
 2040|  1.11k|    }
 2041|  40.8k|    if (xmlBufUse(ret->input->buffer) >= 4) {
  ------------------
  |  Branch (2041:9): [True: 39.7k, False: 1.11k]
  ------------------
 2042|  39.7k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL,
 2043|  39.7k|			     (const char *) xmlBufContent(ret->input->buffer),
 2044|  39.7k|                                            4, URI);
 2045|  39.7k|	ret->base = 0;
 2046|  39.7k|	ret->cur = 4;
 2047|  39.7k|    } else {
 2048|  1.11k|	ret->ctxt = xmlCreatePushParserCtxt(ret->sax, NULL, NULL, 0, URI);
 2049|  1.11k|	ret->base = 0;
 2050|  1.11k|	ret->cur = 0;
 2051|  1.11k|    }
 2052|       |
 2053|  40.8k|    if (ret->ctxt == NULL) {
  ------------------
  |  Branch (2053:9): [True: 38, False: 40.8k]
  ------------------
 2054|     38|	xmlBufFree(ret->buffer);
 2055|     38|	xmlFree(ret->sax);
 2056|     38|	xmlFree(ret);
 2057|     38|	return(NULL);
 2058|     38|    }
 2059|  40.8k|    ret->ctxt->parseMode = XML_PARSE_READER;
 2060|  40.8k|    ret->ctxt->_private = ret;
 2061|  40.8k|    ret->ctxt->dictNames = 1;
 2062|  40.8k|    ret->allocs = XML_TEXTREADER_CTXT;
  ------------------
  |  |   78|  40.8k|#define XML_TEXTREADER_CTXT	2
  ------------------
 2063|       |    /*
 2064|       |     * use the parser dictionary to allocate all elements and attributes names
 2065|       |     */
 2066|  40.8k|    ret->dict = ret->ctxt->dict;
 2067|  40.8k|#ifdef LIBXML_XINCLUDE_ENABLED
 2068|  40.8k|    ret->xinclude = 0;
 2069|  40.8k|#endif
 2070|  40.8k|#ifdef LIBXML_PATTERN_ENABLED
 2071|  40.8k|    ret->patternMax = 0;
 2072|       |    ret->patternTab = NULL;
 2073|  40.8k|#endif
 2074|  40.8k|    return(ret);
 2075|  40.8k|}
xmlFreeTextReader:
 2125|  40.8k|xmlFreeTextReader(xmlTextReader *reader) {
 2126|  40.8k|    if (reader == NULL)
  ------------------
  |  Branch (2126:9): [True: 0, False: 40.8k]
  ------------------
 2127|      0|	return;
 2128|  40.8k|#ifdef LIBXML_RELAXNG_ENABLED
 2129|  40.8k|    if (reader->rngSchemas != NULL) {
  ------------------
  |  Branch (2129:9): [True: 0, False: 40.8k]
  ------------------
 2130|      0|	xmlRelaxNGFree(reader->rngSchemas);
 2131|      0|	reader->rngSchemas = NULL;
 2132|      0|    }
 2133|  40.8k|    if (reader->rngValidCtxt != NULL) {
  ------------------
  |  Branch (2133:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|#endif
 2139|  40.8k|#ifdef LIBXML_SCHEMAS_ENABLED
 2140|  40.8k|    if (reader->xsdPlug != NULL) {
  ------------------
  |  Branch (2140:9): [True: 0, False: 40.8k]
  ------------------
 2141|      0|	xmlSchemaSAXUnplug(reader->xsdPlug);
 2142|      0|	reader->xsdPlug = NULL;
 2143|      0|    }
 2144|  40.8k|    if (reader->xsdValidCtxt != NULL) {
  ------------------
  |  Branch (2144:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|    if (reader->xsdSchemas != NULL) {
  ------------------
  |  Branch (2149:9): [True: 0, False: 40.8k]
  ------------------
 2150|      0|	xmlSchemaFree(reader->xsdSchemas);
 2151|      0|	reader->xsdSchemas = NULL;
 2152|      0|    }
 2153|  40.8k|#endif
 2154|  40.8k|#ifdef LIBXML_XINCLUDE_ENABLED
 2155|  40.8k|    if (reader->xincctxt != NULL)
  ------------------
  |  Branch (2155:9): [True: 8.93k, False: 31.8k]
  ------------------
 2156|  8.93k|	xmlXIncludeFreeContext(reader->xincctxt);
 2157|  40.8k|#endif
 2158|  40.8k|#ifdef LIBXML_PATTERN_ENABLED
 2159|  40.8k|    if (reader->patternTab != NULL) {
  ------------------
  |  Branch (2159:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|#endif
 2168|  40.8k|    if (reader->mode != XML_TEXTREADER_MODE_CLOSED)
  ------------------
  |  Branch (2168:9): [True: 40.3k, False: 455]
  ------------------
 2169|  40.3k|        xmlTextReaderClose(reader);
 2170|  40.8k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2170:9): [True: 40.8k, False: 0]
  ------------------
 2171|  40.8k|        if (reader->dict == reader->ctxt->dict)
  ------------------
  |  Branch (2171:13): [True: 40.8k, False: 0]
  ------------------
 2172|  40.8k|	    reader->dict = NULL;
 2173|  40.8k|	if (reader->allocs & XML_TEXTREADER_CTXT)
  ------------------
  |  |   78|  40.8k|#define XML_TEXTREADER_CTXT	2
  ------------------
  |  Branch (2173:6): [True: 40.8k, False: 0]
  ------------------
 2174|  40.8k|	    xmlFreeParserCtxt(reader->ctxt);
 2175|  40.8k|    }
 2176|  40.8k|    if (reader->sax != NULL)
  ------------------
  |  Branch (2176:9): [True: 40.8k, False: 0]
  ------------------
 2177|  40.8k|	xmlFree(reader->sax);
 2178|  40.8k|    if (reader->buffer != NULL)
  ------------------
  |  Branch (2178:9): [True: 40.8k, False: 0]
  ------------------
 2179|  40.8k|        xmlBufFree(reader->buffer);
 2180|  40.8k|    if (reader->entTab != NULL)
  ------------------
  |  Branch (2180:9): [True: 229, False: 40.6k]
  ------------------
 2181|    229|	xmlFree(reader->entTab);
 2182|  40.8k|    if (reader->dict != NULL)
  ------------------
  |  Branch (2182:9): [True: 0, False: 40.8k]
  ------------------
 2183|      0|        xmlDictFree(reader->dict);
 2184|  40.8k|    xmlFree(reader);
 2185|  40.8k|}
xmlTextReaderClose:
 2201|  42.0k|xmlTextReaderClose(xmlTextReader *reader) {
 2202|  42.0k|    if (reader == NULL)
  ------------------
  |  Branch (2202:9): [True: 0, False: 42.0k]
  ------------------
 2203|      0|	return(-1);
 2204|  42.0k|    reader->node = NULL;
 2205|  42.0k|    reader->curnode = NULL;
 2206|  42.0k|    reader->mode = XML_TEXTREADER_MODE_CLOSED;
 2207|  42.0k|    if (reader->faketext != NULL) {
  ------------------
  |  Branch (2207:9): [True: 209, False: 41.8k]
  ------------------
 2208|    209|        xmlFreeNode(reader->faketext);
 2209|    209|        reader->faketext = NULL;
 2210|    209|    }
 2211|  42.0k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2211:9): [True: 42.0k, False: 0]
  ------------------
 2212|  42.0k|#ifdef LIBXML_VALID_ENABLED
 2213|  42.0k|	if ((reader->ctxt->vctxt.vstateTab != NULL) &&
  ------------------
  |  Branch (2213:6): [True: 2.71k, False: 39.3k]
  ------------------
 2214|  2.71k|	    (reader->ctxt->vctxt.vstateMax > 0)){
  ------------------
  |  Branch (2214:6): [True: 2.71k, False: 0]
  ------------------
 2215|  2.71k|#ifdef LIBXML_REGEXP_ENABLED
 2216|  21.8k|            while (reader->ctxt->vctxt.vstateNr > 0)
  ------------------
  |  Branch (2216:20): [True: 19.1k, False: 2.71k]
  ------------------
 2217|  19.1k|                xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
 2218|  2.71k|#endif /* LIBXML_REGEXP_ENABLED */
 2219|  2.71k|	    xmlFree(reader->ctxt->vctxt.vstateTab);
 2220|  2.71k|	    reader->ctxt->vctxt.vstateTab = NULL;
 2221|  2.71k|	    reader->ctxt->vctxt.vstateMax = 0;
 2222|  2.71k|	}
 2223|  42.0k|#endif /* LIBXML_VALID_ENABLED */
 2224|  42.0k|	xmlStopParser(reader->ctxt);
 2225|  42.0k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2225:6): [True: 38.6k, False: 3.42k]
  ------------------
 2226|  38.6k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2226:10): [True: 35.9k, False: 2.73k]
  ------------------
 2227|  35.9k|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2228|  38.6k|	    reader->ctxt->myDoc = NULL;
 2229|  38.6k|	}
 2230|  42.0k|    }
 2231|  42.0k|    if ((reader->input != NULL)  && (reader->allocs & XML_TEXTREADER_INPUT)) {
  ------------------
  |  |   77|  40.6k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2231:9): [True: 40.6k, False: 1.47k]
  |  Branch (2231:37): [True: 39.7k, False: 873]
  ------------------
 2232|  39.7k|	xmlFreeParserInputBuffer(reader->input);
 2233|  39.7k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  39.7k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2234|  39.7k|    }
 2235|  42.0k|    return(0);
 2236|  42.0k|}
xmlTextReaderGetAttributeNo:
 2248|  6.18k|xmlTextReaderGetAttributeNo(xmlTextReader *reader, int no) {
 2249|  6.18k|    xmlChar *ret;
 2250|  6.18k|    int i;
 2251|  6.18k|    xmlAttrPtr cur;
 2252|  6.18k|    xmlNsPtr ns;
 2253|       |
 2254|  6.18k|    if (reader == NULL)
  ------------------
  |  Branch (2254:9): [True: 0, False: 6.18k]
  ------------------
 2255|      0|	return(NULL);
 2256|  6.18k|    if (reader->node == NULL)
  ------------------
  |  Branch (2256:9): [True: 888, False: 5.29k]
  ------------------
 2257|    888|	return(NULL);
 2258|  5.29k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2258:9): [True: 255, False: 5.04k]
  ------------------
 2259|    255|	return(NULL);
 2260|       |    /* TODO: handle the xmlDecl */
 2261|  5.04k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2261:9): [True: 2.38k, False: 2.65k]
  ------------------
 2262|  2.38k|	return(NULL);
 2263|       |
 2264|  2.65k|    ns = reader->node->nsDef;
 2265|  3.29k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2265:16): [True: 2.25k, False: 1.04k]
  |  Branch (2265:28): [True: 640, False: 1.61k]
  ------------------
 2266|    640|	ns = ns->next;
 2267|    640|    }
 2268|  2.65k|    if (ns != NULL)
  ------------------
  |  Branch (2268:9): [True: 551, False: 2.10k]
  ------------------
 2269|    551|	return(readerStrdup(reader, ns->href));
 2270|       |
 2271|  2.10k|    cur = reader->node->properties;
 2272|  2.10k|    if (cur == NULL)
  ------------------
  |  Branch (2272:9): [True: 1.12k, False: 980]
  ------------------
 2273|  1.12k|	return(NULL);
 2274|  1.43k|    for (;i < no;i++) {
  ------------------
  |  Branch (2274:11): [True: 957, False: 479]
  ------------------
 2275|    957|	cur = cur->next;
 2276|    957|	if (cur == NULL)
  ------------------
  |  Branch (2276:6): [True: 501, False: 456]
  ------------------
 2277|    501|	    return(NULL);
 2278|    957|    }
 2279|       |    /* TODO walk the DTD if present */
 2280|       |
 2281|    479|    if (cur->children == NULL)
  ------------------
  |  Branch (2281:9): [True: 226, False: 253]
  ------------------
 2282|    226|        return(NULL);
 2283|    253|    ret = xmlNodeListGetString(reader->node->doc, cur->children, 1);
 2284|    253|    if (ret == NULL)
  ------------------
  |  Branch (2284:9): [True: 2, False: 251]
  ------------------
 2285|      2|        xmlTextReaderErrMemory(reader);
 2286|    253|    return(ret);
 2287|    479|}
xmlTextReaderGetAttribute:
 2298|  29.1k|xmlTextReaderGetAttribute(xmlTextReader *reader, const xmlChar *name) {
 2299|  29.1k|    xmlChar *prefix = NULL;
 2300|  29.1k|    const xmlChar *localname;
 2301|  29.1k|    xmlNsPtr ns;
 2302|  29.1k|    xmlChar *ret = NULL;
 2303|  29.1k|    int result;
 2304|       |
 2305|  29.1k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2305:9): [True: 0, False: 29.1k]
  |  Branch (2305:29): [True: 13.6k, False: 15.5k]
  ------------------
 2306|  13.6k|	return(NULL);
 2307|  15.5k|    if (reader->node == NULL)
  ------------------
  |  Branch (2307:9): [True: 0, False: 15.5k]
  ------------------
 2308|      0|	return(NULL);
 2309|  15.5k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2309:9): [True: 1.13k, False: 14.4k]
  ------------------
 2310|  1.13k|	return(NULL);
 2311|       |
 2312|       |    /* TODO: handle the xmlDecl */
 2313|  14.4k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2313:9): [True: 5.41k, False: 8.99k]
  ------------------
 2314|  5.41k|	return(NULL);
 2315|       |
 2316|  8.99k|    localname = xmlSplitQName4(name, &prefix);
 2317|  8.99k|    if (localname == NULL) {
  ------------------
  |  Branch (2317:9): [True: 11, False: 8.98k]
  ------------------
 2318|     11|        xmlTextReaderErrMemory(reader);
 2319|     11|        return(NULL);
 2320|     11|    }
 2321|  8.98k|    if (prefix == NULL) {
  ------------------
  |  Branch (2321:9): [True: 5.66k, False: 3.32k]
  ------------------
 2322|       |        /*
 2323|       |         * Namespace default decl
 2324|       |         */
 2325|  5.66k|        if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  5.66k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2325:13): [True: 421, False: 5.23k]
  ------------------
 2326|    421|            ns = reader->node->nsDef;
 2327|    639|            while (ns != NULL) {
  ------------------
  |  Branch (2327:20): [True: 426, False: 213]
  ------------------
 2328|    426|                if (ns->prefix == NULL) {
  ------------------
  |  Branch (2328:21): [True: 208, False: 218]
  ------------------
 2329|    208|                    return(readerStrdup(reader, ns->href));
 2330|    208|                }
 2331|    218|                ns = ns->next;
 2332|    218|            }
 2333|    213|            return NULL;
 2334|    421|        }
 2335|       |
 2336|  5.23k|        result = xmlNodeGetAttrValue(reader->node, name, NULL, &ret);
 2337|  5.23k|        if (result < 0)
  ------------------
  |  Branch (2337:13): [True: 7, False: 5.23k]
  ------------------
 2338|      7|            xmlTextReaderErrMemory(reader);
 2339|  5.23k|        return(ret);
 2340|  5.66k|    }
 2341|       |
 2342|       |    /*
 2343|       |     * Namespace default decl
 2344|       |     */
 2345|  3.32k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.32k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2345:9): [True: 816, False: 2.50k]
  ------------------
 2346|    816|        ns = reader->node->nsDef;
 2347|  1.40k|        while (ns != NULL) {
  ------------------
  |  Branch (2347:16): [True: 826, False: 581]
  ------------------
 2348|    826|            if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2348:17): [True: 608, False: 218]
  |  Branch (2348:41): [True: 235, False: 373]
  ------------------
 2349|    235|                ret = readerStrdup(reader, ns->href);
 2350|    235|                break;
 2351|    235|            }
 2352|    591|            ns = ns->next;
 2353|    591|        }
 2354|  2.50k|    } else {
 2355|  2.50k|        result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2356|  2.50k|        if (result < 0)
  ------------------
  |  Branch (2356:13): [True: 1, False: 2.50k]
  ------------------
 2357|      1|            xmlTextReaderErrMemory(reader);
 2358|  2.50k|        if (ns != NULL) {
  ------------------
  |  Branch (2358:13): [True: 1.67k, False: 827]
  ------------------
 2359|  1.67k|            result = xmlNodeGetAttrValue(reader->node, localname, ns->href,
 2360|  1.67k|                                         &ret);
 2361|  1.67k|            if (result < 0)
  ------------------
  |  Branch (2361:17): [True: 1, False: 1.67k]
  ------------------
 2362|      1|                xmlTextReaderErrMemory(reader);
 2363|  1.67k|        }
 2364|  2.50k|    }
 2365|       |
 2366|  3.32k|    if (prefix != NULL)
  ------------------
  |  Branch (2366:9): [True: 3.32k, False: 0]
  ------------------
 2367|  3.32k|        xmlFree(prefix);
 2368|  3.32k|    return(ret);
 2369|  8.98k|}
xmlTextReaderGetAttributeNs:
 2383|  23.9k|			    const xmlChar *namespaceURI) {
 2384|  23.9k|    xmlChar *ret = NULL;
 2385|  23.9k|    xmlChar *prefix = NULL;
 2386|  23.9k|    xmlNsPtr ns;
 2387|  23.9k|    int result;
 2388|       |
 2389|  23.9k|    if ((reader == NULL) || (localName == NULL))
  ------------------
  |  Branch (2389:9): [True: 0, False: 23.9k]
  |  Branch (2389:29): [True: 9.04k, False: 14.9k]
  ------------------
 2390|  9.04k|	return(NULL);
 2391|  14.9k|    if (reader->node == NULL)
  ------------------
  |  Branch (2391:9): [True: 0, False: 14.9k]
  ------------------
 2392|      0|	return(NULL);
 2393|  14.9k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2393:9): [True: 1.92k, False: 12.9k]
  ------------------
 2394|  1.92k|	return(NULL);
 2395|       |
 2396|       |    /* TODO: handle the xmlDecl */
 2397|  12.9k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2397:9): [True: 5.40k, False: 7.59k]
  ------------------
 2398|  5.40k|	return(NULL);
 2399|       |
 2400|  7.59k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  7.59k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2400:9): [True: 1.05k, False: 6.53k]
  ------------------
 2401|  1.05k|        if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  1.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2401:13): [True: 785, False: 268]
  ------------------
 2402|    785|            prefix = BAD_CAST localName;
  ------------------
  |  |   34|    785|#define BAD_CAST (xmlChar *)
  ------------------
 2403|    785|        }
 2404|  1.05k|        ns = reader->node->nsDef;
 2405|  2.02k|        while (ns != NULL) {
  ------------------
  |  Branch (2405:16): [True: 1.11k, False: 916]
  ------------------
 2406|  1.11k|            if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2406:18): [True: 286, False: 825]
  |  Branch (2406:36): [True: 69, False: 217]
  ------------------
 2407|  1.04k|                ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2407:18): [True: 561, False: 481]
  |  Branch (2407:42): [True: 68, False: 493]
  ------------------
 2408|    137|                return readerStrdup(reader, ns->href);
 2409|    137|            }
 2410|    974|            ns = ns->next;
 2411|    974|        }
 2412|    916|        return NULL;
 2413|  1.05k|    }
 2414|       |
 2415|  6.53k|    result = xmlNodeGetAttrValue(reader->node, localName, namespaceURI, &ret);
 2416|  6.53k|    if (result < 0)
  ------------------
  |  Branch (2416:9): [True: 10, False: 6.52k]
  ------------------
 2417|     10|        xmlTextReaderErrMemory(reader);
 2418|       |
 2419|  6.53k|    return(ret);
 2420|  7.59k|}
xmlTextReaderGetRemainder:
 2436|  3.83k|xmlTextReaderGetRemainder(xmlTextReader *reader) {
 2437|  3.83k|    xmlParserInputBufferPtr ret = NULL;
 2438|       |
 2439|  3.83k|    if (reader == NULL)
  ------------------
  |  Branch (2439:9): [True: 0, False: 3.83k]
  ------------------
 2440|      0|	return(NULL);
 2441|  3.83k|    if (reader->node == NULL)
  ------------------
  |  Branch (2441:9): [True: 2.73k, False: 1.10k]
  ------------------
 2442|  2.73k|	return(NULL);
 2443|       |
 2444|  1.10k|    reader->node = NULL;
 2445|  1.10k|    reader->curnode = NULL;
 2446|  1.10k|    reader->mode = XML_TEXTREADER_MODE_EOF;
 2447|  1.10k|    if (reader->ctxt != NULL) {
  ------------------
  |  Branch (2447:9): [True: 1.10k, False: 0]
  ------------------
 2448|  1.10k|	xmlStopParser(reader->ctxt);
 2449|  1.10k|	if (reader->ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2449:6): [True: 1.10k, False: 0]
  ------------------
 2450|  1.10k|	    if (reader->preserve == 0)
  ------------------
  |  Branch (2450:10): [True: 0, False: 1.10k]
  ------------------
 2451|      0|		xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
 2452|  1.10k|	    reader->ctxt->myDoc = NULL;
 2453|  1.10k|	}
 2454|  1.10k|    }
 2455|  1.10k|    if (reader->allocs & XML_TEXTREADER_INPUT) {
  ------------------
  |  |   77|  1.10k|#define XML_TEXTREADER_INPUT	1
  ------------------
  |  Branch (2455:9): [True: 1.10k, False: 0]
  ------------------
 2456|  1.10k|	ret = reader->input;
 2457|  1.10k|	reader->input = NULL;
 2458|  1.10k|	reader->allocs -= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  1.10k|#define XML_TEXTREADER_INPUT	1
  ------------------
 2459|  1.10k|    } 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.10k|    return(ret);
 2469|  1.10k|}
xmlTextReaderLookupNamespace:
 2481|  7.96k|xmlTextReaderLookupNamespace(xmlTextReader *reader, const xmlChar *prefix) {
 2482|  7.96k|    xmlNsPtr ns;
 2483|  7.96k|    int result;
 2484|       |
 2485|  7.96k|    if (reader == NULL)
  ------------------
  |  Branch (2485:9): [True: 0, False: 7.96k]
  ------------------
 2486|      0|	return(NULL);
 2487|  7.96k|    if (reader->node == NULL)
  ------------------
  |  Branch (2487:9): [True: 2.62k, False: 5.34k]
  ------------------
 2488|  2.62k|	return(NULL);
 2489|       |
 2490|  5.34k|    result = xmlSearchNsSafe(reader->node, prefix, &ns);
 2491|  5.34k|    if (result < 0) {
  ------------------
  |  Branch (2491:9): [True: 0, False: 5.34k]
  ------------------
 2492|      0|        xmlTextReaderErrMemory(reader);
 2493|      0|        return(NULL);
 2494|      0|    }
 2495|  5.34k|    if (ns == NULL)
  ------------------
  |  Branch (2495:9): [True: 4.40k, False: 938]
  ------------------
 2496|  4.40k|	return(NULL);
 2497|    938|    return(readerStrdup(reader, ns->href));
 2498|  5.34k|}
xmlTextReaderMoveToAttributeNo:
 2510|  7.30k|xmlTextReaderMoveToAttributeNo(xmlTextReader *reader, int no) {
 2511|  7.30k|    int i;
 2512|  7.30k|    xmlAttrPtr cur;
 2513|  7.30k|    xmlNsPtr ns;
 2514|       |
 2515|  7.30k|    if (reader == NULL)
  ------------------
  |  Branch (2515:9): [True: 0, False: 7.30k]
  ------------------
 2516|      0|	return(-1);
 2517|  7.30k|    if (reader->node == NULL)
  ------------------
  |  Branch (2517:9): [True: 3.15k, False: 4.15k]
  ------------------
 2518|  3.15k|	return(-1);
 2519|       |    /* TODO: handle the xmlDecl */
 2520|  4.15k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2520:9): [True: 1.22k, False: 2.92k]
  ------------------
 2521|  1.22k|	return(-1);
 2522|       |
 2523|  2.92k|    reader->curnode = NULL;
 2524|       |
 2525|  2.92k|    ns = reader->node->nsDef;
 2526|  4.14k|    for (i = 0;(i < no) && (ns != NULL);i++) {
  ------------------
  |  Branch (2526:16): [True: 3.60k, False: 533]
  |  Branch (2526:28): [True: 1.21k, False: 2.39k]
  ------------------
 2527|  1.21k|	ns = ns->next;
 2528|  1.21k|    }
 2529|  2.92k|    if (ns != NULL) {
  ------------------
  |  Branch (2529:9): [True: 250, False: 2.67k]
  ------------------
 2530|    250|	reader->curnode = (xmlNodePtr) ns;
 2531|    250|	return(1);
 2532|    250|    }
 2533|       |
 2534|  2.67k|    cur = reader->node->properties;
 2535|  2.67k|    if (cur == NULL)
  ------------------
  |  Branch (2535:9): [True: 1.09k, False: 1.58k]
  ------------------
 2536|  1.09k|	return(0);
 2537|  2.43k|    for (;i < no;i++) {
  ------------------
  |  Branch (2537:11): [True: 2.00k, False: 430]
  ------------------
 2538|  2.00k|	cur = cur->next;
 2539|  2.00k|	if (cur == NULL)
  ------------------
  |  Branch (2539:6): [True: 1.15k, False: 848]
  ------------------
 2540|  1.15k|	    return(0);
 2541|  2.00k|    }
 2542|       |    /* TODO walk the DTD if present */
 2543|       |
 2544|    430|    reader->curnode = (xmlNodePtr) cur;
 2545|    430|    return(1);
 2546|  1.58k|}
xmlTextReaderMoveToAttribute:
 2557|  12.4k|xmlTextReaderMoveToAttribute(xmlTextReader *reader, const xmlChar *name) {
 2558|  12.4k|    xmlChar *prefix = NULL;
 2559|  12.4k|    const xmlChar *localname;
 2560|  12.4k|    xmlNsPtr ns;
 2561|  12.4k|    xmlAttrPtr prop;
 2562|       |
 2563|  12.4k|    if ((reader == NULL) || (name == NULL))
  ------------------
  |  Branch (2563:9): [True: 0, False: 12.4k]
  |  Branch (2563:29): [True: 4.23k, False: 8.20k]
  ------------------
 2564|  4.23k|	return(-1);
 2565|  8.20k|    if (reader->node == NULL)
  ------------------
  |  Branch (2565:9): [True: 0, False: 8.20k]
  ------------------
 2566|      0|	return(-1);
 2567|       |
 2568|       |    /* TODO: handle the xmlDecl */
 2569|  8.20k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2569:9): [True: 2.03k, False: 6.17k]
  ------------------
 2570|  2.03k|	return(0);
 2571|       |
 2572|  6.17k|    localname = xmlSplitQName4(name, &prefix);
 2573|  6.17k|    if (localname == NULL) {
  ------------------
  |  Branch (2573:9): [True: 15, False: 6.15k]
  ------------------
 2574|     15|        xmlTextReaderErrMemory(reader);
 2575|     15|        return(-1);
 2576|     15|    }
 2577|  6.15k|    if (prefix == NULL) {
  ------------------
  |  Branch (2577:9): [True: 3.65k, False: 2.50k]
  ------------------
 2578|       |	/*
 2579|       |	 * Namespace default decl
 2580|       |	 */
 2581|  3.65k|	if (xmlStrEqual(name, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  3.65k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2581:6): [True: 519, False: 3.13k]
  ------------------
 2582|    519|	    ns = reader->node->nsDef;
 2583|    723|	    while (ns != NULL) {
  ------------------
  |  Branch (2583:13): [True: 441, False: 282]
  ------------------
 2584|    441|		if (ns->prefix == NULL) {
  ------------------
  |  Branch (2584:7): [True: 237, False: 204]
  ------------------
 2585|    237|		    reader->curnode = (xmlNodePtr) ns;
 2586|    237|		    return(1);
 2587|    237|		}
 2588|    204|		ns = ns->next;
 2589|    204|	    }
 2590|    282|	    return(0);
 2591|    519|	}
 2592|       |
 2593|  3.13k|	prop = reader->node->properties;
 2594|  4.79k|	while (prop != NULL) {
  ------------------
  |  Branch (2594:9): [True: 2.07k, False: 2.71k]
  ------------------
 2595|       |	    /*
 2596|       |	     * One need to have
 2597|       |	     *   - same attribute names
 2598|       |	     *   - and the attribute carrying that namespace
 2599|       |	     */
 2600|  2.07k|	    if ((xmlStrEqual(prop->name, name)) &&
  ------------------
  |  Branch (2600:10): [True: 621, False: 1.45k]
  ------------------
 2601|    621|		((prop->ns == NULL) || (prop->ns->prefix == NULL))) {
  ------------------
  |  Branch (2601:4): [True: 423, False: 198]
  |  Branch (2601:26): [True: 0, False: 198]
  ------------------
 2602|    423|		reader->curnode = (xmlNodePtr) prop;
 2603|    423|		return(1);
 2604|    423|	    }
 2605|  1.65k|	    prop = prop->next;
 2606|  1.65k|	}
 2607|  2.71k|	return(0);
 2608|  3.13k|    }
 2609|       |
 2610|       |    /*
 2611|       |     * Namespace default decl
 2612|       |     */
 2613|  2.50k|    if (xmlStrEqual(prefix, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.50k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2613:9): [True: 1.03k, False: 1.46k]
  ------------------
 2614|  1.03k|	ns = reader->node->nsDef;
 2615|  1.66k|	while (ns != NULL) {
  ------------------
  |  Branch (2615:9): [True: 1.07k, False: 594]
  ------------------
 2616|  1.07k|	    if ((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localname))) {
  ------------------
  |  Branch (2616:10): [True: 846, False: 229]
  |  Branch (2616:34): [True: 445, False: 401]
  ------------------
 2617|    445|		reader->curnode = (xmlNodePtr) ns;
 2618|    445|		goto found;
 2619|    445|	    }
 2620|    630|	    ns = ns->next;
 2621|    630|	}
 2622|    594|	goto not_found;
 2623|  1.03k|    }
 2624|  1.46k|    prop = reader->node->properties;
 2625|  2.69k|    while (prop != NULL) {
  ------------------
  |  Branch (2625:12): [True: 1.51k, False: 1.18k]
  ------------------
 2626|       |	/*
 2627|       |	 * One need to have
 2628|       |	 *   - same attribute names
 2629|       |	 *   - and the attribute carrying that namespace
 2630|       |	 */
 2631|  1.51k|	if ((xmlStrEqual(prop->name, localname)) &&
  ------------------
  |  Branch (2631:6): [True: 730, False: 780]
  ------------------
 2632|    730|	    (prop->ns != NULL) && (xmlStrEqual(prop->ns->prefix, prefix))) {
  ------------------
  |  Branch (2632:6): [True: 488, False: 242]
  |  Branch (2632:28): [True: 276, False: 212]
  ------------------
 2633|    276|	    reader->curnode = (xmlNodePtr) prop;
 2634|    276|	    goto found;
 2635|    276|	}
 2636|  1.23k|	prop = prop->next;
 2637|  1.23k|    }
 2638|  1.78k|not_found:
 2639|  1.78k|    if (prefix != NULL)
  ------------------
  |  Branch (2639:9): [True: 1.78k, False: 0]
  ------------------
 2640|  1.78k|        xmlFree(prefix);
 2641|  1.78k|    return(0);
 2642|       |
 2643|    721|found:
 2644|    721|    if (prefix != NULL)
  ------------------
  |  Branch (2644:9): [True: 721, False: 0]
  ------------------
 2645|    721|        xmlFree(prefix);
 2646|    721|    return(1);
 2647|  1.46k|}
xmlTextReaderMoveToAttributeNs:
 2660|  10.6k|	const xmlChar *localName, const xmlChar *namespaceURI) {
 2661|  10.6k|    xmlAttrPtr prop;
 2662|  10.6k|    xmlNodePtr node;
 2663|  10.6k|    xmlNsPtr ns;
 2664|  10.6k|    xmlChar *prefix = NULL;
 2665|       |
 2666|  10.6k|    if ((reader == NULL) || (localName == NULL) || (namespaceURI == NULL))
  ------------------
  |  Branch (2666:9): [True: 0, False: 10.6k]
  |  Branch (2666:29): [True: 3.92k, False: 6.68k]
  |  Branch (2666:52): [True: 2.99k, False: 3.68k]
  ------------------
 2667|  6.92k|	return(-1);
 2668|  3.68k|    if (reader->node == NULL)
  ------------------
  |  Branch (2668:9): [True: 0, False: 3.68k]
  ------------------
 2669|      0|	return(-1);
 2670|  3.68k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2670:9): [True: 0, False: 3.68k]
  ------------------
 2671|      0|	return(0);
 2672|  3.68k|    node = reader->node;
 2673|       |
 2674|  3.68k|    if (xmlStrEqual(namespaceURI, BAD_CAST "http://www.w3.org/2000/xmlns/")) {
  ------------------
  |  |   34|  3.68k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2674:9): [True: 2.24k, False: 1.43k]
  ------------------
 2675|  2.24k|		if (! xmlStrEqual(localName, BAD_CAST "xmlns")) {
  ------------------
  |  |   34|  2.24k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2675:7): [True: 1.31k, False: 929]
  ------------------
 2676|  1.31k|			prefix = BAD_CAST localName;
  ------------------
  |  |   34|  1.31k|#define BAD_CAST (xmlChar *)
  ------------------
 2677|  1.31k|		}
 2678|  2.24k|		ns = reader->node->nsDef;
 2679|  3.01k|		while (ns != NULL) {
  ------------------
  |  Branch (2679:10): [True: 2.60k, False: 411]
  ------------------
 2680|  2.60k|			if ((prefix == NULL && ns->prefix == NULL) ||
  ------------------
  |  Branch (2680:9): [True: 929, False: 1.67k]
  |  Branch (2680:27): [True: 734, False: 195]
  ------------------
 2681|  1.86k|				((ns->prefix != NULL) && (xmlStrEqual(ns->prefix, localName)))) {
  ------------------
  |  Branch (2681:6): [True: 1.38k, False: 482]
  |  Branch (2681:30): [True: 1.10k, False: 284]
  ------------------
 2682|  1.83k|				reader->curnode = (xmlNodePtr) ns;
 2683|  1.83k|				return(1);
 2684|  1.83k|			}
 2685|    766|			ns = ns->next;
 2686|    766|		}
 2687|    411|		return(0);
 2688|  2.24k|    }
 2689|       |
 2690|  1.43k|    prop = node->properties;
 2691|  2.84k|    while (prop != NULL) {
  ------------------
  |  Branch (2691:12): [True: 1.65k, False: 1.18k]
  ------------------
 2692|       |	/*
 2693|       |	 * One need to have
 2694|       |	 *   - same attribute names
 2695|       |	 *   - and the attribute carrying that namespace
 2696|       |	 */
 2697|  1.65k|        if (xmlStrEqual(prop->name, localName) &&
  ------------------
  |  Branch (2697:13): [True: 1.07k, False: 577]
  ------------------
 2698|  1.07k|	    ((prop->ns != NULL) &&
  ------------------
  |  Branch (2698:7): [True: 457, False: 621]
  ------------------
 2699|    457|	     (xmlStrEqual(prop->ns->href, namespaceURI)))) {
  ------------------
  |  Branch (2699:7): [True: 249, False: 208]
  ------------------
 2700|    249|	    reader->curnode = (xmlNodePtr) prop;
 2701|    249|	    return(1);
 2702|    249|        }
 2703|  1.40k|	prop = prop->next;
 2704|  1.40k|    }
 2705|  1.18k|    return(0);
 2706|  1.43k|}
xmlTextReaderMoveToFirstAttribute:
 2716|  15.0k|xmlTextReaderMoveToFirstAttribute(xmlTextReader *reader) {
 2717|  15.0k|    if (reader == NULL)
  ------------------
  |  Branch (2717:9): [True: 0, False: 15.0k]
  ------------------
 2718|      0|	return(-1);
 2719|  15.0k|    if (reader->node == NULL)
  ------------------
  |  Branch (2719:9): [True: 4.81k, False: 10.2k]
  ------------------
 2720|  4.81k|	return(-1);
 2721|  10.2k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2721:9): [True: 2.86k, False: 7.34k]
  ------------------
 2722|  2.86k|	return(0);
 2723|       |
 2724|  7.34k|    if (reader->node->nsDef != NULL) {
  ------------------
  |  Branch (2724:9): [True: 3.34k, False: 4.00k]
  ------------------
 2725|  3.34k|	reader->curnode = (xmlNodePtr) reader->node->nsDef;
 2726|  3.34k|	return(1);
 2727|  3.34k|    }
 2728|  4.00k|    if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2728:9): [True: 1.92k, False: 2.08k]
  ------------------
 2729|  1.92k|	reader->curnode = (xmlNodePtr) reader->node->properties;
 2730|  1.92k|	return(1);
 2731|  1.92k|    }
 2732|  2.08k|    return(0);
 2733|  4.00k|}
xmlTextReaderMoveToNextAttribute:
 2743|  8.38k|xmlTextReaderMoveToNextAttribute(xmlTextReader *reader) {
 2744|  8.38k|    if (reader == NULL)
  ------------------
  |  Branch (2744:9): [True: 0, False: 8.38k]
  ------------------
 2745|      0|	return(-1);
 2746|  8.38k|    if (reader->node == NULL)
  ------------------
  |  Branch (2746:9): [True: 1.97k, False: 6.40k]
  ------------------
 2747|  1.97k|	return(-1);
 2748|  6.40k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2748:9): [True: 2.35k, False: 4.04k]
  ------------------
 2749|  2.35k|	return(0);
 2750|  4.04k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2750:9): [True: 1.99k, False: 2.04k]
  ------------------
 2751|  1.99k|	return(xmlTextReaderMoveToFirstAttribute(reader));
 2752|       |
 2753|  2.04k|    if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2753:9): [True: 939, False: 1.10k]
  ------------------
 2754|    939|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2755|    939|	if (ns->next != NULL) {
  ------------------
  |  Branch (2755:6): [True: 235, False: 704]
  ------------------
 2756|    235|	    reader->curnode = (xmlNodePtr) ns->next;
 2757|    235|	    return(1);
 2758|    235|	}
 2759|    704|	if (reader->node->properties != NULL) {
  ------------------
  |  Branch (2759:6): [True: 247, False: 457]
  ------------------
 2760|    247|	    reader->curnode = (xmlNodePtr) reader->node->properties;
 2761|    247|	    return(1);
 2762|    247|	}
 2763|    457|	return(0);
 2764|  1.10k|    } else if ((reader->curnode->type == XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (2764:16): [True: 856, False: 253]
  ------------------
 2765|    856|	       (reader->curnode->next != NULL)) {
  ------------------
  |  Branch (2765:9): [True: 233, False: 623]
  ------------------
 2766|    233|	reader->curnode = reader->curnode->next;
 2767|    233|	return(1);
 2768|    233|    }
 2769|    876|    return(0);
 2770|  2.04k|}
xmlTextReaderMoveToElement:
 2780|  4.98k|xmlTextReaderMoveToElement(xmlTextReader *reader) {
 2781|  4.98k|    if (reader == NULL)
  ------------------
  |  Branch (2781:9): [True: 0, False: 4.98k]
  ------------------
 2782|      0|	return(-1);
 2783|  4.98k|    if (reader->node == NULL)
  ------------------
  |  Branch (2783:9): [True: 1.89k, False: 3.08k]
  ------------------
 2784|  1.89k|	return(-1);
 2785|  3.08k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2785:9): [True: 1.23k, False: 1.85k]
  ------------------
 2786|  1.23k|	return(0);
 2787|  1.85k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (2787:9): [True: 525, False: 1.32k]
  ------------------
 2788|    525|	reader->curnode = NULL;
 2789|    525|	return(1);
 2790|    525|    }
 2791|  1.32k|    return(0);
 2792|  1.85k|}
xmlTextReaderReadAttributeValue:
 2803|  9.85k|xmlTextReaderReadAttributeValue(xmlTextReader *reader) {
 2804|  9.85k|    if (reader == NULL)
  ------------------
  |  Branch (2804:9): [True: 0, False: 9.85k]
  ------------------
 2805|      0|	return(-1);
 2806|  9.85k|    if (reader->node == NULL)
  ------------------
  |  Branch (2806:9): [True: 3.27k, False: 6.58k]
  ------------------
 2807|  3.27k|	return(-1);
 2808|  6.58k|    if (reader->curnode == NULL)
  ------------------
  |  Branch (2808:9): [True: 4.92k, False: 1.66k]
  ------------------
 2809|  4.92k|	return(0);
 2810|  1.66k|    if (reader->curnode->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (2810:9): [True: 530, False: 1.13k]
  ------------------
 2811|    530|	if (reader->curnode->children == NULL)
  ------------------
  |  Branch (2811:6): [True: 211, False: 319]
  ------------------
 2812|    211|	    return(0);
 2813|    319|	reader->curnode = reader->curnode->children;
 2814|  1.13k|    } else if (reader->curnode->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2814:16): [True: 652, False: 478]
  ------------------
 2815|    652|	xmlNsPtr ns = (xmlNsPtr) reader->curnode;
 2816|       |
 2817|    652|	if (reader->faketext == NULL) {
  ------------------
  |  Branch (2817:6): [True: 215, False: 437]
  ------------------
 2818|    215|	    reader->faketext = xmlNewDocText(reader->node->doc,
 2819|    215|		                             ns->href);
 2820|    215|            if (reader->faketext == NULL) {
  ------------------
  |  Branch (2820:17): [True: 6, False: 209]
  ------------------
 2821|      6|                xmlTextReaderErrMemory(reader);
 2822|      6|                return(-1);
 2823|      6|            }
 2824|    437|	} else {
 2825|    437|            if ((reader->faketext->content != NULL) &&
  ------------------
  |  Branch (2825:17): [True: 217, False: 220]
  ------------------
 2826|    217|	        (reader->faketext->content !=
  ------------------
  |  Branch (2826:10): [True: 217, False: 0]
  ------------------
 2827|    217|		 (xmlChar *) &(reader->faketext->properties)))
 2828|    217|		xmlFree(reader->faketext->content);
 2829|    437|            if (ns->href == NULL) {
  ------------------
  |  Branch (2829:17): [True: 220, False: 217]
  ------------------
 2830|    220|                reader->faketext->content = NULL;
 2831|    220|            } else {
 2832|    217|                reader->faketext->content = xmlStrdup(ns->href);
 2833|    217|                if (reader->faketext->content == NULL) {
  ------------------
  |  Branch (2833:21): [True: 1, False: 216]
  ------------------
 2834|      1|                    xmlTextReaderErrMemory(reader);
 2835|      1|                    return(-1);
 2836|      1|                }
 2837|    217|            }
 2838|    437|	}
 2839|    645|	reader->curnode = reader->faketext;
 2840|    645|    } else {
 2841|    478|	if (reader->curnode->next == NULL)
  ------------------
  |  Branch (2841:6): [True: 404, False: 74]
  ------------------
 2842|    404|	    return(0);
 2843|     74|	reader->curnode = reader->curnode->next;
 2844|     74|    }
 2845|  1.03k|    return(1);
 2846|  1.66k|}
xmlTextReaderConstEncoding:
 2856|  3.59k|xmlTextReaderConstEncoding(xmlTextReader *reader) {
 2857|  3.59k|    const xmlChar *encoding = NULL;
 2858|       |
 2859|  3.59k|    if (reader == NULL)
  ------------------
  |  Branch (2859:9): [True: 0, False: 3.59k]
  ------------------
 2860|      0|        return(NULL);
 2861|       |
 2862|  3.59k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (2862:9): [True: 3.59k, False: 0]
  ------------------
 2863|  3.59k|        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.59k|    return(constString(reader, encoding));
 2868|  3.59k|}
xmlTextReaderAttributeCount:
 2883|  9.24k|xmlTextReaderAttributeCount(xmlTextReader *reader) {
 2884|  9.24k|    int ret;
 2885|  9.24k|    xmlAttrPtr attr;
 2886|  9.24k|    xmlNsPtr ns;
 2887|  9.24k|    xmlNodePtr node;
 2888|       |
 2889|  9.24k|    if (reader == NULL)
  ------------------
  |  Branch (2889:9): [True: 0, False: 9.24k]
  ------------------
 2890|      0|	return(-1);
 2891|  9.24k|    if (reader->node == NULL)
  ------------------
  |  Branch (2891:9): [True: 3.92k, False: 5.32k]
  ------------------
 2892|  3.92k|	return(0);
 2893|       |
 2894|  5.32k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2894:9): [True: 565, False: 4.75k]
  ------------------
 2895|    565|	node = reader->curnode;
 2896|  4.75k|    else
 2897|  4.75k|	node = reader->node;
 2898|       |
 2899|  5.32k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2899:9): [True: 1.75k, False: 3.56k]
  ------------------
 2900|  1.75k|	return(0);
 2901|  3.56k|    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2901:9): [True: 215, False: 3.35k]
  ------------------
 2902|  3.35k|	(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2902:2): [True: 346, False: 3.00k]
  ------------------
 2903|    561|	return(0);
 2904|  3.00k|    ret = 0;
 2905|  3.00k|    attr = node->properties;
 2906|  7.23k|    while (attr != NULL) {
  ------------------
  |  Branch (2906:12): [True: 4.23k, False: 3.00k]
  ------------------
 2907|  4.23k|	ret++;
 2908|  4.23k|	attr = attr->next;
 2909|  4.23k|    }
 2910|  3.00k|    ns = node->nsDef;
 2911|  4.81k|    while (ns != NULL) {
  ------------------
  |  Branch (2911:12): [True: 1.81k, False: 3.00k]
  ------------------
 2912|  1.81k|	ret++;
 2913|  1.81k|	ns = ns->next;
 2914|  1.81k|    }
 2915|  3.00k|    return(ret);
 2916|  3.56k|}
xmlTextReaderNodeType:
 2927|  10.9k|xmlTextReaderNodeType(xmlTextReader *reader) {
 2928|  10.9k|    xmlNodePtr node;
 2929|       |
 2930|  10.9k|    if (reader == NULL)
  ------------------
  |  Branch (2930:9): [True: 0, False: 10.9k]
  ------------------
 2931|      0|	return(-1);
 2932|  10.9k|    if (reader->node == NULL)
  ------------------
  |  Branch (2932:9): [True: 3.30k, False: 7.61k]
  ------------------
 2933|  3.30k|	return(XML_READER_TYPE_NONE);
 2934|  7.61k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2934:9): [True: 848, False: 6.76k]
  ------------------
 2935|    848|	node = reader->curnode;
 2936|  6.76k|    else
 2937|  6.76k|	node = reader->node;
 2938|  7.61k|    switch (node->type) {
  ------------------
  |  Branch (2938:13): [True: 7.61k, False: 0]
  ------------------
 2939|  2.29k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (2939:9): [True: 2.29k, False: 5.32k]
  ------------------
 2940|  2.29k|	    if ((reader->state == XML_TEXTREADER_END) ||
  ------------------
  |  Branch (2940:10): [True: 238, False: 2.05k]
  ------------------
 2941|  2.05k|		(reader->state == XML_TEXTREADER_BACKTRACK))
  ------------------
  |  Branch (2941:3): [True: 268, False: 1.78k]
  ------------------
 2942|    506|		return(XML_READER_TYPE_END_ELEMENT);
 2943|  1.78k|	    return(XML_READER_TYPE_ELEMENT);
 2944|    297|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (2944:9): [True: 297, False: 7.31k]
  ------------------
 2945|    552|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (2945:9): [True: 255, False: 7.35k]
  ------------------
 2946|    552|	    return(XML_READER_TYPE_ATTRIBUTE);
 2947|  2.22k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (2947:9): [True: 2.22k, False: 5.38k]
  ------------------
 2948|  2.22k|	    if (xmlIsBlankNode(reader->node)) {
  ------------------
  |  Branch (2948:10): [True: 821, False: 1.40k]
  ------------------
 2949|    821|		if (xmlNodeGetSpacePreserve(reader->node))
  ------------------
  |  Branch (2949:7): [True: 821, False: 0]
  ------------------
 2950|    821|		    return(XML_READER_TYPE_SIGNIFICANT_WHITESPACE);
 2951|      0|		else
 2952|      0|		    return(XML_READER_TYPE_WHITESPACE);
 2953|  1.40k|	    } else {
 2954|  1.40k|		return(XML_READER_TYPE_TEXT);
 2955|  1.40k|	    }
 2956|    221|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (2956:9): [True: 221, False: 7.39k]
  ------------------
 2957|    221|	    return(XML_READER_TYPE_CDATA);
 2958|    217|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (2958:9): [True: 217, False: 7.39k]
  ------------------
 2959|    217|	    return(XML_READER_TYPE_ENTITY_REFERENCE);
 2960|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (2960:9): [True: 0, False: 7.61k]
  ------------------
 2961|      0|	    return(XML_READER_TYPE_ENTITY);
 2962|    264|        case XML_PI_NODE:
  ------------------
  |  Branch (2962:9): [True: 264, False: 7.35k]
  ------------------
 2963|    264|	    return(XML_READER_TYPE_PROCESSING_INSTRUCTION);
 2964|    262|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (2964:9): [True: 262, False: 7.35k]
  ------------------
 2965|    262|	    return(XML_READER_TYPE_COMMENT);
 2966|    306|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (2966:9): [True: 306, False: 7.30k]
  ------------------
 2967|    306|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (2967:9): [True: 0, False: 7.61k]
  ------------------
 2968|    306|	    return(XML_READER_TYPE_DOCUMENT);
 2969|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (2969:9): [True: 0, False: 7.61k]
  ------------------
 2970|      0|	    return(XML_READER_TYPE_DOCUMENT_FRAGMENT);
 2971|      0|        case XML_NOTATION_NODE:
  ------------------
  |  Branch (2971:9): [True: 0, False: 7.61k]
  ------------------
 2972|      0|	    return(XML_READER_TYPE_NOTATION);
 2973|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (2973:9): [True: 0, False: 7.61k]
  ------------------
 2974|    567|        case XML_DTD_NODE:
  ------------------
  |  Branch (2974:9): [True: 567, False: 7.04k]
  ------------------
 2975|    567|	    return(XML_READER_TYPE_DOCUMENT_TYPE);
 2976|       |
 2977|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (2977:9): [True: 0, False: 7.61k]
  ------------------
 2978|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (2978:9): [True: 0, False: 7.61k]
  ------------------
 2979|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (2979:9): [True: 0, False: 7.61k]
  ------------------
 2980|    706|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (2980:9): [True: 706, False: 6.90k]
  ------------------
 2981|    706|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (2981:9): [True: 0, False: 7.61k]
  ------------------
 2982|    706|	    return(XML_READER_TYPE_NONE);
 2983|  7.61k|    }
 2984|      0|    return(-1);
 2985|  7.61k|}
xmlTextReaderIsEmptyElement:
 2994|  8.84k|xmlTextReaderIsEmptyElement(xmlTextReader *reader) {
 2995|  8.84k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (2995:9): [True: 0, False: 8.84k]
  |  Branch (2995:29): [True: 2.41k, False: 6.43k]
  ------------------
 2996|  2.41k|	return(-1);
 2997|  6.43k|    if (reader->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (2997:9): [True: 3.66k, False: 2.76k]
  ------------------
 2998|  3.66k|	return(0);
 2999|  2.76k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (2999:9): [True: 245, False: 2.52k]
  ------------------
 3000|    245|	return(0);
 3001|  2.52k|    if (reader->node->children != NULL)
  ------------------
  |  Branch (3001:9): [True: 1.57k, False: 945]
  ------------------
 3002|  1.57k|	return(0);
 3003|    945|    if (reader->state == XML_TEXTREADER_END)
  ------------------
  |  Branch (3003:9): [True: 216, False: 729]
  ------------------
 3004|    216|	return(0);
 3005|    729|    if (reader->doc != NULL)
  ------------------
  |  Branch (3005:9): [True: 0, False: 729]
  ------------------
 3006|      0|        return(1);
 3007|    729|#ifdef LIBXML_XINCLUDE_ENABLED
 3008|    729|    if (reader->in_xinclude > 0)
  ------------------
  |  Branch (3008:9): [True: 314, False: 415]
  ------------------
 3009|    314|        return(1);
 3010|    415|#endif
 3011|    415|    return((reader->node->extra & NODE_IS_EMPTY) != 0);
  ------------------
  |  |  169|    415|#define NODE_IS_EMPTY		0x1
  ------------------
 3012|    729|}
xmlTextReaderLocalName:
 3022|  5.61k|xmlTextReaderLocalName(xmlTextReader *reader) {
 3023|  5.61k|    xmlNodePtr node;
 3024|  5.61k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3024:9): [True: 0, False: 5.61k]
  |  Branch (3024:29): [True: 1.90k, False: 3.71k]
  ------------------
 3025|  1.90k|	return(NULL);
 3026|  3.71k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3026:9): [True: 724, False: 2.98k]
  ------------------
 3027|    724|	node = reader->curnode;
 3028|  2.98k|    else
 3029|  2.98k|	node = reader->node;
 3030|  3.71k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3030:9): [True: 479, False: 3.23k]
  ------------------
 3031|    479|	xmlNsPtr ns = (xmlNsPtr) node;
 3032|    479|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3032:6): [True: 216, False: 263]
  ------------------
 3033|    216|	    return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    216|#define BAD_CAST (xmlChar *)
  ------------------
 3034|    263|	else
 3035|    263|	    return(readerStrdup(reader, ns->prefix));
 3036|    479|    }
 3037|  3.23k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3037:9): [True: 2.09k, False: 1.13k]
  ------------------
 3038|  2.09k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3038:2): [True: 1.87k, False: 222]
  ------------------
 3039|  1.87k|	return(xmlTextReaderName(reader));
 3040|  1.35k|    return(readerStrdup(reader, node->name));
 3041|  3.23k|}
xmlTextReaderConstLocalName:
 3051|  37.2k|xmlTextReaderConstLocalName(xmlTextReader *reader) {
 3052|  37.2k|    xmlNodePtr node;
 3053|  37.2k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3053:9): [True: 0, False: 37.2k]
  |  Branch (3053:29): [True: 11.6k, False: 25.5k]
  ------------------
 3054|  11.6k|	return(NULL);
 3055|  25.5k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3055:9): [True: 4.23k, False: 21.3k]
  ------------------
 3056|  4.23k|	node = reader->curnode;
 3057|  21.3k|    else
 3058|  21.3k|	node = reader->node;
 3059|  25.5k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3059:9): [True: 2.69k, False: 22.8k]
  ------------------
 3060|  2.69k|	xmlNsPtr ns = (xmlNsPtr) node;
 3061|  2.69k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3061:6): [True: 908, False: 1.78k]
  ------------------
 3062|    908|	    return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    908|#define BAD_CAST (xmlChar *)
  ------------------
 3063|  1.78k|	else
 3064|  1.78k|	    return(ns->prefix);
 3065|  2.69k|    }
 3066|  22.8k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3066:9): [True: 11.7k, False: 11.1k]
  ------------------
 3067|  11.7k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3067:2): [True: 10.5k, False: 1.20k]
  ------------------
 3068|  10.5k|	return(xmlTextReaderConstName(reader));
 3069|  12.3k|    return(node->name);
 3070|  22.8k|}
xmlTextReaderName:
 3080|  7.77k|xmlTextReaderName(xmlTextReader *reader) {
 3081|  7.77k|    xmlNodePtr node;
 3082|  7.77k|    xmlChar *ret;
 3083|       |
 3084|  7.77k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3084:9): [True: 0, False: 7.77k]
  |  Branch (3084:29): [True: 1.48k, False: 6.29k]
  ------------------
 3085|  1.48k|	return(NULL);
 3086|  6.29k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3086:9): [True: 752, False: 5.53k]
  ------------------
 3087|    752|	node = reader->curnode;
 3088|  5.53k|    else
 3089|  5.53k|	node = reader->node;
 3090|  6.29k|    switch (node->type) {
  ------------------
  |  Branch (3090:13): [True: 6.29k, False: 0]
  ------------------
 3091|  1.39k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3091:9): [True: 1.39k, False: 4.89k]
  ------------------
 3092|  1.63k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3092:9): [True: 237, False: 6.05k]
  ------------------
 3093|  1.63k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3093:10): [True: 1.10k, False: 530]
  ------------------
 3094|    530|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3094:3): [True: 231, False: 299]
  ------------------
 3095|  1.33k|		return(readerStrdup(reader, node->name));
 3096|       |
 3097|    299|            ret = xmlBuildQName(node->name, node->ns->prefix, NULL, 0);
 3098|    299|            if (ret == NULL)
  ------------------
  |  Branch (3098:17): [True: 1, False: 298]
  ------------------
 3099|      1|                xmlTextReaderErrMemory(reader);
 3100|    299|	    return(ret);
 3101|    861|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3101:9): [True: 861, False: 5.42k]
  ------------------
 3102|    861|	    return(readerStrdup(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|    861|#define BAD_CAST (xmlChar *)
  ------------------
 3103|    257|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3103:9): [True: 257, False: 6.03k]
  ------------------
 3104|    257|	    return(readerStrdup(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    257|#define BAD_CAST (xmlChar *)
  ------------------
 3105|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3105:9): [True: 0, False: 6.29k]
  ------------------
 3106|    239|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3106:9): [True: 239, False: 6.05k]
  ------------------
 3107|    239|	    return(readerStrdup(reader, node->name));
 3108|    551|        case XML_PI_NODE:
  ------------------
  |  Branch (3108:9): [True: 551, False: 5.73k]
  ------------------
 3109|    551|	    return(readerStrdup(reader, node->name));
 3110|    289|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3110:9): [True: 289, False: 6.00k]
  ------------------
 3111|    289|	    return(readerStrdup(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    289|#define BAD_CAST (xmlChar *)
  ------------------
 3112|    315|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3112:9): [True: 315, False: 5.97k]
  ------------------
 3113|    315|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3113:9): [True: 0, False: 6.29k]
  ------------------
 3114|    315|	    return(readerStrdup(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|    315|#define BAD_CAST (xmlChar *)
  ------------------
 3115|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3115:9): [True: 0, False: 6.29k]
  ------------------
 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.29k]
  ------------------
 3118|      0|	    return(readerStrdup(reader, node->name));
 3119|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3119:9): [True: 0, False: 6.29k]
  ------------------
 3120|    758|        case XML_DTD_NODE:
  ------------------
  |  Branch (3120:9): [True: 758, False: 5.53k]
  ------------------
 3121|    758|	    return(readerStrdup(reader, node->name));
 3122|    443|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3122:9): [True: 443, False: 5.84k]
  ------------------
 3123|    443|	    xmlNsPtr ns = (xmlNsPtr) node;
 3124|       |
 3125|    443|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3125:10): [True: 211, False: 232]
  ------------------
 3126|    211|		return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    211|#define BAD_CAST (xmlChar *)
  ------------------
 3127|    232|            ret = xmlBuildQName(ns->prefix, BAD_CAST "xmlns", NULL, 0);
  ------------------
  |  |   34|    232|#define BAD_CAST (xmlChar *)
  ------------------
 3128|    232|            if (ret == NULL)
  ------------------
  |  Branch (3128:17): [True: 1, False: 231]
  ------------------
 3129|      1|                xmlTextReaderErrMemory(reader);
 3130|    232|	    return(ret);
 3131|    443|	}
 3132|       |
 3133|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3133:9): [True: 0, False: 6.29k]
  ------------------
 3134|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3134:9): [True: 0, False: 6.29k]
  ------------------
 3135|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3135:9): [True: 0, False: 6.29k]
  ------------------
 3136|    946|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3136:9): [True: 946, False: 5.34k]
  ------------------
 3137|    946|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3137:9): [True: 0, False: 6.29k]
  ------------------
 3138|    946|	    return(NULL);
 3139|  6.29k|    }
 3140|      0|    return(NULL);
 3141|  6.29k|}
xmlTextReaderConstName:
 3151|  56.4k|xmlTextReaderConstName(xmlTextReader *reader) {
 3152|  56.4k|    xmlNodePtr node;
 3153|       |
 3154|  56.4k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3154:9): [True: 0, False: 56.4k]
  |  Branch (3154:29): [True: 16.3k, False: 40.0k]
  ------------------
 3155|  16.3k|	return(NULL);
 3156|  40.0k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3156:9): [True: 3.34k, False: 36.6k]
  ------------------
 3157|  3.34k|	node = reader->curnode;
 3158|  36.6k|    else
 3159|  36.6k|	node = reader->node;
 3160|  40.0k|    switch (node->type) {
  ------------------
  |  Branch (3160:13): [True: 40.0k, False: 0]
  ------------------
 3161|  14.7k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3161:9): [True: 14.7k, False: 25.2k]
  ------------------
 3162|  15.9k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3162:9): [True: 1.11k, False: 38.9k]
  ------------------
 3163|  15.9k|	    if ((node->ns == NULL) ||
  ------------------
  |  Branch (3163:10): [True: 13.1k, False: 2.77k]
  ------------------
 3164|  2.77k|		(node->ns->prefix == NULL))
  ------------------
  |  Branch (3164:3): [True: 485, False: 2.29k]
  ------------------
 3165|  13.6k|		return(node->name);
 3166|  2.29k|	    return(constQString(reader, node->ns->prefix, node->name));
 3167|  8.00k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3167:9): [True: 8.00k, False: 32.0k]
  ------------------
 3168|  8.00k|	    return(constString(reader, BAD_CAST "#text"));
  ------------------
  |  |   34|  8.00k|#define BAD_CAST (xmlChar *)
  ------------------
 3169|    375|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3169:9): [True: 375, False: 39.6k]
  ------------------
 3170|    375|	    return(constString(reader, BAD_CAST "#cdata-section"));
  ------------------
  |  |   34|    375|#define BAD_CAST (xmlChar *)
  ------------------
 3171|      0|        case XML_ENTITY_NODE:
  ------------------
  |  Branch (3171:9): [True: 0, False: 40.0k]
  ------------------
 3172|    372|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3172:9): [True: 372, False: 39.6k]
  ------------------
 3173|    372|	    return(constString(reader, node->name));
 3174|  1.94k|        case XML_PI_NODE:
  ------------------
  |  Branch (3174:9): [True: 1.94k, False: 38.0k]
  ------------------
 3175|  1.94k|	    return(constString(reader, node->name));
 3176|    894|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3176:9): [True: 894, False: 39.1k]
  ------------------
 3177|    894|	    return(constString(reader, BAD_CAST "#comment"));
  ------------------
  |  |   34|    894|#define BAD_CAST (xmlChar *)
  ------------------
 3178|  1.85k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3178:9): [True: 1.85k, False: 38.1k]
  ------------------
 3179|  1.85k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3179:9): [True: 0, False: 40.0k]
  ------------------
 3180|  1.85k|	    return(constString(reader, BAD_CAST "#document"));
  ------------------
  |  |   34|  1.85k|#define BAD_CAST (xmlChar *)
  ------------------
 3181|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3181:9): [True: 0, False: 40.0k]
  ------------------
 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: 40.0k]
  ------------------
 3184|      0|	    return(constString(reader, node->name));
 3185|      0|        case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (3185:9): [True: 0, False: 40.0k]
  ------------------
 3186|  3.63k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3186:9): [True: 3.63k, False: 36.3k]
  ------------------
 3187|  3.63k|	    return(constString(reader, node->name));
 3188|  1.24k|        case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (3188:9): [True: 1.24k, False: 38.7k]
  ------------------
 3189|  1.24k|	    xmlNsPtr ns = (xmlNsPtr) node;
 3190|       |
 3191|  1.24k|	    if (ns->prefix == NULL)
  ------------------
  |  Branch (3191:10): [True: 350, False: 891]
  ------------------
 3192|    350|		return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    350|#define BAD_CAST (xmlChar *)
  ------------------
 3193|    891|	    return(constQString(reader, BAD_CAST "xmlns", ns->prefix));
  ------------------
  |  |   34|    891|#define BAD_CAST (xmlChar *)
  ------------------
 3194|  1.24k|	}
 3195|       |
 3196|      0|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (3196:9): [True: 0, False: 40.0k]
  ------------------
 3197|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (3197:9): [True: 0, False: 40.0k]
  ------------------
 3198|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (3198:9): [True: 0, False: 40.0k]
  ------------------
 3199|  5.79k|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3199:9): [True: 5.79k, False: 34.2k]
  ------------------
 3200|  5.79k|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3200:9): [True: 0, False: 40.0k]
  ------------------
 3201|  5.79k|	    return(NULL);
 3202|  40.0k|    }
 3203|      0|    return(NULL);
 3204|  40.0k|}
xmlTextReaderPrefix:
 3214|  4.22k|xmlTextReaderPrefix(xmlTextReader *reader) {
 3215|  4.22k|    xmlNodePtr node;
 3216|  4.22k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3216:9): [True: 0, False: 4.22k]
  |  Branch (3216:29): [True: 1.28k, False: 2.93k]
  ------------------
 3217|  1.28k|	return(NULL);
 3218|  2.93k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3218:9): [True: 766, False: 2.17k]
  ------------------
 3219|    766|	node = reader->curnode;
 3220|  2.17k|    else
 3221|  2.17k|	node = reader->node;
 3222|  2.93k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3222:9): [True: 415, False: 2.52k]
  ------------------
 3223|    415|	xmlNsPtr ns = (xmlNsPtr) node;
 3224|    415|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3224:6): [True: 205, False: 210]
  ------------------
 3225|    205|	    return(NULL);
 3226|    210|	return(readerStrdup(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|    210|#define BAD_CAST (xmlChar *)
  ------------------
 3227|    415|    }
 3228|  2.52k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3228:9): [True: 1.32k, False: 1.19k]
  ------------------
 3229|  1.32k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3229:2): [True: 1.04k, False: 276]
  ------------------
 3230|  1.04k|	return(NULL);
 3231|  1.47k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3231:9): [True: 544, False: 930]
  |  Branch (3231:31): [True: 316, False: 228]
  ------------------
 3232|    316|	return(readerStrdup(reader, node->ns->prefix));
 3233|  1.15k|    return(NULL);
 3234|  1.47k|}
xmlTextReaderConstPrefix:
 3244|  20.6k|xmlTextReaderConstPrefix(xmlTextReader *reader) {
 3245|  20.6k|    xmlNodePtr node;
 3246|  20.6k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3246:9): [True: 0, False: 20.6k]
  |  Branch (3246:29): [True: 6.99k, False: 13.6k]
  ------------------
 3247|  6.99k|	return(NULL);
 3248|  13.6k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3248:9): [True: 2.31k, False: 11.2k]
  ------------------
 3249|  2.31k|	node = reader->curnode;
 3250|  11.2k|    else
 3251|  11.2k|	node = reader->node;
 3252|  13.6k|    if (node->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3252:9): [True: 1.43k, False: 12.1k]
  ------------------
 3253|  1.43k|	xmlNsPtr ns = (xmlNsPtr) node;
 3254|  1.43k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (3254:6): [True: 413, False: 1.02k]
  ------------------
 3255|    413|	    return(NULL);
 3256|  1.02k|	return(constString(reader, BAD_CAST "xmlns"));
  ------------------
  |  |   34|  1.02k|#define BAD_CAST (xmlChar *)
  ------------------
 3257|  1.43k|    }
 3258|  12.1k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3258:9): [True: 6.46k, False: 5.70k]
  ------------------
 3259|  6.46k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3259:2): [True: 5.88k, False: 584]
  ------------------
 3260|  5.88k|	return(NULL);
 3261|  6.29k|    if ((node->ns != NULL) && (node->ns->prefix != NULL))
  ------------------
  |  Branch (3261:9): [True: 1.58k, False: 4.71k]
  |  Branch (3261:31): [True: 958, False: 625]
  ------------------
 3262|    958|	return(constString(reader, node->ns->prefix));
 3263|  5.33k|    return(NULL);
 3264|  6.29k|}
xmlTextReaderNamespaceUri:
 3274|  3.77k|xmlTextReaderNamespaceUri(xmlTextReader *reader) {
 3275|  3.77k|    xmlNodePtr node;
 3276|  3.77k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3276:9): [True: 0, False: 3.77k]
  |  Branch (3276:29): [True: 1.93k, False: 1.84k]
  ------------------
 3277|  1.93k|	return(NULL);
 3278|  1.84k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3278:9): [True: 782, False: 1.05k]
  ------------------
 3279|    782|	node = reader->curnode;
 3280|  1.05k|    else
 3281|  1.05k|	node = reader->node;
 3282|  1.84k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3282:9): [True: 280, False: 1.56k]
  ------------------
 3283|    280|	return(readerStrdup(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|    280|#define BAD_CAST (xmlChar *)
  ------------------
 3284|  1.56k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3284:9): [True: 809, False: 751]
  ------------------
 3285|    809|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3285:2): [True: 527, False: 282]
  ------------------
 3286|    527|	return(NULL);
 3287|  1.03k|    if (node->ns != NULL)
  ------------------
  |  Branch (3287:9): [True: 224, False: 809]
  ------------------
 3288|    224|	return(readerStrdup(reader, node->ns->href));
 3289|    809|    return(NULL);
 3290|  1.03k|}
xmlTextReaderConstNamespaceUri:
 3300|  39.8k|xmlTextReaderConstNamespaceUri(xmlTextReader *reader) {
 3301|  39.8k|    xmlNodePtr node;
 3302|  39.8k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3302:9): [True: 0, False: 39.8k]
  |  Branch (3302:29): [True: 13.2k, False: 26.6k]
  ------------------
 3303|  13.2k|	return(NULL);
 3304|  26.6k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3304:9): [True: 4.42k, False: 22.2k]
  ------------------
 3305|  4.42k|	node = reader->curnode;
 3306|  22.2k|    else
 3307|  22.2k|	node = reader->node;
 3308|  26.6k|    if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3308:9): [True: 2.75k, False: 23.9k]
  ------------------
 3309|  2.75k|	return(constString(reader, BAD_CAST "http://www.w3.org/2000/xmlns/"));
  ------------------
  |  |   34|  2.75k|#define BAD_CAST (xmlChar *)
  ------------------
 3310|  23.9k|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3310:9): [True: 12.2k, False: 11.6k]
  ------------------
 3311|  12.2k|	(node->type != XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (3311:2): [True: 11.0k, False: 1.27k]
  ------------------
 3312|  11.0k|	return(NULL);
 3313|  12.9k|    if (node->ns != NULL)
  ------------------
  |  Branch (3313:9): [True: 4.72k, False: 8.20k]
  ------------------
 3314|  4.72k|	return(constString(reader, node->ns->href));
 3315|  8.20k|    return(NULL);
 3316|  12.9k|}
xmlTextReaderBaseUri:
 3326|  8.48k|xmlTextReaderBaseUri(xmlTextReader *reader) {
 3327|  8.48k|    xmlChar *ret = NULL;
 3328|  8.48k|    int result;
 3329|       |
 3330|  8.48k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3330:9): [True: 0, False: 8.48k]
  |  Branch (3330:29): [True: 2.22k, False: 6.25k]
  ------------------
 3331|  2.22k|	return(NULL);
 3332|  6.25k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &ret);
 3333|  6.25k|    if (result < 0)
  ------------------
  |  Branch (3333:9): [True: 131, False: 6.12k]
  ------------------
 3334|    131|        xmlTextReaderErrMemory(reader);
 3335|       |
 3336|  6.25k|    return(ret);
 3337|  8.48k|}
xmlTextReaderConstBaseUri:
 3347|  42.7k|xmlTextReaderConstBaseUri(xmlTextReader *reader) {
 3348|  42.7k|    xmlChar *tmp;
 3349|  42.7k|    const xmlChar *ret;
 3350|  42.7k|    int result;
 3351|       |
 3352|  42.7k|    if ((reader == NULL) || (reader->node == NULL))
  ------------------
  |  Branch (3352:9): [True: 0, False: 42.7k]
  |  Branch (3352:29): [True: 3.45k, False: 39.3k]
  ------------------
 3353|  3.45k|	return(NULL);
 3354|  39.3k|    result = xmlNodeGetBaseSafe(NULL, reader->node, &tmp);
 3355|  39.3k|    if (result < 0)
  ------------------
  |  Branch (3355:9): [True: 771, False: 38.5k]
  ------------------
 3356|    771|        xmlTextReaderErrMemory(reader);
 3357|  39.3k|    if (tmp == NULL)
  ------------------
  |  Branch (3357:9): [True: 11.9k, False: 27.3k]
  ------------------
 3358|  11.9k|        return(NULL);
 3359|  27.3k|    ret = constString(reader, tmp);
 3360|  27.3k|    xmlFree(tmp);
 3361|  27.3k|    return(ret);
 3362|  39.3k|}
xmlTextReaderDepth:
 3371|  3.59k|xmlTextReaderDepth(xmlTextReader *reader) {
 3372|  3.59k|    if (reader == NULL)
  ------------------
  |  Branch (3372:9): [True: 0, False: 3.59k]
  ------------------
 3373|      0|	return(-1);
 3374|  3.59k|    if (reader->node == NULL)
  ------------------
  |  Branch (3374:9): [True: 1.43k, False: 2.15k]
  ------------------
 3375|  1.43k|	return(0);
 3376|       |
 3377|  2.15k|    if (reader->curnode != NULL) {
  ------------------
  |  Branch (3377:9): [True: 745, False: 1.41k]
  ------------------
 3378|    745|	if ((reader->curnode->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (3378:6): [True: 233, False: 512]
  ------------------
 3379|    512|	    (reader->curnode->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3379:6): [True: 286, False: 226]
  ------------------
 3380|    519|	    return(reader->depth + 1);
 3381|    226|	return(reader->depth + 2);
 3382|    745|    }
 3383|  1.41k|    return(reader->depth);
 3384|  2.15k|}
xmlTextReaderHasAttributes:
 3393|  3.30k|xmlTextReaderHasAttributes(xmlTextReader *reader) {
 3394|  3.30k|    xmlNodePtr node;
 3395|  3.30k|    if (reader == NULL)
  ------------------
  |  Branch (3395:9): [True: 0, False: 3.30k]
  ------------------
 3396|      0|	return(-1);
 3397|  3.30k|    if (reader->node == NULL)
  ------------------
  |  Branch (3397:9): [True: 1.07k, False: 2.22k]
  ------------------
 3398|  1.07k|	return(0);
 3399|  2.22k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3399:9): [True: 299, False: 1.92k]
  ------------------
 3400|    299|	node = reader->curnode;
 3401|  1.92k|    else
 3402|  1.92k|	node = reader->node;
 3403|       |
 3404|  2.22k|    if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3404:9): [True: 1.24k, False: 977]
  ------------------
 3405|  1.24k|	((node->properties != NULL) || (node->nsDef != NULL)))
  ------------------
  |  Branch (3405:3): [True: 352, False: 897]
  |  Branch (3405:33): [True: 328, False: 569]
  ------------------
 3406|    680|	return(1);
 3407|       |    /* TODO: handle the xmlDecl */
 3408|  1.54k|    return(0);
 3409|  2.22k|}
xmlTextReaderHasValue:
 3418|  11.3k|xmlTextReaderHasValue(xmlTextReader *reader) {
 3419|  11.3k|    xmlNodePtr node;
 3420|  11.3k|    if (reader == NULL)
  ------------------
  |  Branch (3420:9): [True: 0, False: 11.3k]
  ------------------
 3421|      0|	return(-1);
 3422|  11.3k|    if (reader->node == NULL)
  ------------------
  |  Branch (3422:9): [True: 4.46k, False: 6.90k]
  ------------------
 3423|  4.46k|	return(0);
 3424|  6.90k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3424:9): [True: 984, False: 5.91k]
  ------------------
 3425|    984|	node = reader->curnode;
 3426|  5.91k|    else
 3427|  5.91k|	node = reader->node;
 3428|       |
 3429|  6.90k|    switch (node->type) {
 3430|    322|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3430:9): [True: 322, False: 6.57k]
  ------------------
 3431|  1.55k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3431:9): [True: 1.22k, False: 5.67k]
  ------------------
 3432|  1.79k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3432:9): [True: 240, False: 6.66k]
  ------------------
 3433|  2.10k|        case XML_PI_NODE:
  ------------------
  |  Branch (3433:9): [True: 318, False: 6.58k]
  ------------------
 3434|  2.45k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3434:9): [True: 350, False: 6.55k]
  ------------------
 3435|  2.83k|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3435:9): [True: 381, False: 6.51k]
  ------------------
 3436|  2.83k|	    return(1);
 3437|  4.06k|	default:
  ------------------
  |  Branch (3437:2): [True: 4.06k, False: 2.83k]
  ------------------
 3438|  4.06k|	    break;
 3439|  6.90k|    }
 3440|  4.06k|    return(0);
 3441|  6.90k|}
xmlTextReaderValue:
 3451|  9.11k|xmlTextReaderValue(xmlTextReader *reader) {
 3452|  9.11k|    xmlNodePtr node;
 3453|  9.11k|    if (reader == NULL)
  ------------------
  |  Branch (3453:9): [True: 0, False: 9.11k]
  ------------------
 3454|      0|	return(NULL);
 3455|  9.11k|    if (reader->node == NULL)
  ------------------
  |  Branch (3455:9): [True: 2.54k, False: 6.57k]
  ------------------
 3456|  2.54k|	return(NULL);
 3457|  6.57k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3457:9): [True: 1.80k, False: 4.76k]
  ------------------
 3458|  1.80k|	node = reader->curnode;
 3459|  4.76k|    else
 3460|  4.76k|	node = reader->node;
 3461|       |
 3462|  6.57k|    switch (node->type) {
 3463|    496|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3463:9): [True: 496, False: 6.07k]
  ------------------
 3464|    496|	    return(readerStrdup(reader, ((xmlNsPtr) node)->href));
 3465|  1.07k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3465:9): [True: 1.07k, False: 5.49k]
  ------------------
 3466|  1.07k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3467|  1.07k|            xmlDocPtr doc = NULL;
 3468|  1.07k|            xmlChar *ret;
 3469|       |
 3470|  1.07k|            if (attr->children == NULL)
  ------------------
  |  Branch (3470:17): [True: 217, False: 855]
  ------------------
 3471|    217|                return(NULL);
 3472|    855|	    if (attr->parent != NULL)
  ------------------
  |  Branch (3472:10): [True: 855, False: 0]
  ------------------
 3473|    855|                doc = attr->parent->doc;
 3474|    855|	    ret = xmlNodeListGetString(doc, attr->children, 1);
 3475|    855|            if (ret == NULL)
  ------------------
  |  Branch (3475:17): [True: 10, False: 845]
  ------------------
 3476|     10|                xmlTextReaderErrMemory(reader);
 3477|    855|	    return(ret);
 3478|  1.07k|	}
 3479|  1.11k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3479:9): [True: 1.11k, False: 5.45k]
  ------------------
 3480|  1.36k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3480:9): [True: 247, False: 6.32k]
  ------------------
 3481|  1.92k|        case XML_PI_NODE:
  ------------------
  |  Branch (3481:9): [True: 557, False: 6.01k]
  ------------------
 3482|  2.20k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3482:9): [True: 284, False: 6.28k]
  ------------------
 3483|  2.20k|            return(readerStrdup(reader, node->content));
 3484|  2.79k|	default:
  ------------------
  |  Branch (3484:2): [True: 2.79k, False: 3.77k]
  ------------------
 3485|  2.79k|	    break;
 3486|  6.57k|    }
 3487|  2.79k|    return(NULL);
 3488|  6.57k|}
xmlTextReaderConstValue:
 3498|  6.48k|xmlTextReaderConstValue(xmlTextReader *reader) {
 3499|  6.48k|    xmlNodePtr node;
 3500|  6.48k|    if (reader == NULL)
  ------------------
  |  Branch (3500:9): [True: 0, False: 6.48k]
  ------------------
 3501|      0|	return(NULL);
 3502|  6.48k|    if (reader->node == NULL)
  ------------------
  |  Branch (3502:9): [True: 1.71k, False: 4.77k]
  ------------------
 3503|  1.71k|	return(NULL);
 3504|  4.77k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3504:9): [True: 1.61k, False: 3.16k]
  ------------------
 3505|  1.61k|	node = reader->curnode;
 3506|  3.16k|    else
 3507|  3.16k|	node = reader->node;
 3508|       |
 3509|  4.77k|    switch (node->type) {
 3510|    289|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3510:9): [True: 289, False: 4.48k]
  ------------------
 3511|    289|	    return(((xmlNsPtr) node)->href);
 3512|  1.23k|        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (3512:9): [True: 1.23k, False: 3.54k]
  ------------------
 3513|  1.23k|	    xmlAttrPtr attr = (xmlAttrPtr) node;
 3514|  1.23k|	    const xmlChar *ret;
 3515|       |
 3516|  1.23k|	    if ((attr->children != NULL) &&
  ------------------
  |  Branch (3516:10): [True: 1.02k, False: 210]
  ------------------
 3517|  1.02k|	        (attr->children->type == XML_TEXT_NODE) &&
  ------------------
  |  Branch (3517:10): [True: 606, False: 414]
  ------------------
 3518|    606|		(attr->children->next == NULL))
  ------------------
  |  Branch (3518:3): [True: 303, False: 303]
  ------------------
 3519|    303|		return(attr->children->content);
 3520|    927|	    else {
 3521|    927|		if (reader->buffer == NULL) {
  ------------------
  |  Branch (3521:7): [True: 0, False: 927]
  ------------------
 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|    927|                    xmlBufEmpty(reader->buffer);
 3527|    927|	        xmlBufGetNodeContent(reader->buffer, node);
 3528|    927|		ret = xmlBufContent(reader->buffer);
 3529|    927|		if (ret == NULL) {
  ------------------
  |  Branch (3529:7): [True: 1, False: 926]
  ------------------
 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|    927|		return(ret);
 3536|    927|	    }
 3537|      0|	    break;
 3538|  1.23k|	}
 3539|    762|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3539:9): [True: 762, False: 4.01k]
  ------------------
 3540|    969|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3540:9): [True: 207, False: 4.57k]
  ------------------
 3541|  1.24k|        case XML_PI_NODE:
  ------------------
  |  Branch (3541:9): [True: 275, False: 4.50k]
  ------------------
 3542|  1.44k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3542:9): [True: 205, False: 4.57k]
  ------------------
 3543|  1.44k|	    return(node->content);
 3544|  1.81k|	default:
  ------------------
  |  Branch (3544:2): [True: 1.81k, False: 2.96k]
  ------------------
 3545|  1.81k|	    break;
 3546|  4.77k|    }
 3547|  1.81k|    return(NULL);
 3548|  4.77k|}
xmlTextReaderIsDefault:
 3558|  6.19k|xmlTextReaderIsDefault(xmlTextReader *reader) {
 3559|  6.19k|    if (reader == NULL)
  ------------------
  |  Branch (3559:9): [True: 0, False: 6.19k]
  ------------------
 3560|      0|	return(-1);
 3561|  6.19k|    return(0);
 3562|  6.19k|}
xmlTextReaderQuoteChar:
 3571|  2.82k|xmlTextReaderQuoteChar(xmlTextReader *reader) {
 3572|  2.82k|    if (reader == NULL)
  ------------------
  |  Branch (3572:9): [True: 0, False: 2.82k]
  ------------------
 3573|      0|	return(-1);
 3574|       |    /* TODO maybe lookup the attribute value for " first */
 3575|  2.82k|    return('"');
 3576|  2.82k|}
xmlTextReaderXmlLang:
 3586|  3.11k|xmlTextReaderXmlLang(xmlTextReader *reader) {
 3587|  3.11k|    if (reader == NULL)
  ------------------
  |  Branch (3587:9): [True: 0, False: 3.11k]
  ------------------
 3588|      0|	return(NULL);
 3589|  3.11k|    if (reader->node == NULL)
  ------------------
  |  Branch (3589:9): [True: 1.06k, False: 2.04k]
  ------------------
 3590|  1.06k|	return(NULL);
 3591|  2.04k|    return(xmlNodeGetLang(reader->node));
 3592|  3.11k|}
xmlTextReaderConstXmlLang:
 3601|  9.26k|xmlTextReaderConstXmlLang(xmlTextReader *reader) {
 3602|  9.26k|    xmlChar *tmp;
 3603|  9.26k|    const xmlChar *ret;
 3604|       |
 3605|  9.26k|    if (reader == NULL)
  ------------------
  |  Branch (3605:9): [True: 0, False: 9.26k]
  ------------------
 3606|      0|	return(NULL);
 3607|  9.26k|    if (reader->node == NULL)
  ------------------
  |  Branch (3607:9): [True: 2.28k, False: 6.98k]
  ------------------
 3608|  2.28k|	return(NULL);
 3609|  6.98k|    tmp = xmlNodeGetLang(reader->node);
 3610|  6.98k|    if (tmp == NULL)
  ------------------
  |  Branch (3610:9): [True: 6.71k, False: 274]
  ------------------
 3611|  6.71k|        return(NULL);
 3612|    274|    ret = constString(reader, tmp);
 3613|    274|    xmlFree(tmp);
 3614|    274|    return(ret);
 3615|  6.98k|}
xmlTextReaderNormalization:
 3644|  2.27k|xmlTextReaderNormalization(xmlTextReader *reader) {
 3645|  2.27k|    if (reader == NULL)
  ------------------
  |  Branch (3645:9): [True: 0, False: 2.27k]
  ------------------
 3646|      0|	return(-1);
 3647|  2.27k|    return(1);
 3648|  2.27k|}
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.46k, False: 6.36k]
  ------------------
 3738|    738|        case XML_PARSER_LOADDTD:
  ------------------
  |  Branch (3738:9): [True: 738, False: 7.08k]
  ------------------
 3739|    738|	    if ((ctxt->loadsubset != 0) || (ctxt->validate != 0))
  ------------------
  |  Branch (3739:10): [True: 303, False: 435]
  |  Branch (3739:37): [True: 221, False: 214]
  ------------------
 3740|    524|		return(1);
 3741|    214|	    return(0);
 3742|    392|        case XML_PARSER_DEFAULTATTRS:
  ------------------
  |  Branch (3742:9): [True: 392, False: 7.43k]
  ------------------
 3743|    392|	    if (ctxt->loadsubset & XML_COMPLETE_ATTRS)
  ------------------
  |  |  209|    392|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (3743:10): [True: 195, False: 197]
  ------------------
 3744|    195|		return(1);
 3745|    197|	    return(0);
 3746|    231|        case XML_PARSER_VALIDATE:
  ------------------
  |  Branch (3746:9): [True: 231, False: 7.59k]
  ------------------
 3747|    231|	    return(reader->validate);
 3748|    102|	case XML_PARSER_SUBST_ENTITIES:
  ------------------
  |  Branch (3748:2): [True: 102, False: 7.72k]
  ------------------
 3749|    102|	    return(ctxt->replaceEntities);
 3750|  7.82k|    }
 3751|  6.36k|    return(-1);
 3752|  7.82k|}
xmlTextReaderGetParserLineNumber:
 3763|  5.44k|{
 3764|  5.44k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.44k]
  |  Branch (3764:29): [True: 0, False: 5.44k]
  ------------------
 3765|  5.44k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3765:9): [True: 0, False: 5.44k]
  ------------------
 3766|      0|        return (0);
 3767|      0|    }
 3768|  5.44k|    return (reader->ctxt->input->line);
 3769|  5.44k|}
xmlTextReaderGetParserColumnNumber:
 3779|  9.24k|{
 3780|  9.24k|    if ((reader == NULL) || (reader->ctxt == NULL) ||
  ------------------
  |  Branch (3780:9): [True: 0, False: 9.24k]
  |  Branch (3780:29): [True: 0, False: 9.24k]
  ------------------
 3781|  9.24k|        (reader->ctxt->input == NULL)) {
  ------------------
  |  Branch (3781:9): [True: 0, False: 9.24k]
  ------------------
 3782|      0|        return (0);
 3783|      0|    }
 3784|  9.24k|    return (reader->ctxt->input->col);
 3785|  9.24k|}
xmlTextReaderCurrentNode:
 3796|  12.6k|xmlTextReaderCurrentNode(xmlTextReader *reader) {
 3797|  12.6k|    if (reader == NULL)
  ------------------
  |  Branch (3797:9): [True: 0, False: 12.6k]
  ------------------
 3798|      0|	return(NULL);
 3799|       |
 3800|  12.6k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (3800:9): [True: 714, False: 11.9k]
  ------------------
 3801|    714|	return(reader->curnode);
 3802|  11.9k|    return(reader->node);
 3803|  12.6k|}
xmlTextReaderPreserve:
 3814|  8.66k|xmlTextReaderPreserve(xmlTextReader *reader) {
 3815|  8.66k|    xmlNodePtr cur, parent;
 3816|       |
 3817|  8.66k|    if (reader == NULL)
  ------------------
  |  Branch (3817:9): [True: 0, False: 8.66k]
  ------------------
 3818|      0|	return(NULL);
 3819|       |
 3820|  8.66k|    cur = reader->node;
 3821|  8.66k|    if (cur == NULL)
  ------------------
  |  Branch (3821:9): [True: 3.04k, False: 5.62k]
  ------------------
 3822|  3.04k|        return(NULL);
 3823|       |
 3824|  5.62k|    if ((cur->type != XML_DOCUMENT_NODE) && (cur->type != XML_DTD_NODE)) {
  ------------------
  |  Branch (3824:9): [True: 5.26k, False: 359]
  |  Branch (3824:45): [True: 4.50k, False: 761]
  ------------------
 3825|  4.50k|	cur->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|  4.50k|#define NODE_IS_PRESERVED	0x2
  ------------------
 3826|  4.50k|	cur->extra |= NODE_IS_SPRESERVED;
  ------------------
  |  |  171|  4.50k|#define NODE_IS_SPRESERVED	0x4
  ------------------
 3827|  4.50k|    }
 3828|  5.62k|    reader->preserves++;
 3829|       |
 3830|  5.62k|    parent = cur->parent;;
 3831|  1.22M|    while (parent != NULL) {
  ------------------
  |  Branch (3831:12): [True: 1.21M, False: 5.62k]
  ------------------
 3832|  1.21M|        if (parent->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3832:13): [True: 1.20M, False: 5.28k]
  ------------------
 3833|  1.20M|	    parent->extra |= NODE_IS_PRESERVED;
  ------------------
  |  |  170|  1.20M|#define NODE_IS_PRESERVED	0x2
  ------------------
 3834|  1.21M|	parent = parent->parent;
 3835|  1.21M|    }
 3836|  5.62k|    return(cur);
 3837|  8.66k|}
xmlTextReaderCurrentDoc:
 3897|  9.45k|xmlTextReaderCurrentDoc(xmlTextReader *reader) {
 3898|  9.45k|    if (reader == NULL)
  ------------------
  |  Branch (3898:9): [True: 0, False: 9.45k]
  ------------------
 3899|      0|	return(NULL);
 3900|  9.45k|    if (reader->doc != NULL)
  ------------------
  |  Branch (3900:9): [True: 0, False: 9.45k]
  ------------------
 3901|      0|        return(reader->doc);
 3902|  9.45k|    if ((reader->ctxt == NULL) || (reader->ctxt->myDoc == NULL))
  ------------------
  |  Branch (3902:9): [True: 0, False: 9.45k]
  |  Branch (3902:35): [True: 1.94k, False: 7.51k]
  ------------------
 3903|  1.94k|	return(NULL);
 3904|       |
 3905|  7.51k|    reader->preserve = 1;
 3906|  7.51k|    return(reader->ctxt->myDoc);
 3907|  9.45k|}
xmlTextReaderIsNamespaceDecl:
 4380|  3.96k|xmlTextReaderIsNamespaceDecl(xmlTextReader *reader) {
 4381|  3.96k|    xmlNodePtr node;
 4382|  3.96k|    if (reader == NULL)
  ------------------
  |  Branch (4382:9): [True: 0, False: 3.96k]
  ------------------
 4383|      0|	return(-1);
 4384|  3.96k|    if (reader->node == NULL)
  ------------------
  |  Branch (4384:9): [True: 1.44k, False: 2.52k]
  ------------------
 4385|  1.44k|	return(-1);
 4386|  2.52k|    if (reader->curnode != NULL)
  ------------------
  |  Branch (4386:9): [True: 295, False: 2.22k]
  ------------------
 4387|    295|	node = reader->curnode;
 4388|  2.22k|    else
 4389|  2.22k|	node = reader->node;
 4390|       |
 4391|  2.52k|    if (XML_NAMESPACE_DECL == node->type)
  ------------------
  |  Branch (4391:9): [True: 246, False: 2.27k]
  ------------------
 4392|    246|	return(1);
 4393|  2.27k|    else
 4394|  2.27k|	return(0);
 4395|  2.52k|}
xmlTextReaderConstXmlVersion:
 4405|  4.63k|xmlTextReaderConstXmlVersion(xmlTextReader *reader) {
 4406|  4.63k|    xmlDocPtr doc = NULL;
 4407|  4.63k|    if (reader == NULL)
  ------------------
  |  Branch (4407:9): [True: 0, False: 4.63k]
  ------------------
 4408|      0|	return(NULL);
 4409|  4.63k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4409:9): [True: 0, False: 4.63k]
  ------------------
 4410|      0|        doc = reader->doc;
 4411|  4.63k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4411:14): [True: 4.63k, False: 0]
  ------------------
 4412|  4.63k|	doc = reader->ctxt->myDoc;
 4413|  4.63k|    if (doc == NULL)
  ------------------
  |  Branch (4413:9): [True: 808, False: 3.82k]
  ------------------
 4414|    808|	return(NULL);
 4415|       |
 4416|  3.82k|    if (doc->version == NULL)
  ------------------
  |  Branch (4416:9): [True: 0, False: 3.82k]
  ------------------
 4417|      0|	return(NULL);
 4418|  3.82k|    else
 4419|  3.82k|      return(constString(reader, doc->version));
 4420|  3.82k|}
xmlTextReaderStandalone:
 4431|  4.12k|xmlTextReaderStandalone(xmlTextReader *reader) {
 4432|  4.12k|    xmlDocPtr doc = NULL;
 4433|  4.12k|    if (reader == NULL)
  ------------------
  |  Branch (4433:9): [True: 0, False: 4.12k]
  ------------------
 4434|      0|	return(-1);
 4435|  4.12k|    if (reader->doc != NULL)
  ------------------
  |  Branch (4435:9): [True: 0, False: 4.12k]
  ------------------
 4436|      0|        doc = reader->doc;
 4437|  4.12k|    else if (reader->ctxt != NULL)
  ------------------
  |  Branch (4437:14): [True: 4.12k, False: 0]
  ------------------
 4438|  4.12k|	doc = reader->ctxt->myDoc;
 4439|  4.12k|    if (doc == NULL)
  ------------------
  |  Branch (4439:9): [True: 986, False: 3.13k]
  ------------------
 4440|    986|	return(-1);
 4441|       |
 4442|  3.13k|    return(doc->standalone);
 4443|  4.12k|}
xmlTextReaderSetStructuredErrorHandler:
 4591|  40.8k|{
 4592|  40.8k|    if (reader == NULL)
  ------------------
  |  Branch (4592:9): [True: 0, False: 40.8k]
  ------------------
 4593|      0|        return;
 4594|       |
 4595|  40.8k|    if (f != NULL) {
  ------------------
  |  Branch (4595:9): [True: 40.8k, False: 0]
  ------------------
 4596|  40.8k|        reader->sErrorFunc = f;
 4597|  40.8k|        reader->errorFunc = NULL;
 4598|  40.8k|        reader->errorFuncArg = arg;
 4599|  40.8k|        xmlCtxtSetErrorHandler(reader->ctxt,
 4600|  40.8k|                xmlTextReaderStructuredRelay, reader);
 4601|  40.8k|#ifdef LIBXML_RELAXNG_ENABLED
 4602|  40.8k|        if (reader->rngValidCtxt) {
  ------------------
  |  Branch (4602:13): [True: 0, False: 40.8k]
  ------------------
 4603|      0|            xmlRelaxNGSetValidStructuredErrors(reader->rngValidCtxt,
 4604|      0|                    xmlTextReaderStructuredRelay, reader);
 4605|      0|        }
 4606|  40.8k|#endif
 4607|  40.8k|#ifdef LIBXML_SCHEMAS_ENABLED
 4608|  40.8k|        if (reader->xsdValidCtxt) {
  ------------------
  |  Branch (4608:13): [True: 0, False: 40.8k]
  ------------------
 4609|      0|            xmlSchemaSetValidStructuredErrors(reader->xsdValidCtxt,
 4610|      0|                    xmlTextReaderStructuredRelay, reader);
 4611|      0|        }
 4612|  40.8k|#endif
 4613|  40.8k|    } 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|  40.8k|}
xmlTextReaderSetResourceLoader:
 4662|  40.8k|                               xmlResourceLoader loader, void *data) {
 4663|  40.8k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4663:9): [True: 0, False: 40.8k]
  |  Branch (4663:29): [True: 0, False: 40.8k]
  ------------------
 4664|      0|        return;
 4665|       |
 4666|  40.8k|    reader->resourceLoader = loader;
 4667|  40.8k|    reader->resourceCtxt = data;
 4668|       |
 4669|  40.8k|    xmlCtxtSetResourceLoader(reader->ctxt, loader, data);
 4670|  40.8k|}
xmlTextReaderIsValid:
 4680|  3.74k|{
 4681|  3.74k|    if (reader == NULL)
  ------------------
  |  Branch (4681:9): [True: 0, False: 3.74k]
  ------------------
 4682|      0|        return (-1);
 4683|  3.74k|#ifdef LIBXML_RELAXNG_ENABLED
 4684|  3.74k|    if (reader->validate == XML_TEXTREADER_VALIDATE_RNG)
  ------------------
  |  Branch (4684:9): [True: 0, False: 3.74k]
  ------------------
 4685|      0|        return (reader->rngValidErrors == 0);
 4686|  3.74k|#endif
 4687|  3.74k|#ifdef LIBXML_SCHEMAS_ENABLED
 4688|  3.74k|    if (reader->validate == XML_TEXTREADER_VALIDATE_XSD)
  ------------------
  |  Branch (4688:9): [True: 0, False: 3.74k]
  ------------------
 4689|      0|        return (reader->xsdValidErrors == 0);
 4690|  3.74k|#endif
 4691|  3.74k|    if ((reader->ctxt != NULL) && (reader->ctxt->validate == 1))
  ------------------
  |  Branch (4691:9): [True: 3.74k, False: 0]
  |  Branch (4691:35): [True: 1.41k, False: 2.32k]
  ------------------
 4692|  1.41k|        return (reader->ctxt->valid);
 4693|  2.32k|    return (0);
 4694|  3.74k|}
xmlTextReaderSetup:
 4717|  40.8k|{
 4718|  40.8k|    if (reader == NULL) {
  ------------------
  |  Branch (4718:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|    options |= XML_PARSE_COMPACT;
 4729|       |
 4730|  40.8k|    reader->doc = NULL;
 4731|  40.8k|    reader->entNr = 0;
 4732|  40.8k|    reader->parserFlags = options;
 4733|  40.8k|    reader->validate = XML_TEXTREADER_NOT_VALIDATE;
 4734|  40.8k|    if ((input != NULL) && (reader->input != NULL) &&
  ------------------
  |  Branch (4734:9): [True: 0, False: 40.8k]
  |  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|  40.8k|    if (input != NULL) {
  ------------------
  |  Branch (4740:9): [True: 0, False: 40.8k]
  ------------------
 4741|      0|	reader->input = input;
 4742|      0|	reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|      0|#define XML_TEXTREADER_INPUT	1
  ------------------
 4743|      0|    }
 4744|  40.8k|    if (reader->buffer == NULL)
  ------------------
  |  Branch (4744:9): [True: 0, False: 40.8k]
  ------------------
 4745|      0|        reader->buffer = xmlBufCreate(50);
 4746|  40.8k|    if (reader->buffer == NULL) {
  ------------------
  |  Branch (4746:9): [True: 0, False: 40.8k]
  ------------------
 4747|      0|        return (-1);
 4748|      0|    }
 4749|  40.8k|    if (reader->sax == NULL)
  ------------------
  |  Branch (4749:9): [True: 0, False: 40.8k]
  ------------------
 4750|      0|	reader->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 4751|  40.8k|    if (reader->sax == NULL) {
  ------------------
  |  Branch (4751:9): [True: 0, False: 40.8k]
  ------------------
 4752|      0|        return (-1);
 4753|      0|    }
 4754|  40.8k|    xmlSAXVersion(reader->sax, 2);
 4755|  40.8k|    reader->startElement = reader->sax->startElement;
 4756|  40.8k|    reader->sax->startElement = xmlTextReaderStartElement;
 4757|  40.8k|    reader->endElement = reader->sax->endElement;
 4758|  40.8k|    reader->sax->endElement = xmlTextReaderEndElement;
 4759|  40.8k|#ifdef LIBXML_SAX1_ENABLED
 4760|  40.8k|    if (reader->sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  40.8k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (4760:9): [True: 40.8k, False: 0]
  ------------------
 4761|  40.8k|#endif /* LIBXML_SAX1_ENABLED */
 4762|  40.8k|        reader->startElementNs = reader->sax->startElementNs;
 4763|  40.8k|        reader->sax->startElementNs = xmlTextReaderStartElementNs;
 4764|  40.8k|        reader->endElementNs = reader->sax->endElementNs;
 4765|  40.8k|        reader->sax->endElementNs = xmlTextReaderEndElementNs;
 4766|  40.8k|#ifdef LIBXML_SAX1_ENABLED
 4767|  40.8k|    } else {
 4768|      0|        reader->startElementNs = NULL;
 4769|      0|        reader->endElementNs = NULL;
 4770|      0|    }
 4771|  40.8k|#endif /* LIBXML_SAX1_ENABLED */
 4772|  40.8k|    reader->characters = reader->sax->characters;
 4773|  40.8k|    reader->sax->characters = xmlTextReaderCharacters;
 4774|  40.8k|    reader->sax->ignorableWhitespace = xmlTextReaderCharacters;
 4775|  40.8k|    reader->cdataBlock = reader->sax->cdataBlock;
 4776|  40.8k|    reader->sax->cdataBlock = xmlTextReaderCDataBlock;
 4777|       |
 4778|  40.8k|    reader->mode = XML_TEXTREADER_MODE_INITIAL;
 4779|  40.8k|    reader->node = NULL;
 4780|  40.8k|    reader->curnode = NULL;
 4781|  40.8k|    if (input != NULL) {
  ------------------
  |  Branch (4781:9): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|    if (reader->dict != NULL) {
  ------------------
  |  Branch (4829:9): [True: 40.8k, False: 0]
  ------------------
 4830|  40.8k|        if (reader->ctxt->dict != NULL) {
  ------------------
  |  Branch (4830:13): [True: 40.8k, False: 0]
  ------------------
 4831|  40.8k|	    if (reader->dict != reader->ctxt->dict) {
  ------------------
  |  Branch (4831:10): [True: 0, False: 40.8k]
  ------------------
 4832|      0|		xmlDictFree(reader->dict);
 4833|      0|		reader->dict = reader->ctxt->dict;
 4834|      0|	    }
 4835|  40.8k|	} else {
 4836|      0|	    reader->ctxt->dict = reader->dict;
 4837|      0|	}
 4838|  40.8k|    } 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|  40.8k|    reader->ctxt->_private = reader;
 4844|  40.8k|    reader->ctxt->dictNames = 1;
 4845|       |    /*
 4846|       |     * use the parser dictionary to allocate all elements and attributes names
 4847|       |     */
 4848|  40.8k|    reader->ctxt->parseMode = XML_PARSE_READER;
 4849|       |
 4850|  40.8k|#ifdef LIBXML_XINCLUDE_ENABLED
 4851|  40.8k|    if (reader->xincctxt != NULL) {
  ------------------
  |  Branch (4851:9): [True: 0, False: 40.8k]
  ------------------
 4852|      0|	xmlXIncludeFreeContext(reader->xincctxt);
 4853|      0|	reader->xincctxt = NULL;
 4854|      0|    }
 4855|  40.8k|    if (options & XML_PARSE_XINCLUDE) {
  ------------------
  |  Branch (4855:9): [True: 23.3k, False: 17.4k]
  ------------------
 4856|  23.3k|        reader->xinclude = 1;
 4857|  23.3k|	options -= XML_PARSE_XINCLUDE;
 4858|  23.3k|    } else
 4859|  17.4k|        reader->xinclude = 0;
 4860|  40.8k|    reader->in_xinclude = 0;
 4861|  40.8k|#endif
 4862|  40.8k|#ifdef LIBXML_PATTERN_ENABLED
 4863|  40.8k|    if (reader->patternTab == NULL) {
  ------------------
  |  Branch (4863:9): [True: 40.8k, False: 0]
  ------------------
 4864|  40.8k|        reader->patternNr = 0;
 4865|  40.8k|	reader->patternMax = 0;
 4866|  40.8k|    }
 4867|  40.8k|    while (reader->patternNr > 0) {
  ------------------
  |  Branch (4867:12): [True: 0, False: 40.8k]
  ------------------
 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|  40.8k|#endif
 4875|       |
 4876|  40.8k|    if (options & XML_PARSE_DTDVALID)
  ------------------
  |  Branch (4876:9): [True: 19.5k, False: 21.2k]
  ------------------
 4877|  19.5k|        reader->validate = XML_TEXTREADER_VALIDATE_DTD;
 4878|       |
 4879|  40.8k|    xmlCtxtUseOptions(reader->ctxt, options);
 4880|  40.8k|    if (encoding != NULL)
  ------------------
  |  Branch (4880:9): [True: 0, False: 40.8k]
  ------------------
 4881|      0|        xmlSwitchEncodingName(reader->ctxt, encoding);
 4882|  40.8k|    if ((URL != NULL) && (reader->ctxt->input != NULL) &&
  ------------------
  |  Branch (4882:9): [True: 0, False: 40.8k]
  |  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|  40.8k|    reader->doc = NULL;
 4891|       |
 4892|  40.8k|    return (0);
 4893|  40.8k|}
xmlTextReaderGetLastError:
 4917|  40.8k|{
 4918|  40.8k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4918:9): [True: 0, False: 40.8k]
  |  Branch (4918:29): [True: 0, False: 40.8k]
  ------------------
 4919|      0|        return(NULL);
 4920|  40.8k|    return(&reader->ctxt->lastError);
 4921|  40.8k|}
xmlTextReaderByteConsumed:
 4939|  5.85k|xmlTextReaderByteConsumed(xmlTextReader *reader) {
 4940|  5.85k|    xmlParserInputPtr in;
 4941|       |
 4942|  5.85k|    if ((reader == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (4942:9): [True: 0, False: 5.85k]
  |  Branch (4942:29): [True: 0, False: 5.85k]
  ------------------
 4943|      0|        return(-1);
 4944|  5.85k|    in = reader->ctxt->input;
 4945|  5.85k|    if (in == NULL)
  ------------------
  |  Branch (4945:9): [True: 0, False: 5.85k]
  ------------------
 4946|      0|        return(-1);
 4947|  5.85k|    return(in->consumed + (in->cur - in->base));
 4948|  5.85k|}
xmlReaderForMemory:
 5046|  40.8k|{
 5047|  40.8k|    xmlTextReaderPtr reader;
 5048|  40.8k|    xmlParserInputBufferPtr buf;
 5049|       |
 5050|  40.8k|    buf = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
 5051|  40.8k|    if (buf == NULL) {
  ------------------
  |  Branch (5051:9): [True: 11, False: 40.8k]
  ------------------
 5052|     11|        return (NULL);
 5053|     11|    }
 5054|  40.8k|    reader = xmlNewTextReader(buf, URL);
 5055|  40.8k|    if (reader == NULL) {
  ------------------
  |  Branch (5055:9): [True: 51, False: 40.8k]
  ------------------
 5056|     51|        xmlFreeParserInputBuffer(buf);
 5057|     51|        return (NULL);
 5058|     51|    }
 5059|  40.8k|    reader->allocs |= XML_TEXTREADER_INPUT;
  ------------------
  |  |   77|  40.8k|#define XML_TEXTREADER_INPUT	1
  ------------------
 5060|  40.8k|    if (xmlTextReaderSetup(reader, NULL, URL, encoding, options) < 0) {
  ------------------
  |  Branch (5060:9): [True: 0, False: 40.8k]
  ------------------
 5061|      0|        xmlFreeTextReader(reader);
 5062|      0|        return (NULL);
 5063|      0|    }
 5064|  40.8k|    return (reader);
 5065|  40.8k|}
xmlreader.c:xmlTextReaderPushData:
  788|  82.8k|xmlTextReaderPushData(xmlTextReaderPtr reader) {
  789|  82.8k|    xmlBufPtr inbuf;
  790|  82.8k|    int val, s;
  791|  82.8k|    xmlTextReaderState oldstate;
  792|       |
  793|  82.8k|    if ((reader->input == NULL) || (reader->input->buffer == NULL))
  ------------------
  |  Branch (793:9): [True: 0, False: 82.8k]
  |  Branch (793:36): [True: 0, False: 82.8k]
  ------------------
  794|      0|	return(-1);
  795|       |
  796|  82.8k|    oldstate = reader->state;
  797|  82.8k|    reader->state = XML_TEXTREADER_NONE;
  798|  82.8k|    inbuf = reader->input->buffer;
  799|       |
  800|   459k|    while (reader->state == XML_TEXTREADER_NONE) {
  ------------------
  |  Branch (800:12): [True: 450k, False: 8.78k]
  ------------------
  801|   450k|	if (xmlBufUse(inbuf) < reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   450k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (801:6): [True: 71.7k, False: 378k]
  ------------------
  802|       |	    /*
  803|       |	     * Refill the buffer unless we are at the end of the stream
  804|       |	     */
  805|  71.7k|	    if (reader->mode != XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (805:10): [True: 71.7k, False: 0]
  ------------------
  806|  71.7k|		val = xmlParserInputBufferRead(reader->input, 4096);
  807|  71.7k|		if (val == 0) {
  ------------------
  |  Branch (807:7): [True: 71.7k, False: 0]
  ------------------
  808|  71.7k|		    if (xmlBufUse(inbuf) == reader->cur) {
  ------------------
  |  Branch (808:11): [True: 32.8k, False: 38.9k]
  ------------------
  809|  32.8k|			reader->mode = XML_TEXTREADER_MODE_EOF;
  810|  32.8k|                        break;
  811|  32.8k|		    }
  812|  71.7k|		} 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|  71.7k|	    } else
  820|      0|		break;
  821|  71.7k|	}
  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|   417k|	if (xmlBufUse(inbuf) >= reader->cur + CHUNK_SIZE) {
  ------------------
  |  |   69|   417k|#define CHUNK_SIZE 512
  ------------------
  |  Branch (826:6): [True: 378k, False: 38.9k]
  ------------------
  827|   378k|	    val = xmlParseChunk(reader->ctxt,
  828|   378k|                 (const char *) xmlBufContent(inbuf) + reader->cur,
  829|   378k|                                CHUNK_SIZE, 0);
  ------------------
  |  |   69|   378k|#define CHUNK_SIZE 512
  ------------------
  830|   378k|	    reader->cur += CHUNK_SIZE;
  ------------------
  |  |   69|   378k|#define CHUNK_SIZE 512
  ------------------
  831|   378k|	    if (val != 0)
  ------------------
  |  Branch (831:10): [True: 2.32k, False: 376k]
  ------------------
  832|  2.32k|		reader->ctxt->wellFormed = 0;
  833|   378k|	    if (reader->ctxt->wellFormed == 0)
  ------------------
  |  Branch (833:10): [True: 2.32k, False: 376k]
  ------------------
  834|  2.32k|		break;
  835|   378k|	} else {
  836|  38.9k|	    s = xmlBufUse(inbuf) - reader->cur;
  837|  38.9k|	    val = xmlParseChunk(reader->ctxt,
  838|  38.9k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  839|  38.9k|			        s, 0);
  840|  38.9k|	    reader->cur += s;
  841|  38.9k|	    if (val != 0)
  ------------------
  |  Branch (841:10): [True: 6.50k, False: 32.4k]
  ------------------
  842|  6.50k|		reader->ctxt->wellFormed = 0;
  843|  38.9k|	    break;
  844|  38.9k|	}
  845|   417k|    }
  846|  82.8k|    reader->state = oldstate;
  847|       |
  848|       |    /*
  849|       |     * Discard the consumed input when needed and possible
  850|       |     */
  851|  82.8k|    if (reader->mode == XML_TEXTREADER_MODE_INTERACTIVE) {
  ------------------
  |  Branch (851:9): [True: 48.3k, False: 34.5k]
  ------------------
  852|  48.3k|        if (reader->cur > 80 /* LINE_LEN */) {
  ------------------
  |  Branch (852:13): [True: 30.8k, False: 17.4k]
  ------------------
  853|  30.8k|            val = xmlBufShrink(inbuf, reader->cur - 80);
  854|  30.8k|            if (val >= 0) {
  ------------------
  |  Branch (854:17): [True: 30.8k, False: 0]
  ------------------
  855|  30.8k|                reader->cur -= val;
  856|  30.8k|            }
  857|  30.8k|        }
  858|  48.3k|    }
  859|       |
  860|       |    /*
  861|       |     * At the end of the stream signal that the work is done to the Push
  862|       |     * parser.
  863|       |     */
  864|  34.5k|    else if (reader->mode == XML_TEXTREADER_MODE_EOF) {
  ------------------
  |  Branch (864:14): [True: 32.8k, False: 1.73k]
  ------------------
  865|  32.8k|	if (reader->state != XML_TEXTREADER_DONE) {
  ------------------
  |  Branch (865:6): [True: 32.8k, False: 0]
  ------------------
  866|  32.8k|	    s = xmlBufUse(inbuf) - reader->cur;
  867|  32.8k|	    val = xmlParseChunk(reader->ctxt,
  868|  32.8k|		 (const char *) xmlBufContent(inbuf) + reader->cur,
  869|  32.8k|			        s, 1);
  870|  32.8k|	    reader->cur = xmlBufUse(inbuf);
  871|  32.8k|	    reader->state  = XML_TEXTREADER_DONE;
  872|  32.8k|	    if (val != 0) {
  ------------------
  |  Branch (872:10): [True: 27.9k, False: 4.90k]
  ------------------
  873|  27.9k|	        if (reader->ctxt->wellFormed)
  ------------------
  |  Branch (873:14): [True: 0, False: 27.9k]
  ------------------
  874|      0|		    reader->ctxt->wellFormed = 0;
  875|  27.9k|		else
  876|  27.9k|		    return(-1);
  877|  27.9k|	    }
  878|  32.8k|	}
  879|  32.8k|    }
  880|  54.9k|    if (reader->ctxt->wellFormed == 0) {
  ------------------
  |  Branch (880:9): [True: 8.83k, False: 46.1k]
  ------------------
  881|  8.83k|	reader->mode = XML_TEXTREADER_MODE_EOF;
  882|  8.83k|        return(-1);
  883|  8.83k|    }
  884|       |
  885|  46.1k|    return(0);
  886|  54.9k|}
xmlreader.c:xmlTextReaderValidatePop:
  992|   767k|xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
  993|   767k|    xmlNodePtr node = reader->node;
  994|       |
  995|   767k|#ifdef LIBXML_VALID_ENABLED
  996|   767k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (996:9): [True: 767k, False: 0]
  ------------------
  997|   767k|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (997:9): [True: 767k, False: 0]
  |  Branch (997:35): [True: 109k, False: 658k]
  ------------------
  998|   109k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (998:6): [True: 98.4k, False: 10.8k]
  |  Branch (998:28): [True: 6.26k, False: 4.56k]
  ------------------
  999|   104k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1000|   104k|				    reader->ctxt->myDoc, node, node->name);
 1001|   104k|	} else {
 1002|  4.56k|            xmlChar buf[50];
 1003|  4.56k|	    xmlChar *qname;
 1004|       |
 1005|  4.56k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
 1006|  4.56k|            if (qname == NULL) {
  ------------------
  |  Branch (1006:17): [True: 9, False: 4.55k]
  ------------------
 1007|      9|                xmlTextReaderErrMemory(reader);
 1008|      9|                return(-1);
 1009|      9|            }
 1010|  4.55k|	    reader->ctxt->valid &= xmlValidatePopElement(&reader->ctxt->vctxt,
 1011|  4.55k|				    reader->ctxt->myDoc, node, qname);
 1012|  4.55k|            if (qname != buf)
  ------------------
  |  Branch (1012:17): [True: 2.08k, False: 2.47k]
  ------------------
 1013|  2.08k|	        xmlFree(qname);
 1014|  4.55k|	}
 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|   109k|    }
 1021|   767k|#endif /* LIBXML_VALID_ENABLED */
 1022|   767k|#ifdef LIBXML_RELAXNG_ENABLED
 1023|   767k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (1023:9): [True: 0, False: 767k]
  ------------------
 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|   767k|#endif
 1039|       |
 1040|   767k|    return(0);
 1041|   767k|}
xmlreader.c:xmlTextReaderFreeNode:
  434|   156k|xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) {
  435|   156k|    xmlDictPtr dict;
  436|       |
  437|   156k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (437:9): [True: 156k, False: 0]
  |  Branch (437:29): [True: 156k, False: 0]
  ------------------
  438|   156k|	dict = reader->ctxt->dict;
  439|      0|    else
  440|      0|        dict = NULL;
  441|   156k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (441:9): [True: 0, False: 156k]
  ------------------
  442|      0|	xmlFreeDtd((xmlDtdPtr) cur);
  443|      0|	return;
  444|      0|    }
  445|   156k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (445:9): [True: 0, False: 156k]
  ------------------
  446|      0|	xmlFreeNs((xmlNsPtr) cur);
  447|      0|        return;
  448|      0|    }
  449|   156k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (449:9): [True: 0, False: 156k]
  ------------------
  450|      0|	xmlTextReaderFreeProp(reader, (xmlAttrPtr) cur);
  451|      0|	return;
  452|      0|    }
  453|       |
  454|   156k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (454:9): [True: 2.08k, False: 154k]
  ------------------
  455|  2.08k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (455:2): [True: 579, False: 1.50k]
  ------------------
  456|    579|	if (cur->children->parent == cur)
  ------------------
  |  Branch (456:6): [True: 579, False: 0]
  ------------------
  457|    579|	    xmlTextReaderFreeNodeList(reader, cur->children);
  458|    579|	cur->children = NULL;
  459|    579|    }
  460|       |
  461|   156k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (461:9): [True: 0, False: 156k]
  |  Branch (461:35): [True: 0, False: 0]
  ------------------
  462|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  463|       |
  464|   156k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (464:10): [True: 108k, False: 48.5k]
  ------------------
  465|  48.5k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (465:3): [True: 5.77k, False: 42.8k]
  ------------------
  466|  42.8k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (466:3): [True: 1.95k, False: 40.8k]
  ------------------
  467|   115k|	(cur->properties != NULL))
  ------------------
  |  Branch (467:2): [True: 18.1k, False: 97.8k]
  ------------------
  468|  18.1k|	xmlTextReaderFreePropList(reader, cur->properties);
  469|   156k|    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (469:9): [True: 146k, False: 10.0k]
  ------------------
  470|   146k|        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (470:9): [True: 38.5k, False: 108k]
  ------------------
  471|  38.5k|	(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (471:2): [True: 32.7k, False: 5.77k]
  ------------------
  472|  32.7k|	(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (472:2): [True: 30.8k, False: 1.95k]
  ------------------
  473|  30.8k|	(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (473:2): [True: 29.1k, False: 1.63k]
  ------------------
  474|  29.1k|	DICT_FREE(cur->content);
  ------------------
  |  |  183|  29.1k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 27.3k, False: 1.86k]
  |  |  |  Branch (183:16): [True: 0, False: 27.3k]
  |  |  ------------------
  |  |  184|  27.3k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 26.9k, False: 367]
  |  |  ------------------
  |  |  185|  29.1k|	    xmlFree((char *)(str));
  ------------------
  475|  29.1k|    }
  476|   156k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (476:10): [True: 108k, False: 48.5k]
  ------------------
  477|  48.5k|	 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (477:3): [True: 5.77k, False: 42.8k]
  ------------------
  478|  42.8k|	 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (478:3): [True: 1.95k, False: 40.8k]
  ------------------
  479|   115k|	(cur->nsDef != NULL))
  ------------------
  |  Branch (479:2): [True: 5.62k, False: 110k]
  ------------------
  480|  5.62k|	xmlFreeNsList(cur->nsDef);
  481|       |
  482|       |    /*
  483|       |     * we don't free names here they are interned now
  484|       |     */
  485|   156k|    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (485:9): [True: 125k, False: 31.4k]
  ------------------
  486|   125k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (486:9): [True: 123k, False: 1.74k]
  ------------------
  487|   123k|	DICT_FREE(cur->name);
  ------------------
  |  |  183|   123k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 122k, False: 1.00k]
  |  |  |  Branch (183:16): [True: 0, False: 122k]
  |  |  ------------------
  |  |  184|   122k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 26.0k, False: 96.5k]
  |  |  ------------------
  |  |  185|   123k|	    xmlFree((char *)(str));
  ------------------
  488|       |
  489|   156k|    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (489:10): [True: 108k, False: 48.5k]
  ------------------
  490|  48.5k|	 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (490:3): [True: 31.4k, False: 17.1k]
  ------------------
  491|   139k|	(reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (491:2): [True: 139k, False: 0]
  |  Branch (491:22): [True: 139k, False: 0]
  ------------------
  492|   139k|	(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   139k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (492:2): [True: 9.62k, False: 130k]
  ------------------
  493|  9.62k|	cur->next = reader->ctxt->freeElems;
  494|  9.62k|	reader->ctxt->freeElems = cur;
  495|  9.62k|	reader->ctxt->freeElemsNr++;
  496|   147k|    } else {
  497|   147k|	xmlFree(cur);
  498|   147k|    }
  499|   156k|}
xmlreader.c:xmlTextReaderFreeProp:
  277|   485k|xmlTextReaderFreeProp(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  278|   485k|    xmlDictPtr dict;
  279|       |
  280|   485k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (280:9): [True: 485k, False: 0]
  |  Branch (280:29): [True: 485k, False: 0]
  ------------------
  281|   485k|	dict = reader->ctxt->dict;
  282|      0|    else
  283|      0|        dict = NULL;
  284|   485k|    if (cur == NULL) return;
  ------------------
  |  Branch (284:9): [True: 0, False: 485k]
  ------------------
  285|       |
  286|   485k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (286:9): [True: 0, False: 485k]
  |  Branch (286:35): [True: 0, False: 0]
  ------------------
  287|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  288|       |
  289|   485k|    if (cur->children != NULL)
  ------------------
  |  Branch (289:9): [True: 479k, False: 5.35k]
  ------------------
  290|   479k|        xmlTextReaderFreeNodeList(reader, cur->children);
  291|       |
  292|   485k|    if (cur->id != NULL) {
  ------------------
  |  Branch (292:9): [True: 123, False: 485k]
  ------------------
  293|       |        /*
  294|       |         * Operating in streaming mode, attr is gonna disappear
  295|       |         */
  296|    123|        cur->id->attr = NULL;
  297|    123|        if (cur->id->name != NULL)
  ------------------
  |  Branch (297:13): [True: 0, False: 123]
  ------------------
  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|    123|        cur->id->name = cur->name;
  300|    123|        cur->name = NULL;
  301|   485k|    } else {
  302|   485k|        DICT_FREE(cur->name);
  ------------------
  |  |  183|   485k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 485k, False: 36]
  |  |  |  Branch (183:16): [True: 0, False: 485k]
  |  |  ------------------
  |  |  184|   485k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 105k, False: 380k]
  |  |  ------------------
  |  |  185|   485k|	    xmlFree((char *)(str));
  ------------------
  303|   485k|    }
  304|       |
  305|   485k|    if ((reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (305:9): [True: 485k, False: 0]
  |  Branch (305:29): [True: 485k, False: 0]
  ------------------
  306|   485k|        (reader->ctxt->freeAttrsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|   485k|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (306:9): [True: 16.8k, False: 468k]
  ------------------
  307|  16.8k|        cur->next = reader->ctxt->freeAttrs;
  308|  16.8k|	reader->ctxt->freeAttrs = cur;
  309|  16.8k|	reader->ctxt->freeAttrsNr++;
  310|   468k|    } else {
  311|   468k|	xmlFree(cur);
  312|   468k|    }
  313|   485k|}
xmlreader.c:xmlTextReaderFreeNodeList:
  340|   506k|xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) {
  341|   506k|    xmlNodePtr next;
  342|   506k|    xmlNodePtr parent;
  343|   506k|    xmlDictPtr dict;
  344|   506k|    size_t depth = 0;
  345|       |
  346|   506k|    if ((reader != NULL) && (reader->ctxt != NULL))
  ------------------
  |  Branch (346:9): [True: 506k, False: 0]
  |  Branch (346:29): [True: 506k, False: 0]
  ------------------
  347|   506k|	dict = reader->ctxt->dict;
  348|      0|    else
  349|      0|        dict = NULL;
  350|   506k|    if (cur == NULL) return;
  ------------------
  |  Branch (350:9): [True: 0, False: 506k]
  ------------------
  351|   506k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (351:9): [True: 0, False: 506k]
  ------------------
  352|      0|	xmlFreeNsList((xmlNsPtr) cur);
  353|      0|	return;
  354|      0|    }
  355|   506k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (355:9): [True: 0, False: 506k]
  ------------------
  356|   506k|	(cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (356:2): [True: 0, False: 506k]
  ------------------
  357|      0|	xmlFreeDoc((xmlDocPtr) cur);
  358|      0|	return;
  359|      0|    }
  360|  13.4M|    while (1) {
  ------------------
  |  Branch (360:12): [True: 13.4M, Folded]
  ------------------
  361|  19.7M|        while ((cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (361:16): [True: 19.7M, False: 0]
  ------------------
  362|  19.7M|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (362:16): [True: 19.6M, False: 29.0k]
  ------------------
  363|  19.6M|               (cur->children != NULL) &&
  ------------------
  |  Branch (363:16): [True: 6.26M, False: 13.4M]
  ------------------
  364|  6.26M|               (cur->children->parent == cur)) {
  ------------------
  |  Branch (364:16): [True: 6.26M, False: 0]
  ------------------
  365|  6.26M|            cur = cur->children;
  366|  6.26M|            depth += 1;
  367|  6.26M|        }
  368|       |
  369|  13.4M|        next = cur->next;
  370|  13.4M|        parent = cur->parent;
  371|       |
  372|       |	/* unroll to speed up freeing the document */
  373|  13.4M|	if (cur->type != XML_DTD_NODE) {
  ------------------
  |  Branch (373:6): [True: 13.4M, False: 0]
  ------------------
  374|       |
  375|  13.4M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (375:10): [True: 0, False: 13.4M]
  |  Branch (375:36): [True: 0, False: 0]
  ------------------
  376|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  377|       |
  378|  13.4M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (378:11): [True: 6.51M, False: 6.93M]
  ------------------
  379|  6.93M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (379:4): [True: 7.07k, False: 6.93M]
  ------------------
  380|  6.93M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (380:4): [True: 3.09M, False: 3.84M]
  ------------------
  381|  9.61M|		(cur->properties != NULL))
  ------------------
  |  Branch (381:3): [True: 281k, False: 9.33M]
  ------------------
  382|   281k|		xmlTextReaderFreePropList(reader, cur->properties);
  383|  13.4M|	    if ((cur->content != (xmlChar *) &(cur->properties)) &&
  ------------------
  |  Branch (383:10): [True: 13.3M, False: 137k]
  ------------------
  384|  13.3M|	        (cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (384:10): [True: 6.80M, False: 6.51M]
  ------------------
  385|  6.80M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (385:3): [True: 6.79M, False: 7.07k]
  ------------------
  386|  6.79M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (386:3): [True: 3.70M, False: 3.09M]
  ------------------
  387|  3.70M|		(cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (387:3): [True: 3.67M, False: 29.0k]
  ------------------
  388|  3.67M|		DICT_FREE(cur->content);
  ------------------
  |  |  183|  3.67M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 3.62M, False: 50.1k]
  |  |  |  Branch (183:16): [True: 0, False: 3.62M]
  |  |  ------------------
  |  |  184|  3.62M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 3.62M, False: 214]
  |  |  ------------------
  |  |  185|  3.67M|	    xmlFree((char *)(str));
  ------------------
  389|  3.67M|	    }
  390|  13.4M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (390:11): [True: 6.51M, False: 6.93M]
  ------------------
  391|  6.93M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (391:11): [True: 7.07k, False: 6.93M]
  ------------------
  392|  6.93M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (392:4): [True: 3.09M, False: 3.84M]
  ------------------
  393|  9.61M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (393:3): [True: 3.14M, False: 6.46M]
  ------------------
  394|  3.14M|		xmlFreeNsList(cur->nsDef);
  395|       |
  396|       |	    /*
  397|       |	     * we don't free element names here they are interned now
  398|       |	     */
  399|  13.4M|	    if ((cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (399:10): [True: 9.77M, False: 3.67M]
  ------------------
  400|  9.77M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (400:3): [True: 9.70M, False: 74.1k]
  ------------------
  401|  9.70M|		DICT_FREE(cur->name);
  ------------------
  |  |  183|  9.70M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (183:6): [True: 9.69M, False: 8.85k]
  |  |  |  Branch (183:16): [True: 0, False: 9.69M]
  |  |  ------------------
  |  |  184|  9.69M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (184:6): [True: 186k, False: 9.50M]
  |  |  ------------------
  |  |  185|  9.70M|	    xmlFree((char *)(str));
  ------------------
  402|  13.4M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (402:11): [True: 6.51M, False: 6.93M]
  ------------------
  403|  6.93M|		 (cur->type == XML_TEXT_NODE)) &&
  ------------------
  |  Branch (403:4): [True: 3.67M, False: 3.26M]
  ------------------
  404|  10.1M|	        (reader != NULL) && (reader->ctxt != NULL) &&
  ------------------
  |  Branch (404:10): [True: 10.1M, False: 0]
  |  Branch (404:30): [True: 10.1M, False: 0]
  ------------------
  405|  10.1M|		(reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
  ------------------
  |  |   56|  10.1M|#define MAX_FREE_NODES 1
  ------------------
  |  Branch (405:3): [True: 21.6k, False: 10.1M]
  ------------------
  406|  21.6k|	        cur->next = reader->ctxt->freeElems;
  407|  21.6k|		reader->ctxt->freeElems = cur;
  408|  21.6k|		reader->ctxt->freeElemsNr++;
  409|  13.4M|	    } else {
  410|  13.4M|		xmlFree(cur);
  411|  13.4M|	    }
  412|  13.4M|	}
  413|       |
  414|  13.4M|        if (next != NULL) {
  ------------------
  |  Branch (414:13): [True: 6.68M, False: 6.76M]
  ------------------
  415|  6.68M|	    cur = next;
  416|  6.76M|        } else {
  417|  6.76M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (417:17): [True: 506k, False: 6.26M]
  |  Branch (417:33): [True: 0, False: 6.26M]
  ------------------
  418|   506k|                break;
  419|  6.26M|            depth -= 1;
  420|  6.26M|            cur = parent;
  421|       |            cur->children = NULL;
  422|  6.26M|        }
  423|  13.4M|    }
  424|   506k|}
xmlreader.c:xmlTextReaderFreePropList:
  322|   299k|xmlTextReaderFreePropList(xmlTextReaderPtr reader, xmlAttrPtr cur) {
  323|   299k|    xmlAttrPtr next;
  324|       |
  325|   785k|    while (cur != NULL) {
  ------------------
  |  Branch (325:12): [True: 485k, False: 299k]
  ------------------
  326|   485k|        next = cur->next;
  327|   485k|        xmlTextReaderFreeProp(reader, cur);
  328|   485k|	cur = next;
  329|   485k|    }
  330|   299k|}
xmlreader.c:xmlTextReaderErrMemory:
  206|  6.57k|xmlTextReaderErrMemory(xmlTextReaderPtr reader) {
  207|  6.57k|    if (reader == NULL) {
  ------------------
  |  Branch (207:9): [True: 0, False: 6.57k]
  ------------------
  208|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  209|      0|        return;
  210|      0|    }
  211|       |
  212|  6.57k|    if (reader->ctxt != NULL)
  ------------------
  |  Branch (212:9): [True: 6.57k, False: 0]
  ------------------
  213|  6.57k|        xmlCtxtErrMemory(reader->ctxt);
  214|      0|    else
  215|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  216|       |
  217|  6.57k|    reader->mode = XML_TEXTREADER_MODE_ERROR;
  218|  6.57k|    reader->state = XML_TEXTREADER_ERROR;
  219|  6.57k|}
xmlreader.c:xmlTextReaderStructuredRelay:
  558|   286k|{
  559|   286k|    xmlTextReaderPtr reader = (xmlTextReaderPtr) userData;
  560|       |
  561|   286k|    if (reader->sErrorFunc != NULL) {
  ------------------
  |  Branch (561:9): [True: 286k, False: 0]
  ------------------
  562|   286k|        reader->sErrorFunc(reader->errorFuncArg, error);
  563|   286k|    } 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|   286k|}
xmlreader.c:xmlTextReaderEntPush:
  593|  14.3k|{
  594|  14.3k|    if (reader->entNr >= reader->entMax) {
  ------------------
  |  Branch (594:9): [True: 487, False: 13.9k]
  ------------------
  595|    487|        xmlNodePtr *tmp;
  596|    487|        int newSize;
  597|       |
  598|    487|        newSize = xmlGrowCapacity(reader->entMax, sizeof(tmp[0]),
  599|    487|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|    487|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  600|    487|        if (newSize < 0) {
  ------------------
  |  Branch (600:13): [True: 0, False: 487]
  ------------------
  601|      0|            xmlTextReaderErrMemory(reader);
  602|      0|            return (-1);
  603|      0|        }
  604|    487|        tmp = xmlRealloc(reader->entTab, newSize * sizeof(tmp[0]));
  605|    487|        if (tmp == NULL) {
  ------------------
  |  Branch (605:13): [True: 3, False: 484]
  ------------------
  606|      3|            xmlTextReaderErrMemory(reader);
  607|      3|            return (-1);
  608|      3|        }
  609|    484|        reader->entTab = tmp;
  610|    484|        reader->entMax = newSize;
  611|    484|    }
  612|  14.3k|    reader->entTab[reader->entNr] = value;
  613|  14.3k|    reader->ent = value;
  614|  14.3k|    return (reader->entNr++);
  615|  14.3k|}
xmlreader.c:xmlTextReaderValidateEntity:
 1051|  1.64k|xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
 1052|  1.64k|    xmlNodePtr oldnode = reader->node;
 1053|  1.64k|    xmlNodePtr node = reader->node;
 1054|       |
 1055|  43.2k|    do {
 1056|  43.2k|	if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1056:6): [True: 19.2k, False: 23.9k]
  ------------------
 1057|  19.2k|	    if ((node->children != NULL) &&
  ------------------
  |  Branch (1057:10): [True: 17.9k, False: 1.26k]
  ------------------
 1058|  17.9k|		(node->children->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1058:3): [True: 17.9k, False: 0]
  ------------------
 1059|  17.9k|		(node->children->children != NULL)) {
  ------------------
  |  Branch (1059:3): [True: 14.3k, False: 3.59k]
  ------------------
 1060|  14.3k|		if (xmlTextReaderEntPush(reader, node) < 0) {
  ------------------
  |  Branch (1060:7): [True: 3, False: 14.3k]
  ------------------
 1061|      3|                    if (node == oldnode)
  ------------------
  |  Branch (1061:25): [True: 2, False: 1]
  ------------------
 1062|      2|                        break;
 1063|      1|                    goto skip_children;
 1064|      3|                }
 1065|  14.3k|		node = node->children->children;
 1066|  14.3k|		continue;
 1067|  14.3k|	    } else {
 1068|       |		/*
 1069|       |		 * The error has probably been raised already.
 1070|       |		 */
 1071|  4.85k|		if (node == oldnode)
  ------------------
  |  Branch (1071:7): [True: 360, False: 4.49k]
  ------------------
 1072|    360|		    break;
 1073|  4.49k|                goto skip_children;
 1074|  4.85k|	    }
 1075|  19.2k|#ifdef LIBXML_REGEXP_ENABLED
 1076|  23.9k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1076:13): [True: 5.79k, False: 18.1k]
  ------------------
 1077|  5.79k|	    reader->node = node;
 1078|  5.79k|	    if (xmlTextReaderValidatePush(reader) < 0)
  ------------------
  |  Branch (1078:10): [True: 10, False: 5.78k]
  ------------------
 1079|     10|                return(-1);
 1080|  18.1k|	} else if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1080:13): [True: 16.8k, False: 1.34k]
  ------------------
 1081|  17.4k|		   (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1081:6): [True: 605, False: 744]
  ------------------
 1082|  17.4k|            xmlTextReaderValidateCData(reader, node->content,
 1083|  17.4k|	                               xmlStrlen(node->content));
 1084|  17.4k|#endif
 1085|  17.4k|	}
 1086|       |
 1087|       |	/*
 1088|       |	 * go to next node
 1089|       |	 */
 1090|  23.9k|	if (node->children != NULL) {
  ------------------
  |  Branch (1090:6): [True: 3.54k, False: 20.4k]
  ------------------
 1091|  3.54k|	    node = node->children;
 1092|  3.54k|	    continue;
 1093|  20.4k|	} else if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1093:13): [True: 2.24k, False: 18.1k]
  ------------------
 1094|  2.24k|	    if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1094:10): [True: 7, False: 2.23k]
  ------------------
 1095|      7|                return(-1);
 1096|  2.24k|	}
 1097|  24.9k|skip_children:
 1098|  24.9k|	if (node->next != NULL) {
  ------------------
  |  Branch (1098:6): [True: 11.3k, False: 13.5k]
  ------------------
 1099|  11.3k|	    node = node->next;
 1100|  11.3k|	    continue;
 1101|  11.3k|	}
 1102|  17.8k|	do {
 1103|  17.8k|	    node = node->parent;
 1104|  17.8k|	    if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1104:10): [True: 3.53k, False: 14.3k]
  ------------------
 1105|  3.53k|	        xmlNodePtr tmp;
 1106|  3.53k|		if (reader->entNr == 0) {
  ------------------
  |  Branch (1106:7): [True: 0, False: 3.53k]
  ------------------
 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.53k|		reader->node = node;
 1116|  3.53k|		if (xmlTextReaderValidatePop(reader) < 0)
  ------------------
  |  Branch (1116:7): [True: 0, False: 3.53k]
  ------------------
 1117|      0|                    return(-1);
 1118|  3.53k|	    }
 1119|  17.8k|	    if ((node->type == XML_ENTITY_DECL) &&
  ------------------
  |  Branch (1119:10): [True: 14.3k, False: 3.53k]
  ------------------
 1120|  14.3k|		(reader->ent != NULL) && (reader->ent->children == node)) {
  ------------------
  |  Branch (1120:3): [True: 14.3k, False: 0]
  |  Branch (1120:28): [True: 14.3k, False: 0]
  ------------------
 1121|  14.3k|		node = xmlTextReaderEntPop(reader);
 1122|  14.3k|	    }
 1123|  17.8k|	    if (node == oldnode)
  ------------------
  |  Branch (1123:10): [True: 1.26k, False: 16.6k]
  ------------------
 1124|  1.26k|		break;
 1125|  16.6k|	    if (node->next != NULL) {
  ------------------
  |  Branch (1125:10): [True: 12.2k, False: 4.32k]
  ------------------
 1126|  12.2k|		node = node->next;
 1127|  12.2k|		break;
 1128|  12.2k|	    }
 1129|  16.6k|	} while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1129:11): [True: 4.32k, False: 0]
  |  Branch (1129:29): [True: 4.32k, False: 0]
  ------------------
 1130|  42.8k|    } while ((node != NULL) && (node != oldnode));
  ------------------
  |  Branch (1130:14): [True: 42.8k, False: 0]
  |  Branch (1130:32): [True: 41.5k, False: 1.26k]
  ------------------
 1131|  1.63k|    reader->node = oldnode;
 1132|       |
 1133|  1.63k|    return(0);
 1134|  1.64k|}
xmlreader.c:xmlTextReaderEntPop:
  625|  14.3k|{
  626|  14.3k|    xmlNodePtr ret;
  627|       |
  628|  14.3k|    if (reader->entNr <= 0)
  ------------------
  |  Branch (628:9): [True: 0, False: 14.3k]
  ------------------
  629|      0|        return (NULL);
  630|  14.3k|    reader->entNr--;
  631|  14.3k|    if (reader->entNr > 0)
  ------------------
  |  Branch (631:9): [True: 13.0k, False: 1.26k]
  ------------------
  632|  13.0k|        reader->ent = reader->entTab[reader->entNr - 1];
  633|  1.26k|    else
  634|  1.26k|        reader->ent = NULL;
  635|  14.3k|    ret = reader->entTab[reader->entNr];
  636|       |    reader->entTab[reader->entNr] = NULL;
  637|  14.3k|    return (ret);
  638|  14.3k|}
xmlreader.c:xmlTextReaderValidatePush:
  895|  4.88M|xmlTextReaderValidatePush(xmlTextReaderPtr reader) {
  896|  4.88M|    xmlNodePtr node = reader->node;
  897|       |
  898|  4.88M|#ifdef LIBXML_VALID_ENABLED
  899|  4.88M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (899:9): [True: 4.88M, False: 0]
  ------------------
  900|  4.88M|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (900:9): [True: 4.88M, False: 0]
  |  Branch (900:35): [True: 128k, False: 4.75M]
  ------------------
  901|   128k|	if ((node->ns == NULL) || (node->ns->prefix == NULL)) {
  ------------------
  |  Branch (901:6): [True: 109k, False: 18.5k]
  |  Branch (901:28): [True: 10.6k, False: 7.85k]
  ------------------
  902|   120k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  903|   120k|				    reader->ctxt->myDoc, node, node->name);
  904|   120k|	} else {
  905|  7.85k|            xmlChar buf[50];
  906|  7.85k|	    xmlChar *qname;
  907|       |
  908|  7.85k|	    qname = xmlBuildQName(node->name, node->ns->prefix, buf, 50);
  909|  7.85k|            if (qname == NULL) {
  ------------------
  |  Branch (909:17): [True: 12, False: 7.84k]
  ------------------
  910|     12|                xmlTextReaderErrMemory(reader);
  911|     12|                return(-1);
  912|     12|            }
  913|  7.84k|	    reader->ctxt->valid &= xmlValidatePushElement(&reader->ctxt->vctxt,
  914|  7.84k|				    reader->ctxt->myDoc, node, qname);
  915|  7.84k|            if (qname != buf)
  ------------------
  |  Branch (915:17): [True: 2.36k, False: 5.47k]
  ------------------
  916|  2.36k|	        xmlFree(qname);
  917|  7.84k|	}
  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|   128k|    }
  924|  4.88M|#endif /* LIBXML_VALID_ENABLED */
  925|  4.88M|#ifdef LIBXML_RELAXNG_ENABLED
  926|  4.88M|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (926:9): [True: 0, False: 4.88M]
  ------------------
  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|  4.88M|#endif
  952|       |
  953|  4.88M|    return(0);
  954|  4.88M|}
xmlreader.c:xmlTextReaderValidateCData:
  965|   606k|                           const xmlChar *data, int len) {
  966|   606k|#ifdef LIBXML_VALID_ENABLED
  967|   606k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
  ------------------
  |  Branch (967:9): [True: 606k, False: 0]
  ------------------
  968|   606k|        (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
  ------------------
  |  Branch (968:9): [True: 606k, False: 0]
  |  Branch (968:35): [True: 35.9k, False: 570k]
  ------------------
  969|  35.9k|	reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt,
  970|  35.9k|	                                            data, len);
  971|  35.9k|    }
  972|   606k|#endif /* LIBXML_VALID_ENABLED */
  973|   606k|#ifdef LIBXML_RELAXNG_ENABLED
  974|   606k|    if ((reader->validate == XML_TEXTREADER_VALIDATE_RNG) &&
  ------------------
  |  Branch (974:9): [True: 0, False: 606k]
  ------------------
  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|   606k|#endif
  984|   606k|}
xmlreader.c:xmlTextReaderDoExpand:
 1166|   355k|xmlTextReaderDoExpand(xmlTextReaderPtr reader) {
 1167|   355k|    int val;
 1168|       |
 1169|   355k|    if ((reader == NULL) || (reader->node == NULL) || (reader->ctxt == NULL))
  ------------------
  |  Branch (1169:9): [True: 0, False: 355k]
  |  Branch (1169:29): [True: 0, False: 355k]
  |  Branch (1169:55): [True: 0, False: 355k]
  ------------------
 1170|      0|        return(-1);
 1171|   359k|    do {
 1172|   359k|	if (PARSER_STOPPED(reader->ctxt))
  ------------------
  |  |   44|   359k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 26.5k, False: 333k]
  |  |  ------------------
  ------------------
 1173|  26.5k|            return(1);
 1174|       |
 1175|   333k|        if (xmlTextReaderGetSuccessor(reader->node) != NULL)
  ------------------
  |  Branch (1175:13): [True: 308k, False: 24.5k]
  ------------------
 1176|   308k|	    return(1);
 1177|  24.5k|	if (reader->ctxt->nodeNr < reader->depth)
  ------------------
  |  Branch (1177:6): [True: 1.93k, False: 22.6k]
  ------------------
 1178|  1.93k|	    return(1);
 1179|  22.6k|	if (reader->mode == XML_TEXTREADER_MODE_EOF)
  ------------------
  |  Branch (1179:6): [True: 5.44k, False: 17.1k]
  ------------------
 1180|  5.44k|	    return(1);
 1181|  17.1k|	val = xmlTextReaderPushData(reader);
 1182|  17.1k|	if (val < 0){
  ------------------
  |  Branch (1182:6): [True: 13.0k, False: 4.13k]
  ------------------
 1183|  13.0k|	    reader->mode = XML_TEXTREADER_MODE_ERROR;
 1184|  13.0k|            reader->state = XML_TEXTREADER_ERROR;
 1185|  13.0k|	    return(-1);
 1186|  13.0k|	}
 1187|  17.1k|    } while(reader->mode != XML_TEXTREADER_MODE_EOF);
  ------------------
  |  Branch (1187:13): [True: 4.07k, False: 58]
  ------------------
 1188|     58|    return(1);
 1189|   355k|}
xmlreader.c:xmlTextReaderGetSuccessor:
 1145|   333k|xmlTextReaderGetSuccessor(xmlNodePtr cur) {
 1146|   333k|    if (cur == NULL) return(NULL) ; /* ERROR */
  ------------------
  |  Branch (1146:9): [True: 0, False: 333k]
  ------------------
 1147|   333k|    if (cur->next != NULL) return(cur->next) ;
  ------------------
  |  Branch (1147:9): [True: 24.6k, False: 308k]
  ------------------
 1148|   672k|    do {
 1149|   672k|        cur = cur->parent;
 1150|   672k|        if (cur == NULL) break;
  ------------------
  |  Branch (1150:13): [True: 24.5k, False: 647k]
  ------------------
 1151|   647k|        if (cur->next != NULL) return(cur->next);
  ------------------
  |  Branch (1151:13): [True: 284k, False: 363k]
  ------------------
 1152|   647k|    } while (cur != NULL);
  ------------------
  |  Branch (1152:14): [True: 363k, False: 0]
  ------------------
 1153|  24.5k|    return(cur);
 1154|   308k|}
xmlreader.c:xmlTextReaderDumpCopy:
 1619|  46.8k|                      xmlNodePtr node) {
 1620|  46.8k|    if ((node->type == XML_ELEMENT_DECL) ||
  ------------------
  |  Branch (1620:9): [True: 401, False: 46.4k]
  ------------------
 1621|  46.4k|        (node->type == XML_ATTRIBUTE_DECL) ||
  ------------------
  |  Branch (1621:9): [True: 362, False: 46.0k]
  ------------------
 1622|  46.0k|        (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (1622:9): [True: 359, False: 45.6k]
  ------------------
 1623|  1.12k|        return;
 1624|       |
 1625|  45.6k|    if ((node->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1625:9): [True: 1.28k, False: 44.4k]
  ------------------
 1626|  44.4k|        (node->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (1626:9): [True: 0, False: 44.4k]
  ------------------
 1627|  1.28k|        xmlNodeDumpOutput(output, node->doc, node, 0, 0, NULL);
 1628|  44.4k|    } else {
 1629|  44.4k|        xmlNodePtr copy;
 1630|       |
 1631|       |        /*
 1632|       |         * Create a copy to make sure that namespace declarations from
 1633|       |         * ancestors are added.
 1634|       |         */
 1635|  44.4k|        copy = xmlDocCopyNode(node, node->doc, 1);
 1636|  44.4k|        if (copy == NULL) {
  ------------------
  |  Branch (1636:13): [True: 5.36k, False: 39.0k]
  ------------------
 1637|  5.36k|            xmlTextReaderErrMemory(reader);
 1638|  5.36k|            return;
 1639|  5.36k|        }
 1640|       |
 1641|  39.0k|        xmlNodeDumpOutput(output, copy->doc, copy, 0, 0, NULL);
 1642|       |
 1643|  39.0k|        xmlFreeNode(copy);
 1644|  39.0k|    }
 1645|  45.6k|}
xmlreader.c:xmlTextReaderStartElement:
  649|   130k|	                  const xmlChar **atts) {
  650|   130k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  651|   130k|    xmlTextReaderPtr reader = ctxt->_private;
  652|       |
  653|   130k|    if ((reader != NULL) && (reader->startElement != NULL)) {
  ------------------
  |  Branch (653:9): [True: 130k, False: 0]
  |  Branch (653:29): [True: 130k, False: 0]
  ------------------
  654|   130k|	reader->startElement(ctx, fullname, atts);
  655|   130k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (655:6): [True: 130k, False: 14]
  |  Branch (655:30): [True: 130k, False: 0]
  ------------------
  656|   130k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (656:6): [True: 130k, False: 0]
  |  Branch (656:36): [True: 27.1k, False: 102k]
  ------------------
  657|  27.1k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (657:6): [True: 25.8k, False: 1.36k]
  ------------------
  658|  25.8k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|  25.8k|#define NODE_IS_EMPTY		0x1
  ------------------
  659|   130k|    }
  660|   130k|    if (reader != NULL)
  ------------------
  |  Branch (660:9): [True: 130k, False: 0]
  ------------------
  661|   130k|	reader->state = XML_TEXTREADER_ELEMENT;
  662|   130k|}
xmlreader.c:xmlTextReaderEndElement:
  671|  40.4k|xmlTextReaderEndElement(void *ctx, const xmlChar *fullname) {
  672|  40.4k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  673|  40.4k|    xmlTextReaderPtr reader = ctxt->_private;
  674|       |
  675|  40.4k|    if ((reader != NULL) && (reader->endElement != NULL)) {
  ------------------
  |  Branch (675:9): [True: 40.4k, False: 0]
  |  Branch (675:29): [True: 40.4k, False: 0]
  ------------------
  676|  40.4k|	reader->endElement(ctx, fullname);
  677|  40.4k|    }
  678|  40.4k|}
xmlreader.c:xmlTextReaderStartElementNs:
  704|   297k|{
  705|   297k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  706|   297k|    xmlTextReaderPtr reader = ctxt->_private;
  707|       |
  708|   297k|    if ((reader != NULL) && (reader->startElementNs != NULL)) {
  ------------------
  |  Branch (708:9): [True: 297k, False: 0]
  |  Branch (708:29): [True: 297k, False: 0]
  ------------------
  709|   297k|	reader->startElementNs(ctx, localname, prefix, URI, nb_namespaces,
  710|   297k|	                       namespaces, nb_attributes, nb_defaulted,
  711|   297k|			       attributes);
  712|   297k|	if ((ctxt->node != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (712:6): [True: 297k, False: 26]
  |  Branch (712:30): [True: 297k, False: 0]
  ------------------
  713|   297k|	    (ctxt->input->cur != NULL) && (ctxt->input->cur[0] == '/') &&
  ------------------
  |  Branch (713:6): [True: 297k, False: 0]
  |  Branch (713:36): [True: 121k, False: 176k]
  ------------------
  714|   121k|	    (ctxt->input->cur[1] == '>'))
  ------------------
  |  Branch (714:6): [True: 118k, False: 2.86k]
  ------------------
  715|   118k|	    ctxt->node->extra = NODE_IS_EMPTY;
  ------------------
  |  |  169|   118k|#define NODE_IS_EMPTY		0x1
  ------------------
  716|   297k|    }
  717|   297k|    if (reader != NULL)
  ------------------
  |  Branch (717:9): [True: 297k, False: 0]
  ------------------
  718|   297k|	reader->state = XML_TEXTREADER_ELEMENT;
  719|   297k|}
xmlreader.c:xmlTextReaderEndElementNs:
  734|   151k|{
  735|   151k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  736|   151k|    xmlTextReaderPtr reader = ctxt->_private;
  737|       |
  738|   151k|    if ((reader != NULL) && (reader->endElementNs != NULL)) {
  ------------------
  |  Branch (738:9): [True: 151k, False: 0]
  |  Branch (738:29): [True: 151k, False: 0]
  ------------------
  739|   151k|	reader->endElementNs(ctx, localname, prefix, URI);
  740|   151k|    }
  741|   151k|}
xmlreader.c:xmlTextReaderCharacters:
  753|   359k|{
  754|   359k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  755|   359k|    xmlTextReaderPtr reader = ctxt->_private;
  756|       |
  757|   359k|    if ((reader != NULL) && (reader->characters != NULL)) {
  ------------------
  |  Branch (757:9): [True: 359k, False: 0]
  |  Branch (757:29): [True: 359k, False: 0]
  ------------------
  758|   359k|	reader->characters(ctx, ch, len);
  759|   359k|    }
  760|   359k|}
xmlreader.c:xmlTextReaderCDataBlock:
  771|  8.01k|{
  772|  8.01k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
  773|  8.01k|    xmlTextReaderPtr reader = ctxt->_private;
  774|       |
  775|  8.01k|    if ((reader != NULL) && (reader->cdataBlock != NULL)) {
  ------------------
  |  Branch (775:9): [True: 8.01k, False: 0]
  |  Branch (775:29): [True: 8.01k, False: 0]
  ------------------
  776|  8.01k|	reader->cdataBlock(ctx, ch, len);
  777|  8.01k|    }
  778|  8.01k|}
xmlreader.c:xmlTextReaderFreeDoc:
  508|  35.9k|xmlTextReaderFreeDoc(xmlTextReaderPtr reader, xmlDocPtr cur) {
  509|  35.9k|    xmlDtdPtr extSubset, intSubset;
  510|       |
  511|  35.9k|    if (cur == NULL) return;
  ------------------
  |  Branch (511:9): [True: 0, False: 35.9k]
  ------------------
  512|       |
  513|  35.9k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (513:9): [True: 0, False: 35.9k]
  |  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|  35.9k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (519:9): [True: 584, False: 35.3k]
  ------------------
  520|  35.9k|    cur->ids = NULL;
  521|  35.9k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (521:9): [True: 233, False: 35.6k]
  ------------------
  522|  35.9k|    cur->refs = NULL;
  523|  35.9k|    extSubset = cur->extSubset;
  524|  35.9k|    intSubset = cur->intSubset;
  525|  35.9k|    if (intSubset == extSubset)
  ------------------
  |  Branch (525:9): [True: 19.6k, False: 16.3k]
  ------------------
  526|  19.6k|	extSubset = NULL;
  527|  35.9k|    if (extSubset != NULL) {
  ------------------
  |  Branch (527:9): [True: 1.47k, False: 34.4k]
  ------------------
  528|  1.47k|	xmlUnlinkNode((xmlNodePtr) cur->extSubset);
  529|  1.47k|	cur->extSubset = NULL;
  530|  1.47k|	xmlFreeDtd(extSubset);
  531|  1.47k|    }
  532|  35.9k|    if (intSubset != NULL) {
  ------------------
  |  Branch (532:9): [True: 16.3k, False: 19.6k]
  ------------------
  533|  16.3k|	xmlUnlinkNode((xmlNodePtr) cur->intSubset);
  534|  16.3k|	cur->intSubset = NULL;
  535|  16.3k|	xmlFreeDtd(intSubset);
  536|  16.3k|    }
  537|       |
  538|  35.9k|    if (cur->children != NULL) xmlTextReaderFreeNodeList(reader, cur->children);
  ------------------
  |  Branch (538:9): [True: 25.7k, False: 10.2k]
  ------------------
  539|       |
  540|  35.9k|    if (cur->version != NULL) xmlFree(cur->version);
  ------------------
  |  Branch (540:9): [True: 35.9k, False: 0]
  ------------------
  541|  35.9k|    if (cur->name != NULL) xmlFree((char *) cur->name);
  ------------------
  |  Branch (541:9): [True: 0, False: 35.9k]
  ------------------
  542|  35.9k|    if (cur->encoding != NULL) xmlFree(cur->encoding);
  ------------------
  |  Branch (542:9): [True: 187, False: 35.7k]
  ------------------
  543|  35.9k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (543:9): [True: 4.17k, False: 31.7k]
  ------------------
  544|  35.9k|    if (cur->URL != NULL) xmlFree(cur->URL);
  ------------------
  |  Branch (544:9): [True: 0, False: 35.9k]
  ------------------
  545|  35.9k|    if (cur->dict != NULL) xmlDictFree(cur->dict);
  ------------------
  |  Branch (545:9): [True: 21.3k, False: 14.5k]
  ------------------
  546|       |
  547|  35.9k|    xmlFree(cur);
  548|  35.9k|}
xmlreader.c:readerStrdup:
  222|  12.4k|readerStrdup(xmlTextReaderPtr reader, const xmlChar *string) {
  223|  12.4k|    xmlChar *copy;
  224|       |
  225|  12.4k|    if (string == NULL)
  ------------------
  |  Branch (225:9): [True: 1.33k, False: 11.1k]
  ------------------
  226|  1.33k|        return(NULL);
  227|       |
  228|  11.1k|    copy = xmlStrdup(string);
  229|  11.1k|    if (copy == NULL)
  ------------------
  |  Branch (229:9): [True: 65, False: 11.0k]
  ------------------
  230|     65|        xmlTextReaderErrMemory(reader);
  231|       |
  232|  11.1k|    return(copy);
  233|  12.4k|}
xmlreader.c:constString:
  236|  62.8k|constString(xmlTextReaderPtr reader, const xmlChar *string) {
  237|  62.8k|    const xmlChar *dictString;
  238|       |
  239|  62.8k|    if (string == NULL)
  ------------------
  |  Branch (239:9): [True: 2.71k, False: 60.1k]
  ------------------
  240|  2.71k|        return(NULL);
  241|       |
  242|  60.1k|    dictString = xmlDictLookup(reader->dict, string, -1);
  243|  60.1k|    if (dictString == NULL)
  ------------------
  |  Branch (243:9): [True: 17, False: 60.1k]
  ------------------
  244|     17|        xmlTextReaderErrMemory(reader);
  245|       |
  246|  60.1k|    return(dictString);
  247|  62.8k|}
xmlreader.c:constQString:
  251|  3.18k|             const xmlChar *name) {
  252|  3.18k|    const xmlChar *dictString;
  253|       |
  254|  3.18k|    if (name == NULL)
  ------------------
  |  Branch (254:9): [True: 0, False: 3.18k]
  ------------------
  255|      0|        return(NULL);
  256|       |
  257|  3.18k|    dictString = xmlDictQLookup(reader->dict, prefix, name);
  258|  3.18k|    if (dictString == NULL)
  ------------------
  |  Branch (258:9): [True: 2, False: 3.17k]
  ------------------
  259|      2|        xmlTextReaderErrMemory(reader);
  260|       |
  261|  3.18k|    return(dictString);
  262|  3.18k|}

xmlRegNewExecCtxt:
 3615|  14.0k|xmlRegNewExecCtxt(xmlRegexp *comp, xmlRegExecCallbacks callback, void *data) {
 3616|  14.0k|    xmlRegExecCtxtPtr exec;
 3617|       |
 3618|  14.0k|    if (comp == NULL)
  ------------------
  |  Branch (3618:9): [True: 0, False: 14.0k]
  ------------------
 3619|      0|	return(NULL);
 3620|  14.0k|    if ((comp->compact == NULL) && (comp->states == NULL))
  ------------------
  |  Branch (3620:9): [True: 2.33k, False: 11.6k]
  |  Branch (3620:36): [True: 0, False: 2.33k]
  ------------------
 3621|      0|        return(NULL);
 3622|  14.0k|    exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
 3623|  14.0k|    if (exec == NULL)
  ------------------
  |  Branch (3623:9): [True: 29, False: 13.9k]
  ------------------
 3624|     29|	return(NULL);
 3625|  13.9k|    memset(exec, 0, sizeof(xmlRegExecCtxt));
 3626|  13.9k|    exec->inputString = NULL;
 3627|  13.9k|    exec->index = 0;
 3628|  13.9k|    exec->determinist = 1;
 3629|  13.9k|    exec->maxRollbacks = 0;
 3630|  13.9k|    exec->nbRollbacks = 0;
 3631|  13.9k|    exec->rollbacks = NULL;
 3632|  13.9k|    exec->status = XML_REGEXP_OK;
  ------------------
  |  |   11|  13.9k|#define XML_REGEXP_OK               0
  ------------------
 3633|  13.9k|    exec->comp = comp;
 3634|  13.9k|    if (comp->compact == NULL)
  ------------------
  |  Branch (3634:9): [True: 2.32k, False: 11.6k]
  ------------------
 3635|  2.32k|	exec->state = comp->states[0];
 3636|  13.9k|    exec->transno = 0;
 3637|  13.9k|    exec->transcount = 0;
 3638|  13.9k|    exec->callback = callback;
 3639|  13.9k|    exec->data = data;
 3640|  13.9k|    if (comp->nbCounters > 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 13.9k]
  ------------------
 3641|       |        /*
 3642|       |	 * For error handling, exec->counts is allocated twice the size
 3643|       |	 * the second half is used to store the data in case of rollback
 3644|       |	 */
 3645|      0|	exec->counts = (int *) xmlMalloc(comp->nbCounters * sizeof(int)
 3646|      0|	                                 * 2);
 3647|      0|	if (exec->counts == NULL) {
  ------------------
  |  Branch (3647:6): [True: 0, False: 0]
  ------------------
 3648|      0|	    xmlFree(exec);
 3649|      0|	    return(NULL);
 3650|      0|	}
 3651|      0|        memset(exec->counts, 0, comp->nbCounters * sizeof(int) * 2);
 3652|      0|	exec->errCounts = &exec->counts[comp->nbCounters];
 3653|  13.9k|    } else {
 3654|  13.9k|	exec->counts = NULL;
 3655|  13.9k|	exec->errCounts = NULL;
 3656|  13.9k|    }
 3657|  13.9k|    exec->inputStackMax = 0;
 3658|  13.9k|    exec->inputStackNr = 0;
 3659|  13.9k|    exec->inputStack = NULL;
 3660|  13.9k|    exec->errStateNo = -1;
 3661|       |    exec->errString = NULL;
 3662|  13.9k|    exec->nbPush = 0;
 3663|  13.9k|    return(exec);
 3664|  13.9k|}
xmlRegFreeExecCtxt:
 3674|  14.5k|xmlRegFreeExecCtxt(xmlRegExecCtxt *exec) {
 3675|  14.5k|    if (exec == NULL)
  ------------------
  |  Branch (3675:9): [True: 531, False: 13.9k]
  ------------------
 3676|    531|	return;
 3677|       |
 3678|  13.9k|    if (exec->rollbacks != NULL) {
  ------------------
  |  Branch (3678:9): [True: 891, False: 13.0k]
  ------------------
 3679|    891|	if (exec->counts != NULL) {
  ------------------
  |  Branch (3679:6): [True: 0, False: 891]
  ------------------
 3680|      0|	    int i;
 3681|       |
 3682|      0|	    for (i = 0;i < exec->maxRollbacks;i++)
  ------------------
  |  Branch (3682:17): [True: 0, False: 0]
  ------------------
 3683|      0|		if (exec->rollbacks[i].counts != NULL)
  ------------------
  |  Branch (3683:7): [True: 0, False: 0]
  ------------------
 3684|      0|		    xmlFree(exec->rollbacks[i].counts);
 3685|      0|	}
 3686|    891|	xmlFree(exec->rollbacks);
 3687|    891|    }
 3688|  13.9k|    if (exec->counts != NULL)
  ------------------
  |  Branch (3688:9): [True: 0, False: 13.9k]
  ------------------
 3689|      0|	xmlFree(exec->counts);
 3690|  13.9k|    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (3690:9): [True: 891, False: 13.0k]
  ------------------
 3691|    891|	int i;
 3692|       |
 3693|  64.9k|	for (i = 0;i < exec->inputStackNr;i++) {
  ------------------
  |  Branch (3693:13): [True: 64.0k, False: 891]
  ------------------
 3694|  64.0k|	    if (exec->inputStack[i].value != NULL)
  ------------------
  |  Branch (3694:10): [True: 64.0k, False: 0]
  ------------------
 3695|  64.0k|		xmlFree(exec->inputStack[i].value);
 3696|  64.0k|	}
 3697|    891|	xmlFree(exec->inputStack);
 3698|    891|    }
 3699|  13.9k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3699:9): [True: 5.42k, False: 8.55k]
  ------------------
 3700|  5.42k|        xmlFree(exec->errString);
 3701|  13.9k|    xmlFree(exec);
 3702|  13.9k|}
xmlRegExecPushString:
 4197|  90.5k|	             void *data) {
 4198|  90.5k|    return(xmlRegExecPushStringInternal(exec, value, data, 0));
 4199|  90.5k|}
xmlRegexpIsDeterminist:
 5558|  7.52k|xmlRegexpIsDeterminist(xmlRegexp *comp) {
 5559|  7.52k|    xmlAutomataPtr am;
 5560|  7.52k|    int ret;
 5561|       |
 5562|  7.52k|    if (comp == NULL)
  ------------------
  |  Branch (5562:9): [True: 0, False: 7.52k]
  ------------------
 5563|      0|	return(-1);
 5564|  7.52k|    if (comp->determinist != -1)
  ------------------
  |  Branch (5564:9): [True: 6.06k, False: 1.46k]
  ------------------
 5565|  6.06k|	return(comp->determinist);
 5566|       |
 5567|  1.46k|    am = xmlNewAutomata();
 5568|  1.46k|    if (am == NULL)
  ------------------
  |  Branch (5568:9): [True: 23, False: 1.44k]
  ------------------
 5569|     23|        return(-1);
 5570|  1.44k|    if (am->states != NULL) {
  ------------------
  |  Branch (5570:9): [True: 1.44k, False: 0]
  ------------------
 5571|  1.44k|	int i;
 5572|       |
 5573|  2.89k|	for (i = 0;i < am->nbStates;i++)
  ------------------
  |  Branch (5573:13): [True: 1.44k, False: 1.44k]
  ------------------
 5574|  1.44k|	    xmlRegFreeState(am->states[i]);
 5575|  1.44k|	xmlFree(am->states);
 5576|  1.44k|    }
 5577|  1.44k|    am->nbAtoms = comp->nbAtoms;
 5578|  1.44k|    am->atoms = comp->atoms;
 5579|  1.44k|    am->nbStates = comp->nbStates;
 5580|  1.44k|    am->states = comp->states;
 5581|  1.44k|    am->determinist = -1;
 5582|  1.44k|    am->flags = comp->flags;
 5583|  1.44k|    ret = xmlFAComputesDeterminism(am);
 5584|  1.44k|    am->atoms = NULL;
 5585|       |    am->states = NULL;
 5586|  1.44k|    xmlFreeAutomata(am);
 5587|  1.44k|    comp->determinist = ret;
 5588|  1.44k|    return(ret);
 5589|  1.46k|}
xmlRegFreeRegexp:
 5597|  1.37k|xmlRegFreeRegexp(xmlRegexp *regexp) {
 5598|  1.37k|    int i;
 5599|  1.37k|    if (regexp == NULL)
  ------------------
  |  Branch (5599:9): [True: 0, False: 1.37k]
  ------------------
 5600|      0|	return;
 5601|       |
 5602|  1.37k|    if (regexp->string != NULL)
  ------------------
  |  Branch (5602:9): [True: 0, False: 1.37k]
  ------------------
 5603|      0|	xmlFree(regexp->string);
 5604|  1.37k|    if (regexp->states != NULL) {
  ------------------
  |  Branch (5604:9): [True: 440, False: 933]
  ------------------
 5605|   220k|	for (i = 0;i < regexp->nbStates;i++)
  ------------------
  |  Branch (5605:13): [True: 219k, False: 440]
  ------------------
 5606|   219k|	    xmlRegFreeState(regexp->states[i]);
 5607|    440|	xmlFree(regexp->states);
 5608|    440|    }
 5609|  1.37k|    if (regexp->atoms != NULL) {
  ------------------
  |  Branch (5609:9): [True: 440, False: 933]
  ------------------
 5610|   170k|	for (i = 0;i < regexp->nbAtoms;i++)
  ------------------
  |  Branch (5610:13): [True: 170k, False: 440]
  ------------------
 5611|   170k|	    xmlRegFreeAtom(regexp->atoms[i]);
 5612|    440|	xmlFree(regexp->atoms);
 5613|    440|    }
 5614|  1.37k|    if (regexp->counters != NULL)
  ------------------
  |  Branch (5614:9): [True: 0, False: 1.37k]
  ------------------
 5615|      0|	xmlFree(regexp->counters);
 5616|  1.37k|    if (regexp->compact != NULL)
  ------------------
  |  Branch (5616:9): [True: 933, False: 440]
  ------------------
 5617|    933|	xmlFree(regexp->compact);
 5618|  1.37k|    if (regexp->transdata != NULL)
  ------------------
  |  Branch (5618:9): [True: 0, False: 1.37k]
  ------------------
 5619|      0|	xmlFree(regexp->transdata);
 5620|  1.37k|    if (regexp->stringMap != NULL) {
  ------------------
  |  Branch (5620:9): [True: 933, False: 440]
  ------------------
 5621|  4.65k|	for (i = 0; i < regexp->nbstrings;i++)
  ------------------
  |  Branch (5621:14): [True: 3.71k, False: 933]
  ------------------
 5622|  3.71k|	    xmlFree(regexp->stringMap[i]);
 5623|    933|	xmlFree(regexp->stringMap);
 5624|    933|    }
 5625|       |
 5626|  1.37k|    xmlFree(regexp);
 5627|  1.37k|}
xmlNewAutomata:
 5643|  3.38k|xmlNewAutomata(void) {
 5644|  3.38k|    xmlAutomataPtr ctxt;
 5645|       |
 5646|  3.38k|    ctxt = xmlRegNewParserCtxt(NULL);
 5647|  3.38k|    if (ctxt == NULL)
  ------------------
  |  Branch (5647:9): [True: 8, False: 3.37k]
  ------------------
 5648|      8|	return(NULL);
 5649|       |
 5650|       |    /* initialize the parser */
 5651|  3.37k|    ctxt->state = xmlRegStatePush(ctxt);
 5652|  3.37k|    if (ctxt->state == NULL) {
  ------------------
  |  Branch (5652:9): [True: 29, False: 3.34k]
  ------------------
 5653|     29|	xmlFreeAutomata(ctxt);
 5654|     29|	return(NULL);
 5655|     29|    }
 5656|  3.34k|    ctxt->start = ctxt->state;
 5657|  3.34k|    ctxt->end = NULL;
 5658|       |
 5659|  3.34k|    ctxt->start->type = XML_REGEXP_START_STATE;
 5660|  3.34k|    ctxt->flags = 0;
 5661|       |
 5662|  3.34k|    return(ctxt);
 5663|  3.37k|}
xmlFreeAutomata:
 5673|  3.37k|xmlFreeAutomata(xmlAutomata *am) {
 5674|  3.37k|    if (am == NULL)
  ------------------
  |  Branch (5674:9): [True: 0, False: 3.37k]
  ------------------
 5675|      0|	return;
 5676|  3.37k|    xmlRegFreeParserCtxt(am);
 5677|  3.37k|}
xmlAutomataGetInitState:
 5703|  1.89k|xmlAutomataGetInitState(xmlAutomata *am) {
 5704|  1.89k|    if (am == NULL)
  ------------------
  |  Branch (5704:9): [True: 0, False: 1.89k]
  ------------------
 5705|      0|	return(NULL);
 5706|  1.89k|    return(am->start);
 5707|  1.89k|}
xmlAutomataSetFinalState:
 5719|  1.88k|xmlAutomataSetFinalState(xmlAutomata *am, xmlAutomataState *state) {
 5720|  1.88k|    if ((am == NULL) || (state == NULL))
  ------------------
  |  Branch (5720:9): [True: 0, False: 1.88k]
  |  Branch (5720:25): [True: 72, False: 1.81k]
  ------------------
 5721|     72|	return(-1);
 5722|  1.81k|    state->type = XML_REGEXP_FINAL_STATE;
 5723|  1.81k|    return(0);
 5724|  1.88k|}
xmlAutomataNewTransition:
 5745|   295k|			 void *data) {
 5746|   295k|    xmlRegAtomPtr atom;
 5747|       |
 5748|   295k|    if ((am == NULL) || (from == NULL) || (token == NULL))
  ------------------
  |  Branch (5748:9): [True: 0, False: 295k]
  |  Branch (5748:25): [True: 3.92k, False: 291k]
  |  Branch (5748:43): [True: 0, False: 291k]
  ------------------
 5749|  3.92k|	return(NULL);
 5750|   291k|    atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
 5751|   291k|    if (atom == NULL)
  ------------------
  |  Branch (5751:9): [True: 44, False: 291k]
  ------------------
 5752|     44|        return(NULL);
 5753|   291k|    atom->data = data;
 5754|   291k|    atom->valuep = xmlStrdup(token);
 5755|   291k|    if (atom->valuep == NULL) {
  ------------------
  |  Branch (5755:9): [True: 38, False: 291k]
  ------------------
 5756|     38|        xmlRegFreeAtom(atom);
 5757|     38|        xmlRegexpErrMemory(am);
 5758|     38|        return(NULL);
 5759|     38|    }
 5760|       |
 5761|   291k|    if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
  ------------------
  |  Branch (5761:9): [True: 62, False: 291k]
  ------------------
 5762|     62|        xmlRegFreeAtom(atom);
 5763|     62|	return(NULL);
 5764|     62|    }
 5765|   291k|    if (to == NULL)
  ------------------
  |  Branch (5765:9): [True: 250k, False: 40.5k]
  ------------------
 5766|   250k|	return(am->state);
 5767|  40.5k|    return(to);
 5768|   291k|}
xmlAutomataNewState:
 6229|  31.4k|xmlAutomataNewState(xmlAutomata *am) {
 6230|  31.4k|    if (am == NULL)
  ------------------
  |  Branch (6230:9): [True: 0, False: 31.4k]
  ------------------
 6231|      0|	return(NULL);
 6232|  31.4k|    return(xmlRegStatePush(am));
 6233|  31.4k|}
xmlAutomataNewEpsilon:
 6249|   295k|		      xmlAutomataState *to) {
 6250|   295k|    if ((am == NULL) || (from == NULL))
  ------------------
  |  Branch (6250:9): [True: 0, False: 295k]
  |  Branch (6250:25): [True: 947, False: 294k]
  ------------------
 6251|    947|	return(NULL);
 6252|   294k|    xmlFAGenerateEpsilonTransition(am, from, to);
 6253|   294k|    if (to == NULL)
  ------------------
  |  Branch (6253:9): [True: 90.8k, False: 203k]
  ------------------
 6254|  90.8k|	return(am->state);
 6255|   203k|    return(to);
 6256|   294k|}
xmlAutomataCompile:
 6366|  1.88k|xmlAutomataCompile(xmlAutomata *am) {
 6367|  1.88k|    xmlRegexpPtr ret;
 6368|       |
 6369|  1.88k|    if ((am == NULL) || (am->error != 0)) return(NULL);
  ------------------
  |  Branch (6369:9): [True: 0, False: 1.88k]
  |  Branch (6369:25): [True: 324, False: 1.55k]
  ------------------
 6370|  1.55k|    xmlFAEliminateEpsilonTransitions(am);
 6371|  1.55k|    if (am->error != 0)
  ------------------
  |  Branch (6371:9): [True: 84, False: 1.47k]
  ------------------
 6372|     84|        return(NULL);
 6373|       |    /* xmlFAComputesDeterminism(am); */
 6374|  1.47k|    ret = xmlRegEpxFromParse(am);
 6375|       |
 6376|  1.47k|    return(ret);
 6377|  1.55k|}
xmlregexp.c:xmlRegExecPushStringInternal:
 3886|  90.5k|	                     void *data, int compound) {
 3887|  90.5k|    xmlRegTransPtr trans;
 3888|  90.5k|    xmlRegAtomPtr atom;
 3889|  90.5k|    int ret;
 3890|  90.5k|    int final = 0;
 3891|  90.5k|    int progress = 1;
 3892|       |
 3893|  90.5k|    if (exec == NULL)
  ------------------
  |  Branch (3893:9): [True: 0, False: 90.5k]
  ------------------
 3894|      0|	return(-1);
 3895|  90.5k|    if (exec->comp == NULL)
  ------------------
  |  Branch (3895:9): [True: 0, False: 90.5k]
  ------------------
 3896|      0|	return(-1);
 3897|  90.5k|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  90.5k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3897:9): [True: 11.6k, False: 78.8k]
  ------------------
 3898|  11.6k|	return(exec->status);
 3899|       |
 3900|  78.8k|    if (exec->comp->compact != NULL)
  ------------------
  |  Branch (3900:9): [True: 12.4k, False: 66.4k]
  ------------------
 3901|  12.4k|	return(xmlRegCompactPushString(exec, exec->comp, value, data));
 3902|       |
 3903|  66.4k|    if (value == NULL) {
  ------------------
  |  Branch (3903:9): [True: 1.27k, False: 65.1k]
  ------------------
 3904|  1.27k|        if (exec->state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (3904:13): [True: 844, False: 432]
  ------------------
 3905|    844|	    return(1);
 3906|    432|	final = 1;
 3907|    432|    }
 3908|       |
 3909|       |    /*
 3910|       |     * If we have an active rollback stack push the new value there
 3911|       |     * and get back to where we were left
 3912|       |     */
 3913|  65.5k|    if ((value != NULL) && (exec->inputStackNr > 0)) {
  ------------------
  |  Branch (3913:9): [True: 65.1k, False: 432]
  |  Branch (3913:28): [True: 63.1k, False: 1.99k]
  ------------------
 3914|  63.1k|	xmlFARegExecSaveInputString(exec, value, data);
 3915|  63.1k|	value = exec->inputStack[exec->index].value;
 3916|  63.1k|	data = exec->inputStack[exec->index].data;
 3917|  63.1k|    }
 3918|       |
 3919|  96.9M|    while ((exec->status == XML_REGEXP_OK) &&
  ------------------
  |  |   11|  96.9M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3919:12): [True: 96.9M, False: 1.37k]
  ------------------
 3920|  96.9M|	   ((value != NULL) ||
  ------------------
  |  Branch (3920:6): [True: 96.5M, False: 389k]
  ------------------
 3921|   389k|	    ((final == 1) &&
  ------------------
  |  Branch (3921:7): [True: 325k, False: 64.0k]
  ------------------
 3922|  96.9M|	     (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
  ------------------
  |  Branch (3922:7): [True: 325k, False: 104]
  ------------------
 3923|       |
 3924|       |	/*
 3925|       |	 * End of input on non-terminal state, rollback, however we may
 3926|       |	 * still have epsilon like transition for counted transitions
 3927|       |	 * on counters, in that case don't break too early.
 3928|       |	 */
 3929|  96.9M|	if ((value == NULL) && (exec->counts == NULL))
  ------------------
  |  Branch (3929:6): [True: 325k, False: 96.5M]
  |  Branch (3929:25): [True: 325k, False: 0]
  ------------------
 3930|   325k|	    goto rollback;
 3931|       |
 3932|  96.5M|	exec->transcount = 0;
 3933|   192M|	for (;exec->transno < exec->state->nbTrans;exec->transno++) {
  ------------------
  |  Branch (3933:8): [True: 144M, False: 48.0M]
  ------------------
 3934|   144M|	    trans = &exec->state->trans[exec->transno];
 3935|   144M|	    if (trans->to < 0)
  ------------------
  |  Branch (3935:10): [True: 48.1M, False: 96.6M]
  ------------------
 3936|  48.1M|		continue;
 3937|  96.6M|	    atom = trans->atom;
 3938|  96.6M|	    ret = 0;
 3939|  96.6M|	    if (trans->count == REGEXP_ALL_LAX_COUNTER) {
  ------------------
  |  |  405|  96.6M|#define REGEXP_ALL_LAX_COUNTER	0x123457
  ------------------
  |  Branch (3939:10): [True: 0, False: 96.6M]
  ------------------
 3940|      0|		int i;
 3941|      0|		int count;
 3942|      0|		xmlRegTransPtr t;
 3943|      0|		xmlRegCounterPtr counter;
 3944|       |
 3945|      0|		ret = 0;
 3946|       |
 3947|       |		/*
 3948|       |		 * Check all counted transitions from the current state
 3949|       |		 */
 3950|      0|		if ((value == NULL) && (final)) {
  ------------------
  |  Branch (3950:7): [True: 0, False: 0]
  |  Branch (3950:26): [True: 0, False: 0]
  ------------------
 3951|      0|		    ret = 1;
 3952|      0|		} else if (value != NULL) {
  ------------------
  |  Branch (3952:14): [True: 0, False: 0]
  ------------------
 3953|      0|		    for (i = 0;i < exec->state->nbTrans;i++) {
  ------------------
  |  Branch (3953:18): [True: 0, False: 0]
  ------------------
 3954|      0|			t = &exec->state->trans[i];
 3955|      0|			if ((t->counter < 0) || (t == trans))
  ------------------
  |  Branch (3955:8): [True: 0, False: 0]
  |  Branch (3955:28): [True: 0, False: 0]
  ------------------
 3956|      0|			    continue;
 3957|      0|			counter = &exec->comp->counters[t->counter];
 3958|      0|			count = exec->counts[t->counter];
 3959|      0|			if ((count < counter->max) &&
  ------------------
  |  Branch (3959:8): [True: 0, False: 0]
  ------------------
 3960|      0|		            (t->atom != NULL) &&
  ------------------
  |  Branch (3960:15): [True: 0, False: 0]
  ------------------
 3961|      0|			    (xmlStrEqual(value, t->atom->valuep))) {
  ------------------
  |  Branch (3961:8): [True: 0, False: 0]
  ------------------
 3962|      0|			    ret = 0;
 3963|      0|			    break;
 3964|      0|			}
 3965|      0|			if ((count >= counter->min) &&
  ------------------
  |  Branch (3965:8): [True: 0, False: 0]
  ------------------
 3966|      0|			    (count < counter->max) &&
  ------------------
  |  Branch (3966:8): [True: 0, False: 0]
  ------------------
 3967|      0|			    (t->atom != NULL) &&
  ------------------
  |  Branch (3967:8): [True: 0, False: 0]
  ------------------
 3968|      0|			    (xmlStrEqual(value, t->atom->valuep))) {
  ------------------
  |  Branch (3968:8): [True: 0, False: 0]
  ------------------
 3969|      0|			    ret = 1;
 3970|      0|			    break;
 3971|      0|			}
 3972|      0|		    }
 3973|      0|		}
 3974|  96.6M|	    } else if (trans->count == REGEXP_ALL_COUNTER) {
  ------------------
  |  |  404|  96.6M|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (3974:17): [True: 0, False: 96.6M]
  ------------------
 3975|      0|		int i;
 3976|      0|		int count;
 3977|      0|		xmlRegTransPtr t;
 3978|      0|		xmlRegCounterPtr counter;
 3979|       |
 3980|      0|		ret = 1;
 3981|       |
 3982|       |		/*
 3983|       |		 * Check all counted transitions from the current state
 3984|       |		 */
 3985|      0|		for (i = 0;i < exec->state->nbTrans;i++) {
  ------------------
  |  Branch (3985:14): [True: 0, False: 0]
  ------------------
 3986|      0|                    t = &exec->state->trans[i];
 3987|      0|		    if ((t->counter < 0) || (t == trans))
  ------------------
  |  Branch (3987:11): [True: 0, False: 0]
  |  Branch (3987:31): [True: 0, False: 0]
  ------------------
 3988|      0|			continue;
 3989|      0|                    counter = &exec->comp->counters[t->counter];
 3990|      0|		    count = exec->counts[t->counter];
 3991|      0|		    if ((count < counter->min) || (count > counter->max)) {
  ------------------
  |  Branch (3991:11): [True: 0, False: 0]
  |  Branch (3991:37): [True: 0, False: 0]
  ------------------
 3992|      0|			ret = 0;
 3993|      0|			break;
 3994|      0|		    }
 3995|      0|		}
 3996|  96.6M|	    } else if (trans->count >= 0) {
  ------------------
  |  Branch (3996:17): [True: 0, False: 96.6M]
  ------------------
 3997|      0|		int count;
 3998|      0|		xmlRegCounterPtr counter;
 3999|       |
 4000|       |		/*
 4001|       |		 * A counted transition.
 4002|       |		 */
 4003|       |
 4004|      0|		count = exec->counts[trans->count];
 4005|      0|		counter = &exec->comp->counters[trans->count];
 4006|      0|		ret = ((count >= counter->min) && (count <= counter->max));
  ------------------
  |  Branch (4006:10): [True: 0, False: 0]
  |  Branch (4006:37): [True: 0, False: 0]
  ------------------
 4007|  96.6M|	    } else if (atom == NULL) {
  ------------------
  |  Branch (4007:17): [True: 0, False: 96.6M]
  ------------------
 4008|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4009|      0|		break;
 4010|  96.6M|	    } else if (value != NULL) {
  ------------------
  |  Branch (4010:17): [True: 96.6M, False: 0]
  ------------------
 4011|  96.6M|		ret = xmlRegStrEqualWildcard(atom->valuep, value);
 4012|  96.6M|		if (atom->neg) {
  ------------------
  |  Branch (4012:7): [True: 0, False: 96.6M]
  ------------------
 4013|      0|		    ret = !ret;
 4014|      0|		    if (!compound)
  ------------------
  |  Branch (4014:11): [True: 0, False: 0]
  ------------------
 4015|      0|		        ret = 0;
 4016|      0|		}
 4017|  96.6M|		if ((ret == 1) && (trans->counter >= 0)) {
  ------------------
  |  Branch (4017:7): [True: 48.4M, False: 48.1M]
  |  Branch (4017:21): [True: 0, False: 48.4M]
  ------------------
 4018|      0|		    xmlRegCounterPtr counter;
 4019|      0|		    int count;
 4020|       |
 4021|      0|		    count = exec->counts[trans->counter];
 4022|      0|		    counter = &exec->comp->counters[trans->counter];
 4023|      0|		    if (count >= counter->max)
  ------------------
  |  Branch (4023:11): [True: 0, False: 0]
  ------------------
 4024|      0|			ret = 0;
 4025|      0|		}
 4026|       |
 4027|  96.6M|		if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
  ------------------
  |  Branch (4027:7): [True: 48.4M, False: 48.1M]
  |  Branch (4027:21): [True: 0, False: 48.4M]
  |  Branch (4027:40): [True: 0, False: 0]
  ------------------
 4028|      0|		    xmlRegStatePtr to = exec->comp->states[trans->to];
 4029|       |
 4030|       |		    /*
 4031|       |		     * this is a multiple input sequence
 4032|       |		     */
 4033|      0|		    if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4033:11): [True: 0, False: 0]
  ------------------
 4034|      0|			if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4034:8): [True: 0, False: 0]
  ------------------
 4035|      0|			    xmlFARegExecSaveInputString(exec, value, data);
 4036|      0|			}
 4037|      0|			xmlFARegExecSave(exec);
 4038|      0|		    }
 4039|      0|		    exec->transcount = 1;
 4040|      0|		    do {
 4041|       |			/*
 4042|       |			 * Try to progress as much as possible on the input
 4043|       |			 */
 4044|      0|			if (exec->transcount == atom->max) {
  ------------------
  |  Branch (4044:8): [True: 0, False: 0]
  ------------------
 4045|      0|			    break;
 4046|      0|			}
 4047|      0|			exec->index++;
 4048|      0|			value = exec->inputStack[exec->index].value;
 4049|      0|			data = exec->inputStack[exec->index].data;
 4050|       |
 4051|       |			/*
 4052|       |			 * End of input: stop here
 4053|       |			 */
 4054|      0|			if (value == NULL) {
  ------------------
  |  Branch (4054:8): [True: 0, False: 0]
  ------------------
 4055|      0|			    exec->index --;
 4056|      0|			    break;
 4057|      0|			}
 4058|      0|			if (exec->transcount >= atom->min) {
  ------------------
  |  Branch (4058:8): [True: 0, False: 0]
  ------------------
 4059|      0|			    int transno = exec->transno;
 4060|      0|			    xmlRegStatePtr state = exec->state;
 4061|       |
 4062|       |			    /*
 4063|       |			     * The transition is acceptable save it
 4064|       |			     */
 4065|      0|			    exec->transno = -1; /* trick */
 4066|      0|			    exec->state = to;
 4067|      0|			    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4067:12): [True: 0, False: 0]
  ------------------
 4068|      0|				xmlFARegExecSaveInputString(exec, value, data);
 4069|      0|			    }
 4070|      0|			    xmlFARegExecSave(exec);
 4071|      0|			    exec->transno = transno;
 4072|      0|			    exec->state = state;
 4073|      0|			}
 4074|      0|			ret = xmlStrEqual(value, atom->valuep);
 4075|      0|			exec->transcount++;
 4076|      0|		    } while (ret == 1);
  ------------------
  |  Branch (4076:16): [True: 0, False: 0]
  ------------------
 4077|      0|		    if (exec->transcount < atom->min)
  ------------------
  |  Branch (4077:11): [True: 0, False: 0]
  ------------------
 4078|      0|			ret = 0;
 4079|       |
 4080|       |		    /*
 4081|       |		     * If the last check failed but one transition was found
 4082|       |		     * possible, rollback
 4083|       |		     */
 4084|      0|		    if (ret < 0)
  ------------------
  |  Branch (4084:11): [True: 0, False: 0]
  ------------------
 4085|      0|			ret = 0;
 4086|      0|		    if (ret == 0) {
  ------------------
  |  Branch (4086:11): [True: 0, False: 0]
  ------------------
 4087|      0|			goto rollback;
 4088|      0|		    }
 4089|      0|		}
 4090|  96.6M|	    }
 4091|  96.6M|	    if (ret == 1) {
  ------------------
  |  Branch (4091:10): [True: 48.4M, False: 48.1M]
  ------------------
 4092|  48.4M|		if ((exec->callback != NULL) && (atom != NULL) &&
  ------------------
  |  Branch (4092:7): [True: 0, False: 48.4M]
  |  Branch (4092:35): [True: 0, False: 0]
  ------------------
 4093|      0|			(data != NULL)) {
  ------------------
  |  Branch (4093:4): [True: 0, False: 0]
  ------------------
 4094|      0|		    exec->callback(exec->data, atom->valuep,
 4095|      0|			           atom->data, data);
 4096|      0|		}
 4097|  48.4M|		if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4097:7): [True: 48.4M, False: 64.9k]
  ------------------
 4098|  48.4M|		    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4098:11): [True: 892, False: 48.4M]
  ------------------
 4099|    892|			xmlFARegExecSaveInputString(exec, value, data);
 4100|    892|		    }
 4101|  48.4M|		    xmlFARegExecSave(exec);
 4102|  48.4M|		}
 4103|  48.4M|		if (trans->counter >= 0) {
  ------------------
  |  Branch (4103:7): [True: 0, False: 48.4M]
  ------------------
 4104|      0|		    exec->counts[trans->counter]++;
 4105|      0|		}
 4106|  48.4M|		if ((trans->count >= 0) &&
  ------------------
  |  Branch (4106:7): [True: 0, False: 48.4M]
  ------------------
 4107|      0|		    (trans->count < REGEXP_ALL_COUNTER)) {
  ------------------
  |  |  404|      0|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (4107:7): [True: 0, False: 0]
  ------------------
 4108|      0|		    exec->counts[trans->count] = 0;
 4109|      0|		}
 4110|  48.4M|                if ((exec->comp->states[trans->to] != NULL) &&
  ------------------
  |  Branch (4110:21): [True: 48.4M, False: 0]
  ------------------
 4111|  48.4M|		    (exec->comp->states[trans->to]->type ==
  ------------------
  |  Branch (4111:7): [True: 0, False: 48.4M]
  ------------------
 4112|  48.4M|		     XML_REGEXP_SINK_STATE)) {
 4113|       |		    /*
 4114|       |		     * entering a sink state, save the current state as error
 4115|       |		     * state.
 4116|       |		     */
 4117|      0|                    if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4117:25): [True: 0, False: 0]
  ------------------
 4118|      0|                        break;
 4119|      0|		    exec->errState = exec->state;
 4120|      0|		    memcpy(exec->errCounts, exec->counts,
 4121|      0|			   exec->comp->nbCounters * sizeof(int));
 4122|      0|		}
 4123|  48.4M|		exec->state = exec->comp->states[trans->to];
 4124|  48.4M|		exec->transno = 0;
 4125|  48.4M|		if (trans->atom != NULL) {
  ------------------
  |  Branch (4125:7): [True: 48.4M, False: 0]
  ------------------
 4126|  48.4M|		    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (4126:11): [True: 48.4M, False: 344]
  ------------------
 4127|  48.4M|			exec->index++;
 4128|  48.4M|			if (exec->index < exec->inputStackNr) {
  ------------------
  |  Branch (4128:8): [True: 48.0M, False: 388k]
  ------------------
 4129|  48.0M|			    value = exec->inputStack[exec->index].value;
 4130|  48.0M|			    data = exec->inputStack[exec->index].data;
 4131|  48.0M|			} else {
 4132|   388k|			    value = NULL;
 4133|   388k|			    data = NULL;
 4134|   388k|			}
 4135|  48.4M|		    } else {
 4136|    344|			value = NULL;
 4137|    344|			data = NULL;
 4138|    344|		    }
 4139|  48.4M|		}
 4140|  48.4M|		goto progress;
 4141|  48.4M|	    } else if (ret < 0) {
  ------------------
  |  Branch (4141:17): [True: 0, False: 48.1M]
  ------------------
 4142|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4143|      0|		break;
 4144|      0|	    }
 4145|  96.6M|	}
 4146|  48.0M|	if ((exec->transno != 0) || (exec->state->nbTrans == 0)) {
  ------------------
  |  Branch (4146:6): [True: 48.0M, False: 284]
  |  Branch (4146:30): [True: 284, False: 0]
  ------------------
 4147|  48.4M|rollback:
 4148|       |            /*
 4149|       |	     * if we didn't yet rollback on the current input
 4150|       |	     * store the current state as the error state.
 4151|       |	     */
 4152|  48.4M|	    if ((progress) && (exec->state != NULL) &&
  ------------------
  |  Branch (4152:10): [True: 434k, False: 47.9M]
  |  Branch (4152:24): [True: 434k, False: 0]
  ------------------
 4153|   434k|	        (exec->state->type != XML_REGEXP_SINK_STATE)) {
  ------------------
  |  Branch (4153:10): [True: 434k, False: 0]
  ------------------
 4154|   434k|	        progress = 0;
 4155|   434k|                if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4155:21): [True: 2, False: 434k]
  ------------------
 4156|      2|                    break;
 4157|   434k|		exec->errState = exec->state;
 4158|   434k|                if (exec->comp->nbCounters)
  ------------------
  |  Branch (4158:21): [True: 0, False: 434k]
  ------------------
 4159|      0|                    memcpy(exec->errCounts, exec->counts,
 4160|      0|                           exec->comp->nbCounters * sizeof(int));
 4161|   434k|	    }
 4162|       |
 4163|       |	    /*
 4164|       |	     * Failed to find a way out
 4165|       |	     */
 4166|  48.4M|	    exec->determinist = 0;
 4167|  48.4M|	    xmlFARegExecRollBack(exec);
 4168|  48.4M|	    if ((exec->inputStack != NULL ) &&
  ------------------
  |  Branch (4168:10): [True: 48.4M, False: 917]
  ------------------
 4169|  48.4M|                (exec->status == XML_REGEXP_OK)) {
  ------------------
  |  |   11|  48.4M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4169:17): [True: 48.4M, False: 452]
  ------------------
 4170|  48.4M|		value = exec->inputStack[exec->index].value;
 4171|  48.4M|		data = exec->inputStack[exec->index].data;
 4172|  48.4M|	    }
 4173|  48.4M|	}
 4174|  48.4M|	continue;
 4175|  48.4M|progress:
 4176|  48.4M|        progress = 1;
 4177|  48.4M|    }
 4178|  65.5k|    if (exec->status == XML_REGEXP_OK) {
  ------------------
  |  |   11|  65.5k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4178:9): [True: 64.1k, False: 1.37k]
  ------------------
 4179|  64.1k|        return(exec->state->type == XML_REGEXP_FINAL_STATE);
 4180|  64.1k|    }
 4181|  1.37k|    return(exec->status);
 4182|  65.5k|}
xmlregexp.c:xmlFARegExecSaveInputString:
 3722|  64.0k|	                    void *data) {
 3723|  64.0k|    if (exec->inputStackNr + 1 >= exec->inputStackMax) {
  ------------------
  |  Branch (3723:9): [True: 2.25k, False: 61.7k]
  ------------------
 3724|  2.25k|	xmlRegInputTokenPtr tmp;
 3725|  2.25k|        int newSize;
 3726|       |
 3727|  2.25k|        newSize = xmlGrowCapacity(exec->inputStackMax, sizeof(tmp[0]),
 3728|  2.25k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  2.25k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3729|  2.25k|	if (newSize < 0) {
  ------------------
  |  Branch (3729:6): [True: 0, False: 2.25k]
  ------------------
 3730|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3731|      0|	    return;
 3732|      0|	}
 3733|  2.25k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3734|  2.25k|        if (newSize < 2)
  ------------------
  |  Branch (3734:13): [True: 892, False: 1.36k]
  ------------------
 3735|    892|            newSize = 2;
 3736|  2.25k|#endif
 3737|  2.25k|	tmp = xmlRealloc(exec->inputStack, newSize * sizeof(tmp[0]));
 3738|  2.25k|	if (tmp == NULL) {
  ------------------
  |  Branch (3738:6): [True: 1, False: 2.25k]
  ------------------
 3739|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3740|      1|	    return;
 3741|      1|	}
 3742|  2.25k|	exec->inputStack = tmp;
 3743|  2.25k|	exec->inputStackMax = newSize;
 3744|  2.25k|    }
 3745|  64.0k|    if (value == NULL) {
  ------------------
  |  Branch (3745:9): [True: 0, False: 64.0k]
  ------------------
 3746|      0|        exec->inputStack[exec->inputStackNr].value = NULL;
 3747|  64.0k|    } else {
 3748|  64.0k|        exec->inputStack[exec->inputStackNr].value = xmlStrdup(value);
 3749|  64.0k|        if (exec->inputStack[exec->inputStackNr].value == NULL) {
  ------------------
  |  Branch (3749:13): [True: 1, False: 64.0k]
  ------------------
 3750|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3751|      1|            return;
 3752|      1|        }
 3753|  64.0k|    }
 3754|  64.0k|    exec->inputStack[exec->inputStackNr].data = data;
 3755|  64.0k|    exec->inputStackNr++;
 3756|  64.0k|    exec->inputStack[exec->inputStackNr].value = NULL;
 3757|       |    exec->inputStack[exec->inputStackNr].data = NULL;
 3758|  64.0k|}
xmlregexp.c:xmlRegStrEqualWildcard:
 3772|   127M|xmlRegStrEqualWildcard(const xmlChar *expStr, const xmlChar *valStr) {
 3773|   127M|    if (expStr == valStr) return(1);
  ------------------
  |  Branch (3773:9): [True: 0, False: 127M]
  ------------------
 3774|   127M|    if (expStr == NULL) return(0);
  ------------------
  |  Branch (3774:9): [True: 0, False: 127M]
  ------------------
 3775|   127M|    if (valStr == NULL) return(0);
  ------------------
  |  Branch (3775:9): [True: 0, False: 127M]
  ------------------
 3776|   146M|    do {
 3777|       |	/*
 3778|       |	* Eval if we have a wildcard for the current item.
 3779|       |	*/
 3780|   146M|        if (*expStr != *valStr) {
  ------------------
  |  Branch (3780:13): [True: 72.1M, False: 74.1M]
  ------------------
 3781|       |	    /* if one of them starts with a wildcard make valStr be it */
 3782|  72.1M|	    if (*valStr == '*') {
  ------------------
  |  Branch (3782:10): [True: 0, False: 72.1M]
  ------------------
 3783|      0|	        const xmlChar *tmp;
 3784|       |
 3785|      0|		tmp = valStr;
 3786|      0|		valStr = expStr;
 3787|      0|		expStr = tmp;
 3788|      0|	    }
 3789|  72.1M|	    if ((*valStr != 0) && (*expStr != 0) && (*expStr++ == '*')) {
  ------------------
  |  Branch (3789:10): [True: 72.1M, False: 0]
  |  Branch (3789:28): [True: 70.8M, False: 1.28M]
  |  Branch (3789:46): [True: 0, False: 70.8M]
  ------------------
 3790|      0|		do {
 3791|      0|		    if (*valStr == XML_REG_STRING_SEPARATOR)
  ------------------
  |  |   56|      0|#define XML_REG_STRING_SEPARATOR '|'
  ------------------
  |  Branch (3791:11): [True: 0, False: 0]
  ------------------
 3792|      0|			break;
 3793|      0|		    valStr++;
 3794|      0|		} while (*valStr != 0);
  ------------------
  |  Branch (3794:12): [True: 0, False: 0]
  ------------------
 3795|      0|		continue;
 3796|      0|	    } else
 3797|  72.1M|		return(0);
 3798|  72.1M|	}
 3799|  74.1M|	expStr++;
 3800|  74.1M|	valStr++;
 3801|  74.1M|    } while (*valStr != 0);
  ------------------
  |  Branch (3801:14): [True: 18.6M, False: 55.5M]
  ------------------
 3802|  55.5M|    if (*expStr != 0)
  ------------------
  |  Branch (3802:9): [True: 1.24M, False: 54.3M]
  ------------------
 3803|  1.24M|	return (0);
 3804|  54.3M|    else
 3805|  54.3M|	return (1);
 3806|  55.5M|}
xmlregexp.c:xmlFARegExecSave:
 3241|  48.4M|xmlFARegExecSave(xmlRegExecCtxtPtr exec) {
 3242|  48.4M|#ifdef MAX_PUSH
 3243|  48.4M|    if (exec->nbPush > MAX_PUSH) {
  ------------------
  |  |   41|  48.4M|#define MAX_PUSH 10000000
  ------------------
  |  Branch (3243:9): [True: 3, False: 48.4M]
  ------------------
 3244|      3|        exec->status = XML_REGEXP_INTERNAL_LIMIT;
  ------------------
  |  |   15|      3|#define XML_REGEXP_INTERNAL_LIMIT   (-6)
  ------------------
 3245|      3|        return;
 3246|      3|    }
 3247|  48.4M|    exec->nbPush++;
 3248|  48.4M|#endif
 3249|       |
 3250|  48.4M|    if (exec->nbRollbacks >= exec->maxRollbacks) {
  ------------------
  |  Branch (3250:9): [True: 2.31k, False: 48.4M]
  ------------------
 3251|  2.31k|	xmlRegExecRollback *tmp;
 3252|  2.31k|        int newSize;
 3253|  2.31k|	int len = exec->nbRollbacks;
 3254|       |
 3255|  2.31k|        newSize = xmlGrowCapacity(exec->maxRollbacks, sizeof(tmp[0]),
 3256|  2.31k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  2.31k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3257|  2.31k|	if (newSize < 0) {
  ------------------
  |  Branch (3257:6): [True: 0, False: 2.31k]
  ------------------
 3258|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3259|      0|	    return;
 3260|      0|	}
 3261|  2.31k|	tmp = xmlRealloc(exec->rollbacks, newSize * sizeof(tmp[0]));
 3262|  2.31k|	if (tmp == NULL) {
  ------------------
  |  Branch (3262:6): [True: 1, False: 2.31k]
  ------------------
 3263|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3264|      1|	    return;
 3265|      1|	}
 3266|  2.31k|	exec->rollbacks = tmp;
 3267|  2.31k|	exec->maxRollbacks = newSize;
 3268|  2.31k|	tmp = &exec->rollbacks[len];
 3269|  2.31k|	memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback));
 3270|  2.31k|    }
 3271|  48.4M|    exec->rollbacks[exec->nbRollbacks].state = exec->state;
 3272|  48.4M|    exec->rollbacks[exec->nbRollbacks].index = exec->index;
 3273|  48.4M|    exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1;
 3274|  48.4M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3274:9): [True: 0, False: 48.4M]
  ------------------
 3275|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3275:6): [True: 0, False: 0]
  ------------------
 3276|      0|	    exec->rollbacks[exec->nbRollbacks].counts = (int *)
 3277|      0|		xmlMalloc(exec->comp->nbCounters * sizeof(int));
 3278|      0|	    if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3278:10): [True: 0, False: 0]
  ------------------
 3279|      0|		exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3280|      0|		return;
 3281|      0|	    }
 3282|      0|	}
 3283|      0|	memcpy(exec->rollbacks[exec->nbRollbacks].counts, exec->counts,
 3284|      0|	       exec->comp->nbCounters * sizeof(int));
 3285|      0|    }
 3286|  48.4M|    exec->nbRollbacks++;
 3287|  48.4M|}
xmlregexp.c:xmlRegExecSetErrString:
 3705|   439k|xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) {
 3706|   439k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3706:9): [True: 108k, False: 330k]
  ------------------
 3707|   108k|        xmlFree(exec->errString);
 3708|   439k|    if (value == NULL) {
  ------------------
  |  Branch (3708:9): [True: 325k, False: 114k]
  ------------------
 3709|   325k|        exec->errString = NULL;
 3710|   325k|    } else {
 3711|   114k|        exec->errString = xmlStrdup(value);
 3712|   114k|        if (exec->errString == NULL) {
  ------------------
  |  Branch (3712:13): [True: 28, False: 113k]
  ------------------
 3713|     28|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|     28|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3714|     28|            return(-1);
 3715|     28|        }
 3716|   114k|    }
 3717|   439k|    return(0);
 3718|   439k|}
xmlregexp.c:xmlFARegExecRollBack:
 3290|  48.4M|xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) {
 3291|  48.4M|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  48.4M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3291:9): [True: 0, False: 48.4M]
  ------------------
 3292|      0|        return;
 3293|  48.4M|    if (exec->nbRollbacks <= 0) {
  ------------------
  |  Branch (3293:9): [True: 1.36k, False: 48.4M]
  ------------------
 3294|  1.36k|	exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  1.36k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3295|  1.36k|	return;
 3296|  1.36k|    }
 3297|  48.4M|    exec->nbRollbacks--;
 3298|  48.4M|    exec->state = exec->rollbacks[exec->nbRollbacks].state;
 3299|  48.4M|    exec->index = exec->rollbacks[exec->nbRollbacks].index;
 3300|  48.4M|    exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch;
 3301|  48.4M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3301:9): [True: 0, False: 48.4M]
  ------------------
 3302|      0|	if (exec->rollbacks[exec->nbRollbacks].counts == NULL) {
  ------------------
  |  Branch (3302:6): [True: 0, False: 0]
  ------------------
 3303|      0|	    exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 3304|      0|	    return;
 3305|      0|	}
 3306|      0|	if (exec->counts) {
  ------------------
  |  Branch (3306:6): [True: 0, False: 0]
  ------------------
 3307|      0|	    memcpy(exec->counts, exec->rollbacks[exec->nbRollbacks].counts,
 3308|      0|	       exec->comp->nbCounters * sizeof(int));
 3309|      0|	}
 3310|      0|    }
 3311|  48.4M|}
xmlregexp.c:xmlRegCompactPushString:
 3822|  12.4k|	                void *data) {
 3823|  12.4k|    int state = exec->index;
 3824|  12.4k|    int i, target;
 3825|       |
 3826|  12.4k|    if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL))
  ------------------
  |  Branch (3826:9): [True: 0, False: 12.4k]
  |  Branch (3826:27): [True: 0, False: 12.4k]
  |  Branch (3826:54): [True: 0, False: 12.4k]
  ------------------
 3827|      0|	return(-1);
 3828|       |
 3829|  12.4k|    if (value == NULL) {
  ------------------
  |  Branch (3829:9): [True: 6.41k, False: 6.06k]
  ------------------
 3830|       |	/*
 3831|       |	 * are we at a final state ?
 3832|       |	 */
 3833|  6.41k|	if (comp->compact[state * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3833:6): [True: 2.11k, False: 4.29k]
  ------------------
 3834|  6.41k|            XML_REGEXP_FINAL_STATE)
 3835|  2.11k|	    return(1);
 3836|  4.29k|	return(0);
 3837|  6.41k|    }
 3838|       |
 3839|       |    /*
 3840|       |     * Examine all outside transitions from current state
 3841|       |     */
 3842|  19.2k|    for (i = 0;i < comp->nbstrings;i++) {
  ------------------
  |  Branch (3842:16): [True: 14.8k, False: 4.39k]
  ------------------
 3843|  14.8k|	target = comp->compact[state * (comp->nbstrings + 1) + i + 1];
 3844|  14.8k|	if ((target > 0) && (target <= comp->nbstates)) {
  ------------------
  |  Branch (3844:6): [True: 9.64k, False: 5.25k]
  |  Branch (3844:22): [True: 9.64k, False: 0]
  ------------------
 3845|  9.64k|	    target--; /* to avoid 0 */
 3846|  9.64k|	    if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) {
  ------------------
  |  Branch (3846:10): [True: 1.67k, False: 7.96k]
  ------------------
 3847|  1.67k|		exec->index = target;
 3848|  1.67k|		if ((exec->callback != NULL) && (comp->transdata != NULL)) {
  ------------------
  |  Branch (3848:7): [True: 0, False: 1.67k]
  |  Branch (3848:35): [True: 0, False: 0]
  ------------------
 3849|      0|		    exec->callback(exec->data, value,
 3850|      0|			  comp->transdata[state * comp->nbstrings + i], data);
 3851|      0|		}
 3852|  1.67k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3852:7): [True: 0, False: 1.67k]
  ------------------
 3853|  1.67k|		    XML_REGEXP_SINK_STATE)
 3854|      0|		    goto error;
 3855|       |
 3856|  1.67k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3856:7): [True: 1.43k, False: 241]
  ------------------
 3857|  1.67k|		    XML_REGEXP_FINAL_STATE)
 3858|  1.43k|		    return(1);
 3859|    241|		return(0);
 3860|  1.67k|	    }
 3861|  9.64k|	}
 3862|  14.8k|    }
 3863|       |    /*
 3864|       |     * Failed to find an exit transition out from current state for the
 3865|       |     * current token
 3866|       |     */
 3867|  4.39k|error:
 3868|  4.39k|    exec->errStateNo = state;
 3869|  4.39k|    exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  4.39k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3870|  4.39k|    xmlRegExecSetErrString(exec, value);
 3871|  4.39k|    return(exec->status);
 3872|  6.06k|}
xmlregexp.c:xmlRegNewParserCtxt:
  731|  3.38k|xmlRegNewParserCtxt(const xmlChar *string) {
  732|  3.38k|    xmlRegParserCtxtPtr ret;
  733|       |
  734|  3.38k|    ret = (xmlRegParserCtxtPtr) xmlMalloc(sizeof(xmlRegParserCtxt));
  735|  3.38k|    if (ret == NULL)
  ------------------
  |  Branch (735:9): [True: 8, False: 3.37k]
  ------------------
  736|      8|	return(NULL);
  737|  3.37k|    memset(ret, 0, sizeof(xmlRegParserCtxt));
  738|  3.37k|    if (string != NULL) {
  ------------------
  |  Branch (738:9): [True: 0, False: 3.37k]
  ------------------
  739|      0|        ret->string = xmlStrdup(string);
  740|      0|        if (ret->string == NULL) {
  ------------------
  |  Branch (740:13): [True: 0, False: 0]
  ------------------
  741|      0|            xmlFree(ret);
  742|      0|            return(NULL);
  743|      0|        }
  744|      0|        ret->len = strlen((const char *) ret->string);
  745|      0|    }
  746|  3.37k|    ret->cur = ret->string;
  747|  3.37k|    ret->neg = 0;
  748|  3.37k|    ret->negs = 0;
  749|  3.37k|    ret->error = 0;
  750|  3.37k|    ret->determinist = -1;
  751|  3.37k|    return(ret);
  752|  3.37k|}
xmlregexp.c:xmlRegStatePush:
 1578|   376k|xmlRegStatePush(xmlRegParserCtxtPtr ctxt) {
 1579|   376k|    xmlRegStatePtr state;
 1580|       |
 1581|   376k|    if (ctxt->nbStates >= ctxt->maxStates) {
  ------------------
  |  Branch (1581:9): [True: 13.4k, False: 363k]
  ------------------
 1582|  13.4k|	xmlRegStatePtr *tmp;
 1583|  13.4k|        int newSize;
 1584|       |
 1585|  13.4k|        newSize = xmlGrowCapacity(ctxt->maxStates, sizeof(tmp[0]),
 1586|  13.4k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  13.4k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1587|  13.4k|	if (newSize < 0) {
  ------------------
  |  Branch (1587:6): [True: 0, False: 13.4k]
  ------------------
 1588|      0|	    xmlRegexpErrMemory(ctxt);
 1589|      0|	    return(NULL);
 1590|      0|	}
 1591|  13.4k|	tmp = xmlRealloc(ctxt->states, newSize * sizeof(tmp[0]));
 1592|  13.4k|	if (tmp == NULL) {
  ------------------
  |  Branch (1592:6): [True: 39, False: 13.4k]
  ------------------
 1593|     39|	    xmlRegexpErrMemory(ctxt);
 1594|     39|	    return(NULL);
 1595|     39|	}
 1596|  13.4k|	ctxt->states = tmp;
 1597|  13.4k|	ctxt->maxStates = newSize;
 1598|  13.4k|    }
 1599|       |
 1600|   376k|    state = xmlRegNewState(ctxt);
 1601|   376k|    if (state == NULL)
  ------------------
  |  Branch (1601:9): [True: 77, False: 376k]
  ------------------
 1602|     77|        return(NULL);
 1603|       |
 1604|   376k|    state->no = ctxt->nbStates;
 1605|   376k|    ctxt->states[ctxt->nbStates++] = state;
 1606|       |
 1607|   376k|    return(state);
 1608|   376k|}
xmlregexp.c:xmlRegNewState:
  919|   376k|xmlRegNewState(xmlRegParserCtxtPtr ctxt) {
  920|   376k|    xmlRegStatePtr ret;
  921|       |
  922|   376k|    ret = (xmlRegStatePtr) xmlMalloc(sizeof(xmlRegState));
  923|   376k|    if (ret == NULL) {
  ------------------
  |  Branch (923:9): [True: 77, False: 376k]
  ------------------
  924|     77|	xmlRegexpErrMemory(ctxt);
  925|     77|	return(NULL);
  926|     77|    }
  927|   376k|    memset(ret, 0, sizeof(xmlRegState));
  928|   376k|    ret->type = XML_REGEXP_TRANS_STATE;
  929|   376k|    ret->mark = XML_REGEXP_MARK_NORMAL;
  930|   376k|    return(ret);
  931|   376k|}
xmlregexp.c:xmlFAEliminateEpsilonTransitions:
 2076|  1.55k|xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2077|  1.55k|    int statenr, transnr;
 2078|  1.55k|    xmlRegStatePtr state;
 2079|  1.55k|    int has_epsilon;
 2080|       |
 2081|  1.55k|    if (ctxt->states == NULL) return;
  ------------------
  |  Branch (2081:9): [True: 0, False: 1.55k]
  ------------------
 2082|       |
 2083|       |    /*
 2084|       |     * Eliminate simple epsilon transition and the associated unreachable
 2085|       |     * states.
 2086|       |     */
 2087|  1.55k|    xmlFAEliminateSimpleEpsilonTransitions(ctxt);
 2088|   237k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2088:22): [True: 235k, False: 1.55k]
  ------------------
 2089|   235k|	state = ctxt->states[statenr];
 2090|   235k|	if ((state != NULL) && (state->type == XML_REGEXP_UNREACH_STATE)) {
  ------------------
  |  Branch (2090:6): [True: 235k, False: 0]
  |  Branch (2090:25): [True: 91.2k, False: 144k]
  ------------------
 2091|  91.2k|	    xmlRegFreeState(state);
 2092|  91.2k|	    ctxt->states[statenr] = NULL;
 2093|  91.2k|	}
 2094|   235k|    }
 2095|       |
 2096|  1.55k|    has_epsilon = 0;
 2097|       |
 2098|       |    /*
 2099|       |     * Build the completed transitions bypassing the epsilons
 2100|       |     * Use a marking algorithm to avoid loops
 2101|       |     * Mark sink states too.
 2102|       |     * Process from the latest states backward to the start when
 2103|       |     * there is long cascading epsilon chains this minimize the
 2104|       |     * recursions and transition compares when adding the new ones
 2105|       |     */
 2106|   237k|    for (statenr = ctxt->nbStates - 1;statenr >= 0;statenr--) {
  ------------------
  |  Branch (2106:39): [True: 235k, False: 1.55k]
  ------------------
 2107|   235k|	state = ctxt->states[statenr];
 2108|   235k|	if (state == NULL)
  ------------------
  |  Branch (2108:6): [True: 91.2k, False: 144k]
  ------------------
 2109|  91.2k|	    continue;
 2110|   144k|	if ((state->nbTrans == 0) &&
  ------------------
  |  Branch (2110:6): [True: 1.35k, False: 142k]
  ------------------
 2111|  1.35k|	    (state->type != XML_REGEXP_FINAL_STATE)) {
  ------------------
  |  Branch (2111:6): [True: 0, False: 1.35k]
  ------------------
 2112|      0|	    state->type = XML_REGEXP_SINK_STATE;
 2113|      0|	}
 2114|  2.04M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2114:19): [True: 1.90M, False: 144k]
  ------------------
 2115|  1.90M|	    if ((state->trans[transnr].atom == NULL) &&
  ------------------
  |  Branch (2115:10): [True: 149k, False: 1.75M]
  ------------------
 2116|   149k|		(state->trans[transnr].to >= 0)) {
  ------------------
  |  Branch (2116:3): [True: 90.4k, False: 59.0k]
  ------------------
 2117|  90.4k|		if (state->trans[transnr].to == statenr) {
  ------------------
  |  Branch (2117:7): [True: 0, False: 90.4k]
  ------------------
 2118|      0|		    state->trans[transnr].to = -1;
 2119|  90.4k|		} else if (state->trans[transnr].count < 0) {
  ------------------
  |  Branch (2119:14): [True: 90.4k, False: 0]
  ------------------
 2120|  90.4k|		    int newto = state->trans[transnr].to;
 2121|       |
 2122|  90.4k|		    has_epsilon = 1;
 2123|  90.4k|		    state->trans[transnr].to = -2;
 2124|  90.4k|		    state->mark = XML_REGEXP_MARK_START;
 2125|  90.4k|		    xmlFAReduceEpsilonTransitions(ctxt, statenr,
 2126|  90.4k|				      newto, state->trans[transnr].counter);
 2127|  90.4k|		    xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
 2128|  90.4k|		    state->mark = XML_REGEXP_MARK_NORMAL;
 2129|  90.4k|	        }
 2130|  90.4k|	    }
 2131|  1.90M|	}
 2132|   144k|    }
 2133|       |    /*
 2134|       |     * Eliminate the epsilon transitions
 2135|       |     */
 2136|  1.55k|    if (has_epsilon) {
  ------------------
  |  Branch (2136:9): [True: 1.20k, False: 353]
  ------------------
 2137|   235k|	for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2137:19): [True: 234k, False: 1.20k]
  ------------------
 2138|   234k|	    state = ctxt->states[statenr];
 2139|   234k|	    if (state == NULL)
  ------------------
  |  Branch (2139:10): [True: 91.1k, False: 143k]
  ------------------
 2140|  91.1k|		continue;
 2141|  2.04M|	    for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2141:23): [True: 1.90M, False: 143k]
  ------------------
 2142|  1.90M|		xmlRegTransPtr trans = &(state->trans[transnr]);
 2143|  1.90M|		if ((trans->atom == NULL) &&
  ------------------
  |  Branch (2143:7): [True: 149k, False: 1.75M]
  ------------------
 2144|   149k|		    (trans->count < 0) &&
  ------------------
  |  Branch (2144:7): [True: 149k, False: 0]
  ------------------
 2145|   149k|		    (trans->to >= 0)) {
  ------------------
  |  Branch (2145:7): [True: 0, False: 149k]
  ------------------
 2146|      0|		    trans->to = -1;
 2147|      0|		}
 2148|  1.90M|	    }
 2149|   143k|	}
 2150|  1.20k|    }
 2151|       |
 2152|       |    /*
 2153|       |     * Use this pass to detect unreachable states too
 2154|       |     */
 2155|   237k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2155:22): [True: 235k, False: 1.55k]
  ------------------
 2156|   235k|	state = ctxt->states[statenr];
 2157|   235k|	if (state != NULL)
  ------------------
  |  Branch (2157:6): [True: 144k, False: 91.2k]
  ------------------
 2158|   144k|	    state->reached = XML_REGEXP_MARK_NORMAL;
 2159|   235k|    }
 2160|  1.55k|    state = ctxt->states[0];
 2161|  1.55k|    if (state != NULL)
  ------------------
  |  Branch (2161:9): [True: 1.55k, False: 0]
  ------------------
 2162|  1.55k|	state->reached = XML_REGEXP_MARK_START;
 2163|   124k|    while (state != NULL) {
  ------------------
  |  Branch (2163:12): [True: 122k, False: 1.55k]
  ------------------
 2164|   122k|	xmlRegStatePtr target = NULL;
 2165|   122k|	state->reached = XML_REGEXP_MARK_VISITED;
 2166|       |	/*
 2167|       |	 * Mark all states reachable from the current reachable state
 2168|       |	 */
 2169|  1.74M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2169:19): [True: 1.62M, False: 122k]
  ------------------
 2170|  1.62M|	    if ((state->trans[transnr].to >= 0) &&
  ------------------
  |  Branch (2170:10): [True: 1.48M, False: 137k]
  ------------------
 2171|  1.48M|		((state->trans[transnr].atom != NULL) ||
  ------------------
  |  Branch (2171:4): [True: 1.48M, False: 0]
  ------------------
 2172|  1.48M|		 (state->trans[transnr].count >= 0))) {
  ------------------
  |  Branch (2172:4): [True: 0, False: 0]
  ------------------
 2173|  1.48M|		int newto = state->trans[transnr].to;
 2174|       |
 2175|  1.48M|		if (ctxt->states[newto] == NULL)
  ------------------
  |  Branch (2175:7): [True: 2, False: 1.48M]
  ------------------
 2176|      2|		    continue;
 2177|  1.48M|		if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
  ------------------
  |  Branch (2177:7): [True: 121k, False: 1.36M]
  ------------------
 2178|   121k|		    ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
 2179|   121k|		    target = ctxt->states[newto];
 2180|   121k|		}
 2181|  1.48M|	    }
 2182|  1.62M|	}
 2183|       |
 2184|       |	/*
 2185|       |	 * find the next accessible state not explored
 2186|       |	 */
 2187|   122k|	if (target == NULL) {
  ------------------
  |  Branch (2187:6): [True: 45.8k, False: 76.9k]
  ------------------
 2188|   317M|	    for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2188:23): [True: 317M, False: 1.55k]
  ------------------
 2189|   317M|		state = ctxt->states[statenr];
 2190|   317M|		if ((state != NULL) && (state->reached ==
  ------------------
  |  Branch (2190:7): [True: 157M, False: 160M]
  |  Branch (2190:26): [True: 44.3k, False: 157M]
  ------------------
 2191|   157M|			XML_REGEXP_MARK_START)) {
 2192|  44.3k|		    target = state;
 2193|  44.3k|		    break;
 2194|  44.3k|		}
 2195|   317M|	    }
 2196|  45.8k|	}
 2197|   122k|	state = target;
 2198|   122k|    }
 2199|   237k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2199:22): [True: 235k, False: 1.55k]
  ------------------
 2200|   235k|	state = ctxt->states[statenr];
 2201|   235k|	if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
  ------------------
  |  Branch (2201:6): [True: 144k, False: 91.2k]
  |  Branch (2201:25): [True: 21.5k, False: 122k]
  ------------------
 2202|  21.5k|	    xmlRegFreeState(state);
 2203|  21.5k|	    ctxt->states[statenr] = NULL;
 2204|  21.5k|	}
 2205|   235k|    }
 2206|       |
 2207|  1.55k|}
xmlregexp.c:xmlFAEliminateSimpleEpsilonTransitions:
 2025|  1.55k|xmlFAEliminateSimpleEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2026|  1.55k|    int statenr, i, j, newto;
 2027|  1.55k|    xmlRegStatePtr state, tmp;
 2028|       |
 2029|   237k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2029:22): [True: 235k, False: 1.55k]
  ------------------
 2030|   235k|	state = ctxt->states[statenr];
 2031|   235k|	if (state == NULL)
  ------------------
  |  Branch (2031:6): [True: 0, False: 235k]
  ------------------
 2032|      0|	    continue;
 2033|   235k|	if (state->nbTrans != 1)
  ------------------
  |  Branch (2033:6): [True: 90.1k, False: 145k]
  ------------------
 2034|  90.1k|	    continue;
 2035|   145k|       if (state->type == XML_REGEXP_UNREACH_STATE ||
  ------------------
  |  Branch (2035:12): [True: 0, False: 145k]
  ------------------
 2036|   145k|           state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2036:12): [True: 203, False: 145k]
  ------------------
 2037|    203|	    continue;
 2038|       |	/* is the only transition out a basic transition */
 2039|   145k|	if ((state->trans[0].atom == NULL) &&
  ------------------
  |  Branch (2039:6): [True: 92.0k, False: 53.1k]
  ------------------
 2040|  92.0k|	    (state->trans[0].to >= 0) &&
  ------------------
  |  Branch (2040:6): [True: 92.0k, False: 5]
  ------------------
 2041|  92.0k|	    (state->trans[0].to != statenr) &&
  ------------------
  |  Branch (2041:6): [True: 92.0k, False: 0]
  ------------------
 2042|  92.0k|	    (state->trans[0].counter < 0) &&
  ------------------
  |  Branch (2042:6): [True: 92.0k, False: 0]
  ------------------
 2043|  92.0k|	    (state->trans[0].count < 0)) {
  ------------------
  |  Branch (2043:6): [True: 92.0k, False: 0]
  ------------------
 2044|  92.0k|	    newto = state->trans[0].to;
 2045|       |
 2046|  92.0k|            if (state->type == XML_REGEXP_START_STATE) {
  ------------------
  |  Branch (2046:17): [True: 791, False: 91.2k]
  ------------------
 2047|  91.2k|            } else {
 2048|   227k|	        for (i = 0;i < state->nbTransTo;i++) {
  ------------------
  |  Branch (2048:21): [True: 136k, False: 91.2k]
  ------------------
 2049|   136k|		    tmp = ctxt->states[state->transTo[i]];
 2050|  75.7M|		    for (j = 0;j < tmp->nbTrans;j++) {
  ------------------
  |  Branch (2050:18): [True: 75.6M, False: 136k]
  ------------------
 2051|  75.6M|			if (tmp->trans[j].to == statenr) {
  ------------------
  |  Branch (2051:8): [True: 130k, False: 75.5M]
  ------------------
 2052|   130k|			    tmp->trans[j].to = -1;
 2053|   130k|			    xmlRegStateAddTrans(ctxt, tmp, tmp->trans[j].atom,
 2054|   130k|						ctxt->states[newto],
 2055|   130k|					        tmp->trans[j].counter,
 2056|   130k|						tmp->trans[j].count);
 2057|   130k|			}
 2058|  75.6M|		    }
 2059|   136k|		}
 2060|  91.2k|		if (state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2060:7): [True: 0, False: 91.2k]
  ------------------
 2061|      0|		    ctxt->states[newto]->type = XML_REGEXP_FINAL_STATE;
 2062|       |		/* eliminate the transition completely */
 2063|  91.2k|		state->nbTrans = 0;
 2064|       |
 2065|  91.2k|                state->type = XML_REGEXP_UNREACH_STATE;
 2066|       |
 2067|  91.2k|	    }
 2068|       |
 2069|  92.0k|	}
 2070|   145k|    }
 2071|  1.55k|}
xmlregexp.c:xmlFAReduceEpsilonTransitions:
 1928|   293k|	                      int tonr, int counter) {
 1929|   293k|    int transnr;
 1930|   293k|    xmlRegStatePtr from;
 1931|   293k|    xmlRegStatePtr to;
 1932|       |
 1933|   293k|    from = ctxt->states[fromnr];
 1934|   293k|    if (from == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 293k]
  ------------------
 1935|      0|	return;
 1936|   293k|    to = ctxt->states[tonr];
 1937|   293k|    if (to == NULL)
  ------------------
  |  Branch (1937:9): [True: 97, False: 293k]
  ------------------
 1938|     97|	return;
 1939|   293k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1939:9): [True: 0, False: 293k]
  ------------------
 1940|   293k|	(to->mark == XML_REGEXP_MARK_VISITED))
  ------------------
  |  Branch (1940:2): [True: 61.9k, False: 231k]
  ------------------
 1941|  61.9k|	return;
 1942|       |
 1943|   231k|    to->mark = XML_REGEXP_MARK_VISITED;
 1944|   231k|    if (to->type == XML_REGEXP_FINAL_STATE) {
  ------------------
  |  Branch (1944:9): [True: 84.2k, False: 147k]
  ------------------
 1945|  84.2k|	from->type = XML_REGEXP_FINAL_STATE;
 1946|  84.2k|    }
 1947|  11.9M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1947:22): [True: 11.7M, False: 231k]
  ------------------
 1948|  11.7M|        xmlRegTransPtr t1 = &to->trans[transnr];
 1949|  11.7M|        int tcounter;
 1950|       |
 1951|  11.7M|        if (t1->to < 0)
  ------------------
  |  Branch (1951:13): [True: 1.05M, False: 10.6M]
  ------------------
 1952|  1.05M|	    continue;
 1953|  10.6M|        if (t1->counter >= 0) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 10.6M]
  ------------------
 1954|       |            /* assert(counter < 0); */
 1955|      0|            tcounter = t1->counter;
 1956|  10.6M|        } else {
 1957|  10.6M|            tcounter = counter;
 1958|  10.6M|        }
 1959|  10.6M|	if (t1->atom == NULL) {
  ------------------
  |  Branch (1959:6): [True: 204k, False: 10.4M]
  ------------------
 1960|       |	    /*
 1961|       |	     * Don't remove counted transitions
 1962|       |	     * Don't loop either
 1963|       |	     */
 1964|   204k|	    if (t1->to != fromnr) {
  ------------------
  |  Branch (1964:10): [True: 203k, False: 1.77k]
  ------------------
 1965|   203k|		if (t1->count >= 0) {
  ------------------
  |  Branch (1965:7): [True: 0, False: 203k]
  ------------------
 1966|      0|		    xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
 1967|      0|					-1, t1->count);
 1968|   203k|		} else {
 1969|   203k|                    xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
 1970|   203k|                                                  tcounter);
 1971|   203k|		}
 1972|   203k|	    }
 1973|  10.4M|	} else {
 1974|  10.4M|            xmlRegStateAddTrans(ctxt, from, t1->atom,
 1975|  10.4M|                                ctxt->states[t1->to], tcounter, -1);
 1976|  10.4M|	}
 1977|  10.6M|    }
 1978|   231k|}
xmlregexp.c:xmlFAFinishReduceEpsilonTransitions:
 1985|   295k|xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
 1986|   295k|    int transnr;
 1987|   295k|    xmlRegStatePtr to;
 1988|       |
 1989|   295k|    to = ctxt->states[tonr];
 1990|   295k|    if (to == NULL)
  ------------------
  |  Branch (1990:9): [True: 97, False: 295k]
  ------------------
 1991|     97|	return;
 1992|   295k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1992:9): [True: 1.77k, False: 293k]
  ------------------
 1993|   293k|	(to->mark == XML_REGEXP_MARK_NORMAL))
  ------------------
  |  Branch (1993:2): [True: 61.9k, False: 231k]
  ------------------
 1994|  63.6k|	return;
 1995|       |
 1996|   231k|    to->mark = XML_REGEXP_MARK_NORMAL;
 1997|  11.9M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1997:22): [True: 11.7M, False: 231k]
  ------------------
 1998|  11.7M|	xmlRegTransPtr t1 = &to->trans[transnr];
 1999|  11.7M|	if ((t1->to >= 0) && (t1->atom == NULL))
  ------------------
  |  Branch (1999:6): [True: 10.6M, False: 1.05M]
  |  Branch (1999:23): [True: 204k, False: 10.4M]
  ------------------
 2000|   204k|            xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
 2001|  11.7M|    }
 2002|   231k|}
xmlregexp.c:xmlRegEpxFromParse:
  503|  1.47k|xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
  504|  1.47k|    xmlRegexpPtr ret;
  505|       |
  506|  1.47k|    ret = (xmlRegexpPtr) xmlMalloc(sizeof(xmlRegexp));
  507|  1.47k|    if (ret == NULL) {
  ------------------
  |  Branch (507:9): [True: 6, False: 1.46k]
  ------------------
  508|      6|	xmlRegexpErrMemory(ctxt);
  509|      6|	return(NULL);
  510|      6|    }
  511|  1.46k|    memset(ret, 0, sizeof(xmlRegexp));
  512|  1.46k|    ret->string = ctxt->string;
  513|  1.46k|    ret->nbStates = ctxt->nbStates;
  514|  1.46k|    ret->states = ctxt->states;
  515|  1.46k|    ret->nbAtoms = ctxt->nbAtoms;
  516|  1.46k|    ret->atoms = ctxt->atoms;
  517|  1.46k|    ret->nbCounters = ctxt->nbCounters;
  518|  1.46k|    ret->counters = ctxt->counters;
  519|  1.46k|    ret->determinist = ctxt->determinist;
  520|  1.46k|    ret->flags = ctxt->flags;
  521|  1.46k|    if (ret->determinist == -1) {
  ------------------
  |  Branch (521:9): [True: 1.46k, False: 0]
  ------------------
  522|  1.46k|        if (xmlRegexpIsDeterminist(ret) < 0) {
  ------------------
  |  Branch (522:13): [True: 23, False: 1.44k]
  ------------------
  523|     23|            xmlRegexpErrMemory(ctxt);
  524|     23|            xmlFree(ret);
  525|     23|            return(NULL);
  526|     23|        }
  527|  1.46k|    }
  528|       |
  529|  1.44k|    if ((ret->determinist != 0) &&
  ------------------
  |  Branch (529:9): [True: 1.00k, False: 440]
  ------------------
  530|  1.00k|	(ret->nbCounters == 0) &&
  ------------------
  |  Branch (530:2): [True: 1.00k, False: 0]
  ------------------
  531|  1.00k|	(ctxt->negs == 0) &&
  ------------------
  |  Branch (531:2): [True: 1.00k, False: 0]
  ------------------
  532|  1.00k|	(ret->atoms != NULL) &&
  ------------------
  |  Branch (532:2): [True: 1.00k, False: 0]
  ------------------
  533|  1.00k|	(ret->atoms[0] != NULL) &&
  ------------------
  |  Branch (533:2): [True: 1.00k, False: 0]
  ------------------
  534|  1.00k|	(ret->atoms[0]->type == XML_REGEXP_STRING)) {
  ------------------
  |  Branch (534:2): [True: 1.00k, False: 0]
  ------------------
  535|  1.00k|	int i, j, nbstates = 0, nbatoms = 0;
  536|  1.00k|	int *stateRemap;
  537|  1.00k|	int *stringRemap;
  538|  1.00k|	int *transitions;
  539|  1.00k|	void **transdata;
  540|  1.00k|	xmlChar **stringMap;
  541|  1.00k|        xmlChar *value;
  542|       |
  543|       |	/*
  544|       |	 * Switch to a compact representation
  545|       |	 * 1/ counting the effective number of states left
  546|       |	 * 2/ counting the unique number of atoms, and check that
  547|       |	 *    they are all of the string type
  548|       |	 * 3/ build a table state x atom for the transitions
  549|       |	 */
  550|       |
  551|  1.00k|	stateRemap = xmlMalloc(ret->nbStates * sizeof(int));
  552|  1.00k|	if (stateRemap == NULL) {
  ------------------
  |  Branch (552:6): [True: 6, False: 999]
  ------------------
  553|      6|	    xmlRegexpErrMemory(ctxt);
  554|      6|	    xmlFree(ret);
  555|      6|	    return(NULL);
  556|      6|	}
  557|  15.1k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (557:13): [True: 14.1k, False: 999]
  ------------------
  558|  14.1k|	    if (ret->states[i] != NULL) {
  ------------------
  |  Branch (558:10): [True: 9.92k, False: 4.22k]
  ------------------
  559|  9.92k|		stateRemap[i] = nbstates;
  560|  9.92k|		nbstates++;
  561|  9.92k|	    } else {
  562|  4.22k|		stateRemap[i] = -1;
  563|  4.22k|	    }
  564|  14.1k|	}
  565|    999|	stringMap = xmlMalloc(ret->nbAtoms * sizeof(char *));
  566|    999|	if (stringMap == NULL) {
  ------------------
  |  Branch (566:6): [True: 10, False: 989]
  ------------------
  567|     10|	    xmlRegexpErrMemory(ctxt);
  568|     10|	    xmlFree(stateRemap);
  569|     10|	    xmlFree(ret);
  570|     10|	    return(NULL);
  571|     10|	}
  572|    989|	stringRemap = xmlMalloc(ret->nbAtoms * sizeof(int));
  573|    989|	if (stringRemap == NULL) {
  ------------------
  |  Branch (573:6): [True: 6, False: 983]
  ------------------
  574|      6|	    xmlRegexpErrMemory(ctxt);
  575|      6|	    xmlFree(stringMap);
  576|      6|	    xmlFree(stateRemap);
  577|      6|	    xmlFree(ret);
  578|      6|	    return(NULL);
  579|      6|	}
  580|  13.8k|	for (i = 0;i < ret->nbAtoms;i++) {
  ------------------
  |  Branch (580:13): [True: 12.8k, False: 951]
  ------------------
  581|  12.8k|	    if ((ret->atoms[i]->type == XML_REGEXP_STRING) &&
  ------------------
  |  Branch (581:10): [True: 12.8k, False: 0]
  ------------------
  582|  12.8k|		(ret->atoms[i]->quant == XML_REGEXP_QUANT_ONCE)) {
  ------------------
  |  Branch (582:3): [True: 12.8k, False: 0]
  ------------------
  583|  12.8k|		value = ret->atoms[i]->valuep;
  584|   130k|                for (j = 0;j < nbatoms;j++) {
  ------------------
  |  Branch (584:28): [True: 126k, False: 4.03k]
  ------------------
  585|   126k|		    if (xmlStrEqual(stringMap[j], value)) {
  ------------------
  |  Branch (585:11): [True: 8.85k, False: 117k]
  ------------------
  586|  8.85k|			stringRemap[i] = j;
  587|  8.85k|			break;
  588|  8.85k|		    }
  589|   126k|		}
  590|  12.8k|		if (j >= nbatoms) {
  ------------------
  |  Branch (590:7): [True: 4.03k, False: 8.85k]
  ------------------
  591|  4.03k|		    stringRemap[i] = nbatoms;
  592|  4.03k|		    stringMap[nbatoms] = xmlStrdup(value);
  593|  4.03k|		    if (stringMap[nbatoms] == NULL) {
  ------------------
  |  Branch (593:11): [True: 32, False: 4.00k]
  ------------------
  594|    189|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (594:15): [True: 157, False: 32]
  ------------------
  595|    157|			    xmlFree(stringMap[i]);
  596|     32|			xmlFree(stringRemap);
  597|     32|			xmlFree(stringMap);
  598|     32|			xmlFree(stateRemap);
  599|     32|			xmlFree(ret);
  600|     32|			return(NULL);
  601|     32|		    }
  602|  4.00k|		    nbatoms++;
  603|  4.00k|		}
  604|  12.8k|	    } else {
  605|      0|		xmlFree(stateRemap);
  606|      0|		xmlFree(stringRemap);
  607|      0|		for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (607:14): [True: 0, False: 0]
  ------------------
  608|      0|		    xmlFree(stringMap[i]);
  609|      0|		xmlFree(stringMap);
  610|      0|		xmlFree(ret);
  611|      0|		return(NULL);
  612|      0|	    }
  613|  12.8k|	}
  614|    951|	transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
  615|    951|                                            sizeof(int));
  616|    951|	if (transitions == NULL) {
  ------------------
  |  Branch (616:6): [True: 18, False: 933]
  ------------------
  617|     18|	    xmlFree(stateRemap);
  618|     18|	    xmlFree(stringRemap);
  619|    145|            for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (619:24): [True: 127, False: 18]
  ------------------
  620|    127|		xmlFree(stringMap[i]);
  621|     18|	    xmlFree(stringMap);
  622|     18|	    xmlFree(ret);
  623|     18|	    return(NULL);
  624|     18|	}
  625|       |
  626|       |	/*
  627|       |	 * Allocate the transition table. The first entry for each
  628|       |	 * state corresponds to the state type.
  629|       |	 */
  630|    933|	transdata = NULL;
  631|       |
  632|  14.3k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (632:13): [True: 13.4k, False: 933]
  ------------------
  633|  13.4k|	    int stateno, atomno, targetno, prev;
  634|  13.4k|	    xmlRegStatePtr state;
  635|  13.4k|	    xmlRegTransPtr trans;
  636|       |
  637|  13.4k|	    stateno = stateRemap[i];
  638|  13.4k|	    if (stateno == -1)
  ------------------
  |  Branch (638:10): [True: 3.99k, False: 9.42k]
  ------------------
  639|  3.99k|		continue;
  640|  9.42k|	    state = ret->states[i];
  641|       |
  642|  9.42k|	    transitions[stateno * (nbatoms + 1)] = state->type;
  643|       |
  644|  30.6k|	    for (j = 0;j < state->nbTrans;j++) {
  ------------------
  |  Branch (644:17): [True: 21.2k, False: 9.42k]
  ------------------
  645|  21.2k|		trans = &(state->trans[j]);
  646|  21.2k|		if ((trans->to < 0) || (trans->atom == NULL))
  ------------------
  |  Branch (646:7): [True: 7.10k, False: 14.1k]
  |  Branch (646:26): [True: 0, False: 14.1k]
  ------------------
  647|  7.10k|		    continue;
  648|  14.1k|                atomno = stringRemap[trans->atom->no];
  649|  14.1k|		if ((trans->atom->data != NULL) && (transdata == NULL)) {
  ------------------
  |  Branch (649:7): [True: 0, False: 14.1k]
  |  Branch (649:38): [True: 0, False: 0]
  ------------------
  650|      0|		    transdata = (void **) xmlRegCalloc2(nbstates, nbatoms,
  651|      0|			                                sizeof(void *));
  652|      0|		    if (transdata == NULL) {
  ------------------
  |  Branch (652:11): [True: 0, False: 0]
  ------------------
  653|      0|			xmlRegexpErrMemory(ctxt);
  654|      0|			break;
  655|      0|		    }
  656|      0|		}
  657|  14.1k|		targetno = stateRemap[trans->to];
  658|       |		/*
  659|       |		 * if the same atom can generate transitions to 2 different
  660|       |		 * states then it means the automata is not deterministic and
  661|       |		 * the compact form can't be used !
  662|       |		 */
  663|  14.1k|		prev = transitions[stateno * (nbatoms + 1) + atomno + 1];
  664|  14.1k|		if (prev != 0) {
  ------------------
  |  Branch (664:7): [True: 0, False: 14.1k]
  ------------------
  665|      0|		    if (prev != targetno + 1) {
  ------------------
  |  Branch (665:11): [True: 0, False: 0]
  ------------------
  666|      0|			ret->determinist = 0;
  667|      0|			if (transdata != NULL)
  ------------------
  |  Branch (667:8): [True: 0, False: 0]
  ------------------
  668|      0|			    xmlFree(transdata);
  669|      0|			xmlFree(transitions);
  670|      0|			xmlFree(stateRemap);
  671|      0|			xmlFree(stringRemap);
  672|      0|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (672:15): [True: 0, False: 0]
  ------------------
  673|      0|			    xmlFree(stringMap[i]);
  674|      0|			xmlFree(stringMap);
  675|      0|			goto not_determ;
  676|      0|		    }
  677|  14.1k|		} else {
  678|  14.1k|		    transitions[stateno * (nbatoms + 1) + atomno + 1] =
  679|  14.1k|			targetno + 1; /* to avoid 0 */
  680|  14.1k|		    if (transdata != NULL)
  ------------------
  |  Branch (680:11): [True: 0, False: 14.1k]
  ------------------
  681|      0|			transdata[stateno * nbatoms + atomno] =
  682|      0|			    trans->atom->data;
  683|  14.1k|		}
  684|  14.1k|	    }
  685|  9.42k|	}
  686|    933|	ret->determinist = 1;
  687|       |	/*
  688|       |	 * Cleanup of the old data
  689|       |	 */
  690|    933|	if (ret->states != NULL) {
  ------------------
  |  Branch (690:6): [True: 933, False: 0]
  ------------------
  691|  14.3k|	    for (i = 0;i < ret->nbStates;i++)
  ------------------
  |  Branch (691:17): [True: 13.4k, False: 933]
  ------------------
  692|  13.4k|		xmlRegFreeState(ret->states[i]);
  693|    933|	    xmlFree(ret->states);
  694|    933|	}
  695|    933|	ret->states = NULL;
  696|    933|	ret->nbStates = 0;
  697|    933|	if (ret->atoms != NULL) {
  ------------------
  |  Branch (697:6): [True: 933, False: 0]
  ------------------
  698|  13.4k|	    for (i = 0;i < ret->nbAtoms;i++)
  ------------------
  |  Branch (698:17): [True: 12.4k, False: 933]
  ------------------
  699|  12.4k|		xmlRegFreeAtom(ret->atoms[i]);
  700|    933|	    xmlFree(ret->atoms);
  701|    933|	}
  702|    933|	ret->atoms = NULL;
  703|    933|	ret->nbAtoms = 0;
  704|       |
  705|    933|	ret->compact = transitions;
  706|    933|	ret->transdata = transdata;
  707|    933|	ret->stringMap = stringMap;
  708|    933|	ret->nbstrings = nbatoms;
  709|    933|	ret->nbstates = nbstates;
  710|    933|	xmlFree(stateRemap);
  711|    933|	xmlFree(stringRemap);
  712|    933|    }
  713|  1.37k|not_determ:
  714|  1.37k|    ctxt->string = NULL;
  715|  1.37k|    ctxt->nbStates = 0;
  716|  1.37k|    ctxt->states = NULL;
  717|  1.37k|    ctxt->nbAtoms = 0;
  718|  1.37k|    ctxt->atoms = NULL;
  719|  1.37k|    ctxt->nbCounters = 0;
  720|       |    ctxt->counters = NULL;
  721|  1.37k|    return(ret);
  722|  1.44k|}
xmlregexp.c:xmlRegCalloc2:
  478|    951|xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
  479|    951|    size_t numElems, totalSize;
  480|    951|    void *ret;
  481|       |
  482|       |    /* Check for overflow */
  483|    951|    if ((dim2 == 0) || (elemSize == 0) ||
  ------------------
  |  Branch (483:9): [True: 0, False: 951]
  |  Branch (483:24): [True: 0, False: 951]
  ------------------
  484|    951|        (dim1 > SIZE_MAX / dim2 / elemSize))
  ------------------
  |  Branch (484:9): [True: 0, False: 951]
  ------------------
  485|      0|        return (NULL);
  486|    951|    numElems = dim1 * dim2;
  487|    951|    if (numElems > XML_MAX_ITEMS)
  ------------------
  |  |   13|    951|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (487:9): [True: 0, False: 951]
  ------------------
  488|      0|        return NULL;
  489|    951|    totalSize = numElems * elemSize;
  490|    951|    ret = xmlMalloc(totalSize);
  491|    951|    if (ret != NULL)
  ------------------
  |  Branch (491:9): [True: 933, False: 18]
  ------------------
  492|    933|        memset(ret, 0, totalSize);
  493|    951|    return (ret);
  494|    951|}
xmlregexp.c:xmlRegFreeParserCtxt:
  956|  3.37k|xmlRegFreeParserCtxt(xmlRegParserCtxtPtr ctxt) {
  957|  3.37k|    int i;
  958|  3.37k|    if (ctxt == NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 3.37k]
  ------------------
  959|      0|	return;
  960|       |
  961|  3.37k|    if (ctxt->string != NULL)
  ------------------
  |  Branch (961:9): [True: 0, False: 3.37k]
  ------------------
  962|      0|	xmlFree(ctxt->string);
  963|  3.37k|    if (ctxt->states != NULL) {
  ------------------
  |  Branch (963:9): [True: 542, False: 2.83k]
  ------------------
  964|   142k|	for (i = 0;i < ctxt->nbStates;i++)
  ------------------
  |  Branch (964:13): [True: 141k, False: 542]
  ------------------
  965|   141k|	    xmlRegFreeState(ctxt->states[i]);
  966|    542|	xmlFree(ctxt->states);
  967|    542|    }
  968|  3.37k|    if (ctxt->atoms != NULL) {
  ------------------
  |  Branch (968:9): [True: 498, False: 2.87k]
  ------------------
  969|   109k|	for (i = 0;i < ctxt->nbAtoms;i++)
  ------------------
  |  Branch (969:13): [True: 108k, False: 498]
  ------------------
  970|   108k|	    xmlRegFreeAtom(ctxt->atoms[i]);
  971|    498|	xmlFree(ctxt->atoms);
  972|    498|    }
  973|  3.37k|    if (ctxt->counters != NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 3.37k]
  ------------------
  974|      0|	xmlFree(ctxt->counters);
  975|  3.37k|    xmlFree(ctxt);
  976|  3.37k|}
xmlregexp.c:xmlRegFreeState:
  939|   489k|xmlRegFreeState(xmlRegStatePtr state) {
  940|   489k|    if (state == NULL)
  ------------------
  |  Branch (940:9): [True: 112k, False: 376k]
  ------------------
  941|   112k|	return;
  942|       |
  943|   376k|    if (state->trans != NULL)
  ------------------
  |  Branch (943:9): [True: 372k, False: 4.01k]
  ------------------
  944|   372k|	xmlFree(state->trans);
  945|   376k|    if (state->transTo != NULL)
  ------------------
  |  Branch (945:9): [True: 373k, False: 3.39k]
  ------------------
  946|   373k|	xmlFree(state->transTo);
  947|   376k|    xmlFree(state);
  948|   376k|}
xmlregexp.c:xmlFAComputesDeterminism:
 2803|  1.44k|xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
 2804|  1.44k|    int statenr, transnr;
 2805|  1.44k|    xmlRegStatePtr state;
 2806|  1.44k|    xmlRegTransPtr t1, t2, last;
 2807|  1.44k|    int i;
 2808|  1.44k|    int ret = 1;
 2809|  1.44k|    int deep = 1;
 2810|       |
 2811|  1.44k|    if (ctxt->determinist != -1)
  ------------------
  |  Branch (2811:9): [True: 0, False: 1.44k]
  ------------------
 2812|      0|	return(ctxt->determinist);
 2813|       |
 2814|  1.44k|    if (ctxt->flags & AM_AUTOMATA_RNG)
  ------------------
  |  |  288|  1.44k|#define AM_AUTOMATA_RNG 1
  ------------------
  |  Branch (2814:9): [True: 0, False: 1.44k]
  ------------------
 2815|      0|        deep = 0;
 2816|       |
 2817|       |    /*
 2818|       |     * First cleanup the automata removing cancelled transitions
 2819|       |     */
 2820|   235k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2820:22): [True: 233k, False: 1.44k]
  ------------------
 2821|   233k|	state = ctxt->states[statenr];
 2822|   233k|	if (state == NULL)
  ------------------
  |  Branch (2822:6): [True: 111k, False: 121k]
  ------------------
 2823|   111k|	    continue;
 2824|   121k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2824:6): [True: 52.1k, False: 69.7k]
  ------------------
 2825|  52.1k|	    continue;
 2826|  1.62M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2826:19): [True: 1.55M, False: 69.7k]
  ------------------
 2827|  1.55M|	    t1 = &(state->trans[transnr]);
 2828|       |	    /*
 2829|       |	     * Determinism checks in case of counted or all transitions
 2830|       |	     * will have to be handled separately
 2831|       |	     */
 2832|  1.55M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2832:10): [True: 116k, False: 1.44M]
  ------------------
 2833|       |		/* t1->nd = 1; */
 2834|   116k|		continue;
 2835|   116k|	    }
 2836|  1.44M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2836:10): [True: 20.3k, False: 1.42M]
  ------------------
 2837|  20.3k|		continue;
 2838|   675M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2838:17): [True: 673M, False: 1.42M]
  ------------------
 2839|   673M|		t2 = &(state->trans[i]);
 2840|   673M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2840:7): [True: 591M, False: 82.3M]
  ------------------
 2841|   591M|		    continue;
 2842|  82.3M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2842:7): [True: 82.3M, False: 0]
  ------------------
 2843|  82.3M|		    if (t1->to == t2->to) {
  ------------------
  |  Branch (2843:11): [True: 23.5M, False: 58.7M]
  ------------------
 2844|       |                        /*
 2845|       |                         * Here we use deep because we want to keep the
 2846|       |                         * transitions which indicate a conflict
 2847|       |                         */
 2848|  23.5M|			if (xmlFAEqualAtoms(t1->atom, t2->atom, deep) &&
  ------------------
  |  Branch (2848:8): [True: 690k, False: 22.9M]
  ------------------
 2849|   690k|                            (t1->counter == t2->counter) &&
  ------------------
  |  Branch (2849:29): [True: 690k, False: 0]
  ------------------
 2850|   690k|                            (t1->count == t2->count))
  ------------------
  |  Branch (2850:29): [True: 690k, False: 0]
  ------------------
 2851|   690k|			    t2->to = -1; /* eliminated */
 2852|  23.5M|		    }
 2853|  82.3M|		}
 2854|  82.3M|	    }
 2855|  1.42M|	}
 2856|  69.7k|    }
 2857|       |
 2858|       |    /*
 2859|       |     * Check for all states that there aren't 2 transitions
 2860|       |     * with the same atom and a different target.
 2861|       |     */
 2862|   235k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2862:22): [True: 233k, False: 1.44k]
  ------------------
 2863|   233k|	state = ctxt->states[statenr];
 2864|   233k|	if (state == NULL)
  ------------------
  |  Branch (2864:6): [True: 111k, False: 121k]
  ------------------
 2865|   111k|	    continue;
 2866|   121k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2866:6): [True: 52.1k, False: 69.7k]
  ------------------
 2867|  52.1k|	    continue;
 2868|  69.7k|	last = NULL;
 2869|  1.62M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2869:19): [True: 1.55M, False: 69.7k]
  ------------------
 2870|  1.55M|	    t1 = &(state->trans[transnr]);
 2871|       |	    /*
 2872|       |	     * Determinism checks in case of counted or all transitions
 2873|       |	     * will have to be handled separately
 2874|       |	     */
 2875|  1.55M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2875:10): [True: 116k, False: 1.44M]
  ------------------
 2876|   116k|		continue;
 2877|   116k|	    }
 2878|  1.44M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2878:10): [True: 710k, False: 731k]
  ------------------
 2879|   710k|		continue;
 2880|  57.6M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2880:17): [True: 56.8M, False: 731k]
  ------------------
 2881|  56.8M|		t2 = &(state->trans[i]);
 2882|  56.8M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2882:7): [True: 25.8M, False: 31.0M]
  ------------------
 2883|  25.8M|		    continue;
 2884|  31.0M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2884:7): [True: 31.0M, False: 0]
  ------------------
 2885|       |                    /*
 2886|       |                     * But here we don't use deep because we want to
 2887|       |                     * find transitions which indicate a conflict
 2888|       |                     */
 2889|  31.0M|		    if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
  ------------------
  |  Branch (2889:11): [True: 5.82M, False: 25.2M]
  ------------------
 2890|       |                        /*
 2891|       |                         * Treat equal counter transitions that couldn't be
 2892|       |                         * eliminated as deterministic.
 2893|       |                         */
 2894|  5.82M|                        if ((t1->to != t2->to) ||
  ------------------
  |  Branch (2894:29): [True: 5.82M, False: 0]
  ------------------
 2895|      0|                            (t1->counter == t2->counter) ||
  ------------------
  |  Branch (2895:29): [True: 0, False: 0]
  ------------------
 2896|      0|                            (!xmlFAEqualAtoms(t1->atom, t2->atom, deep)))
  ------------------
  |  Branch (2896:29): [True: 0, False: 0]
  ------------------
 2897|  5.82M|                            ret = 0;
 2898|       |			/* mark the transitions as non-deterministic ones */
 2899|  5.82M|			t1->nd = 1;
 2900|  5.82M|			t2->nd = 1;
 2901|  5.82M|			last = t1;
 2902|  5.82M|		    }
 2903|  31.0M|		} else {
 2904|      0|                    int res;
 2905|       |
 2906|       |		    /*
 2907|       |		     * do the closure in case of remaining specific
 2908|       |		     * epsilon transitions like choices or all
 2909|       |		     */
 2910|      0|		    res = xmlFARecurseDeterminism(ctxt, ctxt->states[t2->to],
 2911|      0|						  statenr, t1->to, t1->atom);
 2912|      0|                    xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t2->to]);
 2913|       |		    /* don't shortcut the computation so all non deterministic
 2914|       |		       transition get marked down
 2915|       |		    if (ret == 0)
 2916|       |			return(0);
 2917|       |		     */
 2918|      0|		    if (res == 0) {
  ------------------
  |  Branch (2918:11): [True: 0, False: 0]
  ------------------
 2919|      0|			t1->nd = 1;
 2920|       |			/* t2->nd = 1; */
 2921|      0|			last = t1;
 2922|      0|                        ret = 0;
 2923|      0|		    }
 2924|      0|		}
 2925|  31.0M|	    }
 2926|       |	    /* don't shortcut the computation so all non deterministic
 2927|       |	       transition get marked down
 2928|       |	    if (ret == 0)
 2929|       |		break; */
 2930|   731k|	}
 2931|       |
 2932|       |	/*
 2933|       |	 * mark specifically the last non-deterministic transition
 2934|       |	 * from a state since there is no need to set-up rollback
 2935|       |	 * from it
 2936|       |	 */
 2937|  69.7k|	if (last != NULL) {
  ------------------
  |  Branch (2937:6): [True: 39.2k, False: 30.5k]
  ------------------
 2938|  39.2k|	    last->nd = 2;
 2939|  39.2k|	}
 2940|       |
 2941|       |	/* don't shortcut the computation so all non deterministic
 2942|       |	   transition get marked down
 2943|       |	if (ret == 0)
 2944|       |	    break; */
 2945|  69.7k|    }
 2946|       |
 2947|  1.44k|    ctxt->determinist = ret;
 2948|  1.44k|    return(ret);
 2949|  1.44k|}
xmlregexp.c:xmlFAEqualAtoms:
 2581|  23.5M|xmlFAEqualAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2582|  23.5M|    int ret = 0;
 2583|       |
 2584|  23.5M|    if (atom1 == atom2)
  ------------------
  |  Branch (2584:9): [True: 0, False: 23.5M]
  ------------------
 2585|      0|	return(1);
 2586|  23.5M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2586:9): [True: 0, False: 23.5M]
  |  Branch (2586:28): [True: 0, False: 23.5M]
  ------------------
 2587|      0|	return(0);
 2588|       |
 2589|  23.5M|    if (atom1->type != atom2->type)
  ------------------
  |  Branch (2589:9): [True: 0, False: 23.5M]
  ------------------
 2590|      0|        return(0);
 2591|  23.5M|    switch (atom1->type) {
 2592|      0|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2592:9): [True: 0, False: 23.5M]
  ------------------
 2593|      0|	    ret = 0;
 2594|      0|	    break;
 2595|  23.5M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2595:9): [True: 23.5M, False: 0]
  ------------------
 2596|  23.5M|            if (!deep)
  ------------------
  |  Branch (2596:17): [True: 0, False: 23.5M]
  ------------------
 2597|      0|                ret = (atom1->valuep == atom2->valuep);
 2598|  23.5M|            else
 2599|  23.5M|                ret = xmlStrEqual((xmlChar *)atom1->valuep,
 2600|  23.5M|                                  (xmlChar *)atom2->valuep);
 2601|  23.5M|	    break;
 2602|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2602:9): [True: 0, False: 23.5M]
  ------------------
 2603|      0|	    ret = (atom1->codepoint == atom2->codepoint);
 2604|      0|	    break;
 2605|      0|	case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2605:2): [True: 0, False: 23.5M]
  ------------------
 2606|       |	    /* too hard to do in the general case */
 2607|      0|	    ret = 0;
 2608|      0|	default:
  ------------------
  |  Branch (2608:2): [True: 0, False: 23.5M]
  ------------------
 2609|      0|	    break;
 2610|  23.5M|    }
 2611|  23.5M|    return(ret);
 2612|  23.5M|}
xmlregexp.c:xmlFACompareAtoms:
 2624|  31.0M|xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2625|  31.0M|    int ret = 1;
 2626|       |
 2627|  31.0M|    if (atom1 == atom2)
  ------------------
  |  Branch (2627:9): [True: 0, False: 31.0M]
  ------------------
 2628|      0|	return(1);
 2629|  31.0M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2629:9): [True: 0, False: 31.0M]
  |  Branch (2629:28): [True: 0, False: 31.0M]
  ------------------
 2630|      0|	return(0);
 2631|       |
 2632|  31.0M|    if ((atom1->type == XML_REGEXP_ANYCHAR) ||
  ------------------
  |  Branch (2632:9): [True: 0, False: 31.0M]
  ------------------
 2633|  31.0M|        (atom2->type == XML_REGEXP_ANYCHAR))
  ------------------
  |  Branch (2633:9): [True: 0, False: 31.0M]
  ------------------
 2634|      0|	return(1);
 2635|       |
 2636|  31.0M|    if (atom1->type > atom2->type) {
  ------------------
  |  Branch (2636:9): [True: 0, False: 31.0M]
  ------------------
 2637|      0|	xmlRegAtomPtr tmp;
 2638|      0|	tmp = atom1;
 2639|      0|	atom1 = atom2;
 2640|      0|	atom2 = tmp;
 2641|      0|    }
 2642|  31.0M|    if (atom1->type != atom2->type) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 31.0M]
  ------------------
 2643|      0|        ret = xmlFACompareAtomTypes(atom1->type, atom2->type);
 2644|       |	/* if they can't intersect at the type level break now */
 2645|      0|	if (ret == 0)
  ------------------
  |  Branch (2645:6): [True: 0, False: 0]
  ------------------
 2646|      0|	    return(0);
 2647|      0|    }
 2648|  31.0M|    switch (atom1->type) {
 2649|  31.0M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2649:9): [True: 31.0M, False: 0]
  ------------------
 2650|  31.0M|            if (!deep)
  ------------------
  |  Branch (2650:17): [True: 0, False: 31.0M]
  ------------------
 2651|      0|                ret = (atom1->valuep != atom2->valuep);
 2652|  31.0M|            else {
 2653|  31.0M|                xmlChar *val1 = (xmlChar *)atom1->valuep;
 2654|  31.0M|                xmlChar *val2 = (xmlChar *)atom2->valuep;
 2655|  31.0M|                int compound1 = (xmlStrchr(val1, '|') != NULL);
 2656|  31.0M|                int compound2 = (xmlStrchr(val2, '|') != NULL);
 2657|       |
 2658|       |                /* Ignore negative match flag for ##other namespaces */
 2659|  31.0M|                if (compound1 != compound2)
  ------------------
  |  Branch (2659:21): [True: 0, False: 31.0M]
  ------------------
 2660|      0|                    return(0);
 2661|       |
 2662|  31.0M|                ret = xmlRegStrEqualWildcard(val1, val2);
 2663|  31.0M|            }
 2664|  31.0M|	    break;
 2665|  31.0M|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2665:9): [True: 0, False: 31.0M]
  ------------------
 2666|      0|	    goto not_determinist;
 2667|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2667:9): [True: 0, False: 31.0M]
  ------------------
 2668|      0|	    if (atom2->type == XML_REGEXP_CHARVAL) {
  ------------------
  |  Branch (2668:10): [True: 0, False: 0]
  ------------------
 2669|      0|		ret = (atom1->codepoint == atom2->codepoint);
 2670|      0|	    } else {
 2671|      0|	        ret = xmlRegCheckCharacter(atom2, atom1->codepoint);
 2672|      0|		if (ret < 0)
  ------------------
  |  Branch (2672:7): [True: 0, False: 0]
  ------------------
 2673|      0|		    ret = 1;
 2674|      0|	    }
 2675|      0|	    break;
 2676|      0|        case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2676:9): [True: 0, False: 31.0M]
  ------------------
 2677|      0|	    if (atom2->type == XML_REGEXP_RANGES) {
  ------------------
  |  Branch (2677:10): [True: 0, False: 0]
  ------------------
 2678|      0|	        int i, j, res;
 2679|      0|		xmlRegRangePtr r1, r2;
 2680|       |
 2681|       |		/*
 2682|       |		 * need to check that none of the ranges eventually matches
 2683|       |		 */
 2684|      0|		for (i = 0;i < atom1->nbRanges;i++) {
  ------------------
  |  Branch (2684:14): [True: 0, False: 0]
  ------------------
 2685|      0|		    for (j = 0;j < atom2->nbRanges;j++) {
  ------------------
  |  Branch (2685:18): [True: 0, False: 0]
  ------------------
 2686|      0|			r1 = atom1->ranges[i];
 2687|      0|			r2 = atom2->ranges[j];
 2688|      0|			res = xmlFACompareRanges(r1, r2);
 2689|      0|			if (res == 1) {
  ------------------
  |  Branch (2689:8): [True: 0, False: 0]
  ------------------
 2690|      0|			    ret = 1;
 2691|      0|			    goto done;
 2692|      0|			}
 2693|      0|		    }
 2694|      0|		}
 2695|      0|		ret = 0;
 2696|      0|	    }
 2697|      0|	    break;
 2698|      0|	default:
  ------------------
  |  Branch (2698:2): [True: 0, False: 31.0M]
  ------------------
 2699|      0|	    goto not_determinist;
 2700|  31.0M|    }
 2701|  31.0M|done:
 2702|  31.0M|    if (atom1->neg != atom2->neg) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 31.0M]
  ------------------
 2703|      0|        ret = !ret;
 2704|      0|    }
 2705|  31.0M|    if (ret == 0)
  ------------------
  |  Branch (2705:9): [True: 25.2M, False: 5.82M]
  ------------------
 2706|  25.2M|        return(0);
 2707|  5.82M|not_determinist:
 2708|  5.82M|    return(1);
 2709|  31.0M|}
xmlregexp.c:xmlRegFreeAtom:
  855|   291k|xmlRegFreeAtom(xmlRegAtomPtr atom) {
  856|   291k|    int i;
  857|       |
  858|   291k|    if (atom == NULL)
  ------------------
  |  Branch (858:9): [True: 0, False: 291k]
  ------------------
  859|      0|	return;
  860|       |
  861|   291k|    for (i = 0;i < atom->nbRanges;i++)
  ------------------
  |  Branch (861:16): [True: 0, False: 291k]
  ------------------
  862|      0|	xmlRegFreeRange(atom->ranges[i]);
  863|   291k|    if (atom->ranges != NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 291k]
  ------------------
  864|      0|	xmlFree(atom->ranges);
  865|   291k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
  ------------------
  |  Branch (865:9): [True: 291k, False: 0]
  |  Branch (865:46): [True: 291k, False: 38]
  ------------------
  866|   291k|	xmlFree(atom->valuep);
  867|   291k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
  ------------------
  |  Branch (867:9): [True: 291k, False: 0]
  |  Branch (867:46): [True: 0, False: 291k]
  ------------------
  868|      0|	xmlFree(atom->valuep2);
  869|   291k|    if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
  ------------------
  |  Branch (869:9): [True: 0, False: 291k]
  |  Branch (869:50): [True: 0, False: 0]
  ------------------
  870|      0|	xmlFree(atom->valuep);
  871|   291k|    xmlFree(atom);
  872|   291k|}
xmlregexp.c:xmlRegNewAtom:
  833|   291k|xmlRegNewAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomType type) {
  834|   291k|    xmlRegAtomPtr ret;
  835|       |
  836|   291k|    ret = (xmlRegAtomPtr) xmlMalloc(sizeof(xmlRegAtom));
  837|   291k|    if (ret == NULL) {
  ------------------
  |  Branch (837:9): [True: 44, False: 291k]
  ------------------
  838|     44|	xmlRegexpErrMemory(ctxt);
  839|     44|	return(NULL);
  840|     44|    }
  841|   291k|    memset(ret, 0, sizeof(xmlRegAtom));
  842|   291k|    ret->type = type;
  843|   291k|    ret->quant = XML_REGEXP_QUANT_ONCE;
  844|   291k|    ret->min = 0;
  845|   291k|    ret->max = 0;
  846|   291k|    return(ret);
  847|   291k|}
xmlregexp.c:xmlRegexpErrMemory:
  427|    488|{
  428|    488|    if (ctxt != NULL)
  ------------------
  |  Branch (428:9): [True: 488, False: 0]
  ------------------
  429|    488|        ctxt->error = XML_ERR_NO_MEMORY;
  430|       |
  431|    488|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_REGEXP, NULL);
  432|    488|}
xmlregexp.c:xmlFAGenerateTransitions:
 1698|   291k|	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
 1699|   291k|    xmlRegStatePtr end;
 1700|   291k|    int nullable = 0;
 1701|       |
 1702|   291k|    if (atom == NULL) {
  ------------------
  |  Branch (1702:9): [True: 0, False: 291k]
  ------------------
 1703|      0|	ERROR("generate transition: atom == NULL");
  ------------------
  |  |   47|      0|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      0|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1704|      0|	return(-1);
 1705|      0|    }
 1706|   291k|    if (atom->type == XML_REGEXP_SUBREG) {
  ------------------
  |  Branch (1706:9): [True: 0, False: 291k]
  ------------------
 1707|       |	/*
 1708|       |	 * this is a subexpression handling one should not need to
 1709|       |	 * create a new node except for XML_REGEXP_QUANT_RANGE.
 1710|       |	 */
 1711|      0|	if ((to != NULL) && (atom->stop != to) &&
  ------------------
  |  Branch (1711:6): [True: 0, False: 0]
  |  Branch (1711:22): [True: 0, False: 0]
  ------------------
 1712|      0|	    (atom->quant != XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1712:6): [True: 0, False: 0]
  ------------------
 1713|       |	    /*
 1714|       |	     * Generate an epsilon transition to link to the target
 1715|       |	     */
 1716|      0|	    xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
 1717|       |#ifdef DV
 1718|       |	} else if ((to == NULL) && (atom->quant != XML_REGEXP_QUANT_RANGE) &&
 1719|       |		   (atom->quant != XML_REGEXP_QUANT_ONCE)) {
 1720|       |	    to = xmlRegStatePush(ctxt, to);
 1721|       |            if (to == NULL)
 1722|       |                return(-1);
 1723|       |	    ctxt->state = to;
 1724|       |	    xmlFAGenerateEpsilonTransition(ctxt, atom->stop, to);
 1725|       |#endif
 1726|      0|	}
 1727|      0|	switch (atom->quant) {
 1728|      0|	    case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1728:6): [True: 0, False: 0]
  ------------------
 1729|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1730|       |		/*
 1731|       |		 * transition done to the state after end of atom.
 1732|       |		 *      1. set transition from atom start to new state
 1733|       |		 *      2. set transition from atom end to this state.
 1734|       |		 */
 1735|      0|                if (to == NULL) {
  ------------------
  |  Branch (1735:21): [True: 0, False: 0]
  ------------------
 1736|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->start, 0);
 1737|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->stop,
 1738|      0|                                                   ctxt->state);
 1739|      0|                } else {
 1740|      0|                    xmlFAGenerateEpsilonTransition(ctxt, atom->start, to);
 1741|      0|                }
 1742|      0|		break;
 1743|      0|	    case XML_REGEXP_QUANT_MULT:
  ------------------
  |  Branch (1743:6): [True: 0, False: 0]
  ------------------
 1744|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1745|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->start, atom->stop);
 1746|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
 1747|      0|		break;
 1748|      0|	    case XML_REGEXP_QUANT_PLUS:
  ------------------
  |  Branch (1748:6): [True: 0, False: 0]
  ------------------
 1749|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1750|      0|		xmlFAGenerateEpsilonTransition(ctxt, atom->stop, atom->start);
 1751|      0|		break;
 1752|      0|	    case XML_REGEXP_QUANT_RANGE: {
  ------------------
  |  Branch (1752:6): [True: 0, False: 0]
  ------------------
 1753|      0|		int counter;
 1754|      0|		xmlRegStatePtr inter, newstate;
 1755|       |
 1756|       |		/*
 1757|       |		 * create the final state now if needed
 1758|       |		 */
 1759|      0|		if (to != NULL) {
  ------------------
  |  Branch (1759:7): [True: 0, False: 0]
  ------------------
 1760|      0|		    newstate = to;
 1761|      0|		} else {
 1762|      0|		    newstate = xmlRegStatePush(ctxt);
 1763|      0|                    if (newstate == NULL)
  ------------------
  |  Branch (1763:25): [True: 0, False: 0]
  ------------------
 1764|      0|                        return(-1);
 1765|      0|		}
 1766|       |
 1767|       |		/*
 1768|       |		 * The principle here is to use counted transition
 1769|       |		 * to avoid explosion in the number of states in the
 1770|       |		 * graph. This is clearly more complex but should not
 1771|       |		 * be exploitable at runtime.
 1772|       |		 */
 1773|      0|		if ((atom->min == 0) && (atom->start0 == NULL)) {
  ------------------
  |  Branch (1773:7): [True: 0, False: 0]
  |  Branch (1773:27): [True: 0, False: 0]
  ------------------
 1774|      0|		    xmlRegAtomPtr copy;
 1775|       |		    /*
 1776|       |		     * duplicate a transition based on atom to count next
 1777|       |		     * occurrences after 1. We cannot loop to atom->start
 1778|       |		     * directly because we need an epsilon transition to
 1779|       |		     * newstate.
 1780|       |		     */
 1781|       |		     /* ???? For some reason it seems we never reach that
 1782|       |		        case, I suppose this got optimized out before when
 1783|       |			building the automata */
 1784|      0|		    copy = xmlRegCopyAtom(ctxt, atom);
 1785|      0|		    if (copy == NULL)
  ------------------
  |  Branch (1785:11): [True: 0, False: 0]
  ------------------
 1786|      0|		        return(-1);
 1787|      0|		    copy->quant = XML_REGEXP_QUANT_ONCE;
 1788|      0|		    copy->min = 0;
 1789|      0|		    copy->max = 0;
 1790|       |
 1791|      0|		    if (xmlFAGenerateTransitions(ctxt, atom->start, NULL, copy)
  ------------------
  |  Branch (1791:11): [True: 0, False: 0]
  ------------------
 1792|      0|		        < 0) {
 1793|      0|                        xmlRegFreeAtom(copy);
 1794|      0|			return(-1);
 1795|      0|                    }
 1796|      0|		    inter = ctxt->state;
 1797|      0|		    counter = xmlRegGetCounter(ctxt);
 1798|      0|                    if (counter < 0)
  ------------------
  |  Branch (1798:25): [True: 0, False: 0]
  ------------------
 1799|      0|                        return(-1);
 1800|      0|		    ctxt->counters[counter].min = atom->min - 1;
 1801|      0|		    ctxt->counters[counter].max = atom->max - 1;
 1802|       |		    /* count the number of times we see it again */
 1803|      0|		    xmlFAGenerateCountedEpsilonTransition(ctxt, inter,
 1804|      0|						   atom->stop, counter);
 1805|       |		    /* allow a way out based on the count */
 1806|      0|		    xmlFAGenerateCountedTransition(ctxt, inter,
 1807|      0|			                           newstate, counter);
 1808|       |		    /* and also allow a direct exit for 0 */
 1809|      0|		    xmlFAGenerateEpsilonTransition(ctxt, atom->start,
 1810|      0|		                                   newstate);
 1811|      0|		} else {
 1812|       |		    /*
 1813|       |		     * either we need the atom at least once or there
 1814|       |		     * is an atom->start0 allowing to easily plug the
 1815|       |		     * epsilon transition.
 1816|       |		     */
 1817|      0|		    counter = xmlRegGetCounter(ctxt);
 1818|      0|                    if (counter < 0)
  ------------------
  |  Branch (1818:25): [True: 0, False: 0]
  ------------------
 1819|      0|                        return(-1);
 1820|      0|		    ctxt->counters[counter].min = atom->min - 1;
 1821|      0|		    ctxt->counters[counter].max = atom->max - 1;
 1822|       |		    /* allow a way out based on the count */
 1823|      0|		    xmlFAGenerateCountedTransition(ctxt, atom->stop,
 1824|      0|			                           newstate, counter);
 1825|       |		    /* count the number of times we see it again */
 1826|      0|		    xmlFAGenerateCountedEpsilonTransition(ctxt, atom->stop,
 1827|      0|						   atom->start, counter);
 1828|       |		    /* and if needed allow a direct exit for 0 */
 1829|      0|		    if (atom->min == 0)
  ------------------
  |  Branch (1829:11): [True: 0, False: 0]
  ------------------
 1830|      0|			xmlFAGenerateEpsilonTransition(ctxt, atom->start0,
 1831|      0|						       newstate);
 1832|       |
 1833|      0|		}
 1834|      0|		atom->min = 0;
 1835|      0|		atom->max = 0;
 1836|      0|		atom->quant = XML_REGEXP_QUANT_ONCE;
 1837|      0|		ctxt->state = newstate;
 1838|      0|	    }
 1839|      0|	    default:
  ------------------
  |  Branch (1839:6): [True: 0, False: 0]
  ------------------
 1840|      0|		break;
 1841|      0|	}
 1842|      0|        atom->start = NULL;
 1843|      0|        atom->start0 = NULL;
 1844|      0|        atom->stop = NULL;
 1845|      0|	if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1845:6): [True: 0, False: 0]
  ------------------
 1846|      0|	    return(-1);
 1847|      0|	return(0);
 1848|      0|    }
 1849|   291k|    if ((atom->min == 0) && (atom->max == 0) &&
  ------------------
  |  Branch (1849:9): [True: 291k, False: 0]
  |  Branch (1849:29): [True: 291k, False: 0]
  ------------------
 1850|   291k|               (atom->quant == XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1850:16): [True: 0, False: 291k]
  ------------------
 1851|       |        /*
 1852|       |	 * we can discard the atom and generate an epsilon transition instead
 1853|       |	 */
 1854|      0|	if (to == NULL) {
  ------------------
  |  Branch (1854:6): [True: 0, False: 0]
  ------------------
 1855|      0|	    to = xmlRegStatePush(ctxt);
 1856|      0|	    if (to == NULL)
  ------------------
  |  Branch (1856:10): [True: 0, False: 0]
  ------------------
 1857|      0|		return(-1);
 1858|      0|	}
 1859|      0|	xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1860|      0|	ctxt->state = to;
 1861|      0|	xmlRegFreeAtom(atom);
 1862|      0|	return(0);
 1863|      0|    }
 1864|   291k|    if (to == NULL) {
  ------------------
  |  Branch (1864:9): [True: 250k, False: 40.5k]
  ------------------
 1865|   250k|	to = xmlRegStatePush(ctxt);
 1866|   250k|	if (to == NULL)
  ------------------
  |  Branch (1866:6): [True: 46, False: 250k]
  ------------------
 1867|     46|	    return(-1);
 1868|   250k|    }
 1869|   291k|    end = to;
 1870|   291k|    if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
  ------------------
  |  Branch (1870:9): [True: 0, False: 291k]
  ------------------
 1871|   291k|        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
  ------------------
  |  Branch (1871:9): [True: 0, False: 291k]
  ------------------
 1872|       |	/*
 1873|       |	 * Do not pollute the target state by adding transitions from
 1874|       |	 * it as it is likely to be the shared target of multiple branches.
 1875|       |	 * So isolate with an epsilon transition.
 1876|       |	 */
 1877|      0|        xmlRegStatePtr tmp;
 1878|       |
 1879|      0|	tmp = xmlRegStatePush(ctxt);
 1880|      0|        if (tmp == NULL)
  ------------------
  |  Branch (1880:13): [True: 0, False: 0]
  ------------------
 1881|      0|	    return(-1);
 1882|      0|	xmlFAGenerateEpsilonTransition(ctxt, tmp, to);
 1883|      0|	to = tmp;
 1884|      0|    }
 1885|   291k|    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
  ------------------
  |  Branch (1885:9): [True: 0, False: 291k]
  ------------------
 1886|      0|        (atom->min == 0) && (atom->max > 0)) {
  ------------------
  |  Branch (1886:9): [True: 0, False: 0]
  |  Branch (1886:29): [True: 0, False: 0]
  ------------------
 1887|      0|	nullable = 1;
 1888|      0|	atom->min = 1;
 1889|      0|        if (atom->max == 1)
  ------------------
  |  Branch (1889:13): [True: 0, False: 0]
  ------------------
 1890|      0|	    atom->quant = XML_REGEXP_QUANT_OPT;
 1891|      0|    }
 1892|   291k|    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
 1893|   291k|    ctxt->state = end;
 1894|   291k|    switch (atom->quant) {
 1895|      0|	case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1895:2): [True: 0, False: 291k]
  ------------------
 1896|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1897|      0|	    xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1898|      0|	    break;
 1899|      0|	case XML_REGEXP_QUANT_MULT:
  ------------------
  |  Branch (1899:2): [True: 0, False: 291k]
  ------------------
 1900|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1901|      0|	    xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1902|      0|	    xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
 1903|      0|	    break;
 1904|      0|	case XML_REGEXP_QUANT_PLUS:
  ------------------
  |  Branch (1904:2): [True: 0, False: 291k]
  ------------------
 1905|      0|	    atom->quant = XML_REGEXP_QUANT_ONCE;
 1906|      0|	    xmlRegStateAddTrans(ctxt, to, atom, to, -1, -1);
 1907|      0|	    break;
 1908|      0|	case XML_REGEXP_QUANT_RANGE:
  ------------------
  |  Branch (1908:2): [True: 0, False: 291k]
  ------------------
 1909|      0|	    if (nullable)
  ------------------
  |  Branch (1909:10): [True: 0, False: 0]
  ------------------
 1910|      0|		xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1911|      0|	    break;
 1912|   291k|	default:
  ------------------
  |  Branch (1912:2): [True: 291k, False: 0]
  ------------------
 1913|   291k|	    break;
 1914|   291k|    }
 1915|   291k|    if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1915:9): [True: 16, False: 291k]
  ------------------
 1916|     16|	return(-1);
 1917|   291k|    return(0);
 1918|   291k|}
xmlregexp.c:xmlRegStateAddTrans:
 1521|  11.2M|		    int counter, int count) {
 1522|       |
 1523|  11.2M|    int nrtrans;
 1524|       |
 1525|  11.2M|    if (state == NULL) {
  ------------------
  |  Branch (1525:9): [True: 0, False: 11.2M]
  ------------------
 1526|      0|	ERROR("add state: state is NULL");
  ------------------
  |  |   47|      0|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      0|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1527|      0|	return;
 1528|      0|    }
 1529|  11.2M|    if (target == NULL) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 11.2M]
  ------------------
 1530|      0|	ERROR("add state: target is NULL");
  ------------------
  |  |   47|      0|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      0|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1531|      0|	return;
 1532|      0|    }
 1533|       |    /*
 1534|       |     * Other routines follow the philosophy 'When in doubt, add a transition'
 1535|       |     * so we check here whether such a transition is already present and, if
 1536|       |     * so, silently ignore this request.
 1537|       |     */
 1538|       |
 1539|  1.56G|    for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) {
  ------------------
  |  Branch (1539:40): [True: 1.56G, False: 2.21M]
  ------------------
 1540|  1.56G|	xmlRegTransPtr trans = &(state->trans[nrtrans]);
 1541|  1.56G|	if ((trans->atom == atom) &&
  ------------------
  |  Branch (1541:6): [True: 9.68M, False: 1.55G]
  ------------------
 1542|  9.68M|	    (trans->to == target->no) &&
  ------------------
  |  Branch (1542:6): [True: 8.98M, False: 700k]
  ------------------
 1543|  8.98M|	    (trans->counter == counter) &&
  ------------------
  |  Branch (1543:6): [True: 8.98M, False: 0]
  ------------------
 1544|  8.98M|	    (trans->count == count)) {
  ------------------
  |  Branch (1544:6): [True: 8.98M, False: 0]
  ------------------
 1545|  8.98M|	    return;
 1546|  8.98M|	}
 1547|  1.56G|    }
 1548|       |
 1549|  2.21M|    if (state->nbTrans >= state->maxTrans) {
  ------------------
  |  Branch (1549:9): [True: 777k, False: 1.43M]
  ------------------
 1550|   777k|	xmlRegTrans *tmp;
 1551|   777k|        int newSize;
 1552|       |
 1553|   777k|        newSize = xmlGrowCapacity(state->maxTrans, sizeof(tmp[0]),
 1554|   777k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   777k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1555|   777k|	if (newSize < 0) {
  ------------------
  |  Branch (1555:6): [True: 0, False: 777k]
  ------------------
 1556|      0|	    xmlRegexpErrMemory(ctxt);
 1557|      0|	    return;
 1558|      0|	}
 1559|   777k|	tmp = xmlRealloc(state->trans, newSize * sizeof(tmp[0]));
 1560|   777k|	if (tmp == NULL) {
  ------------------
  |  Branch (1560:6): [True: 118, False: 777k]
  ------------------
 1561|    118|	    xmlRegexpErrMemory(ctxt);
 1562|    118|	    return;
 1563|    118|	}
 1564|   777k|	state->trans = tmp;
 1565|   777k|	state->maxTrans = newSize;
 1566|   777k|    }
 1567|       |
 1568|  2.21M|    state->trans[state->nbTrans].atom = atom;
 1569|  2.21M|    state->trans[state->nbTrans].to = target->no;
 1570|  2.21M|    state->trans[state->nbTrans].counter = counter;
 1571|  2.21M|    state->trans[state->nbTrans].count = count;
 1572|  2.21M|    state->trans[state->nbTrans].nd = 0;
 1573|  2.21M|    state->nbTrans++;
 1574|  2.21M|    xmlRegStateAddTransTo(ctxt, target, state->no);
 1575|  2.21M|}
xmlregexp.c:xmlRegStateAddTransTo:
 1495|  2.21M|                      int from) {
 1496|  2.21M|    if (target->nbTransTo >= target->maxTransTo) {
  ------------------
  |  Branch (1496:9): [True: 759k, False: 1.45M]
  ------------------
 1497|   759k|	int *tmp;
 1498|   759k|        int newSize;
 1499|       |
 1500|   759k|        newSize = xmlGrowCapacity(target->maxTransTo, sizeof(tmp[0]),
 1501|   759k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   759k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1502|   759k|	if (newSize < 0) {
  ------------------
  |  Branch (1502:6): [True: 0, False: 759k]
  ------------------
 1503|      0|	    xmlRegexpErrMemory(ctxt);
 1504|      0|	    return;
 1505|      0|	}
 1506|   759k|	tmp = xmlRealloc(target->transTo, newSize * sizeof(tmp[0]));
 1507|   759k|	if (tmp == NULL) {
  ------------------
  |  Branch (1507:6): [True: 105, False: 759k]
  ------------------
 1508|    105|	    xmlRegexpErrMemory(ctxt);
 1509|    105|	    return;
 1510|    105|	}
 1511|   759k|	target->transTo = tmp;
 1512|   759k|	target->maxTransTo = newSize;
 1513|   759k|    }
 1514|  2.21M|    target->transTo[target->nbTransTo] = from;
 1515|  2.21M|    target->nbTransTo++;
 1516|  2.21M|}
xmlregexp.c:xmlRegAtomPush:
 1465|   291k|xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
 1466|   291k|    if (atom == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 291k]
  ------------------
 1467|      0|	ERROR("atom push: atom is NULL");
  ------------------
  |  |   47|      0|    ctxt->error = XML_REGEXP_COMPILE_ERROR;				\
  |  |   48|      0|    xmlRegexpErrCompile(ctxt, str);
  ------------------
 1468|      0|	return(-1);
 1469|      0|    }
 1470|   291k|    if (ctxt->nbAtoms >= ctxt->maxAtoms) {
  ------------------
  |  Branch (1470:9): [True: 9.94k, False: 281k]
  ------------------
 1471|  9.94k|	xmlRegAtomPtr *tmp;
 1472|  9.94k|        int newSize;
 1473|       |
 1474|  9.94k|        newSize = xmlGrowCapacity(ctxt->maxAtoms, sizeof(tmp[0]),
 1475|  9.94k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  9.94k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1476|  9.94k|	if (newSize < 0) {
  ------------------
  |  Branch (1476:6): [True: 0, False: 9.94k]
  ------------------
 1477|      0|	    xmlRegexpErrMemory(ctxt);
 1478|      0|	    return(-1);
 1479|      0|	}
 1480|  9.94k|	tmp = xmlRealloc(ctxt->atoms, newSize * sizeof(tmp[0]));
 1481|  9.94k|	if (tmp == NULL) {
  ------------------
  |  Branch (1481:6): [True: 16, False: 9.92k]
  ------------------
 1482|     16|	    xmlRegexpErrMemory(ctxt);
 1483|     16|	    return(-1);
 1484|     16|	}
 1485|  9.92k|	ctxt->atoms = tmp;
 1486|  9.92k|        ctxt->maxAtoms = newSize;
 1487|  9.92k|    }
 1488|   291k|    atom->no = ctxt->nbAtoms;
 1489|   291k|    ctxt->atoms[ctxt->nbAtoms++] = atom;
 1490|   291k|    return(0);
 1491|   291k|}
xmlregexp.c:xmlFAGenerateEpsilonTransition:
 1640|   294k|			       xmlRegStatePtr from, xmlRegStatePtr to) {
 1641|   294k|    if (to == NULL) {
  ------------------
  |  Branch (1641:9): [True: 90.8k, False: 203k]
  ------------------
 1642|  90.8k|	to = xmlRegStatePush(ctxt);
 1643|  90.8k|        if (to == NULL)
  ------------------
  |  Branch (1643:13): [True: 18, False: 90.8k]
  ------------------
 1644|     18|            return(-1);
 1645|  90.8k|	ctxt->state = to;
 1646|  90.8k|    }
 1647|   294k|    xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
 1648|   294k|    return(0);
 1649|   294k|}

xmlSaveSetIndentString:
  126|  40.3k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  40.3k|    size_t len;
  128|  40.3k|    int i;
  129|       |
  130|  40.3k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 40.3k]
  |  Branch (130:27): [True: 0, False: 40.3k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  40.3k|    len = strlen(indent);
  134|  40.3k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  40.3k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 40.3k]
  |  Branch (134:23): [True: 0, False: 40.3k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  40.3k|    ctxt->indent_size = len;
  138|  40.3k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  40.3k|#define MAX_INDENT 60
  ------------------
  139|  1.25M|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 1.20M, False: 40.3k]
  ------------------
  140|  1.20M|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  40.3k|    return(0);
  143|  40.3k|}
xmlNodeDumpOutput:
 2334|  40.3k|{
 2335|  40.3k|    xmlSaveCtxt ctxt;
 2336|  40.3k|    int options;
 2337|  40.3k|#ifdef LIBXML_HTML_ENABLED
 2338|  40.3k|    xmlDtdPtr dtd;
 2339|  40.3k|    int is_xhtml = 0;
 2340|  40.3k|#endif
 2341|       |
 2342|  40.3k|    (void) doc;
 2343|       |
 2344|  40.3k|    xmlInitParser();
 2345|       |
 2346|  40.3k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 40.3k]
  |  Branch (2346:26): [True: 0, False: 40.3k]
  ------------------
 2347|       |
 2348|  40.3k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 40.3k]
  ------------------
 2349|      0|        level = 0;
 2350|  40.3k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 40.3k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  40.3k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 40.3k, False: 0]
  ------------------
 2354|  40.3k|        encoding = "UTF-8";
 2355|       |
 2356|  40.3k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  40.3k|    ctxt.buf = buf;
 2358|  40.3k|    ctxt.level = level;
 2359|  40.3k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  40.3k|    options = XML_SAVE_AS_XML;
 2362|  40.3k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 40.3k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  40.3k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  40.3k|#ifdef LIBXML_HTML_ENABLED
 2367|  40.3k|    dtd = xmlGetIntSubset(doc);
 2368|  40.3k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 25.8k, False: 14.5k]
  ------------------
 2369|  25.8k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  25.8k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 8.10k, False: 17.7k]
  ------------------
 2371|  8.10k|	    is_xhtml = 0;
 2372|  25.8k|    }
 2373|       |
 2374|  40.3k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 16.4k, False: 23.8k]
  ------------------
 2375|  16.4k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  23.8k|    else
 2377|  23.8k|#endif
 2378|  23.8k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  40.3k|}
xmlsave.c:xmlNsDumpOutput:
  762|   899k|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|   899k|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|   899k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|   899k|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 899k]
  |  Branch (765:26): [True: 0, False: 899k]
  ------------------
  766|       |
  767|   899k|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 899k]
  |  Branch (767:27): [True: 0, False: 899k]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|   899k|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|   899k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 899k, False: 0]
  |  Branch (770:47): [True: 895k, False: 4.28k]
  ------------------
  771|   895k|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|   895k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 254, False: 895k]
  ------------------
  772|    254|	    return;
  773|       |
  774|   895k|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 895k, False: 0]
  |  Branch (774:22): [True: 0, False: 895k]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|   895k|	else
  777|   895k|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|   895k|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 886k, False: 8.62k]
  ------------------
  781|   886k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   886k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   886k|	} else
  784|  8.62k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|   895k|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|   895k|        xmlOutputBufferWrite(buf, 1, "\"");
  788|   895k|    }
  789|   899k|}
xmlsave.c:xmlSaveDocInternal:
 1226|  1.28k|                   const xmlChar *encoding) {
 1227|  1.28k|#ifdef LIBXML_HTML_ENABLED
 1228|  1.28k|    xmlDtdPtr dtd;
 1229|  1.28k|    int is_xhtml = 0;
 1230|  1.28k|#endif
 1231|  1.28k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  1.28k|    int switched_encoding = 0;
 1233|       |
 1234|  1.28k|    xmlInitParser();
 1235|       |
 1236|  1.28k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1.28k, False: 0]
  ------------------
 1237|  1.28k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.28k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  1.28k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.28k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  1.28k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1.28k]
  ------------------
 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.28k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1.28k]
  ------------------
 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.28k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1.28k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  1.28k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  1.28k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 1.28k, False: 0]
  |  Branch (1270:28): [True: 0, False: 1.28k]
  ------------------
 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.28k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1.28k, False: 0]
  ------------------
 1280|  1.28k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  1.28k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1.28k, False: 0]
  ------------------
 1282|  1.28k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  1.28k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  1.28k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 1.28k, False: 0]
  ------------------
 1287|  1.28k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  1.28k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  1.28k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  1.28k|	    }
 1291|  1.28k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 144, False: 1.14k]
  ------------------
 1292|     78|		case 0:
  ------------------
  |  Branch (1292:3): [True: 78, False: 1.21k]
  ------------------
 1293|     78|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     78|		    break;
 1295|     66|		case 1:
  ------------------
  |  Branch (1295:3): [True: 66, False: 1.22k]
  ------------------
 1296|     66|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     66|		    break;
 1298|  1.28k|	    }
 1299|  1.28k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  1.28k|	}
 1301|       |
 1302|  1.28k|#ifdef LIBXML_HTML_ENABLED
 1303|  1.28k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 196, False: 1.09k]
  ------------------
 1304|    196|            is_xhtml = 1;
 1305|  1.28k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1.28k, False: 0]
  ------------------
 1306|  1.28k|	    dtd = xmlGetIntSubset(cur);
 1307|  1.28k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 1.20k, False: 81]
  ------------------
 1308|  1.20k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  1.20k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 869, False: 338]
  ------------------
 1310|  1.20k|	    }
 1311|  1.28k|	}
 1312|  1.28k|#endif
 1313|  1.28k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1.28k, False: 0]
  ------------------
 1314|  1.28k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  3.82k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 2.53k, False: 1.28k]
  ------------------
 1317|  2.53k|		ctxt->level = 0;
 1318|  2.53k|#ifdef LIBXML_HTML_ENABLED
 1319|  2.53k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 428, False: 2.10k]
  ------------------
 1320|    428|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  2.10k|		else
 1322|  2.10k|#endif
 1323|  2.10k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  2.53k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 2.53k, False: 0]
  ------------------
 1325|  2.53k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 2.53k, False: 0]
  ------------------
 1326|  2.53k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  2.53k|		child = child->next;
 1328|  2.53k|	    }
 1329|  1.28k|	}
 1330|  1.28k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  1.28k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1.28k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  1.28k|    return(0);
 1340|  1.28k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  16.9k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  16.9k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  16.9k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  16.9k|    xmlChar *start, *end;
 1493|  16.9k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  16.9k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 16.9k]
  ------------------
 1496|       |
 1497|  16.9k|    oldoptions = ctxt->options;
 1498|  16.9k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  16.9k|    root = cur;
 1501|  16.9k|    parent = cur->parent;
 1502|  36.7k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 36.7k, Folded]
  ------------------
 1503|  36.7k|        switch (cur->type) {
 1504|    196|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 196, False: 36.5k]
  ------------------
 1505|    196|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 36.7k]
  ------------------
 1506|    196|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    196|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 36.7k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    196|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 196, False: 36.5k]
  ------------------
 1514|    196|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    196|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 36.7k]
  ------------------
 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: 36.7k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 36.7k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 36.7k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  21.7k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 21.7k, False: 15.0k]
  ------------------
 1539|  21.7k|            addmeta = 0;
 1540|       |
 1541|  21.7k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 10.9k, False: 10.8k]
  |  Branch (1541:27): [True: 0, False: 10.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|  21.7k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 21.7k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  21.7k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  21.7k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 2.47k, False: 19.2k]
  |  Branch (1555:38): [True: 664, False: 1.81k]
  ------------------
 1556|    664|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|    664|                xmlOutputBufferWrite(buf, 1, ":");
 1558|    664|            }
 1559|       |
 1560|  21.7k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  21.7k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 3.19k, False: 18.5k]
  ------------------
 1562|  3.19k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  21.7k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  21.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.01k, False: 20.7k]
  ------------------
 1564|  1.01k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 622, False: 392]
  |  Branch (1564:38): [True: 477, False: 145]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    477|                xmlOutputBufferWriteString(buf,
 1569|    477|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    477|            }
 1571|  21.7k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 7.30k, False: 14.4k]
  ------------------
 1572|  7.30k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  21.7k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 11.1k, False: 10.6k]
  ------------------
 1575|  11.1k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 66, False: 11.0k]
  ------------------
 1576|     66|                xmlStrEqual(cur->name, BAD_CAST"head") &&
  ------------------
  |  |   34|     66|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1576:17): [True: 0, False: 66]
  ------------------
 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|  21.7k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 13.3k, False: 8.39k]
  ------------------
 1605|  13.3k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 11.9k, False: 1.39k]
  |  Branch (1605:43): [True: 1.08k, False: 309]
  ------------------
 1606|  13.0k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 3.24k, False: 9.76k]
  |  Branch (1606:50): [True: 3.24k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  3.24k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  10.0k|                } else {
 1612|  10.0k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 10.0k]
  ------------------
 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|  10.0k|                    } else {
 1631|  10.0k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  10.0k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  10.0k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  10.0k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 1.39k, False: 8.67k]
  |  Branch (1637:46): [True: 309, False: 1.08k]
  ------------------
 1638|    309|                        xmlOutputBufferWriteString(buf,
 1639|    309|                                (const char *)cur->ns->prefix);
 1640|    309|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|    309|                    }
 1642|  10.0k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  10.0k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  10.0k|                }
 1645|  13.3k|            } else {
 1646|  8.39k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  8.39k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 8.39k]
  ------------------
 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|  8.39k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 8.39k]
  ------------------
 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|  8.39k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 8.39k]
  ------------------
 1678|  8.39k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 8.39k, False: 0]
  ------------------
 1679|  8.39k|                parent = cur;
 1680|  8.39k|                cur = cur->children;
 1681|  8.39k|                continue;
 1682|  8.39k|            }
 1683|       |
 1684|  13.3k|            break;
 1685|       |
 1686|  13.3k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 12.3k, False: 24.3k]
  ------------------
 1687|  12.3k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 12.3k]
  ------------------
 1688|      0|                break;
 1689|  12.3k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 12.3k, False: 0]
  ------------------
 1690|  12.3k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  12.3k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 12.3k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  12.3k|                else
 1695|  12.3k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  12.3k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  12.3k|	    break;
 1703|       |
 1704|    920|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 920, False: 35.8k]
  ------------------
 1705|    920|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 448, False: 472]
  ------------------
 1706|    448|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    448|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    448|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 448, False: 0]
  ------------------
 1709|    448|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    448|                    xmlOutputBufferWriteString(buf,
 1711|    448|                            (const char *)cur->content);
 1712|    448|                }
 1713|    448|                xmlOutputBufferWrite(buf, 2, "?>");
 1714|    472|            } else {
 1715|    472|                xmlOutputBufferWrite(buf, 2, "<?");
 1716|    472|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1717|    472|                xmlOutputBufferWrite(buf, 2, "?>");
 1718|    472|            }
 1719|    920|            break;
 1720|       |
 1721|    448|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 448, False: 36.3k]
  ------------------
 1722|    448|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 448, False: 0]
  ------------------
 1723|    448|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    448|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    448|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    448|            }
 1727|    448|            break;
 1728|       |
 1729|    515|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 515, False: 36.2k]
  ------------------
 1730|    515|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    515|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    515|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    515|            break;
 1734|       |
 1735|    315|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 315, False: 36.4k]
  ------------------
 1736|    315|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 315]
  |  Branch (1736:41): [True: 70, False: 245]
  ------------------
 1737|     70|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    245|            } else {
 1739|    245|                start = end = cur->content;
 1740|  4.29k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 4.05k, False: 245]
  ------------------
 1741|  4.05k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 699, False: 3.35k]
  |  Branch (1741:40): [True: 395, False: 304]
  ------------------
 1742|    395|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 395]
  ------------------
 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.05k|                    end++;
 1751|  4.05k|                }
 1752|    245|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 245, False: 0]
  ------------------
 1753|    245|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    245|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    245|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    245|                }
 1757|    245|            }
 1758|    315|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 36.7k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|     88|        default:
  ------------------
  |  Branch (1764:9): [True: 88, False: 36.6k]
  ------------------
 1765|     88|            break;
 1766|  36.7k|        }
 1767|       |
 1768|  36.7k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 36.7k, Folded]
  ------------------
 1769|  36.7k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 16.9k, False: 19.8k]
  ------------------
 1770|  16.9k|                return;
 1771|  19.8k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 19.8k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  19.8k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 11.4k, False: 8.39k]
  ------------------
 1774|  11.4k|                cur = cur->next;
 1775|  11.4k|                break;
 1776|  11.4k|            }
 1777|       |
 1778|  8.39k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  8.39k|            parent = cur->parent;
 1781|       |
 1782|  8.39k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 8.39k, False: 0]
  ------------------
 1783|  8.39k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 8.39k, False: 0]
  ------------------
 1784|  8.39k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 8.39k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  8.39k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  8.39k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 1.08k, False: 7.31k]
  |  Branch (1788:42): [True: 355, False: 727]
  ------------------
 1789|    355|                    xmlOutputBufferWriteString(buf,
 1790|    355|                            (const char *)cur->ns->prefix);
 1791|    355|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|    355|                }
 1793|       |
 1794|  8.39k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  8.39k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  8.39k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 8.39k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  8.39k|            }
 1802|  8.39k|        }
 1803|  28.3k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  10.0k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  10.0k|    xmlOutputBufferPtr buf;
  829|  10.0k|    xmlNodePtr cur;
  830|  10.0k|    int format, level;
  831|       |
  832|  10.0k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 10.0k]
  ------------------
  833|  10.0k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 10.0k]
  |  Branch (833:27): [True: 0, False: 10.0k]
  ------------------
  834|      0|        return;
  835|  10.0k|    buf = ctxt->buf;
  836|  10.0k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  10.0k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  10.0k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 552, False: 9.49k]
  ------------------
  839|    552|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    552|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    552|	xmlOutputBufferWrite(buf, 1, " ");
  842|    552|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  9.49k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 586, False: 8.90k]
  ------------------
  844|    586|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    586|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    586|    }
  847|  10.0k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 7.53k, False: 2.51k]
  |  Branch (847:36): [True: 1.69k, False: 5.83k]
  ------------------
  848|  1.69k|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 1.69k, False: 0]
  |  Branch (848:38): [True: 1.33k, False: 360]
  ------------------
  849|  1.33k|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 1.25k, False: 83]
  ------------------
  850|  1.25k|	xmlOutputBufferWrite(buf, 1, ">");
  851|  1.25k|	return;
  852|  1.25k|    }
  853|  8.79k|    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|  8.79k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.29k, False: 7.50k]
  |  Branch (858:38): [True: 1.07k, False: 213]
  ------------------
  859|  1.29k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 213, False: 0]
  ------------------
  860|  1.29k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.29k|    }
  862|  8.79k|    format = ctxt->format;
  863|  8.79k|    level = ctxt->level;
  864|  8.79k|    ctxt->format = 0;
  865|  8.79k|    ctxt->level = -1;
  866|  27.2k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 18.4k, False: 8.79k]
  ------------------
  867|  18.4k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  18.4k|    }
  869|  8.79k|    ctxt->format = format;
  870|  8.79k|    ctxt->level = level;
  871|  8.79k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  8.79k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  6.16k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  6.16k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  6.16k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 973, False: 5.19k]
  ------------------
  420|    973|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|    973|        xmlOutputBufferWrite(buf, 1, ":");
  422|    973|    }
  423|  6.16k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  6.16k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  6.16k|    switch (elem->etype) {
  427|  1.23k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.23k, False: 4.92k]
  ------------------
  428|  1.23k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.23k|	    break;
  430|    234|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 234, False: 5.92k]
  ------------------
  431|    234|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|    234|	    break;
  433|    526|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 526, False: 5.63k]
  ------------------
  434|  4.69k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 4.16k, False: 1.99k]
  ------------------
  435|  4.69k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  4.69k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 6.16k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  6.16k|    }
  441|       |
  442|  6.16k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  6.16k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  4.69k|                         xmlElementContentPtr content) {
  346|  4.69k|    xmlElementContentPtr cur;
  347|       |
  348|  4.69k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 4.69k]
  ------------------
  349|       |
  350|  4.69k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  4.69k|    cur = content;
  352|       |
  353|   112k|    do {
  354|   112k|        if (cur == NULL) return;
  ------------------
  |  Branch (354:13): [True: 0, False: 112k]
  ------------------
  355|       |
  356|   112k|        switch (cur->type) {
  ------------------
  |  Branch (356:17): [True: 112k, False: 0]
  ------------------
  357|    526|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 526, False: 112k]
  ------------------
  358|    526|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    526|                break;
  360|  58.2k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 58.2k, False: 54.5k]
  ------------------
  361|  58.2k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 5.69k, False: 52.5k]
  ------------------
  362|  5.69k|                    xmlOutputBufferWriteString(buf,
  363|  5.69k|                            (const char *) cur->prefix);
  364|  5.69k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  5.69k|                }
  366|  58.2k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|  58.2k|                break;
  368|  22.0k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 22.0k, False: 90.7k]
  ------------------
  369|  54.0k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 31.9k, False: 80.8k]
  ------------------
  370|  54.0k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 52.3k, False: 1.73k]
  ------------------
  371|  52.3k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 52.3k, False: 0]
  ------------------
  372|  52.3k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 9.17k, False: 43.1k]
  ------------------
  373|  43.1k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 2.77k, False: 40.3k]
  ------------------
  374|  11.9k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|  54.0k|                cur = cur->c1;
  376|  54.0k|                continue;
  377|   112k|        }
  378|       |
  379|   112k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 108k, False: 4.69k]
  ------------------
  380|   108k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   108k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 108k]
  ------------------
  383|       |
  384|   108k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 30.8k, False: 77.2k]
  ------------------
  385|  77.2k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 21.5k, False: 55.7k]
  ------------------
  386|  52.3k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 9.17k, False: 43.1k]
  ------------------
  387|  43.1k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 2.77k, False: 40.3k]
  ------------------
  388|  11.9k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   108k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   108k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 54.0k, False: 54.0k]
  ------------------
  392|  54.0k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 22.0k, False: 31.9k]
  ------------------
  393|  22.0k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  31.9k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 31.9k, False: 0]
  ------------------
  395|  31.9k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|  54.0k|                cur = parent->c2;
  398|  54.0k|                break;
  399|  54.0k|            }
  400|       |
  401|  54.0k|            cur = parent;
  402|  54.0k|        }
  403|   112k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 108k, False: 4.69k]
  ------------------
  404|       |
  405|  4.69k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  4.69k|    xmlBufDumpElementOccur(buf, content);
  407|  4.69k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   112k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   112k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 112k, False: 0]
  ------------------
  323|  87.2k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 87.2k, False: 25.4k]
  ------------------
  324|  87.2k|            break;
  325|  10.5k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 10.5k, False: 102k]
  ------------------
  326|  10.5k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  10.5k|            break;
  328|  12.0k|        case XML_ELEMENT_CONTENT_MULT:
  ------------------
  |  Branch (328:9): [True: 12.0k, False: 100k]
  ------------------
  329|  12.0k|            xmlOutputBufferWrite(buf, 1, "*");
  330|  12.0k|            break;
  331|  2.80k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 2.80k, False: 109k]
  ------------------
  332|  2.80k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  2.80k|            break;
  334|   112k|    }
  335|   112k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  7.58k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  7.58k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  7.58k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  7.58k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  7.58k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  7.58k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 2.40k, False: 5.18k]
  ------------------
  478|  2.40k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  2.40k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  2.40k|    }
  481|  7.58k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  7.58k|    switch (attr->atype) {
  484|    966|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 966, False: 6.62k]
  ------------------
  485|    966|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|    966|	    break;
  487|  1.12k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 1.12k, False: 6.46k]
  ------------------
  488|  1.12k|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|  1.12k|	    break;
  490|    750|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 750, False: 6.83k]
  ------------------
  491|    750|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    750|	    break;
  493|    445|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 445, False: 7.14k]
  ------------------
  494|    445|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    445|	    break;
  496|    617|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 617, False: 6.97k]
  ------------------
  497|    617|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    617|	    break;
  499|    424|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 424, False: 7.16k]
  ------------------
  500|    424|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    424|	    break;
  502|    310|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 310, False: 7.27k]
  ------------------
  503|    310|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    310|	    break;
  505|    256|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 256, False: 7.33k]
  ------------------
  506|    256|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    256|	    break;
  508|  2.39k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 2.39k, False: 5.19k]
  ------------------
  509|  2.39k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  2.39k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  2.39k|	    break;
  512|    300|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 300, False: 7.28k]
  ------------------
  513|    300|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    300|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    300|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 7.58k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  7.58k|    }
  520|       |
  521|  7.58k|    switch (attr->def) {
  522|  4.88k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 4.88k, False: 2.70k]
  ------------------
  523|  4.88k|	    break;
  524|    738|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 738, False: 6.85k]
  ------------------
  525|    738|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    738|	    break;
  527|    636|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 636, False: 6.95k]
  ------------------
  528|    636|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    636|	    break;
  530|  1.32k|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 1.32k, False: 6.26k]
  ------------------
  531|  1.32k|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|  1.32k|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 7.58k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  7.58k|    }
  537|       |
  538|  7.58k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 3.46k, False: 4.12k]
  ------------------
  539|  3.46k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  3.46k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  3.46k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  3.46k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  3.46k|    }
  543|       |
  544|  7.58k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  7.58k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  2.69k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  6.37k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 3.68k, False: 2.69k]
  ------------------
  454|  3.68k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  3.68k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 992, False: 2.69k]
  ------------------
  456|    992|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  3.68k|        cur = cur->next;
  459|  3.68k|    }
  460|       |
  461|  2.69k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  2.69k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  4.53k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  4.53k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 355, False: 4.17k]
  ------------------
  594|  4.17k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 73, False: 4.10k]
  ------------------
  595|    428|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  4.10k|    else
  597|  4.10k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  4.53k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  4.53k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  4.53k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 1.54k, False: 2.98k]
  ------------------
  602|  2.98k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 504, False: 2.48k]
  ------------------
  603|  2.48k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 73, False: 2.40k]
  ------------------
  604|  2.12k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 517, False: 1.60k]
  ------------------
  605|    517|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    517|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    517|             xmlOutputBufferWrite(buf, 1, " ");
  608|  1.60k|        } else {
  609|  1.60k|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|  1.60k|        }
  611|  2.12k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  2.12k|    }
  613|       |
  614|  4.53k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 504, False: 4.02k]
  ------------------
  615|    504|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 367, False: 137]
  ------------------
  616|    367|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    367|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 87, False: 280]
  ------------------
  618|     87|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    280|            else
  620|    280|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    367|        }
  622|    504|    }
  623|       |
  624|  4.53k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 2.05k, False: 2.47k]
  ------------------
  625|  2.47k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 355, False: 2.12k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.40k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.38k, False: 28]
  ------------------
  631|  2.38k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     28|        else
  633|     28|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.40k|    }
  635|       |
  636|  4.53k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  4.53k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     28|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     28|    const char * base, *cur;
  557|       |
  558|     28|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 28]
  ------------------
  559|      0|        return;
  560|       |
  561|     28|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     28|    base = cur = (const char *) content;
  563|    332|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 304, False: 28]
  ------------------
  564|    304|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 304]
  ------------------
  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|    304|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 304]
  ------------------
  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|    304|        } else {
  577|    304|            cur++;
  578|    304|        }
  579|    304|    }
  580|     28|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 28, False: 0]
  ------------------
  581|     28|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     28|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     28|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   878k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|  1.77M|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 899k, False: 878k]
  ------------------
  801|   899k|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|   899k|	cur = cur->next;
  803|   899k|    }
  804|   878k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  7.30k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  7.30k|    xmlAttrPtr xml_lang = NULL;
 1423|  7.30k|    xmlAttrPtr lang = NULL;
 1424|  7.30k|    xmlAttrPtr name = NULL;
 1425|  7.30k|    xmlAttrPtr id = NULL;
 1426|  7.30k|    xmlNodePtr parent;
 1427|  7.30k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  7.30k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 7.30k]
  ------------------
 1430|  7.30k|    buf = ctxt->buf;
 1431|  7.30k|    parent = cur->parent;
 1432|  25.6k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 18.3k, False: 7.30k]
  ------------------
 1433|  18.3k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  17.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 17.1k, False: 1.25k]
  |  Branch (1433:27): [True: 395, False: 16.7k]
  ------------------
 1434|    395|	    id = cur;
 1435|  17.9k|	else
 1436|  17.9k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  16.7k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 16.7k, False: 1.25k]
  |  Branch (1436:27): [True: 2.39k, False: 14.3k]
  ------------------
 1437|  2.39k|	    name = cur;
 1438|  15.6k|	else
 1439|  15.6k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  14.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 14.3k, False: 1.25k]
  |  Branch (1439:27): [True: 568, False: 13.7k]
  ------------------
 1440|    568|	    lang = cur;
 1441|  15.0k|	else
 1442|  15.0k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  1.25k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 1.25k, False: 13.7k]
  |  Branch (1442:27): [True: 922, False: 330]
  ------------------
 1443|    922|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    922|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 647, False: 275]
  ------------------
 1444|    647|	    xml_lang = cur;
 1445|  18.3k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  18.3k|	cur = cur->next;
 1447|  18.3k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  7.30k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 2.39k, False: 4.90k]
  |  Branch (1451:27): [True: 2.19k, False: 198]
  ------------------
 1452|  2.19k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 2.19k, False: 0]
  |  Branch (1452:26): [True: 2.19k, False: 0]
  ------------------
 1453|  2.19k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  2.19k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 559, False: 1.63k]
  ------------------
 1454|  1.63k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.63k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 73, False: 1.56k]
  ------------------
 1455|  1.56k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.56k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 221, False: 1.34k]
  ------------------
 1456|  1.34k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.34k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 203, False: 1.14k]
  ------------------
 1457|  1.14k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.14k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 66, False: 1.07k]
  ------------------
 1458|  1.07k|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|  1.07k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 216, False: 860]
  ------------------
 1459|    860|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|    860|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 227, False: 633]
  ------------------
 1460|    633|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    633|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 201, False: 432]
  ------------------
 1461|  1.98k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    432|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 220, False: 212]
  ------------------
 1462|  1.98k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  1.98k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  1.98k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  1.98k|	}
 1466|  2.19k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  7.30k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 550, False: 6.75k]
  |  Branch (1470:27): [True: 279, False: 271]
  ------------------
 1471|    279|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    279|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    279|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    279|    } else
 1475|  7.02k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 527, False: 6.49k]
  |  Branch (1475:31): [True: 256, False: 271]
  ------------------
 1476|    256|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    256|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    256|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    256|    }
 1480|  7.30k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|  76.7k|{
  242|  76.7k|    xmlNodePtr children;
  243|  76.7k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|  76.7k|    children = attr->children;
  246|   146k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 69.5k, False: 76.7k]
  ------------------
  247|  69.5k|        switch (children->type) {
  248|  69.1k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 69.1k, False: 388]
  ------------------
  249|  69.1k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  69.1k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|  69.1k|		break;
  251|    388|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 388, False: 69.1k]
  ------------------
  252|    388|                xmlOutputBufferWrite(buf, 1, "&");
  253|    388|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    388|                xmlOutputBufferWrite(buf, 1, ";");
  255|    388|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 69.5k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|  69.5k|        }
  260|  69.5k|        children = children->next;
  261|  69.5k|    }
  262|  76.7k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  13.0k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  13.0k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 13.0k]
  ------------------
 1358|      0|	return(-1);
 1359|  13.0k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 13.0k]
  ------------------
 1360|      0|	return(0);
 1361|  13.0k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|  1.08k|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|  1.08k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 1.08k, False: 11.9k]
  |  Branch (1361:31): [True: 862, False: 226]
  ------------------
 1362|    862|	return(0);
 1363|  12.1k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 12.1k]
  ------------------
 1364|      0|	return(0);
 1365|  12.1k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 12.1k, False: 0]
  |  Branch (1365:13): [True: 9.23k, False: 2.91k]
  ------------------
 1366|  2.23k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 2.23k, False: 9.91k]
  ------------------
 1367|  2.23k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  2.23k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 208, False: 2.02k]
  ------------------
 1368|    208|		return(1);
 1369|  2.02k|	    return(0);
 1370|  1.02k|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 1.02k, False: 11.1k]
  ------------------
 1371|  1.02k|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|  1.02k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 76, False: 946]
  ------------------
 1372|     76|		return(1);
 1373|    946|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    946|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 306, False: 640]
  ------------------
 1374|    306|		return(1);
 1375|    640|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    640|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 204, False: 436]
  ------------------
 1376|    204|		return(1);
 1377|    436|	    return(0);
 1378|    610|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 610, False: 11.5k]
  ------------------
 1379|    610|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    610|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 238, False: 372]
  ------------------
 1380|    238|		return(1);
 1381|    372|	    return(0);
 1382|    932|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 932, False: 11.2k]
  ------------------
 1383|    932|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|    932|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 306, False: 626]
  ------------------
 1384|    306|		return(1);
 1385|    626|	    return(0);
 1386|    588|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 588, False: 11.5k]
  ------------------
 1387|    588|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    588|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 205, False: 383]
  ------------------
 1388|    205|		return(1);
 1389|    383|	    return(0);
 1390|  1.66k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.66k, False: 10.4k]
  ------------------
 1391|  1.66k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.66k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 823, False: 839]
  ------------------
 1392|    823|		return(1);
 1393|    839|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    839|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 197, False: 642]
  ------------------
 1394|    197|		return(1);
 1395|    642|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    642|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 220, False: 422]
  ------------------
 1396|    220|		return(1);
 1397|    422|	    return(0);
 1398|    363|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 363, False: 11.7k]
  ------------------
 1399|    363|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    363|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 68, False: 295]
  ------------------
 1400|     68|		return(1);
 1401|    295|	    return(0);
 1402|  1.07k|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 1.07k, False: 11.0k]
  ------------------
 1403|  1.07k|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|  1.07k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 199, False: 872]
  ------------------
 1404|    199|		return(1);
 1405|    872|	    return(0);
 1406|    757|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 757, False: 11.3k]
  ------------------
 1407|    757|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    757|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 196, False: 561]
  ------------------
 1408|    196|		return(1);
 1409|    561|	    return(0);
 1410|  12.1k|    }
 1411|  2.91k|    return(0);
 1412|  12.1k|}
xmlsave.c:xmlSaveWriteText:
  226|   976k|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|   976k|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 976k]
  ------------------
  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|   976k|}
xmlsave.c:xmlAttrDumpOutput:
  881|  74.4k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|  74.4k|    xmlOutputBufferPtr buf;
  883|       |
  884|  74.4k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 74.4k]
  ------------------
  885|  74.4k|    buf = ctxt->buf;
  886|  74.4k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 74.4k]
  ------------------
  887|  74.4k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 74.4k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|  74.4k|    else
  890|  74.4k|        xmlOutputBufferWrite(buf, 1, " ");
  891|  74.4k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 14.7k, False: 59.7k]
  |  Branch (891:30): [True: 14.1k, False: 563]
  ------------------
  892|  14.1k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|  14.1k|	xmlOutputBufferWrite(buf, 1, ":");
  894|  14.1k|    }
  895|  74.4k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|  74.4k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|  74.4k|#ifdef LIBXML_HTML_ENABLED
  898|  74.4k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 18.3k, False: 56.1k]
  ------------------
  899|  18.3k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 17.1k, False: 1.25k]
  ------------------
  900|  17.1k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 6.70k, False: 10.4k]
  ------------------
  901|  10.4k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 10.4k]
  ------------------
  902|  10.4k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 7.82k, False: 2.61k]
  ------------------
  903|  14.5k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 223, False: 14.3k]
  ------------------
  904|    223|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    223|    } else
  906|  74.2k|#endif
  907|  74.2k|    {
  908|  74.2k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|  74.2k|    }
  910|  74.4k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|  74.4k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  44.3k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  44.3k|    int format = ctxt->format;
  963|  44.3k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  44.3k|    xmlAttrPtr attr;
  965|  44.3k|    xmlChar *start, *end;
  966|  44.3k|    xmlOutputBufferPtr buf;
  967|       |
  968|  44.3k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 44.3k]
  ------------------
  969|  44.3k|    buf = ctxt->buf;
  970|       |
  971|  44.3k|    root = cur;
  972|  44.3k|    parent = cur->parent;
  973|  3.56M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 3.56M, Folded]
  ------------------
  974|  3.56M|        switch (cur->type) {
  975|  1.09k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 1.09k, False: 3.56M]
  ------------------
  976|  1.09k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 3.56M]
  ------------------
  977|  1.09k|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|  1.09k|	    break;
  979|       |
  980|  9.85k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 9.85k, False: 3.55M]
  ------------------
  981|  9.85k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  9.85k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 3.56M]
  ------------------
  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|  6.16k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 6.16k, False: 3.56M]
  ------------------
  994|  6.16k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  6.16k|            break;
  996|       |
  997|  7.58k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 7.58k, False: 3.56M]
  ------------------
  998|  7.58k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  7.58k|            break;
 1000|       |
 1001|  4.53k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 4.53k, False: 3.56M]
  ------------------
 1002|  4.53k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  4.53k|            break;
 1004|       |
 1005|  1.77M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 1.77M, False: 1.79M]
  ------------------
 1006|  1.77M|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 1.77M, False: 4.93k]
  |  Branch (1006:27): [True: 0, False: 1.77M]
  ------------------
 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|  1.77M|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 1.77M]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|  1.77M|            xmlOutputBufferWrite(buf, 1, "<");
 1020|  1.77M|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 33.7k, False: 1.74M]
  |  Branch (1020:38): [True: 23.1k, False: 10.5k]
  ------------------
 1021|  23.1k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|  23.1k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|  23.1k|            }
 1024|  1.77M|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|  1.77M|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 875k, False: 900k]
  ------------------
 1026|   875k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  1.83M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 56.1k, False: 1.77M]
  ------------------
 1028|  56.1k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|  1.77M|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 23.9k, False: 1.75M]
  ------------------
 1031|  23.9k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 23.9k, False: 0]
  ------------------
 1032|  23.9k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 23.9k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|  23.9k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|  23.9k|                } 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|  1.75M|            } else {
 1050|  1.75M|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 1.75M]
  ------------------
 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|  1.75M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1.75M]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|  1.75M|                xmlOutputBufferWrite(buf, 1, ">");
 1066|  1.75M|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1.75M]
  ------------------
 1067|  1.75M|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1.75M, False: 0]
  ------------------
 1068|  1.75M|                parent = cur;
 1069|  1.75M|                cur = cur->children;
 1070|  1.75M|                continue;
 1071|  1.75M|            }
 1072|       |
 1073|  23.9k|            break;
 1074|       |
 1075|   891k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 891k, False: 2.67M]
  ------------------
 1076|   891k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 240, False: 891k]
  ------------------
 1077|    240|                break;
 1078|   891k|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 891k, False: 0]
  ------------------
 1079|   891k|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 891k]
  ------------------
 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|   891k|                else
 1087|   891k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|   891k|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|   891k|	    break;
 1095|       |
 1096|  1.48k|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 1.48k, False: 3.56M]
  ------------------
 1097|  1.48k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 851, False: 637]
  |  Branch (1097:27): [True: 0, False: 851]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|  1.48k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 402, False: 1.08k]
  ------------------
 1101|    402|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    402|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    402|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 402, False: 0]
  ------------------
 1104|    402|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 402]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    402|                    else
 1107|    402|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    402|                    xmlOutputBufferWriteString(buf,
 1109|    402|                            (const char *)cur->content);
 1110|    402|                }
 1111|    402|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|  1.08k|            } else {
 1113|  1.08k|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|  1.08k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|  1.08k|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 1.08k]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|  1.08k|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|  1.08k|            }
 1119|  1.48k|            break;
 1120|       |
 1121|  4.74k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 4.74k, False: 3.56M]
  ------------------
 1122|  4.74k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 893, False: 3.85k]
  |  Branch (1122:27): [True: 0, False: 893]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|  4.74k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 4.74k, False: 0]
  ------------------
 1126|  4.74k|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|  4.74k|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|  4.74k|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|  4.74k|            }
 1130|  4.74k|            break;
 1131|       |
 1132|  1.25k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 1.25k, False: 3.56M]
  ------------------
 1133|  1.25k|            xmlOutputBufferWrite(buf, 1, "&");
 1134|  1.25k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|  1.25k|            xmlOutputBufferWrite(buf, 1, ";");
 1136|  1.25k|            break;
 1137|       |
 1138|  1.49k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 1.49k, False: 3.56M]
  ------------------
 1139|  1.49k|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 1.49k]
  |  Branch (1139:41): [True: 201, False: 1.29k]
  ------------------
 1140|    201|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|  1.29k|            } else {
 1142|  1.29k|                start = end = cur->content;
 1143|  4.26k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 2.97k, False: 1.29k]
  ------------------
 1144|  2.97k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 605, False: 2.36k]
  |  Branch (1144:42): [True: 336, False: 269]
  ------------------
 1145|    336|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 336]
  ------------------
 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.97k|                    end++;
 1154|  2.97k|                }
 1155|  1.29k|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 1.29k, False: 0]
  ------------------
 1156|  1.29k|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|  1.29k|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|  1.29k|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|  1.29k|                }
 1160|  1.29k|            }
 1161|  1.49k|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 3.56M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 3.56M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   864k|        default:
  ------------------
  |  Branch (1171:9): [True: 864k, False: 2.70M]
  ------------------
 1172|   864k|            break;
 1173|  3.56M|        }
 1174|       |
 1175|  3.56M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 3.56M, Folded]
  ------------------
 1176|  3.56M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 44.3k, False: 3.52M]
  ------------------
 1177|  44.3k|                return;
 1178|  3.52M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 3.52M]
  ------------------
 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|  3.52M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 1.77M, False: 1.75M]
  ------------------
 1183|  1.77M|                cur = cur->next;
 1184|  1.77M|                break;
 1185|  1.77M|            }
 1186|       |
 1187|  1.75M|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|  1.75M|            parent = cur->parent;
 1190|       |
 1191|  1.75M|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1.75M, False: 0]
  ------------------
 1192|  1.75M|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1.75M, False: 0]
  ------------------
 1193|  1.75M|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1.75M]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|  1.75M|                xmlOutputBufferWrite(buf, 2, "</");
 1197|  1.75M|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 19.6k, False: 1.73M]
  |  Branch (1197:42): [True: 10.8k, False: 8.81k]
  ------------------
 1198|  10.8k|                    xmlOutputBufferWriteString(buf,
 1199|  10.8k|                            (const char *)cur->ns->prefix);
 1200|  10.8k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  10.8k|                }
 1202|       |
 1203|  1.75M|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|  1.75M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1.75M]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|  1.75M|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|  1.75M|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 1.75M]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|  1.75M|            }
 1213|  1.75M|        }
 1214|  1.81M|    }
 1215|  44.3k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.29k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.29k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.29k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.29k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 890, False: 400]
  ------------------
  276|    890|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    890|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    890|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 88, False: 802]
  ------------------
  279|     88|	    xmlOutputBufferWrite(buf, 1, " ");
  280|     88|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|     88|	}
  282|    890|    } else {
  283|    400|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    400|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    400|    }
  286|       |
  287|  1.29k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.29k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.29k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.29k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.29k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.29k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.29k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.29k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  40.3k|{
  154|  40.3k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 40.3k]
  ------------------
  155|       |
  156|  40.3k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  40.3k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  40.3k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 40.3k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  40.3k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 40.3k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  40.3k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 40.3k, False: 0]
  ------------------
  164|  40.3k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  40.3k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 40.3k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  40.3k|    ctxt->options = options;
  168|  40.3k|}

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

xmlStrndup:
   50|  35.6M|xmlStrndup(const xmlChar *cur, int len) {
   51|  35.6M|    xmlChar *ret;
   52|       |
   53|  35.6M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 35.6M]
  |  Branch (53:26): [True: 0, False: 35.6M]
  ------------------
   54|  35.6M|    ret = xmlMalloc((size_t) len + 1);
   55|  35.6M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 3.09k, False: 35.6M]
  ------------------
   56|  3.09k|        return(NULL);
   57|  3.09k|    }
   58|  35.6M|    memcpy(ret, cur, len);
   59|  35.6M|    ret[len] = 0;
   60|  35.6M|    return(ret);
   61|  35.6M|}
xmlStrdup:
   72|  30.6M|xmlStrdup(const xmlChar *cur) {
   73|  30.6M|    const xmlChar *p = cur;
   74|       |
   75|  30.6M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 23, False: 30.6M]
  ------------------
   76|  1.17G|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 1.13G, False: 30.6M]
  ------------------
   77|  30.6M|    return(xmlStrndup(cur, p - cur));
   78|  30.6M|}
xmlCharStrndup:
   89|   790k|xmlCharStrndup(const char *cur, int len) {
   90|   790k|    int i;
   91|   790k|    xmlChar *ret;
   92|       |
   93|   790k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 790k]
  |  Branch (93:26): [True: 0, False: 790k]
  ------------------
   94|   790k|    ret = xmlMalloc((size_t) len + 1);
   95|   790k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 150, False: 790k]
  ------------------
   96|    150|        return(NULL);
   97|    150|    }
   98|  90.4M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 89.6M, False: 790k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  89.6M|        ret[i] = (xmlChar) cur[i];
  101|  89.6M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 89.6M]
  ------------------
  102|  89.6M|    }
  103|   790k|    ret[len] = 0;
  104|   790k|    return(ret);
  105|   790k|}
xmlCharStrdup:
  115|   790k|xmlCharStrdup(const char *cur) {
  116|   790k|    const char *p = cur;
  117|       |
  118|   790k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 790k]
  ------------------
  119|  90.4M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 89.6M, False: 790k]
  ------------------
  120|   790k|    return(xmlCharStrndup(cur, p - cur));
  121|   790k|}
xmlStrcmp:
  132|  3.82k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  3.82k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 3.45k, False: 364]
  ------------------
  134|    364|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 364, 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|  37.6M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  37.6M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 846k, False: 36.7M]
  ------------------
  159|  36.7M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 619k, False: 36.1M]
  ------------------
  160|  36.1M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 3.86M, False: 32.2M]
  ------------------
  161|  32.2M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  32.2M|    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|  36.1M|}
xmlStrQEqual:
  181|  51.2k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  51.2k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 12.5k, False: 38.6k]
  ------------------
  183|  38.6k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 38.6k]
  ------------------
  184|  38.6k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 38.6k]
  ------------------
  185|       |
  186|   137k|    do {
  187|   137k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 137k]
  ------------------
  188|   137k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 137k, False: 0]
  |  Branch (188:26): [True: 98.5k, False: 38.6k]
  ------------------
  189|  38.6k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 38.6k]
  ------------------
  190|   215k|    do {
  191|   215k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 215k]
  ------------------
  192|   215k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 177k, False: 38.6k]
  ------------------
  193|  38.6k|    return(1);
  194|  38.6k|}
xmlStrncmp:
  206|  14.2M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  14.2M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 37, False: 14.2M]
  ------------------
  208|  14.2M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 14.2M]
  ------------------
  209|  14.2M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 2, False: 14.2M]
  ------------------
  210|  14.2M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 14.2M]
  ------------------
  211|  14.2M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  14.2M|    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|  14.2M|}
xmlStrcasecmp:
  266|   103k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|   103k|    register int tmp;
  268|       |
  269|   103k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 103k]
  ------------------
  270|   103k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 103k]
  ------------------
  271|   103k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 103k]
  ------------------
  272|   249k|    do {
  273|   249k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   249k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 98.8k, False: 150k]
  ------------------
  275|   249k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 146k, False: 4.61k]
  ------------------
  276|  4.61k|    return 0;
  277|   103k|}
xmlStrchr:
  312|  70.6M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  70.6M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 70.6M]
  ------------------
  314|   442M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 371M, False: 70.3M]
  ------------------
  315|   371M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 270k, False: 371M]
  ------------------
  316|   371M|        str++;
  317|   371M|    }
  318|  70.3M|    return(NULL);
  319|  70.6M|}
xmlStrstr:
  330|   313k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   313k|    int n;
  332|       |
  333|   313k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 313k]
  ------------------
  334|   313k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 313k]
  ------------------
  335|   313k|    n = xmlStrlen(val);
  336|       |
  337|   313k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 329, False: 313k]
  ------------------
  338|  2.47M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 2.19M, False: 286k]
  ------------------
  339|  2.19M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 34.7k, False: 2.15M]
  ------------------
  340|  34.7k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 27.0k, False: 7.64k]
  ------------------
  341|  34.7k|        }
  342|  2.16M|        str++;
  343|  2.16M|    }
  344|   286k|    return(NULL);
  345|   313k|}
xmlStrlen:
  405|  1.56M|xmlStrlen(const xmlChar *str) {
  406|  1.56M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 1.56M, False: 2.19k]
  ------------------
  407|  1.56M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 1.56M]
  ------------------
  408|  1.56M|}
xmlStrncat:
  423|   164k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   164k|    int size;
  425|   164k|    xmlChar *ret;
  426|       |
  427|   164k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 164k]
  |  Branch (427:26): [True: 272, False: 163k]
  ------------------
  428|    272|        return(cur);
  429|       |
  430|   163k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 163k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   163k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 163k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   163k|    size = xmlStrlen(cur);
  440|   163k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 163k]
  |  Branch (440:23): [True: 0, False: 163k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   163k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   163k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 12, False: 163k]
  ------------------
  446|     12|        xmlFree(cur);
  447|     12|        return(NULL);
  448|     12|    }
  449|   163k|    memcpy(&ret[size], add, len);
  450|   163k|    ret[size + len] = 0;
  451|   163k|    return(ret);
  452|   163k|}
xmlStrncatNew:
  465|     40|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     40|    int size;
  467|     40|    xmlChar *ret;
  468|       |
  469|     40|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 40]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     40|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 40, False: 0]
  ------------------
  475|     40|        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|   164k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   164k|    const xmlChar *p = add;
  504|       |
  505|   164k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 2, False: 164k]
  ------------------
  506|   164k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 3, False: 164k]
  ------------------
  507|      3|        return(xmlStrdup(add));
  508|       |
  509|  2.14M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 1.97M, False: 164k]
  ------------------
  510|   164k|    return(xmlStrncat(cur, add, p - add));
  511|   164k|}
xmlStrVASPrintf:
  573|  1.35M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.35M|    char empty[1];
  575|  1.35M|    va_list copy;
  576|  1.35M|    xmlChar *buf;
  577|  1.35M|    int res, size;
  578|  1.35M|    int truncated = 0;
  579|       |
  580|  1.35M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.35M]
  ------------------
  581|      0|        return(1);
  582|  1.35M|    *out = NULL;
  583|  1.35M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.35M]
  ------------------
  584|      0|        return(1);
  585|  1.35M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.35M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.35M|    va_copy(copy, ap);
  589|  1.35M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.35M|    va_end(copy);
  591|       |
  592|  1.35M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.35M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.35M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.35M, False: 297]
  ------------------
  596|  1.35M|            size = res + 1;
  597|  1.35M|        } else {
  598|    297|            size = maxSize;
  599|    297|            truncated = 1;
  600|    297|        }
  601|  1.35M|        buf = xmlMalloc(size);
  602|  1.35M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.57k, False: 1.35M]
  ------------------
  603|  1.57k|            return(-1);
  604|  1.35M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.35M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.35M|    } 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.35M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 297, False: 1.35M]
  ------------------
  659|    297|        int i = size - 1;
  660|       |
  661|    514|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 514, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    514|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 142, False: 372]
  ------------------
  664|    142|                break;
  665|    372|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    372|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 155, False: 217]
  ------------------
  668|    155|                break;
  669|    372|        }
  670|       |
  671|    297|        buf[i] = 0;
  672|    297|    }
  673|       |
  674|  1.35M|    *out = (xmlChar *) buf;
  675|  1.35M|    return(truncated);
  676|  1.35M|}
xmlUTF8Strlen:
  770|  18.7k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  18.7k|    size_t ret = 0;
  772|       |
  773|  18.7k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 15, False: 18.7k]
  ------------------
  774|     15|        return(-1);
  775|       |
  776|  1.09M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.07M, False: 18.7k]
  ------------------
  777|  1.07M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 10.4k, False: 1.06M]
  ------------------
  778|  10.4k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 10.4k]
  ------------------
  779|      0|                return(-1);
  780|  10.4k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 4.40k, False: 6.07k]
  ------------------
  781|  4.40k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 4.40k]
  ------------------
  782|      0|                    return(-1);
  783|  4.40k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 2.66k, False: 1.73k]
  ------------------
  784|  2.66k|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 2.66k]
  |  Branch (784:52): [True: 0, False: 2.66k]
  ------------------
  785|      0|                        return(-1);
  786|  2.66k|                    utf += 4;
  787|  2.66k|                } else {
  788|  1.73k|                    utf += 3;
  789|  1.73k|                }
  790|  6.07k|            } else {
  791|  6.07k|                utf += 2;
  792|  6.07k|            }
  793|  1.06M|        } else {
  794|  1.06M|            utf++;
  795|  1.06M|        }
  796|  1.07M|        ret++;
  797|  1.07M|    }
  798|  18.7k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 18.7k]
  ------------------
  799|  18.7k|}
xmlGetUTF8Char:
  812|  21.9M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  21.9M|    unsigned int c;
  814|       |
  815|  21.9M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 21.9M]
  ------------------
  816|      0|        goto error;
  817|  21.9M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 21.9M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  21.9M|    c = utf[0];
  821|  21.9M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 18.1M, False: 3.83M]
  ------------------
  822|  18.1M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 18.1M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  18.1M|        *len = 1;
  826|  18.1M|    } else {
  827|  3.83M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 275, False: 3.83M]
  |  Branch (827:27): [True: 91.5k, False: 3.74M]
  ------------------
  828|  91.8k|            goto error;
  829|  3.74M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 144k, False: 3.59M]
  ------------------
  830|   144k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 65.5k, False: 79.3k]
  ------------------
  831|  65.5k|                goto error;
  832|       |            /* 2-byte code */
  833|  79.3k|            *len = 2;
  834|  79.3k|            c = (c & 0x1f) << 6;
  835|  79.3k|            c |= utf[1] & 0x3f;
  836|  3.59M|        } else {
  837|  3.59M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 71, False: 3.59M]
  |  Branch (837:31): [True: 281, False: 3.59M]
  ------------------
  838|    352|                goto error;
  839|  3.59M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 3.59M, False: 3.16k]
  ------------------
  840|       |                /* 3-byte code */
  841|  3.59M|                *len = 3;
  842|  3.59M|                c = (c & 0xf) << 12;
  843|  3.59M|                c |= (utf[1] & 0x3f) << 6;
  844|  3.59M|                c |= utf[2] & 0x3f;
  845|  3.59M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 1.11k, False: 3.59M]
  |  Branch (845:37): [True: 1.75M, False: 1.83M]
  |  Branch (845:54): [True: 251, False: 1.75M]
  ------------------
  846|  1.36k|                    goto error;
  847|  3.59M|            } else {
  848|  3.16k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 74, False: 3.08k]
  |  Branch (848:35): [True: 278, False: 2.80k]
  ------------------
  849|    352|                    goto error;
  850|  2.80k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  2.80k|                c = (c & 0x7) << 18;
  853|  2.80k|                c |= (utf[1] & 0x3f) << 12;
  854|  2.80k|                c |= (utf[2] & 0x3f) << 6;
  855|  2.80k|                c |= utf[3] & 0x3f;
  856|  2.80k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 235, False: 2.57k]
  |  Branch (856:38): [True: 235, False: 2.33k]
  ------------------
  857|    470|                    goto error;
  858|  2.80k|            }
  859|  3.59M|        }
  860|  3.74M|    }
  861|  21.8M|    return(c);
  862|       |
  863|   159k|error:
  864|   159k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 159k, False: 0]
  ------------------
  865|   159k|	*len = 0;
  866|   159k|    return(-1);
  867|  21.9M|}
xmlUTF8Strsize:
  933|   187k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   187k|    const xmlChar *ptr=utf;
  935|   187k|    int ch;
  936|   187k|    size_t ret;
  937|       |
  938|   187k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 187k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   187k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 187k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   407k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 223k, False: 183k]
  ------------------
  945|   223k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 3.40k, False: 220k]
  ------------------
  946|  3.40k|            break;
  947|   220k|        ch = *ptr++;
  948|   220k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 445, False: 219k]
  ------------------
  949|  1.20k|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 759, False: 445]
  ------------------
  950|    759|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 759]
  ------------------
  951|    759|                ptr++;
  952|    759|	    }
  953|   220k|    }
  954|   187k|    ret = ptr - utf;
  955|   187k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 187k]
  ------------------
  956|   187k|}
xmlUTF8Strndup:
  967|  7.95k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|  7.95k|    xmlChar *ret;
  969|  7.95k|    int i;
  970|       |
  971|  7.95k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 7.95k]
  |  Branch (971:26): [True: 0, False: 7.95k]
  ------------------
  972|  7.95k|    i = xmlUTF8Strsize(utf, len);
  973|  7.95k|    ret = xmlMalloc((size_t) i + 1);
  974|  7.95k|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 1, False: 7.95k]
  ------------------
  975|      1|        return(NULL);
  976|      1|    }
  977|  7.95k|    memcpy(ret, utf, i);
  978|  7.95k|    ret[i] = 0;
  979|  7.95k|    return(ret);
  980|  7.95k|}
xmlUTF8Strpos:
  991|  19.7k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  19.7k|    int ch;
  993|       |
  994|  19.7k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 19.7k]
  ------------------
  995|  19.7k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 19.7k]
  ------------------
  996|      0|        return(NULL);
  997|  3.09M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 3.07M, False: 19.7k]
  ------------------
  998|  3.07M|        ch = *utf++;
  999|  3.07M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 3.07M]
  ------------------
 1000|      0|            return(NULL);
 1001|  3.07M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 25.3k, False: 3.04M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  25.3k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 25.3k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|  81.1k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 55.7k, False: 25.3k]
  ------------------
 1007|  55.7k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 55.7k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  25.3k|        }
 1010|  3.07M|    }
 1011|  19.7k|    return((xmlChar *)utf);
 1012|  19.7k|}
xmlUTF8Strloc:
 1023|   109k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|   109k|    size_t i;
 1025|   109k|    int size;
 1026|   109k|    int ch;
 1027|       |
 1028|   109k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 109k]
  |  Branch (1028:22): [True: 0, False: 109k]
  ------------------
 1029|   109k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  13.5M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 13.5M, False: 50.2k]
  ------------------
 1031|  13.5M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 58.7k, False: 13.4M]
  ------------------
 1032|  58.7k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 58.7k]
  ------------------
 1033|  13.4M|            utf++;
 1034|  13.4M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 119k, False: 13.3M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|   119k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 119k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|   340k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 220k, False: 119k]
  ------------------
 1040|   220k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 220k]
  ------------------
 1041|      0|                        return(-1);
 1042|   119k|            }
 1043|  13.4M|        }
 1044|       |
 1045|  50.2k|    return(-1);
 1046|   109k|}
xmlUTF8Strsub:
 1060|  7.95k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|  7.95k|    int i;
 1062|  7.95k|    int ch;
 1063|       |
 1064|  7.95k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 7.95k]
  ------------------
 1065|  7.95k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 7.95k]
  ------------------
 1066|  7.95k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 7.95k]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  12.6k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 4.65k, False: 7.95k]
  ------------------
 1072|  4.65k|        ch = *utf++;
 1073|  4.65k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 4.65k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  4.65k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 4.65k]
  ------------------
 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|  4.65k|    }
 1085|       |
 1086|  7.95k|    return(xmlUTF8Strndup(utf, len));
 1087|  7.95k|}

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|   575k|xmlXPathIsNaN(double val) {
  251|   575k|#ifdef isnan
  252|   575k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   575k|}
xmlXPathIsInf:
  265|   430k|xmlXPathIsInf(double val) {
  266|   430k|#ifdef isinf
  267|   430k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 22.0k, False: 408k]
  |  Branch (267:26): [True: 14.4k, False: 7.56k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   430k|}
xmlXPathErrMemory:
  677|  3.50k|{
  678|  3.50k|    if (ctxt == NULL)
  ------------------
  |  Branch (678:9): [True: 0, False: 3.50k]
  ------------------
  679|      0|        return;
  680|  3.50k|    xmlRaiseMemoryError(ctxt->error, NULL, ctxt->userData, XML_FROM_XPATH,
  681|  3.50k|                        &ctxt->lastError);
  682|  3.50k|}
xmlXPathPErrMemory:
  691|  3.31k|{
  692|  3.31k|    if (ctxt == NULL)
  ------------------
  |  Branch (692:9): [True: 0, False: 3.31k]
  ------------------
  693|      0|        return;
  694|  3.31k|    ctxt->error = XPATH_MEMORY_ERROR;
  695|  3.31k|    xmlXPathErrMemory(ctxt->context);
  696|  3.31k|}
xmlXPathErr:
  777|  7.54k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  7.54k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  7.54k|}
xmlXPathFreeCompExpr:
  971|  11.5k|{
  972|  11.5k|    xmlXPathStepOpPtr op;
  973|  11.5k|    int i;
  974|       |
  975|  11.5k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 11.5k]
  ------------------
  976|      0|        return;
  977|  11.5k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 11.5k, False: 0]
  ------------------
  978|  1.03M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 1.02M, False: 11.5k]
  ------------------
  979|  1.02M|	    op = &comp->steps[i];
  980|  1.02M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 87.9k, False: 937k]
  ------------------
  981|  87.9k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 75.1k, False: 12.8k]
  ------------------
  982|  75.1k|		    xmlXPathFreeObject(op->value4);
  983|  12.8k|		else
  984|  12.8k|		    xmlFree(op->value4);
  985|  87.9k|	    }
  986|  1.02M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 75.8k, False: 949k]
  ------------------
  987|  75.8k|		xmlFree(op->value5);
  988|  1.02M|	}
  989|  11.5k|    } 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|  11.5k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 11.5k, False: 0]
  ------------------
 1000|  11.5k|        xmlFree(comp->steps);
 1001|  11.5k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  11.5k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 11.5k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  11.5k|    xmlFree(comp);
 1012|  11.5k|}
xmlXPathValuePop:
 1979|  4.28M|{
 1980|  4.28M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  4.28M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 4.28M]
  |  Branch (1982:27): [True: 16.3k, False: 4.26M]
  ------------------
 1983|  16.3k|        return (NULL);
 1984|       |
 1985|  4.26M|    ctxt->valueNr--;
 1986|  4.26M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.45M, False: 815k]
  ------------------
 1987|  3.45M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   815k|    else
 1989|   815k|        ctxt->value = NULL;
 1990|  4.26M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  4.26M|    return (ret);
 1993|  4.28M|}
xmlXPathValuePush:
 2007|  4.27M|{
 2008|  4.27M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 4.27M]
  ------------------
 2009|  4.27M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 1.02k, False: 4.27M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|  1.02k|        xmlXPathPErrMemory(ctxt);
 2014|  1.02k|        return(-1);
 2015|  1.02k|    }
 2016|  4.27M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 261, False: 4.27M]
  ------------------
 2017|    261|        xmlXPathObjectPtr *tmp;
 2018|    261|        int newSize;
 2019|       |
 2020|    261|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    261|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    261|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    261|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 261]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    261|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    261|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 2, False: 259]
  ------------------
 2029|      2|            xmlXPathPErrMemory(ctxt);
 2030|      2|            xmlXPathFreeObject(value);
 2031|      2|            return (-1);
 2032|      2|        }
 2033|    259|	ctxt->valueTab = tmp;
 2034|    259|        ctxt->valueMax = newSize;
 2035|    259|    }
 2036|  4.27M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  4.27M|    ctxt->value = value;
 2038|  4.27M|    return (ctxt->valueNr++);
 2039|  4.27M|}
xmlXPathNodeSetSort:
 2552|  30.3k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  30.3k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 30.3k]
  ------------------
 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|  30.3k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  30.3k|#endif /* WITH_TIM_SORT */
 2591|  30.3k|}
xmlXPathNodeSetFreeNs:
 2647|   129k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|   129k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 129k]
  |  Branch (2648:25): [True: 0, False: 129k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|   129k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 129k, False: 0]
  |  Branch (2651:31): [True: 129k, False: 0]
  ------------------
 2652|   129k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 82.3k, False: 47.2k]
  ------------------
 2653|  82.3k|	    xmlFree((xmlChar *)ns->href);
 2654|   129k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 98.9k, False: 30.6k]
  ------------------
 2655|  98.9k|	    xmlFree((xmlChar *)ns->prefix);
 2656|   129k|	xmlFree(ns);
 2657|   129k|    }
 2658|   129k|}
xmlXPathNodeSetCreate:
 2667|  2.36M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.36M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.36M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.36M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 324, False: 2.36M]
  ------------------
 2672|    324|	return(NULL);
 2673|  2.36M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.36M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.25M, False: 1.11M]
  ------------------
 2675|  1.25M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.25M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.25M|					     sizeof(xmlNodePtr));
 2677|  1.25M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 145, False: 1.24M]
  ------------------
 2678|    145|	    xmlFree(ret);
 2679|    145|	    return(NULL);
 2680|    145|	}
 2681|  1.24M|	memset(ret->nodeTab, 0 ,
 2682|  1.24M|	       XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
  ------------------
  |  | 2593|  1.24M|#define XML_NODESET_DEFAULT	10
  ------------------
 2683|  1.24M|        ret->nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  1.24M|#define XML_NODESET_DEFAULT	10
  ------------------
 2684|  1.24M|	if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2684:6): [True: 13.4k, False: 1.23M]
  ------------------
 2685|  13.4k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  13.4k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  13.4k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 4, False: 13.4k]
  ------------------
 2689|      4|                xmlXPathFreeNodeSet(ret);
 2690|      4|                return(NULL);
 2691|      4|            }
 2692|  13.4k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  13.4k|	} else
 2694|  1.23M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.24M|    }
 2696|  2.36M|    return(ret);
 2697|  2.36M|}
xmlXPathNodeSetAddNs:
 2761|  79.6k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|  79.6k|    int i;
 2763|  79.6k|    xmlNodePtr nsNode;
 2764|       |
 2765|  79.6k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 79.6k]
  |  Branch (2765:26): [True: 0, False: 79.6k]
  |  Branch (2765:42): [True: 0, False: 79.6k]
  ------------------
 2766|  79.6k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 79.6k]
  ------------------
 2767|  79.6k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 79.6k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   149k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 70.2k, False: 79.6k]
  ------------------
 2775|  70.2k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 70.2k, False: 0]
  ------------------
 2776|  70.2k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 70.2k, False: 0]
  ------------------
 2777|  70.2k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 70.2k, False: 0]
  ------------------
 2778|  70.2k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 70.2k]
  ------------------
 2779|      0|	    return(0);
 2780|  70.2k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|  79.6k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 7.14k, False: 72.5k]
  ------------------
 2786|  7.14k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 4, False: 7.14k]
  ------------------
 2787|      4|            return(-1);
 2788|  7.14k|    }
 2789|  79.6k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|  79.6k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 28, False: 79.6k]
  ------------------
 2791|     28|        return(-1);
 2792|  79.6k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|  79.6k|    return(0);
 2794|  79.6k|}
xmlXPathNodeSetAdd:
 2804|  2.29k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  2.29k|    int i;
 2806|       |
 2807|  2.29k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 2.29k]
  |  Branch (2807:26): [True: 0, False: 2.29k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  2.29k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 1.42k, False: 876]
  ------------------
 2814|  1.42k|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 1.42k, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    876|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 876, False: 0]
  ------------------
 2820|    876|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 1, False: 875]
  ------------------
 2821|      1|            return(-1);
 2822|    876|    }
 2823|       |
 2824|    875|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 875]
  ------------------
 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|    875|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    875|    return(0);
 2834|    875|}
xmlXPathNodeSetAddUnique:
 2845|  5.53M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  5.53M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 5.53M]
  |  Branch (2846:26): [True: 0, False: 5.53M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  5.53M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.28M, False: 4.24M]
  ------------------
 2853|  1.28M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 174, False: 1.28M]
  ------------------
 2854|    174|            return(-1);
 2855|  1.28M|    }
 2856|       |
 2857|  5.53M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 5.73k, False: 5.52M]
  ------------------
 2858|  5.73k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  5.73k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  5.73k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 6, False: 5.72k]
  ------------------
 2862|      6|            return(-1);
 2863|  5.72k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  5.72k|    } else
 2865|  5.52M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  5.53M|    return(0);
 2867|  5.53M|}
xmlXPathNodeSetMerge:
 2880|  58.0k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  58.0k|    int i, j, initNr, skip;
 2882|  58.0k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  58.0k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 4, False: 58.0k]
  ------------------
 2885|      4|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      4|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 4]
  ------------------
 2887|      0|            return (NULL);
 2888|      4|    }
 2889|  58.0k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 34, False: 57.9k]
  ------------------
 2890|     34|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  57.9k|    initNr = val1->nodeNr;
 2894|       |
 2895|   899k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 841k, False: 57.9k]
  ------------------
 2896|   841k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   841k|	skip = 0;
 2901|  27.2M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 26.5M, False: 737k]
  ------------------
 2902|  26.5M|	    n1 = val1->nodeTab[j];
 2903|  26.5M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 103k, False: 26.4M]
  ------------------
 2904|   103k|		skip = 1;
 2905|   103k|		break;
 2906|  26.4M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 260, False: 26.4M]
  ------------------
 2907|    260|		       (n2->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2907:10): [True: 0, False: 260]
  ------------------
 2908|      0|		if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2908:7): [True: 0, False: 0]
  ------------------
 2909|      0|		    (xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2909:7): [True: 0, False: 0]
  ------------------
 2910|      0|			((xmlNsPtr) n2)->prefix)))
 2911|      0|		{
 2912|      0|		    skip = 1;
 2913|      0|		    break;
 2914|      0|		}
 2915|      0|	    }
 2916|  26.5M|	}
 2917|   841k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 103k, False: 737k]
  ------------------
 2918|   103k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   737k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 61.8k, False: 676k]
  ------------------
 2924|  61.8k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 24, False: 61.8k]
  ------------------
 2925|     24|                goto error;
 2926|  61.8k|        }
 2927|   737k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 30.7k, False: 707k]
  ------------------
 2928|  30.7k|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|  30.7k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|  30.7k|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 25, False: 30.6k]
  ------------------
 2932|     25|                goto error;
 2933|  30.6k|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|  30.6k|	} else
 2935|   707k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   737k|    }
 2937|       |
 2938|  57.9k|    return(val1);
 2939|       |
 2940|     49|error:
 2941|     49|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  57.9k|}
xmlXPathFreeNodeSet:
 3101|  2.36M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.36M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 34, False: 2.36M]
  ------------------
 3103|  2.36M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.63M, False: 724k]
  ------------------
 3104|  1.63M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  8.56M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 6.92M, False: 1.63M]
  ------------------
 3108|  6.92M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 6.92M, False: 0]
  ------------------
 3109|  6.92M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 126k, False: 6.80M]
  ------------------
 3110|   126k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.63M|	xmlFree(obj->nodeTab);
 3112|  1.63M|    }
 3113|  2.36M|    xmlFree(obj);
 3114|  2.36M|}
xmlXPathNewNodeSet:
 3191|  1.25M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.25M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.25M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.25M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 149, False: 1.25M]
  ------------------
 3196|    149|	return(NULL);
 3197|  1.25M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.25M|    ret->type = XPATH_NODESET;
 3199|  1.25M|    ret->boolval = 0;
 3200|  1.25M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.25M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 324, False: 1.25M]
  ------------------
 3202|    324|        xmlFree(ret);
 3203|    324|        return(NULL);
 3204|    324|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.25M|    return(ret);
 3207|  1.25M|}
xmlXPathWrapNodeSet:
 3267|  1.09M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.09M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.09M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.09M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 172, False: 1.09M]
  ------------------
 3272|    172|        xmlXPathFreeNodeSet(val);
 3273|    172|	return(NULL);
 3274|    172|    }
 3275|  1.09M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.09M|    ret->type = XPATH_NODESET;
 3277|  1.09M|    ret->nodesetval = val;
 3278|  1.09M|    return(ret);
 3279|  1.09M|}
xmlXPathFunctionLookup:
 3743|  5.95k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  5.95k|}
xmlXPathFunctionLookupNS:
 3758|  5.95k|			 const xmlChar *ns_uri) {
 3759|  5.95k|    xmlXPathFunction ret;
 3760|  5.95k|    void *payload;
 3761|       |
 3762|  5.95k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 5.95k]
  ------------------
 3763|      0|	return(NULL);
 3764|  5.95k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.95k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  5.95k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 5.95k, False: 8]
  ------------------
 3768|  5.95k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  5.95k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  8.46k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 7.92k, False: 534]
  ------------------
 3771|  7.92k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  7.92k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 5.41k, False: 2.51k]
  ------------------
 3774|  7.92k|                       (char *) name) == 0)
 3775|  5.41k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.51k|            bucketIndex += 1;
 3778|  2.51k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.51k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.51k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.51k|        }
 3781|  5.95k|    }
 3782|       |
 3783|    542|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 542]
  ------------------
 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|    542|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 542, False: 0]
  ------------------
 3793|    542|	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|    542|}
xmlXPathRegisteredFuncsCleanup:
 3807|  7.15k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  7.15k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 7.15k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  7.15k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  7.15k|}
xmlXPathVariableLookup:
 3891|     44|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     44|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 44]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     44|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 44]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     44|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     44|}
xmlXPathVariableLookupNS:
 3916|     55|			 const xmlChar *ns_uri) {
 3917|     55|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 55]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     55|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 55]
  ------------------
 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|     55|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 55, False: 0]
  ------------------
 3929|     55|	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.15k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  7.15k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 7.15k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  7.15k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  7.15k|}
xmlXPathRegisterNs:
 3961|    416|			   const xmlChar *ns_uri) {
 3962|    416|    xmlChar *copy;
 3963|       |
 3964|    416|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 416]
  ------------------
 3965|      0|	return(-1);
 3966|    416|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 416]
  ------------------
 3967|      0|	return(-1);
 3968|    416|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 416]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    416|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 37, False: 379]
  ------------------
 3972|     37|	ctxt->nsHash = xmlHashCreate(10);
 3973|    416|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 3, False: 413]
  ------------------
 3974|      3|        xmlXPathErrMemory(ctxt);
 3975|      3|	return(-1);
 3976|      3|    }
 3977|    413|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 413]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    413|    copy = xmlStrdup(ns_uri);
 3982|    413|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 1, False: 412]
  ------------------
 3983|      1|        xmlXPathErrMemory(ctxt);
 3984|      1|        return(-1);
 3985|      1|    }
 3986|    412|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 1, False: 411]
  ------------------
 3987|    412|                           xmlHashDefaultDeallocator) < 0) {
 3988|      1|        xmlXPathErrMemory(ctxt);
 3989|      1|        xmlFree(copy);
 3990|      1|        return(-1);
 3991|      1|    }
 3992|       |
 3993|    411|    return(0);
 3994|    412|}
xmlXPathNsLookup:
 4005|  8.08k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  8.08k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 8.08k]
  ------------------
 4007|      0|	return(NULL);
 4008|  8.08k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 8.08k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  8.08k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 7.83k, False: 253]
  ------------------
 4012|  7.83k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  7.83k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    253|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 253]
  ------------------
 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|    253|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    253|}
xmlXPathRegisteredNsCleanup:
 4033|  7.15k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  7.15k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 7.15k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  7.15k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  7.15k|}
xmlXPathNewFloat:
 4056|   487k|xmlXPathNewFloat(double val) {
 4057|   487k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   487k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   487k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 143, False: 487k]
  ------------------
 4061|    143|	return(NULL);
 4062|   487k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   487k|    ret->type = XPATH_NUMBER;
 4064|   487k|    ret->floatval = val;
 4065|   487k|    return(ret);
 4066|   487k|}
xmlXPathNewBoolean:
 4075|   611k|xmlXPathNewBoolean(int val) {
 4076|   611k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   611k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   611k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 97, False: 611k]
  ------------------
 4080|     97|	return(NULL);
 4081|   611k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   611k|    ret->type = XPATH_BOOLEAN;
 4083|   611k|    ret->boolval = (val != 0);
 4084|   611k|    return(ret);
 4085|   611k|}
xmlXPathNewString:
 4094|   145k|xmlXPathNewString(const xmlChar *val) {
 4095|   145k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   145k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   145k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 20, False: 145k]
  ------------------
 4099|     20|	return(NULL);
 4100|   145k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   145k|    ret->type = XPATH_STRING;
 4102|   145k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 1, False: 145k]
  ------------------
 4103|      1|        val = BAD_CAST "";
  ------------------
  |  |   34|      1|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   145k|    ret->stringval = xmlStrdup(val);
 4105|   145k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 21, False: 145k]
  ------------------
 4106|     21|        xmlFree(ret);
 4107|     21|        return(NULL);
 4108|     21|    }
 4109|   145k|    return(ret);
 4110|   145k|}
xmlXPathWrapString:
 4121|  57.7k|xmlXPathWrapString (xmlChar *val) {
 4122|  57.7k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  57.7k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  57.7k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 47, False: 57.7k]
  ------------------
 4126|     47|        xmlFree(val);
 4127|     47|	return(NULL);
 4128|     47|    }
 4129|  57.7k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  57.7k|    ret->type = XPATH_STRING;
 4131|  57.7k|    ret->stringval = val;
 4132|  57.7k|    return(ret);
 4133|  57.7k|}
xmlXPathObjectCopy:
 4183|   409k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   409k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   409k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 409k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   409k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   409k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 87, False: 409k]
  ------------------
 4191|     87|	return(NULL);
 4192|   409k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   409k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 409k]
  ------------------
 4195|   387k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 387k, False: 22.0k]
  ------------------
 4196|   387k|	    break;
 4197|  22.0k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 22.0k, False: 387k]
  ------------------
 4198|  22.0k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  22.0k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 14, False: 22.0k]
  ------------------
 4200|     14|                xmlFree(ret);
 4201|     14|                return(NULL);
 4202|     14|            }
 4203|  22.0k|	    break;
 4204|  22.0k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 409k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 409k]
  ------------------
 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: 409k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 409k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   409k|    }
 4222|   409k|    return(ret);
 4223|   409k|}
xmlXPathFreeObject:
 4231|  4.05M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  4.05M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 4.05M]
  ------------------
 4233|  4.05M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.34M, False: 1.71M]
  |  Branch (4233:41): [True: 0, False: 1.71M]
  ------------------
 4234|  2.34M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.34M, False: 61]
  ------------------
 4235|  2.34M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.34M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 225k, False: 1.48M]
  ------------------
 4237|   225k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 225k, False: 30]
  ------------------
 4238|   225k|	    xmlFree(obj->stringval);
 4239|   225k|    }
 4240|  4.05M|    xmlFree(obj);
 4241|  4.05M|}
xmlXPathCastBooleanToString:
 4354|  5.58k|xmlXPathCastBooleanToString (int val) {
 4355|  5.58k|    xmlChar *ret;
 4356|  5.58k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 1.63k, False: 3.95k]
  ------------------
 4357|  1.63k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  3.95k|    else
 4359|  3.95k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  5.58k|    return(ret);
 4361|  5.58k|}
xmlXPathCastNumberToString:
 4370|  22.6k|xmlXPathCastNumberToString (double val) {
 4371|  22.6k|    xmlChar *ret;
 4372|  22.6k|    switch (xmlXPathIsInf(val)) {
 4373|    230|    case 1:
  ------------------
  |  Branch (4373:5): [True: 230, False: 22.3k]
  ------------------
 4374|    230|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    230|	break;
 4376|    436|    case -1:
  ------------------
  |  Branch (4376:5): [True: 436, False: 22.1k]
  ------------------
 4377|    436|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    436|	break;
 4379|  21.9k|    default:
  ------------------
  |  Branch (4379:5): [True: 21.9k, False: 666]
  ------------------
 4380|  21.9k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 2.89k, False: 19.0k]
  ------------------
 4381|  2.89k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  19.0k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 700, False: 18.3k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    700|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  18.3k|	} else {
 4386|       |	    /* could be improved */
 4387|  18.3k|	    char buf[100];
 4388|  18.3k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  18.3k|	    buf[99] = 0;
 4390|  18.3k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  18.3k|	}
 4392|  22.6k|    }
 4393|  22.6k|    return(ret);
 4394|  22.6k|}
xmlXPathCastNodeToString:
 4403|   389k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   389k|    return(xmlNodeGetContent(node));
 4405|   389k|}
xmlXPathCastNodeSetToString:
 4414|   494k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   494k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 494k]
  |  Branch (4415:25): [True: 325k, False: 168k]
  |  Branch (4415:46): [True: 0, False: 168k]
  ------------------
 4416|   325k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   168k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 22.7k, False: 146k]
  ------------------
 4419|  22.7k|	xmlXPathNodeSetSort(ns);
 4420|   168k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   494k|}
xmlXPathCastToString:
 4431|  51.0k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  51.0k|    xmlChar *ret = NULL;
 4433|       |
 4434|  51.0k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 51.0k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  51.0k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 51.0k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 51.0k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  22.3k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 22.3k, False: 28.7k]
  ------------------
 4441|  22.3k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 51.0k]
  ------------------
 4442|  22.3k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  22.3k|	    break;
 4444|    501|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 501, False: 50.5k]
  ------------------
 4445|    501|	    return(xmlStrdup(val->stringval));
 4446|  5.58k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 5.58k, False: 45.4k]
  ------------------
 4447|  5.58k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  5.58k|	    break;
 4449|  22.6k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 22.6k, False: 28.4k]
  ------------------
 4450|  22.6k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  22.6k|	    break;
 4452|  22.3k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 51.0k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  51.0k|    }
 4458|  50.5k|    return(ret);
 4459|  51.0k|}
xmlXPathCastBooleanToNumber:
 4507|  36.6k|xmlXPathCastBooleanToNumber(int val) {
 4508|  36.6k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 3.76k, False: 32.9k]
  ------------------
 4509|  3.76k|	return(1.0);
 4510|  32.9k|    return(0.0);
 4511|  36.6k|}
xmlXPathCastStringToNumber:
 4520|   712k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   712k|    return(xmlXPathStringEvalNumber(val));
 4522|   712k|}
xmlXPathCastNumberToBoolean:
 4617|  67.9k|xmlXPathCastNumberToBoolean (double val) {
 4618|  67.9k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 52.2k, False: 15.6k]
  |  Branch (4618:32): [True: 4.57k, False: 11.1k]
  ------------------
 4619|  56.8k|	 return(0);
 4620|  11.1k|     return(1);
 4621|  67.9k|}
xmlXPathCastStringToBoolean:
 4630|     62|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|     62|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 62]
  |  Branch (4631:26): [True: 18, False: 44]
  ------------------
 4632|     18|	return(0);
 4633|     44|    return(1);
 4634|     62|}
xmlXPathCastNodeSetToBoolean:
 4643|  10.9k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  10.9k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 10.9k]
  |  Branch (4644:25): [True: 9.36k, False: 1.57k]
  ------------------
 4645|  9.36k|	return(0);
 4646|  1.57k|    return(1);
 4647|  10.9k|}
xmlXPathCastToBoolean:
 4656|  14.0k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  14.0k|    int ret = 0;
 4658|       |
 4659|  14.0k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 14.0k]
  ------------------
 4660|      0|	return(0);
 4661|  14.0k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 14.0k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 14.0k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  10.9k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 10.9k, False: 3.14k]
  ------------------
 4666|  10.9k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 14.0k]
  ------------------
 4667|  10.9k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  10.9k|	break;
 4669|     62|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 62, False: 14.0k]
  ------------------
 4670|     62|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|     62|	break;
 4672|  3.08k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 3.08k, False: 11.0k]
  ------------------
 4673|  3.08k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  3.08k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 14.0k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 14.0k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  14.0k|    }
 4683|  14.0k|    return(ret);
 4684|  14.0k|}
xmlXPathNewContext:
 4720|  7.18k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  7.18k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  7.18k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  7.18k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 28, False: 7.15k]
  ------------------
 4725|     28|	return(NULL);
 4726|  7.15k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  7.15k|    ret->doc = doc;
 4728|  7.15k|    ret->node = NULL;
 4729|       |
 4730|  7.15k|    ret->varHash = NULL;
 4731|       |
 4732|  7.15k|    ret->nb_types = 0;
 4733|  7.15k|    ret->max_types = 0;
 4734|  7.15k|    ret->types = NULL;
 4735|       |
 4736|  7.15k|    ret->nb_axis = 0;
 4737|  7.15k|    ret->max_axis = 0;
 4738|  7.15k|    ret->axis = NULL;
 4739|       |
 4740|  7.15k|    ret->nsHash = NULL;
 4741|  7.15k|    ret->user = NULL;
 4742|       |
 4743|  7.15k|    ret->contextSize = -1;
 4744|  7.15k|    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.15k|    return(ret);
 4754|  7.18k|}
xmlXPathFreeContext:
 4762|  7.15k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  7.15k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 7.15k]
  ------------------
 4764|       |
 4765|  7.15k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 7.15k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  7.15k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  7.15k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  7.15k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  7.15k|    xmlResetError(&ctxt->lastError);
 4771|  7.15k|    xmlFree(ctxt);
 4772|  7.15k|}
xmlXPathSetErrorHandler:
 4785|  7.15k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  7.15k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 7.15k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  7.15k|    ctxt->error = handler;
 4790|  7.15k|    ctxt->userData = data;
 4791|  7.15k|}
xmlXPathNewParserContext:
 4807|  11.6k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  11.6k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  11.6k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  11.6k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 34, False: 11.6k]
  ------------------
 4812|     34|        xmlXPathErrMemory(ctxt);
 4813|     34|	return(NULL);
 4814|     34|    }
 4815|  11.6k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  11.6k|    ret->cur = ret->base = str;
 4817|  11.6k|    ret->context = ctxt;
 4818|       |
 4819|  11.6k|    ret->comp = xmlXPathNewCompExpr();
 4820|  11.6k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 62, False: 11.5k]
  ------------------
 4821|     62|        xmlXPathErrMemory(ctxt);
 4822|     62|	xmlFree(ret->valueTab);
 4823|     62|	xmlFree(ret);
 4824|     62|	return(NULL);
 4825|     62|    }
 4826|  11.5k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 11.5k, False: 0]
  |  Branch (4826:27): [True: 0, False: 11.5k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  11.5k|    return(ret);
 4832|  11.6k|}
xmlXPathFreeParserContext:
 4879|  11.5k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  11.5k|    int i;
 4881|       |
 4882|  11.5k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 11.5k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  11.5k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 11.5k, False: 30]
  ------------------
 4886|  20.0k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 8.49k, False: 11.5k]
  ------------------
 4887|  8.49k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 8.49k, False: 0]
  ------------------
 4888|  8.49k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  8.49k|        }
 4892|  11.5k|        xmlFree(ctxt->valueTab);
 4893|  11.5k|    }
 4894|  11.5k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 11.5k, 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|  11.5k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  11.5k|    }
 4903|  11.5k|    xmlFree(ctxt);
 4904|  11.5k|}
xmlXPathEqualValues:
 5702|   396k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   396k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   396k|    int ret = 0;
 5705|       |
 5706|   396k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 396k]
  |  Branch (5706:27): [True: 0, False: 396k]
  ------------------
 5707|   396k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   396k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   396k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 396k]
  |  Branch (5709:27): [True: 0, False: 396k]
  ------------------
 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|   396k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 396k]
  ------------------
 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|   396k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 136k, False: 259k]
  |  Branch (5725:42): [True: 0, False: 259k]
  ------------------
 5726|   259k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 23.9k, False: 235k]
  |  Branch (5726:40): [True: 0, False: 235k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   160k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 104k, False: 56.3k]
  |  Branch (5730:39): [True: 104k, False: 0]
  ------------------
 5731|   104k|		argtmp = arg2;
 5732|   104k|		arg2 = arg1;
 5733|   104k|		arg1 = argtmp;
 5734|   104k|	}
 5735|   160k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 160k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 160k]
  ------------------
 5737|      0|		break;
 5738|  32.4k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 32.4k, False: 128k]
  ------------------
 5739|  32.4k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 160k]
  ------------------
 5740|  32.4k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  32.4k|		break;
 5742|  95.1k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 95.1k, False: 65.5k]
  ------------------
 5743|  95.1k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 95.1k]
  ------------------
 5744|  95.1k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 51.9k, False: 43.2k]
  ------------------
 5745|  43.2k|		else
 5746|  43.2k|		    ret = 1;
 5747|  95.1k|		ret = (ret == arg2->boolval);
 5748|  95.1k|		break;
 5749|  26.7k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 26.7k, False: 133k]
  ------------------
 5750|  26.7k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  26.7k|		break;
 5752|  6.33k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 6.33k, False: 154k]
  ------------------
 5753|  6.33k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  6.33k|                                                 arg2->stringval, 0);
 5755|  6.33k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 160k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   160k|	}
 5760|   160k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   160k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   160k|	return(ret);
 5763|   160k|    }
 5764|       |
 5765|   235k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   396k|}
xmlXPathNotEqualValues:
 5775|  6.82k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  6.82k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  6.82k|    int ret = 0;
 5778|       |
 5779|  6.82k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 6.82k]
  |  Branch (5779:27): [True: 0, False: 6.82k]
  ------------------
 5780|  6.82k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  6.82k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  6.82k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 6.82k]
  |  Branch (5782:27): [True: 0, False: 6.82k]
  ------------------
 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|  6.82k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 6.82k]
  ------------------
 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|  6.82k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 4.06k, False: 2.75k]
  |  Branch (5798:42): [True: 0, False: 2.75k]
  ------------------
 5799|  4.87k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 809, False: 1.94k]
  |  Branch (5799:40): [True: 0, False: 1.94k]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  4.87k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 2.72k, False: 2.15k]
  |  Branch (5803:39): [True: 2.72k, False: 0]
  ------------------
 5804|  2.72k|		argtmp = arg2;
 5805|  2.72k|		arg2 = arg1;
 5806|  2.72k|		arg1 = argtmp;
 5807|  2.72k|	}
 5808|  4.87k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 4.87k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 4.87k]
  ------------------
 5810|      0|		break;
 5811|  1.34k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 1.34k, False: 3.53k]
  ------------------
 5812|  1.34k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 4.87k]
  ------------------
 5813|  1.34k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|  1.34k|		break;
 5815|  1.97k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.97k, False: 2.89k]
  ------------------
 5816|  1.97k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.97k]
  ------------------
 5817|  1.97k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 1.14k, False: 831]
  ------------------
 5818|    831|		else
 5819|    831|		    ret = 1;
 5820|  1.97k|		ret = (ret != arg2->boolval);
 5821|  1.97k|		break;
 5822|    977|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 977, False: 3.89k]
  ------------------
 5823|    977|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|    977|		break;
 5825|    577|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 577, False: 4.29k]
  ------------------
 5826|    577|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    577|                                                 arg2->stringval, 1);
 5828|    577|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 4.87k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  4.87k|	}
 5833|  4.87k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  4.87k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  4.87k|	return(ret);
 5836|  4.87k|    }
 5837|       |
 5838|  1.94k|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  6.82k|}
xmlXPathCompareValues:
 5864|   281k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   281k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   281k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   281k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 281k]
  |  Branch (5868:27): [True: 0, False: 281k]
  ------------------
 5869|   281k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   281k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   281k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 8, False: 281k]
  |  Branch (5871:27): [True: 0, False: 281k]
  ------------------
 5872|      8|	if (arg1 != NULL)
  ------------------
  |  Branch (5872:6): [True: 0, False: 8]
  ------------------
 5873|      0|	    xmlXPathReleaseObject(ctxt->context, arg1);
 5874|      8|	else
 5875|      8|	    xmlXPathReleaseObject(ctxt->context, arg2);
 5876|      8|	XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      8|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
 5877|      0|    }
 5878|       |
 5879|   281k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 135k, False: 146k]
  |  Branch (5879:42): [True: 0, False: 146k]
  ------------------
 5880|   161k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 25.7k, False: 120k]
  |  Branch (5880:40): [True: 0, False: 120k]
  ------------------
 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|   161k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 135k, False: 25.7k]
  |  Branch (5886:40): [True: 0, False: 25.7k]
  ------------------
 5887|   135k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 85.1k, False: 50.3k]
  |  Branch (5887:38): [True: 0, False: 50.3k]
  ------------------
 5888|  85.1k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  85.1k|	} else {
 5890|  76.1k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 25.7k, False: 50.3k]
  |  Branch (5890:43): [True: 0, False: 50.3k]
  ------------------
 5891|  25.7k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  25.7k|			                          arg1, arg2);
 5893|  50.3k|	    } else {
 5894|  50.3k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  50.3k|			                          arg2, arg1);
 5896|  50.3k|	    }
 5897|  76.1k|	}
 5898|   161k|	return(ret);
 5899|   161k|    }
 5900|       |
 5901|   120k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 15.6k, False: 104k]
  ------------------
 5902|  15.6k|	xmlXPathValuePush(ctxt, arg1);
 5903|  15.6k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  15.6k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  15.6k|    }
 5906|   120k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 11.8k, False: 108k]
  ------------------
 5907|  11.8k|	xmlXPathValuePush(ctxt, arg2);
 5908|  11.8k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  11.8k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  11.8k|    }
 5911|   120k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 261, False: 120k]
  ------------------
 5912|    261|        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|   120k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 85.8k, False: 34.4k]
  |  Branch (5918:42): [True: 3.40k, False: 31.0k]
  ------------------
 5919|  89.2k|	ret=0;
 5920|  89.2k|    } else {
 5921|  31.0k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  31.0k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  31.0k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 18.2k, False: 12.8k]
  |  Branch (5923:13): [True: 15.4k, False: 2.81k]
  ------------------
 5924|  15.4k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 697, False: 14.7k]
  |  Branch (5924:26): [True: 315, False: 382]
  ------------------
 5925|  15.1k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 590, False: 14.5k]
  |  Branch (5925:18): [True: 353, False: 237]
  ------------------
 5926|    668|		ret = 1;
 5927|  14.7k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 13.9k, False: 845]
  |  Branch (5927:31): [True: 13.3k, False: 550]
  ------------------
 5928|  13.3k|		ret = (arg1->floatval < arg2->floatval);
 5929|  13.3k|	    } else {
 5930|  1.39k|		ret = 0;
 5931|  1.39k|	    }
 5932|  15.4k|	}
 5933|  15.6k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 2.81k, False: 12.8k]
  |  Branch (5933:18): [True: 2.81k, False: 0]
  ------------------
 5934|  2.81k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 1.01k, False: 1.79k]
  |  Branch (5934:25): [True: 385, False: 1.41k]
  ------------------
 5935|  1.39k|		ret = 1;
 5936|  1.41k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 1.10k, False: 310]
  |  Branch (5936:31): [True: 791, False: 313]
  ------------------
 5937|    791|		ret = (arg1->floatval <= arg2->floatval);
 5938|    791|	    } else {
 5939|    623|		ret = 0;
 5940|    623|	    }
 5941|  2.81k|	}
 5942|  12.8k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 12.8k, False: 0]
  |  Branch (5942:19): [True: 5.47k, False: 7.33k]
  ------------------
 5943|  5.47k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 1.19k, False: 4.28k]
  |  Branch (5943:25): [True: 645, False: 549]
  ------------------
 5944|  4.83k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 596, False: 4.23k]
  |  Branch (5944:19): [True: 508, False: 88]
  ------------------
 5945|  1.15k|		ret = 1;
 5946|  4.32k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 3.29k, False: 1.03k]
  |  Branch (5946:31): [True: 2.94k, False: 346]
  ------------------
 5947|  2.94k|		ret = (arg1->floatval > arg2->floatval);
 5948|  2.94k|	    } else {
 5949|  1.37k|		ret = 0;
 5950|  1.37k|	    }
 5951|  5.47k|	}
 5952|  7.33k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 7.33k, False: 0]
  |  Branch (5952:19): [True: 7.33k, False: 0]
  ------------------
 5953|  7.33k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 4.30k, False: 3.03k]
  |  Branch (5953:24): [True: 293, False: 2.73k]
  ------------------
 5954|  4.59k|		ret = 1;
 5955|  4.59k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 2.47k, False: 259]
  |  Branch (5955:31): [True: 2.21k, False: 267]
  ------------------
 5956|  2.21k|		ret = (arg1->floatval >= arg2->floatval);
 5957|  2.21k|	    } else {
 5958|    526|		ret = 0;
 5959|    526|	    }
 5960|  7.33k|	}
 5961|  31.0k|    }
 5962|   120k|error:
 5963|   120k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|   120k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|   120k|    return(ret);
 5966|   120k|}
xmlXPathValueFlipSign:
 5976|   114k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|   114k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 114k]
  |  Branch (5977:27): [True: 0, False: 114k]
  ------------------
 5978|   114k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   114k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 114k, False: 0]
  |  |  |  Branch (297:34): [True: 65.0k, False: 49.7k]
  |  |  ------------------
  |  |  298|   114k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|   114k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   114k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 114k]
  |  |  |  Branch (261:34): [True: 6, False: 114k]
  |  |  ------------------
  |  |  262|   114k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|   114k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|   114k|}
xmlXPathAddValues:
 5991|  71.9k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  71.9k|    xmlXPathObjectPtr arg;
 5993|  71.9k|    double val;
 5994|       |
 5995|  71.9k|    arg = xmlXPathValuePop(ctxt);
 5996|  71.9k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 71.9k]
  ------------------
 5997|  71.9k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  71.9k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  71.9k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  71.9k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  71.9k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 71.9k, False: 0]
  |  |  |  Branch (297:34): [True: 58.3k, False: 13.5k]
  |  |  ------------------
  |  |  298|  71.9k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  71.9k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  71.9k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 7, False: 71.9k]
  |  |  |  Branch (261:34): [True: 4, False: 71.9k]
  |  |  ------------------
  |  |  262|  71.9k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     11|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  71.9k|    ctxt->value->floatval += val;
 6003|  71.9k|}
xmlXPathSubValues:
 6013|  69.2k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  69.2k|    xmlXPathObjectPtr arg;
 6015|  69.2k|    double val;
 6016|       |
 6017|  69.2k|    arg = xmlXPathValuePop(ctxt);
 6018|  69.2k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 69.2k]
  ------------------
 6019|  69.2k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  69.2k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  69.2k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  69.2k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  69.2k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 69.2k, False: 0]
  |  |  |  Branch (297:34): [True: 22.4k, False: 46.7k]
  |  |  ------------------
  |  |  298|  69.2k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  69.2k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  69.2k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 69.1k]
  |  |  |  Branch (261:34): [True: 5, False: 69.1k]
  |  |  ------------------
  |  |  262|  69.2k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      9|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  69.1k|    ctxt->value->floatval -= val;
 6025|  69.1k|}
xmlXPathMultValues:
 6035|   169k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   169k|    xmlXPathObjectPtr arg;
 6037|   169k|    double val;
 6038|       |
 6039|   169k|    arg = xmlXPathValuePop(ctxt);
 6040|   169k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 169k]
  ------------------
 6041|   169k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   169k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   169k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   169k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   169k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 169k, False: 0]
  |  |  |  Branch (297:34): [True: 86.1k, False: 83.0k]
  |  |  ------------------
  |  |  298|   169k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   169k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   169k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 169k]
  |  |  |  Branch (261:34): [True: 5, False: 169k]
  |  |  ------------------
  |  |  262|   169k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   169k|    ctxt->value->floatval *= val;
 6047|   169k|}
xmlXPathDivValues:
 6058|  1.50k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  1.50k|    xmlXPathObjectPtr arg;
 6060|  1.50k|    double val;
 6061|       |
 6062|  1.50k|    arg = xmlXPathValuePop(ctxt);
 6063|  1.50k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 1.50k]
  ------------------
 6064|  1.50k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  1.50k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  1.50k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  1.50k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.50k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.50k, False: 0]
  |  |  |  Branch (297:34): [True: 669, False: 838]
  |  |  ------------------
  |  |  298|  1.50k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  1.50k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.50k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.50k]
  |  |  |  Branch (261:34): [True: 1, False: 1.50k]
  |  |  ------------------
  |  |  262|  1.50k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  1.50k|    ctxt->value->floatval /= val;
 6070|  1.50k|}
xmlXPathModValues:
 6080|  1.56k|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|  1.56k|    xmlXPathObjectPtr arg;
 6082|  1.56k|    double arg1, arg2;
 6083|       |
 6084|  1.56k|    arg = xmlXPathValuePop(ctxt);
 6085|  1.56k|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 1.56k]
  ------------------
 6086|  1.56k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|  1.56k|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|  1.56k|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|  1.56k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.56k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.56k, False: 0]
  |  |  |  Branch (297:34): [True: 763, False: 805]
  |  |  ------------------
  |  |  298|  1.56k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|  1.56k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.56k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.56k]
  |  |  |  Branch (261:34): [True: 1, False: 1.56k]
  |  |  ------------------
  |  |  262|  1.56k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|  1.56k|    arg1 = ctxt->value->floatval;
 6092|  1.56k|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 434, False: 1.13k]
  ------------------
 6093|    434|	ctxt->value->floatval = xmlXPathNAN;
 6094|  1.13k|    else {
 6095|  1.13k|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|  1.13k|    }
 6097|  1.56k|}
xmlXPathNextSelf:
 6138|    874|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    874|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 874]
  |  Branch (6139:27): [True: 0, False: 874]
  ------------------
 6140|    874|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 437, False: 437]
  ------------------
 6141|    437|        return(ctxt->context->node);
 6142|    437|    return(NULL);
 6143|    874|}
xmlXPathNextChild:
 6154|   220k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   220k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 220k]
  |  Branch (6155:27): [True: 0, False: 220k]
  ------------------
 6156|   220k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 93.3k, False: 127k]
  ------------------
 6157|  93.3k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 93.3k]
  ------------------
 6158|  93.3k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 93.3k, False: 0]
  ------------------
 6159|  22.9k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 22.9k, False: 70.3k]
  ------------------
 6160|  67.0k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 44.0k, False: 49.2k]
  ------------------
 6161|  79.3k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 12.3k, False: 81.0k]
  ------------------
 6162|  79.3k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 93.3k]
  ------------------
 6163|  79.3k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 93.3k]
  ------------------
 6164|  80.6k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 1.28k, False: 92.0k]
  ------------------
 6165|  92.8k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 12.1k, False: 81.1k]
  ------------------
 6166|  92.8k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 93.3k]
  ------------------
 6167|  92.8k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 93.3k]
  ------------------
 6168|  92.8k|		return(ctxt->context->node->children);
 6169|    415|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 415, False: 92.9k]
  ------------------
 6170|    415|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 93.3k]
  ------------------
 6171|    415|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 93.3k]
  ------------------
 6172|    415|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 93.3k]
  ------------------
 6173|    415|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 93.3k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 93.3k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 93.3k]
  ------------------
 6177|    107|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 107, False: 93.2k]
  ------------------
 6178|    107|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 93.3k]
  ------------------
 6179|    107|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 93.3k]
  ------------------
 6180|    107|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 93.3k]
  ------------------
 6181|    107|		return(NULL);
 6182|  93.3k|	}
 6183|      0|	return(NULL);
 6184|  93.3k|    }
 6185|   127k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 127k]
  ------------------
 6186|   127k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 127k]
  ------------------
 6187|      0|	return(NULL);
 6188|   127k|    return(cur->next);
 6189|   127k|}
xmlXPathNextDescendant:
 6271|  5.13M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  5.13M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 5.13M]
  |  Branch (6272:27): [True: 0, False: 5.13M]
  ------------------
 6273|  5.13M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 107k, False: 5.03M]
  ------------------
 6274|   107k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 107k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   107k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 303, False: 107k]
  ------------------
 6277|   107k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 9.84k, False: 97.5k]
  ------------------
 6278|  10.1k|	    return(NULL);
 6279|       |
 6280|  97.5k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 49.1k, False: 48.4k]
  ------------------
 6281|  49.1k|	    return(ctxt->context->doc->children);
 6282|  48.4k|        return(ctxt->context->node->children);
 6283|  97.5k|    }
 6284|       |
 6285|  5.03M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 5.03M]
  ------------------
 6286|      0|        return(NULL);
 6287|  5.03M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.30M, False: 3.72M]
  ------------------
 6288|       |	/*
 6289|       |	 * Do not descend on entities declarations
 6290|       |	 */
 6291|  1.30M|	if (cur->children->type != XML_ENTITY_DECL) {
  ------------------
  |  Branch (6291:6): [True: 1.30M, False: 2.19k]
  ------------------
 6292|  1.30M|	    cur = cur->children;
 6293|       |	    /*
 6294|       |	     * Skip DTDs
 6295|       |	     */
 6296|  1.30M|	    if (cur->type != XML_DTD_NODE)
  ------------------
  |  Branch (6296:10): [True: 1.30M, False: 1.21k]
  ------------------
 6297|  1.30M|		return(cur);
 6298|  1.30M|	}
 6299|  1.30M|    }
 6300|       |
 6301|  3.72M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 18.4k, False: 3.70M]
  ------------------
 6302|       |
 6303|  3.71M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 3.16M, False: 546k]
  ------------------
 6304|  3.16M|	cur = cur->next;
 6305|  3.16M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 3.16M, False: 648]
  ------------------
 6306|  3.16M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 3.16M, False: 2.44k]
  ------------------
 6307|  3.16M|	    return(cur);
 6308|  3.16M|    }
 6309|       |
 6310|  1.33M|    do {
 6311|  1.33M|        cur = cur->parent;
 6312|  1.33M|	if (cur == NULL) break;
  ------------------
  |  Branch (6312:6): [True: 0, False: 1.33M]
  ------------------
 6313|  1.33M|	if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6313:6): [True: 146k, False: 1.18M]
  ------------------
 6314|  1.18M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 399k, False: 788k]
  ------------------
 6315|   399k|	    cur = cur->next;
 6316|   399k|	    return(cur);
 6317|   399k|	}
 6318|  1.18M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 788k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   546k|}
xmlXPathNextDescendantOrSelf:
 6334|  3.99M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  3.99M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 3.99M]
  |  Branch (6335:27): [True: 0, False: 3.99M]
  ------------------
 6336|  3.99M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 146k, False: 3.84M]
  ------------------
 6337|   146k|        return(ctxt->context->node);
 6338|       |
 6339|  3.84M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 3.84M]
  ------------------
 6340|      0|        return(NULL);
 6341|  3.84M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 580, False: 3.84M]
  ------------------
 6342|  3.84M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 5.72k, False: 3.84M]
  ------------------
 6343|  6.30k|        return(NULL);
 6344|       |
 6345|  3.84M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  3.84M|}
xmlXPathNextParent:
 6357|   232k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   232k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 232k]
  |  Branch (6358:27): [True: 0, False: 232k]
  ------------------
 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|   232k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 120k, False: 111k]
  ------------------
 6365|   120k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 120k]
  ------------------
 6366|   120k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 120k, False: 0]
  ------------------
 6367|  81.6k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 81.6k, False: 38.5k]
  ------------------
 6368|   109k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 27.9k, False: 92.2k]
  ------------------
 6369|   110k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 445, False: 119k]
  ------------------
 6370|   110k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 120k]
  ------------------
 6371|   110k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 120k]
  ------------------
 6372|   110k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 545, False: 119k]
  ------------------
 6373|   111k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 1.04k, False: 119k]
  ------------------
 6374|   111k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 120k]
  ------------------
 6375|   111k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 120k]
  ------------------
 6376|   111k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 120k]
  ------------------
 6377|   111k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 120k]
  ------------------
 6378|   111k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 120k]
  ------------------
 6379|   111k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 120k]
  ------------------
 6380|   111k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 120k]
  ------------------
 6381|   111k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 111k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|   111k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 106k, False: 5.63k]
  ------------------
 6384|   106k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 106k]
  ------------------
 6385|   106k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 106k]
  ------------------
 6386|   106k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|   106k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|   111k|		return(ctxt->context->node->parent);
 6389|    713|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 713, False: 119k]
  ------------------
 6390|    713|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|    713|		return(att->parent);
 6393|   111k|	    }
 6394|  7.56k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 7.56k, False: 112k]
  ------------------
 6395|  7.56k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 120k]
  ------------------
 6396|  7.56k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 120k]
  ------------------
 6397|  7.56k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 120k]
  ------------------
 6398|  7.56k|                return(NULL);
 6399|    266|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 266, False: 119k]
  ------------------
 6400|    266|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|    266|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 266, False: 0]
  ------------------
 6403|    266|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 266, False: 0]
  ------------------
 6404|    266|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|    266|	    }
 6407|   120k|	}
 6408|   120k|    }
 6409|   111k|    return(NULL);
 6410|   232k|}
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: 30.4k, False: 133k]
  ------------------
 6433|  30.4k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 30.4k]
  ------------------
 6434|  30.4k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 30.4k, False: 0]
  ------------------
 6435|  27.5k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 27.5k, False: 2.84k]
  ------------------
 6436|  29.1k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.58k, False: 28.8k]
  ------------------
 6437|  29.2k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 103, False: 30.3k]
  ------------------
 6438|  29.2k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 30.4k]
  ------------------
 6439|  29.2k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 30.4k]
  ------------------
 6440|  29.7k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 439, False: 29.9k]
  ------------------
 6441|  29.9k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 258, False: 30.1k]
  ------------------
 6442|  29.9k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 30.4k]
  ------------------
 6443|  29.9k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 30.4k]
  ------------------
 6444|  29.9k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 30.4k]
  ------------------
 6445|  29.9k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 30.4k]
  ------------------
 6446|  29.9k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 30.4k]
  ------------------
 6447|  29.9k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 30.4k]
  ------------------
 6448|  29.9k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 30.4k]
  ------------------
 6449|  29.9k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 29.9k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  29.9k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 29.0k, False: 877]
  ------------------
 6452|  29.0k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 29.0k]
  ------------------
 6453|  29.0k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 29.0k]
  ------------------
 6454|  29.0k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  29.0k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  29.9k|		return(ctxt->context->node->parent);
 6457|     10|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 10, False: 30.4k]
  ------------------
 6458|     10|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     10|		return(tmp->parent);
 6461|  29.9k|	    }
 6462|    446|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 446, False: 29.9k]
  ------------------
 6463|    446|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 30.4k]
  ------------------
 6464|    446|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 30.4k]
  ------------------
 6465|    446|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 30.4k]
  ------------------
 6466|    446|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 30.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|  30.4k|	}
 6477|      0|	return(NULL);
 6478|  30.4k|    }
 6479|   133k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 4.10k, False: 129k]
  ------------------
 6480|  4.10k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   129k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 34.3k, False: 94.8k]
  ------------------
 6482|  34.3k|	return(NULL);
 6483|  94.8k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 94.8k, False: 0]
  ------------------
 6484|  92.7k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 92.7k, False: 2.11k]
  ------------------
 6485|  94.2k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 1.49k, False: 93.4k]
  ------------------
 6486|  94.4k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 204, False: 94.6k]
  ------------------
 6487|  94.4k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 94.8k]
  ------------------
 6488|  94.4k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 94.8k]
  ------------------
 6489|  94.8k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 341, False: 94.5k]
  ------------------
 6490|  94.8k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 48, False: 94.8k]
  ------------------
 6491|  94.8k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 94.8k]
  ------------------
 6492|  94.8k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 94.8k]
  ------------------
 6493|  94.8k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 94.8k]
  ------------------
 6494|  94.8k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 94.8k]
  ------------------
 6495|  94.8k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 94.8k]
  ------------------
 6496|  94.8k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 94.8k]
  ------------------
 6497|  94.8k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 94.8k]
  ------------------
 6498|  94.8k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 94.8k]
  ------------------
 6499|      0|		return(NULL);
 6500|  94.8k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 65.8k, False: 29.0k]
  ------------------
 6501|  65.8k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 65.8k]
  ------------------
 6502|  65.8k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 65.8k]
  ------------------
 6503|  65.8k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  65.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|  94.8k|	    return(cur->parent);
 6506|     34|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 34, False: 94.8k]
  ------------------
 6507|     34|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|     34|	    return(att->parent);
 6510|  94.8k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 94.8k]
  ------------------
 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: 94.8k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 94.8k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 94.8k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 94.8k]
  ------------------
 6524|      0|	    return(NULL);
 6525|  94.8k|    }
 6526|      0|    return(NULL);
 6527|  94.8k|}
xmlXPathNextAncestorOrSelf:
 6541|  30.7k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  30.7k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 30.7k]
  |  Branch (6542:27): [True: 0, False: 30.7k]
  ------------------
 6543|  30.7k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 4.33k, False: 26.4k]
  ------------------
 6544|  4.33k|        return(ctxt->context->node);
 6545|  26.4k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  30.7k|}
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|  6.27k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  6.27k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 6.27k]
  |  Branch (6623:27): [True: 0, False: 6.27k]
  ------------------
 6624|  6.27k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 5.51k, False: 760]
  |  Branch (6624:26): [True: 5.51k, False: 0]
  ------------------
 6625|  5.51k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 5.51k, False: 0]
  |  Branch (6625:46): [True: 216, False: 5.30k]
  ------------------
 6626|    216|        return(cur->children);
 6627|       |
 6628|  6.06k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 760, False: 5.30k]
  ------------------
 6629|    760|        cur = ctxt->context->node;
 6630|    760|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 77, False: 683]
  ------------------
 6631|     77|            cur = cur->parent;
 6632|    683|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 683]
  ------------------
 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|    760|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  6.06k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 6.06k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  6.06k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 153, False: 5.91k]
  ------------------
 6647|    153|        return(NULL);
 6648|       |
 6649|  5.91k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 5.08k, False: 823]
  ------------------
 6650|  5.08k|        return(cur->next);
 6651|       |
 6652|  1.37k|    do {
 6653|  1.37k|        cur = cur->parent;
 6654|  1.37k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 1.37k]
  ------------------
 6655|      0|            break;
 6656|  1.37k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 607, False: 768]
  ------------------
 6657|    607|            return(NULL);
 6658|    768|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 216, False: 552]
  |  Branch (6658:34): [True: 216, False: 0]
  ------------------
 6659|    216|            return(cur->next);
 6660|    768|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 552, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|    823|}
xmlXPathNextNamespace:
 6814|   120k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|   120k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 120k]
  |  Branch (6815:27): [True: 0, False: 120k]
  ------------------
 6816|   120k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 7.47k, False: 113k]
  ------------------
 6817|   113k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 31.8k, False: 81.6k]
  ------------------
 6818|  31.8k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 512, False: 31.2k]
  ------------------
 6819|    512|	    xmlFree(ctxt->context->tmpNsList);
 6820|  31.8k|	ctxt->context->tmpNsNr = 0;
 6821|  31.8k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 5, False: 31.8k]
  ------------------
 6822|  31.8k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      5|            xmlXPathPErrMemory(ctxt);
 6824|      5|            return(NULL);
 6825|      5|        }
 6826|  31.8k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 30.4k, False: 1.37k]
  ------------------
 6827|  81.5k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 51.1k, False: 30.4k]
  ------------------
 6828|  51.1k|                ctxt->context->tmpNsNr++;
 6829|  51.1k|            }
 6830|  30.4k|        }
 6831|  31.8k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  31.8k|    }
 6833|  81.6k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 50.6k, False: 31.0k]
  ------------------
 6834|  50.6k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  50.6k|    } else {
 6836|  31.0k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 29.7k, False: 1.25k]
  ------------------
 6837|  29.7k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  31.0k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  31.0k|    }
 6841|  81.6k|}
xmlXPathNextAttribute:
 6852|   313k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   313k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 313k]
  |  Branch (6853:27): [True: 0, False: 313k]
  ------------------
 6854|   313k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 313k]
  ------------------
 6855|      0|	return(NULL);
 6856|   313k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 61.9k, False: 251k]
  ------------------
 6857|  61.9k|	return(NULL);
 6858|   251k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 237k, False: 14.4k]
  ------------------
 6859|   237k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 237k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   237k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   237k|    }
 6863|  14.4k|    return((xmlNodePtr)cur->next);
 6864|   251k|}
xmlXPathRoot:
 6887|   394k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   394k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 394k]
  |  Branch (6888:27): [True: 0, False: 394k]
  ------------------
 6889|      0|	return;
 6890|   394k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   394k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   394k|}
xmlXPathLastFunction:
 6911|    617|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  1.84k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    617|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 617]
  |  |  ------------------
  |  |  281|    617|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 616]
  |  |  ------------------
  |  |  282|    617|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    616|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 616]
  |  |  ------------------
  |  |  284|    616|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  1.84k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 616, False: 0]
  ------------------
 6914|    616|	xmlXPathValuePush(ctxt,
 6915|    616|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    616|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  1.84k|}
xmlXPathPositionFunction:
 6932|  6.07k|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  18.2k|    CHECK_ARITY(0);
  ------------------
  |  |  280|  6.07k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6.07k]
  |  |  ------------------
  |  |  281|  6.07k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 6.07k]
  |  |  ------------------
  |  |  282|  6.07k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  6.07k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 6.07k]
  |  |  ------------------
  |  |  284|  6.07k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  18.2k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 6.07k, False: 0]
  ------------------
 6935|  6.07k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|  6.07k|            (double) ctxt->context->proximityPosition));
 6937|  6.07k|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  18.2k|}
xmlXPathCountFunction:
 6950|     55|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     55|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    157|    CHECK_ARITY(1);
  ------------------
  |  |  280|     55|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 55]
  |  |  ------------------
  |  |  281|     55|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 51]
  |  |  ------------------
  |  |  282|     55|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     51|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 51]
  |  |  ------------------
  |  |  284|     51|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    157|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 51]
  ------------------
 6955|     51|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 48]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     48|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     48|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     48|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 48]
  |  Branch (6960:26): [True: 0, False: 48]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     48|    else
 6963|     48|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     48|	    (double) cur->nodesetval->nodeNr));
 6965|     48|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     48|}
xmlXPathIdFunction:
 7047|  5.15k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  5.15k|    xmlChar *tokens;
 7049|  5.15k|    xmlNodeSetPtr ret;
 7050|  5.15k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  15.4k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.15k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.15k]
  |  |  ------------------
  |  |  281|  5.15k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 5.14k]
  |  |  ------------------
  |  |  282|  5.15k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.14k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 8, False: 5.14k]
  |  |  ------------------
  |  |  284|  5.14k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  15.4k|    obj = xmlXPathValuePop(ctxt);
 7054|  15.4k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 5.14k]
  ------------------
 7055|  5.14k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 1.91k, False: 3.23k]
  |  Branch (7055:41): [True: 0, False: 3.23k]
  ------------------
 7056|  1.91k|	xmlNodeSetPtr ns;
 7057|  1.91k|	int i;
 7058|       |
 7059|  1.91k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  1.91k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 4, False: 1.90k]
  ------------------
 7061|      4|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  1.91k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 1.91k, False: 0]
  ------------------
 7064|  5.67k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.76k, False: 1.91k]
  ------------------
 7065|  3.76k|		tokens =
 7066|  3.76k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.76k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 14, False: 3.75k]
  ------------------
 7068|     14|                    xmlXPathPErrMemory(ctxt);
 7069|  3.76k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.76k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 34, False: 3.73k]
  ------------------
 7071|     34|                    xmlXPathPErrMemory(ctxt);
 7072|  3.76k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.76k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.76k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.76k|		xmlXPathFreeNodeSet(ns);
 7076|  3.76k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.75k, False: 14]
  ------------------
 7077|  3.75k|		    xmlFree(tokens);
 7078|  3.76k|	    }
 7079|  1.91k|	}
 7080|  1.91k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  1.91k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  1.91k|	return;
 7083|  1.91k|    }
 7084|  3.23k|    tokens = xmlXPathCastToString(obj);
 7085|  3.23k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 4, False: 3.22k]
  ------------------
 7086|      4|        xmlXPathPErrMemory(ctxt);
 7087|  3.23k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  3.23k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  3.23k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 11, False: 3.22k]
  ------------------
 7090|     11|        xmlXPathPErrMemory(ctxt);
 7091|  3.23k|    xmlFree(tokens);
 7092|  3.23k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  3.23k|}
xmlXPathLocalNameFunction:
 7108|  1.48k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  1.48k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  1.48k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 1.48k]
  ------------------
 7112|       |
 7113|  1.48k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 1.48k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  4.44k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  1.48k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 1.48k]
  |  |  ------------------
  |  |  281|  1.48k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 1.48k]
  |  |  ------------------
  |  |  282|  1.48k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  1.48k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 1, False: 1.48k]
  |  |  ------------------
  |  |  284|  1.48k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  4.44k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 1.48k]
  ------------------
 7120|  1.48k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 1.47k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  1.47k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  1.47k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  1.47k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 1.47k]
  |  Branch (7125:38): [True: 1, False: 1.47k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  1.47k|    } else {
 7128|  1.47k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  1.47k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 1.47k]
  ------------------
 7131|      2|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 1, False: 1.47k]
  ------------------
 7132|      2|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 1.47k]
  ------------------
 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: 1.47k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  1.47k|	default:
  ------------------
  |  Branch (7143:2): [True: 1.47k, False: 2]
  ------------------
 7144|  1.47k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  1.47k|	}
 7146|  1.47k|    }
 7147|  1.47k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  1.47k|}
xmlXPathStringFunction:
 7312|  47.9k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  47.9k|    xmlXPathObjectPtr cur;
 7314|  47.9k|    xmlChar *stringval;
 7315|       |
 7316|  47.9k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 47.9k]
  ------------------
 7317|  47.9k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 99, False: 47.8k]
  ------------------
 7318|     99|        stringval = xmlXPathCastNodeToString(ctxt->context->node);
 7319|     99|        if (stringval == NULL)
  ------------------
  |  Branch (7319:13): [True: 1, False: 98]
  ------------------
 7320|      1|            xmlXPathPErrMemory(ctxt);
 7321|     99|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, stringval));
 7322|     99|	return;
 7323|     99|    }
 7324|       |
 7325|   191k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  47.8k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 47.8k]
  |  |  ------------------
  |  |  281|  47.8k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 47.8k]
  |  |  ------------------
  |  |  282|  47.8k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  47.8k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 47.8k]
  |  |  ------------------
  |  |  284|  47.8k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   191k|    cur = xmlXPathValuePop(ctxt);
 7327|   191k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 47.8k]
  ------------------
 7328|  47.8k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 47.7k, False: 13]
  ------------------
 7329|  47.7k|        stringval = xmlXPathCastToString(cur);
 7330|  47.7k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 29, False: 47.7k]
  ------------------
 7331|     29|            xmlXPathPErrMemory(ctxt);
 7332|  47.7k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  47.7k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  47.7k|    }
 7335|  47.8k|    xmlXPathValuePush(ctxt, cur);
 7336|  47.8k|}
xmlXPathStringLengthFunction:
 7350|    149|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    149|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    149|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 10, False: 139]
  ------------------
 7354|     10|        if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (7354:13): [True: 0, False: 10]
  |  Branch (7354:31): [True: 0, False: 10]
  ------------------
 7355|      0|	    return;
 7356|     10|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7356:6): [True: 0, False: 10]
  ------------------
 7357|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0));
 7358|     10|	} else {
 7359|     10|	    xmlChar *content;
 7360|       |
 7361|     10|	    content = xmlXPathCastNodeToString(ctxt->context->node);
 7362|     10|            if (content == NULL)
  ------------------
  |  Branch (7362:17): [True: 1, False: 9]
  ------------------
 7363|      1|                xmlXPathPErrMemory(ctxt);
 7364|     10|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7365|     10|		xmlUTF8Strlen(content)));
 7366|     10|	    xmlFree(content);
 7367|     10|	}
 7368|     10|	return;
 7369|     10|    }
 7370|    550|    CHECK_ARITY(1);
  ------------------
  |  |  280|    139|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 139]
  |  |  ------------------
  |  |  281|    139|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 136]
  |  |  ------------------
  |  |  282|    139|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    136|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 136]
  |  |  ------------------
  |  |  284|    136|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    550|    CAST_TO_STRING;
  ------------------
  |  |  290|    136|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 136, False: 0]
  |  |  |  Branch (290:34): [True: 126, False: 10]
  |  |  ------------------
  |  |  291|    136|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    550|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    136|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 135]
  |  |  |  Branch (261:34): [True: 1, False: 134]
  |  |  ------------------
  |  |  262|    136|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    134|    cur = xmlXPathValuePop(ctxt);
 7374|    134|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    134|	xmlUTF8Strlen(cur->stringval)));
 7376|    134|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    134|}
xmlXPathConcatFunction:
 7388|    549|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    549|    xmlXPathObjectPtr cur, newobj;
 7390|    549|    xmlChar *tmp;
 7391|       |
 7392|    549|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 549]
  ------------------
 7393|    549|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 8, False: 541]
  ------------------
 7394|      8|	CHECK_ARITY(2);
  ------------------
  |  |  280|      8|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 8]
  |  |  ------------------
  |  |  281|      8|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 8, False: 0]
  |  |  ------------------
  |  |  282|      8|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      8|    { 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|      8|    }
 7396|       |
 7397|    541|    CAST_TO_STRING;
  ------------------
  |  |  290|    541|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 541, False: 0]
  |  |  |  Branch (290:34): [True: 460, False: 81]
  |  |  ------------------
  |  |  291|    541|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    541|    cur = xmlXPathValuePop(ctxt);
 7399|    541|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 541]
  |  Branch (7399:26): [True: 2, False: 539]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    539|    nargs--;
 7404|       |
 7405|  1.83k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.29k, False: 536]
  ------------------
 7406|  1.29k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.29k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.29k, False: 0]
  |  |  |  Branch (290:34): [True: 1.26k, False: 35]
  |  |  ------------------
  |  |  291|  1.29k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.29k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.29k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.29k]
  |  Branch (7408:26): [True: 2, False: 1.29k]
  ------------------
 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.29k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.29k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 2, False: 1.29k]
  ------------------
 7415|      2|            xmlXPathPErrMemory(ctxt);
 7416|  1.29k|	newobj->stringval = cur->stringval;
 7417|  1.29k|	cur->stringval = tmp;
 7418|  1.29k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.29k|	nargs--;
 7420|  1.29k|    }
 7421|    536|    xmlXPathValuePush(ctxt, cur);
 7422|    536|}
xmlXPathStartsWithFunction:
 7467|    236|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    236|    xmlXPathObjectPtr hay, needle;
 7469|    236|    int n;
 7470|       |
 7471|    706|    CHECK_ARITY(2);
  ------------------
  |  |  280|    236|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 236]
  |  |  ------------------
  |  |  281|    236|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 235]
  |  |  ------------------
  |  |  282|    236|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    235|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 235]
  |  |  ------------------
  |  |  284|    235|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    706|    CAST_TO_STRING;
  ------------------
  |  |  290|    235|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 235, False: 0]
  |  |  |  Branch (290:34): [True: 75, False: 160]
  |  |  ------------------
  |  |  291|    235|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    706|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    235|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 235]
  |  |  |  Branch (261:34): [True: 1, False: 234]
  |  |  ------------------
  |  |  262|    235|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    234|    needle = xmlXPathValuePop(ctxt);
 7475|    234|    CAST_TO_STRING;
  ------------------
  |  |  290|    234|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 234, False: 0]
  |  |  |  Branch (290:34): [True: 234, False: 0]
  |  |  ------------------
  |  |  291|    234|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    234|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    234|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 1, False: 233]
  |  Branch (7478:26): [True: 1, False: 232]
  ------------------
 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|    232|    n = xmlStrlen(needle->stringval);
 7484|    232|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 194, False: 38]
  ------------------
 7485|    194|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     38|    else
 7487|     38|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    232|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    232|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    232|}
xmlXPathSubstringFunction:
 7520|  11.3k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  11.3k|    xmlXPathObjectPtr str, start, len;
 7522|  11.3k|    double le=0, in;
 7523|  11.3k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  11.3k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 6, False: 11.3k]
  ------------------
 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|  11.3k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 3, False: 11.3k]
  ------------------
 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|  11.3k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 6.82k, False: 4.48k]
  ------------------
 7535|  6.82k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  6.82k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 6.82k, False: 0]
  |  |  |  Branch (297:34): [True: 844, False: 5.98k]
  |  |  ------------------
  |  |  298|  6.82k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  6.82k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  6.82k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 6.82k]
  |  |  |  Branch (261:34): [True: 1, False: 6.82k]
  |  |  ------------------
  |  |  262|  6.82k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  6.82k|	len = xmlXPathValuePop(ctxt);
 7538|  6.82k|	le = len->floatval;
 7539|  6.82k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  6.82k|    }
 7541|       |
 7542|  11.3k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  11.3k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 11.3k, False: 0]
  |  |  |  Branch (297:34): [True: 5.30k, False: 6.00k]
  |  |  ------------------
  |  |  298|  11.3k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  11.3k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  11.3k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 11.3k]
  |  |  |  Branch (261:34): [True: 1, False: 11.3k]
  |  |  ------------------
  |  |  262|  11.3k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  11.3k|    start = xmlXPathValuePop(ctxt);
 7545|  11.3k|    in = start->floatval;
 7546|  11.3k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  11.3k|    CAST_TO_STRING;
  ------------------
  |  |  290|  11.3k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 11.3k, False: 2]
  |  |  |  Branch (290:34): [True: 11.3k, False: 1]
  |  |  ------------------
  |  |  291|  11.3k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  11.3k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  11.3k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 11.3k]
  |  |  |  Branch (261:34): [True: 3, False: 11.3k]
  |  |  ------------------
  |  |  262|  11.3k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  11.3k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  11.3k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 894, False: 10.4k]
  ------------------
 7552|    894|        i = INT_MAX;
 7553|  10.4k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 5.33k, False: 5.07k]
  ------------------
 7554|  5.33k|        i = (int)in;
 7555|  5.33k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 258, False: 5.08k]
  ------------------
 7556|    258|            i += 1;
 7557|  5.33k|    }
 7558|       |
 7559|  11.3k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 6.82k, False: 4.48k]
  ------------------
 7560|  6.82k|        double rin, rle, end;
 7561|       |
 7562|  6.82k|        rin = floor(in);
 7563|  6.82k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 232, False: 6.59k]
  ------------------
 7564|    232|            rin += 1.0;
 7565|       |
 7566|  6.82k|        rle = floor(le);
 7567|  6.82k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 571, False: 6.25k]
  ------------------
 7568|    571|            rle += 1.0;
 7569|       |
 7570|  6.82k|        end = rin + rle;
 7571|  6.82k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 944, False: 5.87k]
  ------------------
 7572|    944|            j = 1;
 7573|  5.87k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 5.40k, False: 478]
  ------------------
 7574|  5.40k|            j = (int)end;
 7575|  5.40k|        }
 7576|  6.82k|    }
 7577|       |
 7578|  11.3k|    i -= 1;
 7579|  11.3k|    j -= 1;
 7580|       |
 7581|  11.3k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 9.50k, False: 1.79k]
  |  Branch (7581:20): [True: 7.95k, False: 1.55k]
  ------------------
 7582|  7.95k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  7.95k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 1, False: 7.95k]
  ------------------
 7584|      1|            xmlXPathPErrMemory(ctxt);
 7585|  7.95k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  7.95k|	xmlFree(ret);
 7587|  7.95k|    } else {
 7588|  3.35k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  3.35k|    }
 7590|       |
 7591|  11.3k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  11.3k|}
xmlXPathSubstringBeforeFunction:
 7607|    558|xmlXPathSubstringBeforeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7608|    558|    xmlXPathObjectPtr str = NULL;
 7609|    558|    xmlXPathObjectPtr find = NULL;
 7610|    558|    const xmlChar *point;
 7611|    558|    xmlChar *result;
 7612|       |
 7613|  1.67k|    CHECK_ARITY(2);
  ------------------
  |  |  280|    558|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 558]
  |  |  ------------------
  |  |  281|    558|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 557]
  |  |  ------------------
  |  |  282|    558|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    557|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 557]
  |  |  ------------------
  |  |  284|    557|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7614|  1.67k|    CAST_TO_STRING;
  ------------------
  |  |  290|    557|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 557, False: 0]
  |  |  |  Branch (290:34): [True: 557, False: 0]
  |  |  ------------------
  |  |  291|    557|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7615|  1.67k|    find = xmlXPathValuePop(ctxt);
 7616|  1.67k|    CAST_TO_STRING;
  ------------------
  |  |  290|    557|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 556, False: 1]
  |  |  |  Branch (290:34): [True: 555, False: 1]
  |  |  ------------------
  |  |  291|    557|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7617|  1.67k|    str = xmlXPathValuePop(ctxt);
 7618|  1.67k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7618:9): [True: 7, False: 550]
  ------------------
 7619|      7|        goto error;
 7620|       |
 7621|    550|    point = xmlStrstr(str->stringval, find->stringval);
 7622|    550|    if (point == NULL) {
  ------------------
  |  Branch (7622:9): [True: 221, False: 329]
  ------------------
 7623|    221|        result = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    221|#define BAD_CAST (xmlChar *)
  ------------------
 7624|    329|    } else {
 7625|    329|        result = xmlStrndup(str->stringval, point - str->stringval);
 7626|    329|    }
 7627|    550|    if (result == NULL) {
  ------------------
  |  Branch (7627:9): [True: 1, False: 549]
  ------------------
 7628|      1|        xmlXPathPErrMemory(ctxt);
 7629|      1|        goto error;
 7630|      1|    }
 7631|    549|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result));
 7632|       |
 7633|    557|error:
 7634|    557|    xmlXPathReleaseObject(ctxt->context, str);
 7635|    557|    xmlXPathReleaseObject(ctxt->context, find);
 7636|    557|}
xmlXPathTranslateFunction:
 7762|  9.16k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  9.16k|    xmlXPathObjectPtr str = NULL;
 7764|  9.16k|    xmlXPathObjectPtr from = NULL;
 7765|  9.16k|    xmlXPathObjectPtr to = NULL;
 7766|  9.16k|    xmlBufPtr target;
 7767|  9.16k|    int offset, max;
 7768|  9.16k|    int ch;
 7769|  9.16k|    const xmlChar *point;
 7770|  9.16k|    xmlChar *cptr, *content;
 7771|       |
 7772|  27.4k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  9.16k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 9.16k]
  |  |  ------------------
  |  |  281|  9.16k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 11, False: 9.15k]
  |  |  ------------------
  |  |  282|  9.16k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|     11|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  9.15k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 9.15k]
  |  |  ------------------
  |  |  284|  9.15k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  27.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  9.15k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 9.15k, False: 0]
  |  |  |  Branch (290:34): [True: 8.53k, False: 622]
  |  |  ------------------
  |  |  291|  9.15k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  27.4k|    to = xmlXPathValuePop(ctxt);
 7776|  27.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  9.15k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 9.15k, False: 0]
  |  |  |  Branch (290:34): [True: 8.57k, False: 584]
  |  |  ------------------
  |  |  291|  9.15k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  27.4k|    from = xmlXPathValuePop(ctxt);
 7778|  27.4k|    CAST_TO_STRING;
  ------------------
  |  |  290|  9.15k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 9.15k, False: 3]
  |  |  |  Branch (290:34): [True: 9.15k, False: 1]
  |  |  ------------------
  |  |  291|  9.15k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  27.4k|    str = xmlXPathValuePop(ctxt);
 7780|  27.4k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 22, False: 9.13k]
  ------------------
 7781|     22|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  9.13k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 9.13k, False: 0]
  ------------------
 7787|  9.13k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  9.13k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  9.13k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 8.50k, False: 629]
  |  Branch (7790:25): [True: 8.09k, False: 415]
  ------------------
 7791|  8.09k|            unsigned long p;
 7792|       |
 7793|  8.09k|            f1 = f1 / 10 + 1;
 7794|  8.09k|            f2 = f2 / 10 + 1;
 7795|  8.09k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 8.09k]
  ------------------
 7796|  8.09k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 6, False: 8.08k]
  ------------------
 7797|      6|                goto error;
 7798|  8.09k|        }
 7799|  9.13k|    }
 7800|       |
 7801|  9.13k|    target = xmlBufCreate(50);
 7802|  9.13k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 13, False: 9.11k]
  ------------------
 7803|     13|        xmlXPathPErrMemory(ctxt);
 7804|     13|        goto error;
 7805|     13|    }
 7806|       |
 7807|  9.11k|    max = xmlUTF8Strlen(to->stringval);
 7808|   118k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 109k, False: 9.11k]
  ------------------
 7809|   109k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|   109k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 58.7k, False: 50.2k]
  ------------------
 7811|  58.7k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 19.7k, False: 39.0k]
  ------------------
 7812|  19.7k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  19.7k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 19.7k, False: 0]
  ------------------
 7814|  19.7k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  19.7k|            }
 7816|  58.7k|        } else
 7817|  50.2k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|   109k|        cptr++;
 7821|   109k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 109k]
  ------------------
 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|   109k|    }
 7837|       |
 7838|  9.11k|    content = xmlBufDetach(target);
 7839|  9.11k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 9.11k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  9.11k|    else
 7842|  9.11k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  9.11k|    xmlBufFree(target);
 7844|  9.15k|error:
 7845|  9.15k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  9.15k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  9.15k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  9.15k|}
xmlXPathBooleanFunction:
 7863|  20.8k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  20.8k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  62.6k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  20.8k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 20.8k]
  |  |  ------------------
  |  |  281|  20.8k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 20.8k]
  |  |  ------------------
  |  |  282|  20.8k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  20.8k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 20.8k]
  |  |  ------------------
  |  |  284|  20.8k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  62.6k|    cur = xmlXPathValuePop(ctxt);
 7868|  62.6k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 20.8k]
  ------------------
 7869|  20.8k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 14.0k, False: 6.78k]
  ------------------
 7870|  14.0k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  14.0k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  14.0k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  14.0k|    }
 7875|  20.8k|    xmlXPathValuePush(ctxt, cur);
 7876|  20.8k|}
xmlXPathNotFunction:
 7888|      6|xmlXPathNotFunction(xmlXPathParserContext *ctxt, int nargs) {
 7889|     16|    CHECK_ARITY(1);
  ------------------
  |  |  280|      6|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6]
  |  |  ------------------
  |  |  281|      6|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 5]
  |  |  ------------------
  |  |  282|      6|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|      5|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5]
  |  |  ------------------
  |  |  284|      5|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7890|     16|    CAST_TO_BOOLEAN;
  ------------------
  |  |  304|      5|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN))	\
  |  |  ------------------
  |  |  |  Branch (304:9): [True: 5, False: 0]
  |  |  |  Branch (304:34): [True: 2, False: 3]
  |  |  ------------------
  |  |  305|      5|        xmlXPathBooleanFunction(ctxt, 1);
  ------------------
 7891|     16|    CHECK_TYPE(XPATH_BOOLEAN);
  ------------------
  |  |  261|      5|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 5]
  |  |  |  Branch (261:34): [True: 1, False: 4]
  |  |  ------------------
  |  |  262|      5|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { 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|     31|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     91|    CHECK_ARITY(0);
  ------------------
  |  |  280|     31|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 31]
  |  |  ------------------
  |  |  281|     31|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 30]
  |  |  ------------------
  |  |  282|     31|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     30|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 30]
  |  |  ------------------
  |  |  284|     30|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     91|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     91|}
xmlXPathLangFunction:
 7942|  6.95k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  6.95k|    xmlXPathObjectPtr val;
 7944|  6.95k|    xmlNodePtr cur;
 7945|  6.95k|    xmlChar *theLang = NULL;
 7946|  6.95k|    const xmlChar *lang;
 7947|  6.95k|    int ret = 0;
 7948|  6.95k|    int i;
 7949|       |
 7950|  20.8k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  6.95k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6.95k]
  |  |  ------------------
  |  |  281|  6.95k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 6.94k]
  |  |  ------------------
  |  |  282|  6.95k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  6.94k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 6.94k]
  |  |  ------------------
  |  |  284|  6.94k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  20.8k|    CAST_TO_STRING;
  ------------------
  |  |  290|  6.94k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 6.94k, False: 0]
  |  |  |  Branch (290:34): [True: 6.94k, False: 6]
  |  |  ------------------
  |  |  291|  6.94k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  20.8k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  6.94k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 6.94k]
  |  |  |  Branch (261:34): [True: 1, False: 6.94k]
  |  |  ------------------
  |  |  262|  6.94k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  6.94k|    val = xmlXPathValuePop(ctxt);
 7954|  6.94k|    lang = val->stringval;
 7955|  6.94k|    cur = ctxt->context->node;
 7956|  61.7k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 54.8k, False: 6.94k]
  ------------------
 7957|  54.8k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  54.8k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  54.8k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 54.8k]
  ------------------
 7958|  54.8k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|  54.8k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 54.8k]
  ------------------
 7961|      0|            break;
 7962|  54.8k|        cur = cur->parent;
 7963|  54.8k|    }
 7964|  6.94k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 6.94k]
  |  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|  6.94k|not_equal:
 7972|  6.94k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 6.94k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  6.94k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  6.94k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  6.94k|}
xmlXPathNumberFunction:
 7987|   406k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   406k|    xmlXPathObjectPtr cur;
 7989|   406k|    double res;
 7990|       |
 7991|   406k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 406k]
  ------------------
 7992|   406k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 406k]
  ------------------
 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.62M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   406k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 406k]
  |  |  ------------------
  |  |  281|   406k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 406k]
  |  |  ------------------
  |  |  282|   406k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   406k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 5, False: 406k]
  |  |  ------------------
  |  |  284|   406k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.62M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.62M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 406k, False: 2]
  ------------------
 8010|   406k|        double floatval;
 8011|       |
 8012|   406k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   406k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   406k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   406k|    }
 8016|  1.62M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.62M|}
xmlXPathSumFunction:
 8029|     41|xmlXPathSumFunction(xmlXPathParserContext *ctxt, int nargs) {
 8030|     41|    xmlXPathObjectPtr cur;
 8031|     41|    int i;
 8032|     41|    double res = 0.0;
 8033|       |
 8034|    117|    CHECK_ARITY(1);
  ------------------
  |  |  280|     41|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 41]
  |  |  ------------------
  |  |  281|     41|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 38]
  |  |  ------------------
  |  |  282|     41|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     38|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 38]
  |  |  ------------------
  |  |  284|     38|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8035|    117|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (8035:9): [True: 0, False: 38]
  ------------------
 8036|     38|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (8036:3): [True: 3, False: 35]
  ------------------
 8037|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (8037:3): [True: 3, False: 0]
  ------------------
 8038|     35|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8039|     35|    cur = xmlXPathValuePop(ctxt);
 8040|       |
 8041|     35|    if ((cur->nodesetval != NULL) && (cur->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (8041:9): [True: 35, False: 0]
  |  Branch (8041:38): [True: 14, False: 21]
  ------------------
 8042|     53|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 39, False: 14]
  ------------------
 8043|     39|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     39|                                                cur->nodesetval->nodeTab[i]);
 8045|     39|	}
 8046|     14|    }
 8047|     35|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     35|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     35|}
xmlXPathFloorFunction:
 8061|    121|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    353|    CHECK_ARITY(1);
  ------------------
  |  |  280|    121|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 121]
  |  |  ------------------
  |  |  281|    121|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 116]
  |  |  ------------------
  |  |  282|    121|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    116|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 116]
  |  |  ------------------
  |  |  284|    116|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    353|    CAST_TO_NUMBER;
  ------------------
  |  |  297|    116|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 116, False: 0]
  |  |  |  Branch (297:34): [True: 74, False: 42]
  |  |  ------------------
  |  |  298|    116|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    353|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|    116|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 116]
  |  |  |  Branch (261:34): [True: 1, False: 115]
  |  |  ------------------
  |  |  262|    116|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|    115|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|    115|}
xmlXPathParseNCName:
 8147|  98.1k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|  98.1k|    const xmlChar *end;
 8149|  98.1k|    xmlChar *ret;
 8150|       |
 8151|  98.1k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 98.1k]
  |  Branch (8151:27): [True: 0, False: 98.1k]
  ------------------
 8152|       |
 8153|  98.1k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  98.1k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  98.1k|#define XML_SCAN_NC         1
  ------------------
 8154|  98.1k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 3, False: 98.1k]
  ------------------
 8155|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|  98.1k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 4.50k, False: 93.6k]
  ------------------
 8158|  4.50k|        return(NULL);
 8159|       |
 8160|  93.6k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  93.6k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 84, False: 93.5k]
  ------------------
 8162|     84|        xmlXPathPErrMemory(ctxt);
 8163|  93.6k|    ctxt->cur = end;
 8164|  93.6k|    return(ret);
 8165|  98.1k|}
xmlXPathParseName:
 8199|  22.2k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  22.2k|    const xmlChar *end;
 8201|  22.2k|    xmlChar *ret;
 8202|       |
 8203|  22.2k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 22.2k]
  |  Branch (8203:27): [True: 0, False: 22.2k]
  ------------------
 8204|       |
 8205|  22.2k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  22.2k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  22.2k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 3, False: 22.2k]
  ------------------
 8207|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  22.2k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 3.00k, False: 19.2k]
  ------------------
 8210|  3.00k|        return(NULL);
 8211|       |
 8212|  19.2k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  19.2k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 50, False: 19.2k]
  ------------------
 8214|     50|        xmlXPathPErrMemory(ctxt);
 8215|  19.2k|    ctxt->cur = end;
 8216|  19.2k|    return(ret);
 8217|  22.2k|}
xmlXPathStringEvalNumber:
 8236|   712k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   712k|    const xmlChar *cur = str;
 8238|   712k|    double ret;
 8239|   712k|    int ok = 0;
 8240|   712k|    int isneg = 0;
 8241|   712k|    int exponent = 0;
 8242|   712k|    int is_exponent_negative = 0;
 8243|   712k|#ifdef __GNUC__
 8244|   712k|    unsigned long tmp = 0;
 8245|   712k|    double temp;
 8246|   712k|#endif
 8247|   712k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 712k]
  ------------------
 8248|   712k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   712k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 71.2k, False: 641k]
  ------------------
 8250|  71.2k|	isneg = 1;
 8251|  71.2k|	cur++;
 8252|  71.2k|    }
 8253|   712k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 638k, False: 74.0k]
  |  Branch (8253:27): [True: 573k, False: 65.2k]
  |  Branch (8253:43): [True: 48.8k, False: 16.3k]
  ------------------
 8254|   622k|        return(xmlXPathNAN);
 8255|   622k|    }
 8256|       |
 8257|  90.4k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  90.4k|    ret = 0;
 8263|   135k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 47.3k, False: 88.1k]
  |  Branch (8263:29): [True: 45.1k, False: 2.26k]
  ------------------
 8264|  45.1k|	ret = ret * 10;
 8265|  45.1k|	tmp = (*cur - '0');
 8266|  45.1k|	ok = 1;
 8267|  45.1k|	cur++;
 8268|  45.1k|	temp = (double) tmp;
 8269|  45.1k|	ret = ret + temp;
 8270|  45.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|  90.4k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 79.2k, False: 11.1k]
  ------------------
 8281|  79.2k|	int v, frac = 0, max;
 8282|  79.2k|	double fraction = 0;
 8283|       |
 8284|  79.2k|        cur++;
 8285|  79.2k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 21.7k, False: 57.5k]
  |  Branch (8285:23): [True: 12.7k, False: 44.7k]
  |  Branch (8285:40): [True: 33.5k, False: 923]
  ------------------
 8286|  33.5k|	    return(xmlXPathNAN);
 8287|  33.5k|	}
 8288|  73.0k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 27.3k, False: 45.7k]
  ------------------
 8289|  27.3k|	    frac = frac + 1;
 8290|  27.3k|	    cur++;
 8291|  27.3k|        }
 8292|  45.7k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  45.7k|#define MAX_FRAC 20
  ------------------
 8293|   134k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 115k, False: 19.2k]
  |  Branch (8293:27): [True: 89.0k, False: 26.3k]
  |  Branch (8293:45): [True: 88.9k, False: 91]
  ------------------
 8294|  88.9k|	    v = (*cur - '0');
 8295|  88.9k|	    fraction = fraction * 10 + v;
 8296|  88.9k|	    frac = frac + 1;
 8297|  88.9k|	    cur++;
 8298|  88.9k|	}
 8299|  45.7k|	fraction /= pow(10.0, frac);
 8300|  45.7k|	ret = ret + fraction;
 8301|  47.8k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 28.5k, False: 19.3k]
  |  Branch (8301:26): [True: 2.10k, False: 26.4k]
  ------------------
 8302|  2.10k|	    cur++;
 8303|  45.7k|    }
 8304|  56.8k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 4.36k, False: 52.4k]
  |  Branch (8304:26): [True: 12.5k, False: 39.9k]
  ------------------
 8305|  16.8k|      cur++;
 8306|  16.8k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 6.68k, False: 10.2k]
  ------------------
 8307|  6.68k|	is_exponent_negative = 1;
 8308|  6.68k|	cur++;
 8309|  10.2k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 5.91k, False: 4.28k]
  ------------------
 8310|  5.91k|        cur++;
 8311|  5.91k|      }
 8312|  64.1k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 48.0k, False: 16.1k]
  |  Branch (8312:31): [True: 47.2k, False: 778]
  ------------------
 8313|  47.2k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 46.2k, False: 1.04k]
  ------------------
 8314|  46.2k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  47.2k|	cur++;
 8316|  47.2k|      }
 8317|  16.8k|    }
 8318|  56.8k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  56.8k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 22.1k, False: 34.7k]
  ------------------
 8320|  34.7k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 19.9k, False: 14.8k]
  ------------------
 8321|  34.7k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 6.54k, False: 28.1k]
  ------------------
 8322|  34.7k|    ret *= pow(10.0, (double)exponent);
 8323|  34.7k|    return(ret);
 8324|  56.8k|}
xmlXPathIsNodeType:
 8548|  9.76k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  9.76k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 9.76k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  9.76k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  9.76k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 34, False: 9.72k]
  ------------------
 8553|     34|	return(1);
 8554|  9.72k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  9.72k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 49, False: 9.67k]
  ------------------
 8555|     49|	return(1);
 8556|  9.67k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  9.67k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 20, False: 9.65k]
  ------------------
 8557|     20|	return(1);
 8558|  9.65k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  9.65k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 148, False: 9.50k]
  ------------------
 8559|    148|	return(1);
 8560|  9.50k|    return(0);
 8561|  9.65k|}
xmlXPathEvaluatePredicateResult:
11626|   254k|                                xmlXPathObject *res) {
11627|   254k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 254k]
  |  Branch (11627:27): [True: 0, False: 254k]
  ------------------
11628|   254k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 254k]
  ------------------
11630|      0|	    return(res->boolval);
11631|   102k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 102k, False: 151k]
  ------------------
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|   102k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   146k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 146k, False: 107k]
  ------------------
11639|   146k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 254k]
  ------------------
11640|   146k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 146k]
  ------------------
11641|      0|		return(0);
11642|   146k|	    return(res->nodesetval->nodeNr != 0);
11643|  4.38k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 4.38k, False: 249k]
  ------------------
11644|  4.38k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 4.38k, False: 0]
  |  Branch (11644:41): [True: 3.42k, False: 965]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 254k]
  ------------------
11646|      0|	    break;
11647|   254k|    }
11648|      0|    return(0);
11649|   254k|}
xmlXPathEvalExpr:
12002|  16.1k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  16.1k|    int oldDepth = 0;
12007|       |
12008|  16.1k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 16.1k]
  |  Branch (12008:27): [True: 0, False: 16.1k]
  ------------------
12009|      0|        return;
12010|  16.1k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 206, False: 15.9k]
  ------------------
12011|    206|        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.9k|    {
12027|  15.9k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 15.9k, False: 0]
  ------------------
12028|  15.9k|            oldDepth = ctxt->context->depth;
12029|  15.9k|	xmlXPathCompileExpr(ctxt, 1);
12030|  15.9k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 15.9k, False: 0]
  ------------------
12031|  15.9k|            ctxt->context->depth = oldDepth;
12032|  15.9k|        CHECK_ERROR;
  ------------------
  |  |  230|  15.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.91k, False: 14.0k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  14.0k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 360, False: 13.6k]
  ------------------
12036|  13.6k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    360|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  13.6k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 13.6k, False: 23]
  |  Branch (12038:34): [True: 13.6k, False: 0]
  ------------------
12039|  13.6k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 13.6k, False: 0]
  ------------------
12040|  13.6k|                oldDepth = ctxt->context->depth;
12041|  13.6k|	    xmlXPathOptimizeExpression(ctxt,
12042|  13.6k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  13.6k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 13.6k, False: 0]
  ------------------
12044|  13.6k|                ctxt->context->depth = oldDepth;
12045|  13.6k|        }
12046|  13.6k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  13.6k|}
xpath.c:xmlXPathNameFunction:
 7223|  7.58k|{
 7224|  7.58k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  7.58k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 2.84k, False: 4.73k]
  ------------------
 7227|  2.84k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  2.84k|        nargs = 1;
 7229|  2.84k|    }
 7230|       |
 7231|  22.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  7.58k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 7.58k]
  |  |  ------------------
  |  |  281|  7.58k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 7.58k]
  |  |  ------------------
  |  |  282|  7.58k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  7.58k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 3, False: 7.57k]
  |  |  ------------------
  |  |  284|  7.58k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  22.7k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 7.57k]
  ------------------
 7233|  7.57k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 4, False: 7.57k]
  ------------------
 7234|      4|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 4, False: 0]
  ------------------
 7235|  7.57k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  7.57k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  7.57k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 7.57k]
  |  Branch (7238:38): [True: 2.06k, False: 5.50k]
  ------------------
 7239|  2.06k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  5.50k|    } else {
 7241|  5.50k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  5.50k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  4.02k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 4.02k, False: 1.48k]
  ------------------
 7245|  4.02k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 5.50k]
  ------------------
 7246|  4.02k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 4.02k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  4.02k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 3.53k, False: 491]
  ------------------
 7250|  3.80k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 273, False: 218]
  ------------------
 7251|  3.80k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  3.80k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  3.80k|		} else {
 7254|    218|		    xmlChar *fullname;
 7255|       |
 7256|    218|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|    218|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|    218|				     NULL, 0);
 7259|    218|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 218]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|    218|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 217]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|    218|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|    218|                }
 7265|  4.02k|                break;
 7266|  1.48k|            default:
  ------------------
  |  Branch (7266:13): [True: 1.48k, False: 4.02k]
  ------------------
 7267|  1.48k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  1.48k|		    cur->nodesetval->nodeTab[i]));
 7269|  1.48k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  5.50k|        }
 7271|  5.50k|    }
 7272|  7.57k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  7.57k|}
xpath.c:xmlXPathSFComputeHash:
  186|  6.00k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  6.00k|    unsigned hashValue = 5381;
  188|  6.00k|    const xmlChar *ptr;
  189|       |
  190|  39.0k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 33.0k, False: 6.00k]
  ------------------
  191|  33.0k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  6.00k|    return(hashValue);
  194|  6.00k|}
xpath.c:wrap_cmp:
  606|  3.58M|    {
  607|  3.58M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  3.58M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 3.58M]
  ------------------
  609|  3.58M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  3.58M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  3.58M|    int depth1, depth2;
  311|  3.58M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  3.58M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  3.58M|    xmlNodePtr cur, root;
  314|  3.58M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  3.58M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  3.58M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 3.58M]
  |  Branch (316:28): [True: 0, False: 3.58M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  3.58M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 3.58M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  3.58M|    switch (node1->type) {
  326|  2.53M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.53M, False: 1.04M]
  ------------------
  327|  2.53M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 1.84M, False: 690k]
  ------------------
  328|  1.84M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  1.84M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  1.84M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 1.84M]
  ------------------
  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|  1.84M|		    goto turtle_comparison;
  340|  1.84M|	    }
  341|   690k|	    break;
  342|   690k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 14.4k, False: 3.56M]
  ------------------
  343|  14.4k|	    precedence1 = 1; /* element is owner */
  344|  14.4k|	    miscNode1 = node1;
  345|  14.4k|	    node1 = node1->parent;
  346|  14.4k|	    misc = 1;
  347|  14.4k|	    break;
  348|   790k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 790k, False: 2.79M]
  ------------------
  349|   853k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 62.2k, False: 3.52M]
  ------------------
  350|   858k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 5.35k, False: 3.57M]
  ------------------
  351|   955k|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 96.7k, False: 3.48M]
  ------------------
  352|   955k|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|   955k|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 476k, False: 479k]
  ------------------
  357|  5.97M|		do {
  358|  5.97M|		    node1 = node1->prev;
  359|  5.97M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 470k, False: 5.50M]
  ------------------
  360|   470k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   470k|			break;
  362|   470k|		    }
  363|  5.50M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 5.59k, False: 5.49M]
  ------------------
  364|  5.59k|			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|  5.59k|			node1 = node1->parent;
  370|  5.59k|			break;
  371|  5.59k|		    }
  372|  5.50M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 5.49M, Folded]
  ------------------
  373|   479k|	    } else {
  374|   479k|		precedence1 = 2; /* element is parent */
  375|   479k|		node1 = node1->parent;
  376|   479k|	    }
  377|   955k|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 955k]
  |  Branch (377:29): [True: 792, False: 954k]
  ------------------
  378|   955k|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|   954k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   954k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 954k, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|   955k|		node1 = miscNode1;
  383|   955k|		precedence1 = 0;
  384|   955k|	    } else
  385|      0|		misc = 1;
  386|   955k|	}
  387|   955k|	    break;
  388|  56.0k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 56.0k, False: 3.52M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|  56.0k|	    return(1);
  393|  22.9k|	default:
  ------------------
  |  Branch (393:2): [True: 22.9k, False: 3.56M]
  ------------------
  394|  22.9k|	    break;
  395|  3.58M|    }
  396|  1.68M|    switch (node2->type) {
  397|   528k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 528k, False: 1.15M]
  ------------------
  398|   528k|	    break;
  399|  13.3k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 13.3k, False: 1.66M]
  ------------------
  400|  13.3k|	    precedence2 = 1; /* element is owner */
  401|  13.3k|	    miscNode2 = node2;
  402|  13.3k|	    node2 = node2->parent;
  403|  13.3k|	    misc = 1;
  404|  13.3k|	    break;
  405|   883k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 883k, False: 800k]
  ------------------
  406|   946k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 63.1k, False: 1.62M]
  ------------------
  407|   951k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 5.24k, False: 1.67M]
  ------------------
  408|  1.04M|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 96.8k, False: 1.58M]
  ------------------
  409|  1.04M|	    miscNode2 = node2;
  410|  1.04M|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 496k, False: 552k]
  ------------------
  411|  5.99M|		do {
  412|  5.99M|		    node2 = node2->prev;
  413|  5.99M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 490k, False: 5.50M]
  ------------------
  414|   490k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   490k|			break;
  416|   490k|		    }
  417|  5.50M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 5.42k, False: 5.49M]
  ------------------
  418|  5.42k|			precedence2 = 2; /* element is parent */
  419|  5.42k|			node2 = node2->parent;
  420|  5.42k|			break;
  421|  5.42k|		    }
  422|  5.50M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 5.49M, Folded]
  ------------------
  423|   552k|	    } else {
  424|   552k|		precedence2 = 2; /* element is parent */
  425|   552k|		node2 = node2->parent;
  426|   552k|	    }
  427|  1.04M|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 1.04M]
  |  Branch (427:29): [True: 651, False: 1.04M]
  ------------------
  428|  1.04M|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|  1.04M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  1.04M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 1.04M, False: 0]
  ------------------
  429|  1.04M|	    {
  430|  1.04M|		node2 = miscNode2;
  431|  1.04M|		precedence2 = 0;
  432|  1.04M|	    } else
  433|      0|		misc = 1;
  434|  1.04M|	}
  435|  1.04M|	    break;
  436|    394|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 394, False: 1.68M]
  ------------------
  437|    394|	    return(1);
  438|  92.6k|	default:
  ------------------
  |  Branch (438:2): [True: 92.6k, False: 1.59M]
  ------------------
  439|  92.6k|	    break;
  440|  1.68M|    }
  441|  1.68M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 19.5k, False: 1.66M]
  ------------------
  442|  19.5k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.57k, False: 16.9k]
  ------------------
  443|  2.57k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 1.21k, False: 1.35k]
  ------------------
  444|       |		/*
  445|       |		* The ugly case; but normally there aren't many
  446|       |		* adjacent non-element nodes around.
  447|       |		*/
  448|  1.21k|		cur = miscNode2->prev;
  449|  1.47k|		while (cur != NULL) {
  ------------------
  |  Branch (449:10): [True: 663, False: 815]
  ------------------
  450|    663|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 401, False: 262]
  ------------------
  451|    401|			return(1);
  452|    262|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 262]
  ------------------
  453|      0|			return(-1);
  454|    262|		    cur = cur->prev;
  455|    262|		}
  456|    815|		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: 486, False: 868]
  ------------------
  464|    486|		    return(1);
  465|    868|		else
  466|    868|		    return(-1);
  467|  1.35k|	    }
  468|  2.57k|	}
  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|  16.9k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 16.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|  16.9k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 16.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|  16.9k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.68M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 702k, False: 977k]
  ------------------
  500|   702k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 13.4k, False: 689k]
  ------------------
  501|  13.4k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  13.4k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  13.4k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 13.4k]
  ------------------
  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|  3.52M|turtle_comparison:
  514|       |
  515|  3.52M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 1.14M, False: 2.38M]
  ------------------
  516|  1.14M|	return(1);
  517|  2.38M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 53.0k, False: 2.32M]
  ------------------
  518|  53.0k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  48.0M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 46.4M, False: 1.62M]
  ------------------
  523|  46.4M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 706k, False: 45.6M]
  ------------------
  524|   706k|	    return(1);
  525|  45.6M|	depth2++;
  526|  45.6M|    }
  527|  1.62M|    root = cur;
  528|  42.7M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 41.5M, False: 1.24M]
  ------------------
  529|  41.5M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 373k, False: 41.1M]
  ------------------
  530|   373k|	    return(-1);
  531|  41.1M|	depth1++;
  532|  41.1M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.24M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.24M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  5.06M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.81M, False: 1.24M]
  ------------------
  543|  3.81M|	depth1--;
  544|  3.81M|	node1 = node1->parent;
  545|  3.81M|    }
  546|  7.93M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 6.68M, False: 1.24M]
  ------------------
  547|  6.68M|	depth2--;
  548|  6.68M|	node2 = node2->parent;
  549|  6.68M|    }
  550|  2.73M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.49M, False: 1.24M]
  ------------------
  551|  1.49M|	node1 = node1->parent;
  552|  1.49M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.49M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.49M]
  |  Branch (554:25): [True: 0, False: 1.49M]
  ------------------
  555|      0|	    return(-2);
  556|  1.49M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.24M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 393k, False: 853k]
  ------------------
  561|   393k|	return(1);
  562|   853k|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 402k, False: 451k]
  ------------------
  563|   402k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   451k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 443k, False: 7.47k]
  ------------------
  568|   443k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 436k, False: 7.62k]
  ------------------
  569|   436k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   436k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   436k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 436k]
  ------------------
  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|  2.38M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 2.17M, False: 210k]
  ------------------
  582|  2.17M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 240k, False: 1.93M]
  ------------------
  583|   240k|	    return(1);
  584|   210k|    return(-1); /* assume there is no sibling list corruption */
  585|   451k|}
xpath.c:xmlXPathErrFmt:
  707|  8.39k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  8.39k|    va_list ap;
  709|  8.39k|    xmlStructuredErrorFunc schannel = NULL;
  710|  8.39k|    xmlGenericErrorFunc channel = NULL;
  711|  8.39k|    void *data = NULL;
  712|  8.39k|    xmlNodePtr node = NULL;
  713|  8.39k|    int res;
  714|       |
  715|  8.39k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 8.39k]
  ------------------
  716|      0|        return;
  717|  8.39k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  8.39k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  8.39k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 8.39k]
  |  Branch (717:23): [True: 0, False: 8.39k]
  ------------------
  718|      0|	code = MAXERRNO;
  ------------------
  |  |  668|      0|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|      0|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  719|       |    /* Only report the first error */
  720|  8.39k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.25k, False: 5.14k]
  ------------------
  721|  3.25k|        return;
  722|       |
  723|  5.14k|    ctxt->error = code;
  724|       |
  725|  5.14k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 5.14k, False: 0]
  ------------------
  726|  5.14k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  5.14k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 5.14k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  5.14k|        xmlResetError(err);
  734|       |
  735|  5.14k|        err->domain = XML_FROM_XPATH;
  736|  5.14k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  5.14k|        err->level = XML_ERR_ERROR;
  738|  5.14k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 5.14k, False: 0]
  ------------------
  739|  5.14k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  5.14k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 26, False: 5.12k]
  ------------------
  741|     26|                xmlXPathPErrMemory(ctxt);
  742|     26|                return;
  743|     26|            }
  744|  5.14k|        }
  745|  5.12k|        err->int1 = ctxt->cur - ctxt->base;
  746|  5.12k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  5.12k|        schannel = ctxt->context->error;
  749|  5.12k|        data = ctxt->context->userData;
  750|  5.12k|        node = ctxt->context->debugNode;
  751|  5.12k|    }
  752|       |
  753|  5.12k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 5.12k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  5.12k|    va_start(ap, fmt);
  759|  5.12k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  5.12k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  5.12k|                         XML_ERR_ERROR, NULL, 0,
  762|  5.12k|                         (const char *) ctxt->base, NULL, NULL,
  763|  5.12k|                         ctxt->cur - ctxt->base, 0,
  764|  5.12k|                         fmt, ap);
  765|  5.12k|    va_end(ap);
  766|  5.12k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 49, False: 5.07k]
  ------------------
  767|     49|        xmlXPathPErrMemory(ctxt);
  768|  5.12k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   720k|                             xmlXPathObjectPtr val) {
 1932|   720k|    double ret = 0.0;
 1933|       |
 1934|   720k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 720k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   720k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 720k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 720k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   471k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 471k, False: 248k]
  ------------------
 1941|   471k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 720k]
  ------------------
 1942|   471k|        xmlChar *str;
 1943|       |
 1944|   471k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   471k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 65, False: 471k]
  ------------------
 1946|     65|            xmlXPathPErrMemory(ctxt);
 1947|     65|            ret = xmlXPathNAN;
 1948|   471k|        } else {
 1949|   471k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   471k|            xmlFree(str);
 1951|   471k|        }
 1952|   471k|	break;
 1953|   471k|    }
 1954|   149k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 149k, False: 570k]
  ------------------
 1955|   149k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   149k|	break;
 1957|  62.1k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 62.1k, False: 657k]
  ------------------
 1958|  62.1k|	ret = val->floatval;
 1959|  62.1k|	break;
 1960|  36.6k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 36.6k, False: 683k]
  ------------------
 1961|  36.6k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  36.6k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 720k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   720k|    }
 1968|   720k|    return(ret);
 1969|   720k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|   129k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|   129k|    xmlNsPtr cur;
 2606|       |
 2607|   129k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 129k]
  |  Branch (2607:25): [True: 0, False: 129k]
  ------------------
 2608|      0|	return(NULL);
 2609|   129k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 129k]
  |  Branch (2609:27): [True: 0, False: 129k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|   129k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|   129k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 25, False: 129k]
  ------------------
 2617|     25|	return(NULL);
 2618|   129k|    memset(cur, 0, sizeof(xmlNs));
 2619|   129k|    cur->type = XML_NAMESPACE_DECL;
 2620|   129k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 82.3k, False: 47.2k]
  ------------------
 2621|  82.3k|	cur->href = xmlStrdup(ns->href);
 2622|  82.3k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 16, False: 82.3k]
  ------------------
 2623|     16|            xmlFree(cur);
 2624|     16|            return(NULL);
 2625|     16|        }
 2626|  82.3k|    }
 2627|   129k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 98.9k, False: 30.6k]
  ------------------
 2628|  98.9k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|  98.9k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 22, False: 98.9k]
  ------------------
 2630|     22|            xmlFree((xmlChar *) cur->href);
 2631|     22|            xmlFree(cur);
 2632|     22|            return(NULL);
 2633|     22|        }
 2634|  98.9k|    }
 2635|   129k|    cur->next = (xmlNsPtr) node;
 2636|   129k|    return((xmlNodePtr) cur);
 2637|   129k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.41M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.41M|    xmlNodePtr *temp;
 2737|  1.41M|    int newSize;
 2738|       |
 2739|  1.41M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.41M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.41M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.41M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.41M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.41M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.41M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.41M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 308, False: 1.41M]
  ------------------
 2745|    308|        return(-1);
 2746|  1.41M|    cur->nodeMax = newSize;
 2747|  1.41M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.41M|    return(0);
 2750|  1.41M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.79M|{
 4258|  3.79M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 20, False: 3.79M]
  ------------------
 4259|     20|	return;
 4260|  3.79M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.79M]
  |  Branch (4260:27): [True: 3.79M, False: 0]
  ------------------
 4261|  3.79M|	 xmlXPathFreeObject(obj);
 4262|  3.79M|    } 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.79M|}
xpath.c:xmlXPathFormatNumber:
 2229|  18.3k|{
 2230|  18.3k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 18.3k]
  ------------------
 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: 18.3k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  18.3k|    default:
  ------------------
  |  Branch (2239:5): [True: 18.3k, False: 0]
  ------------------
 2240|  18.3k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 18.3k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  18.3k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 18.3k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  18.3k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 13.2k, False: 5.11k]
  |  Branch (2246:35): [True: 7.05k, False: 6.18k]
  ------------------
 2247|  7.05k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 4.92k, False: 2.12k]
  ------------------
 2248|  4.92k|	    char work[30];
 2249|  4.92k|	    char *ptr, *cur;
 2250|  4.92k|	    int value = (int) number;
 2251|       |
 2252|  4.92k|            ptr = &buffer[0];
 2253|  4.92k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 4.92k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  4.92k|	    } else {
 2256|  4.92k|		snprintf(work, 29, "%d", value);
 2257|  4.92k|		cur = &work[0];
 2258|  23.1k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 18.2k, False: 4.92k]
  |  Branch (2258:20): [True: 18.2k, False: 0]
  ------------------
 2259|  18.2k|		    *ptr++ = *cur++;
 2260|  18.2k|		}
 2261|  4.92k|	    }
 2262|  4.92k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 4.92k, False: 0]
  ------------------
 2263|  4.92k|		*ptr = 0;
 2264|  4.92k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  13.4k|	} 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|  13.4k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  13.4k|	    int integer_place, fraction_place;
 2280|  13.4k|	    char *ptr;
 2281|  13.4k|	    char *after_fraction;
 2282|  13.4k|	    double absolute_value;
 2283|  13.4k|	    int size;
 2284|       |
 2285|  13.4k|	    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|  13.4k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  13.4k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 11.4k, False: 1.95k]
  ------------------
 2293|  1.95k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  1.95k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 643, False: 1.30k]
  ------------------
 2294|  12.1k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 12.1k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  12.1k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  12.1k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  12.1k|		fraction_place = DBL_DIG - 1;
 2298|  12.1k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  12.1k|			 integer_place, fraction_place, number);
 2300|  65.0k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 65.0k, False: 0]
  |  Branch (2300:24): [True: 52.8k, False: 12.1k]
  ------------------
 2301|       |
 2302|  12.1k|	    }
 2303|  1.30k|	    else {
 2304|       |		/* Use regular notation */
 2305|  1.30k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 1.30k, False: 0]
  ------------------
 2306|  1.30k|		    integer_place = (int)log10(absolute_value);
 2307|  1.30k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 544, False: 765]
  ------------------
 2308|    544|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|    765|		    else
 2310|    765|		        fraction_place = DBL_DIG - integer_place;
 2311|  1.30k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  1.30k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  1.30k|				fraction_place, number);
 2316|  1.30k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  19.7k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 6.33k, False: 13.4k]
  ------------------
 2320|   133k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 126k, False: 6.33k]
  ------------------
 2321|  6.33k|		size--;
 2322|  6.33k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  13.4k|	    after_fraction = work + size;
 2326|  13.4k|	    ptr = after_fraction;
 2327|  44.6k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 31.2k, False: 13.4k]
  ------------------
 2328|  31.2k|		;
 2329|  13.4k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 13.1k, False: 327]
  ------------------
 2330|  13.1k|	        ptr++;
 2331|  66.3k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 52.8k, False: 13.4k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  13.4k|	    size = strlen(work) + 1;
 2335|  13.4k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 13.4k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  13.4k|	    memmove(buffer, work, size);
 2340|  13.4k|	}
 2341|  18.3k|	break;
 2342|  18.3k|    }
 2343|  18.3k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|  91.5k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|  91.5k|    xmlChar *strval;
 4534|  91.5k|    double ret;
 4535|       |
 4536|  91.5k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 91.5k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|  91.5k|    strval = xmlXPathCastNodeToString(node);
 4539|  91.5k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 16, False: 91.5k]
  ------------------
 4540|     16|        xmlXPathPErrMemory(ctxt);
 4541|     16|	return(xmlXPathNAN);
 4542|     16|    }
 4543|  91.5k|    ret = xmlXPathCastStringToNumber(strval);
 4544|  91.5k|    xmlFree(strval);
 4545|       |
 4546|  91.5k|    return(ret);
 4547|  91.5k|}
xpath.c:xmlXPathNewCompExpr:
  940|  11.6k|xmlXPathNewCompExpr(void) {
  941|  11.6k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  11.6k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  11.6k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 32, False: 11.5k]
  ------------------
  945|     32|	return(NULL);
  946|  11.5k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  11.5k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  11.5k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  11.5k|    cur->nbStep = 0;
  953|  11.5k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  11.5k|	                                   sizeof(xmlXPathStepOp));
  955|  11.5k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 30, False: 11.5k]
  ------------------
  956|     30|	xmlFree(cur);
  957|     30|	return(NULL);
  958|     30|    }
  959|  11.5k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  11.5k|    cur->last = -1;
  961|  11.5k|    return(cur);
  962|  11.5k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  33.8k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  33.8k|    int i, j;
 5435|  33.8k|    unsigned int *hashs1;
 5436|  33.8k|    unsigned int *hashs2;
 5437|  33.8k|    xmlChar **values1;
 5438|  33.8k|    xmlChar **values2;
 5439|  33.8k|    int ret = 0;
 5440|  33.8k|    xmlNodeSetPtr ns1;
 5441|  33.8k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  33.8k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 33.8k]
  ------------------
 5444|  33.8k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 33.8k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  33.8k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 33.8k]
  ------------------
 5447|  33.8k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 33.8k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  33.8k|    ns1 = arg1->nodesetval;
 5451|  33.8k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  33.8k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 33.8k]
  |  Branch (5453:26): [True: 8.40k, False: 25.4k]
  ------------------
 5454|  8.40k|	return(0);
 5455|  25.4k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 25.4k]
  |  Branch (5455:26): [True: 2.91k, False: 22.4k]
  ------------------
 5456|  2.91k|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  22.4k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 21.6k, False: 818]
  ------------------
 5462|  43.1k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 26.0k, False: 17.0k]
  ------------------
 5463|   108k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 87.2k, False: 21.5k]
  ------------------
 5464|  87.2k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 4.58k, False: 82.6k]
  ------------------
 5465|  4.58k|		    return(1);
 5466|       |
 5467|  17.9k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  17.9k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 1, False: 17.9k]
  ------------------
 5469|      1|        xmlXPathPErrMemory(ctxt);
 5470|      1|	return(0);
 5471|      1|    }
 5472|  17.9k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  17.9k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 1, False: 17.9k]
  ------------------
 5474|      1|        xmlXPathPErrMemory(ctxt);
 5475|      1|	xmlFree(values1);
 5476|      1|	return(0);
 5477|      1|    }
 5478|  17.9k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  17.9k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  17.9k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 4, False: 17.8k]
  ------------------
 5481|      4|        xmlXPathPErrMemory(ctxt);
 5482|      4|	xmlFree(hashs1);
 5483|      4|	xmlFree(values1);
 5484|      4|	return(0);
 5485|      4|    }
 5486|  17.8k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  17.8k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 2, False: 17.8k]
  ------------------
 5488|      2|        xmlXPathPErrMemory(ctxt);
 5489|      2|	xmlFree(hashs1);
 5490|      2|	xmlFree(values1);
 5491|      2|	xmlFree(values2);
 5492|      2|	return(0);
 5493|      2|    }
 5494|  17.8k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  37.8k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 21.5k, False: 16.3k]
  ------------------
 5496|  21.5k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  62.7k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 42.8k, False: 19.9k]
  ------------------
 5498|  42.8k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 38.8k, False: 3.93k]
  ------------------
 5499|  38.8k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  42.8k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 39.9k, False: 2.84k]
  ------------------
 5501|  39.9k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 497, False: 39.4k]
  ------------------
 5502|    497|		    ret = 1;
 5503|    497|		    break;
 5504|    497|		}
 5505|  39.9k|	    }
 5506|  2.84k|	    else {
 5507|  2.84k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 2.48k, False: 355]
  ------------------
 5508|  2.48k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  2.48k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 6, False: 2.48k]
  ------------------
 5510|      6|                        xmlXPathPErrMemory(ctxt);
 5511|  2.48k|                }
 5512|  2.84k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 2.08k, False: 758]
  ------------------
 5513|  2.08k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  2.08k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 1, False: 2.08k]
  ------------------
 5515|      1|                        xmlXPathPErrMemory(ctxt);
 5516|  2.08k|                }
 5517|  2.84k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  2.84k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 1.08k, False: 1.76k]
  ------------------
 5519|  1.08k|		    break;
 5520|  2.84k|	    }
 5521|  42.8k|	}
 5522|  21.5k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 1.57k, False: 19.9k]
  ------------------
 5523|  1.57k|	    break;
 5524|  21.5k|    }
 5525|  41.8k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 23.9k, False: 17.8k]
  ------------------
 5526|  23.9k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 2.48k, False: 21.4k]
  ------------------
 5527|  2.48k|	    xmlFree(values1[i]);
 5528|  56.8k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 38.9k, False: 17.8k]
  ------------------
 5529|  38.9k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 2.08k, False: 36.8k]
  ------------------
 5530|  2.08k|	    xmlFree(values2[j]);
 5531|  17.8k|    xmlFree(values1);
 5532|  17.8k|    xmlFree(values2);
 5533|  17.8k|    xmlFree(hashs1);
 5534|  17.8k|    xmlFree(hashs2);
 5535|  17.8k|    return(ret);
 5536|  17.8k|}
xpath.c:xmlXPathNodeValHash:
 4920|  81.6k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  81.6k|    int len = 2;
 4922|  81.6k|    const xmlChar * string = NULL;
 4923|  81.6k|    xmlNodePtr tmp = NULL;
 4924|  81.6k|    unsigned int ret = 0;
 4925|       |
 4926|  81.6k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 81.6k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  81.6k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 18.3k, False: 63.3k]
  ------------------
 4930|  18.3k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  18.3k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 18.3k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  18.3k|	else
 4934|  18.3k|	    node = tmp;
 4935|       |
 4936|  18.3k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 18.3k]
  ------------------
 4937|      0|	    return(0);
 4938|  18.3k|    }
 4939|       |
 4940|  81.6k|    switch (node->type) {
 4941|    775|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 775, False: 80.9k]
  ------------------
 4942|  1.98k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 1.21k, False: 80.4k]
  ------------------
 4943|  2.26k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 275, False: 81.4k]
  ------------------
 4944|  8.76k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 6.50k, False: 75.1k]
  ------------------
 4945|  8.76k|	    string = node->content;
 4946|  8.76k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 1.21k, False: 7.55k]
  ------------------
 4947|  1.21k|		return(0);
 4948|  7.55k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 107, False: 7.44k]
  ------------------
 4949|    107|		return(0);
 4950|  7.44k|	    return(string[0] + (string[1] << 8));
 4951|    487|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 487, False: 81.2k]
  ------------------
 4952|    487|	    string = ((xmlNsPtr)node)->href;
 4953|    487|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 222, False: 265]
  ------------------
 4954|    222|		return(0);
 4955|    265|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 265]
  ------------------
 4956|      0|		return(0);
 4957|    265|	    return(string[0] + (string[1] << 8));
 4958|    925|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 925, False: 80.7k]
  ------------------
 4959|    925|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    925|	    break;
 4961|  71.5k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 71.5k, False: 10.1k]
  ------------------
 4962|  71.5k|	    tmp = node->children;
 4963|  71.5k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 81.6k]
  ------------------
 4965|      0|	    return(0);
 4966|  81.6k|    }
 4967|   361k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 323k, False: 37.5k]
  ------------------
 4968|   323k|	switch (tmp->type) {
 4969|  14.4k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 14.4k, False: 309k]
  ------------------
 4970|  54.9k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 40.4k, False: 283k]
  ------------------
 4971|  54.9k|		string = tmp->content;
 4972|  54.9k|		break;
 4973|   268k|	    default:
  ------------------
  |  Branch (4973:6): [True: 268k, False: 54.9k]
  ------------------
 4974|   268k|                string = NULL;
 4975|   268k|		break;
 4976|   323k|	}
 4977|   323k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 54.9k, False: 268k]
  |  Branch (4977:26): [True: 54.5k, False: 372]
  ------------------
 4978|  54.5k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 18.1k, False: 36.4k]
  ------------------
 4979|  18.1k|		return(ret + (string[0] << 8));
 4980|  18.1k|	    }
 4981|  36.4k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 19.6k, False: 16.7k]
  ------------------
 4982|  19.6k|		len = 1;
 4983|  19.6k|		ret = string[0];
 4984|  19.6k|	    } else {
 4985|  16.7k|		return(string[0] + (string[1] << 8));
 4986|  16.7k|	    }
 4987|  36.4k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|   288k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 96.8k, False: 191k]
  ------------------
 4992|  96.8k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 96.8k, False: 0]
  ------------------
 4993|  96.8k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 96.8k, False: 0]
  ------------------
 4994|  96.8k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 96.8k, False: 0]
  ------------------
 4995|  96.8k|            tmp = tmp->children;
 4996|  96.8k|            continue;
 4997|  96.8k|	}
 4998|   191k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 191k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|   191k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 187k, False: 4.73k]
  ------------------
 5002|   187k|	    tmp = tmp->next;
 5003|   187k|	    continue;
 5004|   187k|	}
 5005|       |
 5006|  7.67k|	do {
 5007|  7.67k|	    tmp = tmp->parent;
 5008|  7.67k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 7.67k]
  ------------------
 5009|      0|		break;
 5010|  7.67k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 2.42k, False: 5.24k]
  ------------------
 5011|  2.42k|		tmp = NULL;
 5012|  2.42k|		break;
 5013|  2.42k|	    }
 5014|  5.24k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 2.31k, False: 2.93k]
  ------------------
 5015|  2.31k|		tmp = tmp->next;
 5016|  2.31k|		break;
 5017|  2.31k|	    }
 5018|  5.24k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 2.93k, False: 0]
  ------------------
 5019|  4.73k|    }
 5020|  37.5k|    return(ret);
 5021|  72.4k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  27.6k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  27.6k|  int i, ret=0;
 5372|  27.6k|  xmlNodeSetPtr ns;
 5373|  27.6k|  xmlChar *str2;
 5374|  27.6k|  xmlXPathObjectPtr val;
 5375|  27.6k|  double v;
 5376|       |
 5377|  27.6k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 27.6k]
  ------------------
 5378|  27.6k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 27.6k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  27.6k|    ns = arg->nodesetval;
 5382|  27.6k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 27.6k, False: 0]
  ------------------
 5383|  68.0k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 41.2k, False: 26.8k]
  ------------------
 5384|  41.2k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  41.2k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 41.2k, False: 10]
  ------------------
 5386|  41.2k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  41.2k|		xmlFree(str2);
 5388|  41.2k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  41.2k|                CHECK_ERROR0;
  ------------------
  |  |  236|  41.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 15, False: 41.2k]
  |  |  ------------------
  ------------------
 5390|  41.2k|		val = xmlXPathValuePop(ctxt);
 5391|  41.2k|		v = val->floatval;
 5392|  41.2k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  41.2k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 4.32k, False: 36.8k]
  ------------------
 5394|  4.32k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 3.94k, False: 382]
  |  Branch (5394:21): [True: 495, False: 3.44k]
  ------------------
 5395|    495|			ret = 1;
 5396|    495|			break;
 5397|  3.82k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 382, False: 3.44k]
  |  Branch (5397:27): [True: 364, False: 18]
  ------------------
 5398|    364|			ret = 1;
 5399|    364|			break;
 5400|    364|		    }
 5401|  36.8k|		} else {	/* NaN is unequal to any value */
 5402|  36.8k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 5.47k, False: 31.4k]
  ------------------
 5403|  5.47k|			ret = 1;
 5404|  36.8k|		}
 5405|  41.2k|	    } else {
 5406|     10|                xmlXPathPErrMemory(ctxt);
 5407|     10|            }
 5408|  41.2k|	}
 5409|  27.6k|    }
 5410|       |
 5411|  27.6k|    return(ret);
 5412|  27.6k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  6.91k|{
 5315|  6.91k|    int i;
 5316|  6.91k|    xmlNodeSetPtr ns;
 5317|  6.91k|    xmlChar *str2;
 5318|  6.91k|    unsigned int hash;
 5319|       |
 5320|  6.91k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 6.91k]
  |  Branch (5320:26): [True: 0, False: 6.91k]
  ------------------
 5321|  6.91k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 6.91k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  6.91k|    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|  6.91k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 6.91k]
  |  Branch (5328:25): [True: 5.59k, False: 1.31k]
  ------------------
 5329|  5.59k|        return (0);
 5330|  1.31k|    hash = xmlXPathStringHash(str);
 5331|  21.8k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 21.2k, False: 557]
  ------------------
 5332|  21.2k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 1.18k, False: 20.0k]
  ------------------
 5333|  1.18k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  1.18k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 3, False: 1.18k]
  ------------------
 5335|      3|                xmlXPathPErrMemory(ctxt);
 5336|      3|                return(0);
 5337|      3|            }
 5338|  1.18k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 560, False: 622]
  ------------------
 5339|    560|                xmlFree(str2);
 5340|    560|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 274, False: 286]
  ------------------
 5341|    274|		    continue;
 5342|    286|                return (1);
 5343|    622|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 233, False: 389]
  ------------------
 5344|    233|		xmlFree(str2);
 5345|    233|		return (1);
 5346|    233|	    }
 5347|    389|            xmlFree(str2);
 5348|  20.0k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 236, False: 19.8k]
  ------------------
 5349|    236|	    return (1);
 5350|  21.2k|    }
 5351|    557|    return (0);
 5352|  1.31k|}
xpath.c:xmlXPathStringHash:
 5031|  1.31k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.31k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.31k]
  ------------------
 5033|      0|	return(0);
 5034|  1.31k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 354, False: 961]
  ------------------
 5035|    354|	return(0);
 5036|    961|    return(string[0] + (string[1] << 8));
 5037|  1.31k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   237k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   237k|    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|   237k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 237k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 237k]
  ------------------
 5548|      0|	    break;
 5549|   115k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 115k, False: 122k]
  ------------------
 5550|   115k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 115k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 115k]
  ------------------
 5552|      0|		    break;
 5553|  69.9k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 69.9k, False: 45.8k]
  ------------------
 5554|  69.9k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  69.9k|		    break;
 5556|  33.0k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 33.0k, False: 82.7k]
  ------------------
 5557|  33.0k|		    ret = (arg1->boolval ==
 5558|  33.0k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  33.0k|		    break;
 5560|  12.7k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 12.7k, False: 103k]
  ------------------
 5561|  12.7k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 12.7k]
  ------------------
 5562|  12.7k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 2.25k, False: 10.5k]
  ------------------
 5563|  10.5k|		    else
 5564|  10.5k|			ret = 1;
 5565|  12.7k|		    ret = (arg1->boolval == ret);
 5566|  12.7k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 115k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 115k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 115k]
  ------------------
 5572|      0|		    break;
 5573|   115k|	    }
 5574|   115k|	    break;
 5575|   120k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 120k, False: 117k]
  ------------------
 5576|   120k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 120k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 120k]
  ------------------
 5578|      0|		    break;
 5579|  31.7k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 31.7k, False: 88.6k]
  ------------------
 5580|  31.7k|		    ret = (arg2->boolval==
 5581|  31.7k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  31.7k|		    break;
 5583|    639|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 639, False: 119k]
  ------------------
 5584|    639|		    xmlXPathValuePush(ctxt, arg2);
 5585|    639|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    639|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    639|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 1, False: 638]
  ------------------
 5588|      1|                        break;
 5589|       |                    /* Falls through. */
 5590|  88.6k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 88.0k, False: 32.3k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  88.6k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 3.85k, False: 84.8k]
  ------------------
 5593|  84.8k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 532, False: 84.2k]
  ------------------
 5594|  4.39k|		        ret = 0;
 5595|  84.2k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 4.55k, False: 79.7k]
  ------------------
 5596|  4.55k|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 366, False: 4.19k]
  ------------------
 5597|    366|			    ret = 1;
 5598|  4.19k|			else
 5599|  4.19k|			    ret = 0;
 5600|  79.7k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 846, False: 78.8k]
  ------------------
 5601|    846|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 309, False: 537]
  ------------------
 5602|    309|			    ret = 1;
 5603|    537|			else
 5604|    537|			    ret = 0;
 5605|  78.8k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 647, False: 78.2k]
  ------------------
 5606|    647|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 647]
  ------------------
 5607|      0|			    ret = 1;
 5608|    647|			else
 5609|    647|			    ret = 0;
 5610|  78.2k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 261, False: 77.9k]
  ------------------
 5611|    261|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 261]
  ------------------
 5612|      0|			    ret = 1;
 5613|    261|			else
 5614|    261|			    ret = 0;
 5615|  77.9k|		    } else {
 5616|  77.9k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  77.9k|		    }
 5618|  88.6k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 120k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 120k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 120k]
  ------------------
 5624|      0|		    break;
 5625|   120k|	    }
 5626|   120k|	    break;
 5627|   120k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.61k, False: 236k]
  ------------------
 5628|  1.61k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.61k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.61k]
  ------------------
 5630|      0|		    break;
 5631|    591|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 591, False: 1.02k]
  ------------------
 5632|    591|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 591]
  ------------------
 5633|    591|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 199, False: 392]
  ------------------
 5634|    392|		    else
 5635|    392|			ret = 1;
 5636|    591|		    ret = (arg2->boolval == ret);
 5637|    591|		    break;
 5638|     72|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 72, False: 1.54k]
  ------------------
 5639|     72|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|     72|		    break;
 5641|    956|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 956, False: 663]
  ------------------
 5642|    956|		    xmlXPathValuePush(ctxt, arg1);
 5643|    956|		    xmlXPathNumberFunction(ctxt, 1);
 5644|    956|		    arg1 = xmlXPathValuePop(ctxt);
 5645|    956|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 1, False: 955]
  ------------------
 5646|      1|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|    955|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 780, False: 175]
  ------------------
 5649|    861|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 81, False: 94]
  ------------------
 5650|    861|		        ret = 0;
 5651|    861|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 93]
  ------------------
 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|     93|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 1, False: 92]
  ------------------
 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|     92|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 82]
  ------------------
 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|     82|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 3, False: 79]
  ------------------
 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|     79|		    } else {
 5672|     79|		        ret = (arg1->floatval == arg2->floatval);
 5673|     79|		    }
 5674|    955|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.61k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.61k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.61k]
  ------------------
 5680|      0|		    break;
 5681|  1.61k|	    }
 5682|  1.61k|	    break;
 5683|  1.61k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 237k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 237k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 237k]
  ------------------
 5688|      0|	    break;
 5689|   237k|    }
 5690|   237k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   237k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   237k|    return(ret);
 5693|   237k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  85.1k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  85.1k|    int i, j, init = 0;
 5180|  85.1k|    double val1;
 5181|  85.1k|    double *values2;
 5182|  85.1k|    int ret = 0;
 5183|  85.1k|    xmlNodeSetPtr ns1;
 5184|  85.1k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  85.1k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 85.1k]
  ------------------
 5187|  85.1k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 85.1k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  85.1k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 85.1k]
  ------------------
 5192|  85.1k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 85.1k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  85.1k|    ns1 = arg1->nodesetval;
 5199|  85.1k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  85.1k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 85.1k]
  |  Branch (5201:26): [True: 52.2k, False: 32.8k]
  ------------------
 5202|  52.2k|	xmlXPathFreeObject(arg1);
 5203|  52.2k|	xmlXPathFreeObject(arg2);
 5204|  52.2k|	return(0);
 5205|  52.2k|    }
 5206|  32.8k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 32.8k]
  |  Branch (5206:26): [True: 25.5k, False: 7.29k]
  ------------------
 5207|  25.5k|	xmlXPathFreeObject(arg1);
 5208|  25.5k|	xmlXPathFreeObject(arg2);
 5209|  25.5k|	return(0);
 5210|  25.5k|    }
 5211|       |
 5212|  7.29k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  7.29k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 7.28k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  49.6k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 45.3k, False: 4.36k]
  ------------------
 5220|  45.3k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  45.3k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 39.7k, False: 5.55k]
  ------------------
 5222|  39.7k|	    continue;
 5223|  54.0k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 51.4k, False: 2.63k]
  ------------------
 5224|  51.4k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 46.2k, False: 5.18k]
  ------------------
 5225|  46.2k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  46.2k|                                                          ns2->nodeTab[j]);
 5227|  46.2k|	    }
 5228|  51.4k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 44.4k, False: 6.96k]
  ------------------
 5229|  44.4k|		continue;
 5230|  6.96k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 528, False: 6.43k]
  |  Branch (5230:17): [True: 251, False: 277]
  ------------------
 5231|    251|		ret = (val1 < values2[j]);
 5232|  6.71k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 277, False: 6.43k]
  |  Branch (5232:22): [True: 277, False: 0]
  ------------------
 5233|    277|		ret = (val1 <= values2[j]);
 5234|  6.43k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 6.43k, False: 0]
  |  Branch (5234:23): [True: 5.67k, False: 757]
  ------------------
 5235|  5.67k|		ret = (val1 > values2[j]);
 5236|    757|	    else if (!inf && !strict)
  ------------------
  |  Branch (5236:15): [True: 757, False: 0]
  |  Branch (5236:23): [True: 757, False: 0]
  ------------------
 5237|    757|		ret = (val1 >= values2[j]);
 5238|  6.96k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 2.92k, False: 4.04k]
  ------------------
 5239|  2.92k|		break;
 5240|  6.96k|	}
 5241|  5.55k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 2.92k, False: 2.63k]
  ------------------
 5242|  2.92k|	    break;
 5243|  2.63k|	init = 1;
 5244|  2.63k|    }
 5245|  7.28k|    xmlFree(values2);
 5246|  7.28k|    xmlXPathFreeObject(arg1);
 5247|  7.28k|    xmlXPathFreeObject(arg2);
 5248|  7.28k|    return(ret);
 5249|  7.29k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  76.1k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  76.1k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 76.1k]
  |  Branch (5273:26): [True: 0, False: 76.1k]
  ------------------
 5274|  76.1k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 76.1k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  76.1k|    switch(val->type) {
 5278|  64.1k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 64.1k, False: 11.9k]
  ------------------
 5279|  64.1k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 76.1k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 76.1k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|  1.35k|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 1.35k, False: 74.7k]
  ------------------
 5284|  1.35k|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  10.5k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 10.5k, False: 65.5k]
  ------------------
 5286|  10.5k|	    xmlXPathValuePush(ctxt, arg);
 5287|  10.5k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  10.5k|	    xmlXPathValuePush(ctxt, val);
 5289|  10.5k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 76.1k]
  ------------------
 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|  76.1k|    }
 5295|      0|    return(0);
 5296|  76.1k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  64.1k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  64.1k|    int i, ret = 0;
 5063|  64.1k|    xmlNodeSetPtr ns;
 5064|  64.1k|    xmlChar *str2;
 5065|       |
 5066|  64.1k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 64.1k]
  |  Branch (5066:24): [True: 0, False: 64.1k]
  ------------------
 5067|  64.1k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 64.1k]
  |  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|  64.1k|    ns = arg->nodesetval;
 5073|  64.1k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 64.1k, False: 0]
  ------------------
 5074|   145k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 83.0k, False: 62.4k]
  ------------------
 5075|  83.0k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  83.0k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 83.0k, False: 7]
  ------------------
 5077|  83.0k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  83.0k|		 xmlFree(str2);
 5079|  83.0k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  83.0k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  83.0k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  83.0k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 1.75k, False: 81.2k]
  ------------------
 5083|  1.75k|		     break;
 5084|  83.0k|	     } else {
 5085|      7|                 xmlXPathPErrMemory(ctxt);
 5086|      7|             }
 5087|  83.0k|	}
 5088|  64.1k|    }
 5089|  64.1k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  64.1k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  64.1k|    return(ret);
 5092|  64.1k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   409k|{
 1882|   409k|    xmlXPathObjectPtr ret;
 1883|   409k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   409k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 409k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   409k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 409k, False: 0]
  |  Branch (1888:27): [True: 0, False: 409k]
  ------------------
 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|   409k|    ret = xmlXPathObjectCopy(val);
 1911|   409k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 101, False: 409k]
  ------------------
 1912|    101|        xmlXPathPErrMemory(pctxt);
 1913|   409k|    return(ret);
 1914|   409k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|  1.35k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|  1.35k|    int i, ret = 0;
 5117|  1.35k|    xmlNodeSetPtr ns;
 5118|  1.35k|    xmlChar *str2;
 5119|       |
 5120|  1.35k|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 1.35k]
  |  Branch (5120:24): [True: 0, False: 1.35k]
  ------------------
 5121|  1.35k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 1.35k]
  |  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|  1.35k|    ns = arg->nodesetval;
 5127|  1.35k|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 1.35k, False: 0]
  ------------------
 5128|  2.36k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 1.01k, False: 1.35k]
  ------------------
 5129|  1.01k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|  1.01k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 1.00k, False: 1]
  ------------------
 5131|  1.00k|		 xmlXPathValuePush(ctxt,
 5132|  1.00k|			   xmlXPathCacheNewString(ctxt, str2));
 5133|  1.00k|		 xmlFree(str2);
 5134|  1.00k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|  1.00k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|  1.00k|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 1.00k]
  ------------------
 5137|      0|		     break;
 5138|  1.00k|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|  1.01k|	}
 5142|  1.35k|    }
 5143|  1.35k|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|  1.35k|    xmlXPathReleaseObject(ctxt->context, s);
 5145|  1.35k|    return(ret);
 5146|  1.35k|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.25M|{
 1690|  1.25M|    xmlXPathObjectPtr ret;
 1691|  1.25M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.25M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.25M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.25M]
  ------------------
 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.25M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.25M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 455, False: 1.24M]
  ------------------
 1742|    455|        xmlXPathPErrMemory(pctxt);
 1743|  1.25M|    return(ret);
 1744|  1.25M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   487k|{
 1848|   487k|    xmlXPathObjectPtr ret;
 1849|   487k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   487k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 487k, False: 0]
  |  Branch (1851:27): [True: 0, False: 487k]
  ------------------
 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|   487k|    ret = xmlXPathNewFloat(val);
 1866|   487k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 143, False: 487k]
  ------------------
 1867|    143|        xmlXPathPErrMemory(pctxt);
 1868|   487k|    return(ret);
 1869|   487k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  6.99k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  6.99k|    xmlNodeSetPtr ret;
 6978|  6.99k|    const xmlChar *cur = ids;
 6979|  6.99k|    xmlChar *ID;
 6980|  6.99k|    xmlAttrPtr attr;
 6981|  6.99k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  6.99k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 18, False: 6.97k]
  ------------------
 6984|       |
 6985|  6.97k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  6.97k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 9, False: 6.96k]
  ------------------
 6987|      9|        return(ret);
 6988|       |
 6989|  6.96k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  15.7k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 8.82k, False: 6.95k]
  ------------------
 6991|  52.3k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|  52.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  52.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 4.10k, False: 48.2k]
  |  |  |  |  ------------------
  |  |  |  |   91|  52.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 44.2k, False: 4.00k]
  |  |  |  |  |  Branch (91:23): [True: 380, False: 43.8k]
  |  |  |  |  ------------------
  |  |  |  |   92|  52.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 336, False: 47.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 43.4k, False: 4.00k]
  ------------------
 6992|  43.4k|	    cur++;
 6993|       |
 6994|  8.82k|        ID = xmlStrndup(ids, cur - ids);
 6995|  8.82k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 17, False: 8.81k]
  ------------------
 6996|     17|            xmlXPathFreeNodeSet(ret);
 6997|     17|            return(NULL);
 6998|     17|        }
 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|  8.81k|        attr = xmlGetID(doc, ID);
 7007|  8.81k|        xmlFree(ID);
 7008|  8.81k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 2.29k, False: 6.51k]
  ------------------
 7009|  2.29k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 2.29k, False: 0]
  ------------------
 7010|  2.29k|                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|  2.29k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 2.29k, False: 0]
  ------------------
 7016|  2.29k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 1, False: 2.29k]
  ------------------
 7017|      1|                    xmlXPathFreeNodeSet(ret);
 7018|      1|                    return(NULL);
 7019|      1|                }
 7020|  2.29k|            }
 7021|  2.29k|        }
 7022|       |
 7023|  10.8k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  8.80k|	ids = cur;
 7025|  8.80k|    }
 7026|  6.95k|    return(ret);
 7027|  6.96k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.09M|{
 1621|  1.09M|    xmlXPathObjectPtr ret;
 1622|  1.09M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.09M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.09M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.09M]
  ------------------
 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.09M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.09M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 172, False: 1.09M]
  ------------------
 1641|    172|        xmlXPathPErrMemory(pctxt);
 1642|  1.09M|    return(ret);
 1643|  1.09M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  6.89k|{
 1800|  6.89k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  6.89k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  6.89k|}
xpath.c:xmlXPathCacheNewString:
 1756|   145k|{
 1757|   145k|    xmlXPathObjectPtr ret;
 1758|   145k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   145k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 145k, False: 0]
  |  Branch (1760:27): [True: 0, False: 145k]
  ------------------
 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|   145k|    ret = xmlXPathNewString(val);
 1784|   145k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 33, False: 145k]
  ------------------
 1785|     33|        xmlXPathPErrMemory(pctxt);
 1786|   145k|    return(ret);
 1787|   145k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  57.7k|{
 1656|  57.7k|    xmlXPathObjectPtr ret;
 1657|  57.7k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  57.7k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 57.7k, False: 0]
  |  Branch (1659:27): [True: 0, False: 57.7k]
  ------------------
 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|  57.7k|    ret = xmlXPathWrapString(val);
 1673|  57.7k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 47, False: 57.7k]
  ------------------
 1674|     47|        xmlXPathPErrMemory(pctxt);
 1675|  57.7k|    return(ret);
 1676|  57.7k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   611k|{
 1814|   611k|    xmlXPathObjectPtr ret;
 1815|   611k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   611k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 611k, False: 0]
  |  Branch (1817:27): [True: 0, False: 611k]
  ------------------
 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|   611k|    ret = xmlXPathNewBoolean(val);
 1832|   611k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 97, False: 611k]
  ------------------
 1833|     97|        xmlXPathPErrMemory(pctxt);
 1834|   611k|    return(ret);
 1835|   611k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  14.2M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  14.2M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  14.2M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 1, False: 14.2M]
  ------------------
  807|  14.2M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 110, False: 14.2M]
  ------------------
  808|    111|        xpctxt->opCount = xpctxt->opLimit;
  809|    111|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|    111|        return(-1);
  811|    111|    }
  812|       |
  813|  14.2M|    xpctxt->opCount += opCount;
  814|  14.2M|    return(0);
  815|  14.2M|}
xpath.c:xmlXPathCompileExpr:
 9088|  57.1k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  57.1k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  57.1k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 57.1k, False: 0]
  ------------------
 9092|  57.1k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  57.1k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 286, False: 56.8k]
  ------------------
 9093|  56.8k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    286|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  56.8k|        xpctxt->depth += 10;
 9099|  56.8k|    }
 9100|       |
 9101|  56.8k|    xmlXPathCompAndExpr(ctxt);
 9102|  56.8k|    CHECK_ERROR;
  ------------------
  |  |  230|  56.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.70k, False: 51.1k]
  |  |  ------------------
  ------------------
 9103|  51.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  51.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  56.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  56.8k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  56.8k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  5.84k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 5.84k, False: 51.0k]
  |  Branch (9104:28): [True: 5.83k, False: 14]
  ------------------
 9105|  5.83k|	int op1 = ctxt->comp->last;
 9106|  5.83k|        SKIP(2);
  ------------------
  |  | 2194|  5.83k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  5.83k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.83k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.53k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  5.83k|        xmlXPathCompAndExpr(ctxt);
 9109|  5.83k|	CHECK_ERROR;
  ------------------
  |  |  230|  5.83k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 127, False: 5.70k]
  |  |  ------------------
  ------------------
 9110|  5.70k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  5.70k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  5.70k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  5.70k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  5.70k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.70k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  5.70k|    }
 9113|  51.0k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 43.6k, False: 7.37k]
  |  Branch (9113:19): [True: 30.0k, False: 13.6k]
  ------------------
 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|  30.0k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  30.0k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  30.0k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  30.0k|    }
 9122|       |
 9123|  51.0k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 51.0k, False: 0]
  ------------------
 9124|  51.0k|        xpctxt->depth -= 10;
 9125|  51.0k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  62.7k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  62.7k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  62.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  62.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.78k, False: 56.9k]
  |  |  ------------------
  ------------------
 9065|  56.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  56.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  62.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  57.8k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  57.8k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|  1.03k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|  1.00k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 1.03k, False: 56.8k]
  |  Branch (9066:28): [True: 1.00k, False: 33]
  |  Branch (9066:47): [True: 1.00k, False: 4]
  ------------------
 9067|  1.00k|	int op1 = ctxt->comp->last;
 9068|  1.00k|        SKIP(3);
  ------------------
  |  | 2194|  1.00k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|  1.00k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.75k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.75k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.75k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|  1.00k|        xmlXPathCompEqualityExpr(ctxt);
 9071|  1.00k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.00k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 49, False: 953]
  |  |  ------------------
  ------------------
 9072|    953|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    953|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    953|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    953|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    953|	SKIP_BLANKS;
  ------------------
  |  | 2199|    953|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    953|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    953|    }
 9075|  56.9k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  63.7k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  63.7k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  63.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  63.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.01k, False: 58.6k]
  |  |  ------------------
  ------------------
 9036|  58.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  58.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  63.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|   107k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|   107k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  60.0k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  2.24k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 46.9k, False: 60.0k]
  |  Branch (9037:29): [True: 2.24k, False: 57.8k]
  |  Branch (9037:45): [True: 2.21k, False: 22]
  ------------------
 9038|  49.1k|	int eq;
 9039|  49.1k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  49.1k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  49.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 46.9k, False: 2.21k]
  ------------------
 9042|  2.21k|	else eq = 0;
 9043|  49.1k|	NEXT;
  ------------------
  |  | 2202|  49.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 49.1k, False: 0]
  |  |  ------------------
  ------------------
 9044|  49.1k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  2.21k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.21k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 2.21k, False: 46.9k]
  ------------------
 9045|  49.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  49.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  49.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 49.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  49.1k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  49.1k|	CHECK_ERROR;
  ------------------
  |  |  230|  49.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 817, False: 48.3k]
  |  |  ------------------
  ------------------
 9048|  48.3k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  48.3k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  48.3k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  48.3k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  48.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  48.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  48.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  48.3k|    }
 9051|  58.6k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|   112k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|   112k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|   112k|    CHECK_ERROR;
  ------------------
  |  |  230|   112k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.79k, False: 108k]
  |  |  ------------------
  ------------------
 8999|   108k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   108k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   112k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|   138k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   138k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   133k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 5.03k, False: 133k]
  |  Branch (9000:28): [True: 26.1k, False: 107k]
  ------------------
 9001|  31.2k|	int inf, strict;
 9002|  31.2k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  31.2k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  31.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 5.03k, False: 26.1k]
  ------------------
 9005|  26.1k|	else inf = 0;
 9006|  31.2k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  31.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 10.0k, False: 21.1k]
  ------------------
 9007|  21.1k|	else strict = 1;
 9008|  31.2k|	NEXT;
  ------------------
  |  | 2202|  31.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 31.2k, False: 0]
  |  |  ------------------
  ------------------
 9009|  31.2k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  10.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 10.0k, False: 21.1k]
  ------------------
 9010|  31.2k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  31.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.53k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.53k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  31.2k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  31.2k|	CHECK_ERROR;
  ------------------
  |  |  230|  31.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.03k, False: 30.1k]
  |  |  ------------------
  ------------------
 9013|  30.1k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  30.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  30.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  30.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  30.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  30.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  30.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  30.1k|    }
 9016|   108k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|   144k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|   144k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|   144k|    CHECK_ERROR;
  ------------------
  |  |  230|   144k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.98k, False: 139k]
  |  |  ------------------
  ------------------
 8962|   139k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   139k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   144k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   171k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   171k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   165k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 5.35k, False: 165k]
  |  Branch (8963:28): [True: 27.4k, False: 138k]
  ------------------
 8964|  32.7k|	int plus;
 8965|  32.7k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  32.7k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  32.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 5.35k, False: 27.4k]
  ------------------
 8968|  27.4k|	else plus = 0;
 8969|  32.7k|	NEXT;
  ------------------
  |  | 2202|  32.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 32.7k, False: 0]
  |  |  ------------------
  ------------------
 8970|  32.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  32.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.55k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.55k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  32.7k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  32.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  32.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 837, False: 31.9k]
  |  |  ------------------
  ------------------
 8973|  31.9k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  31.9k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  31.9k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  31.9k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  31.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  31.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  31.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  31.9k|    }
 8976|   139k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   176k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   176k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   176k|    CHECK_ERROR;
  ------------------
  |  |  230|   176k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.41k, False: 171k]
  |  |  ------------------
  ------------------
 8922|   171k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   171k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   176k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|   339k|    while ((CUR == '*') ||
  ------------------
  |  | 2193|   339k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 167k, False: 172k]
  ------------------
 8924|   172k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   172k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    651|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    620|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 651, False: 171k]
  |  Branch (8924:29): [True: 620, False: 31]
  |  Branch (8924:48): [True: 602, False: 18]
  ------------------
 8925|   171k|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   171k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    406|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    400|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 406, False: 171k]
  |  Branch (8925:29): [True: 400, False: 6]
  |  Branch (8925:48): [True: 393, False: 7]
  ------------------
 8926|   168k|	int op = -1;
 8927|   168k|	int op1 = ctxt->comp->last;
 8928|       |
 8929|   168k|        if (CUR == '*') {
  ------------------
  |  | 2193|   168k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 167k, False: 995]
  ------------------
 8930|   167k|	    op = 0;
 8931|   167k|	    NEXT;
  ------------------
  |  | 2202|   167k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 167k, False: 0]
  |  |  ------------------
  ------------------
 8932|   167k|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|    995|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 602, False: 393]
  ------------------
 8933|    602|	    op = 1;
 8934|    602|	    SKIP(3);
  ------------------
  |  | 2194|    602|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    602|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    393|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 393, False: 0]
  ------------------
 8936|    393|	    op = 2;
 8937|    393|	    SKIP(3);
  ------------------
  |  | 2194|    393|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    393|	}
 8939|   168k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   168k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|   168k|        xmlXPathCompUnaryExpr(ctxt);
 8941|   168k|	CHECK_ERROR;
  ------------------
  |  |  230|   168k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 411, False: 167k]
  |  |  ------------------
  ------------------
 8942|   167k|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|   167k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|   167k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|   167k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|   167k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   167k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   167k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|   167k|    }
 8945|   171k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|   345k|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|   345k|    int minus = 0;
 8886|   345k|    int found = 0;
 8887|       |
 8888|   345k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   345k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|   403k|    while (CUR == '-') {
  ------------------
  |  | 2193|   403k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 57.8k, False: 345k]
  ------------------
 8890|  57.8k|        minus = 1 - minus;
 8891|  57.8k|	found = 1;
 8892|  57.8k|	NEXT;
  ------------------
  |  | 2202|  57.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 57.8k, False: 0]
  |  |  ------------------
  ------------------
 8893|  57.8k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  57.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.58k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.58k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  57.8k|    }
 8895|       |
 8896|   345k|    xmlXPathCompUnionExpr(ctxt);
 8897|   345k|    CHECK_ERROR;
  ------------------
  |  |  230|   345k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.81k, False: 339k]
  |  |  ------------------
  ------------------
 8898|   339k|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 31.8k, False: 307k]
  ------------------
 8899|  31.8k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 22.5k, False: 9.29k]
  ------------------
 8900|  22.5k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  22.5k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  22.5k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  9.29k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  9.29k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  9.29k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  31.8k|    }
 8904|   339k|}
xpath.c:xmlXPathCompUnionExpr:
 8856|   345k|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|   345k|    xmlXPathCompPathExpr(ctxt);
 8858|   345k|    CHECK_ERROR;
  ------------------
  |  |  230|   345k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.64k, False: 339k]
  |  |  ------------------
  ------------------
 8859|   339k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   339k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   345k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|   349k|    while (CUR == '|') {
  ------------------
  |  | 2193|   349k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 10.1k, False: 339k]
  ------------------
 8861|  10.1k|	int op1 = ctxt->comp->last;
 8862|  10.1k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  10.1k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  10.1k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  10.1k|	NEXT;
  ------------------
  |  | 2202|  10.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.1k, False: 0]
  |  |  ------------------
  ------------------
 8865|  10.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.03k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.03k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  10.1k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  10.1k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  10.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  10.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  10.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  10.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.1k|    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|  10.1k|    }
 8872|   339k|}
xpath.c:xmlXPathCompPathExpr:
 8734|   355k|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|   355k|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|   355k|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|   355k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   355k|    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|   355k|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   355k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   353k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 1.38k, False: 353k]
  |  Branch (8739:25): [True: 3.78k, False: 350k]
  ------------------
 8740|   350k|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|   350k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 139k, False: 210k]
  |  |  |  Branch (230:45): [True: 71.1k, False: 68.2k]
  |  |  ------------------
  ------------------
 8741|   278k|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   278k|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   277k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.54k, False: 277k]
  |  Branch (8741:26): [True: 84, False: 277k]
  ------------------
 8742|   277k|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|   277k|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  11.7k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 7.79k, False: 4.00k]
  |  |  |  Branch (230:45): [True: 2.60k, False: 5.18k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 11.7k, False: 265k]
  ------------------
 8743|  80.5k|	lc = 0;
 8744|   274k|    } else if (CUR == '*') {
  ------------------
  |  | 2193|   274k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 162k, False: 112k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   162k|	lc = 1;
 8747|   162k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   112k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 34.7k, False: 77.7k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  34.7k|	lc = 1;
 8750|  77.7k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  77.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 527, False: 77.2k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|    527|	lc = 1;
 8753|  77.2k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  77.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 9.19k, False: 68.0k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  9.19k|	lc = 1;
 8756|  68.0k|    } 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|  68.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  68.0k|    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|  68.0k|	name = xmlXPathScanName(ctxt);
 8770|  68.0k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 65.0k, False: 2.96k]
  |  Branch (8770:24): [True: 1.52k, False: 63.5k]
  ------------------
 8771|  1.52k|	    lc = 1;
 8772|  1.52k|	    xmlFree(name);
 8773|  66.5k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 63.5k, False: 2.96k]
  ------------------
 8774|  63.5k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   423k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   423k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 422k, False: 978]
  ------------------
 8778|   422k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   422k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.51k, False: 419k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.51k|		    lc = 1;
 8781|  3.51k|		    break;
 8782|   419k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   419k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   419k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 358k, False: 60.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|   419k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 60.5k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.33k, False: 59.2k]
  |  |  |  |  ------------------
  |  |  |  |   92|   419k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 151, False: 59.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   360k|		    ;
 8785|   360k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  59.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 657, False: 58.4k]
  ------------------
 8786|    657|		    lc = 1;
 8787|    657|		    break;
 8788|  58.4k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  58.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 9.76k, False: 48.6k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  9.76k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 251, False: 9.50k]
  ------------------
 8791|    251|			lc = 1;
 8792|  9.50k|		    } else {
 8793|  9.50k|			lc = 0;
 8794|  9.50k|		    }
 8795|  9.76k|                    break;
 8796|  48.6k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  48.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 958, False: 47.6k]
  ------------------
 8797|       |		    /* element name */
 8798|    958|		    lc = 1;
 8799|    958|		    break;
 8800|  47.6k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  47.6k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  46.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 688, False: 46.9k]
  |  Branch (8800:35): [True: 8.02k, False: 38.9k]
  ------------------
 8801|  38.9k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  38.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 8.19k, False: 30.7k]
  ------------------
 8802|  16.9k|		    lc = 1;
 8803|  16.9k|		    break;
 8804|  30.7k|		} else {
 8805|  30.7k|		    lc = 1;
 8806|  30.7k|		    break;
 8807|  30.7k|		}
 8808|   360k|		len++;
 8809|   360k|	    }
 8810|  63.5k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  63.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 978, False: 62.5k]
  ------------------
 8811|       |		/* element name */
 8812|    978|		lc = 1;
 8813|    978|	    }
 8814|  63.5k|	    xmlFree(name);
 8815|  63.5k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  2.96k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  2.96k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  68.0k|    }
 8820|       |
 8821|   352k|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 262k, False: 90.0k]
  ------------------
 8822|   262k|	if (CUR == '/') {
  ------------------
  |  | 2193|   262k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 34.7k, False: 227k]
  ------------------
 8823|  34.7k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  34.7k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  34.7k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|   227k|	} else {
 8825|   227k|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|   227k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|   227k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|   227k|	}
 8827|   262k|	xmlXPathCompLocationPath(ctxt);
 8828|   262k|    } else {
 8829|  90.0k|	xmlXPathCompFilterExpr(ctxt);
 8830|  90.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  90.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.24k, False: 87.8k]
  |  |  ------------------
  ------------------
 8831|  87.8k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  87.8k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.56k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.56k, False: 85.2k]
  |  Branch (8831:22): [True: 770, False: 1.79k]
  ------------------
 8832|    770|	    SKIP(2);
  ------------------
  |  | 2194|    770|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    770|	    SKIP_BLANKS;
  ------------------
  |  | 2199|    936|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    936|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 936, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    770|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    770|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    770|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    770|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    770|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  87.0k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  87.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.79k, False: 85.2k]
  ------------------
 8840|  1.79k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.79k|	}
 8842|  87.8k|    }
 8843|   350k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   350k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   357k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|   350k|}
xpath.c:xmlXPathScanName:
 8705|  68.0k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  68.0k|    const xmlChar *end;
 8707|  68.0k|    xmlChar *ret;
 8708|       |
 8709|  68.0k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  68.0k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  68.0k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 3, False: 68.0k]
  ------------------
 8711|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  68.0k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 2.89k, False: 65.1k]
  ------------------
 8714|  2.89k|        return(NULL);
 8715|       |
 8716|  65.1k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  65.1k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 60, False: 65.0k]
  ------------------
 8718|     60|        xmlXPathPErrMemory(ctxt);
 8719|  65.1k|    return(ret);
 8720|  68.0k|}
xpath.c:xmlXPathCompLocationPath:
 9524|   262k|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|   262k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   262k|    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|   262k|    if (CUR != '/') {
  ------------------
  |  | 2193|   262k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 227k, False: 34.7k]
  ------------------
 9527|   227k|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|   227k|    } else {
 9529|  71.8k|	while (CUR == '/') {
  ------------------
  |  | 2193|  71.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 37.5k, False: 34.3k]
  ------------------
 9530|  37.5k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  37.5k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  37.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 37.5k, False: 0]
  |  Branch (9530:26): [True: 11.6k, False: 25.8k]
  ------------------
 9531|  11.6k|		SKIP(2);
  ------------------
  |  | 2194|  11.6k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  11.6k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  11.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.87k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  11.6k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  11.6k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  11.6k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  11.6k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  11.6k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  25.8k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  25.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 25.8k, False: 0]
  ------------------
 9537|  25.8k|		NEXT;
  ------------------
  |  | 2202|  25.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.8k, False: 0]
  |  |  ------------------
  ------------------
 9538|  25.8k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  35.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 35.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  25.8k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  25.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 25.1k, False: 715]
  ------------------
 9540|  25.1k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  25.1k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.62k, False: 16.5k]
  |  |  ------------------
  |  |  223|  25.1k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.80k, False: 1.82k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  18.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 321, False: 18.0k]
  ------------------
 9541|  18.0k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  18.0k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  17.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 553, False: 17.4k]
  |  Branch (9541:38): [True: 6.21k, False: 11.2k]
  ------------------
 9542|  11.2k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  11.2k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  10.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 284, False: 10.9k]
  |  Branch (9542:24): [True: 4.96k, False: 6.01k]
  ------------------
 9543|  19.1k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  25.8k|	    }
 9545|  37.5k|	    CHECK_ERROR;
  ------------------
  |  |  230|  37.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 414, False: 37.0k]
  |  |  ------------------
  ------------------
 9546|  37.5k|	}
 9547|  34.7k|    }
 9548|   262k|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  90.0k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  90.0k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  90.0k|    CHECK_ERROR;
  ------------------
  |  |  230|  90.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.68k, False: 88.3k]
  |  |  ------------------
  ------------------
 8686|  88.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  88.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  90.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|   104k|    while (CUR == '[') {
  ------------------
  |  | 2193|   104k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 15.9k, False: 88.3k]
  ------------------
 8689|  15.9k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  15.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  15.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8691|  15.9k|    }
 8692|       |
 8693|       |
 8694|  88.3k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  90.0k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  90.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  90.0k|    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|  90.0k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  90.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 1.38k, False: 88.6k]
  ------------------
 8648|  88.6k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  88.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 3.78k, False: 84.8k]
  ------------------
 8649|  3.78k|	NEXT;
  ------------------
  |  | 2202|  3.78k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.78k, False: 0]
  |  |  ------------------
  ------------------
 8650|  3.78k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.40k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.40k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.40k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  3.78k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  3.78k|	CHECK_ERROR;
  ------------------
  |  |  230|  3.78k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 450, False: 3.33k]
  |  |  ------------------
  ------------------
 8653|  3.33k|	if (CUR != ')') {
  ------------------
  |  | 2193|  3.33k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 68, False: 3.26k]
  ------------------
 8654|     68|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     68|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  3.26k|	NEXT;
  ------------------
  |  | 2202|  3.26k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.26k, False: 0]
  |  |  ------------------
  ------------------
 8657|  3.26k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  11.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  14.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  84.8k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   169k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 80.6k, False: 4.23k]
  |  |  |  Branch (230:45): [True: 71.1k, False: 9.50k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  13.7k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.60k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.60k, False: 0]
  |  |  |  Branch (230:45): [True: 2.60k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.60k, False: 11.1k]
  ------------------
 8659|  73.7k|	xmlXPathCompNumber(ctxt);
 8660|  73.7k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.1k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  9.59k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.54k, False: 9.59k]
  |  Branch (8660:33): [True: 84, False: 9.50k]
  ------------------
 8661|  1.63k|	xmlXPathCompLiteral(ctxt);
 8662|  9.50k|    } else {
 8663|  9.50k|	xmlXPathCompFunctionCall(ctxt);
 8664|  9.50k|    }
 8665|  89.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   121k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   211k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 121k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  89.5k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  1.38k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  1.38k|    xmlChar *name;
 8513|  1.38k|    xmlChar *prefix;
 8514|       |
 8515|  1.38k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.38k|    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.38k|    if (CUR != '$') {
  ------------------
  |  | 2193|  1.38k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 1.38k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  1.38k|    NEXT;
  ------------------
  |  | 2202|  1.38k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.38k, False: 0]
  |  |  ------------------
  ------------------
 8520|  1.38k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  1.38k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 38, False: 1.34k]
  ------------------
 8522|     38|        xmlFree(prefix);
 8523|     38|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     38|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|  1.34k|    ctxt->comp->last = -1;
 8526|  1.34k|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  1.34k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.34k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 3, False: 1.34k]
  ------------------
 8527|      3|        xmlFree(prefix);
 8528|      3|        xmlFree(name);
 8529|      3|    }
 8530|  1.34k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  6.17k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.52k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.17k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|  1.34k|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|  1.34k|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 1.34k, False: 0]
  |  Branch (8531:36): [True: 0, False: 1.34k]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|  1.34k|}
xpath.c:xmlXPathParseQName:
 8178|  10.8k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  10.8k|    xmlChar *ret = NULL;
 8180|       |
 8181|  10.8k|    *prefix = NULL;
 8182|  10.8k|    ret = xmlXPathParseNCName(ctxt);
 8183|  10.8k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  10.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 10.8k, False: 57]
  |  Branch (8183:16): [True: 1.05k, False: 9.78k]
  ------------------
 8184|  1.05k|        *prefix = ret;
 8185|  1.05k|	NEXT;
  ------------------
  |  | 2202|  1.05k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.05k, False: 0]
  |  |  ------------------
  ------------------
 8186|  1.05k|	ret = xmlXPathParseNCName(ctxt);
 8187|  1.05k|    }
 8188|  10.8k|    return(ret);
 8189|  10.8k|}
xpath.c:xmlXPathCompNumber:
 8337|  73.7k|{
 8338|  73.7k|    double ret = 0.0;
 8339|  73.7k|    int ok = 0;
 8340|  73.7k|    int exponent = 0;
 8341|  73.7k|    int is_exponent_negative = 0;
 8342|  73.7k|    xmlXPathObjectPtr num;
 8343|  73.7k|#ifdef __GNUC__
 8344|  73.7k|    unsigned long tmp = 0;
 8345|  73.7k|    double temp;
 8346|  73.7k|#endif
 8347|       |
 8348|  73.7k|    CHECK_ERROR;
  ------------------
  |  |  230|  73.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 31, False: 73.7k]
  |  |  ------------------
  ------------------
 8349|  73.7k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  73.7k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  71.0k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  71.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 71.0k, False: 2.60k]
  |  Branch (8349:26): [True: 0, False: 71.0k]
  |  Branch (8349:41): [True: 0, False: 71.0k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  73.7k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  73.7k|    ret = 0;
 8358|   283k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   283k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   242k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 242k, False: 41.4k]
  |  Branch (8358:28): [True: 209k, False: 32.2k]
  ------------------
 8359|   209k|	ret = ret * 10;
 8360|   209k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|   209k|#define CUR (*ctxt->cur)
  ------------------
 8361|   209k|        ok = 1;
 8362|   209k|        NEXT;
  ------------------
  |  | 2202|   209k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 209k, False: 0]
  |  |  ------------------
  ------------------
 8363|   209k|	temp = (double) tmp;
 8364|   209k|	ret = ret + temp;
 8365|   209k|    }
 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|  73.7k|    if (CUR == '.') {
  ------------------
  |  | 2193|  73.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 11.2k, False: 62.4k]
  ------------------
 8375|  11.2k|	int v, frac = 0, max;
 8376|  11.2k|	double fraction = 0;
 8377|       |
 8378|  11.2k|        NEXT;
  ------------------
  |  | 2202|  11.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.2k, False: 0]
  |  |  ------------------
  ------------------
 8379|  11.2k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  11.2k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  10.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 845, False: 10.4k]
  |  Branch (8379:29): [True: 1.55k, False: 8.85k]
  |  Branch (8379:45): [True: 0, False: 2.40k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  16.2k|        while (CUR == '0') {
  ------------------
  |  | 2193|  16.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 4.94k, False: 11.2k]
  ------------------
 8383|  4.94k|            frac = frac + 1;
 8384|  4.94k|            NEXT;
  ------------------
  |  | 2202|  4.94k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.94k, False: 0]
  |  |  ------------------
  ------------------
 8385|  4.94k|        }
 8386|  11.2k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  11.2k|#define MAX_FRAC 20
  ------------------
 8387|  36.7k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  36.7k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  34.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 34.2k, False: 2.58k]
  |  Branch (8387:32): [True: 25.6k, False: 8.59k]
  |  Branch (8387:48): [True: 25.5k, False: 78]
  ------------------
 8388|  25.5k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  25.5k|#define CUR (*ctxt->cur)
  ------------------
 8389|  25.5k|	    fraction = fraction * 10 + v;
 8390|  25.5k|	    frac = frac + 1;
 8391|  25.5k|            NEXT;
  ------------------
  |  | 2202|  25.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.5k, False: 0]
  |  |  ------------------
  ------------------
 8392|  25.5k|        }
 8393|  11.2k|        fraction /= pow(10.0, frac);
 8394|  11.2k|        ret = ret + fraction;
 8395|  12.0k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  12.0k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  9.43k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 9.43k, False: 2.64k]
  |  Branch (8395:32): [True: 814, False: 8.61k]
  ------------------
 8396|    814|            NEXT;
  ------------------
  |  | 2202|  12.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 814, False: 0]
  |  |  ------------------
  ------------------
 8397|  11.2k|    }
 8398|  73.7k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  73.7k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  72.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 787, False: 72.9k]
  |  Branch (8398:25): [True: 11.1k, False: 61.7k]
  ------------------
 8399|  11.9k|        NEXT;
  ------------------
  |  | 2202|  11.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.9k, False: 0]
  |  |  ------------------
  ------------------
 8400|  11.9k|        if (CUR == '-') {
  ------------------
  |  | 2193|  11.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 578, False: 11.3k]
  ------------------
 8401|    578|            is_exponent_negative = 1;
 8402|    578|            NEXT;
  ------------------
  |  | 2202|    578|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 578, False: 0]
  |  |  ------------------
  ------------------
 8403|  11.3k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  11.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 742, False: 10.6k]
  ------------------
 8404|    742|	    NEXT;
  ------------------
  |  | 2202|    742|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 742, False: 0]
  |  |  ------------------
  ------------------
 8405|    742|	}
 8406|  93.9k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  93.9k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  90.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 90.2k, False: 3.65k]
  |  Branch (8406:32): [True: 81.9k, False: 8.27k]
  ------------------
 8407|  81.9k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 63.7k, False: 18.2k]
  ------------------
 8408|  63.7k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  63.7k|#define CUR (*ctxt->cur)
  ------------------
 8409|  81.9k|            NEXT;
  ------------------
  |  | 2202|  81.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 81.9k, False: 0]
  |  |  ------------------
  ------------------
 8410|  81.9k|        }
 8411|  11.9k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 578, False: 11.3k]
  ------------------
 8412|    578|            exponent = -exponent;
 8413|  11.9k|        ret *= pow(10.0, (double) exponent);
 8414|  11.9k|    }
 8415|  73.7k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  73.7k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 44, False: 73.6k]
  ------------------
 8417|     44|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  73.6k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  73.6k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  73.6k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 16, False: 73.6k]
  ------------------
 8419|  73.6k|                              NULL) == -1) {
 8420|     16|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     16|    }
 8422|  73.7k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.63k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.63k|    xmlChar *ret = NULL;
 8480|  1.63k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.63k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.63k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 133, False: 1.49k]
  ------------------
 8484|    133|        return;
 8485|  1.49k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.49k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 7, False: 1.49k]
  ------------------
 8487|      7|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.49k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.49k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.49k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 4, False: 1.48k]
  ------------------
 8489|  1.49k|                              NULL) == -1) {
 8490|      4|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      4|    }
 8492|  1.49k|    xmlFree(ret);
 8493|  1.49k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.73k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.73k|    const xmlChar *q;
 8436|  1.73k|    xmlChar *ret = NULL;
 8437|  1.73k|    int quote;
 8438|       |
 8439|  1.73k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.73k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 84, False: 1.64k]
  ------------------
 8440|     84|        quote = '"';
 8441|  1.64k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.64k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.64k, False: 7]
  ------------------
 8442|  1.64k|        quote = '\'';
 8443|  1.64k|    } else {
 8444|      7|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      7|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.72k|    NEXT;
  ------------------
  |  | 2202|  1.72k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.72k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.72k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.72k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  19.2k|    while (CUR != quote) {
  ------------------
  |  | 2193|  19.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 17.6k, False: 1.59k]
  ------------------
 8450|  17.6k|        int ch;
 8451|  17.6k|        int len = 4;
 8452|       |
 8453|  17.6k|        if (CUR == 0)
  ------------------
  |  | 2193|  17.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 124, False: 17.5k]
  ------------------
 8454|  17.5k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    124|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  17.5k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  17.5k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  17.5k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  17.5k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  17.5k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 17.0k, False: 480]
  |  |  |  |  ------------------
  |  |  |  |  118|  17.5k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  17.0k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 17.0k, False: 6]
  |  |  |  |  |  |  |  Branch (108:44): [True: 232, False: 16.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  17.0k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 125, False: 16.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  17.0k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 16.7k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  17.5k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 480, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 165, False: 315]
  |  |  |  |  ------------------
  |  |  |  |  120|    480|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 315, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 83, False: 232]
  |  |  |  |  ------------------
  |  |  |  |  121|    480|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 232, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 232, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 17.5k]
  |  Branch (8456:25): [True: 6, False: 17.5k]
  ------------------
 8457|  17.5k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|      9|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  17.5k|        CUR_PTR += len;
  ------------------
  |  | 2196|  17.5k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  17.5k|    }
 8460|  1.59k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.59k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.59k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 4, False: 1.58k]
  ------------------
 8462|      4|        xmlXPathPErrMemory(ctxt);
 8463|  1.59k|    NEXT;
  ------------------
  |  | 2202|  1.59k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.59k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.59k|    return(ret);
 8465|  1.72k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  9.50k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  9.50k|    xmlChar *name;
 8575|  9.50k|    xmlChar *prefix;
 8576|  9.50k|    int nbargs = 0;
 8577|  9.50k|    int sort = 1;
 8578|       |
 8579|  9.50k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  9.50k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 21, False: 9.48k]
  ------------------
 8581|     21|	xmlFree(prefix);
 8582|     21|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     21|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  9.48k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   202k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   211k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 202k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  9.48k|    if (CUR != '(') {
  ------------------
  |  | 2193|  9.48k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 3, False: 9.48k]
  ------------------
 8587|      3|	xmlFree(name);
 8588|      3|	xmlFree(prefix);
 8589|      3|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8590|      0|    }
 8591|  9.48k|    NEXT;
  ------------------
  |  | 2202|  9.48k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.48k, False: 0]
  |  |  ------------------
  ------------------
 8592|  9.48k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  80.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  90.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 80.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  9.48k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 8.80k, False: 678]
  |  Branch (8597:29): [True: 1.11k, False: 7.69k]
  ------------------
 8598|  1.11k|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|  1.11k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 57, False: 1.05k]
  ------------------
 8599|     57|    {
 8600|     57|	sort = 0;
 8601|     57|    }
 8602|  9.48k|    ctxt->comp->last = -1;
 8603|  9.48k|    if (CUR != ')') {
  ------------------
  |  | 2193|  9.48k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 7.93k, False: 1.55k]
  ------------------
 8604|  12.2k|	while (CUR != 0) {
  ------------------
  |  | 2193|  12.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 12.2k, False: 3]
  ------------------
 8605|  12.2k|	    int op1 = ctxt->comp->last;
 8606|  12.2k|	    ctxt->comp->last = -1;
 8607|  12.2k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  12.2k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 742, False: 11.4k]
  ------------------
 8609|    742|		xmlFree(name);
 8610|    742|		xmlFree(prefix);
 8611|    742|		return;
 8612|    742|	    }
 8613|  11.4k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  11.4k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  11.4k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  11.4k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  11.4k|	    nbargs++;
 8615|  11.4k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  11.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 7.08k, False: 4.41k]
  ------------------
 8616|  4.41k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  4.41k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 104, False: 4.30k]
  ------------------
 8617|    104|		xmlFree(name);
 8618|    104|		xmlFree(prefix);
 8619|    104|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    104|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  4.30k|	    NEXT;
  ------------------
  |  | 2202|  4.30k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.30k, False: 0]
  |  |  ------------------
  ------------------
 8622|  4.30k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  4.30k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.00k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  4.30k|	}
 8624|  7.93k|    }
 8625|  8.63k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  8.63k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  8.63k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 2, False: 8.63k]
  ------------------
 8626|      2|        xmlFree(prefix);
 8627|      2|        xmlFree(name);
 8628|      2|    }
 8629|  8.63k|    NEXT;
  ------------------
  |  | 2202|  8.63k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.63k, False: 3]
  |  |  ------------------
  ------------------
 8630|  8.63k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  74.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  83.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 74.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  8.63k|}
xpath.c:xmlXPathCompPredicate:
 9137|  25.1k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  25.1k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  25.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.1k|    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|  25.1k|    if (CUR != '[') {
  ------------------
  |  | 2193|  25.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 25.1k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  25.1k|    NEXT;
  ------------------
  |  | 2202|  25.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.1k, False: 0]
  |  |  ------------------
  ------------------
 9145|  25.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  47.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 21.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  25.1k|    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|  25.1k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 9.27k, False: 15.9k]
  ------------------
 9158|  9.27k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  15.9k|    else
 9160|  15.9k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  25.1k|    CHECK_ERROR;
  ------------------
  |  |  230|  25.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 3.02k, False: 22.1k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  22.1k|    if (CUR != ']') {
  ------------------
  |  | 2193|  22.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 235, False: 21.9k]
  ------------------
 9164|    235|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    235|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  21.9k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 14.7k, False: 7.13k]
  ------------------
 9168|  14.7k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  14.7k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  14.7k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  14.7k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  7.13k|    else
 9170|  7.13k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.13k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.13k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.13k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  21.9k|    NEXT;
  ------------------
  |  | 2202|  21.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 21.9k, False: 0]
  |  |  ------------------
  ------------------
 9173|  21.9k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  36.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  58.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 36.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  21.9k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|   260k|(xmlXPathParserContextPtr ctxt) {
 9482|   260k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   260k|    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|   260k|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|   260k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.80k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.80k, False: 253k]
  |  Branch (9483:25): [True: 3.59k, False: 4.20k]
  ------------------
 9484|  3.59k|	SKIP(2);
  ------------------
  |  | 2194|  3.59k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.59k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  11.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  11.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.59k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.59k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.59k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.59k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|   257k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   257k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 4.20k, False: 253k]
  ------------------
 9489|  4.20k|	    NEXT;
  ------------------
  |  | 2202|  4.20k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.20k, False: 0]
  |  |  ------------------
  ------------------
 9490|  4.20k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  10.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  4.20k|    }
 9492|   260k|    xmlXPathCompStep(ctxt);
 9493|   260k|    CHECK_ERROR;
  ------------------
  |  |  230|   260k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.33k, False: 259k]
  |  |  ------------------
  ------------------
 9494|   259k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   259k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   260k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|   276k|    while (CUR == '/') {
  ------------------
  |  | 2193|   276k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 16.5k, False: 259k]
  ------------------
 9496|  16.5k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  16.5k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  16.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 16.5k, False: 0]
  |  Branch (9496:22): [True: 5.96k, False: 10.6k]
  ------------------
 9497|  5.96k|	    SKIP(2);
  ------------------
  |  | 2194|  5.96k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  5.96k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.87k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.87k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.87k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  5.96k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  5.96k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.96k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  5.96k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  5.96k|	    xmlXPathCompStep(ctxt);
 9502|  10.6k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  10.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 10.6k, False: 0]
  ------------------
 9503|  10.6k|	    NEXT;
  ------------------
  |  | 2202|  10.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.6k, False: 0]
  |  |  ------------------
  ------------------
 9504|  10.6k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  10.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.64k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.64k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  10.6k|	    xmlXPathCompStep(ctxt);
 9506|  10.6k|	}
 9507|  16.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  16.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.42k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.42k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  16.5k|    }
 9509|   259k|}
xpath.c:xmlXPathCompStep:
 9390|   277k|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|   277k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   277k|    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|   277k|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|   277k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  27.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 27.4k, False: 250k]
  |  Branch (9392:25): [True: 7.11k, False: 20.3k]
  ------------------
 9393|  7.11k|	SKIP(2);
  ------------------
  |  | 2194|  7.11k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  7.11k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.11k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.18k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.18k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  7.11k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  7.11k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  7.11k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  7.11k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|   270k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|   270k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 20.3k, False: 250k]
  ------------------
 9398|  20.3k|	NEXT;
  ------------------
  |  | 2202|  20.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 20.3k, False: 0]
  |  |  ------------------
  ------------------
 9399|  20.3k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  20.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|   250k|    } else {
 9401|   250k|	xmlChar *name = NULL;
 9402|   250k|	xmlChar *prefix = NULL;
 9403|   250k|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|   250k|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|   250k|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|   250k|	int op1;
 9407|       |
 9408|   250k|	if (CUR == '*') {
  ------------------
  |  | 2193|   250k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 172k, False: 77.6k]
  ------------------
 9409|   172k|	    axis = AXIS_CHILD;
 9410|   172k|	} else {
 9411|  77.6k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 77.6k, False: 0]
  ------------------
 9412|  77.6k|		name = xmlXPathParseNCName(ctxt);
 9413|  77.6k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 73.4k, False: 4.10k]
  ------------------
 9414|  73.4k|		axis = xmlXPathIsAxisName(name);
 9415|  73.4k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 4.07k, False: 69.4k]
  ------------------
 9416|  4.07k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  35.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  35.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 35.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  4.07k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  4.07k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  2.91k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 2.91k, False: 1.16k]
  |  Branch (9417:27): [True: 2.82k, False: 94]
  ------------------
 9418|  2.82k|			SKIP(2);
  ------------------
  |  | 2194|  2.82k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.82k|			xmlFree(name);
 9420|  2.82k|			name = NULL;
 9421|  2.82k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  1.25k|			axis = AXIS_CHILD;
 9424|  1.25k|		    }
 9425|  69.4k|		} else {
 9426|  69.4k|		    axis = AXIS_CHILD;
 9427|  69.4k|		}
 9428|  73.4k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  4.10k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 3.31k, False: 786]
  ------------------
 9429|  3.31k|		NEXT;
  ------------------
  |  | 2202|  3.31k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.31k, False: 0]
  |  |  ------------------
  ------------------
 9430|  3.31k|		axis = AXIS_ATTRIBUTE;
 9431|  3.31k|	    } else {
 9432|    786|		axis = AXIS_CHILD;
 9433|    786|	    }
 9434|  77.6k|	}
 9435|       |
 9436|   250k|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 894, False: 249k]
  ------------------
 9437|    894|            xmlFree(name);
 9438|    894|            return;
 9439|    894|        }
 9440|       |
 9441|   249k|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|   249k|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 414, False: 248k]
  ------------------
 9443|    414|	    return;
 9444|       |
 9445|   248k|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 2.83k, False: 245k]
  |  Branch (9445:33): [True: 2.83k, False: 0]
  ------------------
 9446|  2.83k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  2.83k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 2.83k]
  ------------------
 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|   248k|	op1 = ctxt->comp->last;
 9454|   248k|	ctxt->comp->last = -1;
 9455|       |
 9456|   248k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   248k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   261k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|   258k|	while (CUR == '[') {
  ------------------
  |  | 2193|   258k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 9.27k, False: 248k]
  ------------------
 9458|  9.27k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  9.27k|	}
 9460|       |
 9461|   248k|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|   248k|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|   248k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 31, False: 248k]
  ------------------
 9462|   248k|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     31|            xmlFree(prefix);
 9464|     31|            xmlFree(name);
 9465|     31|        }
 9466|   248k|    }
 9467|   277k|}
xpath.c:xmlXPathIsAxisName:
 9321|  73.4k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  73.4k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  73.4k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 25.2k, False: 48.2k]
  ------------------
 9324|  8.64k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 8.64k, False: 64.8k]
  ------------------
 9325|  8.64k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  8.64k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.11k, False: 7.52k]
  ------------------
 9326|  1.11k|		ret = AXIS_ANCESTOR;
 9327|  8.64k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  8.64k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 696, False: 7.94k]
  ------------------
 9328|    696|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  8.64k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  8.64k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 69, False: 8.57k]
  ------------------
 9330|     69|		ret = AXIS_ATTRIBUTE;
 9331|  8.64k|	    break;
 9332|  2.14k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 2.14k, False: 71.3k]
  ------------------
 9333|  2.14k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  2.14k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 12, False: 2.13k]
  ------------------
 9334|     12|		ret = AXIS_CHILD;
 9335|  2.14k|	    break;
 9336|  1.45k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.45k, False: 72.0k]
  ------------------
 9337|  1.45k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.45k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 34, False: 1.42k]
  ------------------
 9338|     34|		ret = AXIS_DESCENDANT;
 9339|  1.45k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.45k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 10, False: 1.44k]
  ------------------
 9340|     10|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.45k|	    break;
 9342|  2.05k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 2.05k, False: 71.4k]
  ------------------
 9343|  2.05k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  2.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 273, False: 1.77k]
  ------------------
 9344|    273|		ret = AXIS_FOLLOWING;
 9345|  2.05k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  2.05k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 68, False: 1.98k]
  ------------------
 9346|     68|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  2.05k|	    break;
 9348|  6.28k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 6.28k, False: 67.2k]
  ------------------
 9349|  6.28k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  6.28k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 476, False: 5.80k]
  ------------------
 9350|    476|		ret = AXIS_NAMESPACE;
 9351|  6.28k|	    break;
 9352|  2.04k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 2.04k, False: 71.4k]
  ------------------
 9353|  2.04k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  2.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 292, False: 1.75k]
  ------------------
 9354|    292|		ret = AXIS_PARENT;
 9355|  2.04k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  2.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 64, False: 1.97k]
  ------------------
 9356|     64|		ret = AXIS_PRECEDING;
 9357|  2.04k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  2.04k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 7, False: 2.03k]
  ------------------
 9358|      7|		ret = AXIS_PRECEDING_SIBLING;
 9359|  2.04k|	    break;
 9360|  2.59k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.59k, False: 70.9k]
  ------------------
 9361|  2.59k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.59k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 959, False: 1.63k]
  ------------------
 9362|    959|		ret = AXIS_SELF;
 9363|  2.59k|	    break;
 9364|  73.4k|    }
 9365|  73.4k|    return(ret);
 9366|  73.4k|}
xpath.c:xmlXPathCompNodeTest:
 9201|   249k|		     xmlChar *name) {
 9202|   249k|    int blanks;
 9203|       |
 9204|   249k|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 249k]
  |  Branch (9204:27): [True: 0, False: 249k]
  |  Branch (9204:45): [True: 0, False: 249k]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|   249k|    *type = (xmlXPathTypeVal) 0;
 9208|   249k|    *test = (xmlXPathTestVal) 0;
 9209|   249k|    *prefix = NULL;
 9210|   249k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   249k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   401k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 152k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|   249k|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|   178k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 178k, False: 70.2k]
  |  Branch (9212:27): [True: 173k, False: 5.85k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|   173k|	NEXT;
  ------------------
  |  | 2202|   173k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 173k, False: 0]
  |  |  ------------------
  ------------------
 9217|   173k|	*test = NODE_TEST_ALL;
 9218|   173k|	return(NULL);
 9219|   173k|    }
 9220|       |
 9221|  76.0k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 5.85k, False: 70.2k]
  ------------------
 9222|  5.85k|	name = xmlXPathParseNCName(ctxt);
 9223|  76.0k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 368, False: 75.7k]
  ------------------
 9224|    368|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    368|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  75.7k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  75.7k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  75.7k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.11k, False: 73.5k]
  |  |  |  |  ------------------
  |  |  |  |   91|  75.7k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 71.6k, False: 1.96k]
  |  |  |  |  |  Branch (91:23): [True: 17, False: 71.6k]
  |  |  |  |  ------------------
  |  |  |  |   92|  75.7k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 12, False: 73.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  75.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  75.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  85.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  75.7k|    if (CUR == '(') {
  ------------------
  |  | 2193|  75.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 805, False: 74.9k]
  ------------------
 9230|    805|	NEXT;
  ------------------
  |  | 2202|    805|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 805, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    805|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    805|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 25, False: 780]
  ------------------
 9235|     25|	    *type = NODE_TYPE_COMMENT;
 9236|    780|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    780|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 75, False: 705]
  ------------------
 9237|     75|	    *type = NODE_TYPE_NODE;
 9238|    705|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    705|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 148, False: 557]
  ------------------
 9239|    148|	    *type = NODE_TYPE_PI;
 9240|    557|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    557|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 511, False: 46]
  ------------------
 9241|    511|	    *type = NODE_TYPE_TEXT;
 9242|     46|	else {
 9243|     46|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 46, False: 0]
  ------------------
 9244|     46|		xmlFree(name);
 9245|     46|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     46|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    759|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    759|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.01k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.77k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    759|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 148, False: 611]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    148|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 148, False: 0]
  ------------------
 9256|    148|		xmlFree(name);
 9257|    148|	    name = NULL;
 9258|    148|	    if (CUR != ')') {
  ------------------
  |  | 2193|    148|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 101, False: 47]
  ------------------
 9259|    101|		name = xmlXPathParseLiteral(ctxt);
 9260|    101|		*test = NODE_TEST_PI;
 9261|    101|		SKIP_BLANKS;
  ------------------
  |  | 2199|    594|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    594|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 594, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9262|    101|	    }
 9263|    148|	}
 9264|    759|	if (CUR != ')') {
  ------------------
  |  | 2193|    759|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 52, False: 707]
  ------------------
 9265|     52|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 41, False: 11]
  ------------------
 9266|     41|		xmlFree(name);
 9267|     52|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     52|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    707|	NEXT;
  ------------------
  |  | 2202|    707|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 707, False: 0]
  |  |  ------------------
  ------------------
 9270|    707|	return(name);
 9271|    759|    }
 9272|  74.9k|    *test = NODE_TEST_NAME;
 9273|  74.9k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  72.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 72.7k, False: 2.13k]
  |  Branch (9273:22): [True: 2.83k, False: 69.9k]
  ------------------
 9274|  2.83k|	NEXT;
  ------------------
  |  | 2202|  2.83k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.83k, 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|  2.83k|	*prefix = name;
 9284|       |
 9285|  2.83k|	if (CUR == '*') {
  ------------------
  |  | 2193|  2.83k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 541, False: 2.29k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    541|	    NEXT;
  ------------------
  |  | 2202|    541|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 541, False: 0]
  |  |  ------------------
  ------------------
 9290|    541|	    *test = NODE_TEST_ALL;
 9291|    541|	    return(NULL);
 9292|    541|	}
 9293|       |
 9294|  2.29k|	name = xmlXPathParseNCName(ctxt);
 9295|  2.29k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 52, False: 2.23k]
  ------------------
 9296|     52|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     52|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  2.29k|    }
 9299|  74.3k|    return(name);
 9300|  74.9k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  1.02M|   int value2, int value3, void *value4, void *value5) {
 1032|  1.02M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  1.02M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 62.1k, False: 963k]
  ------------------
 1034|  62.1k|	xmlXPathStepOp *real;
 1035|  62.1k|        int newSize;
 1036|       |
 1037|  62.1k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  62.1k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  62.1k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  62.1k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 62.1k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  62.1k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  62.1k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 146, False: 62.0k]
  ------------------
 1045|    146|	    xmlXPathPErrMemory(ctxt);
 1046|    146|	    return(-1);
 1047|    146|	}
 1048|  62.0k|	comp->steps = real;
 1049|  62.0k|	comp->maxStep = newSize;
 1050|  62.0k|    }
 1051|  1.02M|    comp->last = comp->nbStep;
 1052|  1.02M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  1.02M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  1.02M|    comp->steps[comp->nbStep].op = op;
 1055|  1.02M|    comp->steps[comp->nbStep].value = value;
 1056|  1.02M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  1.02M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  1.02M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 1.02M]
  ------------------
 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|  1.02M|    } else {
 1074|  1.02M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  1.02M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  1.02M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  1.02M|    return(comp->nbStep++);
 1079|  1.02M|}
xpath.c:xmlXPathOptimizeExpression:
11740|   875k|{
11741|   875k|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|   875k|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|   875k|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 240k, False: 634k]
  ------------------
11750|   240k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 240k, False: 0]
  ------------------
11751|   240k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 233k, False: 6.47k]
  ------------------
11752|   233k|    {
11753|   233k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   233k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 18.6k, False: 215k]
  ------------------
11756|  18.6k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 10.6k, False: 7.97k]
  ------------------
11757|  18.6k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  10.6k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 10.6k, False: 0]
  ------------------
11759|  10.6k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 10.6k, False: 0]
  ------------------
11760|  10.6k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 10.6k, False: 0]
  ------------------
11761|  10.6k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  10.6k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.64k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.64k, False: 7.98k]
  ------------------
11769|  2.64k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 10.6k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.64k|                    op->ch1   = prevop->ch1;
11776|  2.64k|                    op->value = AXIS_DESCENDANT;
11777|  2.64k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 10.6k]
  ------------------
11779|  2.35k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 2.35k, False: 8.28k]
  ------------------
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.35k|                    op->ch1   = prevop->ch1;
11786|  2.35k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  2.35k|                    break;
11788|  5.63k|                default:
  ------------------
  |  Branch (11788:17): [True: 5.63k, False: 4.99k]
  ------------------
11789|  5.63k|                    break;
11790|  10.6k|            }
11791|  10.6k|	}
11792|   233k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|   875k|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 58.3k, False: 816k]
  ------------------
11796|  58.3k|        return;
11797|       |
11798|       |    /* Recurse */
11799|   816k|    ctxt = pctxt->context;
11800|   816k|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 816k, False: 0]
  ------------------
11801|   816k|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|   816k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 335, False: 816k]
  ------------------
11802|    335|            return;
11803|   816k|        ctxt->depth += 1;
11804|   816k|    }
11805|   816k|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 570k, False: 246k]
  ------------------
11806|   570k|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|   816k|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 291k, False: 525k]
  ------------------
11808|   291k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|   816k|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 816k, False: 0]
  ------------------
11810|   816k|        ctxt->depth -= 1;
11811|   816k|}
xpath.c:xmlXPathRunEval:
11496|  13.6k|{
11497|  13.6k|    xmlXPathCompExprPtr comp;
11498|  13.6k|    int oldDepth;
11499|       |
11500|  13.6k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 13.6k]
  |  Branch (11500:27): [True: 0, False: 13.6k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  13.6k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 13.6k]
  ------------------
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.6k|    comp = ctxt->comp;
11553|  13.6k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 13.6k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  13.6k|    oldDepth = ctxt->context->depth;
11558|  13.6k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 13.6k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  13.6k|    else
11562|  13.6k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  13.6k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  13.6k|    return(0);
11566|  13.6k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   496k|{
11178|   496k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   499k|start:
11181|   499k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   499k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 499k, False: 0]
  |  |  |  Branch (818:39): [True: 5, False: 499k]
  |  |  ------------------
  ------------------
11182|      5|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   499k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 499k]
  ------------------
11186|      0|            return (0);
11187|  30.2k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 30.2k, False: 469k]
  ------------------
11188|  30.2k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  30.2k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 30.2k, False: 0]
  ------------------
11190|  30.2k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  2.68k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 2.68k, False: 496k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  2.68k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 2.68k, False: 0]
  ------------------
11197|  2.68k|		op = &ctxt->comp->steps[op->ch1];
11198|  2.68k|		goto start;
11199|  2.68k|	    }
11200|      0|	    return(0);
11201|   126k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 126k, False: 372k]
  ------------------
11202|   126k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 126k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   126k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   126k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 115, False: 126k]
  ------------------
11207|    115|		return(-1);
11208|       |
11209|   126k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   126k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 298, False: 126k]
  ------------------
11211|    298|		return(-1);
11212|       |
11213|   126k|	    resObj = xmlXPathValuePop(ctxt);
11214|   126k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 126k]
  ------------------
11215|      0|		return(-1);
11216|   126k|	    break;
11217|   339k|	default:
  ------------------
  |  Branch (11217:2): [True: 339k, False: 159k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   339k|	    xmlXPathCompOpEval(ctxt, op);
11222|   339k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.34k, False: 338k]
  ------------------
11223|  1.34k|		return(-1);
11224|       |
11225|   338k|	    resObj = xmlXPathValuePop(ctxt);
11226|   338k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 338k]
  ------------------
11227|      0|		return(-1);
11228|   338k|	    break;
11229|   499k|    }
11230|       |
11231|   464k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 464k, False: 0]
  ------------------
11232|   464k|	int res;
11233|       |
11234|   464k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 240k, False: 224k]
  ------------------
11235|   240k|	    res = resObj->boolval;
11236|   240k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 224k, 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|   224k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   224k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   464k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   464k|	return(res);
11251|   464k|    }
11252|       |
11253|      0|    return(0);
11254|   464k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.16M|{
 9794|       |
 9795|  1.16M|#define XP_TEST_HIT \
 9796|  1.16M|    if (hasAxisRange != 0) { \
 9797|  1.16M|	if (++pos == maxPos) { \
 9798|  1.16M|	    if (addNode(seq, cur) < 0) \
 9799|  1.16M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.16M|	    goto axis_range_end; } \
 9801|  1.16M|    } else { \
 9802|  1.16M|	if (addNode(seq, cur) < 0) \
 9803|  1.16M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.16M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.16M|#define XP_TEST_HIT_NS \
 9807|  1.16M|    if (hasAxisRange != 0) { \
 9808|  1.16M|	if (++pos == maxPos) { \
 9809|  1.16M|	    hasNsNodes = 1; \
 9810|  1.16M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.16M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.16M|	goto axis_range_end; } \
 9813|  1.16M|    } else { \
 9814|  1.16M|	hasNsNodes = 1; \
 9815|  1.16M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.16M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.16M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.16M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.16M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.16M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.16M|    const xmlChar *prefix = op->value4;
 9823|  1.16M|    const xmlChar *name = op->value5;
 9824|  1.16M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.16M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.16M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.16M|    xmlNodeSetPtr contextSeq;
 9831|  1.16M|    int contextIdx;
 9832|  1.16M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.16M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.16M|    xmlNodeSetPtr seq;
 9840|  1.16M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.16M|    xmlXPathStepOpPtr predOp;
 9843|  1.16M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.16M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.16M|    int breakOnFirstHit;
 9846|       |
 9847|  1.16M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.16M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.16M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.16M|    xmlNodePtr oldContextNode;
 9851|  1.16M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.16M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.16M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.16M]
  |  |  |  Branch (271:34): [True: 138, False: 1.16M]
  |  |  ------------------
  |  |  272|  1.16M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    138|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.16M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.16M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 7.99k, False: 1.16M]
  ------------------
 9860|  7.99k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  7.99k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 175, False: 7.81k]
  ------------------
 9862|    175|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    175|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    175|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    175|            return 0;
 9866|    175|	}
 9867|  7.99k|    }
 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.16M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.16M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.16M, False: 0]
  ------------------
 9883|    453|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 453, False: 1.16M]
  ------------------
 9884|    453|            first = NULL;
 9885|    453|            next = xmlXPathNextAncestor;
 9886|    453|            break;
 9887|    340|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 340, False: 1.16M]
  ------------------
 9888|    340|            first = NULL;
 9889|    340|            next = xmlXPathNextAncestorOrSelf;
 9890|    340|            break;
 9891|  20.6k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 20.6k, False: 1.14M]
  ------------------
 9892|  20.6k|            first = NULL;
 9893|  20.6k|	    last = NULL;
 9894|  20.6k|            next = xmlXPathNextAttribute;
 9895|  20.6k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  20.6k|            break;
 9897|   922k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 922k, False: 245k]
  ------------------
 9898|   922k|	    last = NULL;
 9899|   922k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 728k, False: 193k]
  |  Branch (9899:39): [True: 189k, False: 4.53k]
  ------------------
 9900|   917k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 917k, False: 0]
  ------------------
 9901|   917k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   917k|		next = xmlXPathNextChildElement;
 9906|   917k|	    } else
 9907|  4.53k|		next = xmlXPathNextChild;
 9908|   922k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   922k|            break;
 9910|  52.3k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 52.3k, False: 1.11M]
  ------------------
 9911|  52.3k|	    last = NULL;
 9912|  52.3k|            next = xmlXPathNextDescendant;
 9913|  52.3k|            break;
 9914|   139k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 139k, False: 1.02M]
  ------------------
 9915|   139k|	    last = NULL;
 9916|   139k|            next = xmlXPathNextDescendantOrSelf;
 9917|   139k|            break;
 9918|    427|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 427, False: 1.16M]
  ------------------
 9919|    427|	    last = NULL;
 9920|    427|            next = xmlXPathNextFollowing;
 9921|    427|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.16M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  2.24k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 2.24k, False: 1.16M]
  ------------------
 9927|  2.24k|            first = NULL;
 9928|  2.24k|	    last = NULL;
 9929|  2.24k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  2.24k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  2.24k|            break;
 9932|  29.0k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 29.0k, False: 1.13M]
  ------------------
 9933|  29.0k|            first = NULL;
 9934|  29.0k|            next = xmlXPathNextParent;
 9935|  29.0k|            break;
 9936|     64|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 64, False: 1.16M]
  ------------------
 9937|     64|            first = NULL;
 9938|     64|            next = xmlXPathNextPrecedingInternal;
 9939|     64|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.16M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    438|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 438, False: 1.16M]
  ------------------
 9945|    438|            first = NULL;
 9946|    438|	    last = NULL;
 9947|    438|            next = xmlXPathNextSelf;
 9948|    438|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    438|            break;
 9950|  1.16M|    }
 9951|       |
 9952|  1.16M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.16M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.16M|    contextSeq = obj->nodesetval;
 9957|  1.16M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.16M]
  |  Branch (9957:33): [True: 81.7k, False: 1.08M]
  ------------------
 9958|  81.7k|        xmlXPathValuePush(ctxt, obj);
 9959|  81.7k|        return(0);
 9960|  81.7k|    }
 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.08M|    maxPos = 0;
 9980|  1.08M|    predOp = NULL;
 9981|  1.08M|    hasPredicateRange = 0;
 9982|  1.08M|    hasAxisRange = 0;
 9983|  1.08M|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 127k, False: 958k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   127k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   127k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 62.5k, False: 65.1k]
  ------------------
 9989|  62.5k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 38.9k, False: 23.5k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  38.9k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  38.9k|		hasPredicateRange = 1;
 9995|  38.9k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  23.5k|		predOp = NULL;
10000|  23.5k|		hasAxisRange = 1;
10001|  23.5k|	    }
10002|  62.5k|	}
10003|   127k|    }
10004|  1.08M|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 123k, False: 962k]
  |  Branch (10004:36): [True: 97.7k, False: 25.8k]
  ------------------
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.08M|    oldContextNode = xpctxt->node;
10019|  1.08M|    addNode = xmlXPathNodeSetAddUnique;
10020|  1.08M|    outSeq = NULL;
10021|  1.08M|    seq = NULL;
10022|  1.08M|    contextNode = NULL;
10023|  1.08M|    contextIdx = 0;
10024|       |
10025|       |
10026|  3.27M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.26M, False: 1.00M]
  |  Branch (10026:50): [True: 0, False: 1.00M]
  ------------------
10027|  2.26M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.26M, False: 97]
  ------------------
10028|  2.26M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.26M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.10M, False: 1.15M]
  ------------------
10031|  1.10M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.10M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 135, False: 1.10M]
  ------------------
10033|    135|                xmlXPathPErrMemory(ctxt);
10034|    135|		total = 0;
10035|    135|		goto error;
10036|    135|	    }
10037|  1.10M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.26M|	pos = 0;
10042|  2.26M|	cur = NULL;
10043|  2.26M|	hasNsNodes = 0;
10044|  9.30M|        do {
10045|  9.30M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  9.30M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 9.30M, False: 0]
  |  |  |  Branch (818:39): [True: 40, False: 9.30M]
  |  |  ------------------
  ------------------
10046|     40|                goto error;
10047|       |
10048|  9.30M|            cur = next(ctxt, cur);
10049|  9.30M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 2.18M, False: 7.12M]
  ------------------
10050|  2.18M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  7.12M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 4.68k, False: 7.11M]
  |  Branch (10055:36): [True: 1.37k, False: 3.31k]
  ------------------
10056|  1.37k|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 261, False: 1.11k]
  ------------------
10057|    261|		    break;
10058|  1.11k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 1.01k, False: 102]
  ------------------
10059|  1.01k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|  1.01k|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 852, False: 158]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|    852|		{
10065|    852|		    break;
10066|    852|		}
10067|  1.11k|	    }
10068|  7.12M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 2.18k, False: 7.11M]
  |  Branch (10068:28): [True: 1.47k, False: 714]
  ------------------
10069|  1.47k|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 169, False: 1.30k]
  ------------------
10070|    169|		    break;
10071|  1.30k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 763, False: 543]
  ------------------
10072|    763|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|    763|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 682, False: 81]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|    682|		{
10078|    682|		    break;
10079|    682|		}
10080|  1.30k|	    }
10081|       |
10082|  7.12M|            total++;
10083|       |
10084|  7.12M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 7.12M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 7.12M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  4.09M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 4.09M, False: 3.02M]
  ------------------
10089|  4.09M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 3.96M, False: 127k]
  ------------------
10090|  3.96M|			switch (cur->type) {
10091|   123k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 123k, False: 3.84M]
  ------------------
10092|   123k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 3.96M]
  ------------------
10093|  2.67M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.55M, False: 1.41M]
  ------------------
10094|  2.67M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 580, False: 3.96M]
  ------------------
10095|  2.80M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 127k, False: 3.84M]
  ------------------
10096|  2.82M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 22.5k, False: 3.94M]
  ------------------
10097|  2.92M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 100k, False: 3.86M]
  ------------------
10098|  3.96M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 1.03M, False: 2.93M]
  ------------------
10099|  3.96M|				XP_TEST_HIT
  ------------------
  |  | 9796|  3.96M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 527, False: 3.96M]
  |  |  ------------------
  |  | 9797|    527|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 254, False: 273]
  |  |  ------------------
  |  | 9798|    254|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 253]
  |  |  ------------------
  |  | 9799|    254|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    254|	    goto axis_range_end; } \
  |  | 9801|  3.96M|    } else { \
  |  | 9802|  3.96M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 97, False: 3.96M]
  |  |  ------------------
  |  | 9803|  3.96M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  3.96M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 8.06k, False: 3.95M]
  |  |  ------------------
  ------------------
10100|  3.95M|				break;
10101|  3.95M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 5.73k, False: 3.96M]
  ------------------
10102|  5.73k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 5.73k]
  ------------------
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|  5.73k|				} else {
10105|  5.73k|	                            hasNsNodes = 1;
10106|  5.73k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  5.73k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 5.73k]
  |  |  ------------------
  |  | 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|  5.73k|    } else { \
  |  | 9802|  5.73k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 6, False: 5.72k]
  |  |  ------------------
  |  | 9803|  5.73k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  5.73k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 5.73k]
  |  |  ------------------
  ------------------
10107|  5.73k|				}
10108|  5.73k|				break;
10109|  5.73k|                            }
10110|  5.73k|			    default:
  ------------------
  |  Branch (10110:8): [True: 1.12k, False: 3.96M]
  ------------------
10111|  1.12k|				break;
10112|  3.96M|			}
10113|  3.96M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 63.2k, False: 63.9k]
  ------------------
10114|  63.2k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 63.2k]
  ------------------
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|  63.2k|			else
10117|  63.2k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  63.2k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.23k, False: 61.9k]
  |  |  ------------------
  |  | 9797|  1.23k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 216, False: 1.01k]
  |  |  ------------------
  |  | 9798|    216|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 215]
  |  |  ------------------
  |  | 9799|    216|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    216|	    goto axis_range_end; } \
  |  | 9801|  61.9k|    } else { \
  |  | 9802|  61.9k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 61.9k]
  |  |  ------------------
  |  | 9803|  61.9k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  61.9k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 201, False: 61.7k]
  |  |  ------------------
  ------------------
10118|  63.9k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 63.9k, False: 37]
  ------------------
10119|  63.9k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 18.8k, False: 45.0k]
  ------------------
10120|  18.8k|		    {
10121|  18.8k|			XP_TEST_HIT
  ------------------
  |  | 9796|  18.8k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 329, False: 18.5k]
  |  |  ------------------
  |  | 9797|    329|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 38, False: 291]
  |  |  ------------------
  |  | 9798|     38|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 37]
  |  |  ------------------
  |  | 9799|     38|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     38|	    goto axis_range_end; } \
  |  | 9801|  18.5k|    } else { \
  |  | 9802|  18.5k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 18.5k]
  |  |  ------------------
  |  | 9803|  18.5k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  18.5k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 197, False: 18.3k]
  |  |  ------------------
  ------------------
10122|  18.8k|		    }
10123|  4.08M|		    break;
10124|  4.08M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 277, False: 7.12M]
  ------------------
10125|    277|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 88, False: 189]
  ------------------
10126|     88|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 88]
  |  Branch (10126:44): [True: 54, False: 34]
  ------------------
10127|     54|		    {
10128|     54|			XP_TEST_HIT
  ------------------
  |  | 9796|     54|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 54]
  |  |  ------------------
  |  | 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|     54|    } else { \
  |  | 9802|     54|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 53]
  |  |  ------------------
  |  | 9803|     54|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     54|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 54]
  |  |  ------------------
  ------------------
10129|     54|                    }
10130|    277|                    break;
10131|  1.30M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.30M, False: 5.81M]
  ------------------
10132|  1.30M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 23.6k, False: 1.27M]
  ------------------
10133|  23.6k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 23.6k, False: 0]
  ------------------
10134|  23.6k|			{
10135|  23.6k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 22.7k, False: 940]
  ------------------
10136|  22.7k|			    {
10137|  22.7k|				XP_TEST_HIT
  ------------------
  |  | 9796|  22.7k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 10.9k, False: 11.8k]
  |  |  ------------------
  |  | 9797|  10.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 5.60k, False: 5.31k]
  |  |  ------------------
  |  | 9798|  5.60k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 5.60k]
  |  |  ------------------
  |  | 9799|  5.60k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  5.60k|	    goto axis_range_end; } \
  |  | 9801|  11.8k|    } else { \
  |  | 9802|  11.8k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 4, False: 11.8k]
  |  |  ------------------
  |  | 9803|  11.8k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  11.8k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 7.02k, False: 4.81k]
  |  |  ------------------
  ------------------
10138|  22.7k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 741, False: 199]
  ------------------
10139|    741|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 741, False: 0]
  ------------------
10140|    741|			    {
10141|    741|				XP_TEST_HIT
  ------------------
  |  | 9796|    741|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 441, False: 300]
  |  |  ------------------
  |  | 9797|    441|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 244, False: 197]
  |  |  ------------------
  |  | 9798|    244|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 243]
  |  |  ------------------
  |  | 9799|    244|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    244|	    goto axis_range_end; } \
  |  | 9801|    441|    } else { \
  |  | 9802|    300|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 299]
  |  |  ------------------
  |  | 9803|    300|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    300|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 87, False: 213]
  |  |  ------------------
  ------------------
10142|    741|                            }
10143|  23.6k|                        }
10144|  1.27M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 79.6k, False: 1.19M]
  ------------------
10145|  79.6k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 79.6k, False: 0]
  ------------------
10146|  79.6k|			{
10147|  79.6k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  79.6k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 1.18k, False: 78.4k]
  |  |  ------------------
  |  | 9808|  1.18k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 664, False: 524]
  |  |  ------------------
  |  | 9809|    664|	    hasNsNodes = 1; \
  |  | 9810|    664|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 3, False: 661]
  |  |  ------------------
  |  | 9811|    664|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|    664|	goto axis_range_end; } \
  |  | 9813|  78.4k|    } else { \
  |  | 9814|  78.4k|	hasNsNodes = 1; \
  |  | 9815|  78.4k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 24, False: 78.3k]
  |  |  ------------------
  |  | 9816|  78.4k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|  78.4k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 78.4k]
  |  |  ------------------
  ------------------
10148|  79.6k|                        }
10149|  1.19M|                    } else {
10150|  1.19M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.10M, False: 98.7k]
  ------------------
10151|  1.10M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.09M, False: 8.78k]
  ------------------
10152|  1.09M|			    {
10153|  1.09M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.09M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 11.8k, False: 1.08M]
  |  |  ------------------
  |  | 9797|  11.8k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 5.85k, False: 6.00k]
  |  |  ------------------
  |  | 9798|  5.85k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 5.85k]
  |  |  ------------------
  |  | 9799|  5.85k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  5.85k|	    goto axis_range_end; } \
  |  | 9801|  1.08M|    } else { \
  |  | 9802|  1.08M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 41, False: 1.07M]
  |  |  ------------------
  |  | 9803|  1.08M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.08M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 34.1k, False: 1.04M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.09M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 1.60k, False: 7.18k]
  ------------------
10156|  1.60k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 901, False: 699]
  ------------------
10157|    901|			    {
10158|    901|				XP_TEST_HIT
  ------------------
  |  | 9796|    901|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 286, False: 615]
  |  |  ------------------
  |  | 9797|    286|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 71, False: 215]
  |  |  ------------------
  |  | 9798|     71|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 69]
  |  |  ------------------
  |  | 9799|     71|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     71|	    goto axis_range_end; } \
  |  | 9801|    615|    } else { \
  |  | 9802|    615|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 613]
  |  |  ------------------
  |  | 9803|    615|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    615|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 380, False: 235]
  |  |  ------------------
  ------------------
10159|    901|                            }
10160|  1.10M|                        }
10161|  1.19M|                    }
10162|  1.24M|                    break;
10163|  1.24M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 7.12M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.30M|                    }
10167|  1.72M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.72M, False: 5.39M]
  ------------------
10168|  1.72M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 4.64k, False: 1.71M]
  ------------------
10169|  4.64k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 4.64k]
  ------------------
10170|      0|			    break;
10171|  1.71M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 2.83k, False: 1.71M]
  ------------------
10172|  2.83k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 2.83k]
  ------------------
10173|      0|			    break;
10174|  1.71M|		    } else {
10175|  1.71M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 218k, False: 1.49M]
  ------------------
10176|   218k|			    break;
10177|  1.71M|		    }
10178|  1.50M|                    switch (cur->type) {
10179|  1.49M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.49M, False: 7.47k]
  ------------------
10180|  1.49M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 399k, False: 1.09M]
  ------------------
10181|   399k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 396k, False: 3.41k]
  ------------------
10182|   396k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 395k, False: 545]
  ------------------
10183|   395k|				    {
10184|   395k|					XP_TEST_HIT
  ------------------
  |  | 9796|   395k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 26.6k, False: 369k]
  |  |  ------------------
  |  | 9797|  26.6k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 7.73k, False: 18.8k]
  |  |  ------------------
  |  | 9798|  7.73k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 7.73k]
  |  |  ------------------
  |  | 9799|  7.73k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  7.73k|	    goto axis_range_end; } \
  |  | 9801|   369k|    } else { \
  |  | 9802|   369k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 10, False: 369k]
  |  |  ------------------
  |  | 9803|   369k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   369k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 223, False: 369k]
  |  |  ------------------
  ------------------
10185|   395k|                                    }
10186|   396k|                                } else {
10187|  3.41k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 329, False: 3.08k]
  ------------------
10188|    329|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 77, False: 252]
  ------------------
10189|     77|				    {
10190|     77|					XP_TEST_HIT
  ------------------
  |  | 9796|     77|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 77]
  |  |  ------------------
  |  | 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|     77|    } else { \
  |  | 9802|     77|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 76]
  |  |  ------------------
  |  | 9803|     77|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     77|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 77]
  |  |  ------------------
  ------------------
10191|     77|                                    }
10192|  3.41k|                                }
10193|   399k|                            }
10194|  1.48M|                            break;
10195|  1.48M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 4.64k, False: 1.49M]
  ------------------
10196|  4.64k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  4.64k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 3.24k, False: 1.39k]
  ------------------
10199|  3.24k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 3.01k, False: 224]
  ------------------
10200|  3.01k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 2.93k, False: 81]
  ------------------
10201|     81|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 81]
  ------------------
10202|  2.93k|					{
10203|  2.93k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  2.93k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 2.31k, False: 617]
  |  |  ------------------
  |  | 9797|  2.31k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 853, False: 1.46k]
  |  |  ------------------
  |  | 9798|    853|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 852]
  |  |  ------------------
  |  | 9799|    853|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    853|	    goto axis_range_end; } \
  |  | 9801|  2.31k|    } else { \
  |  | 9802|    617|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 615]
  |  |  ------------------
  |  | 9803|    617|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    617|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 69, False: 548]
  |  |  ------------------
  ------------------
10204|  2.93k|                                        }
10205|  3.01k|                                    } else {
10206|    224|                                        if ((attr->ns != NULL) &&
  ------------------
  |  Branch (10206:45): [True: 1, False: 223]
  ------------------
10207|      1|                                            (xmlStrEqual(URI,
  ------------------
  |  Branch (10207:45): [True: 1, False: 0]
  ------------------
10208|      1|					      attr->ns->href)))
10209|      1|					{
10210|      1|					    XP_TEST_HIT
  ------------------
  |  | 9796|      1|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 1]
  |  |  ------------------
  |  | 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|      1|    } else { \
  |  | 9802|      1|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 0, False: 1]
  |  |  ------------------
  |  | 9803|      1|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|      1|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 1]
  |  |  ------------------
  ------------------
10211|      1|                                        }
10212|    224|                                    }
10213|  3.24k|                                }
10214|  3.71k|                                break;
10215|  4.64k|                            }
10216|  3.71k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 2.83k, False: 1.50M]
  ------------------
10217|  2.83k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 2.83k, False: 0]
  ------------------
10218|  2.83k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  2.83k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 2.06k, False: 769]
  |  Branch (10220:61): [True: 2.06k, False: 0]
  ------------------
10221|  2.06k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 670, False: 1.39k]
  ------------------
10222|    670|				{
10223|    670|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|    670|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 153, False: 517]
  |  |  ------------------
  |  | 9808|    153|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 83, False: 70]
  |  |  ------------------
  |  | 9809|     83|	    hasNsNodes = 1; \
  |  | 9810|     83|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 2, False: 81]
  |  |  ------------------
  |  | 9811|     83|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|     83|	goto axis_range_end; } \
  |  | 9813|    517|    } else { \
  |  | 9814|    517|	hasNsNodes = 1; \
  |  | 9815|    517|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 3, False: 514]
  |  |  ------------------
  |  | 9816|    517|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    517|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 517]
  |  |  ------------------
  ------------------
10224|    670|                                }
10225|  2.83k|                            }
10226|  2.74k|                            break;
10227|  2.74k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.50M]
  ------------------
10228|      0|                            break;
10229|  1.50M|                    }
10230|  1.49M|                    break;
10231|  7.12M|	    } /* switch(test) */
10232|  7.12M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 7.04M, False: 0]
  |  Branch (10232:35): [True: 7.04M, False: 191]
  ------------------
10233|       |
10234|  2.18M|	goto apply_predicates;
10235|       |
10236|  2.18M|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|  21.6k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 14.6k, False: 6.98k]
  ------------------
10244|  14.6k|	    outSeq = seq;
10245|  14.6k|	    seq = NULL;
10246|  14.6k|	} else {
10247|  6.98k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  6.98k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 4, False: 6.98k]
  ------------------
10249|      4|                xmlXPathPErrMemory(ctxt);
10250|  6.98k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  21.6k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.6k, False: 7.95k]
  ------------------
10255|  13.6k|	    break;
10256|  7.95k|	continue;
10257|       |
10258|  50.3k|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|  50.3k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 50.3k, False: 0]
  ------------------
10264|  50.3k|	    outSeq = seq;
10265|  50.3k|	    seq = NULL;
10266|  50.3k|	} 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|  50.3k|	break;
10272|       |
10273|  2.18M|apply_predicates: /* --------------------------------------------------- */
10274|  2.18M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 196, False: 2.18M]
  ------------------
10275|    196|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  2.18M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 656k, False: 1.53M]
  |  Branch (10280:33): [True: 141k, False: 515k]
  ------------------
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|   141k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 11.4k, False: 129k]
  ------------------
10310|  11.4k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  11.4k|					    hasNsNodes);
10312|   129k|	    else
10313|   129k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   129k|					    hasNsNodes);
10315|       |
10316|   141k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.73k, False: 139k]
  ------------------
10317|  1.73k|		total = 0;
10318|  1.73k|		goto error;
10319|  1.73k|	    }
10320|   141k|        }
10321|       |
10322|  2.18M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 525k, False: 1.66M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   525k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 253k, False: 272k]
  ------------------
10327|   253k|		outSeq = seq;
10328|   253k|		seq = NULL;
10329|   272k|	    } else {
10330|   272k|		outSeq = mergeAndClear(outSeq, seq);
10331|   272k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 101, False: 272k]
  ------------------
10332|    101|                    xmlXPathPErrMemory(ctxt);
10333|   272k|	    }
10334|       |
10335|   525k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 11.3k, False: 514k]
  ------------------
10336|  11.3k|                break;
10337|   525k|	}
10338|  2.18M|    }
10339|       |
10340|  1.08M|error:
10341|  1.08M|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 1.08M]
  |  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.08M|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|  1.08M|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 767k, False: 318k]
  ------------------
10358|   767k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 767k, False: 130]
  |  Branch (10358:23): [True: 767k, False: 136]
  ------------------
10359|   767k|	    outSeq = seq;
10360|   767k|        } else {
10361|    266|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    266|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 265]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    266|        }
10365|   767k|    }
10366|  1.08M|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 785k, False: 300k]
  |  Branch (10366:26): [True: 18.2k, False: 767k]
  ------------------
10367|  18.2k|	 xmlXPathFreeNodeSet(seq);
10368|  18.2k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|  1.08M|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|  1.08M|    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.08M|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 142, False: 1.08M]
  ------------------
10383|    142|        xmlFree(xpctxt->tmpNsList);
10384|    142|        xpctxt->tmpNsList = NULL;
10385|    142|    }
10386|       |
10387|  1.08M|    return(total);
10388|  1.08M|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   148k|{
 2959|   148k|    {
 2960|   148k|	int i, j, initNbSet1;
 2961|   148k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   148k|	initNbSet1 = set1->nodeNr;
 2964|   514k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 365k, False: 148k]
  ------------------
 2965|   365k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  97.0M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 97.0M, False: 75.8k]
  ------------------
 2970|  97.0M|		n1 = set1->nodeTab[j];
 2971|  97.0M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 289k, False: 96.7M]
  ------------------
 2972|   289k|		    goto skip_node;
 2973|  96.7M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 163k, False: 96.5M]
  ------------------
 2974|   163k|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 163k, False: 0]
  ------------------
 2975|   163k|		{
 2976|   163k|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 4.28k, False: 159k]
  ------------------
 2977|  4.28k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 4.28k]
  ------------------
 2978|  4.28k|			((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|   163k|		}
 2987|  97.0M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  75.8k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 14.2k, False: 61.5k]
  ------------------
 2992|  14.2k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 43, False: 14.2k]
  ------------------
 2993|     43|                    goto error;
 2994|  14.2k|            }
 2995|  75.7k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   365k|skip_node:
 2997|   365k|            set2->nodeTab[i] = NULL;
 2998|   365k|	}
 2999|   148k|    }
 3000|   148k|    set2->nodeNr = 0;
 3001|   148k|    return(set1);
 3002|       |
 3003|     43|error:
 3004|     43|    xmlXPathFreeNodeSet(set1);
 3005|     43|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   148k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  2.23k|{
 3155|  2.23k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  2.23k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  2.84k|{
 3128|  2.84k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 2.84k]
  |  Branch (3128:26): [True: 0, False: 2.84k]
  ------------------
 3129|      0|	return;
 3130|  2.84k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 711, False: 2.12k]
  ------------------
 3131|    711|	int i;
 3132|    711|	xmlNodePtr node;
 3133|       |
 3134|  3.92k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 3.21k, False: 711]
  ------------------
 3135|  3.21k|	    node = set->nodeTab[i];
 3136|  3.21k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 2.54k, False: 671]
  ------------------
 3137|  2.54k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 53, False: 2.48k]
  ------------------
 3138|     53|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  3.21k|	}
 3140|    711|    }
 3141|  2.84k|    set->nodeNr = pos;
 3142|  2.84k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   130k|{
 3022|   130k|    {
 3023|   130k|	int i;
 3024|   130k|	xmlNodePtr n2;
 3025|       |
 3026|   420k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 289k, False: 130k]
  ------------------
 3027|   289k|	    n2 = set2->nodeTab[i];
 3028|   289k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 45.7k, False: 244k]
  ------------------
 3029|  45.7k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 62, False: 45.6k]
  ------------------
 3030|     62|                    goto error;
 3031|  45.7k|            }
 3032|   289k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   289k|            set2->nodeTab[i] = NULL;
 3034|   289k|	}
 3035|   130k|    }
 3036|   130k|    set2->nodeNr = 0;
 3037|   130k|    return(set1);
 3038|       |
 3039|     62|error:
 3040|     62|    xmlXPathFreeNodeSet(set1);
 3041|     62|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   130k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.86M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.86M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.86M]
  |  Branch (6201:27): [True: 0, False: 2.86M]
  ------------------
 6202|  2.86M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.41M, False: 1.44M]
  ------------------
 6203|  1.41M|	cur = ctxt->context->node;
 6204|  1.41M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.41M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.41M|	switch (cur->type) {
 6209|  1.09M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.09M, False: 322k]
  ------------------
 6210|  1.09M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.41M]
  ------------------
 6211|  1.09M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.41M]
  ------------------
 6212|  1.09M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.41M]
  ------------------
 6213|  1.09M|		cur = cur->children;
 6214|  1.09M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 381k, False: 710k]
  ------------------
 6215|   381k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 184k, False: 197k]
  ------------------
 6216|   184k|			return(cur);
 6217|   205k|		    do {
 6218|   205k|			cur = cur->next;
 6219|   205k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 126k, False: 79.1k]
  ------------------
 6220|   126k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 8.49k, False: 117k]
  ------------------
 6221|   197k|		    return(cur);
 6222|   381k|		}
 6223|   710k|		return(NULL);
 6224|   209k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 209k, False: 1.20M]
  ------------------
 6225|   209k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.41M]
  ------------------
 6226|   209k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   112k|	    default:
  ------------------
  |  Branch (6227:6): [True: 112k, False: 1.30M]
  ------------------
 6228|   112k|		return(NULL);
 6229|  1.41M|	}
 6230|      0|	return(NULL);
 6231|  1.41M|    }
 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: 1.04M, False: 405k]
  ------------------
 6250|  1.04M|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 881k, False: 162k]
  ------------------
 6251|   881k|	    return(cur->next);
 6252|   162k|	cur = cur->next;
 6253|   224k|	do {
 6254|   224k|	    cur = cur->next;
 6255|   224k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 132k, False: 91.8k]
  |  Branch (6255:28): [True: 61.9k, False: 70.8k]
  ------------------
 6256|   162k|	return(cur);
 6257|  1.04M|    }
 6258|   405k|    return(NULL);
 6259|  1.44M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  91.3k|{
 6757|  91.3k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 91.3k]
  |  Branch (6757:27): [True: 0, False: 91.3k]
  ------------------
 6758|  91.3k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 4.10k, False: 87.2k]
  ------------------
 6759|  4.10k|        cur = ctxt->context->node;
 6760|  4.10k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 4.10k]
  ------------------
 6761|      0|            return (NULL);
 6762|  4.10k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 4.10k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  4.10k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 4.10k]
  ------------------
 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|  4.10k|        ctxt->ancestor = cur->parent;
 6773|  4.10k|    }
 6774|       |
 6775|  91.3k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 91.3k]
  |  Branch (6775:44): [True: 64, False: 91.3k]
  ------------------
 6776|     64|        return(NULL);
 6777|       |
 6778|  91.3k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 37.2k, False: 54.0k]
  |  Branch (6778:32): [True: 2.47k, False: 34.7k]
  ------------------
 6779|  2.47k|	cur = cur->prev;
 6780|       |
 6781|  1.33M|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 1.29M, False: 43.7k]
  ------------------
 6782|  1.29M|        cur = cur->parent;
 6783|  1.29M|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 2.76k, False: 1.29M]
  ------------------
 6784|  2.76k|            return (NULL);
 6785|  1.29M|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 1.27k, False: 1.29M]
  ------------------
 6786|  1.27k|            return (NULL);
 6787|  1.29M|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 43.5k, False: 1.24M]
  ------------------
 6788|  43.5k|            return (cur);
 6789|  1.24M|        ctxt->ancestor = cur->parent;
 6790|  1.24M|    }
 6791|       |
 6792|  43.7k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 43.7k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  43.7k|    cur = cur->prev;
 6796|  87.2k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 43.5k, False: 43.7k]
  ------------------
 6797|  43.5k|        cur = cur->last;
 6798|  43.7k|    return (cur);
 6799|  43.7k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   127k|{
 9737|       |
 9738|   127k|    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|   127k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 127k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   127k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 127k, False: 0]
  ------------------
 9757|   127k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   127k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   127k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 127k, False: 0]
  ------------------
 9762|   127k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 67.6k, False: 60.0k]
  ------------------
 9763|  67.6k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 67.6k, False: 0]
  ------------------
 9764|  67.6k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 67.3k, False: 273]
  ------------------
 9765|  67.3k|    {
 9766|  67.3k|        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|  67.3k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 67.1k, False: 219]
  |  Branch (9779:37): [True: 64.9k, False: 2.11k]
  ------------------
 9780|  64.9k|	    *maxPos = (int) floatval;
 9781|  64.9k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 62.5k, False: 2.49k]
  ------------------
 9782|  62.5k|                return(1);
 9783|  64.9k|        }
 9784|  67.3k|    }
 9785|  65.1k|    return(0);
 9786|   127k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   142k|{
 9711|   142k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 1.42k, False: 141k]
  ------------------
 9712|  1.42k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  1.42k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 1.42k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  1.42k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.42k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 1.42k]
  ------------------
 9720|  1.42k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  1.42k|        ctxt->context->depth += 1;
 9722|  1.42k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  1.42k|                                    1, set->nodeNr, hasNsNodes);
 9724|  1.42k|        ctxt->context->depth -= 1;
 9725|  1.42k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.42k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 218, False: 1.20k]
  |  |  ------------------
  ------------------
 9726|  1.42k|    }
 9727|       |
 9728|   142k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 142k, False: 0]
  ------------------
 9729|   142k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   142k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   149k|{
 9578|   149k|    xmlXPathContextPtr xpctxt;
 9579|   149k|    xmlNodePtr oldnode;
 9580|   149k|    xmlDocPtr olddoc;
 9581|   149k|    xmlXPathStepOpPtr filterOp;
 9582|   149k|    int oldcs, oldpp;
 9583|   149k|    int i, j, pos;
 9584|       |
 9585|   149k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 149k]
  |  Branch (9585:26): [True: 3.83k, False: 145k]
  ------------------
 9586|  3.83k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   145k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 2.12k, False: 143k]
  ------------------
 9593|  2.12k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  2.12k|        return;
 9595|  2.12k|    }
 9596|       |
 9597|   143k|    xpctxt = ctxt->context;
 9598|   143k|    oldnode = xpctxt->node;
 9599|   143k|    olddoc = xpctxt->doc;
 9600|   143k|    oldcs = xpctxt->contextSize;
 9601|   143k|    oldpp = xpctxt->proximityPosition;
 9602|   143k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   143k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   573k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 496k, False: 76.8k]
  ------------------
 9607|   496k|        xmlNodePtr node = set->nodeTab[i];
 9608|   496k|        int res;
 9609|       |
 9610|   496k|        xpctxt->node = node;
 9611|   496k|        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|   496k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 481k, False: 14.6k]
  ------------------
 9620|   481k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 481k, False: 0]
  ------------------
 9621|   481k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   496k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   496k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.76k, False: 494k]
  ------------------
 9626|  1.76k|            break;
 9627|   494k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 494k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   494k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 202k, False: 292k]
  |  Branch (9633:28): [True: 177k, False: 24.7k]
  |  Branch (9633:47): [True: 169k, False: 8.20k]
  ------------------
 9634|   169k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 6.95k, False: 162k]
  ------------------
 9635|  6.95k|                set->nodeTab[j] = node;
 9636|  6.95k|                set->nodeTab[i] = NULL;
 9637|  6.95k|            }
 9638|       |
 9639|   169k|            j += 1;
 9640|   325k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   325k|            set->nodeTab[i] = NULL;
 9643|   325k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 2.50k, False: 323k]
  ------------------
 9644|  2.50k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   325k|        }
 9646|       |
 9647|   494k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 202k, False: 292k]
  ------------------
 9648|   202k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 65.1k, False: 136k]
  ------------------
 9649|  65.1k|                i += 1;
 9650|  65.1k|                break;
 9651|  65.1k|            }
 9652|       |
 9653|   136k|            pos += 1;
 9654|   136k|        }
 9655|   494k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   143k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 10.9k, False: 132k]
  ------------------
 9659|  11.6k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 670, False: 10.9k]
  ------------------
 9660|    670|            xmlNodePtr node = set->nodeTab[i];
 9661|    670|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 670, False: 0]
  |  Branch (9661:35): [True: 27, False: 643]
  ------------------
 9662|     27|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|    670|        }
 9664|  10.9k|    }
 9665|       |
 9666|   143k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   143k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   143k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 12.6k, False: 131k]
  ------------------
 9670|  12.6k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 7.88k, False: 4.72k]
  ------------------
 9671|  7.88k|        xmlNodePtr *tmp;
 9672|  7.88k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  7.88k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  7.88k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 7.77k, False: 110]
  ------------------
 9675|  7.77k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  7.77k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  7.88k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  7.88k|                nodeMax * sizeof(xmlNodePtr));
 9678|  7.88k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 2, False: 7.87k]
  ------------------
 9679|      2|            xmlXPathPErrMemory(ctxt);
 9680|  7.87k|        } else {
 9681|  7.87k|            set->nodeTab = tmp;
 9682|  7.87k|            set->nodeMax = nodeMax;
 9683|  7.87k|        }
 9684|  7.88k|    }
 9685|       |
 9686|   143k|    xpctxt->node = oldnode;
 9687|   143k|    xpctxt->doc = olddoc;
 9688|   143k|    xpctxt->contextSize = oldcs;
 9689|   143k|    xpctxt->proximityPosition = oldpp;
 9690|   143k|}
xpath.c:xmlXPathCompOpEval:
10750|  4.04M|{
10751|  4.04M|    int total = 0;
10752|  4.04M|    int equal, ret;
10753|  4.04M|    xmlXPathCompExprPtr comp;
10754|  4.04M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  4.04M|    CHECK_ERROR0;
  ------------------
  |  |  236|  4.04M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 2, False: 4.04M]
  |  |  ------------------
  ------------------
10757|  4.04M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  4.04M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 4.04M, False: 0]
  |  |  |  Branch (818:39): [True: 44, False: 4.04M]
  |  |  ------------------
  ------------------
10758|     44|        return(0);
10759|  4.04M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  4.04M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 19, False: 4.04M]
  ------------------
10760|  4.04M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     19|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  4.04M|    ctxt->context->depth += 1;
10762|  4.04M|    comp = ctxt->comp;
10763|  4.04M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 4.04M]
  ------------------
10765|      0|            break;
10766|  2.11k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 2.11k, False: 4.03M]
  ------------------
10767|  2.11k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  2.11k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.11k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 275, False: 1.83k]
  |  |  ------------------
  ------------------
10769|  1.83k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.83k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 2, False: 1.83k]
  |  Branch (10770:42): [True: 361, False: 1.47k]
  ------------------
10771|    363|                break;
10772|  1.47k|            arg2 = xmlXPathValuePop(ctxt);
10773|  1.47k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|  1.47k|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 37, False: 1.43k]
  ------------------
10775|     37|		xmlXPathFreeObject(arg2);
10776|     37|		break;
10777|     37|	    }
10778|  1.43k|            xmlXPathBooleanFunction(ctxt, 1);
10779|  1.43k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 1.43k, False: 1]
  ------------------
10780|  1.43k|                ctxt->value->boolval &= arg2->boolval;
10781|  1.43k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|  1.43k|            break;
10783|  4.86k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 4.86k, False: 4.03M]
  ------------------
10784|  4.86k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  4.86k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  4.86k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 837, False: 4.03k]
  |  |  ------------------
  ------------------
10786|  4.03k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  4.03k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 3, False: 4.02k]
  |  Branch (10787:42): [True: 940, False: 3.08k]
  ------------------
10788|    943|                break;
10789|  3.08k|            arg2 = xmlXPathValuePop(ctxt);
10790|  3.08k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  3.08k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 121, False: 2.96k]
  ------------------
10792|    121|		xmlXPathFreeObject(arg2);
10793|    121|		break;
10794|    121|	    }
10795|  2.96k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  2.96k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 2.96k, False: 2]
  ------------------
10797|  2.96k|                ctxt->value->boolval |= arg2->boolval;
10798|  2.96k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  2.96k|            break;
10800|   413k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 413k, False: 3.62M]
  ------------------
10801|   413k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   413k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   413k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 8.20k, False: 404k]
  |  |  ------------------
  ------------------
10803|   404k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   404k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   404k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.48k, False: 403k]
  |  |  ------------------
  ------------------
10805|   403k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 396k, False: 6.82k]
  ------------------
10806|   396k|		equal = xmlXPathEqualValues(ctxt);
10807|  6.82k|	    else
10808|  6.82k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   403k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   403k|            break;
10811|   189k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 189k, False: 3.85M]
  ------------------
10812|   189k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   189k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   189k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.12k, False: 187k]
  |  |  ------------------
  ------------------
10814|   187k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   187k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   187k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 766, False: 187k]
  |  |  ------------------
  ------------------
10816|   187k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   187k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   187k|            break;
10819|   276k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 276k, False: 3.76M]
  ------------------
10820|   276k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   276k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   276k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 3.70k, False: 273k]
  |  |  ------------------
  ------------------
10822|   273k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 142k, False: 131k]
  ------------------
10823|   142k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   142k|	    }
10825|   273k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   273k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 924, False: 272k]
  |  |  ------------------
  ------------------
10826|   272k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 69.2k, False: 203k]
  ------------------
10827|  69.2k|                xmlXPathSubValues(ctxt);
10828|   203k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 71.9k, False: 131k]
  ------------------
10829|  71.9k|                xmlXPathAddValues(ctxt);
10830|   131k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 114k, False: 16.4k]
  ------------------
10831|   114k|                xmlXPathValueFlipSign(ctxt);
10832|  16.4k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 16.4k, False: 0]
  ------------------
10833|  16.4k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  16.4k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 16.4k, False: 0]
  |  |  |  Branch (297:34): [True: 13.7k, False: 2.65k]
  |  |  ------------------
  |  |  298|  16.4k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  16.4k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  16.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 3, False: 16.4k]
  |  |  |  Branch (271:34): [True: 3, False: 16.4k]
  |  |  ------------------
  |  |  272|  16.4k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      6|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  16.4k|            }
10836|   272k|            break;
10837|   272k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 181k, False: 3.85M]
  ------------------
10838|   181k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   181k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   181k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 8.39k, False: 172k]
  |  |  ------------------
  ------------------
10840|   172k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   172k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   172k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 397, False: 172k]
  |  |  ------------------
  ------------------
10842|   172k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 169k, False: 3.07k]
  ------------------
10843|   169k|                xmlXPathMultValues(ctxt);
10844|  3.07k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 1.50k, False: 1.56k]
  ------------------
10845|  1.50k|                xmlXPathDivValues(ctxt);
10846|  1.56k|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 1.56k, False: 0]
  ------------------
10847|  1.56k|                xmlXPathModValues(ctxt);
10848|   172k|            break;
10849|   136k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 136k, False: 3.90M]
  ------------------
10850|   136k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   136k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   136k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 596, False: 135k]
  |  |  ------------------
  ------------------
10852|   135k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   135k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   135k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 327, False: 135k]
  |  |  ------------------
  ------------------
10854|       |
10855|   135k|            arg2 = xmlXPathValuePop(ctxt);
10856|   135k|            arg1 = xmlXPathValuePop(ctxt);
10857|   135k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 135k]
  |  Branch (10857:35): [True: 41, False: 135k]
  ------------------
10858|   135k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 135k]
  |  Branch (10858:35): [True: 14, False: 135k]
  ------------------
10859|     55|	        xmlXPathReleaseObject(ctxt->context, arg1);
10860|     55|	        xmlXPathReleaseObject(ctxt->context, arg2);
10861|     55|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|     55|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10862|      0|            }
10863|   135k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 135k, False: 0]
  ------------------
10864|   135k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 135k, False: 0]
  ------------------
10865|   135k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 11, False: 135k]
  ------------------
10866|   135k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   135k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 135k, False: 0]
  ------------------
10868|   135k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 3, False: 135k]
  ------------------
10869|   135k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     14|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     14|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     14|                break;
10873|     14|            }
10874|       |
10875|   135k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 135k, False: 0]
  ------------------
10876|   135k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 50.9k, False: 84.2k]
  ------------------
10877|  50.9k|	    {
10878|  50.9k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  50.9k|							arg2->nodesetval);
10880|  50.9k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 44, False: 50.9k]
  ------------------
10881|     44|                    xmlXPathPErrMemory(ctxt);
10882|  50.9k|	    }
10883|       |
10884|   135k|            xmlXPathValuePush(ctxt, arg1);
10885|   135k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   135k|            break;
10887|   393k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 393k, False: 3.64M]
  ------------------
10888|   393k|            xmlXPathRoot(ctxt);
10889|   393k|            break;
10890|   849k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 849k, False: 3.19M]
  ------------------
10891|   849k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10891:17): [True: 0, False: 849k]
  ------------------
10892|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10893|   849k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   849k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 849k]
  |  |  ------------------
  ------------------
10894|   849k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10894:17): [True: 0, False: 849k]
  ------------------
10895|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10896|   849k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   849k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 849k]
  |  |  ------------------
  ------------------
10897|   849k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10898|   849k|                                                    ctxt->context->node));
10899|   849k|            break;
10900|  1.02M|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 1.02M, False: 3.01M]
  ------------------
10901|  1.02M|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 1.02M]
  ------------------
10902|      0|                    break;
10903|       |
10904|  1.02M|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|  1.02M|		CHECK_ERROR0;
  ------------------
  |  |  236|  1.02M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.45k, False: 1.02M]
  |  |  ------------------
  ------------------
10906|       |
10907|  1.02M|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|  1.02M|                break;
10909|  1.02M|            }
10910|   325k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 325k, False: 3.71M]
  ------------------
10911|   325k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   325k|            break;
10913|     64|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 64, False: 4.04M]
  ------------------
10914|     64|		xmlXPathObjectPtr val;
10915|       |
10916|     64|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 64]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     64|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 44, False: 20]
  ------------------
10920|     44|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     44|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 44, False: 0]
  ------------------
10922|     44|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     44|                                       "Undefined variable: %s\n", op->value4);
10924|     44|                        return 0;
10925|     44|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     20|		} else {
10928|     20|                    const xmlChar *URI;
10929|       |
10930|     20|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     20|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 9, False: 11]
  ------------------
10932|      9|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      9|                                       "Undefined namespace prefix: %s\n",
10934|      9|                                       op->value5);
10935|      9|                        return 0;
10936|      9|                    }
10937|     11|		    val = xmlXPathVariableLookupNS(ctxt->context,
10938|     11|                                                       op->value4, URI);
10939|     11|		    if (val == NULL) {
  ------------------
  |  Branch (10939:11): [True: 11, False: 0]
  ------------------
10940|     11|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10941|     11|                                       "Undefined variable: %s:%s\n",
10942|     11|                                       op->value5, op->value4);
10943|     11|                        return 0;
10944|     11|                    }
10945|      0|                    xmlXPathValuePush(ctxt, val);
10946|      0|                }
10947|      0|                break;
10948|     64|            }
10949|  49.7k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 49.7k, False: 3.99M]
  ------------------
10950|  49.7k|                xmlXPathFunction func;
10951|  49.7k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  49.7k|		int i;
10953|  49.7k|                int frame;
10954|       |
10955|  49.7k|                frame = ctxt->valueNr;
10956|  49.7k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 39.9k, False: 9.75k]
  ------------------
10957|  39.9k|                    total +=
10958|  39.9k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  39.9k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 897, False: 39.0k]
  ------------------
10960|    897|                        break;
10961|  39.9k|                }
10962|  48.8k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 48.8k]
  ------------------
10963|  48.8k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|   126k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 78.0k, False: 48.8k]
  ------------------
10965|  78.0k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 78.0k]
  ------------------
10966|  78.0k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  78.0k|                }
10968|  48.8k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 42.8k, False: 6.02k]
  ------------------
10969|  42.8k|                    func = op->cache;
10970|  6.02k|                else {
10971|  6.02k|                    const xmlChar *URI = NULL;
10972|       |
10973|  6.02k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 5.95k, False: 77]
  ------------------
10974|  5.95k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  5.95k|                                                      op->value4);
10976|  5.95k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 534, False: 5.41k]
  ------------------
10977|    534|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    534|                                           "Unregistered function: %s\n",
10979|    534|                                           op->value4);
10980|    534|                            return 0;
10981|    534|                        }
10982|  5.95k|                    } else {
10983|     77|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     77|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 69, False: 8]
  ------------------
10985|     69|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     69|                                           "Undefined namespace prefix: %s\n",
10987|     69|                                           op->value5);
10988|     69|                            return 0;
10989|     69|                        }
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|  5.41k|                    op->cache = func;
11000|  5.41k|                    op->cacheURI = (void *) URI;
11001|  5.41k|                }
11002|  48.2k|                oldFunc = ctxt->context->function;
11003|  48.2k|                oldFuncURI = ctxt->context->functionURI;
11004|  48.2k|                ctxt->context->function = op->value4;
11005|  48.2k|                ctxt->context->functionURI = op->cacheURI;
11006|  48.2k|                func(ctxt, op->value);
11007|  48.2k|                ctxt->context->function = oldFunc;
11008|  48.2k|                ctxt->context->functionURI = oldFuncURI;
11009|  48.2k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 47.9k, False: 271]
  ------------------
11010|  47.9k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 47.9k]
  ------------------
11011|  48.2k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  48.2k|                break;
11013|  48.2k|            }
11014|  79.9k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 79.9k, False: 3.96M]
  ------------------
11015|  79.9k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 39.9k, False: 39.9k]
  ------------------
11016|  39.9k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  39.9k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  39.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 493, False: 39.4k]
  |  |  ------------------
  ------------------
11018|  39.9k|            }
11019|  79.4k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 79.4k, False: 0]
  ------------------
11020|  79.4k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  79.4k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  79.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 897, False: 78.5k]
  |  |  ------------------
  ------------------
11022|  79.4k|	    }
11023|  78.5k|            break;
11024|  78.5k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 4.04M]
  ------------------
11025|  16.6k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 16.6k, False: 4.02M]
  ------------------
11026|  16.6k|                xmlXPathObjectPtr obj;
11027|  16.6k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  16.6k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 16.6k, False: 0]
  |  Branch (11032:40): [True: 16.6k, False: 0]
  ------------------
11033|  16.6k|#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|  16.6k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 9.04k, False: 7.62k]
  ------------------
11044|  7.62k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 7.55k, False: 73]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  16.5k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 11.7k, False: 4.81k]
  ------------------
11049|  11.7k|                    xmlXPathObjectPtr val;
11050|       |
11051|  11.7k|                    val = comp->steps[op->ch2].value4;
11052|  11.7k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 11.7k, False: 0]
  |  Branch (11052:42): [True: 11.7k, False: 9]
  ------------------
11053|  11.7k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 8.85k, False: 2.92k]
  ------------------
11054|  8.85k|                        xmlNodePtr first = NULL;
11055|       |
11056|  8.85k|                        total +=
11057|  8.85k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  8.85k|                                                    &comp->steps[op->ch1],
11059|  8.85k|                                                    &first);
11060|  8.85k|			CHECK_ERROR0;
  ------------------
  |  |  236|  8.85k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.31k, False: 7.53k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  7.53k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 7.53k, False: 0]
  ------------------
11066|  7.53k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 7.36k, False: 172]
  ------------------
11067|  7.36k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 7.36k, False: 0]
  ------------------
11068|  7.36k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 606, False: 6.75k]
  ------------------
11069|    606|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    606|                                                        1, 1);
11071|  7.53k|                        break;
11072|  8.85k|                    }
11073|  11.7k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  7.81k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 7.81k, False: 0]
  |  Branch (11077:40): [True: 7.81k, False: 0]
  ------------------
11078|  7.81k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 4.92k, False: 2.89k]
  ------------------
11079|  4.92k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 4.47k, False: 448]
  ------------------
11080|  4.47k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  4.47k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 4.47k, False: 0]
  ------------------
11083|  4.47k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.49k, False: 1.97k]
  ------------------
11084|  2.49k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 2.27k, False: 227]
  ------------------
11085|  2.27k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 2.00k, False: 266]
  ------------------
11086|  2.00k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 2.00k, False: 0]
  ------------------
11087|  2.00k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.93k, False: 69]
  ------------------
11088|  2.00k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.93k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.93k|                        total +=
11092|  1.93k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.93k|                                                   &comp->steps[op->ch1],
11094|  1.93k|                                                   &last);
11095|  1.93k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.93k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 33, False: 1.90k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.90k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.90k, False: 0]
  ------------------
11101|  1.90k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.86k, False: 35]
  ------------------
11102|  1.86k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.86k, False: 0]
  ------------------
11103|  1.86k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.75k, False: 109]
  ------------------
11104|  1.75k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 417, False: 1.34k]
  ------------------
11105|    417|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.90k|                        break;
11107|  1.93k|                    }
11108|  4.47k|                }
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|  5.87k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 5.87k, False: 0]
  ------------------
11121|  5.87k|                    total +=
11122|  5.87k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  5.87k|		CHECK_ERROR0;
  ------------------
  |  |  236|  5.87k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 496, False: 5.38k]
  |  |  ------------------
  ------------------
11124|  5.38k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 5.38k]
  ------------------
11125|      0|                    break;
11126|  5.38k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 5.38k]
  ------------------
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|  5.38k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  5.38k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 5.38k]
  |  |  |  Branch (271:34): [True: 37, False: 5.34k]
  |  |  ------------------
  |  |  272|  5.38k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     37|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  5.34k|                obj = xmlXPathValuePop(ctxt);
11137|  5.34k|                set = obj->nodesetval;
11138|  5.34k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 5.34k, False: 0]
  ------------------
11139|  5.34k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  5.34k|                                          1, set->nodeNr, 1);
11141|  5.34k|                xmlXPathValuePush(ctxt, obj);
11142|  5.34k|                break;
11143|  5.38k|            }
11144|  97.7k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 97.7k, False: 3.94M]
  ------------------
11145|  97.7k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 97.7k, False: 0]
  ------------------
11146|  97.7k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|  97.7k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  97.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.28k, False: 93.4k]
  |  |  ------------------
  ------------------
11148|  93.4k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 93.4k, False: 0]
  ------------------
11149|  93.4k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 54.5k, False: 38.9k]
  ------------------
11150|  54.5k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 54.5k, False: 0]
  ------------------
11151|  54.5k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 3.72k, False: 50.8k]
  ------------------
11152|  3.72k|	    {
11153|  3.72k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  3.72k|	    }
11155|  93.4k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 4.04M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  4.04M|    }
11160|       |
11161|  4.00M|    ctxt->context->depth -= 1;
11162|  4.00M|    return (total);
11163|  4.04M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  18.0k|{
10407|  18.0k|    int total = 0, cur;
10408|  18.0k|    xmlXPathCompExprPtr comp;
10409|  18.0k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  18.0k|    CHECK_ERROR0;
  ------------------
  |  |  236|  18.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 18.0k]
  |  |  ------------------
  ------------------
10412|  18.0k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  18.0k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 18.0k, False: 0]
  |  |  |  Branch (818:39): [True: 0, False: 18.0k]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|  18.0k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  18.0k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 3, False: 18.0k]
  ------------------
10415|  18.0k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      3|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  18.0k|    ctxt->context->depth += 1;
10417|  18.0k|    comp = ctxt->comp;
10418|  18.0k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 18.0k]
  ------------------
10420|      0|            break;
10421|  2.61k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.61k, False: 15.3k]
  ------------------
10422|  2.61k|            total =
10423|  2.61k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.61k|                                        first);
10425|  2.61k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.61k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 231, False: 2.38k]
  |  |  ------------------
  ------------------
10426|  2.38k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10426:17): [True: 2.38k, False: 0]
  ------------------
10427|  2.38k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10427:20): [True: 2.38k, False: 3]
  ------------------
10428|  2.38k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10428:20): [True: 2.38k, False: 0]
  ------------------
10429|  2.38k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10429:20): [True: 1.56k, False: 812]
  ------------------
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.56k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 814, False: 755]
  ------------------
10441|    814|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.56k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.56k|            }
10444|  2.38k|            cur =
10445|  2.38k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch2],
10446|  2.38k|                                        first);
10447|  2.38k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.38k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 19, False: 2.36k]
  |  |  ------------------
  ------------------
10448|       |
10449|  2.36k|            arg2 = xmlXPathValuePop(ctxt);
10450|  2.36k|            arg1 = xmlXPathValuePop(ctxt);
10451|  2.36k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10451:17): [True: 0, False: 2.36k]
  |  Branch (10451:35): [True: 3, False: 2.36k]
  ------------------
10452|  2.36k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10452:17): [True: 0, False: 2.36k]
  |  Branch (10452:35): [True: 6, False: 2.35k]
  ------------------
10453|      9|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      9|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      9|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      9|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.35k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.35k, False: 0]
  ------------------
10458|  2.35k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.35k, False: 0]
  ------------------
10459|  2.35k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.35k]
  ------------------
10460|  2.35k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.35k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.35k, False: 0]
  ------------------
10462|  2.35k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.35k]
  ------------------
10463|  2.35k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.35k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.35k, False: 0]
  ------------------
10470|  2.35k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 236, False: 2.12k]
  ------------------
10471|    236|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    236|                                                        arg2->nodesetval);
10473|    236|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 1, False: 235]
  ------------------
10474|      1|                    xmlXPathPErrMemory(ctxt);
10475|    236|            }
10476|  2.35k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.35k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.35k|            total += cur;
10479|  2.35k|            break;
10480|    426|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 426, False: 17.5k]
  ------------------
10481|    426|            xmlXPathRoot(ctxt);
10482|    426|            break;
10483|  1.00k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 1.00k, False: 16.9k]
  ------------------
10484|  1.00k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10484:17): [True: 0, False: 1.00k]
  ------------------
10485|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10486|  1.00k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.00k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.00k]
  |  |  ------------------
  ------------------
10487|  1.00k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10487:17): [True: 0, False: 1.00k]
  ------------------
10488|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10489|  1.00k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.00k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.00k]
  |  |  ------------------
  ------------------
10490|  1.00k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10491|  1.00k|		ctxt->context->node));
10492|  1.00k|            break;
10493|  4.88k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 4.88k, False: 13.1k]
  ------------------
10494|  4.88k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 4.88k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  4.88k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  4.88k|		CHECK_ERROR0;
  ------------------
  |  |  236|  4.88k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 9, False: 4.87k]
  |  |  ------------------
  ------------------
10499|       |
10500|  4.87k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  4.87k|                break;
10502|  4.88k|            }
10503|      6|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 6, False: 18.0k]
  ------------------
10504|      6|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      6|            break;
10506|  4.15k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 4.15k, False: 13.8k]
  ------------------
10507|  4.15k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 4.15k, False: 0]
  ------------------
10508|  4.15k|                total +=
10509|  4.15k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  4.15k|                                            first);
10511|  4.15k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  4.15k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 44, False: 4.11k]
  |  |  ------------------
  ------------------
10512|  4.11k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 4.11k, False: 0]
  ------------------
10513|  4.11k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 4.00k, False: 105]
  ------------------
10514|  4.00k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 4.00k, False: 0]
  ------------------
10515|  4.00k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 617, False: 3.39k]
  ------------------
10516|    617|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  4.11k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  4.80k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 4.80k, False: 13.2k]
  ------------------
10520|  4.80k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  4.80k|            break;
10522|      0|#endif
10523|    112|        default:
  ------------------
  |  Branch (10523:9): [True: 112, False: 17.8k]
  ------------------
10524|    112|            total += xmlXPathCompOpEval(ctxt, op);
10525|    112|            break;
10526|  18.0k|    }
10527|       |
10528|  17.6k|    ctxt->context->depth -= 1;
10529|  17.6k|    return(total);
10530|  18.0k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  4.80k|{
10669|  4.80k|    int total = 0;
10670|  4.80k|    xmlXPathCompExprPtr comp;
10671|  4.80k|    xmlXPathObjectPtr obj;
10672|  4.80k|    xmlNodeSetPtr set;
10673|       |
10674|  4.80k|    CHECK_ERROR0;
  ------------------
  |  |  236|  4.80k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 4.80k]
  |  |  ------------------
  ------------------
10675|  4.80k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  4.80k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 4.80k, False: 0]
  |  Branch (10679:28): [True: 4.80k, False: 0]
  ------------------
10680|  4.80k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 3.51k, False: 1.28k]
  ------------------
10681|  3.51k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 2.35k, False: 1.15k]
  ------------------
10682|  2.35k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  2.35k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 2.35k, False: 0]
  ------------------
10685|  2.35k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 2.02k, False: 334]
  ------------------
10686|  2.02k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 1.94k, False: 77]
  ------------------
10687|  1.94k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 1.74k, False: 206]
  ------------------
10688|  1.74k|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 1.74k, False: 0]
  ------------------
10689|  1.74k|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 1.66k, False: 75]
  ------------------
10690|  1.74k|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  1.74k|#define BAD_CAST (xmlChar *)
  ------------------
10691|  1.66k|	    xmlNodePtr last = NULL;
10692|       |
10693|  1.66k|	    total +=
10694|  1.66k|		xmlXPathCompOpEvalLast(ctxt,
10695|  1.66k|		    &comp->steps[op->ch1],
10696|  1.66k|		    &last);
10697|  1.66k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.66k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 10, False: 1.65k]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|  1.65k|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 1.65k, False: 0]
  ------------------
10703|  1.65k|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 1.58k, False: 71]
  ------------------
10704|  1.58k|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 1.58k, False: 0]
  ------------------
10705|  1.58k|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 1.32k, False: 260]
  ------------------
10706|  1.32k|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 264, False: 1.06k]
  ------------------
10707|    264|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    264|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    264|	    }
10710|  1.65k|	    return (total);
10711|  1.66k|	}
10712|  2.35k|    }
10713|       |
10714|  3.13k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 3.13k, False: 0]
  ------------------
10715|  3.13k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  3.13k|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.13k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.25k, False: 1.88k]
  |  |  ------------------
  ------------------
10717|  1.88k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 1.88k]
  ------------------
10718|      0|	return (total);
10719|  1.88k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 1.88k]
  ------------------
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|  1.88k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.88k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.88k]
  |  |  |  Branch (271:34): [True: 18, False: 1.86k]
  |  |  ------------------
  |  |  272|  1.88k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     18|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  1.86k|    obj = xmlXPathValuePop(ctxt);
10729|  1.86k|    set = obj->nodesetval;
10730|  1.86k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 1.86k, False: 0]
  ------------------
10731|  1.86k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  1.86k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 410, False: 1.45k]
  ------------------
10733|    410|            *first = set->nodeTab[0];
10734|  1.86k|    }
10735|  1.86k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  1.86k|    return (total);
10738|  1.88k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  31.3k|{
10545|  31.3k|    int total = 0, cur;
10546|  31.3k|    xmlXPathCompExprPtr comp;
10547|  31.3k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  31.3k|    CHECK_ERROR0;
  ------------------
  |  |  236|  31.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 31.3k]
  |  |  ------------------
  ------------------
10550|  31.3k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  31.3k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 31.3k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 31.3k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  31.3k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  31.3k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 31.3k]
  ------------------
10553|  31.3k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  31.3k|    ctxt->context->depth += 1;
10555|  31.3k|    comp = ctxt->comp;
10556|  31.3k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 31.3k]
  ------------------
10558|      0|            break;
10559|  12.1k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 12.1k, False: 19.2k]
  ------------------
10560|  12.1k|            total =
10561|  12.1k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  12.1k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  12.1k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 107, False: 12.0k]
  |  |  ------------------
  ------------------
10563|  12.0k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 12.0k, False: 0]
  ------------------
10564|  12.0k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 12.0k, False: 1]
  ------------------
10565|  12.0k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 12.0k, False: 0]
  ------------------
10566|  12.0k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 8.35k, False: 3.65k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  8.35k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 1.80k, False: 6.54k]
  ------------------
10571|  1.80k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  8.35k|                *last =
10573|  8.35k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  8.35k|                                                     nodesetval->nodeNr -
10575|  8.35k|                                                     1];
10576|  8.35k|            }
10577|  12.0k|            cur =
10578|  12.0k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  12.0k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  12.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 24, False: 11.9k]
  |  |  ------------------
  ------------------
10580|  11.9k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 11.9k, False: 0]
  ------------------
10581|  11.9k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 11.9k, False: 1]
  ------------------
10582|  11.9k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 11.9k, False: 0]
  ------------------
10583|  11.9k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 3.03k, False: 8.94k]
  ------------------
10584|  3.03k|            }
10585|       |
10586|  11.9k|            arg2 = xmlXPathValuePop(ctxt);
10587|  11.9k|            arg1 = xmlXPathValuePop(ctxt);
10588|  11.9k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 11.9k]
  |  Branch (10588:35): [True: 1, False: 11.9k]
  ------------------
10589|  11.9k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 11.9k]
  |  Branch (10589:35): [True: 1, False: 11.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|  11.9k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 11.9k, False: 0]
  ------------------
10595|  11.9k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 11.9k, False: 0]
  ------------------
10596|  11.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 11.9k]
  ------------------
10597|  11.9k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  11.9k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 11.9k, False: 0]
  ------------------
10599|  11.9k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 11.9k]
  ------------------
10600|  11.9k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  11.9k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 11.9k, False: 0]
  ------------------
10607|  11.9k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 3.03k, False: 8.94k]
  ------------------
10608|  3.03k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  3.03k|                                                        arg2->nodesetval);
10610|  3.03k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 3, False: 3.03k]
  ------------------
10611|      3|                    xmlXPathPErrMemory(ctxt);
10612|  3.03k|            }
10613|  11.9k|            xmlXPathValuePush(ctxt, arg1);
10614|  11.9k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  11.9k|            total += cur;
10616|  11.9k|            break;
10617|    647|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 647, False: 30.6k]
  ------------------
10618|    647|            xmlXPathRoot(ctxt);
10619|    647|            break;
10620|  1.31k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 1.31k, False: 29.9k]
  ------------------
10621|  1.31k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 1.31k]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|  1.31k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.31k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.31k]
  |  |  ------------------
  ------------------
10624|  1.31k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 1.31k]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|  1.31k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.31k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.31k]
  |  |  ------------------
  ------------------
10627|  1.31k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|  1.31k|		ctxt->context->node));
10629|  1.31k|            break;
10630|  13.5k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 13.5k, False: 17.7k]
  ------------------
10631|  13.5k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 13.5k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  13.5k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  13.5k|		CHECK_ERROR0;
  ------------------
  |  |  236|  13.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 16, False: 13.5k]
  |  |  ------------------
  ------------------
10636|       |
10637|  13.5k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  13.5k|                break;
10639|  13.5k|            }
10640|      2|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 2, False: 31.3k]
  ------------------
10641|      2|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      2|            break;
10643|  3.60k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 3.60k, False: 27.7k]
  ------------------
10644|  3.60k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 3.60k, False: 0]
  ------------------
10645|  3.60k|                total +=
10646|  3.60k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  3.60k|                                           last);
10648|  3.60k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.60k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 43, False: 3.55k]
  |  |  ------------------
  ------------------
10649|  3.55k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 3.55k, False: 0]
  ------------------
10650|  3.55k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 3.45k, False: 106]
  ------------------
10651|  3.45k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 3.45k, False: 0]
  ------------------
10652|  3.45k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 681, False: 2.77k]
  ------------------
10653|    681|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  3.55k|            break;
10655|    110|        default:
  ------------------
  |  Branch (10655:9): [True: 110, False: 31.2k]
  ------------------
10656|    110|            total += xmlXPathCompOpEval(ctxt, op);
10657|    110|            break;
10658|  31.3k|    }
10659|       |
10660|  31.1k|    ctxt->context->depth -= 1;
10661|  31.1k|    return (total);
10662|  31.3k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|    681|{
 3168|    681|    int i;
 3169|    681|    xmlNodePtr node;
 3170|       |
 3171|    681|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 681]
  |  Branch (3171:26): [True: 0, False: 681]
  ------------------
 3172|      0|	return;
 3173|  5.87k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 5.19k, False: 681]
  ------------------
 3174|  5.19k|        node = set->nodeTab[i];
 3175|  5.19k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 5.19k, False: 0]
  ------------------
 3176|  5.19k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 5.19k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  5.19k|    }
 3179|    681|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|    681|    set->nodeNr = 1;
 3181|    681|}

xmlXPtrEval:
  607|  11.6k|xmlXPtrEval(const xmlChar *str, xmlXPathContext *ctx) {
  608|  11.6k|    xmlXPathParserContextPtr ctxt;
  609|  11.6k|    xmlXPathObjectPtr res = NULL, tmp;
  610|  11.6k|    xmlXPathObjectPtr init = NULL;
  611|  11.6k|    int stack = 0;
  612|       |
  613|  11.6k|    xmlInitParser();
  614|       |
  615|  11.6k|    if ((ctx == NULL) || (str == NULL))
  ------------------
  |  Branch (615:9): [True: 0, False: 11.6k]
  |  Branch (615:26): [True: 0, False: 11.6k]
  ------------------
  616|      0|	return(NULL);
  617|       |
  618|  11.6k|    xmlResetError(&ctx->lastError);
  619|       |
  620|  11.6k|    ctxt = xmlXPathNewParserContext(str, ctx);
  621|  11.6k|    if (ctxt == NULL) {
  ------------------
  |  Branch (621:9): [True: 96, False: 11.5k]
  ------------------
  622|     96|        xmlXPathErrMemory(ctx);
  623|     96|	return(NULL);
  624|     96|    }
  625|  11.5k|    xmlXPtrEvalXPointer(ctxt);
  626|  11.5k|    if (ctx->lastError.code != XML_ERR_OK)
  ------------------
  |  Branch (626:9): [True: 7.65k, False: 3.90k]
  ------------------
  627|  7.65k|        goto error;
  628|       |
  629|  3.90k|    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (629:9): [True: 1.23k, False: 2.67k]
  ------------------
  630|  1.23k|	(ctxt->value->type != XPATH_NODESET)) {
  ------------------
  |  Branch (630:2): [True: 0, False: 1.23k]
  ------------------
  631|      0|        xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
  632|      0|		"xmlXPtrEval: evaluation failed to return a node set\n",
  633|      0|		   NULL);
  634|  3.90k|    } else {
  635|  3.90k|	res = xmlXPathValuePop(ctxt);
  636|  3.90k|    }
  637|       |
  638|  3.90k|    do {
  639|  3.90k|        tmp = xmlXPathValuePop(ctxt);
  640|  3.90k|	if (tmp != NULL) {
  ------------------
  |  Branch (640:6): [True: 0, False: 3.90k]
  ------------------
  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|  3.90k|    } while (tmp != NULL);
  ------------------
  |  Branch (656:14): [True: 0, False: 3.90k]
  ------------------
  657|  3.90k|    if (stack != 0) {
  ------------------
  |  Branch (657:9): [True: 0, False: 3.90k]
  ------------------
  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|  3.90k|    if (ctx->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (662:9): [True: 0, False: 3.90k]
  ------------------
  663|      0|	xmlXPathFreeObject(res);
  664|      0|	res = NULL;
  665|      0|    }
  666|       |
  667|  11.5k|error:
  668|  11.5k|    xmlXPathFreeParserContext(ctxt);
  669|  11.5k|    return(res);
  670|  3.90k|}
xpointer.c:xmlXPtrEvalXPointer:
  528|  11.5k|xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
  529|  11.5k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (529:9): [True: 11.5k, False: 0]
  ------------------
  530|       |	/* Allocate the value stack */
  531|  11.5k|	ctxt->valueTab = (xmlXPathObjectPtr *)
  532|  11.5k|			 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
  533|  11.5k|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (533:6): [True: 30, False: 11.5k]
  ------------------
  534|     30|	    xmlXPathPErrMemory(ctxt);
  535|     30|	    return;
  536|     30|	}
  537|  11.5k|	ctxt->valueNr = 0;
  538|  11.5k|	ctxt->valueMax = 10;
  539|  11.5k|	ctxt->value = NULL;
  540|  11.5k|    }
  541|  11.5k|    SKIP_BLANKS;
  ------------------
  |  |  178|  11.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  13.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.42k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  11.5k|    if (CUR == '/') {
  ------------------
  |  |  173|  11.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (542:9): [True: 184, False: 11.3k]
  ------------------
  543|    184|	xmlXPathRoot(ctxt);
  544|    184|        xmlXPtrEvalChildSeq(ctxt, NULL);
  545|  11.3k|    } else {
  546|  11.3k|	xmlChar *name;
  547|       |
  548|  11.3k|	name = xmlXPathParseName(ctxt);
  549|  11.3k|	if (name == NULL)
  ------------------
  |  Branch (549:6): [True: 138, False: 11.2k]
  ------------------
  550|  11.2k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    138|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  551|  11.2k|	if (CUR == '(') {
  ------------------
  |  |  173|  11.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (551:6): [True: 10.7k, False: 474]
  ------------------
  552|  10.7k|	    xmlXPtrEvalFullXPtr(ctxt, name);
  553|       |	    /* Short evaluation */
  554|  10.7k|	    return;
  555|  10.7k|	} else {
  556|       |	    /* this handle both Bare Names and Child Sequences */
  557|    474|	    xmlXPtrEvalChildSeq(ctxt, name);
  558|    474|	}
  559|  11.2k|    }
  560|    658|    SKIP_BLANKS;
  ------------------
  |  |  178|  2.02k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  13.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.02k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  561|    658|    if (CUR != 0)
  ------------------
  |  |  173|    658|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (561:9): [True: 352, False: 306]
  ------------------
  562|    352|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    352|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  563|    306|}
xpointer.c:xmlXPtrEvalChildSeq:
  478|    696|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|    696|    if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  173|    187|#define CUR (*ctxt->cur)
  ------------------
                  if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  175|    187|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (483:9): [True: 187, False: 509]
  |  Branch (483:27): [True: 187, False: 0]
  |  Branch (483:43): [True: 84, False: 103]
  ------------------
  484|     84|        xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
  485|     84|		   "warning: ChildSeq not starting by /1\n", NULL);
  486|     84|    }
  487|       |
  488|    696|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 509, False: 187]
  ------------------
  489|    509|	xmlXPathValuePush(ctxt, xmlXPathNewString(name));
  490|    509|	xmlFree(name);
  491|    509|	xmlXPathIdFunction(ctxt, 1);
  492|    509|	CHECK_ERROR;
  ------------------
  |  |  230|    509|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 19, False: 490]
  |  |  ------------------
  ------------------
  493|    509|    }
  494|       |
  495|  1.90k|    while (CUR == '/') {
  ------------------
  |  |  173|  1.90k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (495:12): [True: 1.22k, False: 677]
  ------------------
  496|  1.22k|	int child = 0, overflow = 0;
  497|  1.22k|	NEXT;
  ------------------
  |  |  181|  1.22k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
  498|       |
  499|  4.24k|	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  4.24k|#define CUR (*ctxt->cur)
  ------------------
              	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  3.22k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (499:9): [True: 3.22k, False: 1.02k]
  |  Branch (499:25): [True: 3.01k, False: 208]
  ------------------
  500|  3.01k|            int d = CUR - '0';
  ------------------
  |  |  173|  3.01k|#define CUR (*ctxt->cur)
  ------------------
  501|  3.01k|            if (child > INT_MAX / 10)
  ------------------
  |  Branch (501:17): [True: 942, False: 2.07k]
  ------------------
  502|    942|                overflow = 1;
  503|  2.07k|            else
  504|  2.07k|                child *= 10;
  505|  3.01k|            if (child > INT_MAX - d)
  ------------------
  |  Branch (505:17): [True: 112, False: 2.90k]
  ------------------
  506|    112|                overflow = 1;
  507|  2.90k|            else
  508|  2.90k|                child += d;
  509|  3.01k|	    NEXT;
  ------------------
  |  |  181|  3.01k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 3.01k, False: 0]
  |  |  ------------------
  ------------------
  510|  3.01k|	}
  511|  1.22k|        if (overflow)
  ------------------
  |  Branch (511:13): [True: 78, False: 1.15k]
  ------------------
  512|     78|            child = 0;
  513|  1.22k|	xmlXPtrGetChildNo(ctxt, child);
  514|  1.22k|    }
  515|    677|}
xpointer.c:xmlXPtrGetChildNo:
  191|  1.22k|xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
  192|  1.22k|    xmlNodePtr cur = NULL;
  193|  1.22k|    xmlXPathObjectPtr obj;
  194|  1.22k|    xmlNodeSetPtr oldset;
  195|       |
  196|  1.22k|    CHECK_TYPE(XPATH_NODESET);
  ------------------
  |  |  261|  1.22k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 220, False: 1.00k]
  |  |  |  Branch (261:34): [True: 0, False: 1.00k]
  |  |  ------------------
  |  |  262|  1.22k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|    220|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
  197|  1.00k|    obj = xmlXPathValuePop(ctxt);
  198|  1.00k|    oldset = obj->nodesetval;
  199|  1.00k|    if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
  ------------------
  |  Branch (199:9): [True: 720, False: 288]
  |  Branch (199:24): [True: 0, False: 288]
  |  Branch (199:44): [True: 82, False: 206]
  ------------------
  200|    802|	xmlXPathFreeObject(obj);
  201|    802|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  202|    802|	return;
  203|    802|    }
  204|    206|    cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
  205|    206|    if (cur == NULL) {
  ------------------
  |  Branch (205:9): [True: 120, False: 86]
  ------------------
  206|    120|	xmlXPathFreeObject(obj);
  207|    120|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  208|    120|	return;
  209|    120|    }
  210|     86|    oldset->nodeTab[0] = cur;
  211|     86|    xmlXPathValuePush(ctxt, obj);
  212|     86|}
xpointer.c:xmlXPtrGetNthChild:
  124|    206|xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
  125|    206|    int i;
  126|    206|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (126:9): [True: 0, False: 206]
  |  Branch (126:26): [True: 0, False: 206]
  ------------------
  127|      0|	return(cur);
  128|    206|    cur = cur->children;
  129|  1.16k|    for (i = 0;i <= no;cur = cur->next) {
  ------------------
  |  Branch (129:16): [True: 1.16k, False: 0]
  ------------------
  130|  1.16k|	if (cur == NULL)
  ------------------
  |  Branch (130:6): [True: 120, False: 1.04k]
  ------------------
  131|    120|	    return(cur);
  132|  1.04k|	if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (132:6): [True: 753, False: 295]
  ------------------
  133|    295|	    (cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (133:6): [True: 0, False: 295]
  ------------------
  134|    753|	    (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (134:6): [True: 0, False: 295]
  ------------------
  135|    753|	    i++;
  136|    753|	    if (i == no)
  ------------------
  |  Branch (136:10): [True: 86, False: 667]
  ------------------
  137|     86|		break;
  138|    753|	}
  139|  1.04k|    }
  140|     86|    return(cur);
  141|    206|}
xpointer.c:xmlXPtrEvalFullXPtr:
  415|  10.7k|xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  416|  10.7k|    if (name == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 10.7k]
  ------------------
  417|      0|    name = xmlXPathParseName(ctxt);
  418|  10.7k|    if (name == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 10.7k]
  ------------------
  419|  10.7k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  420|  21.6k|    while (name != NULL) {
  ------------------
  |  Branch (420:12): [True: 18.7k, False: 2.91k]
  ------------------
  421|  18.7k|	ctxt->error = XPATH_EXPRESSION_OK;
  422|  18.7k|	xmlXPtrEvalXPtrPart(ctxt, name);
  423|       |
  424|       |	/* in case of syntax error, break here */
  425|  18.7k|	if ((ctxt->error != XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (425:6): [True: 7.41k, False: 11.2k]
  ------------------
  426|  7.41k|            (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
  ------------------
  |  Branch (426:13): [True: 6.88k, False: 534]
  ------------------
  427|  6.88k|	    return;
  428|       |
  429|       |	/*
  430|       |	 * If the returned value is a non-empty nodeset
  431|       |	 * or location set, return here.
  432|       |	 */
  433|  11.8k|	if (ctxt->value != NULL) {
  ------------------
  |  Branch (433:6): [True: 10.6k, False: 1.15k]
  ------------------
  434|  10.6k|	    xmlXPathObjectPtr obj = ctxt->value;
  435|       |
  436|  10.6k|	    switch (obj->type) {
  437|  1.90k|		case XPATH_NODESET: {
  ------------------
  |  Branch (437:3): [True: 1.90k, False: 8.76k]
  ------------------
  438|  1.90k|		    xmlNodeSetPtr loc = ctxt->value->nodesetval;
  439|  1.90k|		    if ((loc != NULL) && (loc->nodeNr > 0))
  ------------------
  |  Branch (439:11): [True: 1.90k, False: 0]
  |  Branch (439:28): [True: 942, False: 967]
  ------------------
  440|    942|			return;
  441|    967|		    break;
  442|  1.90k|		}
  443|  8.76k|		default:
  ------------------
  |  Branch (443:3): [True: 8.76k, False: 1.90k]
  ------------------
  444|  8.76k|		    break;
  445|  10.6k|	    }
  446|       |
  447|       |	    /*
  448|       |	     * Evaluating to improper values is equivalent to
  449|       |	     * a sub-resource error, clean-up the stack
  450|       |	     */
  451|  19.4k|	    do {
  452|  19.4k|		obj = xmlXPathValuePop(ctxt);
  453|  19.4k|		if (obj != NULL) {
  ------------------
  |  Branch (453:7): [True: 9.73k, False: 9.73k]
  ------------------
  454|  9.73k|		    xmlXPathFreeObject(obj);
  455|  9.73k|		}
  456|  19.4k|	    } while (obj != NULL);
  ------------------
  |  Branch (456:15): [True: 9.73k, False: 9.73k]
  ------------------
  457|  9.73k|	}
  458|       |
  459|       |	/*
  460|       |	 * Is there another XPointer part.
  461|       |	 */
  462|  10.8k|	SKIP_BLANKS;
  ------------------
  |  |  178|  10.8k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  19.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 7.72k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  10.8k|	name = xmlXPathParseName(ctxt);
  464|  10.8k|    }
  465|  10.7k|}
xpointer.c:xmlXPtrEvalXPtrPart:
  248|  18.7k|xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  249|  18.7k|    xmlChar *buffer, *cur;
  250|  18.7k|    int len;
  251|  18.7k|    int level;
  252|       |
  253|  18.7k|    if (name == NULL)
  ------------------
  |  Branch (253:9): [True: 0, False: 18.7k]
  ------------------
  254|      0|    name = xmlXPathParseName(ctxt);
  255|  18.7k|    if (name == NULL)
  ------------------
  |  Branch (255:9): [True: 0, False: 18.7k]
  ------------------
  256|  18.7k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  257|       |
  258|  18.7k|    if (CUR != '(') {
  ------------------
  |  |  173|  18.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (258:9): [True: 1.30k, False: 17.3k]
  ------------------
  259|  1.30k|        xmlFree(name);
  260|  1.30k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  1.30k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  261|      0|    }
  262|  17.3k|    NEXT;
  ------------------
  |  |  181|  17.3k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 17.3k, False: 0]
  |  |  ------------------
  ------------------
  263|  17.3k|    level = 1;
  264|       |
  265|  17.3k|    len = xmlStrlen(ctxt->cur);
  266|       |    /* Overflow in xmlStrlen */
  267|  17.3k|    if (len == 0 && ctxt->cur != NULL && *ctxt->cur != 0) {
  ------------------
  |  Branch (267:9): [True: 34, False: 17.3k]
  |  Branch (267:21): [True: 34, False: 0]
  |  Branch (267:42): [True: 0, False: 34]
  ------------------
  268|      0|        xmlXPathPErrMemory(ctxt);
  269|      0|        xmlFree(name);
  270|      0|        return;
  271|      0|    }
  272|       |
  273|  17.3k|    len++;
  274|  17.3k|    buffer = xmlMalloc(len);
  275|  17.3k|    if (buffer == NULL) {
  ------------------
  |  Branch (275:9): [True: 31, False: 17.3k]
  ------------------
  276|     31|        xmlXPathPErrMemory(ctxt);
  277|     31|        xmlFree(name);
  278|     31|	return;
  279|     31|    }
  280|       |
  281|  17.3k|    cur = buffer;
  282|  3.40M|    while (CUR != 0) {
  ------------------
  |  |  173|  3.40M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (282:12): [True: 3.40M, False: 204]
  ------------------
  283|  3.40M|	if (CUR == ')') {
  ------------------
  |  |  173|  3.40M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (283:6): [True: 32.1k, False: 3.36M]
  ------------------
  284|  32.1k|	    level--;
  285|  32.1k|	    if (level == 0) {
  ------------------
  |  Branch (285:10): [True: 17.1k, False: 14.9k]
  ------------------
  286|  17.1k|		NEXT;
  ------------------
  |  |  181|  17.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 17.1k, False: 0]
  |  |  ------------------
  ------------------
  287|  17.1k|		break;
  288|  17.1k|	    }
  289|  3.36M|	} else if (CUR == '(') {
  ------------------
  |  |  173|  3.36M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (289:13): [True: 17.4k, False: 3.35M]
  ------------------
  290|  17.4k|	    level++;
  291|  3.35M|	} else if (CUR == '^') {
  ------------------
  |  |  173|  3.35M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (291:13): [True: 17.3k, False: 3.33M]
  ------------------
  292|  17.3k|            if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  17.3k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  17.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  16.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (292:17): [True: 352, False: 17.0k]
  |  Branch (292:36): [True: 452, False: 16.5k]
  |  Branch (292:55): [True: 15.7k, False: 868]
  ------------------
  293|  16.5k|                NEXT;
  ------------------
  |  |  181|  16.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 16.5k, False: 0]
  |  |  ------------------
  ------------------
  294|  16.5k|            }
  295|  17.3k|	}
  296|  3.38M|        *cur++ = CUR;
  ------------------
  |  |  173|  3.38M|#define CUR (*ctxt->cur)
  ------------------
  297|  3.38M|	NEXT;
  ------------------
  |  |  181|  3.38M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 3.38M, False: 0]
  |  |  ------------------
  ------------------
  298|  3.38M|    }
  299|  17.3k|    *cur = 0;
  300|       |
  301|  17.3k|    if ((level != 0) && (CUR == 0)) {
  ------------------
  |  |  173|    204|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (301:9): [True: 204, False: 17.1k]
  |  Branch (301:25): [True: 204, False: 0]
  ------------------
  302|    204|        xmlFree(name);
  303|    204|	xmlFree(buffer);
  304|    204|	XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|    204|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  305|      0|    }
  306|       |
  307|  17.1k|    if (xmlStrEqual(name, (xmlChar *) "xpointer") ||
  ------------------
  |  Branch (307:9): [True: 16.1k, False: 1.04k]
  ------------------
  308|  16.1k|        xmlStrEqual(name, (xmlChar *) "xpath1")) {
  ------------------
  |  Branch (308:9): [True: 26, False: 1.01k]
  ------------------
  309|  16.1k|	const xmlChar *oldBase = ctxt->base;
  310|  16.1k|	const xmlChar *oldCur = ctxt->cur;
  311|       |
  312|  16.1k|	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|  16.1k|	ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
  320|  16.1k|	ctxt->context->proximityPosition = 1;
  321|  16.1k|	ctxt->context->contextSize = 1;
  322|  16.1k|	xmlXPathEvalExpr(ctxt);
  323|  16.1k|	ctxt->base = oldBase;
  324|  16.1k|        ctxt->cur = oldCur;
  325|  16.1k|    } else if (xmlStrEqual(name, (xmlChar *) "element")) {
  ------------------
  |  Branch (325:16): [True: 41, False: 974]
  ------------------
  326|     41|	const xmlChar *oldBase = ctxt->base;
  327|     41|	const xmlChar *oldCur = ctxt->cur;
  328|     41|	xmlChar *name2;
  329|       |
  330|     41|	ctxt->cur = ctxt->base = buffer;
  331|     41|	if (buffer[0] == '/') {
  ------------------
  |  Branch (331:6): [True: 3, False: 38]
  ------------------
  332|      3|	    xmlXPathRoot(ctxt);
  333|      3|	    xmlXPtrEvalChildSeq(ctxt, NULL);
  334|     38|	} else {
  335|     38|	    name2 = xmlXPathParseName(ctxt);
  336|     38|	    if (name2 == NULL) {
  ------------------
  |  Branch (336:10): [True: 3, False: 35]
  ------------------
  337|      3|                ctxt->base = oldBase;
  338|      3|                ctxt->cur = oldCur;
  339|      3|		xmlFree(buffer);
  340|      3|                xmlFree(name);
  341|      3|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  342|      0|	    }
  343|     35|	    xmlXPtrEvalChildSeq(ctxt, name2);
  344|     35|	}
  345|     38|	ctxt->base = oldBase;
  346|     38|        ctxt->cur = oldCur;
  347|     38|#ifdef XPTR_XMLNS_SCHEME
  348|    974|    } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) {
  ------------------
  |  Branch (348:16): [True: 433, False: 541]
  ------------------
  349|    433|	const xmlChar *oldBase = ctxt->base;
  350|    433|	const xmlChar *oldCur = ctxt->cur;
  351|    433|	xmlChar *prefix;
  352|       |
  353|    433|	ctxt->cur = ctxt->base = buffer;
  354|    433|        prefix = xmlXPathParseNCName(ctxt);
  355|    433|	if (prefix == NULL) {
  ------------------
  |  Branch (355:6): [True: 4, False: 429]
  ------------------
  356|      4|            ctxt->base = oldBase;
  357|      4|            ctxt->cur = oldCur;
  358|      4|	    xmlFree(buffer);
  359|      4|	    xmlFree(name);
  360|      4|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  361|      0|	}
  362|    429|	SKIP_BLANKS;
  ------------------
  |  |  178|  5.79k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  6.22k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 5.79k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|    429|	if (CUR != '=') {
  ------------------
  |  |  173|    429|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (363:6): [True: 13, False: 416]
  ------------------
  364|     13|            ctxt->base = oldBase;
  365|     13|            ctxt->cur = oldCur;
  366|     13|	    xmlFree(prefix);
  367|     13|	    xmlFree(buffer);
  368|     13|	    xmlFree(name);
  369|     13|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|     13|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  370|      0|	}
  371|    416|	NEXT;
  ------------------
  |  |  181|    416|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 416, False: 0]
  |  |  ------------------
  ------------------
  372|    416|	SKIP_BLANKS;
  ------------------
  |  |  178|  1.67k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  2.08k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 1.67k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|    416|	if (xmlXPathRegisterNs(ctxt->context, prefix, ctxt->cur) < 0)
  ------------------
  |  Branch (374:6): [True: 5, False: 411]
  ------------------
  375|      5|            xmlXPathPErrMemory(ctxt);
  376|    416|        ctxt->base = oldBase;
  377|    416|        ctxt->cur = oldCur;
  378|    416|	xmlFree(prefix);
  379|    416|#endif /* XPTR_XMLNS_SCHEME */
  380|    541|    } else {
  381|    541|        xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
  382|    541|		   "unsupported scheme '%s'\n", name);
  383|    541|    }
  384|  17.1k|    xmlFree(buffer);
  385|  17.1k|    xmlFree(name);
  386|  17.1k|}
xpointer.c:xmlXPtrErr:
   67|    625|{
   68|    625|    xmlStructuredErrorFunc serror = NULL;
   69|    625|    void *data = NULL;
   70|    625|    xmlNodePtr node = NULL;
   71|    625|    int res;
   72|       |
   73|    625|    if (ctxt == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 625]
  ------------------
   74|      0|        return;
   75|       |    /* Only report the first error */
   76|    625|    if (ctxt->error != 0)
  ------------------
  |  Branch (76:9): [True: 2, False: 623]
  ------------------
   77|      2|        return;
   78|       |
   79|    623|    ctxt->error = code;
   80|       |
   81|    623|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (81:9): [True: 623, False: 0]
  ------------------
   82|    623|        xmlErrorPtr err = &ctxt->context->lastError;
   83|       |
   84|       |        /* cleanup current last error */
   85|    623|        xmlResetError(err);
   86|       |
   87|    623|        err->domain = XML_FROM_XPOINTER;
   88|    623|        err->code = code;
   89|    623|        err->level = XML_ERR_ERROR;
   90|    623|        err->str1 = (char *) xmlStrdup(ctxt->base);
   91|    623|        if (err->str1 == NULL) {
  ------------------
  |  Branch (91:13): [True: 2, False: 621]
  ------------------
   92|      2|            xmlXPathPErrMemory(ctxt);
   93|      2|            return;
   94|      2|        }
   95|    621|        err->int1 = ctxt->cur - ctxt->base;
   96|    621|        err->node = ctxt->context->debugNode;
   97|       |
   98|    621|        serror = ctxt->context->error;
   99|    621|        data = ctxt->context->userData;
  100|    621|        node = ctxt->context->debugNode;
  101|    621|    }
  102|       |
  103|    621|    res = xmlRaiseError(serror, NULL, data, NULL, node,
  104|    621|                        XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0,
  105|    621|                        (const char *) extra, (const char *) ctxt->base,
  106|    621|                        NULL, ctxt->cur - ctxt->base, 0,
  107|    621|                        msg, extra);
  108|    621|    if (res < 0)
  ------------------
  |  Branch (108:9): [True: 7, False: 614]
  ------------------
  109|      7|        xmlXPathPErrMemory(ctxt);
  110|    621|}

