htmlIsBooleanAttr:
  362|  17.2k|{
  363|  17.2k|    const char *str = NULL;
  364|       |
  365|  17.2k|    if (name == NULL)
  ------------------
  |  Branch (365:9): [True: 0, False: 17.2k]
  ------------------
  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|  17.2k|    switch (name[0] | 0x20) {
  ------------------
  |  Branch (388:13): [True: 10.1k, False: 7.13k]
  ------------------
  389|  2.64k|        case 'c':
  ------------------
  |  Branch (389:9): [True: 2.64k, False: 14.6k]
  ------------------
  390|  2.64k|            name += 1;
  391|  2.64k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (391:21): [True: 319, False: 2.33k]
  ------------------
  392|     81|                case 'h': str = "ecked"; break;
  ------------------
  |  Branch (392:17): [True: 81, False: 2.56k]
  ------------------
  393|    238|                case 'o': str = "mpact"; break;
  ------------------
  |  Branch (393:17): [True: 238, False: 2.41k]
  ------------------
  394|  2.64k|            }
  395|  2.64k|            break;
  396|  3.25k|        case 'd':
  ------------------
  |  Branch (396:9): [True: 3.25k, False: 14.0k]
  ------------------
  397|  3.25k|            name += 1;
  398|  3.25k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (398:21): [True: 759, False: 2.49k]
  ------------------
  399|    533|                case 'e':
  ------------------
  |  Branch (399:17): [True: 533, False: 2.71k]
  ------------------
  400|    533|                    name += 1;
  401|    533|                    switch (name[0] | 0x20) {
  ------------------
  |  Branch (401:29): [True: 276, False: 257]
  ------------------
  402|     73|                        case 'c': str = "lare"; break;
  ------------------
  |  Branch (402:25): [True: 73, False: 460]
  ------------------
  403|    203|                        case 'f': str = "er"; break;
  ------------------
  |  Branch (403:25): [True: 203, False: 330]
  ------------------
  404|    533|                    }
  405|    533|                    break;
  406|    533|                case 'i': str = "sabled"; break;
  ------------------
  |  Branch (406:17): [True: 226, False: 3.02k]
  ------------------
  407|  3.25k|            }
  408|  3.25k|            break;
  409|  3.25k|        case 'i':
  ------------------
  |  Branch (409:9): [True: 680, False: 16.6k]
  ------------------
  410|    680|            str = "smap";
  411|    680|            break;
  412|    204|        case 'm':
  ------------------
  |  Branch (412:9): [True: 204, False: 17.0k]
  ------------------
  413|    204|            str = "ultiple";
  414|    204|            break;
  415|  2.66k|        case 'n':
  ------------------
  |  Branch (415:9): [True: 2.66k, False: 14.6k]
  ------------------
  416|  2.66k|            name += 1;
  417|  2.66k|            if ((name[0] | 0x20) != 'o')
  ------------------
  |  Branch (417:17): [True: 1.13k, False: 1.53k]
  ------------------
  418|  1.13k|                break;
  419|  1.53k|            name += 1;
  420|  1.53k|            switch (name[0] | 0x20) {
  ------------------
  |  Branch (420:21): [True: 1.29k, False: 235]
  ------------------
  421|    203|                case 'h': str = "ref"; break;
  ------------------
  |  Branch (421:17): [True: 203, False: 1.33k]
  ------------------
  422|    804|                case 'r': str = "esize"; break;
  ------------------
  |  Branch (422:17): [True: 804, False: 730]
  ------------------
  423|     77|                case 's': str = "hade"; break;
  ------------------
  |  Branch (423:17): [True: 77, False: 1.45k]
  ------------------
  424|    215|                case 'w': str = "rap"; break;
  ------------------
  |  Branch (424:17): [True: 215, False: 1.31k]
  ------------------
  425|  1.53k|            }
  426|  1.53k|            break;
  427|  1.53k|        case 'r':
  ------------------
  |  Branch (427:9): [True: 426, False: 16.8k]
  ------------------
  428|    426|            str = "eadonly";
  429|    426|            break;
  430|    274|        case 's':
  ------------------
  |  Branch (430:9): [True: 274, False: 17.0k]
  ------------------
  431|    274|            str = "elected";
  432|    274|            break;
  433|  17.2k|    }
  434|       |
  435|  17.2k|    if (str == NULL)
  ------------------
  |  Branch (435:9): [True: 13.5k, False: 3.70k]
  ------------------
  436|  13.5k|        return(0);
  437|       |
  438|  3.70k|    return(xmlStrcasecmp(name + 1, BAD_CAST str) == 0);
  ------------------
  |  |   34|  3.70k|#define BAD_CAST (xmlChar *)
  ------------------
  439|  17.2k|}

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

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

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

xmlInitDictInternal:
   98|      2|xmlInitDictInternal(void) {
   99|      2|    xmlInitMutex(&xmlDictMutex);
  100|      2|}
xmlDictCreate:
  264|  49.1k|xmlDictCreate(void) {
  265|  49.1k|    xmlDictPtr dict;
  266|       |
  267|  49.1k|    xmlInitParser();
  268|       |
  269|  49.1k|    dict = xmlMalloc(sizeof(xmlDict));
  270|  49.1k|    if (dict == NULL)
  ------------------
  |  Branch (270:9): [True: 3, False: 49.1k]
  ------------------
  271|      3|        return(NULL);
  272|  49.1k|    dict->ref_counter = 1;
  273|  49.1k|    dict->limit = 0;
  274|       |
  275|  49.1k|    dict->size = 0;
  276|  49.1k|    dict->nbElems = 0;
  277|  49.1k|    dict->table = NULL;
  278|  49.1k|    dict->strings = NULL;
  279|       |    dict->subdict = NULL;
  280|  49.1k|    dict->seed = xmlRandom();
  281|  49.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  282|  49.1k|    dict->seed = 0;
  283|  49.1k|#endif
  284|  49.1k|    return(dict);
  285|  49.1k|}
xmlDictReference:
  315|  60.6k|xmlDictReference(xmlDict *dict) {
  316|  60.6k|    if (dict == NULL) return -1;
  ------------------
  |  Branch (316:9): [True: 9.19k, False: 51.5k]
  ------------------
  317|  51.5k|    xmlMutexLock(&xmlDictMutex);
  318|  51.5k|    dict->ref_counter++;
  319|  51.5k|    xmlMutexUnlock(&xmlDictMutex);
  320|  51.5k|    return(0);
  321|  60.6k|}
xmlDictFree:
  330|   100k|xmlDictFree(xmlDict *dict) {
  331|   100k|    xmlDictStringsPtr pool, nextp;
  332|       |
  333|   100k|    if (dict == NULL)
  ------------------
  |  Branch (333:9): [True: 0, False: 100k]
  ------------------
  334|      0|	return;
  335|       |
  336|       |    /* decrement the counter, it may be shared by a parser and docs */
  337|   100k|    xmlMutexLock(&xmlDictMutex);
  338|   100k|    dict->ref_counter--;
  339|   100k|    if (dict->ref_counter > 0) {
  ------------------
  |  Branch (339:9): [True: 51.5k, False: 49.1k]
  ------------------
  340|  51.5k|        xmlMutexUnlock(&xmlDictMutex);
  341|  51.5k|        return;
  342|  51.5k|    }
  343|       |
  344|  49.1k|    xmlMutexUnlock(&xmlDictMutex);
  345|       |
  346|  49.1k|    if (dict->subdict != NULL) {
  ------------------
  |  Branch (346:9): [True: 0, False: 49.1k]
  ------------------
  347|      0|        xmlDictFree(dict->subdict);
  348|      0|    }
  349|       |
  350|  49.1k|    if (dict->table) {
  ------------------
  |  Branch (350:9): [True: 43.2k, False: 5.93k]
  ------------------
  351|  43.2k|	xmlFree(dict->table);
  352|  43.2k|    }
  353|  49.1k|    pool = dict->strings;
  354|  93.1k|    while (pool != NULL) {
  ------------------
  |  Branch (354:12): [True: 44.0k, False: 49.1k]
  ------------------
  355|  44.0k|        nextp = pool->next;
  356|  44.0k|	xmlFree(pool);
  357|  44.0k|	pool = nextp;
  358|  44.0k|    }
  359|  49.1k|    xmlFree(dict);
  360|  49.1k|}
xmlDictOwns:
  371|  24.1M|xmlDictOwns(xmlDict *dict, const xmlChar *str) {
  372|  24.1M|    xmlDictStringsPtr pool;
  373|       |
  374|  24.1M|    if ((dict == NULL) || (str == NULL))
  ------------------
  |  Branch (374:9): [True: 0, False: 24.1M]
  |  Branch (374:27): [True: 0, False: 24.1M]
  ------------------
  375|      0|	return(-1);
  376|  24.1M|    pool = dict->strings;
  377|  31.2M|    while (pool != NULL) {
  ------------------
  |  Branch (377:12): [True: 24.4M, False: 6.76M]
  ------------------
  378|  24.4M|        if ((str >= &pool->array[0]) && (str <= pool->free))
  ------------------
  |  Branch (378:13): [True: 23.9M, False: 494k]
  |  Branch (378:41): [True: 17.4M, False: 6.56M]
  ------------------
  379|  17.4M|	    return(1);
  380|  7.05M|	pool = pool->next;
  381|  7.05M|    }
  382|  6.76M|    if (dict->subdict)
  ------------------
  |  Branch (382:9): [True: 0, False: 6.76M]
  ------------------
  383|      0|        return(xmlDictOwns(dict->subdict, str));
  384|  6.76M|    return(0);
  385|  6.76M|}
xmlDictSetLimit:
  412|  50.0k|xmlDictSetLimit(xmlDict *dict, size_t limit) {
  413|  50.0k|    size_t ret;
  414|       |
  415|  50.0k|    if (dict == NULL)
  ------------------
  |  Branch (415:9): [True: 0, False: 50.0k]
  ------------------
  416|      0|	return(0);
  417|  50.0k|    ret = dict->limit;
  418|  50.0k|    dict->limit = limit;
  419|  50.0k|    return(ret);
  420|  50.0k|}
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|   400k|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|   400k|    v1 ^= v2;
  530|   400k|    v1 += HASH_ROL31(v2, 5);
  ------------------
  |  |  513|   400k|#define HASH_ROL31(x,n) ((x) << (n) | ((x) & 0x7FFFFFFF) >> (31 - (n)))
  ------------------
  531|       |
  532|   400k|    return((v1 & 0xFFFFFFFF) | 0x80000000);
  533|   400k|}
xmlDictLookup:
  825|  19.8M|xmlDictLookup(xmlDict *dict, const xmlChar *name, int len) {
  826|  19.8M|    const xmlDictEntry *entry;
  827|       |
  828|  19.8M|    entry = xmlDictLookupInternal(dict, NULL, name, len, 1);
  829|  19.8M|    if (entry == NULL)
  ------------------
  |  Branch (829:9): [True: 42, False: 19.8M]
  ------------------
  830|     42|        return(NULL);
  831|  19.8M|    return(entry->name);
  832|  19.8M|}
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: 16, False: 1.45M]
  ------------------
  851|     16|        ret.name = NULL;
  852|     16|        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.8k|xmlDictQLookup(xmlDict *dict, const xmlChar *prefix, const xmlChar *name) {
  890|  44.8k|    const xmlDictEntry *entry;
  891|       |
  892|  44.8k|    entry = xmlDictLookupInternal(dict, prefix, name, -1, 1);
  893|  44.8k|    if (entry == NULL)
  ------------------
  |  Branch (893:9): [True: 6, False: 44.7k]
  ------------------
  894|      6|        return(NULL);
  895|  44.7k|    return(entry->name);
  896|  44.8k|}
xmlInitRandom:
  926|      2|xmlInitRandom(void) {
  927|      2|    xmlInitMutex(&xmlRngMutex);
  928|       |
  929|      2|    {
  930|       |#ifdef _WIN32
  931|       |        NTSTATUS status;
  932|       |
  933|       |        /*
  934|       |         * You can find many (recent as of 2025) discussions how
  935|       |         * to get a pseudo-random seed on Windows in projects like
  936|       |         * Golang, Rust, Chromium and Firefox.
  937|       |         *
  938|       |         * TODO: Support ProcessPrng available since Windows 10.
  939|       |         */
  940|       |        status = BCryptGenRandom(NULL, (unsigned char *) globalRngState,
  941|       |                                 sizeof(globalRngState),
  942|       |                                 BCRYPT_USE_SYSTEM_PREFERRED_RNG);
  943|       |        if (!BCRYPT_SUCCESS(status))
  944|       |            xmlAbort("libxml2: BCryptGenRandom failed with error code %lu\n",
  945|       |                     GetLastError());
  946|       |#else
  947|      2|        int var;
  948|       |
  949|      2|#if HAVE_DECL_GETENTROPY
  950|      2|        while (1) {
  ------------------
  |  Branch (950:16): [True: 2, Folded]
  ------------------
  951|      2|            if (getentropy(globalRngState, sizeof(globalRngState)) == 0)
  ------------------
  |  Branch (951:17): [True: 2, False: 0]
  ------------------
  952|      2|                return;
  953|       |
  954|       |            /*
  955|       |             * This most likely means that libxml2 was compiled on
  956|       |             * a system supporting certain system calls and is running
  957|       |             * on a system that doesn't support these calls, as can
  958|       |             * be the case on Linux.
  959|       |             */
  960|      0|            if (errno == ENOSYS)
  ------------------
  |  Branch (960:17): [True: 0, False: 0]
  ------------------
  961|      0|                break;
  962|       |
  963|       |            /*
  964|       |             * We really don't want to fallback to the unsafe PRNG
  965|       |             * for possibly accidental reasons, so we abort on any
  966|       |             * unknown error.
  967|       |             */
  968|      0|            if (errno != EINTR)
  ------------------
  |  Branch (968:17): [True: 0, False: 0]
  ------------------
  969|      0|                xmlAbort("libxml2: getentropy failed with error code %d\n",
  970|      0|                         errno);
  971|      0|        }
  972|      0|#endif
  973|       |
  974|       |        /*
  975|       |         * TODO: Fallback to /dev/urandom for older POSIX systems.
  976|       |         */
  977|      0|        globalRngState[0] =
  978|      0|                (unsigned) time(NULL) ^
  979|      0|                HASH_ROL((unsigned) ((size_t) &xmlInitRandom & 0xFFFFFFFF), 8);
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  980|      0|        globalRngState[1] =
  981|      0|                HASH_ROL((unsigned) ((size_t) &xmlRngMutex & 0xFFFFFFFF), 16) ^
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  982|      0|                HASH_ROL((unsigned) ((size_t) &var & 0xFFFFFFFF), 24);
  ------------------
  |  |   12|      0|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
  983|      0|#endif
  984|      0|    }
  985|      0|}
xmlGlobalRandom:
 1017|      2|xmlGlobalRandom(void) {
 1018|      2|    unsigned ret;
 1019|       |
 1020|      2|    xmlMutexLock(&xmlRngMutex);
 1021|      2|    ret = xoroshiro64ss(globalRngState);
 1022|      2|    xmlMutexUnlock(&xmlRngMutex);
 1023|       |
 1024|      2|    return(ret);
 1025|      2|}
xmlRandom:
 1034|   132k|xmlRandom(void) {
 1035|   132k|    return(xoroshiro64ss(xmlGetLocalRngState()));
 1036|   132k|}
dict.c:xmlDictHashName:
  454|  21.6M|                size_t *plen) {
  455|  21.6M|    unsigned h1, h2;
  456|  21.6M|    size_t i;
  457|       |
  458|  21.6M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  21.6M|    do { \
  |  |   24|  21.6M|        h1 = seed ^ 0x3b00; \
  |  |   25|  21.6M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  21.6M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  21.6M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 21.6M]
  |  |  ------------------
  ------------------
  459|       |
  460|   234M|    for (i = 0; i < maxLen && data[i]; i++) {
  ------------------
  |  Branch (460:17): [True: 229M, False: 4.46M]
  |  Branch (460:31): [True: 212M, False: 17.1M]
  ------------------
  461|   212M|        HASH_UPDATE(h1, h2, data[i]);
  ------------------
  |  |   29|   212M|    do { \
  |  |   30|   212M|        h1 += ch; \
  |  |   31|   212M|        h1 += h1 << 3; \
  |  |   32|   212M|        h2 += h1; \
  |  |   33|   212M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   212M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   212M|        h2 += h2 << 2; \
  |  |   35|   212M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 212M]
  |  |  ------------------
  ------------------
  462|   212M|    }
  463|       |
  464|  21.6M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  21.6M|    do { \
  |  |   40|  21.6M|        h1 ^= h2; \
  |  |   41|  21.6M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  21.6M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  21.6M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  21.6M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  21.6M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  21.6M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  21.6M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  21.6M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  21.6M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  21.6M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 21.6M]
  |  |  ------------------
  ------------------
  465|       |
  466|  21.6M|    *plen = i;
  467|  21.6M|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  21.6M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  468|  21.6M|}
dict.c:xmlDictLookupInternal:
  678|  21.3M|                      const xmlChar *name, int maybeLen, int update) {
  679|  21.3M|    xmlDictEntry *entry = NULL;
  680|  21.3M|    const xmlChar *ret;
  681|  21.3M|    unsigned hashValue, newSize;
  682|  21.3M|    size_t maxLen, len, plen, klen;
  683|  21.3M|    int found = 0;
  684|       |
  685|  21.3M|    if ((dict == NULL) || (name == NULL))
  ------------------
  |  Branch (685:9): [True: 0, False: 21.3M]
  |  Branch (685:27): [True: 0, False: 21.3M]
  ------------------
  686|      0|	return(NULL);
  687|       |
  688|  21.3M|    maxLen = (maybeLen < 0) ? SIZE_MAX : (size_t) maybeLen;
  ------------------
  |  Branch (688:14): [True: 16.9M, False: 4.46M]
  ------------------
  689|       |
  690|  21.3M|    if (prefix == NULL) {
  ------------------
  |  Branch (690:9): [True: 21.3M, False: 44.8k]
  ------------------
  691|  21.3M|        hashValue = xmlDictHashName(dict->seed, name, maxLen, &len);
  692|  21.3M|        if (len > INT_MAX / 2)
  ------------------
  |  Branch (692:13): [True: 0, False: 21.3M]
  ------------------
  693|      0|            return(NULL);
  694|  21.3M|        klen = len;
  695|  21.3M|    } else {
  696|  44.8k|        hashValue = xmlDictHashQName(dict->seed, prefix, name, &plen, &len);
  697|  44.8k|        if ((len > INT_MAX / 2) || (plen >= INT_MAX / 2 - len))
  ------------------
  |  Branch (697:13): [True: 0, False: 44.8k]
  |  Branch (697:36): [True: 0, False: 44.8k]
  ------------------
  698|      0|            return(NULL);
  699|  44.8k|        klen = plen + 1 + len;
  700|  44.8k|    }
  701|       |
  702|  21.3M|    if ((dict->limit > 0) && (klen >= dict->limit))
  ------------------
  |  Branch (702:9): [True: 18.2M, False: 3.13M]
  |  Branch (702:30): [True: 0, False: 18.2M]
  ------------------
  703|      0|        return(NULL);
  704|       |
  705|       |    /*
  706|       |     * Check for an existing entry
  707|       |     */
  708|  21.3M|    if (dict->size == 0) {
  ------------------
  |  Branch (708:9): [True: 43.2k, False: 21.3M]
  ------------------
  709|  43.2k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   43|  43.2k|#define MIN_HASH_SIZE 8
  ------------------
  710|  21.3M|    } else {
  711|  21.3M|        entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found);
  712|  21.3M|        if (found)
  ------------------
  |  Branch (712:13): [True: 20.9M, False: 366k]
  ------------------
  713|  20.9M|            return(entry);
  714|       |
  715|   366k|        if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   42|   366k|#define MAX_FILL_DENOM 8
  ------------------
                      if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   41|   366k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (715:13): [True: 27.6k, False: 339k]
  ------------------
  716|  27.6k|            if (dict->size >= MAX_HASH_SIZE)
  ------------------
  |  |   44|  27.6k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (716:17): [True: 0, False: 27.6k]
  ------------------
  717|      0|                return(NULL);
  718|  27.6k|            newSize = dict->size * 2;
  719|   339k|        } else {
  720|   339k|            newSize = 0;
  721|   339k|        }
  722|   366k|    }
  723|       |
  724|   410k|    if ((dict->subdict != NULL) && (dict->subdict->size > 0)) {
  ------------------
  |  Branch (724:9): [True: 0, False: 410k]
  |  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|   410k|    if (!update)
  ------------------
  |  Branch (740:9): [True: 0, False: 410k]
  ------------------
  741|      0|        return(NULL);
  742|       |
  743|       |    /*
  744|       |     * Grow the hash table if needed
  745|       |     */
  746|   410k|    if (newSize > 0) {
  ------------------
  |  Branch (746:9): [True: 70.8k, False: 339k]
  ------------------
  747|  70.8k|        unsigned mask, displ, pos;
  748|       |
  749|  70.8k|        if (xmlDictGrow(dict, newSize) != 0)
  ------------------
  |  Branch (749:13): [True: 52, False: 70.8k]
  ------------------
  750|     52|            return(NULL);
  751|       |
  752|       |        /*
  753|       |         * Find new entry
  754|       |         */
  755|  70.8k|        mask = dict->size - 1;
  756|  70.8k|        displ = 0;
  757|  70.8k|        pos = hashValue & mask;
  758|  70.8k|        entry = &dict->table[pos];
  759|       |
  760|  84.0k|        while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (760:16): [True: 17.4k, False: 66.6k]
  ------------------
  761|  17.4k|               ((pos - entry->hashValue) & mask) >= displ) {
  ------------------
  |  Branch (761:16): [True: 13.2k, False: 4.18k]
  ------------------
  762|  13.2k|            displ++;
  763|  13.2k|            pos++;
  764|  13.2k|            entry++;
  765|  13.2k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (765:17): [True: 1.29k, False: 11.9k]
  ------------------
  766|  1.29k|                entry = dict->table;
  767|  13.2k|        }
  768|  70.8k|    }
  769|       |
  770|   410k|    if (prefix == NULL)
  ------------------
  |  Branch (770:9): [True: 404k, False: 5.39k]
  ------------------
  771|   404k|        ret = xmlDictAddString(dict, name, len);
  772|  5.39k|    else
  773|  5.39k|        ret = xmlDictAddQString(dict, prefix, plen, name, len);
  774|   410k|    if (ret == NULL)
  ------------------
  |  Branch (774:9): [True: 12, False: 409k]
  ------------------
  775|     12|        return(NULL);
  776|       |
  777|       |    /*
  778|       |     * Shift the remainder of the probe sequence to the right
  779|       |     */
  780|   409k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (780:9): [True: 76.4k, False: 333k]
  ------------------
  781|  76.4k|        const xmlDictEntry *end = &dict->table[dict->size];
  782|  76.4k|        const xmlDictEntry *cur = entry;
  783|       |
  784|   253k|        do {
  785|   253k|            cur++;
  786|   253k|            if (cur >= end)
  ------------------
  |  Branch (786:17): [True: 23.1k, False: 230k]
  ------------------
  787|  23.1k|                cur = dict->table;
  788|   253k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (788:18): [True: 177k, False: 76.4k]
  ------------------
  789|       |
  790|  76.4k|        if (cur < entry) {
  ------------------
  |  Branch (790:13): [True: 23.1k, False: 53.2k]
  ------------------
  791|       |            /*
  792|       |             * If we traversed the end of the buffer, handle the part
  793|       |             * at the start of the buffer.
  794|       |             */
  795|  23.1k|            memmove(&dict->table[1], dict->table,
  796|  23.1k|                    (char *) cur - (char *) dict->table);
  797|  23.1k|            cur = end - 1;
  798|  23.1k|            dict->table[0] = *cur;
  799|  23.1k|        }
  800|       |
  801|  76.4k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  802|  76.4k|    }
  803|       |
  804|       |    /*
  805|       |     * Populate entry
  806|       |     */
  807|   409k|    entry->hashValue = hashValue;
  808|   409k|    entry->name = ret;
  809|       |
  810|   409k|    dict->nbElems++;
  811|       |
  812|   409k|    return(entry);
  813|   410k|}
dict.c:xmlDictHashQName:
  473|  44.8k|                 size_t *pplen, size_t *plen) {
  474|  44.8k|    unsigned h1, h2;
  475|  44.8k|    size_t i;
  476|       |
  477|  44.8k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  44.8k|    do { \
  |  |   24|  44.8k|        h1 = seed ^ 0x3b00; \
  |  |   25|  44.8k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  44.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  478|       |
  479|   410k|    for (i = 0; prefix[i] != 0; i++) {
  ------------------
  |  Branch (479:17): [True: 365k, False: 44.8k]
  ------------------
  480|   365k|        HASH_UPDATE(h1, h2, prefix[i]);
  ------------------
  |  |   29|   365k|    do { \
  |  |   30|   365k|        h1 += ch; \
  |  |   31|   365k|        h1 += h1 << 3; \
  |  |   32|   365k|        h2 += h1; \
  |  |   33|   365k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   365k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   365k|        h2 += h2 << 2; \
  |  |   35|   365k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 365k]
  |  |  ------------------
  ------------------
  481|   365k|    }
  482|  44.8k|    *pplen = i;
  483|       |
  484|  44.8k|    HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  44.8k|    do { \
  |  |   30|  44.8k|        h1 += ch; \
  |  |   31|  44.8k|        h1 += h1 << 3; \
  |  |   32|  44.8k|        h2 += h1; \
  |  |   33|  44.8k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  44.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  44.8k|        h2 += h2 << 2; \
  |  |   35|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  485|       |
  486|  2.58M|    for (i = 0; name[i] != 0; i++) {
  ------------------
  |  Branch (486:17): [True: 2.54M, False: 44.8k]
  ------------------
  487|  2.54M|        HASH_UPDATE(h1, h2, name[i]);
  ------------------
  |  |   29|  2.54M|    do { \
  |  |   30|  2.54M|        h1 += ch; \
  |  |   31|  2.54M|        h1 += h1 << 3; \
  |  |   32|  2.54M|        h2 += h1; \
  |  |   33|  2.54M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  2.54M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  2.54M|        h2 += h2 << 2; \
  |  |   35|  2.54M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 2.54M]
  |  |  ------------------
  ------------------
  488|  2.54M|    }
  489|  44.8k|    *plen = i;
  490|       |
  491|  44.8k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  44.8k|    do { \
  |  |   40|  44.8k|        h1 ^= h2; \
  |  |   41|  44.8k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  44.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  44.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  44.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  44.8k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  44.8k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  44.8k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  44.8k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  44.8k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  44.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 44.8k]
  |  |  ------------------
  ------------------
  492|       |
  493|       |    /*
  494|       |     * Always set the upper bit of hash values since 0 means an unoccupied
  495|       |     * bucket.
  496|       |     */
  497|  44.8k|    return(h2 | MAX_HASH_SIZE);
  ------------------
  |  |   44|  44.8k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  498|  44.8k|}
dict.c:xmlDictFindEntry:
  551|  21.3M|                 int *pfound) {
  552|  21.3M|    xmlDictEntry *entry;
  553|  21.3M|    unsigned mask, pos, displ;
  554|  21.3M|    int found = 0;
  555|       |
  556|  21.3M|    mask = dict->size - 1;
  557|  21.3M|    pos = hashValue & mask;
  558|  21.3M|    entry = &dict->table[pos];
  559|       |
  560|  21.3M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (560:9): [True: 21.1M, False: 212k]
  ------------------
  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.1M|        displ = 0;
  567|       |
  568|  24.9M|        do {
  569|  24.9M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (569:17): [True: 20.9M, False: 3.92M]
  ------------------
  570|  20.9M|                if (prefix == NULL) {
  ------------------
  |  Branch (570:21): [True: 20.9M, False: 39.4k]
  ------------------
  571|       |                    /*
  572|       |                     * name is not necessarily null-terminated.
  573|       |                     */
  574|  20.9M|                    if ((strncmp((const char *) entry->name,
  ------------------
  |  Branch (574:25): [True: 20.9M, False: 195]
  ------------------
  575|  20.9M|                                 (const char *) name, len) == 0) &&
  576|  20.9M|                        (entry->name[len] == 0)) {
  ------------------
  |  Branch (576:25): [True: 20.9M, False: 0]
  ------------------
  577|  20.9M|                        found = 1;
  578|  20.9M|                        break;
  579|  20.9M|                    }
  580|  20.9M|                } else {
  581|  39.4k|                    if (xmlStrQEqual(prefix, name, entry->name)) {
  ------------------
  |  Branch (581:25): [True: 39.4k, False: 0]
  ------------------
  582|  39.4k|                        found = 1;
  583|  39.4k|                        break;
  584|  39.4k|                    }
  585|  39.4k|                }
  586|  20.9M|            }
  587|       |
  588|  3.92M|            displ++;
  589|  3.92M|            pos++;
  590|  3.92M|            entry++;
  591|  3.92M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (591:17): [True: 293k, False: 3.63M]
  ------------------
  592|   293k|                entry = dict->table;
  593|  3.92M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (593:18): [True: 3.85M, False: 65.7k]
  ------------------
  594|  3.85M|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (594:18): [True: 3.77M, False: 88.7k]
  ------------------
  595|  21.1M|    }
  596|       |
  597|  21.3M|    *pfound = found;
  598|  21.3M|    return(entry);
  599|  21.3M|}
dict.c:xmlDictGrow:
  609|  70.8k|xmlDictGrow(xmlDictPtr dict, unsigned size) {
  610|  70.8k|    const xmlDictEntry *oldentry, *oldend, *end;
  611|  70.8k|    xmlDictEntry *table;
  612|  70.8k|    unsigned oldsize, i;
  613|       |
  614|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  615|  70.8k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (615:9): [True: 0, False: 70.8k]
  ------------------
  616|      0|        return(-1);
  617|  70.8k|    table = xmlMalloc(size * sizeof(table[0]));
  618|  70.8k|    if (table == NULL)
  ------------------
  |  Branch (618:9): [True: 52, False: 70.8k]
  ------------------
  619|     52|        return(-1);
  620|  70.8k|    memset(table, 0, size * sizeof(table[0]));
  621|       |
  622|  70.8k|    oldsize = dict->size;
  623|  70.8k|    if (oldsize == 0)
  ------------------
  |  Branch (623:9): [True: 43.2k, False: 27.6k]
  ------------------
  624|  43.2k|        goto done;
  625|       |
  626|  27.6k|    oldend = &dict->table[oldsize];
  627|  27.6k|    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.6k|    oldentry = dict->table;
  637|   155k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (637:12): [True: 127k, False: 27.6k]
  ------------------
  638|   127k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (638:13): [True: 0, False: 127k]
  ------------------
  639|      0|            oldentry = dict->table;
  640|   127k|    }
  641|       |
  642|   345k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (642:17): [True: 317k, False: 27.6k]
  ------------------
  643|   317k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (643:13): [True: 277k, False: 39.6k]
  ------------------
  644|   277k|            xmlDictEntry *entry = &table[oldentry->hashValue & (size - 1)];
  645|       |
  646|   357k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (646:20): [True: 79.1k, False: 277k]
  ------------------
  647|  79.1k|                if (++entry >= end)
  ------------------
  |  Branch (647:21): [True: 12.9k, False: 66.2k]
  ------------------
  648|  12.9k|                    entry = table;
  649|  79.1k|            }
  650|   277k|            *entry = *oldentry;
  651|   277k|        }
  652|       |
  653|   317k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (653:13): [True: 27.6k, False: 289k]
  ------------------
  654|  27.6k|            oldentry = dict->table;
  655|   317k|    }
  656|       |
  657|  27.6k|    xmlFree(dict->table);
  658|       |
  659|  70.8k|done:
  660|  70.8k|    dict->table = table;
  661|  70.8k|    dict->size = size;
  662|       |
  663|  70.8k|    return(0);
  664|  27.6k|}
dict.c:xmlDictAddString:
  130|   404k|xmlDictAddString(xmlDictPtr dict, const xmlChar *name, unsigned int namelen) {
  131|   404k|    xmlDictStringsPtr pool;
  132|   404k|    const xmlChar *ret;
  133|   404k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  134|   404k|    size_t limit = 0;
  135|       |
  136|   404k|    pool = dict->strings;
  137|   406k|    while (pool != NULL) {
  ------------------
  |  Branch (137:12): [True: 362k, False: 44.0k]
  ------------------
  138|   362k|	if ((size_t)(pool->end - pool->free) > namelen)
  ------------------
  |  Branch (138:6): [True: 360k, False: 2.16k]
  ------------------
  139|   360k|	    goto found_pool;
  140|  2.16k|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (140:6): [True: 1.61k, False: 545]
  ------------------
  141|  2.16k|        limit += pool->size;
  142|  2.16k|	pool = pool->next;
  143|  2.16k|    }
  144|       |    /*
  145|       |     * Not found, need to allocate
  146|       |     */
  147|  44.0k|    if (pool == NULL) {
  ------------------
  |  Branch (147:9): [True: 44.0k, False: 0]
  ------------------
  148|  44.0k|        if ((dict->limit > 0) && (limit > dict->limit)) {
  ------------------
  |  Branch (148:13): [True: 532, False: 43.4k]
  |  Branch (148:34): [True: 0, False: 532]
  ------------------
  149|      0|            return(NULL);
  150|      0|        }
  151|       |
  152|  44.0k|        if (size == 0) {
  ------------------
  |  Branch (152:13): [True: 43.2k, False: 795]
  ------------------
  153|  43.2k|            size = 1000;
  154|  43.2k|        } else {
  155|    795|            if (size < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (155:17): [True: 795, False: 0]
  ------------------
  156|    795|                size *= 4; /* exponential growth */
  157|      0|            else
  158|      0|                size = SIZE_MAX - sizeof(xmlDictStrings);
  159|    795|        }
  160|  44.0k|        if (size / 4 < namelen) {
  ------------------
  |  Branch (160:13): [True: 538, False: 43.4k]
  ------------------
  161|    538|            if ((size_t) namelen + 0 < (SIZE_MAX - sizeof(xmlDictStrings)) / 4)
  ------------------
  |  Branch (161:17): [True: 538, False: 0]
  ------------------
  162|    538|                size = 4 * (size_t) namelen; /* just in case ! */
  163|      0|            else
  164|      0|                return(NULL);
  165|    538|        }
  166|  44.0k|	pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
  167|  44.0k|	if (pool == NULL)
  ------------------
  |  Branch (167:6): [True: 9, False: 43.9k]
  ------------------
  168|      9|	    return(NULL);
  169|  43.9k|	pool->size = size;
  170|  43.9k|	pool->nbStrings = 0;
  171|  43.9k|	pool->free = &pool->array[0];
  172|  43.9k|	pool->end = &pool->array[size];
  173|  43.9k|	pool->next = dict->strings;
  174|  43.9k|	dict->strings = pool;
  175|  43.9k|    }
  176|   404k|found_pool:
  177|   404k|    ret = pool->free;
  178|   404k|    memcpy(pool->free, name, namelen);
  179|   404k|    pool->free += namelen;
  180|   404k|    *(pool->free++) = 0;
  181|   404k|    pool->nbStrings++;
  182|   404k|    return(ret);
  183|  44.0k|}
dict.c:xmlDictAddQString:
  199|  5.39k|{
  200|  5.39k|    xmlDictStringsPtr pool;
  201|  5.39k|    const xmlChar *ret;
  202|  5.39k|    size_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
  203|  5.39k|    size_t limit = 0;
  204|       |
  205|  5.39k|    pool = dict->strings;
  206|  6.19k|    while (pool != NULL) {
  ------------------
  |  Branch (206:12): [True: 6.12k, False: 71]
  ------------------
  207|  6.12k|	if ((size_t)(pool->end - pool->free) > namelen + plen + 1)
  ------------------
  |  Branch (207:6): [True: 5.31k, False: 809]
  ------------------
  208|  5.31k|	    goto found_pool;
  209|    809|	if (pool->size > size) size = pool->size;
  ------------------
  |  Branch (209:6): [True: 489, False: 320]
  ------------------
  210|    809|        limit += pool->size;
  211|    809|	pool = pool->next;
  212|    809|    }
  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: 46, False: 25]
  |  Branch (217:34): [True: 0, False: 46]
  ------------------
  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.38k|found_pool:
  247|  5.38k|    ret = pool->free;
  248|  5.38k|    memcpy(pool->free, prefix, plen);
  249|  5.38k|    pool->free += plen;
  250|  5.38k|    *(pool->free++) = ':';
  251|  5.38k|    memcpy(pool->free, name, namelen);
  252|  5.38k|    pool->free += namelen;
  253|  5.38k|    *(pool->free++) = 0;
  254|  5.38k|    pool->nbStrings++;
  255|  5.38k|    return(ret);
  256|     71|}
dict.c:xoroshiro64ss:
  998|   132k|xoroshiro64ss(unsigned *s) {
  999|   132k|    unsigned s0 = s[0];
 1000|   132k|    unsigned s1 = s[1];
 1001|   132k|    unsigned result = HASH_ROL(s0 * 0x9E3779BB, 5) * 5;
  ------------------
  |  |   12|   132k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1002|       |
 1003|   132k|    s1 ^= s0;
 1004|   132k|    s[0] = HASH_ROL(s0, 26) ^ s1 ^ (s1 << 9);
  ------------------
  |  |   12|   132k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1005|   132k|    s[1] = HASH_ROL(s1, 13);
  ------------------
  |  |   12|   132k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  ------------------
 1006|       |
 1007|   132k|    return(result & 0xFFFFFFFF);
 1008|   132k|}

xmlGetEncodingAlias:
  473|  15.0k|xmlGetEncodingAlias(const char *alias) {
  474|  15.0k|    int i;
  475|  15.0k|    char upper[100];
  476|       |
  477|  15.0k|    if (alias == NULL)
  ------------------
  |  Branch (477:9): [True: 0, False: 15.0k]
  ------------------
  478|      0|	return(NULL);
  479|       |
  480|  15.0k|    if (xmlCharEncodingAliases == NULL)
  ------------------
  |  Branch (480:9): [True: 15.0k, False: 0]
  ------------------
  481|  15.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.9k|                           xmlCharEncodingHandler **out) {
  771|  10.9k|    xmlCharEncodingHandler *handler;
  772|       |
  773|  10.9k|    if (out == NULL)
  ------------------
  |  Branch (773:9): [True: 0, False: 10.9k]
  ------------------
  774|      0|        return(XML_ERR_ARGUMENT);
  775|       |
  776|  10.9k|    handler = xmlMalloc(sizeof(*handler));
  777|  10.9k|    if (handler == NULL)
  ------------------
  |  Branch (777:9): [True: 8, False: 10.9k]
  ------------------
  778|      8|        goto error;
  779|  10.9k|    memset(handler, 0, sizeof(*handler));
  780|       |
  781|  10.9k|    if (name != NULL) {
  ------------------
  |  Branch (781:9): [True: 10.9k, False: 0]
  ------------------
  782|  10.9k|        handler->name = xmlMemStrdup(name);
  783|  10.9k|        if (handler->name == NULL)
  ------------------
  |  Branch (783:13): [True: 8, False: 10.8k]
  ------------------
  784|      8|            goto error;
  785|  10.9k|    }
  786|       |
  787|  10.8k|    handler->input.func = input;
  788|  10.8k|    handler->output.func = output;
  789|  10.8k|    handler->ctxtDtor = ctxtDtor;
  790|  10.8k|    handler->inputCtxt = inputCtxt;
  791|  10.8k|    handler->outputCtxt = outputCtxt;
  792|       |
  793|  10.8k|    *out = handler;
  794|  10.8k|    return(XML_ERR_OK);
  795|       |
  796|     16|error:
  797|     16|    xmlFree(handler);
  798|       |
  799|     16|    if (ctxtDtor != NULL) {
  ------------------
  |  Branch (799:9): [True: 16, False: 0]
  ------------------
  800|     16|        if (inputCtxt != NULL)
  ------------------
  |  Branch (800:13): [True: 16, False: 0]
  ------------------
  801|     16|            ctxtDtor(inputCtxt);
  802|     16|        if (outputCtxt != NULL)
  ------------------
  |  Branch (802:13): [True: 2, False: 14]
  ------------------
  803|      2|            ctxtDtor(outputCtxt);
  804|     16|    }
  805|       |
  806|     16|    return(XML_ERR_NO_MEMORY);
  807|  10.9k|}
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.50k|                             xmlCharEncodingHandler **out) {
  987|  6.50k|    const xmlCharEncodingHandler *handler;
  988|       |
  989|  6.50k|    if (out == NULL)
  ------------------
  |  Branch (989:9): [True: 0, False: 6.50k]
  ------------------
  990|      0|        return(XML_ERR_ARGUMENT);
  991|  6.50k|    *out = NULL;
  992|       |
  993|  6.50k|    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
  ------------------
  |  |  355|  6.50k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (993:9): [True: 0, False: 6.50k]
  |  Branch (993:23): [True: 0, False: 6.50k]
  ------------------
  994|      0|        return(XML_ERR_UNSUPPORTED_ENCODING);
  995|       |
  996|       |    /* Return NULL handler for UTF-8 */
  997|  6.50k|    if ((enc == XML_CHAR_ENCODING_UTF8) ||
  ------------------
  |  Branch (997:9): [True: 25, False: 6.48k]
  ------------------
  998|  6.48k|        (enc == XML_CHAR_ENCODING_NONE))
  ------------------
  |  Branch (998:9): [True: 0, False: 6.48k]
  ------------------
  999|     25|        return(XML_ERR_OK);
 1000|       |
 1001|  6.48k|    handler = &defaultHandlers[enc];
 1002|  6.48k|    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
  ------------------
  |  Branch (1002:9): [True: 5.48k, False: 998]
  |  Branch (1002:42): [True: 0, False: 998]
  ------------------
 1003|  5.48k|        *out = (xmlCharEncodingHandler *) handler;
 1004|  5.48k|        return(XML_ERR_OK);
 1005|  5.48k|    }
 1006|       |
 1007|    998|    if (handler->name != NULL) {
  ------------------
  |  Branch (1007:9): [True: 998, False: 0]
  ------------------
 1008|    998|        xmlCharEncFlags flags = XML_ENC_INPUT;
 1009|       |
 1010|    998|#ifdef LIBXML_OUTPUT_ENABLED
 1011|    998|        flags |= XML_ENC_OUTPUT;
 1012|    998|#endif
 1013|    998|        return(xmlFindExtraHandler(handler->name, handler->name, flags,
 1014|    998|                                   NULL, NULL, out));
 1015|    998|    }
 1016|       |
 1017|      0|    return(XML_ERR_UNSUPPORTED_ENCODING);
 1018|    998|}
xmlCreateCharEncodingHandler:
 1066|  15.0k|                             xmlCharEncodingHandler **out) {
 1067|  15.0k|    const xmlCharEncodingHandler *handler;
 1068|  15.0k|    const char *norig, *nalias;
 1069|  15.0k|    xmlCharEncoding enc;
 1070|       |
 1071|  15.0k|    if (out == NULL)
  ------------------
  |  Branch (1071:9): [True: 0, False: 15.0k]
  ------------------
 1072|      0|        return(XML_ERR_ARGUMENT);
 1073|  15.0k|    *out = NULL;
 1074|       |
 1075|  15.0k|    if ((name == NULL) || (flags == 0))
  ------------------
  |  Branch (1075:9): [True: 0, False: 15.0k]
  |  Branch (1075:27): [True: 0, False: 15.0k]
  ------------------
 1076|      0|        return(XML_ERR_ARGUMENT);
 1077|       |
 1078|  15.0k|    norig = name;
 1079|  15.0k|    nalias = xmlGetEncodingAlias(name);
 1080|  15.0k|    if (nalias != NULL)
  ------------------
  |  Branch (1080:9): [True: 0, False: 15.0k]
  ------------------
 1081|      0|	name = nalias;
 1082|       |
 1083|  15.0k|    enc = xmlParseCharEncodingInternal(name);
 1084|       |
 1085|       |    /* Return NULL handler for UTF-8 */
 1086|  15.0k|    if (enc == XML_CHAR_ENCODING_UTF8)
  ------------------
  |  Branch (1086:9): [True: 700, False: 14.3k]
  ------------------
 1087|    700|        return(XML_ERR_OK);
 1088|       |
 1089|  14.3k|    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
  ------------------
  |  |  355|  4.31k|    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
  ------------------
  |  Branch (1089:9): [True: 4.31k, False: 10.0k]
  |  Branch (1089:22): [True: 4.31k, False: 0]
  ------------------
 1090|  4.31k|        if (flags & XML_ENC_HTML) {
  ------------------
  |  Branch (1090:13): [True: 0, False: 4.31k]
  ------------------
 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.31k|        handler = &defaultHandlers[enc];
 1113|  4.31k|        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
  ------------------
  |  Branch (1113:14): [True: 0, False: 4.31k]
  |  Branch (1113:48): [True: 3.70k, False: 618]
  ------------------
 1114|  3.70k|            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
  ------------------
  |  Branch (1114:14): [True: 3.70k, False: 0]
  |  Branch (1114:49): [True: 0, False: 0]
  ------------------
 1115|  3.70k|            xmlCharEncodingHandler *ret;
 1116|       |
 1117|       |            /*
 1118|       |             * Return a copy of the handler with the original name.
 1119|       |             */
 1120|       |
 1121|  3.70k|            ret = xmlMalloc(sizeof(*ret));
 1122|  3.70k|            if (ret == NULL)
  ------------------
  |  Branch (1122:17): [True: 3, False: 3.69k]
  ------------------
 1123|      3|                return(XML_ERR_NO_MEMORY);
 1124|  3.69k|            memset(ret, 0, sizeof(*ret));
 1125|       |
 1126|  3.69k|            ret->name = xmlMemStrdup(norig);
 1127|  3.69k|            if (ret->name == NULL) {
  ------------------
  |  Branch (1127:17): [True: 2, False: 3.69k]
  ------------------
 1128|      2|                xmlFree(ret);
 1129|      2|                return(XML_ERR_NO_MEMORY);
 1130|      2|            }
 1131|  3.69k|            ret->input = handler->input;
 1132|  3.69k|            ret->output = handler->output;
 1133|  3.69k|            ret->inputCtxt = handler->inputCtxt;
 1134|  3.69k|            ret->outputCtxt = handler->outputCtxt;
 1135|  3.69k|            ret->ctxtDtor = handler->ctxtDtor;
 1136|       |
 1137|  3.69k|            *out = ret;
 1138|  3.69k|            return(XML_ERR_OK);
 1139|  3.69k|        }
 1140|  4.31k|    }
 1141|       |
 1142|  10.6k|    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
 1143|  14.3k|}
xmlOpenCharEncodingHandler:
 1169|     24|                           xmlCharEncodingHandler **out) {
 1170|     24|    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
  ------------------
  |  Branch (1170:29): [True: 0, False: 24]
  ------------------
 1171|       |
 1172|     24|    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 1173|     24|}
xmlEncInputChunk:
 1685|   181k|                 int flush) {
 1686|   181k|    xmlCharEncError ret;
 1687|       |
 1688|   181k|    if (handler->flags & XML_HANDLER_LEGACY) {
  ------------------
  |  |   54|   181k|#define XML_HANDLER_LEGACY (1 << 1)
  ------------------
  |  Branch (1688:9): [True: 0, False: 181k]
  ------------------
 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|   181k|    } else {
 1699|   181k|        xmlCharEncConvFunc func = handler->input.func;
 1700|   181k|        int oldInlen;
 1701|       |
 1702|   181k|        if (func == NULL) {
  ------------------
  |  Branch (1702:13): [True: 0, False: 181k]
  ------------------
 1703|      0|            *outlen = 0;
 1704|      0|            *inlen = 0;
 1705|      0|            return(XML_ENC_ERR_INTERNAL);
 1706|      0|        }
 1707|       |
 1708|   181k|        oldInlen = *inlen;
 1709|   181k|        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
 1710|       |
 1711|       |        /*
 1712|       |         * Check for truncated multi-byte sequence.
 1713|       |         */
 1714|   181k|        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
  ------------------
  |  Branch (1714:13): [True: 8, False: 181k]
  |  Branch (1714:24): [True: 8, False: 0]
  |  Branch (1714:56): [True: 0, False: 8]
  ------------------
 1715|      0|            ret = XML_ENC_ERR_INPUT;
 1716|   181k|    }
 1717|       |
 1718|   181k|    if (ret > 0)
  ------------------
  |  Branch (1718:9): [True: 25.2k, False: 156k]
  ------------------
 1719|  25.2k|        ret = XML_ENC_ERR_SUCCESS;
 1720|       |
 1721|   181k|    return(ret);
 1722|   181k|}
xmlCharEncInput:
 1795|   455k|{
 1796|   455k|    xmlBufPtr out, in;
 1797|   455k|    const xmlChar *dataIn;
 1798|   455k|    size_t availIn;
 1799|   455k|    size_t maxOut;
 1800|   455k|    size_t totalIn, totalOut;
 1801|   455k|    xmlCharEncError ret;
 1802|       |
 1803|   455k|    out = input->buffer;
 1804|   455k|    in = input->raw;
 1805|       |
 1806|   455k|    maxOut = *sizeOut;
 1807|   455k|    totalOut = 0;
 1808|       |
 1809|   455k|    *sizeOut = 0;
 1810|       |
 1811|   455k|    availIn = xmlBufUse(in);
 1812|   455k|    if ((availIn == 0) && (!flush))
  ------------------
  |  Branch (1812:9): [True: 282k, False: 173k]
  |  Branch (1812:27): [True: 282k, False: 8]
  ------------------
 1813|   282k|        return(0);
 1814|   173k|    dataIn = xmlBufContent(in);
 1815|   173k|    totalIn = 0;
 1816|       |
 1817|   177k|    while (1) {
  ------------------
  |  Branch (1817:12): [True: 177k, Folded]
  ------------------
 1818|   177k|        size_t availOut;
 1819|   177k|        int completeOut, completeIn;
 1820|   177k|        int c_out, c_in;
 1821|       |
 1822|   177k|        availOut = xmlBufAvail(out);
 1823|   177k|        if (availOut > INT_MAX / 2)
  ------------------
  |  Branch (1823:13): [True: 0, False: 177k]
  ------------------
 1824|      0|            availOut = INT_MAX / 2;
 1825|       |
 1826|   177k|        if (availOut < maxOut) {
  ------------------
  |  Branch (1826:13): [True: 117k, False: 59.3k]
  ------------------
 1827|   117k|            c_out = availOut;
 1828|   117k|            completeOut = 0;
 1829|   117k|        } else {
 1830|  59.3k|            c_out = maxOut;
 1831|  59.3k|            completeOut = 1;
 1832|  59.3k|        }
 1833|       |
 1834|   177k|        if (availIn > INT_MAX / 2) {
  ------------------
  |  Branch (1834:13): [True: 0, False: 177k]
  ------------------
 1835|      0|            c_in = INT_MAX / 2;
 1836|      0|            completeIn = 0;
 1837|   177k|        } else {
 1838|   177k|            c_in = availIn;
 1839|   177k|            completeIn = 1;
 1840|   177k|        }
 1841|       |
 1842|   177k|        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
 1843|   177k|                               dataIn, &c_in, flush && completeIn);
  ------------------
  |  Branch (1843:47): [True: 8, False: 177k]
  |  Branch (1843:56): [True: 8, False: 0]
  ------------------
 1844|       |
 1845|   177k|        totalIn += c_in;
 1846|   177k|        dataIn += c_in;
 1847|   177k|        availIn -= c_in;
 1848|       |
 1849|   177k|        totalOut += c_out;
 1850|   177k|        maxOut -= c_out;
 1851|   177k|        xmlBufAddLen(out, c_out);
 1852|       |
 1853|   177k|        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
  ------------------
  |  Branch (1853:13): [True: 26.8k, False: 150k]
  |  Branch (1853:45): [True: 3.57k, False: 23.3k]
  ------------------
 1854|  3.57k|            input->error = xmlEncConvertError(ret);
 1855|  3.57k|            return(ret);
 1856|  3.57k|        }
 1857|       |
 1858|   173k|        if ((completeOut) && (completeIn))
  ------------------
  |  Branch (1858:13): [True: 56.4k, False: 117k]
  |  Branch (1858:30): [True: 56.4k, False: 0]
  ------------------
 1859|  56.4k|            break;
 1860|   117k|        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
  ------------------
  |  Branch (1860:13): [True: 0, False: 117k]
  |  Branch (1860:30): [True: 0, False: 0]
  ------------------
 1861|      0|            break;
 1862|   117k|        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
  ------------------
  |  Branch (1862:13): [True: 117k, False: 0]
  |  Branch (1862:29): [True: 113k, False: 3.84k]
  ------------------
 1863|   113k|            break;
 1864|       |
 1865|  3.84k|        if (ret == XML_ENC_ERR_SPACE) {
  ------------------
  |  Branch (1865:13): [True: 3.84k, False: 0]
  ------------------
 1866|  3.84k|            if (xmlBufGrow(out, 4096) < 0) {
  ------------------
  |  Branch (1866:17): [True: 10, False: 3.83k]
  ------------------
 1867|     10|                input->error = XML_ERR_NO_MEMORY;
 1868|     10|                return(XML_ENC_ERR_MEMORY);
 1869|     10|            }
 1870|  3.84k|        }
 1871|  3.84k|    }
 1872|       |
 1873|   169k|    xmlBufShrink(in, totalIn);
 1874|       |
 1875|   169k|    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
  ------------------
  |  Branch (1875:9): [True: 0, False: 169k]
  ------------------
 1876|      0|        input->rawconsumed = ULONG_MAX;
 1877|   169k|    else
 1878|   169k|        input->rawconsumed += totalIn;
 1879|       |
 1880|   169k|    *sizeOut = totalOut;
 1881|   169k|    return(XML_ENC_ERR_SUCCESS);
 1882|   173k|}
xmlCharEncCloseFunc:
 2192|  20.2k|xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
 2193|  20.2k|    if (handler == NULL)
  ------------------
  |  Branch (2193:9): [True: 155, False: 20.0k]
  ------------------
 2194|    155|        return(0);
 2195|       |
 2196|  20.0k|    if (handler->flags & XML_HANDLER_STATIC)
  ------------------
  |  |   53|  20.0k|#define XML_HANDLER_STATIC (1 << 0)
  ------------------
  |  Branch (2196:9): [True: 5.48k, False: 14.5k]
  ------------------
 2197|  5.48k|        return(0);
 2198|       |
 2199|  14.5k|    xmlFree(handler->name);
 2200|  14.5k|    if (handler->ctxtDtor != NULL) {
  ------------------
  |  Branch (2200:9): [True: 10.8k, False: 3.69k]
  ------------------
 2201|  10.8k|        handler->ctxtDtor(handler->inputCtxt);
 2202|  10.8k|        handler->ctxtDtor(handler->outputCtxt);
 2203|  10.8k|    }
 2204|  14.5k|    xmlFree(handler);
 2205|  14.5k|    return(0);
 2206|  20.0k|}
encoding.c:xmlParseCharEncodingInternal:
  618|  15.0k|{
  619|  15.0k|    const xmlEncTableEntry *entry;
  620|       |
  621|  15.0k|    if (name == NULL)
  ------------------
  |  Branch (621:9): [True: 0, False: 15.0k]
  ------------------
  622|      0|       return(XML_CHAR_ENCODING_NONE);
  623|       |
  624|  15.0k|    entry = bsearch(name, xmlEncTable,
  625|  15.0k|                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
  626|  15.0k|                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
  627|  15.0k|    if (entry != NULL)
  ------------------
  |  Branch (627:9): [True: 5.01k, False: 10.0k]
  ------------------
  628|  5.01k|        return(entry->enc);
  629|       |
  630|  10.0k|    return(XML_CHAR_ENCODING_ERROR);
  631|  15.0k|}
encoding.c:xmlCompareEncTableEntries:
  609|  91.0k|xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
  610|  91.0k|    const char *key = vkey;
  611|  91.0k|    const xmlEncTableEntry *entry = ventry;
  612|       |
  613|  91.0k|    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  91.0k|#define BAD_CAST (xmlChar *)
  ------------------
                  return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
  ------------------
  |  |   34|  91.0k|#define BAD_CAST (xmlChar *)
  ------------------
  614|  91.0k|}
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.46M|    while (in < inend) {
  ------------------
  |  Branch (2500:12): [True: 3.36M, False: 100k]
  ------------------
 2501|  3.36M|        c = in[0] | (in[1] << 8);
 2502|       |
 2503|  3.36M|        if (c < 0x80) {
  ------------------
  |  Branch (2503:13): [True: 13.1k, False: 3.35M]
  ------------------
 2504|  13.1k|            if (out >= outend)
  ------------------
  |  Branch (2504:17): [True: 268, False: 12.8k]
  ------------------
 2505|    268|                goto done;
 2506|  12.8k|            out[0] = c;
 2507|  12.8k|            in += 2;
 2508|  12.8k|            out += 1;
 2509|  3.35M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2509:20): [True: 6.33k, False: 3.34M]
  ------------------
 2510|  6.33k|            if (outend - out < 2)
  ------------------
  |  Branch (2510:17): [True: 283, False: 6.05k]
  ------------------
 2511|    283|                goto done;
 2512|  6.05k|            out[0] = (c >> 6)   | 0xC0;
 2513|  6.05k|            out[1] = (c & 0x3F) | 0x80;
 2514|  6.05k|            in += 2;
 2515|  6.05k|            out += 2;
 2516|  3.34M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2516:20): [True: 3.34M, False: 2.29k]
  ------------------
 2517|  3.34M|            if (outend - out < 3)
  ------------------
  |  Branch (2517:17): [True: 883, False: 3.34M]
  ------------------
 2518|    883|                goto done;
 2519|  3.34M|            out[0] =  (c >> 12)         | 0xE0;
 2520|  3.34M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2521|  3.34M|            out[2] =  (c        & 0x3F) | 0x80;
 2522|  3.34M|            in += 2;
 2523|  3.34M|            out += 3;
 2524|  3.34M|        } else {
 2525|       |            /* Surrogate pair */
 2526|  2.29k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2526:17): [True: 534, False: 1.76k]
  ------------------
 2527|    534|                ret = XML_ENC_ERR_INPUT;
 2528|    534|                goto done;
 2529|    534|            }
 2530|  1.76k|	    if (inend - in < 4)
  ------------------
  |  Branch (2530:10): [True: 344, False: 1.41k]
  ------------------
 2531|    344|		break;
 2532|  1.41k|            d = in[2] | (in[3] << 8);
 2533|  1.41k|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2533:17): [True: 524, False: 892]
  ------------------
 2534|    524|                ret = XML_ENC_ERR_INPUT;
 2535|    524|                goto done;
 2536|    524|            }
 2537|    892|	    if (outend - out < 4)
  ------------------
  |  Branch (2537:10): [True: 226, False: 666]
  ------------------
 2538|    226|		goto done;
 2539|    666|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2540|    666|            out[0] =  (c >> 18)         | 0xF0;
 2541|    666|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2542|    666|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2543|    666|            out[3] =  (c        & 0x3F) | 0x80;
 2544|    666|            in += 4;
 2545|    666|            out += 4;
 2546|    666|        }
 2547|  3.36M|    }
 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|  15.1k|              int flush ATTRIBUTE_UNUSED) {
 2690|  15.1k|    const unsigned char *instart = in;
 2691|  15.1k|    const unsigned char *inend = in + (*inlen & ~1);
 2692|  15.1k|    unsigned char *outstart = out;
 2693|  15.1k|    unsigned char *outend = out + *outlen;
 2694|  15.1k|    unsigned c, d;
 2695|  15.1k|    int ret = XML_ENC_ERR_SPACE;
 2696|       |
 2697|  2.93M|    while (in < inend) {
  ------------------
  |  Branch (2697:12): [True: 2.92M, False: 11.8k]
  ------------------
 2698|  2.92M|        c = (in[0] << 8) | in[1];
 2699|       |
 2700|  2.92M|        if (c < 0x80) {
  ------------------
  |  Branch (2700:13): [True: 22.4k, False: 2.90M]
  ------------------
 2701|  22.4k|            if (out >= outend)
  ------------------
  |  Branch (2701:17): [True: 272, False: 22.1k]
  ------------------
 2702|    272|                goto done;
 2703|  22.1k|            out[0] = c;
 2704|  22.1k|            in += 2;
 2705|  22.1k|            out += 1;
 2706|  2.90M|        } else if (c < 0x800) {
  ------------------
  |  Branch (2706:20): [True: 13.4k, False: 2.89M]
  ------------------
 2707|  13.4k|            if (outend - out < 2)
  ------------------
  |  Branch (2707:17): [True: 220, False: 13.2k]
  ------------------
 2708|    220|                goto done;
 2709|  13.2k|            out[0] = (c >> 6)   | 0xC0;
 2710|  13.2k|            out[1] = (c & 0x3F) | 0x80;
 2711|  13.2k|            in += 2;
 2712|  13.2k|            out += 2;
 2713|  2.89M|        } else if ((c & 0xF800) != 0xD800) {
  ------------------
  |  Branch (2713:20): [True: 2.88M, False: 1.82k]
  ------------------
 2714|  2.88M|            if (outend - out < 3)
  ------------------
  |  Branch (2714:17): [True: 1.45k, False: 2.88M]
  ------------------
 2715|  1.45k|                goto done;
 2716|  2.88M|            out[0] =  (c >> 12)         | 0xE0;
 2717|  2.88M|            out[1] = ((c >>  6) & 0x3F) | 0x80;
 2718|  2.88M|            out[2] =  (c        & 0x3F) | 0x80;
 2719|  2.88M|            in += 2;
 2720|  2.88M|            out += 3;
 2721|  2.88M|        } else {
 2722|       |            /* Surrogate pair */
 2723|  1.82k|            if ((c & 0xFC00) != 0xD800) {
  ------------------
  |  Branch (2723:17): [True: 727, False: 1.10k]
  ------------------
 2724|    727|                ret = XML_ENC_ERR_INPUT;
 2725|    727|                goto done;
 2726|    727|            }
 2727|  1.10k|	    if (inend - in < 4)
  ------------------
  |  Branch (2727:10): [True: 265, False: 835]
  ------------------
 2728|    265|		break;
 2729|    835|            d = (in[2] << 8) | in[3];
 2730|    835|            if ((d & 0xFC00) != 0xDC00) {
  ------------------
  |  Branch (2730:17): [True: 221, False: 614]
  ------------------
 2731|    221|                ret = XML_ENC_ERR_INPUT;
 2732|    221|                goto done;
 2733|    221|            }
 2734|    614|	    if (outend - out < 4)
  ------------------
  |  Branch (2734:10): [True: 134, False: 480]
  ------------------
 2735|    134|		goto done;
 2736|    480|            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
 2737|    480|            out[0] =  (c >> 18)         | 0xF0;
 2738|    480|            out[1] = ((c >> 12) & 0x3F) | 0x80;
 2739|    480|            out[2] = ((c >>  6) & 0x3F) | 0x80;
 2740|    480|            out[3] =  (c        & 0x3F) | 0x80;
 2741|    480|            in += 4;
 2742|    480|            out += 4;
 2743|    480|        }
 2744|  2.92M|    }
 2745|       |
 2746|  12.1k|    ret = out - outstart;
 2747|       |
 2748|  15.1k|done:
 2749|  15.1k|    *outlen = out - outstart;
 2750|  15.1k|    *inlen = in - instart;
 2751|  15.1k|    return(ret);
 2752|  12.1k|}
encoding.c:asciiToAscii:
 2278|  1.13k|             int flush ATTRIBUTE_UNUSED) {
 2279|  1.13k|    const unsigned char *inend;
 2280|  1.13k|    const unsigned char *instart = in;
 2281|  1.13k|    int inlen, outlen, ret;
 2282|       |
 2283|  1.13k|    if (in == NULL) {
  ------------------
  |  Branch (2283:9): [True: 0, False: 1.13k]
  ------------------
 2284|      0|        *pinlen = 0;
 2285|      0|        *poutlen = 0;
 2286|      0|        return(XML_ENC_ERR_SUCCESS);
 2287|      0|    }
 2288|       |
 2289|  1.13k|    inlen = *pinlen;
 2290|  1.13k|    outlen = *poutlen;
 2291|       |
 2292|  1.13k|    if (outlen < inlen) {
  ------------------
  |  Branch (2292:9): [True: 228, False: 904]
  ------------------
 2293|    228|        inlen = outlen;
 2294|    228|        ret = XML_ENC_ERR_SPACE;
 2295|    904|    } else {
 2296|    904|        ret = inlen;
 2297|    904|    }
 2298|       |
 2299|  1.13k|    inend = in + inlen;
 2300|  1.13k|    *poutlen = inlen;
 2301|  1.13k|    *pinlen = inlen;
 2302|       |
 2303|  55.3k|    while (in < inend) {
  ------------------
  |  Branch (2303:12): [True: 55.1k, False: 213]
  ------------------
 2304|  55.1k|	unsigned c = *in;
 2305|       |
 2306|  55.1k|        if (c >= 0x80) {
  ------------------
  |  Branch (2306:13): [True: 919, False: 54.2k]
  ------------------
 2307|    919|	    *poutlen = in - instart;
 2308|    919|	    *pinlen = in - instart;
 2309|    919|	    return(XML_ENC_ERR_INPUT);
 2310|    919|	}
 2311|       |
 2312|  54.2k|        in++;
 2313|  54.2k|	*out++ = c;
 2314|  54.2k|    }
 2315|       |
 2316|    213|    return(ret);
 2317|  1.13k|}
encoding.c:xmlFindExtraHandler:
  908|  11.6k|                    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.6k|    if (impl != NULL)
  ------------------
  |  Branch (915:9): [True: 0, False: 11.6k]
  ------------------
  916|      0|        return(impl(implCtxt, norig, flags, out));
  917|       |
  918|       |    /*
  919|       |     * Deprecated
  920|       |     */
  921|  11.6k|    if (globalHandlers != NULL) {
  ------------------
  |  Branch (921:9): [True: 0, False: 11.6k]
  ------------------
  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.6k|#ifdef LIBXML_ICONV_ENABLED
  939|  11.6k|    {
  940|  11.6k|        int ret = xmlCharEncIconv(name, flags, out);
  941|       |
  942|  11.6k|        if (ret == XML_ERR_OK)
  ------------------
  |  Branch (942:13): [True: 10.8k, False: 733]
  ------------------
  943|  10.8k|            return(XML_ERR_OK);
  944|    733|        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
  ------------------
  |  Branch (944:13): [True: 23, False: 710]
  ------------------
  945|     23|            return(ret);
  946|    733|    }
  947|    710|#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|    710|    return(XML_ERR_UNSUPPORTED_ENCODING);
  961|    733|}
encoding.c:xmlCharEncIconv:
 1319|  11.6k|                xmlCharEncodingHandler **out) {
 1320|  11.6k|    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
 1321|  11.6k|    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
 1322|  11.6k|    iconv_t icv_in;
 1323|  11.6k|    iconv_t icv_out;
 1324|  11.6k|    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.6k|    if (strstr(name, "//") != NULL) {
  ------------------
  |  Branch (1353:9): [True: 6, False: 11.6k]
  ------------------
 1354|      6|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1355|      6|        goto error;
 1356|      6|    }
 1357|       |
 1358|  11.6k|#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
 1359|  11.6k|    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.6k|    if ((xmlEncodingMatch(name, "TSCII")) ||
  ------------------
  |  Branch (1366:9): [True: 234, False: 11.3k]
  ------------------
 1367|  11.3k|        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
  ------------------
  |  Branch (1367:9): [True: 0, False: 11.3k]
  ------------------
 1368|    234|        ret = XML_ERR_UNSUPPORTED_ENCODING;
 1369|    234|        goto error;
 1370|    234|    }
 1371|  11.3k|#endif
 1372|       |
 1373|  11.3k|    if (flags & XML_ENC_INPUT) {
  ------------------
  |  Branch (1373:9): [True: 11.3k, False: 0]
  ------------------
 1374|  11.3k|        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1375|  11.3k|        if (inputCtxt == NULL) {
  ------------------
  |  Branch (1375:13): [True: 5, False: 11.3k]
  ------------------
 1376|      5|            ret = XML_ERR_NO_MEMORY;
 1377|      5|            goto error;
 1378|      5|        }
 1379|  11.3k|        inputCtxt->cd = (iconv_t) -1;
 1380|       |
 1381|  11.3k|        icv_in = iconv_open("UTF-8", name);
 1382|  11.3k|        if (icv_in == (iconv_t) -1) {
  ------------------
  |  Branch (1382:13): [True: 470, False: 10.9k]
  ------------------
 1383|    470|            if (errno == EINVAL)
  ------------------
  |  Branch (1383:17): [True: 470, False: 0]
  ------------------
 1384|    470|                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|    470|            goto error;
 1390|    470|        }
 1391|  10.9k|        inputCtxt->cd = icv_in;
 1392|       |
 1393|  10.9k|        inFunc = xmlIconvConvert;
 1394|  10.9k|    }
 1395|       |
 1396|  10.9k|    if (flags & XML_ENC_OUTPUT) {
  ------------------
  |  Branch (1396:9): [True: 998, False: 9.91k]
  ------------------
 1397|    998|        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
 1398|    998|        if (outputCtxt == NULL) {
  ------------------
  |  Branch (1398:13): [True: 2, False: 996]
  ------------------
 1399|      2|            ret = XML_ERR_NO_MEMORY;
 1400|      2|            goto error;
 1401|      2|        }
 1402|    996|        outputCtxt->cd = (iconv_t) -1;
 1403|       |
 1404|    996|        icv_out = iconv_open(name, "UTF-8");
 1405|    996|        if (icv_out == (iconv_t) -1) {
  ------------------
  |  Branch (1405:13): [True: 0, False: 996]
  ------------------
 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|    996|        outputCtxt->cd = icv_out;
 1415|       |
 1416|    996|        outFunc = xmlIconvConvert;
 1417|    996|    }
 1418|       |
 1419|  10.9k|    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
 1420|  10.9k|                                      inputCtxt, outputCtxt, out));
 1421|       |
 1422|    717|error:
 1423|    717|    if (inputCtxt != NULL)
  ------------------
  |  Branch (1423:9): [True: 472, False: 245]
  ------------------
 1424|    472|        xmlIconvFree(inputCtxt);
 1425|    717|    if (outputCtxt != NULL)
  ------------------
  |  Branch (1425:9): [True: 0, False: 717]
  ------------------
 1426|      0|        xmlIconvFree(outputCtxt);
 1427|    717|    return(ret);
 1428|  10.9k|}
encoding.c:xmlEncodingMatch:
 1295|  23.0k|xmlEncodingMatch(const char *name1, const char *name2) {
 1296|       |    /*
 1297|       |     * Fuzzy match for encoding names
 1298|       |     */
 1299|  24.2k|    while (1) {
  ------------------
  |  Branch (1299:12): [True: 24.2k, Folded]
  ------------------
 1300|  25.5k|        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
  ------------------
  |  |  222|  25.0k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 24.4k, False: 615]
  |  |  ------------------
  |  |  223|  25.0k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 23.8k, False: 652]
  |  |  ------------------
  ------------------
  |  Branch (1300:16): [True: 25.0k, False: 461]
  ------------------
 1301|  1.26k|            name1 += 1;
 1302|  24.2k|        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
  ------------------
  |  |  222|  24.0k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 24.0k, False: 0]
  |  |  ------------------
  |  |  223|  24.0k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 24.0k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1302:16): [True: 24.0k, False: 234]
  ------------------
 1303|      0|            name2 += 1;
 1304|  24.2k|        if ((*name1 == 0) || (*name2 == 0))
  ------------------
  |  Branch (1304:13): [True: 461, False: 23.8k]
  |  Branch (1304:30): [True: 215, False: 23.6k]
  ------------------
 1305|    676|            break;
 1306|  23.6k|        if ((*name1 | 0x20) != (*name2 | 0x20))
  ------------------
  |  Branch (1306:13): [True: 22.3k, False: 1.28k]
  ------------------
 1307|  22.3k|            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|    676|    return(*name2 == 0);
 1314|  23.0k|}
encoding.c:xmlIconvConvert:
 1234|  39.5k|                int flush ATTRIBUTE_UNUSED) {
 1235|  39.5k|    xmlIconvCtxt *ctxt = vctxt;
 1236|  39.5k|    size_t icv_inlen, icv_outlen;
 1237|  39.5k|    const char *icv_in = (const char *) in;
 1238|  39.5k|    char *icv_out = (char *) out;
 1239|  39.5k|    size_t ret;
 1240|       |
 1241|  39.5k|    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
  ------------------
  |  Branch (1241:9): [True: 0, False: 39.5k]
  |  Branch (1241:26): [True: 0, False: 39.5k]
  |  Branch (1241:46): [True: 0, False: 39.5k]
  |  Branch (1241:65): [True: 0, False: 39.5k]
  ------------------
 1242|      0|        if (outlen != NULL) *outlen = 0;
  ------------------
  |  Branch (1242:13): [True: 0, False: 0]
  ------------------
 1243|      0|        return(XML_ENC_ERR_INTERNAL);
 1244|      0|    }
 1245|  39.5k|    icv_inlen = *inlen;
 1246|  39.5k|    icv_outlen = *outlen;
 1247|       |    /*
 1248|       |     * Some versions take const, other versions take non-const input.
 1249|       |     */
 1250|  39.5k|    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
 1251|  39.5k|    *inlen -= icv_inlen;
 1252|  39.5k|    *outlen -= icv_outlen;
 1253|  39.5k|    if (ret == (size_t) -1) {
  ------------------
  |  Branch (1253:9): [True: 17.8k, False: 21.6k]
  ------------------
 1254|  17.8k|        if (errno == EILSEQ)
  ------------------
  |  Branch (1254:13): [True: 646, False: 17.2k]
  ------------------
 1255|    646|            return(XML_ENC_ERR_INPUT);
 1256|  17.2k|        if (errno == E2BIG)
  ------------------
  |  Branch (1256:13): [True: 14.6k, False: 2.63k]
  ------------------
 1257|  14.6k|            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.63k|        if (errno == EINVAL)
  ------------------
  |  Branch (1262:13): [True: 2.63k, False: 0]
  ------------------
 1263|  2.63k|            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.63k|    }
 1274|  21.6k|    return(XML_ENC_ERR_SUCCESS);
 1275|  39.5k|}
encoding.c:xmlIconvFree:
 1278|  22.2k|xmlIconvFree(void *vctxt) {
 1279|  22.2k|    xmlIconvCtxt *ctxt = vctxt;
 1280|       |
 1281|  22.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (1281:9): [True: 9.89k, False: 12.3k]
  ------------------
 1282|  9.89k|        return;
 1283|       |
 1284|  12.3k|    if (ctxt->cd != (iconv_t) -1)
  ------------------
  |  Branch (1284:9): [True: 11.9k, False: 470]
  ------------------
 1285|  11.9k|        iconv_close(ctxt->cd);
 1286|       |
 1287|  12.3k|    xmlFree(ctxt);
 1288|  12.3k|}
encoding.c:xmlEncConvertError:
 1649|  3.57k|xmlEncConvertError(xmlCharEncError code) {
 1650|  3.57k|    xmlParserErrors ret;
 1651|       |
 1652|  3.57k|    switch (code) {
 1653|      0|        case XML_ENC_ERR_SUCCESS:
  ------------------
  |  Branch (1653:9): [True: 0, False: 3.57k]
  ------------------
 1654|      0|            ret = XML_ERR_OK;
 1655|      0|            break;
 1656|  3.57k|        case XML_ENC_ERR_INPUT:
  ------------------
  |  Branch (1656:9): [True: 3.57k, False: 0]
  ------------------
 1657|  3.57k|            ret = XML_ERR_INVALID_ENCODING;
 1658|  3.57k|            break;
 1659|      0|        case XML_ENC_ERR_MEMORY:
  ------------------
  |  Branch (1659:9): [True: 0, False: 3.57k]
  ------------------
 1660|      0|            ret = XML_ERR_NO_MEMORY;
 1661|      0|            break;
 1662|      0|        default:
  ------------------
  |  Branch (1662:9): [True: 0, False: 3.57k]
  ------------------
 1663|      0|            ret = XML_ERR_INTERNAL_ERROR;
 1664|      0|            break;
 1665|  3.57k|    }
 1666|       |
 1667|  3.57k|    return(ret);
 1668|  3.57k|}
encoding.c:latin1ToUTF8:
 2323|  22.6k|             int flush ATTRIBUTE_UNUSED) {
 2324|  22.6k|    unsigned char* outstart = out;
 2325|  22.6k|    const unsigned char* instart = in;
 2326|  22.6k|    unsigned char* outend;
 2327|  22.6k|    const unsigned char* inend;
 2328|  22.6k|    int ret = XML_ENC_ERR_SPACE;
 2329|       |
 2330|  22.6k|    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
  ------------------
  |  Branch (2330:9): [True: 0, False: 22.6k]
  |  Branch (2330:26): [True: 0, False: 22.6k]
  |  Branch (2330:42): [True: 0, False: 22.6k]
  |  Branch (2330:62): [True: 0, False: 22.6k]
  ------------------
 2331|      0|	return(XML_ENC_ERR_INTERNAL);
 2332|       |
 2333|  22.6k|    outend = out + *outlen;
 2334|  22.6k|    inend = in + *inlen;
 2335|       |
 2336|  20.2M|    while (in < inend) {
  ------------------
  |  Branch (2336:12): [True: 20.1M, False: 16.7k]
  ------------------
 2337|  20.1M|        unsigned c = *in;
 2338|       |
 2339|  20.1M|	if (c < 0x80) {
  ------------------
  |  Branch (2339:6): [True: 7.06M, False: 13.1M]
  ------------------
 2340|  7.06M|            if (out >= outend)
  ------------------
  |  Branch (2340:17): [True: 2.65k, False: 7.05M]
  ------------------
 2341|  2.65k|                goto done;
 2342|  7.05M|            *out++ = c;
 2343|  13.1M|	} else {
 2344|  13.1M|            if (outend - out < 2)
  ------------------
  |  Branch (2344:17): [True: 3.28k, False: 13.1M]
  ------------------
 2345|  3.28k|                goto done;
 2346|  13.1M|	    *out++ = (c >> 6) | 0xC0;
 2347|  13.1M|            *out++ = (c & 0x3F) | 0x80;
 2348|  13.1M|        }
 2349|       |
 2350|  20.1M|        in++;
 2351|  20.1M|    }
 2352|       |
 2353|  16.7k|    ret = out - outstart;
 2354|       |
 2355|  22.6k|done:
 2356|  22.6k|    *outlen = out - outstart;
 2357|  22.6k|    *inlen = in - instart;
 2358|  22.6k|    return(ret);
 2359|  16.7k|}

xmlFreeEntity:
   85|   145k|{
   86|   145k|    xmlDictPtr dict = NULL;
   87|       |
   88|   145k|    if (entity == NULL)
  ------------------
  |  Branch (88:9): [True: 0, False: 145k]
  ------------------
   89|      0|        return;
   90|       |
   91|   145k|    if (entity->doc != NULL)
  ------------------
  |  Branch (91:9): [True: 142k, False: 3.18k]
  ------------------
   92|   142k|        dict = entity->doc->dict;
   93|       |
   94|       |
   95|   145k|    if ((entity->children) &&
  ------------------
  |  Branch (95:9): [True: 4.09k, False: 141k]
  ------------------
   96|  4.09k|        (entity == (xmlEntityPtr) entity->children->parent))
  ------------------
  |  Branch (96:9): [True: 4.09k, False: 0]
  ------------------
   97|  4.09k|        xmlFreeNodeList(entity->children);
   98|   145k|    if ((entity->name != NULL) &&
  ------------------
  |  Branch (98:9): [True: 145k, False: 11]
  ------------------
   99|   145k|        ((dict == NULL) || (!xmlDictOwns(dict, entity->name))))
  ------------------
  |  Branch (99:10): [True: 118k, False: 27.3k]
  |  Branch (99:28): [True: 0, False: 27.3k]
  ------------------
  100|   118k|        xmlFree((char *) entity->name);
  101|   145k|    if (entity->ExternalID != NULL)
  ------------------
  |  Branch (101:9): [True: 3.56k, False: 142k]
  ------------------
  102|  3.56k|        xmlFree((char *) entity->ExternalID);
  103|   145k|    if (entity->SystemID != NULL)
  ------------------
  |  Branch (103:9): [True: 13.9k, False: 131k]
  ------------------
  104|  13.9k|        xmlFree((char *) entity->SystemID);
  105|   145k|    if (entity->URI != NULL)
  ------------------
  |  Branch (105:9): [True: 9.04k, False: 136k]
  ------------------
  106|  9.04k|        xmlFree((char *) entity->URI);
  107|   145k|    if (entity->content != NULL)
  ------------------
  |  Branch (107:9): [True: 127k, False: 18.0k]
  ------------------
  108|   127k|        xmlFree((char *) entity->content);
  109|   145k|    if (entity->orig != NULL)
  ------------------
  |  Branch (109:9): [True: 15.5k, False: 130k]
  ------------------
  110|  15.5k|        xmlFree((char *) entity->orig);
  111|   145k|    xmlFree(entity);
  112|   145k|}
xmlAddEntity:
  188|   146k|	  const xmlChar *content, xmlEntity **out) {
  189|   146k|    xmlDtdPtr dtd;
  190|   146k|    xmlDictPtr dict = NULL;
  191|   146k|    xmlEntitiesTablePtr table = NULL;
  192|   146k|    xmlEntityPtr ret, predef;
  193|   146k|    int res;
  194|       |
  195|   146k|    if (out != NULL)
  ------------------
  |  Branch (195:9): [True: 146k, False: 0]
  ------------------
  196|   146k|        *out = NULL;
  197|   146k|    if ((doc == NULL) || (name == NULL))
  ------------------
  |  Branch (197:9): [True: 0, False: 146k]
  |  Branch (197:26): [True: 0, False: 146k]
  ------------------
  198|      0|	return(XML_ERR_ARGUMENT);
  199|   146k|    dict = doc->dict;
  200|       |
  201|   146k|    if (extSubset)
  ------------------
  |  Branch (201:9): [True: 6.11k, False: 140k]
  ------------------
  202|  6.11k|        dtd = doc->extSubset;
  203|   140k|    else
  204|   140k|        dtd = doc->intSubset;
  205|   146k|    if (dtd == NULL)
  ------------------
  |  Branch (205:9): [True: 0, False: 146k]
  ------------------
  206|      0|        return(XML_DTD_NO_DTD);
  207|       |
  208|   146k|    switch (type) {
  209|  64.6k|        case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (209:9): [True: 64.6k, False: 82.1k]
  ------------------
  210|  74.7k|        case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (210:9): [True: 10.0k, False: 136k]
  ------------------
  211|  75.3k|        case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (211:9): [True: 617, False: 146k]
  ------------------
  212|  75.3k|            predef = xmlGetPredefinedEntity(name);
  213|  75.3k|            if (predef != NULL) {
  ------------------
  |  Branch (213:17): [True: 4.76k, False: 70.5k]
  ------------------
  214|  4.76k|                int valid = 0;
  215|       |
  216|       |                /* 4.6 Predefined Entities */
  217|  4.76k|                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
  ------------------
  |  Branch (217:21): [True: 4.39k, False: 373]
  ------------------
  218|  4.39k|                    (content != NULL)) {
  ------------------
  |  Branch (218:21): [True: 2.82k, False: 1.57k]
  ------------------
  219|  2.82k|                    int c = predef->content[0];
  220|       |
  221|  2.82k|                    if (((content[0] == c) && (content[1] == 0)) &&
  ------------------
  |  Branch (221:26): [True: 1.39k, False: 1.42k]
  |  Branch (221:47): [True: 540, False: 855]
  ------------------
  222|    540|                        ((c == '>') || (c == '\'') || (c == '"'))) {
  ------------------
  |  Branch (222:26): [True: 118, False: 422]
  |  Branch (222:40): [True: 112, False: 310]
  |  Branch (222:55): [True: 83, False: 227]
  ------------------
  223|    313|                        valid = 1;
  224|  2.51k|                    } else if ((content[0] == '&') && (content[1] == '#')) {
  ------------------
  |  Branch (224:32): [True: 1.16k, False: 1.34k]
  |  Branch (224:55): [True: 766, False: 399]
  ------------------
  225|    766|                        if (content[2] == 'x') {
  ------------------
  |  Branch (225:29): [True: 85, False: 681]
  ------------------
  226|     85|                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
  ------------------
  |  |   34|     85|#define BAD_CAST (xmlChar *)
  ------------------
  227|     85|                            xmlChar ref[] = "00;";
  228|       |
  229|     85|                            ref[0] = hex[c / 16 % 16];
  230|     85|                            ref[1] = hex[c % 16];
  231|     85|                            if (xmlStrcasecmp(&content[3], ref) == 0)
  ------------------
  |  Branch (231:33): [True: 10, False: 75]
  ------------------
  232|     10|                                valid = 1;
  233|    681|                        } else {
  234|    681|                            xmlChar ref[] = "00;";
  235|       |
  236|    681|                            ref[0] = '0' + c / 10 % 10;
  237|    681|                            ref[1] = '0' + c % 10;
  238|    681|                            if (xmlStrEqual(&content[2], ref))
  ------------------
  |  Branch (238:33): [True: 249, False: 432]
  ------------------
  239|    249|                                valid = 1;
  240|    681|                        }
  241|    766|                    }
  242|  2.82k|                }
  243|  4.76k|                if (!valid)
  ------------------
  |  Branch (243:21): [True: 4.19k, False: 572]
  ------------------
  244|  4.19k|                    return(XML_ERR_REDECL_PREDEF_ENTITY);
  245|  4.76k|            }
  246|  71.1k|	    if (dtd->entities == NULL) {
  ------------------
  |  Branch (246:10): [True: 5.25k, False: 65.8k]
  ------------------
  247|  5.25k|		dtd->entities = xmlHashCreateDict(0, dict);
  248|  5.25k|                if (dtd->entities == NULL)
  ------------------
  |  Branch (248:21): [True: 1, False: 5.25k]
  ------------------
  249|      1|                    return(XML_ERR_NO_MEMORY);
  250|  5.25k|            }
  251|  71.1k|	    table = dtd->entities;
  252|  71.1k|	    break;
  253|  65.3k|        case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (253:9): [True: 65.3k, False: 81.4k]
  ------------------
  254|  71.4k|        case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (254:9): [True: 6.07k, False: 140k]
  ------------------
  255|  71.4k|	    if (dtd->pentities == NULL) {
  ------------------
  |  Branch (255:10): [True: 3.38k, False: 68.0k]
  ------------------
  256|  3.38k|		dtd->pentities = xmlHashCreateDict(0, dict);
  257|  3.38k|                if (dtd->pentities == NULL)
  ------------------
  |  Branch (257:21): [True: 1, False: 3.38k]
  ------------------
  258|      1|                    return(XML_ERR_NO_MEMORY);
  259|  3.38k|            }
  260|  71.4k|	    table = dtd->pentities;
  261|  71.4k|	    break;
  262|      0|        default:
  ------------------
  |  Branch (262:9): [True: 0, False: 146k]
  ------------------
  263|      0|	    return(XML_ERR_ARGUMENT);
  264|   146k|    }
  265|   142k|    ret = xmlCreateEntity(dtd->doc, name, type, publicId, systemId, content);
  266|   142k|    if (ret == NULL)
  ------------------
  |  Branch (266:9): [True: 24, False: 142k]
  ------------------
  267|     24|        return(XML_ERR_NO_MEMORY);
  268|       |
  269|   142k|    res = xmlHashAdd(table, name, ret);
  270|   142k|    if (res < 0) {
  ------------------
  |  Branch (270:9): [True: 7, False: 142k]
  ------------------
  271|      7|        xmlFreeEntity(ret);
  272|      7|        return(XML_ERR_NO_MEMORY);
  273|   142k|    } else if (res == 0) {
  ------------------
  |  Branch (273:16): [True: 120k, False: 21.7k]
  ------------------
  274|       |	/*
  275|       |	 * entity was already defined at another level.
  276|       |	 */
  277|   120k|        xmlFreeEntity(ret);
  278|   120k|	return(XML_WAR_ENTITY_REDEFINED);
  279|   120k|    }
  280|       |
  281|       |    /*
  282|       |     * Link it to the DTD
  283|       |     */
  284|  21.7k|    ret->parent = dtd;
  285|  21.7k|    ret->doc = dtd->doc;
  286|  21.7k|    if (dtd->last == NULL) {
  ------------------
  |  Branch (286:9): [True: 5.98k, False: 15.7k]
  ------------------
  287|  5.98k|	dtd->children = dtd->last = (xmlNodePtr) ret;
  288|  15.7k|    } else {
  289|  15.7k|	dtd->last->next = (xmlNodePtr) ret;
  290|  15.7k|	ret->prev = dtd->last;
  291|  15.7k|	dtd->last = (xmlNodePtr) ret;
  292|  15.7k|    }
  293|       |
  294|  21.7k|    if (out != NULL)
  ------------------
  |  Branch (294:9): [True: 21.7k, False: 0]
  ------------------
  295|  21.7k|        *out = ret;
  296|  21.7k|    return(0);
  297|   142k|}
xmlGetPredefinedEntity:
  306|  5.54M|xmlGetPredefinedEntity(const xmlChar *name) {
  307|  5.54M|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (307:9): [True: 6, False: 5.54M]
  ------------------
  308|  5.54M|    switch (name[0]) {
  309|   312k|        case 'l':
  ------------------
  |  Branch (309:9): [True: 312k, False: 5.23M]
  ------------------
  310|   312k|	    if (xmlStrEqual(name, BAD_CAST "lt"))
  ------------------
  |  |   34|   312k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (310:10): [True: 13.2k, False: 299k]
  ------------------
  311|  13.2k|	        return(&xmlEntityLt);
  312|   299k|	    break;
  313|  1.60M|        case 'g':
  ------------------
  |  Branch (313:9): [True: 1.60M, False: 3.94M]
  ------------------
  314|  1.60M|	    if (xmlStrEqual(name, BAD_CAST "gt"))
  ------------------
  |  |   34|  1.60M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (314:10): [True: 1.56M, False: 39.7k]
  ------------------
  315|  1.56M|	        return(&xmlEntityGt);
  316|  39.7k|	    break;
  317|  86.6k|        case 'a':
  ------------------
  |  Branch (317:9): [True: 86.6k, False: 5.46M]
  ------------------
  318|  86.6k|	    if (xmlStrEqual(name, BAD_CAST "amp"))
  ------------------
  |  |   34|  86.6k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (318:10): [True: 11.6k, False: 74.9k]
  ------------------
  319|  11.6k|	        return(&xmlEntityAmp);
  320|  74.9k|	    if (xmlStrEqual(name, BAD_CAST "apos"))
  ------------------
  |  |   34|  74.9k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (320:10): [True: 7.39k, False: 67.5k]
  ------------------
  321|  7.39k|	        return(&xmlEntityApos);
  322|  67.5k|	    break;
  323|   101k|        case 'q':
  ------------------
  |  Branch (323:9): [True: 101k, False: 5.44M]
  ------------------
  324|   101k|	    if (xmlStrEqual(name, BAD_CAST "quot"))
  ------------------
  |  |   34|   101k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (324:10): [True: 101k, False: 894]
  ------------------
  325|   101k|	        return(&xmlEntityQuot);
  326|    894|	    break;
  327|  3.44M|	default:
  ------------------
  |  Branch (327:2): [True: 3.44M, False: 2.10M]
  ------------------
  328|  3.44M|	    break;
  329|  5.54M|    }
  330|  3.85M|    return(NULL);
  331|  5.54M|}
xmlAddDocEntity:
  372|    133|	        const xmlChar *content) {
  373|    133|    xmlEntityPtr ret;
  374|       |
  375|    133|    xmlAddEntity(doc, 0, name, type, publicId, systemId, content, &ret);
  376|    133|    return(ret);
  377|    133|}
xmlGetParameterEntity:
  428|   480k|xmlGetParameterEntity(xmlDoc *doc, const xmlChar *name) {
  429|   480k|    xmlEntitiesTablePtr table;
  430|   480k|    xmlEntityPtr ret;
  431|       |
  432|   480k|    if (doc == NULL)
  ------------------
  |  Branch (432:9): [True: 43, False: 480k]
  ------------------
  433|     43|	return(NULL);
  434|   480k|    if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
  ------------------
  |  Branch (434:9): [True: 480k, False: 24]
  |  Branch (434:37): [True: 466k, False: 14.6k]
  ------------------
  435|   466k|	table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
  436|   466k|	ret = xmlGetEntityFromTable(table, name);
  437|   466k|	if (ret != NULL)
  ------------------
  |  Branch (437:6): [True: 356k, False: 109k]
  ------------------
  438|   356k|	    return(ret);
  439|   466k|    }
  440|   124k|    if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
  ------------------
  |  Branch (440:9): [True: 15.2k, False: 109k]
  |  Branch (440:37): [True: 14.9k, False: 293]
  ------------------
  441|  14.9k|	table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
  442|  14.9k|	return(xmlGetEntityFromTable(table, name));
  443|  14.9k|    }
  444|   109k|    return(NULL);
  445|   124k|}
xmlGetDocEntity:
  476|  2.87M|xmlGetDocEntity(const xmlDoc *doc, const xmlChar *name) {
  477|  2.87M|    xmlEntityPtr cur;
  478|  2.87M|    xmlEntitiesTablePtr table;
  479|       |
  480|  2.87M|    if (doc != NULL) {
  ------------------
  |  Branch (480:9): [True: 2.87M, False: 1.15k]
  ------------------
  481|  2.87M|	if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
  ------------------
  |  Branch (481:6): [True: 2.85M, False: 20.2k]
  |  Branch (481:34): [True: 2.79M, False: 64.8k]
  ------------------
  482|  2.79M|	    table = (xmlEntitiesTablePtr) doc->intSubset->entities;
  483|  2.79M|	    cur = xmlGetEntityFromTable(table, name);
  484|  2.79M|	    if (cur != NULL)
  ------------------
  |  Branch (484:10): [True: 2.34M, False: 444k]
  ------------------
  485|  2.34M|		return(cur);
  486|  2.79M|	}
  487|   529k|	if (doc->standalone != 1) {
  ------------------
  |  Branch (487:6): [True: 528k, False: 891]
  ------------------
  488|   528k|	    if ((doc->extSubset != NULL) &&
  ------------------
  |  Branch (488:10): [True: 5.14k, False: 523k]
  ------------------
  489|  5.14k|		(doc->extSubset->entities != NULL)) {
  ------------------
  |  Branch (489:3): [True: 4.05k, False: 1.09k]
  ------------------
  490|  4.05k|		table = (xmlEntitiesTablePtr) doc->extSubset->entities;
  491|  4.05k|		cur = xmlGetEntityFromTable(table, name);
  492|  4.05k|		if (cur != NULL)
  ------------------
  |  Branch (492:7): [True: 3.07k, False: 982]
  ------------------
  493|  3.07k|		    return(cur);
  494|  4.05k|	    }
  495|   528k|	}
  496|   529k|    }
  497|   527k|    return(xmlGetPredefinedEntity(name));
  498|  2.87M|}
xmlFreeEntitiesTable:
  588|  10.8k|xmlFreeEntitiesTable(xmlEntitiesTable *table) {
  589|  10.8k|    xmlHashFree(table, xmlFreeEntityWrapper);
  590|  10.8k|}
xmlCopyEntitiesTable:
  665|  2.24k|xmlCopyEntitiesTable(xmlEntitiesTable *table) {
  666|  2.24k|    return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
  667|  2.24k|}
entities.c:xmlCreateEntity:
  120|   142k|	        const xmlChar *content) {
  121|   142k|    xmlEntityPtr ret;
  122|       |
  123|   142k|    ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  124|   142k|    if (ret == NULL)
  ------------------
  |  Branch (124:9): [True: 10, False: 142k]
  ------------------
  125|     10|	return(NULL);
  126|   142k|    memset(ret, 0, sizeof(xmlEntity));
  127|   142k|    ret->doc = doc;
  128|   142k|    ret->type = XML_ENTITY_DECL;
  129|       |
  130|       |    /*
  131|       |     * fill the structure.
  132|       |     */
  133|   142k|    ret->etype = (xmlEntityType) type;
  134|   142k|    if ((doc == NULL) || (doc->dict == NULL))
  ------------------
  |  Branch (134:9): [True: 0, False: 142k]
  |  Branch (134:26): [True: 115k, False: 27.3k]
  ------------------
  135|   115k|	ret->name = xmlStrdup(name);
  136|  27.3k|    else
  137|  27.3k|        ret->name = xmlDictLookup(doc->dict, name, -1);
  138|   142k|    if (ret->name == NULL)
  ------------------
  |  Branch (138:9): [True: 3, False: 142k]
  ------------------
  139|      3|        goto error;
  140|   142k|    if (publicId != NULL) {
  ------------------
  |  Branch (140:9): [True: 3.20k, False: 139k]
  ------------------
  141|  3.20k|        ret->ExternalID = xmlStrdup(publicId);
  142|  3.20k|        if (ret->ExternalID == NULL)
  ------------------
  |  Branch (142:13): [True: 1, False: 3.20k]
  ------------------
  143|      1|            goto error;
  144|  3.20k|    }
  145|   142k|    if (systemId != NULL) {
  ------------------
  |  Branch (145:9): [True: 12.4k, False: 130k]
  ------------------
  146|  12.4k|        ret->SystemID = xmlStrdup(systemId);
  147|  12.4k|        if (ret->SystemID == NULL)
  ------------------
  |  Branch (147:13): [True: 2, False: 12.4k]
  ------------------
  148|      2|            goto error;
  149|  12.4k|    }
  150|   142k|    if (content != NULL) {
  ------------------
  |  Branch (150:9): [True: 125k, False: 16.9k]
  ------------------
  151|   125k|        ret->length = xmlStrlen(content);
  152|   125k|	ret->content = xmlStrndup(content, ret->length);
  153|   125k|        if (ret->content == NULL)
  ------------------
  |  Branch (153:13): [True: 8, False: 125k]
  ------------------
  154|      8|            goto error;
  155|   125k|     } else {
  156|  16.9k|        ret->length = 0;
  157|  16.9k|        ret->content = NULL;
  158|  16.9k|    }
  159|   142k|    ret->URI = NULL; /* to be computed by the layer knowing
  160|       |			the defining entity */
  161|   142k|    ret->orig = NULL;
  162|       |
  163|   142k|    return(ret);
  164|       |
  165|     14|error:
  166|     14|    xmlFreeEntity(ret);
  167|       |    return(NULL);
  168|   142k|}
entities.c:xmlGetEntityFromTable:
  415|  3.27M|xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
  416|  3.27M|    return((xmlEntityPtr) xmlHashLookup(table, name));
  417|  3.27M|}
entities.c:xmlFreeEntityWrapper:
  575|  24.8k|xmlFreeEntityWrapper(void *entity, const xmlChar *name ATTRIBUTE_UNUSED) {
  576|  24.8k|    if (entity != NULL)
  ------------------
  |  Branch (576:9): [True: 24.8k, False: 0]
  ------------------
  577|  24.8k|	xmlFreeEntity((xmlEntityPtr) entity);
  578|  24.8k|}
entities.c:xmlCopyEntity:
  600|  3.19k|xmlCopyEntity(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
  601|  3.19k|    xmlEntityPtr ent = (xmlEntityPtr) payload;
  602|  3.19k|    xmlEntityPtr cur;
  603|       |
  604|  3.19k|    cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
  605|  3.19k|    if (cur == NULL)
  ------------------
  |  Branch (605:9): [True: 9, False: 3.18k]
  ------------------
  606|      9|	return(NULL);
  607|  3.18k|    memset(cur, 0, sizeof(xmlEntity));
  608|  3.18k|    cur->type = XML_ENTITY_DECL;
  609|       |
  610|  3.18k|    cur->etype = ent->etype;
  611|  3.18k|    if (ent->name != NULL) {
  ------------------
  |  Branch (611:9): [True: 3.18k, False: 0]
  ------------------
  612|  3.18k|	cur->name = xmlStrdup(ent->name);
  613|  3.18k|        if (cur->name == NULL)
  ------------------
  |  Branch (613:13): [True: 8, False: 3.18k]
  ------------------
  614|      8|            goto error;
  615|  3.18k|    }
  616|  3.18k|    if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (616:9): [True: 356, False: 2.82k]
  ------------------
  617|    356|	cur->ExternalID = xmlStrdup(ent->ExternalID);
  618|    356|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (618:13): [True: 1, False: 355]
  ------------------
  619|      1|            goto error;
  620|    356|    }
  621|  3.18k|    if (ent->SystemID != NULL) {
  ------------------
  |  Branch (621:9): [True: 1.49k, False: 1.68k]
  ------------------
  622|  1.49k|	cur->SystemID = xmlStrdup(ent->SystemID);
  623|  1.49k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (623:13): [True: 5, False: 1.48k]
  ------------------
  624|      5|            goto error;
  625|  1.49k|    }
  626|  3.17k|    if (ent->content != NULL) {
  ------------------
  |  Branch (626:9): [True: 1.91k, False: 1.26k]
  ------------------
  627|  1.91k|	cur->content = xmlStrdup(ent->content);
  628|  1.91k|        if (cur->content == NULL)
  ------------------
  |  Branch (628:13): [True: 4, False: 1.90k]
  ------------------
  629|      4|            goto error;
  630|  1.91k|    }
  631|  3.17k|    if (ent->orig != NULL) {
  ------------------
  |  Branch (631:9): [True: 1.93k, False: 1.23k]
  ------------------
  632|  1.93k|	cur->orig = xmlStrdup(ent->orig);
  633|  1.93k|        if (cur->orig == NULL)
  ------------------
  |  Branch (633:13): [True: 7, False: 1.92k]
  ------------------
  634|      7|            goto error;
  635|  1.93k|    }
  636|  3.16k|    if (ent->URI != NULL) {
  ------------------
  |  Branch (636:9): [True: 1.48k, False: 1.67k]
  ------------------
  637|  1.48k|	cur->URI = xmlStrdup(ent->URI);
  638|  1.48k|        if (cur->URI == NULL)
  ------------------
  |  Branch (638:13): [True: 9, False: 1.48k]
  ------------------
  639|      9|            goto error;
  640|  1.48k|    }
  641|       |    /* Handle XML_TEXT_NODE children for XML_ENTITY_DECL */
  642|  3.15k|    if (ent->children != NULL) {
  ------------------
  |  Branch (642:9): [True: 716, False: 2.43k]
  ------------------
  643|    716|        cur->children = xmlStaticCopyNodeList(ent->children, cur->doc, (xmlNodePtr)cur);
  644|       |        /* Update last pointers */
  645|    716|        cur->last = cur->children;
  646|  2.85k|        while (cur->last && cur->last->next) cur->last = cur->last->next;
  ------------------
  |  Branch (646:16): [True: 2.84k, False: 9]
  |  Branch (646:29): [True: 2.14k, False: 707]
  ------------------
  647|    716|    }
  648|       |
  649|  3.15k|    return(cur);
  650|       |
  651|     34|error:
  652|     34|    xmlFreeEntity(cur);
  653|       |    return(NULL);
  654|  3.16k|}

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

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

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|  39.8k|LLVMFuzzerTestOneInput(const char *data, size_t size) {
  105|  39.8k|    xmlTextReaderPtr reader;
  106|  39.8k|    xmlDocPtr doc = NULL;
  107|  39.8k|    const xmlError *error;
  108|  39.8k|    const char *docBuffer;
  109|  39.8k|    const unsigned char *program;
  110|  39.8k|    size_t failurePos, docSize, programSize, i;
  111|  39.8k|    size_t totalStringSize = 0;
  112|  39.8k|    int opts;
  113|  39.8k|    int oomReport = 0;
  114|       |
  115|  39.8k|    xmlFuzzDataInit(data, size);
  116|  39.8k|    opts = (int) xmlFuzzReadInt(4);
  117|  39.8k|    failurePos = xmlFuzzReadInt(4) % (size + 100);
  118|       |
  119|  39.8k|    program = (const unsigned char *) xmlFuzzReadString(&programSize);
  120|  39.8k|    if (programSize > 1000)
  ------------------
  |  Branch (120:9): [True: 31, False: 39.7k]
  ------------------
  121|     31|        programSize = 1000;
  122|       |
  123|  39.8k|    xmlFuzzReadEntities();
  124|  39.8k|    docBuffer = xmlFuzzMainEntity(&docSize);
  125|  39.8k|    if (docBuffer == NULL)
  ------------------
  |  Branch (125:9): [True: 113, False: 39.6k]
  ------------------
  126|    113|        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|  39.6k|    xmlFuzzInjectFailure(failurePos);
  142|  39.6k|    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
  143|  39.6k|    if (reader == NULL)
  ------------------
  |  Branch (143:9): [True: 54, False: 39.6k]
  ------------------
  144|     54|        goto exit;
  145|       |
  146|  39.6k|    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
  147|  39.6k|    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
  148|       |
  149|  39.6k|    i = 0;
  150|   817k|    while (i < programSize) {
  ------------------
  |  Branch (150:12): [True: 778k, False: 38.3k]
  ------------------
  151|   778k|        int op = program[i++];
  152|       |
  153|   778k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  154|   778k|#define FREE_STRING(str) \
  155|   778k|    do { \
  156|   778k|        if (str != NULL) { \
  157|   778k|            totalStringSize += strlen((char *) str); \
  158|   778k|            xmlFree(str); \
  159|   778k|        } \
  160|   778k|    } while (0)
  161|       |
  162|   778k|        switch (op & 0x3F) {
  163|  52.3k|            case OP_READ:
  ------------------
  |  Branch (163:13): [True: 52.3k, False: 726k]
  ------------------
  164|   265k|            default:
  ------------------
  |  Branch (164:13): [True: 213k, False: 565k]
  ------------------
  165|   265k|                startOp("Read");
  166|   265k|                xmlTextReaderRead(reader);
  167|   265k|                break;
  168|       |
  169|  13.9k|            case OP_READ_INNER_XML: {
  ------------------
  |  Branch (169:13): [True: 13.9k, False: 764k]
  ------------------
  170|  13.9k|                xmlChar *result;
  171|       |
  172|  13.9k|                startOp("ReadInnerXml");
  173|  13.9k|                result = xmlTextReaderReadInnerXml(reader);
  174|  13.9k|                FREE_STRING(result);
  ------------------
  |  |  155|  13.9k|    do { \
  |  |  156|  13.9k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 8.59k, False: 5.31k]
  |  |  ------------------
  |  |  157|  8.59k|            totalStringSize += strlen((char *) str); \
  |  |  158|  8.59k|            xmlFree(str); \
  |  |  159|  8.59k|        } \
  |  |  160|  13.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 13.9k]
  |  |  ------------------
  ------------------
  175|  13.9k|                break;
  176|  52.3k|            }
  177|       |
  178|  36.0k|            case OP_READ_OUTER_XML: {
  ------------------
  |  Branch (178:13): [True: 36.0k, False: 742k]
  ------------------
  179|  36.0k|                xmlChar *result;
  180|       |
  181|  36.0k|                startOp("ReadOuterXml");
  182|  36.0k|                result = xmlTextReaderReadOuterXml(reader);
  183|  36.0k|                FREE_STRING(result);
  ------------------
  |  |  155|  36.0k|    do { \
  |  |  156|  36.0k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 27.0k, False: 8.98k]
  |  |  ------------------
  |  |  157|  27.0k|            totalStringSize += strlen((char *) str); \
  |  |  158|  27.0k|            xmlFree(str); \
  |  |  159|  27.0k|        } \
  |  |  160|  36.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 36.0k]
  |  |  ------------------
  ------------------
  184|  36.0k|                break;
  185|  52.3k|            }
  186|       |
  187|  10.1k|            case OP_READ_STRING: {
  ------------------
  |  Branch (187:13): [True: 10.1k, False: 768k]
  ------------------
  188|  10.1k|                xmlChar *result;
  189|       |
  190|  10.1k|                startOp("ReadString");
  191|  10.1k|                result = xmlTextReaderReadString(reader);
  192|  10.1k|                FREE_STRING(result);
  ------------------
  |  |  155|  10.1k|    do { \
  |  |  156|  10.1k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.70k, False: 7.47k]
  |  |  ------------------
  |  |  157|  2.70k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.70k|            xmlFree(str); \
  |  |  159|  2.70k|        } \
  |  |  160|  10.1k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 10.1k]
  |  |  ------------------
  ------------------
  193|  10.1k|                break;
  194|  52.3k|            }
  195|       |
  196|  10.2k|            case OP_READ_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (196:13): [True: 10.2k, False: 768k]
  ------------------
  197|  10.2k|                startOp("ReadAttributeValue");
  198|  10.2k|                xmlTextReaderReadAttributeValue(reader);
  199|  10.2k|                break;
  200|       |
  201|  8.73k|            case OP_ATTRIBUTE_COUNT:
  ------------------
  |  Branch (201:13): [True: 8.73k, False: 770k]
  ------------------
  202|  8.73k|                startOp("AttributeCount");
  203|  8.73k|                xmlTextReaderAttributeCount(reader);
  204|  8.73k|                break;
  205|       |
  206|  3.83k|            case OP_DEPTH:
  ------------------
  |  Branch (206:13): [True: 3.83k, False: 774k]
  ------------------
  207|  3.83k|                startOp("Depth");
  208|  3.83k|                xmlTextReaderDepth(reader);
  209|  3.83k|                break;
  210|       |
  211|  3.55k|            case OP_HAS_ATTRIBUTES:
  ------------------
  |  Branch (211:13): [True: 3.55k, False: 775k]
  ------------------
  212|  3.55k|                startOp("HasAttributes");
  213|  3.55k|                xmlTextReaderHasAttributes(reader);
  214|  3.55k|                break;
  215|       |
  216|  12.0k|            case OP_HAS_VALUE:
  ------------------
  |  Branch (216:13): [True: 12.0k, False: 766k]
  ------------------
  217|  12.0k|                startOp("HasValue");
  218|  12.0k|                xmlTextReaderHasValue(reader);
  219|  12.0k|                break;
  220|       |
  221|  5.87k|            case OP_IS_DEFAULT:
  ------------------
  |  Branch (221:13): [True: 5.87k, False: 772k]
  ------------------
  222|  5.87k|                startOp("IsDefault");
  223|  5.87k|                xmlTextReaderIsDefault(reader);
  224|  5.87k|                break;
  225|       |
  226|  9.24k|            case OP_IS_EMPTY_ELEMENT:
  ------------------
  |  Branch (226:13): [True: 9.24k, False: 769k]
  ------------------
  227|  9.24k|                startOp("IsEmptyElement");
  228|  9.24k|                xmlTextReaderIsEmptyElement(reader);
  229|  9.24k|                break;
  230|       |
  231|  11.3k|            case OP_NODE_TYPE:
  ------------------
  |  Branch (231:13): [True: 11.3k, False: 767k]
  ------------------
  232|  11.3k|                startOp("NodeType");
  233|  11.3k|                xmlTextReaderNodeType(reader);
  234|  11.3k|                break;
  235|       |
  236|  2.92k|            case OP_QUOTE_CHAR:
  ------------------
  |  Branch (236:13): [True: 2.92k, False: 775k]
  ------------------
  237|  2.92k|                startOp("QuoteChar");
  238|  2.92k|                xmlTextReaderQuoteChar(reader);
  239|  2.92k|                break;
  240|       |
  241|  4.89k|            case OP_READ_STATE:
  ------------------
  |  Branch (241:13): [True: 4.89k, False: 773k]
  ------------------
  242|  4.89k|                startOp("ReadState");
  243|  4.89k|                xmlTextReaderReadState(reader);
  244|  4.89k|                break;
  245|       |
  246|  4.36k|            case OP_IS_NAMESPACE_DECL:
  ------------------
  |  Branch (246:13): [True: 4.36k, False: 774k]
  ------------------
  247|  4.36k|                startOp("IsNamespaceDecl");
  248|  4.36k|                xmlTextReaderIsNamespaceDecl(reader);
  249|  4.36k|                break;
  250|       |
  251|  43.8k|            case OP_CONST_BASE_URI:
  ------------------
  |  Branch (251:13): [True: 43.8k, False: 734k]
  ------------------
  252|  43.8k|                startOp("ConstBaseUri");
  253|  43.8k|                xmlTextReaderConstBaseUri(reader);
  254|  43.8k|                break;
  255|       |
  256|  2.79k|            case OP_CONST_LOCAL_NAME:
  ------------------
  |  Branch (256:13): [True: 2.79k, False: 775k]
  ------------------
  257|  2.79k|                startOp("ConstLocalName");
  258|  2.79k|                xmlTextReaderConstLocalName(reader);
  259|  2.79k|                break;
  260|       |
  261|  4.83k|            case OP_CONST_NAME:
  ------------------
  |  Branch (261:13): [True: 4.83k, False: 773k]
  ------------------
  262|  4.83k|                startOp("ConstName");
  263|  4.83k|                xmlTextReaderConstName(reader);
  264|  4.83k|                break;
  265|       |
  266|  5.53k|            case OP_CONST_NAMESPACE_URI:
  ------------------
  |  Branch (266:13): [True: 5.53k, False: 773k]
  ------------------
  267|  5.53k|                startOp("ConstNamespaceUri");
  268|  5.53k|                xmlTextReaderConstNamespaceUri(reader);
  269|  5.53k|                break;
  270|       |
  271|  13.5k|            case OP_CONST_PREFIX:
  ------------------
  |  Branch (271:13): [True: 13.5k, False: 765k]
  ------------------
  272|  13.5k|                startOp("ConstPrefix");
  273|  13.5k|                xmlTextReaderConstPrefix(reader);
  274|  13.5k|                break;
  275|       |
  276|  7.19k|            case OP_CONST_XML_LANG:
  ------------------
  |  Branch (276:13): [True: 7.19k, False: 771k]
  ------------------
  277|  7.19k|                startOp("ConstXmlLang");
  278|  7.19k|                xmlTextReaderConstXmlLang(reader);
  279|  7.19k|                oomReport = -1;
  280|  7.19k|                break;
  281|       |
  282|  7.15k|            case OP_CONST_VALUE:
  ------------------
  |  Branch (282:13): [True: 7.15k, False: 771k]
  ------------------
  283|  7.15k|                startOp("ConstValue");
  284|  7.15k|                xmlTextReaderConstValue(reader);
  285|  7.15k|                break;
  286|       |
  287|  9.48k|            case OP_BASE_URI: {
  ------------------
  |  Branch (287:13): [True: 9.48k, False: 769k]
  ------------------
  288|  9.48k|                xmlChar *result;
  289|       |
  290|  9.48k|                startOp("BaseUri");
  291|  9.48k|                result = xmlTextReaderBaseUri(reader);
  292|  9.48k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.48k|    do { \
  |  |  156|  9.48k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 2.47k, False: 7.01k]
  |  |  ------------------
  |  |  157|  2.47k|            totalStringSize += strlen((char *) str); \
  |  |  158|  2.47k|            xmlFree(str); \
  |  |  159|  2.47k|        } \
  |  |  160|  9.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.48k]
  |  |  ------------------
  ------------------
  293|  9.48k|                break;
  294|  52.3k|            }
  295|       |
  296|  5.48k|            case OP_LOCAL_NAME: {
  ------------------
  |  Branch (296:13): [True: 5.48k, False: 773k]
  ------------------
  297|  5.48k|                xmlChar *result;
  298|       |
  299|  5.48k|                startOp("LocalName");
  300|  5.48k|                result = xmlTextReaderLocalName(reader);
  301|  5.48k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.48k|    do { \
  |  |  156|  5.48k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.29k, False: 2.19k]
  |  |  ------------------
  |  |  157|  3.29k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.29k|            xmlFree(str); \
  |  |  159|  3.29k|        } \
  |  |  160|  5.48k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.48k]
  |  |  ------------------
  ------------------
  302|  5.48k|                break;
  303|  52.3k|            }
  304|       |
  305|  5.83k|            case OP_NAME: {
  ------------------
  |  Branch (305:13): [True: 5.83k, False: 772k]
  ------------------
  306|  5.83k|                xmlChar *result;
  307|       |
  308|  5.83k|                startOp("Name");
  309|  5.83k|                result = xmlTextReaderName(reader);
  310|  5.83k|                FREE_STRING(result);
  ------------------
  |  |  155|  5.83k|    do { \
  |  |  156|  5.83k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.89k, False: 1.94k]
  |  |  ------------------
  |  |  157|  3.89k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.89k|            xmlFree(str); \
  |  |  159|  3.89k|        } \
  |  |  160|  5.83k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 5.83k]
  |  |  ------------------
  ------------------
  311|  5.83k|                break;
  312|  52.3k|            }
  313|       |
  314|  4.02k|            case OP_NAMESPACE_URI: {
  ------------------
  |  Branch (314:13): [True: 4.02k, False: 774k]
  ------------------
  315|  4.02k|                xmlChar *result;
  316|       |
  317|  4.02k|                startOp("NamespaceUri");
  318|  4.02k|                result = xmlTextReaderNamespaceUri(reader);
  319|  4.02k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.02k|    do { \
  |  |  156|  4.02k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 558, False: 3.46k]
  |  |  ------------------
  |  |  157|    558|            totalStringSize += strlen((char *) str); \
  |  |  158|    558|            xmlFree(str); \
  |  |  159|    558|        } \
  |  |  160|  4.02k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.02k]
  |  |  ------------------
  ------------------
  320|  4.02k|                break;
  321|  52.3k|            }
  322|       |
  323|  4.32k|            case OP_PREFIX: {
  ------------------
  |  Branch (323:13): [True: 4.32k, False: 774k]
  ------------------
  324|  4.32k|                xmlChar *result;
  325|       |
  326|  4.32k|                startOp("Prefix");
  327|  4.32k|                result = xmlTextReaderPrefix(reader);
  328|  4.32k|                FREE_STRING(result);
  ------------------
  |  |  155|  4.32k|    do { \
  |  |  156|  4.32k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 626, False: 3.69k]
  |  |  ------------------
  |  |  157|    626|            totalStringSize += strlen((char *) str); \
  |  |  158|    626|            xmlFree(str); \
  |  |  159|    626|        } \
  |  |  160|  4.32k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 4.32k]
  |  |  ------------------
  ------------------
  329|  4.32k|                break;
  330|  52.3k|            }
  331|       |
  332|  3.21k|            case OP_XML_LANG: {
  ------------------
  |  Branch (332:13): [True: 3.21k, False: 775k]
  ------------------
  333|  3.21k|                xmlChar *result;
  334|       |
  335|  3.21k|                startOp("XmlLang");
  336|  3.21k|                result = xmlTextReaderXmlLang(reader);
  337|  3.21k|                oomReport = -1;
  338|  3.21k|                FREE_STRING(result);
  ------------------
  |  |  155|  3.21k|    do { \
  |  |  156|  3.21k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 225, False: 2.98k]
  |  |  ------------------
  |  |  157|    225|            totalStringSize += strlen((char *) str); \
  |  |  158|    225|            xmlFree(str); \
  |  |  159|    225|        } \
  |  |  160|  3.21k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 3.21k]
  |  |  ------------------
  ------------------
  339|  3.21k|                break;
  340|  52.3k|            }
  341|       |
  342|  9.66k|            case OP_VALUE: {
  ------------------
  |  Branch (342:13): [True: 9.66k, False: 769k]
  ------------------
  343|  9.66k|                xmlChar *result;
  344|       |
  345|  9.66k|                startOp("Value");
  346|  9.66k|                result = xmlTextReaderValue(reader);
  347|  9.66k|                FREE_STRING(result);
  ------------------
  |  |  155|  9.66k|    do { \
  |  |  156|  9.66k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 3.07k, False: 6.59k]
  |  |  ------------------
  |  |  157|  3.07k|            totalStringSize += strlen((char *) str); \
  |  |  158|  3.07k|            xmlFree(str); \
  |  |  159|  3.07k|        } \
  |  |  160|  9.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 9.66k]
  |  |  ------------------
  ------------------
  348|  9.66k|                break;
  349|  52.3k|            }
  350|       |
  351|  1.68k|            case OP_CLOSE:
  ------------------
  |  Branch (351:13): [True: 1.68k, False: 777k]
  ------------------
  352|  1.68k|                startOp("Close");
  353|  1.68k|                if (doc == NULL)
  ------------------
  |  Branch (353:21): [True: 588, False: 1.10k]
  ------------------
  354|    588|                    doc = xmlTextReaderCurrentDoc(reader);
  355|  1.68k|                xmlTextReaderClose(reader);
  356|  1.68k|                break;
  357|       |
  358|  6.49k|            case OP_GET_ATTRIBUTE_NO: {
  ------------------
  |  Branch (358:13): [True: 6.49k, False: 772k]
  ------------------
  359|  6.49k|                xmlChar *result;
  360|  6.49k|                int no = READ_BYTE();
  ------------------
  |  |  153|  6.49k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 6.41k, False: 78]
  |  |  ------------------
  ------------------
  361|       |
  362|  6.49k|                startOp("GetAttributeNo");
  363|  6.49k|                result = xmlTextReaderGetAttributeNo(reader, no);
  364|  6.49k|                FREE_STRING(result);
  ------------------
  |  |  155|  6.49k|    do { \
  |  |  156|  6.49k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 461, False: 6.03k]
  |  |  ------------------
  |  |  157|    461|            totalStringSize += strlen((char *) str); \
  |  |  158|    461|            xmlFree(str); \
  |  |  159|    461|        } \
  |  |  160|  6.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 6.49k]
  |  |  ------------------
  ------------------
  365|  6.49k|                break;
  366|  52.3k|            }
  367|       |
  368|  30.4k|            case OP_GET_ATTRIBUTE: {
  ------------------
  |  Branch (368:13): [True: 30.4k, False: 748k]
  ------------------
  369|  30.4k|                const xmlChar *name = xmlTextReaderConstName(reader);
  370|  30.4k|                xmlChar *result;
  371|       |
  372|  30.4k|                startOp("GetAttribute");
  373|  30.4k|                result = xmlTextReaderGetAttribute(reader, name);
  374|  30.4k|                FREE_STRING(result);
  ------------------
  |  |  155|  30.4k|    do { \
  |  |  156|  30.4k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 840, False: 29.5k]
  |  |  ------------------
  |  |  157|    840|            totalStringSize += strlen((char *) str); \
  |  |  158|    840|            xmlFree(str); \
  |  |  159|    840|        } \
  |  |  160|  30.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 30.4k]
  |  |  ------------------
  ------------------
  375|  30.4k|                break;
  376|  52.3k|            }
  377|       |
  378|  25.6k|            case OP_GET_ATTRIBUTE_NS: {
  ------------------
  |  Branch (378:13): [True: 25.6k, False: 753k]
  ------------------
  379|  25.6k|                const xmlChar *localName, *namespaceUri;
  380|  25.6k|                xmlChar *result;
  381|       |
  382|  25.6k|                startOp("GetAttributeNs");
  383|  25.6k|                localName = xmlTextReaderConstLocalName(reader);
  384|  25.6k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  385|  25.6k|                result = xmlTextReaderGetAttributeNs(reader, localName,
  386|  25.6k|                                                     namespaceUri);
  387|  25.6k|                FREE_STRING(result);
  ------------------
  |  |  155|  25.6k|    do { \
  |  |  156|  25.6k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 983, False: 24.6k]
  |  |  ------------------
  |  |  157|    983|            totalStringSize += strlen((char *) str); \
  |  |  158|    983|            xmlFree(str); \
  |  |  159|    983|        } \
  |  |  160|  25.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 25.6k]
  |  |  ------------------
  ------------------
  388|  25.6k|                break;
  389|  52.3k|            }
  390|       |
  391|  4.13k|            case OP_GET_REMAINDER:
  ------------------
  |  Branch (391:13): [True: 4.13k, False: 774k]
  ------------------
  392|  4.13k|                startOp("GetRemainder");
  393|  4.13k|                if (doc == NULL)
  ------------------
  |  Branch (393:21): [True: 2.00k, False: 2.13k]
  ------------------
  394|  2.00k|                    doc = xmlTextReaderCurrentDoc(reader);
  395|  4.13k|                xmlFreeParserInputBuffer(xmlTextReaderGetRemainder(reader));
  396|  4.13k|                break;
  397|       |
  398|  8.19k|            case OP_LOOKUP_NAMESPACE: {
  ------------------
  |  Branch (398:13): [True: 8.19k, False: 770k]
  ------------------
  399|  8.19k|                const xmlChar *prefix = xmlTextReaderConstPrefix(reader);
  400|  8.19k|                xmlChar *result;
  401|       |
  402|  8.19k|                startOp("LookupNamespace");
  403|  8.19k|                result = xmlTextReaderLookupNamespace(reader, prefix);
  404|  8.19k|                FREE_STRING(result);
  ------------------
  |  |  155|  8.19k|    do { \
  |  |  156|  8.19k|        if (str != NULL) { \
  |  |  ------------------
  |  |  |  Branch (156:13): [True: 945, False: 7.25k]
  |  |  ------------------
  |  |  157|    945|            totalStringSize += strlen((char *) str); \
  |  |  158|    945|            xmlFree(str); \
  |  |  159|    945|        } \
  |  |  160|  8.19k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (160:14): [Folded, False: 8.19k]
  |  |  ------------------
  ------------------
  405|  8.19k|                break;
  406|  52.3k|            }
  407|       |
  408|  7.18k|            case OP_MOVE_TO_ATTRIBUTE_NO: {
  ------------------
  |  Branch (408:13): [True: 7.18k, False: 771k]
  ------------------
  409|  7.18k|                int no = READ_BYTE();
  ------------------
  |  |  153|  7.18k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.09k, False: 90]
  |  |  ------------------
  ------------------
  410|       |
  411|  7.18k|                startOp("MoveToAttributeNo");
  412|  7.18k|                xmlTextReaderMoveToAttributeNo(reader, no);
  413|  7.18k|                break;
  414|  52.3k|            }
  415|       |
  416|  12.3k|            case OP_MOVE_TO_ATTRIBUTE: {
  ------------------
  |  Branch (416:13): [True: 12.3k, False: 766k]
  ------------------
  417|  12.3k|                const xmlChar *name = xmlTextReaderConstName(reader);
  418|       |
  419|  12.3k|                startOp("MoveToAttribute");
  420|  12.3k|                xmlTextReaderMoveToAttribute(reader, name);
  421|  12.3k|                break;
  422|  52.3k|            }
  423|       |
  424|  10.8k|            case OP_MOVE_TO_ATTRIBUTE_NS: {
  ------------------
  |  Branch (424:13): [True: 10.8k, False: 767k]
  ------------------
  425|  10.8k|                const xmlChar *localName, *namespaceUri;
  426|       |
  427|  10.8k|                startOp("MoveToAttributeNs");
  428|  10.8k|                localName = xmlTextReaderConstLocalName(reader);
  429|  10.8k|                namespaceUri = xmlTextReaderConstNamespaceUri(reader);
  430|  10.8k|                xmlTextReaderMoveToAttributeNs(reader, localName,
  431|  10.8k|                                               namespaceUri);
  432|  10.8k|                break;
  433|  52.3k|            }
  434|       |
  435|  13.1k|            case OP_MOVE_TO_FIRST_ATTRIBUTE:
  ------------------
  |  Branch (435:13): [True: 13.1k, False: 765k]
  ------------------
  436|  13.1k|                startOp("MoveToFirstAttribute");
  437|  13.1k|                xmlTextReaderMoveToFirstAttribute(reader);
  438|  13.1k|                break;
  439|       |
  440|  7.84k|            case OP_MOVE_TO_NEXT_ATTRIBUTE:
  ------------------
  |  Branch (440:13): [True: 7.84k, False: 770k]
  ------------------
  441|  7.84k|                startOp("MoveToNextAttribute");
  442|  7.84k|                xmlTextReaderMoveToNextAttribute(reader);
  443|  7.84k|                break;
  444|       |
  445|  5.19k|            case OP_MOVE_TO_ELEMENT:
  ------------------
  |  Branch (445:13): [True: 5.19k, False: 773k]
  ------------------
  446|  5.19k|                startOp("MoveToElement");
  447|  5.19k|                xmlTextReaderMoveToElement(reader);
  448|  5.19k|                break;
  449|       |
  450|  2.51k|            case OP_NORMALIZATION:
  ------------------
  |  Branch (450:13): [True: 2.51k, False: 776k]
  ------------------
  451|  2.51k|                startOp("Normalization");
  452|  2.51k|                xmlTextReaderNormalization(reader);
  453|  2.51k|                break;
  454|       |
  455|  3.37k|            case OP_CONST_ENCODING:
  ------------------
  |  Branch (455:13): [True: 3.37k, False: 775k]
  ------------------
  456|  3.37k|                startOp("ConstEncoding");
  457|  3.37k|                xmlTextReaderConstEncoding(reader);
  458|  3.37k|                break;
  459|       |
  460|  7.96k|            case OP_GET_PARSER_PROP: {
  ------------------
  |  Branch (460:13): [True: 7.96k, False: 770k]
  ------------------
  461|  7.96k|                int prop = READ_BYTE();
  ------------------
  |  |  153|  7.96k|#define READ_BYTE() (i < programSize ? program[i++] : 0)
  |  |  ------------------
  |  |  |  Branch (153:22): [True: 7.72k, False: 235]
  |  |  ------------------
  ------------------
  462|       |
  463|  7.96k|                startOp("GetParserProp");
  464|  7.96k|                xmlTextReaderGetParserProp(reader, prop);
  465|  7.96k|                break;
  466|  52.3k|            }
  467|       |
  468|  13.3k|            case OP_CURRENT_NODE:
  ------------------
  |  Branch (468:13): [True: 13.3k, False: 765k]
  ------------------
  469|  13.3k|                startOp("CurrentNode");
  470|  13.3k|                xmlTextReaderCurrentNode(reader);
  471|  13.3k|                break;
  472|       |
  473|  5.74k|            case OP_GET_PARSER_LINE_NUMBER:
  ------------------
  |  Branch (473:13): [True: 5.74k, False: 773k]
  ------------------
  474|  5.74k|                startOp("GetParserLineNumber");
  475|  5.74k|                xmlTextReaderGetParserLineNumber(reader);
  476|  5.74k|                break;
  477|       |
  478|  10.2k|            case OP_GET_PARSER_COLUMN_NUMBER:
  ------------------
  |  Branch (478:13): [True: 10.2k, False: 768k]
  ------------------
  479|  10.2k|                startOp("GetParserColumnNumber");
  480|  10.2k|                xmlTextReaderGetParserColumnNumber(reader);
  481|  10.2k|                break;
  482|       |
  483|  9.26k|            case OP_PRESERVE:
  ------------------
  |  Branch (483:13): [True: 9.26k, False: 769k]
  ------------------
  484|  9.26k|                startOp("Preserve");
  485|  9.26k|                xmlTextReaderPreserve(reader);
  486|  9.26k|                break;
  487|       |
  488|  7.38k|            case OP_CURRENT_DOC: {
  ------------------
  |  Branch (488:13): [True: 7.38k, False: 771k]
  ------------------
  489|  7.38k|                xmlDocPtr result;
  490|       |
  491|  7.38k|                startOp("CurrentDoc");
  492|  7.38k|                result = xmlTextReaderCurrentDoc(reader);
  493|  7.38k|                if (doc == NULL)
  ------------------
  |  Branch (493:21): [True: 3.02k, False: 4.36k]
  ------------------
  494|  3.02k|                    doc = result;
  495|  7.38k|                break;
  496|  52.3k|            }
  497|       |
  498|  8.40k|            case OP_EXPAND:
  ------------------
  |  Branch (498:13): [True: 8.40k, False: 770k]
  ------------------
  499|  8.40k|                startOp("Expand");
  500|  8.40k|                xmlTextReaderExpand(reader);
  501|  8.40k|                break;
  502|       |
  503|  20.2k|            case OP_NEXT:
  ------------------
  |  Branch (503:13): [True: 20.2k, False: 758k]
  ------------------
  504|  20.2k|                startOp("Next");
  505|  20.2k|                xmlTextReaderNext(reader);
  506|  20.2k|                break;
  507|       |
  508|  8.21k|            case OP_NEXT_SIBLING:
  ------------------
  |  Branch (508:13): [True: 8.21k, False: 770k]
  ------------------
  509|  8.21k|                startOp("NextSibling");
  510|  8.21k|                xmlTextReaderNextSibling(reader);
  511|  8.21k|                break;
  512|       |
  513|  3.76k|            case OP_IS_VALID:
  ------------------
  |  Branch (513:13): [True: 3.76k, False: 774k]
  ------------------
  514|  3.76k|                startOp("IsValid");
  515|  3.76k|                xmlTextReaderIsValid(reader);
  516|  3.76k|                break;
  517|       |
  518|  4.98k|            case OP_CONST_XML_VERSION:
  ------------------
  |  Branch (518:13): [True: 4.98k, False: 773k]
  ------------------
  519|  4.98k|                startOp("ConstXmlVersion");
  520|  4.98k|                xmlTextReaderConstXmlVersion(reader);
  521|  4.98k|                break;
  522|       |
  523|  4.63k|            case OP_STANDALONE:
  ------------------
  |  Branch (523:13): [True: 4.63k, False: 774k]
  ------------------
  524|  4.63k|                startOp("Standalone");
  525|  4.63k|                xmlTextReaderStandalone(reader);
  526|  4.63k|                break;
  527|       |
  528|  6.02k|            case OP_BYTE_CONSUMED:
  ------------------
  |  Branch (528:13): [True: 6.02k, False: 772k]
  ------------------
  529|  6.02k|                startOp("ByteConsumed");
  530|  6.02k|                xmlTextReaderByteConsumed(reader);
  531|  6.02k|                oomReport = -1;
  532|  6.02k|                break;
  533|   778k|        }
  534|       |
  535|   778k|        if (totalStringSize > docSize * 2)
  ------------------
  |  Branch (535:13): [True: 1.33k, False: 777k]
  ------------------
  536|  1.33k|            break;
  537|   778k|    }
  538|       |
  539|  39.6k|    error = xmlTextReaderGetLastError(reader);
  540|  39.6k|    if (error->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (540:9): [True: 9.61k, False: 30.0k]
  ------------------
  541|  9.61k|        oomReport = 1;
  542|  39.6k|    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
  543|       |
  544|  39.6k|    xmlFreeTextReader(reader);
  545|       |
  546|  39.6k|    if (doc != NULL)
  ------------------
  |  Branch (546:9): [True: 3.90k, False: 35.7k]
  ------------------
  547|  3.90k|        xmlFreeDoc(doc);
  548|       |
  549|  39.8k|exit:
  550|  39.8k|    xmlFuzzInjectFailure(0);
  551|  39.8k|    xmlFuzzDataCleanup();
  552|  39.8k|    xmlResetLastError();
  553|  39.8k|    return(0);
  554|  39.6k|}
reader.c:startOp:
   83|   778k|startOp(const char *name) {
   84|   778k|    (void) name;
   85|       |#ifdef DEBUG
   86|       |    fprintf(stderr, "%s\n", name);
   87|       |#endif
   88|   778k|}

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|  49.1k|__xmlDoValidityCheckingDefaultValue(void) {
  634|  49.1k|    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
  635|  49.1k|}
__xmlGetWarningsDefaultValue:
  638|   734k|__xmlGetWarningsDefaultValue(void) {
  639|   734k|    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
  640|   734k|}
__xmlKeepBlanksDefaultValue:
  643|  49.1k|__xmlKeepBlanksDefaultValue(void) {
  644|  49.1k|    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
  645|  49.1k|}
__xmlLoadExtDtdDefaultValue:
  653|  49.1k|__xmlLoadExtDtdDefaultValue(void) {
  654|  49.1k|    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
  655|  49.1k|}
__xmlPedanticParserDefaultValue:
  658|  49.1k|__xmlPedanticParserDefaultValue(void) {
  659|  49.1k|    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
  660|  49.1k|}
__xmlSubstituteEntitiesDefaultValue:
  663|  49.1k|__xmlSubstituteEntitiesDefaultValue(void) {
  664|  49.1k|    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
  665|  49.1k|}
__xmlTreeIndentString:
  674|  39.0k|__xmlTreeIndentString(void) {
  675|  39.0k|    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
  676|  39.0k|}
__xmlSaveNoEmptyTags:
  679|  39.0k|__xmlSaveNoEmptyTags(void) {
  680|  39.0k|    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
  681|  39.0k|}
__xmlStructuredError:
  695|   419k|__xmlStructuredError(void) {
  696|   419k|    return(&xmlGetThreadLocalStorage(0)->structuredError);
  697|   419k|}
xmlGetLocalRngState:
  755|   132k|xmlGetLocalRngState(void) {
  756|   132k|    return(xmlGetThreadLocalStorage(0)->localRngState);
  757|   132k|}
xmlGetLastErrorInternal:
  785|   769k|xmlGetLastErrorInternal(void) {
  786|   769k|    return(&xmlGetThreadLocalStorage(0)->lastError);
  787|   769k|}
globals.c:xmlPosixStrdup:
  200|   554k|xmlPosixStrdup(const char *cur) {
  201|   554k|    return((char*) xmlCharStrdup(cur));
  202|   554k|}
globals.c:xmlGetThreadLocalStorage:
  525|  2.37M|xmlGetThreadLocalStorage(int allowFailure) {
  526|  2.37M|    xmlGlobalState *gs;
  527|       |
  528|  2.37M|    (void) allowFailure;
  529|       |
  530|  2.37M|    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.37M|    if (gs == NULL)
  ------------------
  |  Branch (538:9): [True: 1, False: 2.37M]
  ------------------
  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.37M|    return(gs);
  549|  2.37M|}
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|  83.5k|xmlHashCreate(int size) {
  159|  83.5k|    xmlHashTablePtr hash;
  160|       |
  161|  83.5k|    xmlInitParser();
  162|       |
  163|  83.5k|    hash = xmlMalloc(sizeof(*hash));
  164|  83.5k|    if (hash == NULL)
  ------------------
  |  Branch (164:9): [True: 33, False: 83.4k]
  ------------------
  165|     33|        return(NULL);
  166|  83.4k|    hash->dict = NULL;
  167|  83.4k|    hash->size = 0;
  168|  83.4k|    hash->table = NULL;
  169|  83.4k|    hash->nbElems = 0;
  170|  83.4k|    hash->randomSeed = xmlRandom();
  171|  83.4k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  172|  83.4k|    hash->randomSeed = 0;
  173|  83.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|  83.4k|    if (size > MIN_HASH_SIZE) {
  ------------------
  |  |   30|  83.4k|#define MIN_HASH_SIZE 8
  ------------------
  |  Branch (180:9): [True: 6.79k, False: 76.7k]
  ------------------
  181|  6.79k|        unsigned newSize = MIN_HASH_SIZE * 2;
  ------------------
  |  |   30|  6.79k|#define MIN_HASH_SIZE 8
  ------------------
  182|       |
  183|  6.89k|        while ((newSize < (unsigned) size) && (newSize < MAX_HASH_SIZE))
  ------------------
  |  |   31|     91|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (183:16): [True: 91, False: 6.79k]
  |  Branch (183:47): [True: 91, False: 0]
  ------------------
  184|     91|            newSize *= 2;
  185|       |
  186|  6.79k|        if (xmlHashGrow(hash, newSize) != 0) {
  ------------------
  |  Branch (186:13): [True: 2, False: 6.79k]
  ------------------
  187|      2|            xmlFree(hash);
  188|      2|            return(NULL);
  189|      2|        }
  190|  6.79k|    }
  191|       |
  192|  83.4k|    return(hash);
  193|  83.4k|}
xmlHashCreateDict:
  205|  28.8k|xmlHashCreateDict(int size, xmlDict *dict) {
  206|  28.8k|    xmlHashTablePtr hash;
  207|       |
  208|  28.8k|    hash = xmlHashCreate(size);
  209|  28.8k|    if (hash != NULL) {
  ------------------
  |  Branch (209:9): [True: 28.8k, False: 12]
  ------------------
  210|  28.8k|        hash->dict = dict;
  211|  28.8k|        xmlDictReference(dict);
  212|  28.8k|    }
  213|  28.8k|    return(hash);
  214|  28.8k|}
xmlHashFree:
  224|   104k|xmlHashFree(xmlHashTable *hash, xmlHashDeallocator dealloc) {
  225|   104k|    if (hash == NULL)
  ------------------
  |  Branch (225:9): [True: 20.7k, False: 83.4k]
  ------------------
  226|  20.7k|        return;
  227|       |
  228|  83.4k|    if (hash->table) {
  ------------------
  |  Branch (228:9): [True: 83.1k, False: 376]
  ------------------
  229|  83.1k|        const xmlHashEntry *end = &hash->table[hash->size];
  230|  83.1k|        const xmlHashEntry *entry;
  231|       |
  232|   884k|        for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (232:35): [True: 800k, False: 83.1k]
  ------------------
  233|   800k|            if (entry->hashValue == 0)
  ------------------
  |  Branch (233:17): [True: 631k, False: 169k]
  ------------------
  234|   631k|                continue;
  235|   169k|            if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (235:17): [True: 147k, False: 22.0k]
  |  Branch (235:38): [True: 147k, False: 0]
  ------------------
  236|   147k|                dealloc(entry->payload, entry->key);
  237|   169k|            if (hash->dict == NULL) {
  ------------------
  |  Branch (237:17): [True: 99.0k, False: 70.3k]
  ------------------
  238|  99.0k|                if (entry->key)
  ------------------
  |  Branch (238:21): [True: 99.0k, False: 0]
  ------------------
  239|  99.0k|                    xmlFree(entry->key);
  240|  99.0k|                if (entry->key2)
  ------------------
  |  Branch (240:21): [True: 7.01k, False: 92.0k]
  ------------------
  241|  7.01k|                    xmlFree(entry->key2);
  242|  99.0k|                if (entry->key3)
  ------------------
  |  Branch (242:21): [True: 15.7k, False: 83.3k]
  ------------------
  243|  15.7k|                    xmlFree(entry->key3);
  244|  99.0k|            }
  245|   169k|        }
  246|       |
  247|  83.1k|        xmlFree(hash->table);
  248|  83.1k|    }
  249|       |
  250|  83.4k|    if (hash->dict)
  ------------------
  |  Branch (250:9): [True: 19.6k, False: 63.8k]
  ------------------
  251|  19.6k|        xmlDictFree(hash->dict);
  252|       |
  253|  83.4k|    xmlFree(hash);
  254|  83.4k|}
xmlHashDefaultDeallocator:
  592|  57.6k|xmlHashDefaultDeallocator(void *entry, const xmlChar *key ATTRIBUTE_UNUSED) {
  593|  57.6k|    xmlFree(entry);
  594|  57.6k|}
xmlHashAdd:
  610|   144k|xmlHashAdd(xmlHashTable *hash, const xmlChar *key, void *payload) {
  611|   144k|    return(xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0));
  612|   144k|}
xmlHashAdd2:
  629|  63.1k|                 const xmlChar *key2, void *payload) {
  630|  63.1k|    return(xmlHashUpdateInternal(hash, key, key2, NULL, payload, NULL, 0));
  631|  63.1k|}
xmlHashAdd3:
  650|  75.6k|                 void *payload) {
  651|       |    return(xmlHashUpdateInternal(hash, key, key2, key3, payload, NULL, 0));
  652|  75.6k|}
xmlHashAddEntry:
  669|  57.2k|xmlHashAddEntry(xmlHashTable *hash, const xmlChar *key, void *payload) {
  670|  57.2k|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, NULL, 0);
  671|       |
  672|  57.2k|    if (res == 0)
  ------------------
  |  Branch (672:9): [True: 0, False: 57.2k]
  ------------------
  673|      0|        res = -1;
  674|  57.2k|    else if (res == 1)
  ------------------
  |  Branch (674:14): [True: 57.2k, False: 9]
  ------------------
  675|  57.2k|        res = 0;
  676|       |
  677|  57.2k|    return(res);
  678|  57.2k|}
xmlHashUpdateEntry:
  742|    430|                   void *payload, xmlHashDeallocator dealloc) {
  743|    430|    int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload,
  744|    430|                                    dealloc, 1);
  745|       |
  746|    430|    if (res == 1)
  ------------------
  |  Branch (746:9): [True: 55, False: 375]
  ------------------
  747|     55|        res = 0;
  748|       |
  749|    430|    return(res);
  750|    430|}
xmlHashUpdateEntry2:
  767|  4.13k|                   xmlHashDeallocator dealloc) {
  768|  4.13k|    int res = xmlHashUpdateInternal(hash, key, key2, NULL, payload,
  769|  4.13k|                                    dealloc, 1);
  770|       |
  771|  4.13k|    if (res == 1)
  ------------------
  |  Branch (771:9): [True: 3.38k, False: 750]
  ------------------
  772|  3.38k|        res = 0;
  773|       |
  774|  4.13k|    return(res);
  775|  4.13k|}
xmlHashLookup:
  811|  3.68M|xmlHashLookup(xmlHashTable *hash, const xmlChar *key) {
  812|  3.68M|    return(xmlHashLookup3(hash, key, NULL, NULL));
  813|  3.68M|}
xmlHashLookup2:
  825|  1.13M|              const xmlChar *key2) {
  826|       |    return(xmlHashLookup3(hash, key, key2, NULL));
  827|  1.13M|}
xmlHashQLookup2:
  856|  38.9k|                const xmlChar *name2) {
  857|  38.9k|    return(xmlHashQLookup3(hash, prefix, name, prefix2, name2, NULL, NULL));
  858|  38.9k|}
xmlHashLookup3:
  871|  6.61M|               const xmlChar *key2, const xmlChar *key3) {
  872|  6.61M|    const xmlHashEntry *entry;
  873|  6.61M|    unsigned hashValue;
  874|  6.61M|    int found;
  875|       |
  876|  6.61M|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (876:9): [True: 11.8k, False: 6.60M]
  |  Branch (876:27): [True: 52.3k, False: 6.55M]
  |  Branch (876:48): [True: 14, False: 6.55M]
  ------------------
  877|  64.1k|        return(NULL);
  878|  6.55M|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
  879|  6.55M|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  880|  6.55M|    if (found)
  ------------------
  |  Branch (880:9): [True: 4.78M, False: 1.76M]
  ------------------
  881|  4.78M|        return(entry->payload);
  882|  1.76M|    return(NULL);
  883|  6.55M|}
xmlHashQLookup3:
  902|  38.9k|                const xmlChar *prefix3, const xmlChar *name3) {
  903|  38.9k|    const xmlHashEntry *entry;
  904|  38.9k|    unsigned hashValue, mask, pos, displ;
  905|       |
  906|  38.9k|    if ((hash == NULL) || (hash->size == 0) || (name == NULL))
  ------------------
  |  Branch (906:9): [True: 0, False: 38.9k]
  |  Branch (906:27): [True: 0, False: 38.9k]
  |  Branch (906:48): [True: 0, False: 38.9k]
  ------------------
  907|      0|        return(NULL);
  908|       |
  909|  38.9k|    hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
  910|  38.9k|                                  name2, prefix3, name3);
  911|  38.9k|    mask = hash->size - 1;
  912|  38.9k|    pos = hashValue & mask;
  913|  38.9k|    entry = &hash->table[pos];
  914|       |
  915|  38.9k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (915:9): [True: 7.55k, False: 31.3k]
  ------------------
  916|  7.55k|        displ = 0;
  917|  7.55k|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  7.55k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  918|       |
  919|  8.45k|        do {
  920|  8.45k|            if ((hashValue == entry->hashValue) &&
  ------------------
  |  Branch (920:17): [True: 4.48k, False: 3.96k]
  ------------------
  921|  4.48k|                (xmlStrQEqual(prefix, name, entry->key)) &&
  ------------------
  |  Branch (921:17): [True: 4.48k, False: 0]
  ------------------
  922|  4.48k|                (xmlStrQEqual(prefix2, name2, entry->key2)) &&
  ------------------
  |  Branch (922:17): [True: 4.48k, False: 0]
  ------------------
  923|  4.48k|                (xmlStrQEqual(prefix3, name3, entry->key3)))
  ------------------
  |  Branch (923:17): [True: 4.48k, False: 0]
  ------------------
  924|  4.48k|                return(entry->payload);
  925|       |
  926|  3.96k|            displ++;
  927|  3.96k|            pos++;
  928|  3.96k|            entry++;
  929|  3.96k|            if ((pos & mask) == 0)
  ------------------
  |  Branch (929:17): [True: 390, False: 3.57k]
  ------------------
  930|    390|                entry = hash->table;
  931|  3.96k|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (931:18): [True: 2.00k, False: 1.96k]
  ------------------
  932|  2.00k|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (932:18): [True: 897, False: 1.10k]
  ------------------
  933|  7.55k|    }
  934|       |
  935|  34.4k|    return(NULL);
  936|  38.9k|}
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.2k|xmlHashScanFull(xmlHashTable *hash, xmlHashScannerFull scan, void *data) {
  975|  11.2k|    const xmlHashEntry *entry, *end;
  976|  11.2k|    xmlHashEntry old;
  977|  11.2k|    unsigned i;
  978|       |
  979|  11.2k|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (979:9): [True: 395, False: 10.8k]
  |  Branch (979:27): [True: 0, False: 10.8k]
  |  Branch (979:48): [True: 0, False: 10.8k]
  ------------------
  980|    395|        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.8k|    entry = hash->table;
  990|  10.8k|    end = &hash->table[hash->size];
  991|  14.4k|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (991:12): [True: 3.58k, False: 10.8k]
  ------------------
  992|  3.58k|        if (++entry >= end)
  ------------------
  |  Branch (992:13): [True: 0, False: 3.58k]
  ------------------
  993|      0|            entry = hash->table;
  994|  3.58k|    }
  995|       |
  996|   170k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (996:17): [True: 159k, False: 10.8k]
  ------------------
  997|   159k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (997:13): [True: 43.3k, False: 115k]
  |  Branch (997:40): [True: 43.3k, False: 0]
  ------------------
  998|       |            /*
  999|       |             * Make sure to rescan after a possible deletion.
 1000|       |             */
 1001|  44.1k|            do {
 1002|  44.1k|                old = *entry;
 1003|  44.1k|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1004|  44.1k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1004:22): [True: 42.6k, False: 1.45k]
  ------------------
 1005|  42.6k|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1005:22): [True: 42.6k, False: 0]
  ------------------
 1006|  42.6k|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1006:23): [True: 695, False: 41.9k]
  ------------------
 1007|  41.9k|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1007:23): [True: 60, False: 41.9k]
  ------------------
 1008|  41.9k|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1008:23): [True: 0, False: 41.9k]
  ------------------
 1009|  43.3k|        }
 1010|   159k|        if (++entry >= end)
  ------------------
  |  Branch (1010:13): [True: 10.8k, False: 148k]
  ------------------
 1011|  10.8k|            entry = hash->table;
 1012|   159k|    }
 1013|  10.8k|}
xmlHashScan3:
 1030|    871|             xmlHashScanner scan, void *data) {
 1031|    871|    stubData sdata;
 1032|    871|    sdata.data = data;
 1033|    871|    sdata.scan = scan;
 1034|    871|    xmlHashScanFull3(hash, key, key2, key3, stubHashScannerFull, &sdata);
 1035|    871|}
xmlHashScanFull3:
 1052|    871|                 xmlHashScannerFull scan, void *data) {
 1053|    871|    const xmlHashEntry *entry, *end;
 1054|    871|    xmlHashEntry old;
 1055|    871|    unsigned i;
 1056|       |
 1057|    871|    if ((hash == NULL) || (hash->size == 0) || (scan == NULL))
  ------------------
  |  Branch (1057:9): [True: 361, False: 510]
  |  Branch (1057:27): [True: 0, False: 510]
  |  Branch (1057:48): [True: 0, False: 510]
  ------------------
 1058|    361|        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|    510|    entry = hash->table;
 1068|    510|    end = &hash->table[hash->size];
 1069|    748|    while (entry->hashValue != 0) {
  ------------------
  |  Branch (1069:12): [True: 238, False: 510]
  ------------------
 1070|    238|        if (++entry >= end)
  ------------------
  |  Branch (1070:13): [True: 0, False: 238]
  ------------------
 1071|      0|            entry = hash->table;
 1072|    238|    }
 1073|       |
 1074|   221k|    for (i = 0; i < hash->size; i++) {
  ------------------
  |  Branch (1074:17): [True: 221k, False: 510]
  ------------------
 1075|   221k|        if ((entry->hashValue != 0) && (entry->payload != NULL)) {
  ------------------
  |  Branch (1075:13): [True: 111k, False: 109k]
  |  Branch (1075:40): [True: 111k, False: 0]
  ------------------
 1076|       |            /*
 1077|       |             * Make sure to rescan after a possible deletion.
 1078|       |             */
 1079|   111k|            do {
 1080|   111k|                if (((key != NULL) && (strcmp((const char *) key,
  ------------------
  |  Branch (1080:22): [True: 0, False: 111k]
  |  Branch (1080:39): [True: 0, False: 0]
  ------------------
 1081|      0|                                              (const char *) entry->key) != 0)) ||
 1082|   111k|                    ((key2 != NULL) && (!xmlFastStrEqual(key2, entry->key2))) ||
  ------------------
  |  Branch (1082:22): [True: 0, False: 111k]
  |  Branch (1082:40): [True: 0, False: 0]
  ------------------
 1083|   111k|                    ((key3 != NULL) && (!xmlFastStrEqual(key3, entry->key3))))
  ------------------
  |  Branch (1083:22): [True: 111k, False: 0]
  |  Branch (1083:40): [True: 111k, False: 96]
  ------------------
 1084|   111k|                    break;
 1085|     96|                old = *entry;
 1086|     96|                scan(entry->payload, data, entry->key, entry->key2, entry->key3);
 1087|     96|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (1087:22): [True: 96, False: 0]
  ------------------
 1088|     96|                     (entry->payload != NULL) &&
  ------------------
  |  Branch (1088:22): [True: 96, False: 0]
  ------------------
 1089|     96|                     ((entry->key != old.key) ||
  ------------------
  |  Branch (1089:23): [True: 0, False: 96]
  ------------------
 1090|     96|                      (entry->key2 != old.key2) ||
  ------------------
  |  Branch (1090:23): [True: 0, False: 96]
  ------------------
 1091|     96|                      (entry->key3 != old.key3)));
  ------------------
  |  Branch (1091:23): [True: 0, False: 96]
  ------------------
 1092|   111k|        }
 1093|   221k|        if (++entry >= end)
  ------------------
  |  Branch (1093:13): [True: 510, False: 220k]
  ------------------
 1094|    510|            entry = hash->table;
 1095|   221k|    }
 1096|    510|}
xmlHashCopySafe:
 1111|  13.5k|                xmlHashDeallocator deallocFunc) {
 1112|  13.5k|    const xmlHashEntry *entry, *end;
 1113|  13.5k|    xmlHashTablePtr ret;
 1114|       |
 1115|  13.5k|    if ((hash == NULL) || (copyFunc == NULL))
  ------------------
  |  Branch (1115:9): [True: 0, False: 13.5k]
  |  Branch (1115:27): [True: 0, False: 13.5k]
  ------------------
 1116|      0|        return(NULL);
 1117|       |
 1118|  13.5k|    ret = xmlHashCreate(hash->size);
 1119|  13.5k|    if (ret == NULL)
  ------------------
  |  Branch (1119:9): [True: 17, False: 13.5k]
  ------------------
 1120|     17|        return(NULL);
 1121|       |
 1122|  13.5k|    if (hash->size == 0)
  ------------------
  |  Branch (1122:9): [True: 0, False: 13.5k]
  ------------------
 1123|      0|        return(ret);
 1124|       |
 1125|  13.5k|    end = &hash->table[hash->size];
 1126|       |
 1127|   124k|    for (entry = hash->table; entry < end; entry++) {
  ------------------
  |  Branch (1127:31): [True: 110k, False: 13.2k]
  ------------------
 1128|   110k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (1128:13): [True: 21.5k, False: 89.2k]
  ------------------
 1129|  21.5k|            void *copy;
 1130|       |
 1131|  21.5k|            copy = copyFunc(entry->payload, entry->key);
 1132|  21.5k|            if (copy == NULL)
  ------------------
  |  Branch (1132:17): [True: 207, False: 21.3k]
  ------------------
 1133|    207|                goto error;
 1134|  21.3k|            if (xmlHashAdd3(ret, entry->key, entry->key2, entry->key3,
  ------------------
  |  Branch (1134:17): [True: 66, False: 21.2k]
  ------------------
 1135|  21.3k|                            copy) <= 0) {
 1136|     66|                if (deallocFunc != NULL)
  ------------------
  |  Branch (1136:21): [True: 66, False: 0]
  ------------------
 1137|     66|                    deallocFunc(copy, entry->key);
 1138|     66|                goto error;
 1139|     66|            }
 1140|  21.3k|        }
 1141|   110k|    }
 1142|       |
 1143|  13.2k|    return(ret);
 1144|       |
 1145|    273|error:
 1146|    273|    xmlHashFree(ret, deallocFunc);
 1147|       |    return(NULL);
 1148|  13.5k|}
xmlHashSize:
 1173|  3.54k|xmlHashSize(xmlHashTable *hash) {
 1174|  3.54k|    if (hash == NULL)
  ------------------
  |  Branch (1174:9): [True: 0, False: 3.54k]
  ------------------
 1175|      0|        return(-1);
 1176|  3.54k|    return(hash->nbElems);
 1177|  3.54k|}
xmlHashRemoveEntry:
 1189|  2.24k|                       xmlHashDeallocator dealloc) {
 1190|  2.24k|    return(xmlHashRemoveEntry3(hash, key, NULL, NULL, dealloc));
 1191|  2.24k|}
xmlHashRemoveEntry2:
 1206|  2.40k|                    const xmlChar *key2, xmlHashDeallocator dealloc) {
 1207|       |    return(xmlHashRemoveEntry3(hash, key, key2, NULL, dealloc));
 1208|  2.40k|}
xmlHashRemoveEntry3:
 1226|  4.64k|                    xmlHashDeallocator dealloc) {
 1227|  4.64k|    xmlHashEntry *entry, *cur, *next;
 1228|  4.64k|    unsigned hashValue, mask, pos, nextpos;
 1229|  4.64k|    int found;
 1230|       |
 1231|  4.64k|    if ((hash == NULL) || (hash->size == 0) || (key == NULL))
  ------------------
  |  Branch (1231:9): [True: 0, False: 4.64k]
  |  Branch (1231:27): [True: 0, False: 4.64k]
  |  Branch (1231:48): [True: 0, False: 4.64k]
  ------------------
 1232|      0|        return(-1);
 1233|       |
 1234|  4.64k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, NULL);
 1235|  4.64k|    entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
 1236|  4.64k|    if (!found)
  ------------------
  |  Branch (1236:9): [True: 0, False: 4.64k]
  ------------------
 1237|      0|        return(-1);
 1238|       |
 1239|  4.64k|    if ((dealloc != NULL) && (entry->payload != NULL))
  ------------------
  |  Branch (1239:9): [True: 2.24k, False: 2.40k]
  |  Branch (1239:30): [True: 2.24k, False: 0]
  ------------------
 1240|  2.24k|        dealloc(entry->payload, entry->key);
 1241|  4.64k|    if (hash->dict == NULL) {
  ------------------
  |  Branch (1241:9): [True: 2.32k, False: 2.31k]
  ------------------
 1242|  2.32k|        if (entry->key)
  ------------------
  |  Branch (1242:13): [True: 2.32k, False: 0]
  ------------------
 1243|  2.32k|            xmlFree(entry->key);
 1244|  2.32k|        if (entry->key2)
  ------------------
  |  Branch (1244:13): [True: 4, False: 2.32k]
  ------------------
 1245|      4|            xmlFree(entry->key2);
 1246|  2.32k|        if (entry->key3)
  ------------------
  |  Branch (1246:13): [True: 0, False: 2.32k]
  ------------------
 1247|      0|            xmlFree(entry->key3);
 1248|  2.32k|    }
 1249|       |
 1250|       |    /*
 1251|       |     * Find end of probe sequence. Entries at their initial probe
 1252|       |     * position start a new sequence.
 1253|       |     */
 1254|  4.64k|    mask = hash->size - 1;
 1255|  4.64k|    pos = entry - hash->table;
 1256|  4.64k|    cur = entry;
 1257|       |
 1258|  9.35k|    while (1) {
  ------------------
  |  Branch (1258:12): [True: 9.35k, Folded]
  ------------------
 1259|  9.35k|        nextpos = pos + 1;
 1260|  9.35k|        next = cur + 1;
 1261|  9.35k|        if ((nextpos & mask) == 0)
  ------------------
  |  Branch (1261:13): [True: 916, False: 8.44k]
  ------------------
 1262|    916|            next = hash->table;
 1263|       |
 1264|  9.35k|        if ((next->hashValue == 0) ||
  ------------------
  |  Branch (1264:13): [True: 3.13k, False: 6.22k]
  ------------------
 1265|  6.22k|            (((next->hashValue - nextpos) & mask) == 0))
  ------------------
  |  Branch (1265:13): [True: 1.50k, False: 4.71k]
  ------------------
 1266|  4.64k|            break;
 1267|       |
 1268|  4.71k|        cur = next;
 1269|  4.71k|        pos = nextpos;
 1270|  4.71k|    }
 1271|       |
 1272|       |    /*
 1273|       |     * Backward shift
 1274|       |     */
 1275|  4.64k|    next = entry + 1;
 1276|       |
 1277|  4.64k|    if (cur < entry) {
  ------------------
  |  Branch (1277:9): [True: 451, False: 4.19k]
  ------------------
 1278|    451|        xmlHashEntry *end = &hash->table[hash->size];
 1279|       |
 1280|    451|        memmove(entry, next, (char *) end - (char *) next);
 1281|    451|        entry = hash->table;
 1282|    451|        end[-1] = *entry;
 1283|    451|        next = entry + 1;
 1284|    451|    }
 1285|       |
 1286|  4.64k|    memmove(entry, next, (char *) cur - (char *) entry);
 1287|       |
 1288|       |    /*
 1289|       |     * Update entry
 1290|       |     */
 1291|  4.64k|    cur->hashValue = 0;
 1292|       |
 1293|  4.64k|    hash->nbElems--;
 1294|       |
 1295|  4.64k|    return(0);
 1296|  4.64k|}
hash.c:xmlHashGrow:
  345|  85.4k|xmlHashGrow(xmlHashTablePtr hash, unsigned size) {
  346|  85.4k|    const xmlHashEntry *oldentry, *oldend, *end;
  347|  85.4k|    xmlHashEntry *table;
  348|  85.4k|    unsigned oldsize, i;
  349|       |
  350|       |    /* Add 0 to avoid spurious -Wtype-limits warning on 64-bit GCC */
  351|  85.4k|    if ((size_t) size + 0 > SIZE_MAX / sizeof(table[0]))
  ------------------
  |  Branch (351:9): [True: 0, False: 85.4k]
  ------------------
  352|      0|        return(-1);
  353|  85.4k|    table = xmlMalloc(size * sizeof(table[0]));
  354|  85.4k|    if (table == NULL)
  ------------------
  |  Branch (354:9): [True: 32, False: 85.4k]
  ------------------
  355|     32|        return(-1);
  356|  85.4k|    memset(table, 0, size * sizeof(table[0]));
  357|       |
  358|  85.4k|    oldsize = hash->size;
  359|  85.4k|    if (oldsize == 0)
  ------------------
  |  Branch (359:9): [True: 83.1k, False: 2.34k]
  ------------------
  360|  83.1k|        goto done;
  361|       |
  362|  2.34k|    oldend = &hash->table[oldsize];
  363|  2.34k|    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.34k|    oldentry = hash->table;
  373|  14.8k|    while (oldentry->hashValue != 0) {
  ------------------
  |  Branch (373:12): [True: 12.5k, False: 2.34k]
  ------------------
  374|  12.5k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (374:13): [True: 0, False: 12.5k]
  ------------------
  375|      0|            oldentry = hash->table;
  376|  12.5k|    }
  377|       |
  378|  82.5k|    for (i = 0; i < oldsize; i++) {
  ------------------
  |  Branch (378:17): [True: 80.1k, False: 2.34k]
  ------------------
  379|  80.1k|        if (oldentry->hashValue != 0) {
  ------------------
  |  Branch (379:13): [True: 70.1k, False: 10.0k]
  ------------------
  380|  70.1k|            xmlHashEntry *entry = &table[oldentry->hashValue & (size - 1)];
  381|       |
  382|  95.6k|            while (entry->hashValue != 0) {
  ------------------
  |  Branch (382:20): [True: 25.4k, False: 70.1k]
  ------------------
  383|  25.4k|                if (++entry >= end)
  ------------------
  |  Branch (383:21): [True: 351, False: 25.0k]
  ------------------
  384|    351|                    entry = table;
  385|  25.4k|            }
  386|  70.1k|            *entry = *oldentry;
  387|  70.1k|        }
  388|       |
  389|  80.1k|        if (++oldentry >= oldend)
  ------------------
  |  Branch (389:13): [True: 2.34k, False: 77.8k]
  ------------------
  390|  2.34k|            oldentry = hash->table;
  391|  80.1k|    }
  392|       |
  393|  2.34k|    xmlFree(hash->table);
  394|       |
  395|  85.4k|done:
  396|  85.4k|    hash->table = table;
  397|  85.4k|    hash->size = size;
  398|       |
  399|  85.4k|    return(0);
  400|  2.34k|}
hash.c:xmlHashUpdateInternal:
  417|   345k|                      void *payload, xmlHashDeallocator dealloc, int update) {
  418|   345k|    xmlChar *copy, *copy2, *copy3;
  419|   345k|    xmlHashEntry *entry = NULL;
  420|   345k|    size_t lengths[3] = {0, 0, 0};
  421|   345k|    unsigned hashValue, newSize;
  422|       |
  423|   345k|    if ((hash == NULL) || (key == NULL))
  ------------------
  |  Branch (423:9): [True: 0, False: 345k]
  |  Branch (423:27): [True: 0, False: 345k]
  ------------------
  424|      0|        return(-1);
  425|       |
  426|   345k|    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
  427|       |
  428|       |    /*
  429|       |     * Check for an existing entry
  430|       |     */
  431|   345k|    if (hash->size == 0) {
  ------------------
  |  Branch (431:9): [True: 76.3k, False: 269k]
  ------------------
  432|  76.3k|        newSize = MIN_HASH_SIZE;
  ------------------
  |  |   30|  76.3k|#define MIN_HASH_SIZE 8
  ------------------
  433|   269k|    } else {
  434|   269k|        int found = 0;
  435|       |
  436|   269k|        entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
  437|       |
  438|   269k|        if (found) {
  ------------------
  |  Branch (438:13): [True: 171k, False: 97.8k]
  ------------------
  439|   171k|            if (update) {
  ------------------
  |  Branch (439:17): [True: 1.12k, False: 170k]
  ------------------
  440|  1.12k|                if (dealloc)
  ------------------
  |  Branch (440:21): [True: 373, False: 750]
  ------------------
  441|    373|                    dealloc(entry->payload, entry->key);
  442|  1.12k|                entry->payload = payload;
  443|  1.12k|            }
  444|       |
  445|   171k|            return(0);
  446|   171k|        }
  447|       |
  448|  97.8k|        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   29|  97.8k|#define MAX_FILL_DENOM 8
  ------------------
                      if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
  ------------------
  |  |   28|  97.8k|#define MAX_FILL_NUM 7
  ------------------
  |  Branch (448:13): [True: 2.34k, False: 95.4k]
  ------------------
  449|       |            /* This guarantees that nbElems < INT_MAX */
  450|  2.34k|            if (hash->size >= MAX_HASH_SIZE)
  ------------------
  |  |   31|  2.34k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  |  Branch (450:17): [True: 0, False: 2.34k]
  ------------------
  451|      0|                return(-1);
  452|  2.34k|            newSize = hash->size * 2;
  453|  95.4k|        } else {
  454|  95.4k|            newSize = 0;
  455|  95.4k|        }
  456|  97.8k|    }
  457|       |
  458|       |    /*
  459|       |     * Grow the hash table if needed
  460|       |     */
  461|   174k|    if (newSize > 0) {
  ------------------
  |  Branch (461:9): [True: 78.6k, False: 95.4k]
  ------------------
  462|  78.6k|        unsigned mask, displ, pos;
  463|       |
  464|  78.6k|        if (xmlHashGrow(hash, newSize) != 0)
  ------------------
  |  Branch (464:13): [True: 30, False: 78.6k]
  ------------------
  465|     30|            return(-1);
  466|       |
  467|       |        /*
  468|       |         * Find new entry
  469|       |         */
  470|  78.6k|        mask = hash->size - 1;
  471|  78.6k|        displ = 0;
  472|  78.6k|        pos = hashValue & mask;
  473|  78.6k|        entry = &hash->table[pos];
  474|       |
  475|  78.6k|        if (entry->hashValue != 0) {
  ------------------
  |  Branch (475:13): [True: 1.02k, False: 77.6k]
  ------------------
  476|  1.43k|            do {
  477|  1.43k|                displ++;
  478|  1.43k|                pos++;
  479|  1.43k|                entry++;
  480|  1.43k|                if ((pos & mask) == 0)
  ------------------
  |  Branch (480:21): [True: 69, False: 1.36k]
  ------------------
  481|     69|                    entry = hash->table;
  482|  1.43k|            } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (482:22): [True: 809, False: 627]
  ------------------
  483|    809|                     ((pos - entry->hashValue) & mask) >= displ);
  ------------------
  |  Branch (483:22): [True: 408, False: 401]
  ------------------
  484|  1.02k|        }
  485|  78.6k|    }
  486|       |
  487|       |    /*
  488|       |     * Copy keys
  489|       |     */
  490|   174k|    if (hash->dict != NULL) {
  ------------------
  |  Branch (490:9): [True: 72.6k, False: 101k]
  ------------------
  491|  72.6k|        if (xmlDictOwns(hash->dict, key)) {
  ------------------
  |  Branch (491:13): [True: 72.6k, False: 0]
  ------------------
  492|  72.6k|            copy = (xmlChar *) key;
  493|  72.6k|        } 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|  72.6k|        if ((key2 == NULL) || (xmlDictOwns(hash->dict, key2))) {
  ------------------
  |  Branch (499:13): [True: 45.2k, False: 27.4k]
  |  Branch (499:31): [True: 26.8k, False: 622]
  ------------------
  500|  72.0k|            copy2 = (xmlChar *) key2;
  501|  72.0k|        } else {
  502|    622|            copy2 = (xmlChar *) xmlDictLookup(hash->dict, key2, -1);
  503|    622|            if (copy2 == NULL)
  ------------------
  |  Branch (503:17): [True: 1, False: 621]
  ------------------
  504|      1|                return(-1);
  505|    622|        }
  506|  72.6k|        if ((key3 == NULL) || (xmlDictOwns(hash->dict, key3))) {
  ------------------
  |  Branch (506:13): [True: 52.2k, False: 20.4k]
  |  Branch (506:31): [True: 20.4k, False: 0]
  ------------------
  507|  72.6k|            copy3 = (xmlChar *) key3;
  508|  72.6k|        } 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|   101k|    } else {
  514|   101k|        copy = xmlMalloc(lengths[0] + 1);
  515|   101k|        if (copy == NULL)
  ------------------
  |  Branch (515:13): [True: 52, False: 101k]
  ------------------
  516|     52|            return(-1);
  517|   101k|        memcpy(copy, key, lengths[0] + 1);
  518|       |
  519|   101k|        if (key2 != NULL) {
  ------------------
  |  Branch (519:13): [True: 7.02k, False: 94.3k]
  ------------------
  520|  7.02k|            copy2 = xmlMalloc(lengths[1] + 1);
  521|  7.02k|            if (copy2 == NULL) {
  ------------------
  |  Branch (521:17): [True: 10, False: 7.01k]
  ------------------
  522|     10|                xmlFree(copy);
  523|     10|                return(-1);
  524|     10|            }
  525|  7.01k|            memcpy(copy2, key2, lengths[1] + 1);
  526|  94.3k|        } else {
  527|  94.3k|            copy2 = NULL;
  528|  94.3k|        }
  529|       |
  530|   101k|        if (key3 != NULL) {
  ------------------
  |  Branch (530:13): [True: 15.7k, False: 85.6k]
  ------------------
  531|  15.7k|            copy3 = xmlMalloc(lengths[2] + 1);
  532|  15.7k|            if (copy3 == NULL) {
  ------------------
  |  Branch (532:17): [True: 9, False: 15.7k]
  ------------------
  533|      9|                xmlFree(copy);
  534|      9|                xmlFree(copy2);
  535|      9|                return(-1);
  536|      9|            }
  537|  15.7k|            memcpy(copy3, key3, lengths[2] + 1);
  538|  85.6k|        } else {
  539|  85.6k|            copy3 = NULL;
  540|  85.6k|        }
  541|   101k|    }
  542|       |
  543|       |    /*
  544|       |     * Shift the remainder of the probe sequence to the right
  545|       |     */
  546|   174k|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (546:9): [True: 20.2k, False: 153k]
  ------------------
  547|  20.2k|        const xmlHashEntry *end = &hash->table[hash->size];
  548|  20.2k|        const xmlHashEntry *cur = entry;
  549|       |
  550|  99.0k|        do {
  551|  99.0k|            cur++;
  552|  99.0k|            if (cur >= end)
  ------------------
  |  Branch (552:17): [True: 2.45k, False: 96.5k]
  ------------------
  553|  2.45k|                cur = hash->table;
  554|  99.0k|        } while (cur->hashValue != 0);
  ------------------
  |  Branch (554:18): [True: 78.7k, False: 20.2k]
  ------------------
  555|       |
  556|  20.2k|        if (cur < entry) {
  ------------------
  |  Branch (556:13): [True: 2.45k, False: 17.8k]
  ------------------
  557|       |            /*
  558|       |             * If we traversed the end of the buffer, handle the part
  559|       |             * at the start of the buffer.
  560|       |             */
  561|  2.45k|            memmove(&hash->table[1], hash->table,
  562|  2.45k|                    (char *) cur - (char *) hash->table);
  563|  2.45k|            cur = end - 1;
  564|  2.45k|            hash->table[0] = *cur;
  565|  2.45k|        }
  566|       |
  567|  20.2k|        memmove(&entry[1], entry, (char *) cur - (char *) entry);
  568|  20.2k|    }
  569|       |
  570|       |    /*
  571|       |     * Populate entry
  572|       |     */
  573|   174k|    entry->key = copy;
  574|   174k|    entry->key2 = copy2;
  575|   174k|    entry->key3 = copy3;
  576|   174k|    entry->payload = payload;
  577|       |    /* OR with MAX_HASH_SIZE to make sure that the value is non-zero */
  578|   174k|    entry->hashValue = hashValue | MAX_HASH_SIZE;
  ------------------
  |  |   31|   174k|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  579|       |
  580|   174k|    hash->nbElems++;
  581|       |
  582|   174k|    return(1);
  583|   174k|}
hash.c:xmlHashValue:
   62|  6.90M|             const xmlChar *key3, size_t *lengths) {
   63|  6.90M|    unsigned h1, h2;
   64|  6.90M|    size_t i;
   65|       |
   66|  6.90M|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  6.90M|    do { \
  |  |   24|  6.90M|        h1 = seed ^ 0x3b00; \
  |  |   25|  6.90M|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  6.90M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  6.90M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 6.90M]
  |  |  ------------------
  ------------------
   67|       |
   68|  54.8M|    for (i = 0; key[i] != 0; i++) {
  ------------------
  |  Branch (68:17): [True: 47.9M, False: 6.90M]
  ------------------
   69|  47.9M|        HASH_UPDATE(h1, h2, key[i]);
  ------------------
  |  |   29|  47.9M|    do { \
  |  |   30|  47.9M|        h1 += ch; \
  |  |   31|  47.9M|        h1 += h1 << 3; \
  |  |   32|  47.9M|        h2 += h1; \
  |  |   33|  47.9M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  47.9M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  47.9M|        h2 += h2 << 2; \
  |  |   35|  47.9M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 47.9M]
  |  |  ------------------
  ------------------
   70|  47.9M|    }
   71|  6.90M|    if (lengths)
  ------------------
  |  Branch (71:9): [True: 345k, False: 6.55M]
  ------------------
   72|   345k|        lengths[0] = i;
   73|       |
   74|  6.90M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  6.90M|    do { \
  |  |   30|  6.90M|        h1 += ch; \
  |  |   31|  6.90M|        h1 += h1 << 3; \
  |  |   32|  6.90M|        h2 += h1; \
  |  |   33|  6.90M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.90M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.90M|        h2 += h2 << 2; \
  |  |   35|  6.90M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.90M]
  |  |  ------------------
  ------------------
   75|       |
   76|  6.90M|    if (key2 != NULL) {
  ------------------
  |  Branch (76:9): [True: 322k, False: 6.58M]
  ------------------
   77|  1.66M|        for (i = 0; key2[i] != 0; i++) {
  ------------------
  |  Branch (77:21): [True: 1.33M, False: 322k]
  ------------------
   78|  1.33M|            HASH_UPDATE(h1, h2, key2[i]);
  ------------------
  |  |   29|  1.33M|    do { \
  |  |   30|  1.33M|        h1 += ch; \
  |  |   31|  1.33M|        h1 += h1 << 3; \
  |  |   32|  1.33M|        h2 += h1; \
  |  |   33|  1.33M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  1.33M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  1.33M|        h2 += h2 << 2; \
  |  |   35|  1.33M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 1.33M]
  |  |  ------------------
  ------------------
   79|  1.33M|        }
   80|   322k|        if (lengths)
  ------------------
  |  Branch (80:13): [True: 58.7k, False: 263k]
  ------------------
   81|  58.7k|            lengths[1] = i;
   82|   322k|    }
   83|       |
   84|  6.90M|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  6.90M|    do { \
  |  |   30|  6.90M|        h1 += ch; \
  |  |   31|  6.90M|        h1 += h1 << 3; \
  |  |   32|  6.90M|        h2 += h1; \
  |  |   33|  6.90M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.90M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.90M|        h2 += h2 << 2; \
  |  |   35|  6.90M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.90M]
  |  |  ------------------
  ------------------
   85|       |
   86|  6.90M|    if (key3 != NULL) {
  ------------------
  |  Branch (86:9): [True: 1.85M, False: 5.04M]
  ------------------
   87|  4.12M|        for (i = 0; key3[i] != 0; i++) {
  ------------------
  |  Branch (87:21): [True: 2.26M, False: 1.85M]
  ------------------
   88|  2.26M|            HASH_UPDATE(h1, h2, key3[i]);
  ------------------
  |  |   29|  2.26M|    do { \
  |  |   30|  2.26M|        h1 += ch; \
  |  |   31|  2.26M|        h1 += h1 << 3; \
  |  |   32|  2.26M|        h2 += h1; \
  |  |   33|  2.26M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  2.26M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  2.26M|        h2 += h2 << 2; \
  |  |   35|  2.26M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 2.26M]
  |  |  ------------------
  ------------------
   89|  2.26M|        }
   90|  1.85M|        if (lengths)
  ------------------
  |  Branch (90:13): [True: 61.4k, False: 1.79M]
  ------------------
   91|  61.4k|            lengths[2] = i;
   92|  1.85M|    }
   93|       |
   94|  6.90M|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  6.90M|    do { \
  |  |   40|  6.90M|        h1 ^= h2; \
  |  |   41|  6.90M|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  6.90M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  6.90M|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  6.90M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  6.90M|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  6.90M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  6.90M|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  6.90M|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  6.90M|        h2 &= 0xFFFFFFFF; \
  |  |   46|  6.90M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 6.90M]
  |  |  ------------------
  ------------------
   95|       |
   96|  6.90M|    return(h2);
   97|  6.90M|}
hash.c:xmlHashFindEntry:
  287|  6.82M|                 unsigned hashValue, int *pfound) {
  288|  6.82M|    xmlHashEntry *entry;
  289|  6.82M|    unsigned mask, pos, displ;
  290|  6.82M|    int found = 0;
  291|       |
  292|  6.82M|    mask = hash->size - 1;
  293|  6.82M|    pos = hashValue & mask;
  294|  6.82M|    entry = &hash->table[pos];
  295|       |
  296|  6.82M|    if (entry->hashValue != 0) {
  ------------------
  |  Branch (296:9): [True: 5.69M, False: 1.13M]
  ------------------
  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.69M|        displ = 0;
  303|  5.69M|        hashValue |= MAX_HASH_SIZE;
  ------------------
  |  |   31|  5.69M|#define MAX_HASH_SIZE (1u << 31)
  ------------------
  304|       |
  305|  6.96M|        do {
  306|  6.96M|            if (entry->hashValue == hashValue) {
  ------------------
  |  Branch (306:17): [True: 4.96M, False: 2.00M]
  ------------------
  307|  4.96M|                if (hash->dict) {
  ------------------
  |  Branch (307:21): [True: 2.57M, False: 2.39M]
  ------------------
  308|  2.57M|                    if ((entry->key == key) &&
  ------------------
  |  Branch (308:25): [True: 1.41M, False: 1.15M]
  ------------------
  309|  1.41M|                        (entry->key2 == key2) &&
  ------------------
  |  Branch (309:25): [True: 1.40M, False: 12.6k]
  ------------------
  310|  1.40M|                        (entry->key3 == key3)) {
  ------------------
  |  Branch (310:25): [True: 1.40M, False: 739]
  ------------------
  311|  1.40M|                        found = 1;
  312|  1.40M|                        break;
  313|  1.40M|                    }
  314|  2.57M|                }
  315|  3.55M|                if ((strcmp((const char *) entry->key,
  ------------------
  |  Branch (315:21): [True: 3.55M, False: 209]
  ------------------
  316|  3.55M|                            (const char *) key) == 0) &&
  317|  3.55M|                    (xmlFastStrEqual(entry->key2, key2)) &&
  ------------------
  |  Branch (317:21): [True: 3.55M, False: 0]
  ------------------
  318|  3.55M|                    (xmlFastStrEqual(entry->key3, key3))) {
  ------------------
  |  Branch (318:21): [True: 3.55M, False: 0]
  ------------------
  319|  3.55M|                    found = 1;
  320|  3.55M|                    break;
  321|  3.55M|                }
  322|  3.55M|            }
  323|       |
  324|  2.00M|            displ++;
  325|  2.00M|            pos++;
  326|  2.00M|            entry++;
  327|  2.00M|            if ((pos & mask) == 0)
  ------------------
  |  Branch (327:17): [True: 298k, False: 1.70M]
  ------------------
  328|   298k|                entry = hash->table;
  329|  2.00M|        } while ((entry->hashValue != 0) &&
  ------------------
  |  Branch (329:18): [True: 1.42M, False: 577k]
  ------------------
  330|  1.42M|                 (((pos - entry->hashValue) & mask) >= displ));
  ------------------
  |  Branch (330:18): [True: 1.27M, False: 151k]
  ------------------
  331|  5.69M|    }
  332|       |
  333|  6.82M|    *pfound = found;
  334|  6.82M|    return(entry);
  335|  6.82M|}
hash.c:xmlHashQNameValue:
  104|  38.9k|                  const xmlChar *prefix3, const xmlChar *name3) {
  105|  38.9k|    unsigned h1, h2, ch;
  106|       |
  107|  38.9k|    HASH_INIT(h1, h2, seed);
  ------------------
  |  |   23|  38.9k|    do { \
  |  |   24|  38.9k|        h1 = seed ^ 0x3b00; \
  |  |   25|  38.9k|        h2 = HASH_ROL(seed, 15); \
  |  |  ------------------
  |  |  |  |   12|  38.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   26|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (26:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  108|       |
  109|  38.9k|    if (prefix != NULL) {
  ------------------
  |  Branch (109:9): [True: 6.72k, False: 32.1k]
  ------------------
  110|  22.4k|        while ((ch = *prefix++) != 0) {
  ------------------
  |  Branch (110:16): [True: 15.7k, False: 6.72k]
  ------------------
  111|  15.7k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  15.7k|    do { \
  |  |   30|  15.7k|        h1 += ch; \
  |  |   31|  15.7k|        h1 += h1 << 3; \
  |  |   32|  15.7k|        h2 += h1; \
  |  |   33|  15.7k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  15.7k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  15.7k|        h2 += h2 << 2; \
  |  |   35|  15.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 15.7k]
  |  |  ------------------
  ------------------
  112|  15.7k|        }
  113|  6.72k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  6.72k|    do { \
  |  |   30|  6.72k|        h1 += ch; \
  |  |   31|  6.72k|        h1 += h1 << 3; \
  |  |   32|  6.72k|        h2 += h1; \
  |  |   33|  6.72k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  6.72k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  6.72k|        h2 += h2 << 2; \
  |  |   35|  6.72k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 6.72k]
  |  |  ------------------
  ------------------
  114|  6.72k|    }
  115|  38.9k|    if (name != NULL) {
  ------------------
  |  Branch (115:9): [True: 38.9k, False: 0]
  ------------------
  116|  4.20M|        while ((ch = *name++) != 0) {
  ------------------
  |  Branch (116:16): [True: 4.16M, False: 38.9k]
  ------------------
  117|  4.16M|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  4.16M|    do { \
  |  |   30|  4.16M|        h1 += ch; \
  |  |   31|  4.16M|        h1 += h1 << 3; \
  |  |   32|  4.16M|        h2 += h1; \
  |  |   33|  4.16M|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  4.16M|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  4.16M|        h2 += h2 << 2; \
  |  |   35|  4.16M|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 4.16M]
  |  |  ------------------
  ------------------
  118|  4.16M|        }
  119|  38.9k|    }
  120|  38.9k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  38.9k|    do { \
  |  |   30|  38.9k|        h1 += ch; \
  |  |   31|  38.9k|        h1 += h1 << 3; \
  |  |   32|  38.9k|        h2 += h1; \
  |  |   33|  38.9k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  38.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  38.9k|        h2 += h2 << 2; \
  |  |   35|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  121|  38.9k|    if (prefix2 != NULL) {
  ------------------
  |  Branch (121:9): [True: 11.7k, False: 27.1k]
  ------------------
  122|  51.5k|        while ((ch = *prefix2++) != 0) {
  ------------------
  |  Branch (122:16): [True: 39.7k, False: 11.7k]
  ------------------
  123|  39.7k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|  39.7k|    do { \
  |  |   30|  39.7k|        h1 += ch; \
  |  |   31|  39.7k|        h1 += h1 << 3; \
  |  |   32|  39.7k|        h2 += h1; \
  |  |   33|  39.7k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  39.7k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  39.7k|        h2 += h2 << 2; \
  |  |   35|  39.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 39.7k]
  |  |  ------------------
  ------------------
  124|  39.7k|        }
  125|  11.7k|        HASH_UPDATE(h1, h2, ':');
  ------------------
  |  |   29|  11.7k|    do { \
  |  |   30|  11.7k|        h1 += ch; \
  |  |   31|  11.7k|        h1 += h1 << 3; \
  |  |   32|  11.7k|        h2 += h1; \
  |  |   33|  11.7k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  11.7k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  11.7k|        h2 += h2 << 2; \
  |  |   35|  11.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 11.7k]
  |  |  ------------------
  ------------------
  126|  11.7k|    }
  127|  38.9k|    if (name2 != NULL) {
  ------------------
  |  Branch (127:9): [True: 38.9k, False: 0]
  ------------------
  128|   733k|        while ((ch = *name2++) != 0) {
  ------------------
  |  Branch (128:16): [True: 694k, False: 38.9k]
  ------------------
  129|   694k|            HASH_UPDATE(h1, h2, ch);
  ------------------
  |  |   29|   694k|    do { \
  |  |   30|   694k|        h1 += ch; \
  |  |   31|   694k|        h1 += h1 << 3; \
  |  |   32|   694k|        h2 += h1; \
  |  |   33|   694k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|   694k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|   694k|        h2 += h2 << 2; \
  |  |   35|   694k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 694k]
  |  |  ------------------
  ------------------
  130|   694k|        }
  131|  38.9k|    }
  132|  38.9k|    HASH_UPDATE(h1, h2, 0);
  ------------------
  |  |   29|  38.9k|    do { \
  |  |   30|  38.9k|        h1 += ch; \
  |  |   31|  38.9k|        h1 += h1 << 3; \
  |  |   32|  38.9k|        h2 += h1; \
  |  |   33|  38.9k|        h2 = HASH_ROL(h2, 7); \
  |  |  ------------------
  |  |  |  |   12|  38.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   34|  38.9k|        h2 += h2 << 2; \
  |  |   35|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (35:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  133|  38.9k|    if (prefix3 != NULL) {
  ------------------
  |  Branch (133:9): [True: 0, False: 38.9k]
  ------------------
  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|  38.9k|    if (name3 != NULL) {
  ------------------
  |  Branch (139:9): [True: 0, False: 38.9k]
  ------------------
  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|  38.9k|    HASH_FINISH(h1, h2);
  ------------------
  |  |   39|  38.9k|    do { \
  |  |   40|  38.9k|        h1 ^= h2; \
  |  |   41|  38.9k|        h1 += HASH_ROL(h2, 14); \
  |  |  ------------------
  |  |  |  |   12|  38.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   42|  38.9k|        h2 ^= h1; h2 += HASH_ROR(h1, 6); \
  |  |  ------------------
  |  |  |  |   13|  38.9k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   43|  38.9k|        h1 ^= h2; h1 += HASH_ROL(h2, 5); \
  |  |  ------------------
  |  |  |  |   12|  38.9k|#define HASH_ROL(x,n) ((x) << (n) | ((x) & 0xFFFFFFFF) >> (32 - (n)))
  |  |  ------------------
  |  |   44|  38.9k|        h2 ^= h1; h2 += HASH_ROR(h1, 8); \
  |  |  ------------------
  |  |  |  |   13|  38.9k|#define HASH_ROR(x,n) (((x) & 0xFFFFFFFF) >> (n) | (x) << (32 - (n)))
  |  |  ------------------
  |  |   45|  38.9k|        h2 &= 0xFFFFFFFF; \
  |  |   46|  38.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (46:14): [Folded, False: 38.9k]
  |  |  ------------------
  ------------------
  146|       |
  147|  38.9k|    return(h2);
  148|  38.9k|}
hash.c:stubHashScannerFull:
  946|  19.9k|                    const xmlChar *key3 ATTRIBUTE_UNUSED) {
  947|  19.9k|    stubData *sdata = (stubData *) data;
  948|  19.9k|    sdata->scan(payload, sdata->data, key);
  949|  19.9k|}
hash.c:xmlFastStrEqual:
  263|  7.22M|xmlFastStrEqual(const xmlChar *s1, const xmlChar *s2) {
  264|  7.22M|    if (s1 == NULL)
  ------------------
  |  Branch (264:9): [True: 6.05M, False: 1.16M]
  ------------------
  265|  6.05M|        return(s2 == NULL);
  266|  1.16M|    else
  267|  1.16M|        return((s2 != NULL) &&
  ------------------
  |  Branch (267:16): [True: 1.16M, False: 0]
  ------------------
  268|  1.16M|               (strcmp((const char *) s1, (const char *) s2) == 0));
  ------------------
  |  Branch (268:16): [True: 1.05M, False: 111k]
  ------------------
  269|  7.22M|}

tree.c:xmlGrowCapacity:
   32|  25.8k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  25.8k|    int extra;
   34|       |
   35|  25.8k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 25.0k, False: 830]
  ------------------
   36|  25.0k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  25.0k|        (void) min;
   38|  25.0k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  25.0k|    }
   43|       |
   44|    830|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 830]
  ------------------
   45|    830|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 830]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    830|    extra = (capacity + 1) / 2;
   50|       |
   51|    830|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 830]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    830|    return(capacity + extra);
   55|    830|}
uri.c:xmlGrowCapacity:
   32|  10.8k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  10.8k|    int extra;
   34|       |
   35|  10.8k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 0, False: 10.8k]
  ------------------
   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.8k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 26, False: 10.7k]
  ------------------
   45|  10.7k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 10.7k]
  ------------------
   46|     26|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  10.7k|    extra = (capacity + 1) / 2;
   50|       |
   51|  10.7k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 40, False: 10.7k]
  ------------------
   52|     40|        return(max);
   53|       |
   54|  10.7k|    return(capacity + extra);
   55|  10.7k|}
valid.c:xmlGrowCapacity:
   32|  8.52k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  8.52k|    int extra;
   34|       |
   35|  8.52k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 3.13k, False: 5.38k]
  ------------------
   36|  3.13k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  3.13k|        (void) min;
   38|  3.13k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  3.13k|    }
   43|       |
   44|  5.38k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 5.38k]
  ------------------
   45|  5.38k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 5.38k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  5.38k|    extra = (capacity + 1) / 2;
   50|       |
   51|  5.38k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 5.38k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  5.38k|    return(capacity + extra);
   55|  5.38k|}
xmlreader.c:xmlGrowCapacity:
   32|    475|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|    475|    int extra;
   34|       |
   35|    475|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 221, False: 254]
  ------------------
   36|    221|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|    221|        (void) min;
   38|    221|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|    221|    }
   43|       |
   44|    254|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 254]
  ------------------
   45|    254|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 254]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|    254|    extra = (capacity + 1) / 2;
   50|       |
   51|    254|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 254]
  ------------------
   52|      0|        return(max);
   53|       |
   54|    254|    return(capacity + extra);
   55|    254|}
xmlregexp.c:xmlGrowCapacity:
   32|  1.60M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.60M|    int extra;
   34|       |
   35|  1.60M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 772k, False: 834k]
  ------------------
   36|   772k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   772k|        (void) min;
   38|   772k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   772k|    }
   43|       |
   44|   834k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 834k]
  ------------------
   45|   834k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 834k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   834k|    extra = (capacity + 1) / 2;
   50|       |
   51|   834k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 834k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|   834k|    return(capacity + extra);
   55|   834k|}
xinclude.c:xmlGrowCapacity:
   32|  22.3k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  22.3k|    int extra;
   34|       |
   35|  22.3k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 20.1k, False: 2.16k]
  ------------------
   36|  20.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  20.1k|        (void) min;
   38|  20.1k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  20.1k|    }
   43|       |
   44|  2.16k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 2.16k]
  ------------------
   45|  2.16k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 2.16k]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  2.16k|    extra = (capacity + 1) / 2;
   50|       |
   51|  2.16k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 2.16k]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  2.16k|    return(capacity + extra);
   55|  2.16k|}
xpath.c:xmlGrowCapacity:
   32|  1.44M|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|  1.44M|    int extra;
   34|       |
   35|  1.44M|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 380k, False: 1.06M]
  ------------------
   36|   380k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|   380k|        (void) min;
   38|   380k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|   380k|    }
   43|       |
   44|  1.06M|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 0, False: 1.06M]
  ------------------
   45|  1.06M|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 1.06M]
  ------------------
   46|      0|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|  1.06M|    extra = (capacity + 1) / 2;
   50|       |
   51|  1.06M|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 0, False: 1.06M]
  ------------------
   52|      0|        return(max);
   53|       |
   54|  1.06M|    return(capacity + extra);
   55|  1.06M|}
parser.c:xmlGrowCapacity:
   32|   351k|xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
   33|   351k|    int extra;
   34|       |
   35|   351k|    if (capacity <= 0) {
  ------------------
  |  Branch (35:9): [True: 35.3k, False: 316k]
  ------------------
   36|  35.3k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
   37|  35.3k|        (void) min;
   38|  35.3k|        return(1);
   39|       |#else
   40|       |        return(min);
   41|       |#endif
   42|  35.3k|    }
   43|       |
   44|   316k|    if ((capacity >= max) ||
  ------------------
  |  Branch (44:9): [True: 156, False: 316k]
  ------------------
   45|   316k|        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
  ------------------
  |  Branch (45:9): [True: 0, False: 316k]
  ------------------
   46|    156|        return(-1);
   47|       |
   48|       |    /* Grow by 50% */
   49|   316k|    extra = (capacity + 1) / 2;
   50|       |
   51|   316k|    if (capacity > max - extra)
  ------------------
  |  Branch (51:9): [True: 366, False: 315k]
  ------------------
   52|    366|        return(max);
   53|       |
   54|   315k|    return(capacity + extra);
   55|   316k|}

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

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

xmlWarningMsg:
  276|  41.2k|{
  277|  41.2k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING,
  278|       |               str1, str2, NULL, 0, msg, str1, str2);
  279|  41.2k|}
xmlAttrNormalizeSpace:
  989|  30.4k|{
  990|  30.4k|    if ((src == NULL) || (dst == NULL))
  ------------------
  |  Branch (990:9): [True: 0, False: 30.4k]
  |  Branch (990:26): [True: 0, False: 30.4k]
  ------------------
  991|      0|        return(NULL);
  992|       |
  993|  37.4k|    while (*src == 0x20) src++;
  ------------------
  |  Branch (993:12): [True: 6.98k, False: 30.4k]
  ------------------
  994|  1.68M|    while (*src != 0) {
  ------------------
  |  Branch (994:12): [True: 1.65M, False: 30.4k]
  ------------------
  995|  1.65M|	if (*src == 0x20) {
  ------------------
  |  Branch (995:6): [True: 25.2k, False: 1.63M]
  ------------------
  996|   221k|	    while (*src == 0x20) src++;
  ------------------
  |  Branch (996:13): [True: 196k, False: 25.2k]
  ------------------
  997|  25.2k|	    if (*src != 0)
  ------------------
  |  Branch (997:10): [True: 24.5k, False: 694]
  ------------------
  998|  24.5k|		*dst++ = 0x20;
  999|  1.63M|	} else {
 1000|  1.63M|	    *dst++ = *src++;
 1001|  1.63M|	}
 1002|  1.65M|    }
 1003|  30.4k|    *dst = 0;
 1004|  30.4k|    if (dst == src)
  ------------------
  |  Branch (1004:9): [True: 26.6k, False: 3.80k]
  ------------------
 1005|  26.6k|       return(NULL);
 1006|  3.80k|    return(dst);
 1007|  30.4k|}
xmlAttrNormalize:
 1024|  2.32k|{
 1025|  2.32k|    xmlChar *out = NULL;
 1026|  2.32k|    xmlChar *dst = NULL;
 1027|       |
 1028|  2.32k|    if (src == NULL)
  ------------------
  |  Branch (1028:9): [True: 0, False: 2.32k]
  ------------------
 1029|      0|        return(NULL);
 1030|       |
 1031|  2.32k|    out = src;
 1032|  2.32k|    dst = out;
 1033|  38.3k|    while (*src != 0) {
  ------------------
  |  Branch (1033:12): [True: 36.0k, False: 2.32k]
  ------------------
 1034|  36.0k|        if (*src < 0x20) {
  ------------------
  |  Branch (1034:13): [True: 26, False: 36.0k]
  ------------------
 1035|     26|            src++;
 1036|     26|            *dst++ = 0x20;
 1037|  36.0k|        } else {
 1038|  36.0k|            *dst++ = *src++;
 1039|  36.0k|        }
 1040|  36.0k|    }
 1041|  2.32k|    *dst = 0;
 1042|  2.32k|    return(out);
 1043|  2.32k|}
xmlCheckLanguageID:
 1304|  42.2k|{
 1305|  42.2k|    const xmlChar *cur = lang, *nxt;
 1306|       |
 1307|  42.2k|    if (cur == NULL)
  ------------------
  |  Branch (1307:9): [True: 261, False: 42.0k]
  ------------------
 1308|    261|        return (0);
 1309|  42.0k|    if (((cur[0] == 'i') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1309:10): [True: 343, False: 41.6k]
  |  Branch (1309:29): [True: 92, False: 251]
  ------------------
 1310|  41.9k|        ((cur[0] == 'I') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1310:10): [True: 24.8k, False: 17.0k]
  |  Branch (1310:29): [True: 971, False: 23.8k]
  ------------------
 1311|  40.9k|        ((cur[0] == 'x') && (cur[1] == '-')) ||
  ------------------
  |  Branch (1311:10): [True: 673, False: 40.2k]
  |  Branch (1311:29): [True: 83, False: 590]
  ------------------
 1312|  40.8k|        ((cur[0] == 'X') && (cur[1] == '-'))) {
  ------------------
  |  Branch (1312:10): [True: 299, False: 40.5k]
  |  Branch (1312:29): [True: 80, False: 219]
  ------------------
 1313|       |        /*
 1314|       |         * Still allow IANA code and user code which were coming
 1315|       |         * from the previous version of the XML-1.0 specification
 1316|       |         * it's deprecated but we should not fail
 1317|       |         */
 1318|  1.22k|        cur += 2;
 1319|  3.27k|        while (((cur[0] >= 'A') && (cur[0] <= 'Z')) ||
  ------------------
  |  Branch (1319:17): [True: 2.14k, False: 1.12k]
  |  Branch (1319:36): [True: 1.70k, False: 437]
  ------------------
 1320|  1.56k|               ((cur[0] >= 'a') && (cur[0] <= 'z')))
  ------------------
  |  Branch (1320:17): [True: 437, False: 1.12k]
  |  Branch (1320:36): [True: 340, False: 97]
  ------------------
 1321|  2.04k|            cur++;
 1322|  1.22k|        return(cur[0] == 0);
 1323|  1.22k|    }
 1324|  40.8k|    nxt = cur;
 1325|   186k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1325:13): [True: 147k, False: 38.7k]
  |  Branch (1325:32): [True: 133k, False: 13.5k]
  ------------------
 1326|  52.3k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1326:13): [True: 13.5k, False: 38.7k]
  |  Branch (1326:32): [True: 11.5k, False: 2.06k]
  ------------------
 1327|   145k|           nxt++;
 1328|  40.8k|    if (nxt - cur >= 4) {
  ------------------
  |  Branch (1328:9): [True: 2.32k, False: 38.4k]
  ------------------
 1329|       |        /*
 1330|       |         * Reserved
 1331|       |         */
 1332|  2.32k|        if ((nxt - cur > 8) || (nxt[0] != 0))
  ------------------
  |  Branch (1332:13): [True: 893, False: 1.42k]
  |  Branch (1332:32): [True: 842, False: 587]
  ------------------
 1333|  1.73k|            return(0);
 1334|    587|        return(1);
 1335|  2.32k|    }
 1336|  38.4k|    if (nxt - cur < 2)
  ------------------
  |  Branch (1336:9): [True: 2.59k, False: 35.8k]
  ------------------
 1337|  2.59k|        return(0);
 1338|       |    /* we got an ISO 639 code */
 1339|  35.8k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1339:9): [True: 1.67k, False: 34.2k]
  ------------------
 1340|  1.67k|        return(1);
 1341|  34.2k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1341:9): [True: 2.36k, False: 31.8k]
  ------------------
 1342|  2.36k|        return(0);
 1343|       |
 1344|  31.8k|    nxt++;
 1345|  31.8k|    cur = nxt;
 1346|       |    /* now we can have extlang or script or region or variant */
 1347|  31.8k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1347:9): [True: 30.2k, False: 1.60k]
  |  Branch (1347:28): [True: 6.64k, False: 23.6k]
  ------------------
 1348|  6.64k|        goto region_m49;
 1349|       |
 1350|   108k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1350:13): [True: 84.6k, False: 24.1k]
  |  Branch (1350:32): [True: 66.7k, False: 17.8k]
  ------------------
 1351|  42.0k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1351:13): [True: 17.7k, False: 24.3k]
  |  Branch (1351:32): [True: 16.8k, False: 881]
  ------------------
 1352|  83.5k|           nxt++;
 1353|  25.2k|    if (nxt - cur == 4)
  ------------------
  |  Branch (1353:9): [True: 1.32k, False: 23.8k]
  ------------------
 1354|  1.32k|        goto script;
 1355|  23.8k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1355:9): [True: 2.41k, False: 21.4k]
  ------------------
 1356|  2.41k|        goto region;
 1357|  21.4k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1357:9): [True: 1.14k, False: 20.3k]
  |  Branch (1357:29): [True: 1.01k, False: 125]
  ------------------
 1358|  1.01k|        goto variant;
 1359|  20.4k|    if (nxt - cur != 3)
  ------------------
  |  Branch (1359:9): [True: 2.62k, False: 17.8k]
  ------------------
 1360|  2.62k|        return(0);
 1361|       |    /* we parsed an extlang */
 1362|  17.8k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1362:9): [True: 209, False: 17.6k]
  ------------------
 1363|    209|        return(1);
 1364|  17.6k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1364:9): [True: 4.60k, False: 13.0k]
  ------------------
 1365|  4.60k|        return(0);
 1366|       |
 1367|  13.0k|    nxt++;
 1368|  13.0k|    cur = nxt;
 1369|       |    /* now we can have script or region or variant */
 1370|  13.0k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1370:9): [True: 12.4k, False: 611]
  |  Branch (1370:28): [True: 768, False: 11.6k]
  ------------------
 1371|    768|        goto region_m49;
 1372|       |
 1373|  71.4k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1373:13): [True: 62.8k, False: 8.62k]
  |  Branch (1373:32): [True: 49.2k, False: 13.6k]
  ------------------
 1374|  22.2k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1374:13): [True: 13.5k, False: 8.62k]
  |  Branch (1374:32): [True: 9.97k, False: 3.61k]
  ------------------
 1375|  59.2k|           nxt++;
 1376|  12.2k|    if (nxt - cur == 2)
  ------------------
  |  Branch (1376:9): [True: 5.95k, False: 6.29k]
  ------------------
 1377|  5.95k|        goto region;
 1378|  6.29k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1378:9): [True: 4.10k, False: 2.19k]
  |  Branch (1378:29): [True: 3.46k, False: 636]
  ------------------
 1379|  3.46k|        goto variant;
 1380|  2.82k|    if (nxt - cur != 4)
  ------------------
  |  Branch (1380:9): [True: 1.90k, False: 926]
  ------------------
 1381|  1.90k|        return(0);
 1382|       |    /* we parsed a script */
 1383|  2.25k|script:
 1384|  2.25k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1384:9): [True: 442, False: 1.80k]
  ------------------
 1385|    442|        return(1);
 1386|  1.80k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1386:9): [True: 373, False: 1.43k]
  ------------------
 1387|    373|        return(0);
 1388|       |
 1389|  1.43k|    nxt++;
 1390|  1.43k|    cur = nxt;
 1391|       |    /* now we can have region or variant */
 1392|  1.43k|    if ((nxt[0] >= '0') && (nxt[0] <= '9'))
  ------------------
  |  Branch (1392:9): [True: 1.11k, False: 322]
  |  Branch (1392:28): [True: 223, False: 890]
  ------------------
 1393|    223|        goto region_m49;
 1394|       |
 1395|  4.87k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1395:13): [True: 3.80k, False: 1.06k]
  |  Branch (1395:32): [True: 2.61k, False: 1.18k]
  ------------------
 1396|  2.25k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1396:13): [True: 1.18k, False: 1.06k]
  |  Branch (1396:32): [True: 1.03k, False: 145]
  ------------------
 1397|  3.65k|           nxt++;
 1398|       |
 1399|  1.21k|    if ((nxt - cur >= 5) && (nxt - cur <= 8))
  ------------------
  |  Branch (1399:9): [True: 285, False: 927]
  |  Branch (1399:29): [True: 203, False: 82]
  ------------------
 1400|    203|        goto variant;
 1401|  1.00k|    if (nxt - cur != 2)
  ------------------
  |  Branch (1401:9): [True: 506, False: 503]
  ------------------
 1402|    506|        return(0);
 1403|       |    /* we parsed a region */
 1404|  9.11k|region:
 1405|  9.11k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1405:9): [True: 1.24k, False: 7.87k]
  ------------------
 1406|  1.24k|        return(1);
 1407|  7.87k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1407:9): [True: 6.06k, False: 1.80k]
  ------------------
 1408|  6.06k|        return(0);
 1409|       |
 1410|  1.80k|    nxt++;
 1411|  1.80k|    cur = nxt;
 1412|       |    /* now we can just have a variant */
 1413|  11.2k|    while (((nxt[0] >= 'A') && (nxt[0] <= 'Z')) ||
  ------------------
  |  Branch (1413:13): [True: 9.73k, False: 1.49k]
  |  Branch (1413:32): [True: 4.18k, False: 5.54k]
  ------------------
 1414|  7.04k|           ((nxt[0] >= 'a') && (nxt[0] <= 'z')))
  ------------------
  |  Branch (1414:13): [True: 5.54k, False: 1.49k]
  |  Branch (1414:32): [True: 5.23k, False: 314]
  ------------------
 1415|  9.41k|           nxt++;
 1416|       |
 1417|  1.80k|    if ((nxt - cur < 5) || (nxt - cur > 8))
  ------------------
  |  Branch (1417:9): [True: 840, False: 968]
  |  Branch (1417:28): [True: 271, False: 697]
  ------------------
 1418|  1.11k|        return(0);
 1419|       |
 1420|       |    /* we parsed a variant */
 1421|  5.38k|variant:
 1422|  5.38k|    if (nxt[0] == 0)
  ------------------
  |  Branch (1422:9): [True: 1.04k, False: 4.34k]
  ------------------
 1423|  1.04k|        return(1);
 1424|  4.34k|    if (nxt[0] != '-')
  ------------------
  |  Branch (1424:9): [True: 3.77k, False: 570]
  ------------------
 1425|  3.77k|        return(0);
 1426|       |    /* extensions and private use subtags not checked */
 1427|    570|    return (1);
 1428|       |
 1429|  7.63k|region_m49:
 1430|  7.63k|    if (((nxt[1] >= '0') && (nxt[1] <= '9')) &&
  ------------------
  |  Branch (1430:10): [True: 6.73k, False: 897]
  |  Branch (1430:29): [True: 5.39k, False: 1.33k]
  ------------------
 1431|  5.39k|        ((nxt[2] >= '0') && (nxt[2] <= '9'))) {
  ------------------
  |  Branch (1431:10): [True: 3.75k, False: 1.64k]
  |  Branch (1431:29): [True: 242, False: 3.51k]
  ------------------
 1432|    242|        nxt += 3;
 1433|    242|        goto region;
 1434|    242|    }
 1435|  7.39k|    return(0);
 1436|  7.63k|}
xmlParserNsCreate:
 1453|  49.1k|xmlParserNsCreate(void) {
 1454|  49.1k|    xmlParserNsData *nsdb = xmlMalloc(sizeof(*nsdb));
 1455|       |
 1456|  49.1k|    if (nsdb == NULL)
  ------------------
  |  Branch (1456:9): [True: 2, False: 49.1k]
  ------------------
 1457|      2|        return(NULL);
 1458|  49.1k|    memset(nsdb, 0, sizeof(*nsdb));
 1459|  49.1k|    nsdb->defaultNsIndex = INT_MAX;
 1460|       |
 1461|  49.1k|    return(nsdb);
 1462|  49.1k|}
xmlParserNsFree:
 1470|  49.1k|xmlParserNsFree(xmlParserNsData *nsdb) {
 1471|  49.1k|    if (nsdb == NULL)
  ------------------
  |  Branch (1471:9): [True: 0, False: 49.1k]
  ------------------
 1472|      0|        return;
 1473|       |
 1474|  49.1k|    xmlFree(nsdb->extra);
 1475|  49.1k|    xmlFree(nsdb->hash);
 1476|  49.1k|    xmlFree(nsdb);
 1477|  49.1k|}
xmlParserNsLookupSax:
 1603|   122k|xmlParserNsLookupSax(xmlParserCtxt *ctxt, const xmlChar *prefix) {
 1604|   122k|    xmlHashedString hprefix;
 1605|   122k|    int nsIndex;
 1606|       |
 1607|   122k|    if (prefix == ctxt->str_xml)
  ------------------
  |  Branch (1607:9): [True: 74.1k, False: 48.0k]
  ------------------
 1608|  74.1k|        return(NULL);
 1609|       |
 1610|  48.0k|    hprefix.name = prefix;
 1611|  48.0k|    if (prefix != NULL)
  ------------------
  |  Branch (1611:9): [True: 31.6k, False: 16.3k]
  ------------------
 1612|  31.6k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1613|  16.3k|    else
 1614|  16.3k|        hprefix.hashValue = 0;
 1615|  48.0k|    nsIndex = xmlParserNsLookup(ctxt, &hprefix, NULL);
 1616|  48.0k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1616:9): [True: 0, False: 48.0k]
  |  Branch (1616:33): [True: 0, False: 48.0k]
  ------------------
 1617|      0|        return(NULL);
 1618|       |
 1619|  48.0k|    return(ctxt->nsdb->extra[nsIndex].saxData);
 1620|  48.0k|}
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: 250k, False: 39.7k]
  ------------------
 1643|   250k|        hprefix.hashValue = xmlDictComputeHash(ctxt->dict, prefix);
 1644|  39.7k|    else
 1645|  39.7k|        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|   350k|{
 1930|   350k|    char *directory = NULL;
 1931|   350k|    int maxDepth;
 1932|       |
 1933|   350k|    if ((ctxt == NULL) || (value == NULL))
  ------------------
  |  Branch (1933:9): [True: 0, False: 350k]
  |  Branch (1933:27): [True: 3.07k, False: 347k]
  ------------------
 1934|  3.07k|        return(-1);
 1935|       |
 1936|   347k|    maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (1936:16): [True: 90.5k, False: 256k]
  ------------------
 1937|       |
 1938|   347k|    if (ctxt->inputNr >= ctxt->inputMax) {
  ------------------
  |  Branch (1938:9): [True: 7.83k, False: 339k]
  ------------------
 1939|  7.83k|        xmlParserInputPtr *tmp;
 1940|  7.83k|        int newSize;
 1941|       |
 1942|  7.83k|        newSize = xmlGrowCapacity(ctxt->inputMax, sizeof(tmp[0]),
 1943|  7.83k|                                  5, maxDepth);
 1944|  7.83k|        if (newSize < 0) {
  ------------------
  |  Branch (1944:13): [True: 1, False: 7.83k]
  ------------------
 1945|      1|            xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 1946|      1|                           "Maximum entity nesting depth exceeded");
 1947|      1|            return(-1);
 1948|      1|        }
 1949|  7.83k|        tmp = xmlRealloc(ctxt->inputTab, newSize * sizeof(tmp[0]));
 1950|  7.83k|        if (tmp == NULL) {
  ------------------
  |  Branch (1950:13): [True: 1, False: 7.83k]
  ------------------
 1951|      1|            xmlErrMemory(ctxt);
 1952|      1|            return(-1);
 1953|      1|        }
 1954|  7.83k|        ctxt->inputTab = tmp;
 1955|  7.83k|        ctxt->inputMax = newSize;
 1956|  7.83k|    }
 1957|       |
 1958|   347k|    if ((ctxt->inputNr == 0) && (value->filename != NULL)) {
  ------------------
  |  Branch (1958:9): [True: 224k, False: 122k]
  |  Branch (1958:33): [True: 184k, False: 39.6k]
  ------------------
 1959|   184k|        directory = xmlParserGetDirectory(value->filename);
 1960|   184k|        if (directory == NULL) {
  ------------------
  |  Branch (1960:13): [True: 13, False: 184k]
  ------------------
 1961|     13|            xmlErrMemory(ctxt);
 1962|     13|            return(-1);
 1963|     13|        }
 1964|   184k|    }
 1965|       |
 1966|   347k|    if (ctxt->input_id >= INT_MAX) {
  ------------------
  |  Branch (1966:9): [True: 0, False: 347k]
  ------------------
 1967|      0|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT, "Input ID overflow\n");
 1968|      0|        return(-1);
 1969|      0|    }
 1970|       |
 1971|   347k|    ctxt->inputTab[ctxt->inputNr] = value;
 1972|   347k|    ctxt->input = value;
 1973|       |
 1974|   347k|    if (ctxt->inputNr == 0) {
  ------------------
  |  Branch (1974:9): [True: 224k, False: 122k]
  ------------------
 1975|   224k|        xmlFree(ctxt->directory);
 1976|   224k|        ctxt->directory = directory;
 1977|   224k|    }
 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|   347k|    value->id = ctxt->input_id++;
 1985|       |
 1986|   347k|    return(ctxt->inputNr++);
 1987|   347k|}
xmlCtxtPopInput:
 1997|   443k|{
 1998|   443k|    xmlParserInputPtr ret;
 1999|       |
 2000|   443k|    if (ctxt == NULL)
  ------------------
  |  Branch (2000:9): [True: 0, False: 443k]
  ------------------
 2001|      0|        return(NULL);
 2002|   443k|    if (ctxt->inputNr <= 0)
  ------------------
  |  Branch (2002:9): [True: 98.2k, False: 345k]
  ------------------
 2003|  98.2k|        return (NULL);
 2004|   345k|    ctxt->inputNr--;
 2005|   345k|    if (ctxt->inputNr > 0)
  ------------------
  |  Branch (2005:9): [True: 122k, False: 222k]
  ------------------
 2006|   122k|        ctxt->input = ctxt->inputTab[ctxt->inputNr - 1];
 2007|   222k|    else
 2008|   222k|        ctxt->input = NULL;
 2009|   345k|    ret = ctxt->inputTab[ctxt->inputNr];
 2010|       |    ctxt->inputTab[ctxt->inputNr] = NULL;
 2011|   345k|    return (ret);
 2012|   443k|}
nodePush:
 2025|   880k|{
 2026|   880k|    if (ctxt == NULL)
  ------------------
  |  Branch (2026:9): [True: 0, False: 880k]
  ------------------
 2027|      0|        return(0);
 2028|       |
 2029|   880k|    if (ctxt->nodeNr >= ctxt->nodeMax) {
  ------------------
  |  Branch (2029:9): [True: 52.2k, False: 828k]
  ------------------
 2030|  52.2k|        int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (2030:24): [True: 26.1k, False: 26.1k]
  ------------------
 2031|  52.2k|        xmlNodePtr *tmp;
 2032|  52.2k|        int newSize;
 2033|       |
 2034|  52.2k|        newSize = xmlGrowCapacity(ctxt->nodeMax, sizeof(tmp[0]),
 2035|  52.2k|                                  10, maxDepth);
 2036|  52.2k|        if (newSize < 0) {
  ------------------
  |  Branch (2036:13): [True: 50, False: 52.1k]
  ------------------
 2037|     50|            xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 2038|     50|                    "Excessive depth in document: %d,"
 2039|     50|                    " use XML_PARSE_HUGE option\n",
 2040|     50|                    ctxt->nodeNr);
 2041|     50|            return(-1);
 2042|     50|        }
 2043|       |
 2044|  52.1k|	tmp = xmlRealloc(ctxt->nodeTab, newSize * sizeof(tmp[0]));
 2045|  52.1k|        if (tmp == NULL) {
  ------------------
  |  Branch (2045:13): [True: 23, False: 52.1k]
  ------------------
 2046|     23|            xmlErrMemory(ctxt);
 2047|     23|            return (-1);
 2048|     23|        }
 2049|  52.1k|        ctxt->nodeTab = tmp;
 2050|  52.1k|	ctxt->nodeMax = newSize;
 2051|  52.1k|    }
 2052|       |
 2053|   880k|    ctxt->nodeTab[ctxt->nodeNr] = value;
 2054|   880k|    ctxt->node = value;
 2055|   880k|    return (ctxt->nodeNr++);
 2056|   880k|}
nodePop:
 2068|   956k|{
 2069|   956k|    xmlNodePtr ret;
 2070|       |
 2071|   956k|    if (ctxt == NULL) return(NULL);
  ------------------
  |  Branch (2071:9): [True: 0, False: 956k]
  ------------------
 2072|   956k|    if (ctxt->nodeNr <= 0)
  ------------------
  |  Branch (2072:9): [True: 211k, False: 745k]
  ------------------
 2073|   211k|        return (NULL);
 2074|   745k|    ctxt->nodeNr--;
 2075|   745k|    if (ctxt->nodeNr > 0)
  ------------------
  |  Branch (2075:9): [True: 728k, False: 17.1k]
  ------------------
 2076|   728k|        ctxt->node = ctxt->nodeTab[ctxt->nodeNr - 1];
 2077|  17.1k|    else
 2078|  17.1k|        ctxt->node = NULL;
 2079|   745k|    ret = ctxt->nodeTab[ctxt->nodeNr];
 2080|       |    ctxt->nodeTab[ctxt->nodeNr] = NULL;
 2081|   745k|    return (ret);
 2082|   956k|}
xmlSkipBlankChars:
 2355|  5.31M|xmlSkipBlankChars(xmlParserCtxt *ctxt) {
 2356|  5.31M|    const xmlChar *cur;
 2357|  5.31M|    int res = 0;
 2358|       |
 2359|  5.31M|    cur = ctxt->input->cur;
 2360|  5.31M|    while (IS_BLANK_CH(*cur)) {
 2361|  2.19M|        if (*cur == '\n') {
  ------------------
  |  Branch (2361:13): [True: 774k, False: 1.41M]
  ------------------
 2362|   774k|            ctxt->input->line++; ctxt->input->col = 1;
 2363|  1.41M|        } else {
 2364|  1.41M|            ctxt->input->col++;
 2365|  1.41M|        }
 2366|  2.19M|        cur++;
 2367|  2.19M|        if (res < INT_MAX)
  ------------------
  |  Branch (2367:13): [True: 2.19M, False: 0]
  ------------------
 2368|  2.19M|            res++;
 2369|  2.19M|        if (*cur == 0) {
  ------------------
  |  Branch (2369:13): [True: 27.3k, False: 2.16M]
  ------------------
 2370|  27.3k|            ctxt->input->cur = cur;
 2371|  27.3k|            xmlParserGrow(ctxt);
 2372|  27.3k|            cur = ctxt->input->cur;
 2373|  27.3k|        }
 2374|  2.19M|    }
 2375|  5.31M|    ctxt->input->cur = cur;
 2376|       |
 2377|  5.31M|    if (res > 4)
  ------------------
  |  Branch (2377:9): [True: 46.5k, False: 5.26M]
  ------------------
 2378|  46.5k|        GROW;
  ------------------
  |  | 2308|  46.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  46.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  46.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 44.1k, False: 2.36k]
  |  |  ------------------
  |  | 2309|  46.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  44.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.80k, False: 41.3k]
  |  |  ------------------
  |  | 2310|  46.5k|	xmlParserGrow(ctxt);
  ------------------
 2379|       |
 2380|  5.31M|    return(res);
 2381|  5.31M|}
xmlParseCharRef:
 2566|   104k|xmlParseCharRef(xmlParserCtxt *ctxt) {
 2567|   104k|    int val = 0;
 2568|   104k|    int count = 0;
 2569|       |
 2570|       |    /*
 2571|       |     * Using RAW/CUR/NEXT is okay since we are working on ASCII range here
 2572|       |     */
 2573|   104k|    if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2261|   104k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '&') && (NXT(1) == '#') &&
  ------------------
  |  | 2263|   104k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2573:9): [True: 104k, False: 0]
  |  Branch (2573:25): [True: 104k, False: 0]
  ------------------
 2574|   104k|        (NXT(2) == 'x')) {
  ------------------
  |  | 2263|   104k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2574:9): [True: 15.5k, False: 88.5k]
  ------------------
 2575|  15.5k|	SKIP(3);
  ------------------
  |  | 2285|  15.5k|#define SKIP(val) do {							\
  |  | 2286|  15.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  15.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 235, False: 15.3k]
  |  |  ------------------
  |  | 2288|  15.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  15.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 15.5k]
  |  |  ------------------
  ------------------
 2576|  15.5k|	GROW;
  ------------------
  |  | 2308|  15.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  15.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  15.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 10.9k, False: 4.56k]
  |  |  ------------------
  |  | 2309|  15.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  10.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 1.20k, False: 9.78k]
  |  |  ------------------
  |  | 2310|  15.5k|	xmlParserGrow(ctxt);
  ------------------
 2577|  67.3k|	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  67.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != ';') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  55.1k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2577:9): [True: 55.1k, False: 12.1k]
  |  Branch (2577:25): [True: 55.1k, False: 0]
  ------------------
 2578|  55.1k|	    if (count++ > 20) {
  ------------------
  |  Branch (2578:10): [True: 1.88k, False: 53.2k]
  ------------------
 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.52k, False: 358]
  |  |  ------------------
  |  | 2309|  1.88k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.52k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 460, False: 1.06k]
  |  |  ------------------
  |  | 2310|  1.88k|	xmlParserGrow(ctxt);
  ------------------
 2581|  1.88k|	    }
 2582|  55.1k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  55.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|  53.8k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2582:10): [True: 53.8k, False: 1.32k]
  |  Branch (2582:26): [True: 37.0k, False: 16.7k]
  ------------------
 2583|  37.0k|	        val = val * 16 + (CUR - '0');
  ------------------
  |  | 2262|  37.0k|#define CUR (*ctxt->input->cur)
  ------------------
 2584|  18.1k|	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  18.1k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'a') && (RAW <= 'f') && (count < 20))
  ------------------
  |  | 2261|  12.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2584:15): [True: 12.3k, False: 5.77k]
  |  Branch (2584:31): [True: 10.9k, False: 1.34k]
  |  Branch (2584:47): [True: 10.7k, False: 210]
  ------------------
 2585|  10.7k|	        val = val * 16 + (CUR - 'a') + 10;
  ------------------
  |  | 2262|  10.7k|#define CUR (*ctxt->input->cur)
  ------------------
 2586|  7.33k|	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  7.33k|#define RAW (*ctxt->input->cur)
  ------------------
              	    else if ((RAW >= 'A') && (RAW <= 'F') && (count < 20))
  ------------------
  |  | 2261|  5.80k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2586:15): [True: 5.80k, False: 1.52k]
  |  Branch (2586:31): [True: 4.21k, False: 1.59k]
  |  Branch (2586:47): [True: 3.97k, False: 241]
  ------------------
 2587|  3.97k|	        val = val * 16 + (CUR - 'A') + 10;
  ------------------
  |  | 2262|  3.97k|#define CUR (*ctxt->input->cur)
  ------------------
 2588|  3.36k|	    else {
 2589|  3.36k|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2590|  3.36k|		val = 0;
 2591|  3.36k|		break;
 2592|  3.36k|	    }
 2593|  51.7k|	    if (val > 0x110000)
  ------------------
  |  Branch (2593:10): [True: 20.5k, False: 31.1k]
  ------------------
 2594|  20.5k|	        val = 0x110000;
 2595|       |
 2596|  51.7k|	    NEXT;
  ------------------
  |  | 2316|  51.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2597|  51.7k|	    count++;
 2598|  51.7k|	}
 2599|  15.5k|	if (RAW == ';') {
  ------------------
  |  | 2261|  15.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2599:6): [True: 12.1k, False: 3.36k]
  ------------------
 2600|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2601|  12.1k|	    ctxt->input->col++;
 2602|  12.1k|	    ctxt->input->cur++;
 2603|  12.1k|	}
 2604|  88.5k|    } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2261|  88.5k|#define RAW (*ctxt->input->cur)
  ------------------
                  } else if  ((RAW == '&') && (NXT(1) == '#')) {
  ------------------
  |  | 2263|  88.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2604:17): [True: 88.5k, False: 0]
  |  Branch (2604:33): [True: 88.5k, False: 0]
  ------------------
 2605|  88.5k|	SKIP(2);
  ------------------
  |  | 2285|  88.5k|#define SKIP(val) do {							\
  |  | 2286|  88.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  88.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 471, False: 88.1k]
  |  |  ------------------
  |  | 2288|  88.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  88.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 88.5k]
  |  |  ------------------
  ------------------
 2606|  88.5k|	GROW;
  ------------------
  |  | 2308|  88.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  88.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  88.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 69.8k, False: 18.7k]
  |  |  ------------------
  |  | 2309|  88.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  69.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.8k, False: 58.9k]
  |  |  ------------------
  |  | 2310|  88.5k|	xmlParserGrow(ctxt);
  ------------------
 2607|   279k|	while (RAW != ';') { /* loop blocked by count */
  ------------------
  |  | 2261|   279k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2607:9): [True: 196k, False: 83.1k]
  ------------------
 2608|   196k|	    if (count++ > 20) {
  ------------------
  |  Branch (2608:10): [True: 1.48k, False: 194k]
  ------------------
 2609|  1.48k|		count = 0;
 2610|  1.48k|		GROW;
  ------------------
  |  | 2308|  1.48k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.48k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.48k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.20k, False: 282]
  |  |  ------------------
  |  | 2309|  1.48k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.20k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 912, False: 295]
  |  |  ------------------
  |  | 2310|  1.48k|	xmlParserGrow(ctxt);
  ------------------
 2611|  1.48k|	    }
 2612|   196k|	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   196k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW >= '0') && (RAW <= '9'))
  ------------------
  |  | 2261|   193k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2612:10): [True: 193k, False: 2.02k]
  |  Branch (2612:26): [True: 190k, False: 3.38k]
  ------------------
 2613|   190k|	        val = val * 10 + (CUR - '0');
  ------------------
  |  | 2262|   190k|#define CUR (*ctxt->input->cur)
  ------------------
 2614|  5.40k|	    else {
 2615|  5.40k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2616|  5.40k|		val = 0;
 2617|  5.40k|		break;
 2618|  5.40k|	    }
 2619|   190k|	    if (val > 0x110000)
  ------------------
  |  Branch (2619:10): [True: 15.7k, False: 174k]
  ------------------
 2620|  15.7k|	        val = 0x110000;
 2621|       |
 2622|   190k|	    NEXT;
  ------------------
  |  | 2316|   190k|#define NEXT xmlNextChar(ctxt)
  ------------------
 2623|   190k|	    count++;
 2624|   190k|	}
 2625|  88.5k|	if (RAW == ';') {
  ------------------
  |  | 2261|  88.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2625:6): [True: 83.1k, False: 5.40k]
  ------------------
 2626|       |	    /* on purpose to avoid reentrancy problems with NEXT and SKIP */
 2627|  83.1k|	    ctxt->input->col++;
 2628|  83.1k|	    ctxt->input->cur++;
 2629|  83.1k|	}
 2630|  88.5k|    } 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|   104k|    if (val >= 0x110000) {
  ------------------
  |  Branch (2641:9): [True: 961, False: 103k]
  ------------------
 2642|    961|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2643|    961|                "xmlParseCharRef: character reference out of bounds\n",
 2644|    961|	        val);
 2645|    961|        val = 0xFFFD;
 2646|   103k|    } else if (!IS_CHAR(val)) {
  ------------------
  |  |  115|   103k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   103k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 101k, False: 1.32k]
  |  |  |  |  ------------------
  |  |  |  |  118|   103k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   101k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 90.8k, False: 11.0k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 18.2k, False: 72.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   101k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 36.8k, False: 46.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   101k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 35.0k, False: 11.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   103k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.32k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 523, False: 802]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.32k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 723, False: 79]
  |  |  |  |  |  Branch (120:26): [True: 261, False: 462]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.32k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 387, False: 154]
  |  |  |  |  |  Branch (121:27): [True: 387, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2646:16): [True: 11.8k, False: 91.3k]
  ------------------
 2647|  11.8k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2648|  11.8k|                          "xmlParseCharRef: invalid xmlChar value %d\n",
 2649|  11.8k|	                  val);
 2650|  11.8k|    }
 2651|   104k|    return(val);
 2652|   104k|}
xmlScanName:
 3088|  3.82M|xmlScanName(const xmlChar *ptr, size_t maxSize, int flags) {
 3089|  3.82M|    int stop = flags & XML_SCAN_NC ? ':' : 0;
  ------------------
  |  |   69|  3.82M|#define XML_SCAN_NC         1
  ------------------
  |  Branch (3089:16): [True: 97.3k, False: 3.73M]
  ------------------
 3090|  3.82M|    int old10 = flags & XML_SCAN_OLD10 ? 1 : 0;
  ------------------
  |  |   71|  3.82M|#define XML_SCAN_OLD10      4
  ------------------
  |  Branch (3090:17): [True: 1.80M, False: 2.02M]
  ------------------
 3091|       |
 3092|  14.3M|    while (1) {
  ------------------
  |  Branch (3092:12): [True: 14.3M, Folded]
  ------------------
 3093|  14.3M|        int c, len;
 3094|       |
 3095|  14.3M|        c = *ptr;
 3096|  14.3M|        if (c < 0x80) {
  ------------------
  |  Branch (3096:13): [True: 12.5M, False: 1.87M]
  ------------------
 3097|  12.5M|            if (c == stop)
  ------------------
  |  Branch (3097:17): [True: 73.4k, False: 12.4M]
  ------------------
 3098|  73.4k|                break;
 3099|  12.4M|            len = 1;
 3100|  12.4M|        } else {
 3101|  1.87M|            len = 4;
 3102|  1.87M|            c = xmlGetUTF8Char(ptr, &len);
 3103|  1.87M|            if (c < 0)
  ------------------
  |  Branch (3103:17): [True: 4.89k, False: 1.86M]
  ------------------
 3104|  4.89k|                break;
 3105|  1.87M|        }
 3106|       |
 3107|  14.3M|        if (flags & XML_SCAN_NMTOKEN ?
  ------------------
  |  |   70|  14.3M|#define XML_SCAN_NMTOKEN    2
  ------------------
  |  Branch (3107:13): [True: 10.5M, False: 3.76M]
  |  Branch (3107:13): [True: 3.75M, False: 10.5M]
  ------------------
 3108|  10.5M|                !xmlIsNameChar(c, old10) :
 3109|  14.3M|                !xmlIsNameStartChar(c, old10))
 3110|  3.75M|            break;
 3111|       |
 3112|  10.5M|        if ((size_t) len > maxSize)
  ------------------
  |  Branch (3112:13): [True: 66, False: 10.5M]
  ------------------
 3113|     66|            return(NULL);
 3114|  10.5M|        ptr += len;
 3115|  10.5M|        maxSize -= len;
 3116|  10.5M|        flags |= XML_SCAN_NMTOKEN;
  ------------------
  |  |   70|  10.5M|#define XML_SCAN_NMTOKEN    2
  ------------------
 3117|  10.5M|    }
 3118|       |
 3119|  3.82M|    return(ptr);
 3120|  3.82M|}
xmlParseName:
 3187|  3.10M|xmlParseName(xmlParserCtxt *ctxt) {
 3188|  3.10M|    const xmlChar *in;
 3189|  3.10M|    const xmlChar *ret;
 3190|  3.10M|    size_t count = 0;
 3191|  3.10M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3191:24): [True: 1.21M, False: 1.89M]
  ------------------
 3192|  1.21M|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.21M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3193|  3.10M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.99M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3194|       |
 3195|  3.10M|    GROW;
  ------------------
  |  | 2308|  3.10M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  3.10M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  3.10M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 1.88M, False: 1.21M]
  |  |  ------------------
  |  | 2309|  3.10M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  1.88M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 655k, False: 1.23M]
  |  |  ------------------
  |  | 2310|  3.10M|	xmlParserGrow(ctxt);
  ------------------
 3196|       |
 3197|       |    /*
 3198|       |     * Accelerator for simple ASCII names
 3199|       |     */
 3200|  3.10M|    in = ctxt->input->cur;
 3201|  3.10M|    if (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3201:10): [True: 2.77M, False: 327k]
  |  Branch (3201:27): [True: 2.74M, False: 36.6k]
  ------------------
 3202|   364k|	((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3202:3): [True: 150k, False: 214k]
  |  Branch (3202:20): [True: 109k, False: 40.1k]
  ------------------
 3203|  2.85M|	(*in == '_') || (*in == ':')) {
  ------------------
  |  Branch (3203:2): [True: 1.34k, False: 252k]
  |  Branch (3203:18): [True: 6.23k, False: 246k]
  ------------------
 3204|  2.85M|	in++;
 3205|  19.0M|	while (((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3205:10): [True: 4.49M, False: 14.5M]
  |  Branch (3205:27): [True: 4.43M, False: 63.8k]
  ------------------
 3206|  14.5M|	       ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3206:10): [True: 8.03M, False: 6.56M]
  |  Branch (3206:27): [True: 7.95M, False: 81.4k]
  ------------------
 3207|  6.64M|	       ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3207:10): [True: 5.64M, False: 1.00M]
  |  Branch (3207:27): [True: 3.45M, False: 2.18M]
  ------------------
 3208|  3.19M|	       (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3208:9): [True: 4.67k, False: 3.18M]
  |  Branch (3208:25): [True: 105k, False: 3.08M]
  ------------------
 3209|  3.08M|	       (*in == ':') || (*in == '.'))
  ------------------
  |  Branch (3209:9): [True: 205k, False: 2.87M]
  |  Branch (3209:25): [True: 16.0k, False: 2.85M]
  ------------------
 3210|  16.1M|	    in++;
 3211|  2.85M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3211:6): [True: 2.81M, False: 39.4k]
  |  Branch (3211:19): [True: 2.79M, False: 20.2k]
  ------------------
 3212|  2.79M|	    count = in - ctxt->input->cur;
 3213|  2.79M|            if (count > maxLength) {
  ------------------
  |  Branch (3213:17): [True: 82, False: 2.79M]
  ------------------
 3214|     82|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3215|     82|                return(NULL);
 3216|     82|            }
 3217|  2.79M|	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
 3218|  2.79M|	    ctxt->input->cur = in;
 3219|  2.79M|	    ctxt->input->col += count;
 3220|  2.79M|	    if (ret == NULL)
  ------------------
  |  Branch (3220:10): [True: 5, False: 2.79M]
  ------------------
 3221|      5|	        xmlErrMemory(ctxt);
 3222|  2.79M|	    return(ret);
 3223|  2.79M|	}
 3224|  2.85M|    }
 3225|       |    /* accelerator for special cases */
 3226|   306k|    return(xmlParseNameComplex(ctxt));
 3227|  3.10M|}
xmlParseNmtoken:
 3417|  33.8k|xmlParseNmtoken(xmlParserCtxt *ctxt) {
 3418|  33.8k|    xmlChar buf[XML_MAX_NAMELEN + 5];
 3419|  33.8k|    xmlChar *ret;
 3420|  33.8k|    int len = 0, l;
 3421|  33.8k|    int c;
 3422|  33.8k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3422:21): [True: 14.8k, False: 18.9k]
  ------------------
 3423|  14.8k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  14.8k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3424|  33.8k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  18.9k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3425|  33.8k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3425:17): [True: 13.2k, False: 20.6k]
  ------------------
 3426|       |
 3427|  33.8k|    c = xmlCurrentChar(ctxt, &l);
 3428|       |
 3429|   160k|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3429:12): [True: 127k, False: 33.0k]
  ------------------
 3430|   127k|	COPY_BUF(buf, len, c);
  ------------------
  |  | 2333|   127k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 100k, False: 26.7k]
  |  |  ------------------
  |  | 2334|   127k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3431|   127k|	NEXTL(l);
  ------------------
  |  | 2325|   127k|#define NEXTL(l) do {							\
  |  | 2326|   127k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 127k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   127k|    } else ctxt->input->col++;						\
  |  | 2329|   127k|    ctxt->input->cur += l;				\
  |  | 2330|   127k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 127k]
  |  |  ------------------
  ------------------
 3432|   127k|	c = xmlCurrentChar(ctxt, &l);
 3433|   127k|	if (len >= XML_MAX_NAMELEN) {
  ------------------
  |  |   87|   127k|#define XML_MAX_NAMELEN 100
  ------------------
  |  Branch (3433:6): [True: 790, False: 126k]
  ------------------
 3434|       |	    /*
 3435|       |	     * Okay someone managed to make a huge token, so he's ready to pay
 3436|       |	     * for the processing speed.
 3437|       |	     */
 3438|    790|	    xmlChar *buffer;
 3439|    790|	    int max = len * 2;
 3440|       |
 3441|    790|	    buffer = xmlMalloc(max);
 3442|    790|	    if (buffer == NULL) {
  ------------------
  |  Branch (3442:10): [True: 1, False: 789]
  ------------------
 3443|      1|	        xmlErrMemory(ctxt);
 3444|      1|		return(NULL);
 3445|      1|	    }
 3446|    789|	    memcpy(buffer, buf, len);
 3447|  3.48M|	    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3447:13): [True: 3.48M, False: 726]
  ------------------
 3448|  3.48M|		if (len + 10 > max) {
  ------------------
  |  Branch (3448:7): [True: 2.26k, False: 3.48M]
  ------------------
 3449|  2.26k|		    xmlChar *tmp;
 3450|  2.26k|                    int newSize;
 3451|       |
 3452|  2.26k|                    newSize = xmlGrowCapacity(max, 1, 1, maxLength);
 3453|  2.26k|                    if (newSize < 0) {
  ------------------
  |  Branch (3453:25): [True: 62, False: 2.20k]
  ------------------
 3454|     62|                        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3455|     62|                        xmlFree(buffer);
 3456|     62|                        return(NULL);
 3457|     62|                    }
 3458|  2.20k|		    tmp = xmlRealloc(buffer, newSize);
 3459|  2.20k|		    if (tmp == NULL) {
  ------------------
  |  Branch (3459:11): [True: 1, False: 2.20k]
  ------------------
 3460|      1|			xmlErrMemory(ctxt);
 3461|      1|			xmlFree(buffer);
 3462|      1|			return(NULL);
 3463|      1|		    }
 3464|  2.20k|		    buffer = tmp;
 3465|  2.20k|                    max = newSize;
 3466|  2.20k|		}
 3467|  3.48M|		COPY_BUF(buffer, len, c);
  ------------------
  |  | 2333|  3.48M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 978k, False: 2.50M]
  |  |  ------------------
  |  | 2334|  3.48M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 3468|  3.48M|		NEXTL(l);
  ------------------
  |  | 2325|  3.48M|#define NEXTL(l) do {							\
  |  | 2326|  3.48M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 3.48M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  3.48M|    } else ctxt->input->col++;						\
  |  | 2329|  3.48M|    ctxt->input->cur += l;				\
  |  | 2330|  3.48M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 3.48M]
  |  |  ------------------
  ------------------
 3469|  3.48M|		c = xmlCurrentChar(ctxt, &l);
 3470|  3.48M|	    }
 3471|    726|	    buffer[len] = 0;
 3472|    726|	    return(buffer);
 3473|    789|	}
 3474|   127k|    }
 3475|  33.0k|    if (len == 0)
  ------------------
  |  Branch (3475:9): [True: 3.15k, False: 29.9k]
  ------------------
 3476|  3.15k|        return(NULL);
 3477|  29.9k|    if (len > maxLength) {
  ------------------
  |  Branch (3477:9): [True: 0, False: 29.9k]
  ------------------
 3478|      0|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
 3479|      0|        return(NULL);
 3480|      0|    }
 3481|  29.9k|    ret = xmlStrndup(buf, len);
 3482|  29.9k|    if (ret == NULL)
  ------------------
  |  Branch (3482:9): [True: 2, False: 29.9k]
  ------------------
 3483|      2|        xmlErrMemory(ctxt);
 3484|  29.9k|    return(ret);
 3485|  29.9k|}
xmlParseEntityValue:
 3647|   136k|xmlParseEntityValue(xmlParserCtxt *ctxt, xmlChar **orig) {
 3648|   136k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3648:26): [True: 33.2k, False: 103k]
  ------------------
 3649|  33.2k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  33.2k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 3650|   136k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   240k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3651|   136k|    xmlSBuf buf;
 3652|   136k|    const xmlChar *start;
 3653|   136k|    int quote, length;
 3654|       |
 3655|   136k|    xmlSBufInit(&buf, maxLength);
 3656|       |
 3657|   136k|    GROW;
  ------------------
  |  | 2308|   136k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   136k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   136k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 125k, False: 11.5k]
  |  |  ------------------
  |  | 2309|   136k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   125k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 27.5k, False: 97.6k]
  |  |  ------------------
  |  | 2310|   136k|	xmlParserGrow(ctxt);
  ------------------
 3658|       |
 3659|   136k|    quote = CUR;
  ------------------
  |  | 2262|   136k|#define CUR (*ctxt->input->cur)
  ------------------
 3660|   136k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (3660:9): [True: 3.39k, False: 133k]
  |  Branch (3660:27): [True: 0, False: 3.39k]
  ------------------
 3661|      0|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 3662|      0|	return(NULL);
 3663|      0|    }
 3664|   136k|    CUR_PTR++;
  ------------------
  |  | 2264|   136k|#define CUR_PTR ctxt->input->cur
  ------------------
 3665|       |
 3666|   136k|    length = 0;
 3667|       |
 3668|       |    /*
 3669|       |     * Copy raw content of the entity into a buffer
 3670|       |     */
 3671|   139M|    while (1) {
  ------------------
  |  Branch (3671:12): [True: 139M, Folded]
  ------------------
 3672|   139M|        int c;
 3673|       |
 3674|   139M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   139M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 4, False: 139M]
  |  |  ------------------
  ------------------
 3675|      4|            goto error;
 3676|       |
 3677|   139M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   139M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3677:13): [True: 3.90k, False: 139M]
  ------------------
 3678|  3.90k|            xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_NOT_FINISHED, NULL);
 3679|  3.90k|            goto error;
 3680|  3.90k|        }
 3681|       |
 3682|   139M|        c = CUR;
  ------------------
  |  | 2262|   139M|#define CUR (*ctxt->input->cur)
  ------------------
 3683|       |
 3684|   139M|        if (c == 0) {
  ------------------
  |  Branch (3684:13): [True: 287, False: 139M]
  ------------------
 3685|    287|            xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3686|    287|                    "invalid character in entity value\n");
 3687|    287|            goto error;
 3688|    287|        }
 3689|   139M|        if (c == quote)
  ------------------
  |  Branch (3689:13): [True: 132k, False: 139M]
  ------------------
 3690|   132k|            break;
 3691|   139M|        NEXTL(1);
  ------------------
  |  | 2325|   139M|#define NEXTL(l) do {							\
  |  | 2326|   139M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.31M, False: 137M]
  |  |  ------------------
  |  | 2327|  2.31M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   137M|    } else ctxt->input->col++;						\
  |  | 2329|   139M|    ctxt->input->cur += l;				\
  |  | 2330|   139M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 139M]
  |  |  ------------------
  ------------------
 3692|   139M|        length += 1;
 3693|       |
 3694|       |        /*
 3695|       |         * TODO: Check growth threshold
 3696|       |         */
 3697|   139M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   139M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (3697:13): [True: 75.0k, False: 139M]
  ------------------
 3698|  75.0k|            GROW;
  ------------------
  |  | 2308|  75.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  75.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  75.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 72.1k, False: 2.85k]
  |  |  ------------------
  |  | 2309|  75.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  72.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 72.1k, False: 0]
  |  |  ------------------
  |  | 2310|  75.0k|	xmlParserGrow(ctxt);
  ------------------
 3699|   139M|    }
 3700|       |
 3701|   132k|    start = CUR_PTR - length;
  ------------------
  |  | 2264|   132k|#define CUR_PTR ctxt->input->cur
  ------------------
 3702|       |
 3703|   132k|    if (orig != NULL) {
  ------------------
  |  Branch (3703:9): [True: 132k, False: 0]
  ------------------
 3704|   132k|        *orig = xmlStrndup(start, length);
 3705|   132k|        if (*orig == NULL)
  ------------------
  |  Branch (3705:13): [True: 3, False: 132k]
  ------------------
 3706|      3|            xmlErrMemory(ctxt);
 3707|   132k|    }
 3708|       |
 3709|   132k|    xmlExpandPEsInEntityValue(ctxt, &buf, start, length, ctxt->inputNr);
 3710|       |
 3711|   132k|    NEXTL(1);
  ------------------
  |  | 2325|   132k|#define NEXTL(l) do {							\
  |  | 2326|   132k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 132k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   132k|    } else ctxt->input->col++;						\
  |  | 2329|   132k|    ctxt->input->cur += l;				\
  |  | 2330|   132k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 132k]
  |  |  ------------------
  ------------------
 3712|       |
 3713|   132k|    return(xmlSBufFinish(&buf, NULL, ctxt, "entity length too long"));
 3714|       |
 3715|  4.19k|error:
 3716|  4.19k|    xmlSBufCleanup(&buf, ctxt, "entity length too long");
 3717|       |    return(NULL);
 3718|   136k|}
xmlExpandEntitiesInAttValue:
 4000|  19.9k|                            int normalize) {
 4001|  19.9k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4001:26): [True: 9.85k, False: 10.0k]
  ------------------
 4002|  9.85k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  9.85k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4003|  19.9k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  29.9k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4004|  19.9k|    xmlSBuf buf;
 4005|  19.9k|    int inSpace = 1;
 4006|       |
 4007|  19.9k|    xmlSBufInit(&buf, maxLength);
 4008|       |
 4009|  19.9k|    xmlExpandEntityInAttValue(ctxt, &buf, str, NULL, normalize, &inSpace,
 4010|  19.9k|                              ctxt->inputNr, /* check */ 0);
 4011|       |
 4012|  19.9k|    if ((normalize) && (inSpace) && (buf.size > 0))
  ------------------
  |  Branch (4012:9): [True: 0, False: 19.9k]
  |  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|  19.9k|}
xmlParseAttValue:
 4333|   207k|xmlParseAttValue(xmlParserCtxt *ctxt) {
 4334|   207k|    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
  ------------------
  |  Branch (4334:9): [True: 0, False: 207k]
  |  Branch (4334:27): [True: 0, False: 207k]
  ------------------
 4335|   207k|    return(xmlParseAttValueInternal(ctxt, NULL, NULL, 0, 0));
 4336|   207k|}
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.3k, False: 11.1k]
  ------------------
 4356|  10.3k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  10.3k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4357|  21.5k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  11.1k|#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.76k]
  ------------------
 4361|  11.7k|        NEXT;
  ------------------
  |  | 2316|  11.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4362|  11.7k|	stop = '"';
 4363|  11.7k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  9.76k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4363:16): [True: 6.43k, False: 3.32k]
  ------------------
 4364|  6.43k|        NEXT;
  ------------------
  |  | 2316|  6.43k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4365|  6.43k|	stop = '\'';
 4366|  6.43k|    } else {
 4367|  3.32k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4368|  3.32k|	return(NULL);
 4369|  3.32k|    }
 4370|       |
 4371|  18.1k|    buf = xmlMalloc(size);
 4372|  18.1k|    if (buf == NULL) {
  ------------------
  |  Branch (4372:9): [True: 2, False: 18.1k]
  ------------------
 4373|      2|        xmlErrMemory(ctxt);
 4374|      2|	return(NULL);
 4375|      2|    }
 4376|  18.1k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4377|  4.73M|    while ((IS_CHAR(cur)) && (cur != stop)) { /* checked */
  ------------------
  |  |  115|  4.73M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  4.73M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 915k, False: 3.82M]
  |  |  |  |  ------------------
  |  |  |  |  118|  4.73M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   915k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 913k, False: 2.39k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 3.59k, False: 910k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   915k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 912k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   915k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 910k, False: 2.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  4.73M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3.82M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.38k, False: 3.82M]
  |  |  |  |  ------------------
  |  |  |  |  120|  3.82M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3.82M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.81M, False: 714]
  |  |  |  |  ------------------
  |  |  |  |  121|  3.82M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 711, False: 3]
  |  |  |  |  |  Branch (121:27): [True: 711, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4377:12): [True: 4.73M, False: 2.40k]
  |  Branch (4377:30): [True: 4.72M, False: 15.7k]
  ------------------
 4378|  4.72M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4378:6): [True: 3.73k, False: 4.71M]
  ------------------
 4379|  3.73k|	    xmlChar *tmp;
 4380|  3.73k|            int newSize;
 4381|       |
 4382|  3.73k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4383|  3.73k|            if (newSize < 0) {
  ------------------
  |  Branch (4383:17): [True: 40, False: 3.69k]
  ------------------
 4384|     40|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
 4385|     40|                xmlFree(buf);
 4386|     40|                return(NULL);
 4387|     40|            }
 4388|  3.69k|	    tmp = xmlRealloc(buf, newSize);
 4389|  3.69k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4389:10): [True: 2, False: 3.69k]
  ------------------
 4390|      2|	        xmlFree(buf);
 4391|      2|		xmlErrMemory(ctxt);
 4392|      2|		return(NULL);
 4393|      2|	    }
 4394|  3.69k|	    buf = tmp;
 4395|  3.69k|            size = newSize;
 4396|  3.69k|	}
 4397|  4.72M|	COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  4.72M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 177k, False: 4.54M]
  |  |  ------------------
  |  | 2334|  4.72M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4398|  4.72M|	NEXTL(l);
  ------------------
  |  | 2325|  4.72M|#define NEXTL(l) do {							\
  |  | 2326|  4.72M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.73k, False: 4.71M]
  |  |  ------------------
  |  | 2327|  2.73k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  4.71M|    } else ctxt->input->col++;						\
  |  | 2329|  4.72M|    ctxt->input->cur += l;				\
  |  | 2330|  4.72M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 4.72M]
  |  |  ------------------
  ------------------
 4399|  4.72M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4400|  4.72M|    }
 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: 3]
  |  |  |  |  ------------------
  |  |  |  |  118|  18.1k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  18.1k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 15.7k, False: 2.39k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 15.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  18.1k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  18.1k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 15.7k, False: 2.39k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  18.1k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 3, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  120|      3|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 3, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  |  |  121|      3|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 3]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4402:9): [True: 2.40k, False: 15.7k]
  ------------------
 4403|  2.40k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4404|  15.7k|    } else {
 4405|  15.7k|	NEXT;
  ------------------
  |  | 2316|  15.7k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4406|  15.7k|    }
 4407|  18.1k|    return(buf);
 4408|  18.1k|}
xmlParsePubidLiteral:
 4422|  7.18k|xmlParsePubidLiteral(xmlParserCtxt *ctxt) {
 4423|  7.18k|    xmlChar *buf = NULL;
 4424|  7.18k|    int len = 0;
 4425|  7.18k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  7.18k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4426|  7.18k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4426:21): [True: 2.87k, False: 4.31k]
  ------------------
 4427|  2.87k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.87k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4428|  7.18k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.31k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 4429|  7.18k|    xmlChar cur;
 4430|  7.18k|    xmlChar stop;
 4431|       |
 4432|  7.18k|    if (RAW == '"') {
  ------------------
  |  | 2261|  7.18k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4432:9): [True: 995, False: 6.19k]
  ------------------
 4433|    995|        NEXT;
  ------------------
  |  | 2316|    995|#define NEXT xmlNextChar(ctxt)
  ------------------
 4434|    995|	stop = '"';
 4435|  6.19k|    } else if (RAW == '\'') {
  ------------------
  |  | 2261|  6.19k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (4435:16): [True: 5.05k, False: 1.14k]
  ------------------
 4436|  5.05k|        NEXT;
  ------------------
  |  | 2316|  5.05k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4437|  5.05k|	stop = '\'';
 4438|  5.05k|    } else {
 4439|  1.14k|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_STARTED, NULL);
 4440|  1.14k|	return(NULL);
 4441|  1.14k|    }
 4442|  6.04k|    buf = xmlMalloc(size);
 4443|  6.04k|    if (buf == NULL) {
  ------------------
  |  Branch (4443:9): [True: 1, False: 6.04k]
  ------------------
 4444|      1|	xmlErrMemory(ctxt);
 4445|      1|	return(NULL);
 4446|      1|    }
 4447|  6.04k|    cur = CUR;
  ------------------
  |  | 2262|  6.04k|#define CUR (*ctxt->input->cur)
  ------------------
 4448|  1.03M|    while ((IS_PUBIDCHAR_CH(cur)) && (cur != stop) &&
  ------------------
  |  |  246|  1.03M|#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
  |  |  ------------------
  |  |  |  |  180|  1.03M|#define xmlIsPubidChar_ch(c)	(xmlIsPubidChar_tab[(c)])
  |  |  ------------------
  ------------------
  |  Branch (4448:12): [True: 1.03M, False: 1.31k]
  |  Branch (4448:38): [True: 1.03M, False: 4.72k]
  ------------------
 4449|  1.03M|           (PARSER_STOPPED(ctxt) == 0)) { /* checked */
  ------------------
  |  |   44|  1.03M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (4449:12): [True: 1.03M, False: 1]
  ------------------
 4450|  1.03M|	if (len + 1 >= size) {
  ------------------
  |  Branch (4450:6): [True: 483, False: 1.03M]
  ------------------
 4451|    483|	    xmlChar *tmp;
 4452|    483|            int newSize;
 4453|       |
 4454|    483|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4455|    483|            if (newSize < 0) {
  ------------------
  |  Branch (4455:17): [True: 1, False: 482]
  ------------------
 4456|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
 4457|      1|                xmlFree(buf);
 4458|      1|                return(NULL);
 4459|      1|            }
 4460|    482|	    tmp = xmlRealloc(buf, newSize);
 4461|    482|	    if (tmp == NULL) {
  ------------------
  |  Branch (4461:10): [True: 1, False: 481]
  ------------------
 4462|      1|		xmlErrMemory(ctxt);
 4463|      1|		xmlFree(buf);
 4464|      1|		return(NULL);
 4465|      1|	    }
 4466|    481|	    buf = tmp;
 4467|    481|            size = newSize;
 4468|    481|	}
 4469|  1.03M|	buf[len++] = cur;
 4470|  1.03M|	NEXT;
  ------------------
  |  | 2316|  1.03M|#define NEXT xmlNextChar(ctxt)
  ------------------
 4471|  1.03M|	cur = CUR;
  ------------------
  |  | 2262|  1.03M|#define CUR (*ctxt->input->cur)
  ------------------
 4472|  1.03M|    }
 4473|  6.04k|    buf[len] = 0;
 4474|  6.04k|    if (cur != stop) {
  ------------------
  |  Branch (4474:9): [True: 501, False: 5.54k]
  ------------------
 4475|    501|	xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
 4476|  5.54k|    } else {
 4477|  5.54k|	NEXTL(1);
  ------------------
  |  | 2325|  5.54k|#define NEXTL(l) do {							\
  |  | 2326|  5.54k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 5.54k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.54k|    } else ctxt->input->col++;						\
  |  | 2329|  5.54k|    ctxt->input->cur += l;				\
  |  | 2330|  5.54k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.54k]
  |  |  ------------------
  ------------------
 4478|  5.54k|    }
 4479|  6.04k|    return(buf);
 4480|  6.04k|}
xmlParseExternalID:
 4792|  43.6k|xmlParseExternalID(xmlParserCtxt *ctxt, xmlChar **publicId, int strict) {
 4793|  43.6k|    xmlChar *URI = NULL;
 4794|       |
 4795|  43.6k|    *publicId = NULL;
 4796|  43.6k|    if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
  ------------------
  |  | 2273|  43.6k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  87.2k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  87.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 15.9k, False: 27.6k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 15.9k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  43.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 15.9k, False: 3]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 15.9k, False: 8]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 15.9k, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 15.9k, False: 2]
  |  |  ------------------
  ------------------
 4797|  15.9k|        SKIP(6);
  ------------------
  |  | 2285|  15.9k|#define SKIP(val) do {							\
  |  | 2286|  15.9k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  15.9k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 210, False: 15.7k]
  |  |  ------------------
  |  | 2288|  15.9k|        xmlParserGrow(ctxt);						\
  |  | 2289|  15.9k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 15.9k]
  |  |  ------------------
  ------------------
 4798|  15.9k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  15.9k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4798:6): [True: 1.86k, False: 14.0k]
  ------------------
 4799|  1.86k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4800|  1.86k|	                   "Space required after 'SYSTEM'\n");
 4801|  1.86k|	}
 4802|  15.9k|	URI = xmlParseSystemLiteral(ctxt);
 4803|  15.9k|	if (URI == NULL) {
  ------------------
  |  Branch (4803:6): [True: 1.97k, False: 13.9k]
  ------------------
 4804|  1.97k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4805|  1.97k|        }
 4806|  27.7k|    } else if (CMP6(CUR_PTR, 'P', 'U', 'B', 'L', 'I', 'C')) {
  ------------------
  |  | 2273|  27.7k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  55.4k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  55.4k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.21k, False: 20.4k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.20k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  27.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.20k, False: 7]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.19k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.18k, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 7.18k, False: 1]
  |  |  ------------------
  ------------------
 4807|  7.18k|        SKIP(6);
  ------------------
  |  | 2285|  7.18k|#define SKIP(val) do {							\
  |  | 2286|  7.18k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.18k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 112, False: 7.07k]
  |  |  ------------------
  |  | 2288|  7.18k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.18k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.18k]
  |  |  ------------------
  ------------------
 4808|  7.18k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  7.18k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4808:6): [True: 1.49k, False: 5.69k]
  ------------------
 4809|  1.49k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4810|  1.49k|		    "Space required after 'PUBLIC'\n");
 4811|  1.49k|	}
 4812|  7.18k|	*publicId = xmlParsePubidLiteral(ctxt);
 4813|  7.18k|	if (*publicId == NULL) {
  ------------------
  |  Branch (4813:6): [True: 1.14k, False: 6.04k]
  ------------------
 4814|  1.14k|	    xmlFatalErr(ctxt, XML_ERR_PUBID_REQUIRED, NULL);
 4815|  1.14k|	}
 4816|  7.18k|	if (strict) {
  ------------------
  |  Branch (4816:6): [True: 5.52k, False: 1.66k]
  ------------------
 4817|       |	    /*
 4818|       |	     * We don't handle [83] so "S SystemLiteral" is required.
 4819|       |	     */
 4820|  5.52k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  5.52k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4820:10): [True: 2.02k, False: 3.50k]
  ------------------
 4821|  2.02k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 4822|  2.02k|			"Space required after the Public Identifier\n");
 4823|  2.02k|	    }
 4824|  5.52k|	} 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.66k|	    if (SKIP_BLANKS == 0) return(NULL);
  ------------------
  |  | 2312|  1.66k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (4831:10): [True: 1.51k, False: 148]
  ------------------
 4832|    148|	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|    148|#define CUR (*ctxt->input->cur)
  ------------------
              	    if ((CUR != '\'') && (CUR != '"')) return(NULL);
  ------------------
  |  | 2262|     98|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4832:10): [True: 98, False: 50]
  |  Branch (4832:27): [True: 88, False: 10]
  ------------------
 4833|    148|	}
 4834|  5.58k|	URI = xmlParseSystemLiteral(ctxt);
 4835|  5.58k|	if (URI == NULL) {
  ------------------
  |  Branch (4835:6): [True: 1.39k, False: 4.18k]
  ------------------
 4836|  1.39k|	    xmlFatalErr(ctxt, XML_ERR_URI_REQUIRED, NULL);
 4837|  1.39k|        }
 4838|  5.58k|    }
 4839|  42.0k|    return(URI);
 4840|  43.6k|}
xmlParseComment:
 4969|   405k|xmlParseComment(xmlParserCtxt *ctxt) {
 4970|   405k|    xmlChar *buf = NULL;
 4971|   405k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   405k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4972|   405k|    size_t len = 0;
 4973|   405k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4973:24): [True: 126k, False: 279k]
  ------------------
 4974|   126k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   126k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4975|   405k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   685k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4976|   405k|    const xmlChar *in;
 4977|   405k|    size_t nbchar = 0;
 4978|   405k|    int ccol;
 4979|       |
 4980|       |    /*
 4981|       |     * Check that there is a comment right here.
 4982|       |     */
 4983|   405k|    if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2261|   405k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   405k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4983:9): [True: 0, False: 405k]
  |  Branch (4983:25): [True: 0, False: 405k]
  ------------------
 4984|      0|        return;
 4985|   405k|    SKIP(2);
  ------------------
  |  | 2285|   405k|#define SKIP(val) do {							\
  |  | 2286|   405k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   405k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 405k]
  |  |  ------------------
  |  | 2288|   405k|        xmlParserGrow(ctxt);						\
  |  | 2289|   405k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 405k]
  |  |  ------------------
  ------------------
 4986|   405k|    if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2261|   405k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '-') || (NXT(1) != '-'))
  ------------------
  |  | 2263|   405k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4986:9): [True: 0, False: 405k]
  |  Branch (4986:25): [True: 10, False: 405k]
  ------------------
 4987|     10|        return;
 4988|   405k|    SKIP(2);
  ------------------
  |  | 2285|   405k|#define SKIP(val) do {							\
  |  | 2286|   405k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   405k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 353, False: 405k]
  |  |  ------------------
  |  | 2288|   405k|        xmlParserGrow(ctxt);						\
  |  | 2289|   405k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 405k]
  |  |  ------------------
  ------------------
 4989|   405k|    GROW;
  ------------------
  |  | 2308|   405k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   405k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   405k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 271k, False: 134k]
  |  |  ------------------
  |  | 2309|   405k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   271k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 120k, False: 151k]
  |  |  ------------------
  |  | 2310|   405k|	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|   405k|    in = ctxt->input->cur;
 4996|   406k|    do {
 4997|   406k|	if (*in == 0xA) {
  ------------------
  |  Branch (4997:6): [True: 424, False: 406k]
  ------------------
 4998|  4.33k|	    do {
 4999|  4.33k|		ctxt->input->line++; ctxt->input->col = 1;
 5000|  4.33k|		in++;
 5001|  4.33k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5001:15): [True: 3.90k, False: 424]
  ------------------
 5002|    424|	}
 5003|   895k|get_more:
 5004|   895k|        ccol = ctxt->input->col;
 5005|  6.67M|	while (((*in > '-') && (*in <= 0x7F)) ||
  ------------------
  |  Branch (5005:10): [True: 4.81M, False: 1.86M]
  |  Branch (5005:25): [True: 4.74M, False: 70.3k]
  ------------------
 5006|  1.93M|	       ((*in >= 0x20) && (*in < '-')) ||
  ------------------
  |  Branch (5006:10): [True: 1.78M, False: 142k]
  |  Branch (5006:27): [True: 1.02M, False: 764k]
  ------------------
 5007|  5.78M|	       (*in == 0x09)) {
  ------------------
  |  Branch (5007:9): [True: 12.0k, False: 895k]
  ------------------
 5008|  5.78M|		    in++;
 5009|  5.78M|		    ccol++;
 5010|  5.78M|	}
 5011|   895k|	ctxt->input->col = ccol;
 5012|   895k|	if (*in == 0xA) {
  ------------------
  |  Branch (5012:6): [True: 34.6k, False: 860k]
  ------------------
 5013|   253k|	    do {
 5014|   253k|		ctxt->input->line++; ctxt->input->col = 1;
 5015|   253k|		in++;
 5016|   253k|	    } while (*in == 0xA);
  ------------------
  |  Branch (5016:15): [True: 218k, False: 34.6k]
  ------------------
 5017|  34.6k|	    goto get_more;
 5018|  34.6k|	}
 5019|   860k|	nbchar = in - ctxt->input->cur;
 5020|       |	/*
 5021|       |	 * save current set of data
 5022|       |	 */
 5023|   860k|	if (nbchar > 0) {
  ------------------
  |  Branch (5023:6): [True: 599k, False: 260k]
  ------------------
 5024|   599k|            if (nbchar > maxLength - len) {
  ------------------
  |  Branch (5024:17): [True: 0, False: 599k]
  ------------------
 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|   599k|            if (buf == NULL) {
  ------------------
  |  Branch (5030:17): [True: 187k, False: 412k]
  ------------------
 5031|   187k|                if ((*in == '-') && (in[1] == '-'))
  ------------------
  |  Branch (5031:21): [True: 99.9k, False: 87.4k]
  |  Branch (5031:37): [True: 62.0k, False: 37.9k]
  ------------------
 5032|  62.0k|                    size = nbchar + 1;
 5033|   125k|                else
 5034|   125k|                    size = XML_PARSER_BUFFER_SIZE + nbchar;
  ------------------
  |  |  172|   125k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5035|   187k|                buf = xmlMalloc(size);
 5036|   187k|                if (buf == NULL) {
  ------------------
  |  Branch (5036:21): [True: 2, False: 187k]
  ------------------
 5037|      2|                    xmlErrMemory(ctxt);
 5038|      2|                    return;
 5039|      2|                }
 5040|   187k|                len = 0;
 5041|   412k|            } else if (len + nbchar + 1 >= size) {
  ------------------
  |  Branch (5041:24): [True: 12.7k, False: 399k]
  ------------------
 5042|  12.7k|                xmlChar *new_buf;
 5043|  12.7k|                size += len + nbchar + XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  12.7k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5044|  12.7k|                new_buf = xmlRealloc(buf, size);
 5045|  12.7k|                if (new_buf == NULL) {
  ------------------
  |  Branch (5045:21): [True: 2, False: 12.7k]
  ------------------
 5046|      2|                    xmlErrMemory(ctxt);
 5047|      2|                    xmlFree(buf);
 5048|      2|                    return;
 5049|      2|                }
 5050|  12.7k|                buf = new_buf;
 5051|  12.7k|            }
 5052|   599k|            memcpy(&buf[len], ctxt->input->cur, nbchar);
 5053|   599k|            len += nbchar;
 5054|   599k|            buf[len] = 0;
 5055|   599k|	}
 5056|   860k|	ctxt->input->cur = in;
 5057|   860k|	if (*in == 0xA) {
  ------------------
  |  Branch (5057:6): [True: 0, False: 860k]
  ------------------
 5058|      0|	    in++;
 5059|      0|	    ctxt->input->line++; ctxt->input->col = 1;
 5060|      0|	}
 5061|   860k|	if (*in == 0xD) {
  ------------------
  |  Branch (5061:6): [True: 93.4k, False: 767k]
  ------------------
 5062|  93.4k|	    in++;
 5063|  93.4k|	    if (*in == 0xA) {
  ------------------
  |  Branch (5063:10): [True: 15.2k, False: 78.2k]
  ------------------
 5064|  15.2k|		ctxt->input->cur = in;
 5065|  15.2k|		in++;
 5066|  15.2k|		ctxt->input->line++; ctxt->input->col = 1;
 5067|  15.2k|		goto get_more;
 5068|  15.2k|	    }
 5069|  78.2k|	    in--;
 5070|  78.2k|	}
 5071|   845k|	SHRINK;
  ------------------
  |  | 2304|   845k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   845k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   845k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 698k, False: 147k]
  |  |  ------------------
  |  | 2305|   845k|	xmlParserShrink(ctxt);
  ------------------
 5072|   845k|	GROW;
  ------------------
  |  | 2308|   845k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   845k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   845k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 698k, False: 147k]
  |  |  ------------------
  |  | 2309|   845k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   698k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 130k, False: 567k]
  |  |  ------------------
  |  | 2310|   845k|	xmlParserGrow(ctxt);
  ------------------
 5073|   845k|	in = ctxt->input->cur;
 5074|   845k|	if (*in == '-') {
  ------------------
  |  Branch (5074:6): [True: 694k, False: 151k]
  ------------------
 5075|   694k|	    if (in[1] == '-') {
  ------------------
  |  Branch (5075:10): [True: 478k, False: 215k]
  ------------------
 5076|   478k|	        if (in[2] == '>') {
  ------------------
  |  Branch (5076:14): [True: 255k, False: 223k]
  ------------------
 5077|   255k|		    SKIP(3);
  ------------------
  |  | 2285|   255k|#define SKIP(val) do {							\
  |  | 2286|   255k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   255k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 661, False: 254k]
  |  |  ------------------
  |  | 2288|   255k|        xmlParserGrow(ctxt);						\
  |  | 2289|   255k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 255k]
  |  |  ------------------
  ------------------
 5078|   255k|		    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (5078:11): [True: 255k, False: 0]
  |  Branch (5078:34): [True: 255k, False: 0]
  ------------------
 5079|   255k|		        (!ctxt->disableSAX)) {
  ------------------
  |  Branch (5079:11): [True: 129k, False: 125k]
  ------------------
 5080|   129k|			if (buf != NULL)
  ------------------
  |  Branch (5080:8): [True: 56.4k, False: 73.0k]
  ------------------
 5081|  56.4k|			    ctxt->sax->comment(ctxt->userData, buf);
 5082|  73.0k|			else
 5083|  73.0k|			    ctxt->sax->comment(ctxt->userData, BAD_CAST "");
  ------------------
  |  |   34|  73.0k|#define BAD_CAST (xmlChar *)
  ------------------
 5084|   129k|		    }
 5085|   255k|		    if (buf != NULL)
  ------------------
  |  Branch (5085:11): [True: 59.6k, False: 195k]
  ------------------
 5086|  59.6k|		        xmlFree(buf);
 5087|   255k|		    return;
 5088|   255k|		}
 5089|   223k|		if (buf != NULL) {
  ------------------
  |  Branch (5089:7): [True: 185k, False: 38.0k]
  ------------------
 5090|   185k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5091|   185k|		                      "Double hyphen within comment: "
 5092|   185k|                                      "<!--%.50s\n",
 5093|   185k|				      buf);
 5094|   185k|		} else
 5095|  38.0k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_HYPHEN_IN_COMMENT,
 5096|  38.0k|		                      "Double hyphen within comment\n", NULL);
 5097|   223k|		in++;
 5098|   223k|		ctxt->input->col++;
 5099|   223k|	    }
 5100|   438k|	    in++;
 5101|   438k|	    ctxt->input->col++;
 5102|   438k|	    goto get_more;
 5103|   694k|	}
 5104|   845k|    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (5104:15): [True: 70.9k, False: 80.4k]
  |  Branch (5104:32): [True: 527, False: 70.3k]
  |  Branch (5104:50): [True: 348, False: 150k]
  |  Branch (5104:67): [True: 0, False: 150k]
  ------------------
 5105|   150k|    xmlParseCommentComplex(ctxt, buf, len, size);
 5106|   150k|}
xmlParsePITarget:
 5121|   232k|xmlParsePITarget(xmlParserCtxt *ctxt) {
 5122|   232k|    const xmlChar *name;
 5123|       |
 5124|   232k|    name = xmlParseName(ctxt);
 5125|   232k|    if ((name != NULL) &&
  ------------------
  |  Branch (5125:9): [True: 223k, False: 9.48k]
  ------------------
 5126|   223k|        ((name[0] == 'x') || (name[0] == 'X')) &&
  ------------------
  |  Branch (5126:10): [True: 25.0k, False: 197k]
  |  Branch (5126:30): [True: 436, False: 197k]
  ------------------
 5127|  25.4k|        ((name[1] == 'm') || (name[1] == 'M')) &&
  ------------------
  |  Branch (5127:10): [True: 23.0k, False: 2.42k]
  |  Branch (5127:30): [True: 365, False: 2.06k]
  ------------------
 5128|  23.4k|        ((name[2] == 'l') || (name[2] == 'L'))) {
  ------------------
  |  Branch (5128:10): [True: 14.8k, False: 8.60k]
  |  Branch (5128:30): [True: 313, False: 8.29k]
  ------------------
 5129|  15.1k|	int i;
 5130|  15.1k|	if ((name[0] == 'x') && (name[1] == 'm') &&
  ------------------
  |  Branch (5130:6): [True: 14.8k, False: 276]
  |  Branch (5130:26): [True: 14.6k, False: 216]
  ------------------
 5131|  14.6k|	    (name[2] == 'l') && (name[3] == 0)) {
  ------------------
  |  Branch (5131:6): [True: 14.3k, False: 298]
  |  Branch (5131:26): [True: 11.0k, False: 3.29k]
  ------------------
 5132|  11.0k|	    xmlFatalErrMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5133|  11.0k|		 "XML declaration allowed only at the start of the document\n");
 5134|  11.0k|	    return(name);
 5135|  11.0k|	} else if (name[3] == 0) {
  ------------------
  |  Branch (5135:13): [True: 521, False: 3.56k]
  ------------------
 5136|    521|	    xmlFatalErr(ctxt, XML_ERR_RESERVED_XML_NAME, NULL);
 5137|    521|	    return(name);
 5138|    521|	}
 5139|  10.6k|	for (i = 0;;i++) {
 5140|  10.6k|	    if (xmlW3CPIs[i] == NULL) break;
  ------------------
  |  Branch (5140:10): [True: 3.48k, False: 7.11k]
  ------------------
 5141|  7.11k|	    if (xmlStrEqual(name, (const xmlChar *)xmlW3CPIs[i]))
  ------------------
  |  Branch (5141:10): [True: 78, False: 7.03k]
  ------------------
 5142|     78|	        return(name);
 5143|  7.11k|	}
 5144|  3.48k|	xmlWarningMsg(ctxt, XML_ERR_RESERVED_XML_NAME,
 5145|  3.48k|		      "xmlParsePITarget: invalid name prefix 'xml'\n",
 5146|  3.48k|		      NULL, NULL);
 5147|  3.48k|    }
 5148|   220k|    if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
  ------------------
  |  Branch (5148:9): [True: 211k, False: 9.48k]
  |  Branch (5148:27): [True: 445, False: 210k]
  ------------------
 5149|    445|	xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5150|    445|		 "colons are forbidden from PI names '%s'\n", name, NULL, NULL);
 5151|    445|    }
 5152|   220k|    return(name);
 5153|   232k|}
xmlParsePI:
 5235|   232k|xmlParsePI(xmlParserCtxt *ctxt) {
 5236|   232k|    xmlChar *buf = NULL;
 5237|   232k|    size_t len = 0;
 5238|   232k|    size_t size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   232k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 5239|   232k|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (5239:24): [True: 111k, False: 120k]
  ------------------
 5240|   111k|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   111k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 5241|   232k|                       XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   353k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 5242|   232k|    int cur, l;
 5243|   232k|    const xmlChar *target;
 5244|       |
 5245|   232k|    if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|   232k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|   232k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5245:9): [True: 232k, False: 0]
  |  Branch (5245:25): [True: 232k, False: 0]
  ------------------
 5246|       |	/*
 5247|       |	 * this is a Processing Instruction.
 5248|       |	 */
 5249|   232k|	SKIP(2);
  ------------------
  |  | 2285|   232k|#define SKIP(val) do {							\
  |  | 2286|   232k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   232k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.44k, False: 231k]
  |  |  ------------------
  |  | 2288|   232k|        xmlParserGrow(ctxt);						\
  |  | 2289|   232k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 232k]
  |  |  ------------------
  ------------------
 5250|       |
 5251|       |	/*
 5252|       |	 * Parse the target name and check for special support like
 5253|       |	 * namespace.
 5254|       |	 */
 5255|   232k|        target = xmlParsePITarget(ctxt);
 5256|   232k|	if (target != NULL) {
  ------------------
  |  Branch (5256:6): [True: 223k, False: 9.48k]
  ------------------
 5257|   223k|	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   223k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   190k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5257:10): [True: 190k, False: 32.6k]
  |  Branch (5257:26): [True: 189k, False: 557]
  ------------------
 5258|   189k|		SKIP(2);
  ------------------
  |  | 2285|   189k|#define SKIP(val) do {							\
  |  | 2286|   189k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   189k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 789, False: 189k]
  |  |  ------------------
  |  | 2288|   189k|        xmlParserGrow(ctxt);						\
  |  | 2289|   189k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 189k]
  |  |  ------------------
  ------------------
 5259|       |
 5260|       |		/*
 5261|       |		 * SAX: PI detected.
 5262|       |		 */
 5263|   189k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5263:7): [True: 189k, False: 0]
  |  Branch (5263:22): [True: 188k, False: 1.05k]
  ------------------
 5264|   188k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5264:7): [True: 188k, False: 0]
  ------------------
 5265|   188k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5266|   188k|		                                     target, NULL);
 5267|   189k|		return;
 5268|   189k|	    }
 5269|  33.1k|	    buf = xmlMalloc(size);
 5270|  33.1k|	    if (buf == NULL) {
  ------------------
  |  Branch (5270:10): [True: 8, False: 33.1k]
  ------------------
 5271|      8|		xmlErrMemory(ctxt);
 5272|      8|		return;
 5273|      8|	    }
 5274|  33.1k|	    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  33.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (5274:10): [True: 11.2k, False: 21.8k]
  ------------------
 5275|  11.2k|		xmlFatalErrMsgStr(ctxt, XML_ERR_SPACE_REQUIRED,
 5276|  11.2k|			  "ParsePI: PI %s space expected\n", target);
 5277|  11.2k|	    }
 5278|  33.1k|	    cur = xmlCurrentCharRecover(ctxt, &l);
 5279|  6.07M|	    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  6.07M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  12.1M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 6.06M, False: 9.94k]
  |  |  |  |  |  Branch (117:25): [True: 1.45M, False: 4.62M]
  |  |  |  |  ------------------
  |  |  |  |  118|  12.1M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.45M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.44M, False: 9.59k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 343k, False: 1.09M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.45M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 1.10M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.45M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.09M, False: 9.73k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  12.1M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 4.62M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 2.16M, False: 2.45M]
  |  |  |  |  ------------------
  |  |  |  |  120|  4.62M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.45M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.44M, False: 1.31k]
  |  |  |  |  ------------------
  |  |  |  |  121|  4.62M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 1.10k, False: 213]
  |  |  |  |  |  Branch (121:27): [True: 1.10k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5280|  6.06M|		   ((cur != '?') || (NXT(1) != '>'))) {
  ------------------
  |  | 2263|  29.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5280:7): [True: 6.03M, False: 29.7k]
  |  Branch (5280:23): [True: 6.55k, False: 23.1k]
  ------------------
 5281|  6.03M|		if (len + 5 >= size) {
  ------------------
  |  Branch (5281:7): [True: 17.1k, False: 6.02M]
  ------------------
 5282|  17.1k|		    xmlChar *tmp;
 5283|  17.1k|                    int newSize;
 5284|       |
 5285|  17.1k|                    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 5286|  17.1k|                    if (newSize < 0) {
  ------------------
  |  Branch (5286:25): [True: 0, False: 17.1k]
  ------------------
 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.1k|		    tmp = xmlRealloc(buf, newSize);
 5293|  17.1k|		    if (tmp == NULL) {
  ------------------
  |  Branch (5293:11): [True: 14, False: 17.0k]
  ------------------
 5294|     14|			xmlErrMemory(ctxt);
 5295|     14|			xmlFree(buf);
 5296|     14|			return;
 5297|     14|		    }
 5298|  17.0k|		    buf = tmp;
 5299|  17.0k|                    size = newSize;
 5300|  17.0k|		}
 5301|  6.03M|		COPY_BUF(buf, len, cur);
  ------------------
  |  | 2333|  6.03M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 1.38M, False: 4.65M]
  |  |  ------------------
  |  | 2334|  6.03M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 5302|  6.03M|		NEXTL(l);
  ------------------
  |  | 2325|  6.03M|#define NEXTL(l) do {							\
  |  | 2326|  6.03M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 341k, False: 5.69M]
  |  |  ------------------
  |  | 2327|   341k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.69M|    } else ctxt->input->col++;						\
  |  | 2329|  6.03M|    ctxt->input->cur += l;				\
  |  | 2330|  6.03M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.03M]
  |  |  ------------------
  ------------------
 5303|  6.03M|		cur = xmlCurrentCharRecover(ctxt, &l);
 5304|  6.03M|	    }
 5305|  33.1k|	    buf[len] = 0;
 5306|  33.1k|	    if (cur != '?') {
  ------------------
  |  Branch (5306:10): [True: 9.94k, False: 23.1k]
  ------------------
 5307|  9.94k|		xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
 5308|  9.94k|		      "ParsePI: PI %s never end ...\n", target);
 5309|  23.1k|	    } else {
 5310|  23.1k|		SKIP(2);
  ------------------
  |  | 2285|  23.1k|#define SKIP(val) do {							\
  |  | 2286|  23.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  23.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 272, False: 22.9k]
  |  |  ------------------
  |  | 2288|  23.1k|        xmlParserGrow(ctxt);						\
  |  | 2289|  23.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 23.1k]
  |  |  ------------------
  ------------------
 5311|       |
 5312|  23.1k|#ifdef LIBXML_CATALOG_ENABLED
 5313|  23.1k|		if ((ctxt->inSubset == 0) &&
  ------------------
  |  Branch (5313:7): [True: 8.49k, False: 14.6k]
  ------------------
 5314|  8.49k|		    (xmlStrEqual(target, XML_CATALOG_PI))) {
  ------------------
  |  |   44|  8.49k|    (const xmlChar *) "oasis-xml-catalog"
  ------------------
  |  Branch (5314:7): [True: 413, False: 8.08k]
  ------------------
 5315|    413|		    xmlCatalogAllow allow = xmlCatalogGetDefaults();
 5316|       |
 5317|    413|		    if ((ctxt->options & XML_PARSE_CATALOG_PI) &&
  ------------------
  |  Branch (5317:11): [True: 202, False: 211]
  ------------------
 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|    413|		}
 5322|  23.1k|#endif
 5323|       |
 5324|       |		/*
 5325|       |		 * SAX: PI detected.
 5326|       |		 */
 5327|  23.1k|		if ((ctxt->sax) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5327:7): [True: 23.1k, False: 0]
  |  Branch (5327:22): [True: 22.3k, False: 884]
  ------------------
 5328|  22.3k|		    (ctxt->sax->processingInstruction != NULL))
  ------------------
  |  Branch (5328:7): [True: 22.3k, False: 0]
  ------------------
 5329|  22.3k|		    ctxt->sax->processingInstruction(ctxt->userData,
 5330|  22.3k|		                                     target, buf);
 5331|  23.1k|	    }
 5332|  33.1k|	    xmlFree(buf);
 5333|  33.1k|	} else {
 5334|       |	    xmlFatalErr(ctxt, XML_ERR_PI_NOT_STARTED, NULL);
 5335|  9.48k|	}
 5336|   232k|    }
 5337|   232k|}
xmlParseNotationDecl:
 5359|  3.61k|xmlParseNotationDecl(xmlParserCtxt *ctxt) {
 5360|  3.61k|    const xmlChar *name;
 5361|  3.61k|    xmlChar *Pubid;
 5362|  3.61k|    xmlChar *Systemid;
 5363|       |
 5364|  3.61k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  3.61k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  3.61k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5364:9): [True: 0, False: 3.61k]
  |  Branch (5364:25): [True: 0, False: 3.61k]
  ------------------
 5365|      0|        return;
 5366|  3.61k|    SKIP(2);
  ------------------
  |  | 2285|  3.61k|#define SKIP(val) do {							\
  |  | 2286|  3.61k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.61k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.61k]
  |  |  ------------------
  |  | 2288|  3.61k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.61k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.61k]
  |  |  ------------------
  ------------------
 5367|       |
 5368|  3.61k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  3.61k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  7.22k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  7.22k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  7.22k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  7.22k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 3.61k, False: 0]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.60k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  3.61k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.60k, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.60k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.59k, False: 5]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 3.58k, False: 7]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 3.58k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 3.58k, False: 4]
  |  |  ------------------
  ------------------
 5369|  3.58k|#ifdef LIBXML_VALID_ENABLED
 5370|  3.58k|	int oldInputNr = ctxt->inputNr;
 5371|  3.58k|#endif
 5372|       |
 5373|  3.58k|	SKIP(8);
  ------------------
  |  | 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: 85, False: 3.49k]
  |  |  ------------------
  |  | 2288|  3.58k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.58k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.58k]
  |  |  ------------------
  ------------------
 5374|  3.58k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  3.58k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5374:6): [True: 312, False: 3.27k]
  ------------------
 5375|    312|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5376|    312|			   "Space required after '<!NOTATION'\n");
 5377|    312|	    return;
 5378|    312|	}
 5379|       |
 5380|  3.27k|        name = xmlParseName(ctxt);
 5381|  3.27k|	if (name == NULL) {
  ------------------
  |  Branch (5381:6): [True: 387, False: 2.88k]
  ------------------
 5382|    387|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5383|    387|	    return;
 5384|    387|	}
 5385|  2.88k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5385:6): [True: 218, False: 2.66k]
  ------------------
 5386|    218|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5387|    218|		     "colons are forbidden from notation names '%s'\n",
 5388|    218|		     name, NULL, NULL);
 5389|    218|	}
 5390|  2.88k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  2.88k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5390:6): [True: 108, False: 2.77k]
  ------------------
 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.77k|	Systemid = xmlParseExternalID(ctxt, &Pubid, 0);
 5400|  2.77k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.77k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5401|       |
 5402|  2.77k|	if (RAW == '>') {
  ------------------
  |  | 2261|  2.77k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5402:6): [True: 2.22k, False: 548]
  ------------------
 5403|  2.22k|#ifdef LIBXML_VALID_ENABLED
 5404|  2.22k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5404:10): [True: 1.56k, False: 662]
  |  Branch (5404:30): [True: 3, False: 1.56k]
  ------------------
 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.22k|#endif
 5411|  2.22k|	    NEXT;
  ------------------
  |  | 2316|  2.22k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5412|  2.22k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5412:10): [True: 2.22k, False: 0]
  |  Branch (5412:33): [True: 1.76k, False: 464]
  ------------------
 5413|  1.76k|		(ctxt->sax->notationDecl != NULL))
  ------------------
  |  Branch (5413:3): [True: 1.76k, False: 0]
  ------------------
 5414|  1.76k|		ctxt->sax->notationDecl(ctxt->userData, name, Pubid, Systemid);
 5415|  2.22k|	} else {
 5416|    548|	    xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5417|    548|	}
 5418|  2.77k|	if (Systemid != NULL) xmlFree(Systemid);
  ------------------
  |  Branch (5418:6): [True: 947, False: 1.82k]
  ------------------
 5419|  2.77k|	if (Pubid != NULL) xmlFree(Pubid);
  ------------------
  |  Branch (5419:6): [True: 1.55k, False: 1.22k]
  ------------------
 5420|  2.77k|    }
 5421|  3.61k|}
xmlParseEntityDecl:
 5447|   192k|xmlParseEntityDecl(xmlParserCtxt *ctxt) {
 5448|   192k|    const xmlChar *name = NULL;
 5449|   192k|    xmlChar *value = NULL;
 5450|   192k|    xmlChar *URI = NULL, *literal = NULL;
 5451|   192k|    const xmlChar *ndata = NULL;
 5452|   192k|    int isParameter = 0;
 5453|   192k|    xmlChar *orig = NULL;
 5454|       |
 5455|   192k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|   192k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|   192k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5455:9): [True: 0, False: 192k]
  |  Branch (5455:25): [True: 0, False: 192k]
  ------------------
 5456|      0|        return;
 5457|   192k|    SKIP(2);
  ------------------
  |  | 2285|   192k|#define SKIP(val) do {							\
  |  | 2286|   192k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   192k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 192k]
  |  |  ------------------
  |  | 2288|   192k|        xmlParserGrow(ctxt);						\
  |  | 2289|   192k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 192k]
  |  |  ------------------
  ------------------
 5458|       |
 5459|       |    /* GROW; done in the caller */
 5460|   192k|    if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|   192k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   385k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   385k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 192k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 192k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   192k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 192k, False: 22]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 192k, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 192k, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 192k, False: 10]
  |  |  ------------------
  ------------------
 5461|   192k|#ifdef LIBXML_VALID_ENABLED
 5462|   192k|	int oldInputNr = ctxt->inputNr;
 5463|   192k|#endif
 5464|       |
 5465|   192k|	SKIP(6);
  ------------------
  |  | 2285|   192k|#define SKIP(val) do {							\
  |  | 2286|   192k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   192k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 234, False: 192k]
  |  |  ------------------
  |  | 2288|   192k|        xmlParserGrow(ctxt);						\
  |  | 2289|   192k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 192k]
  |  |  ------------------
  ------------------
 5466|   192k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   192k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5466:6): [True: 2.91k, False: 189k]
  ------------------
 5467|  2.91k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5468|  2.91k|			   "Space required after '<!ENTITY'\n");
 5469|  2.91k|	}
 5470|       |
 5471|   192k|	if (RAW == '%') {
  ------------------
  |  | 2261|   192k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5471:6): [True: 79.8k, False: 112k]
  ------------------
 5472|  79.8k|	    NEXT;
  ------------------
  |  | 2316|  79.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5473|  79.8k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  79.8k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5473:10): [True: 373, False: 79.4k]
  ------------------
 5474|    373|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5475|    373|			       "Space required after '%%'\n");
 5476|    373|	    }
 5477|  79.8k|	    isParameter = 1;
 5478|  79.8k|	}
 5479|       |
 5480|   192k|        name = xmlParseName(ctxt);
 5481|   192k|	if (name == NULL) {
  ------------------
  |  Branch (5481:6): [True: 35.1k, False: 157k]
  ------------------
 5482|  35.1k|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5483|  35.1k|	                   "xmlParseEntityDecl: no name\n");
 5484|  35.1k|            return;
 5485|  35.1k|	}
 5486|   157k|	if (xmlStrchr(name, ':') != NULL) {
  ------------------
  |  Branch (5486:6): [True: 2.09k, False: 155k]
  ------------------
 5487|  2.09k|	    xmlNsErr(ctxt, XML_NS_ERR_COLON,
 5488|  2.09k|		     "colons are forbidden from entities names '%s'\n",
 5489|  2.09k|		     name, NULL, NULL);
 5490|  2.09k|	}
 5491|   157k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   157k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5491:6): [True: 3.77k, False: 153k]
  ------------------
 5492|  3.77k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5493|  3.77k|			   "Space required after the entity name\n");
 5494|  3.77k|	}
 5495|       |
 5496|       |	/*
 5497|       |	 * handle the various case of definitions...
 5498|       |	 */
 5499|   157k|	if (isParameter) {
  ------------------
  |  Branch (5499:6): [True: 79.2k, False: 78.2k]
  ------------------
 5500|  79.2k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  79.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  9.60k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5500:10): [True: 69.6k, False: 9.60k]
  |  Branch (5500:26): [True: 1.38k, False: 8.21k]
  ------------------
 5501|  71.0k|	        value = xmlParseEntityValue(ctxt, &orig);
 5502|  71.0k|		if (value) {
  ------------------
  |  Branch (5502:7): [True: 69.4k, False: 1.51k]
  ------------------
 5503|  69.4k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5503:11): [True: 69.4k, False: 0]
  ------------------
 5504|  69.4k|			(!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5504:4): [True: 65.3k, False: 4.10k]
  |  Branch (5504:27): [True: 65.3k, False: 0]
  ------------------
 5505|  65.3k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5506|  65.3k|		                    XML_INTERNAL_PARAMETER_ENTITY,
 5507|  65.3k|				    NULL, NULL, value);
 5508|  69.4k|		}
 5509|  71.0k|	    } else {
 5510|  8.21k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5511|  8.21k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5511:7): [True: 894, False: 7.32k]
  |  Branch (5511:24): [True: 789, False: 105]
  ------------------
 5512|    789|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5513|    789|		}
 5514|  8.21k|		if (URI) {
  ------------------
  |  Branch (5514:7): [True: 7.32k, False: 894]
  ------------------
 5515|  7.32k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5515:25): [True: 348, False: 6.97k]
  ------------------
 5516|    348|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5517|  6.97k|                    } else {
 5518|  6.97k|                        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5518:29): [True: 6.97k, False: 0]
  ------------------
 5519|  6.97k|                            (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5519:29): [True: 6.07k, False: 897]
  ------------------
 5520|  6.07k|                            (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5520:29): [True: 6.07k, False: 0]
  ------------------
 5521|  6.07k|                            ctxt->sax->entityDecl(ctxt->userData, name,
 5522|  6.07k|                                        XML_EXTERNAL_PARAMETER_ENTITY,
 5523|  6.07k|                                        literal, URI, NULL);
 5524|  6.97k|                    }
 5525|  7.32k|		}
 5526|  8.21k|	    }
 5527|  79.2k|	} else {
 5528|  78.2k|	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  78.2k|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == '"') || (RAW == '\'')) {
  ------------------
  |  | 2261|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5528:10): [True: 63.7k, False: 14.5k]
  |  Branch (5528:26): [True: 2.00k, False: 12.5k]
  ------------------
 5529|  65.7k|	        value = xmlParseEntityValue(ctxt, &orig);
 5530|  65.7k|		if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5530:7): [True: 65.7k, False: 0]
  ------------------
 5531|  65.7k|		    (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5531:7): [True: 64.5k, False: 1.25k]
  |  Branch (5531:30): [True: 64.5k, False: 0]
  ------------------
 5532|  64.5k|		    ctxt->sax->entityDecl(ctxt->userData, name,
 5533|  64.5k|				XML_INTERNAL_GENERAL_ENTITY,
 5534|  64.5k|				NULL, NULL, value);
 5535|       |		/*
 5536|       |		 * For expat compatibility in SAX mode.
 5537|       |		 */
 5538|  65.7k|		if ((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5538:7): [True: 11, False: 65.7k]
  ------------------
 5539|  65.7k|		    (xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  65.7k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  65.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5539:7): [True: 69, False: 65.6k]
  ------------------
 5540|     80|		    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (5540:11): [True: 11, False: 69]
  ------------------
 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|     79|		    if (ctxt->myDoc->intSubset == NULL) {
  ------------------
  |  Branch (5548:11): [True: 10, False: 69]
  ------------------
 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|     78|		    xmlSAX2EntityDecl(ctxt, name, XML_INTERNAL_GENERAL_ENTITY,
 5558|     78|			              NULL, NULL, value);
 5559|     78|		}
 5560|  65.7k|	    } else {
 5561|  12.5k|	        URI = xmlParseExternalID(ctxt, &literal, 1);
 5562|  12.5k|		if ((URI == NULL) && (literal == NULL)) {
  ------------------
  |  Branch (5562:7): [True: 5.64k, False: 6.86k]
  |  Branch (5562:24): [True: 5.40k, False: 234]
  ------------------
 5563|  5.40k|		    xmlFatalErr(ctxt, XML_ERR_VALUE_REQUIRED, NULL);
 5564|  5.40k|		}
 5565|  12.5k|		if (URI) {
  ------------------
  |  Branch (5565:7): [True: 6.86k, False: 5.64k]
  ------------------
 5566|  6.86k|                    if (xmlStrchr(URI, '#')) {
  ------------------
  |  Branch (5566:25): [True: 419, False: 6.44k]
  ------------------
 5567|    419|                        xmlFatalErr(ctxt, XML_ERR_URI_FRAGMENT, NULL);
 5568|    419|                    }
 5569|  6.86k|		}
 5570|  12.5k|		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2261|  12.5k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW != '>') && (SKIP_BLANKS_PE == 0)) {
  ------------------
  |  | 2314|  7.18k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5570:7): [True: 7.18k, False: 5.31k]
  |  Branch (5570:23): [True: 5.27k, False: 1.91k]
  ------------------
 5571|  5.27k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5572|  5.27k|				   "Space required before 'NDATA'\n");
 5573|  5.27k|		}
 5574|  12.5k|		if (CMP5(CUR_PTR, 'N', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|  12.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  25.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 905, False: 11.5k]
  |  |  |  |  |  Branch (2268:41): [True: 899, False: 6]
  |  |  |  |  ------------------
  |  |  |  | 2269|  12.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 893, False: 6]
  |  |  |  |  |  Branch (2269:41): [True: 884, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 882, False: 2]
  |  |  ------------------
  ------------------
 5575|    882|		    SKIP(5);
  ------------------
  |  | 2285|    882|#define SKIP(val) do {							\
  |  | 2286|    882|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    882|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 73, False: 809]
  |  |  ------------------
  |  | 2288|    882|        xmlParserGrow(ctxt);						\
  |  | 2289|    882|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 882]
  |  |  ------------------
  ------------------
 5576|    882|		    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|    882|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5576:11): [True: 291, False: 591]
  ------------------
 5577|    291|			xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5578|    291|				       "Space required after 'NDATA'\n");
 5579|    291|		    }
 5580|    882|		    ndata = xmlParseName(ctxt);
 5581|    882|		    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (5581:11): [True: 882, False: 0]
  |  Branch (5581:34): [True: 617, False: 265]
  ------------------
 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.6k|		} else {
 5586|  11.6k|		    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5586:11): [True: 11.6k, False: 0]
  ------------------
 5587|  11.6k|		        (!ctxt->disableSAX) && (ctxt->sax->entityDecl != NULL))
  ------------------
  |  Branch (5587:11): [True: 9.76k, False: 1.85k]
  |  Branch (5587:34): [True: 9.76k, False: 0]
  ------------------
 5588|  9.76k|			ctxt->sax->entityDecl(ctxt->userData, name,
 5589|  9.76k|				    XML_EXTERNAL_GENERAL_PARSED_ENTITY,
 5590|  9.76k|				    literal, URI, NULL);
 5591|       |		    /*
 5592|       |		     * For expat compatibility in SAX mode.
 5593|       |		     * assuming the entity replacement was asked for
 5594|       |		     */
 5595|  11.6k|		    if ((ctxt->replaceEntities != 0) &&
  ------------------
  |  Branch (5595:11): [True: 5.87k, False: 5.75k]
  ------------------
 5596|  5.87k|			((ctxt->myDoc == NULL) ||
  ------------------
  |  Branch (5596:5): [True: 10, False: 5.86k]
  ------------------
 5597|  5.86k|			(xmlStrEqual(ctxt->myDoc->version, SAX_COMPAT_MODE)))) {
  ------------------
  |  |  173|  5.86k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  5.86k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (5597:4): [True: 215, False: 5.64k]
  ------------------
 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.6k|		}
 5620|  12.5k|	    }
 5621|  78.2k|	}
 5622|   157k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|   157k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5623|   157k|	if (RAW != '>') {
  ------------------
  |  | 2261|   157k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5623:6): [True: 13.6k, False: 143k]
  ------------------
 5624|  13.6k|	    xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_NOT_FINISHED,
 5625|  13.6k|	            "xmlParseEntityDecl: entity %s not terminated\n", name);
 5626|   143k|	} else {
 5627|   143k|#ifdef LIBXML_VALID_ENABLED
 5628|   143k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (5628:10): [True: 104k, False: 38.9k]
  |  Branch (5628:30): [True: 6, False: 104k]
  ------------------
 5629|      6|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 5630|      6|	                         "Entity declaration doesn't start and stop in"
 5631|      6|                                 " the same entity\n",
 5632|      6|                                 NULL, NULL);
 5633|      6|	    }
 5634|   143k|#endif
 5635|   143k|	    NEXT;
  ------------------
  |  | 2316|   143k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5636|   143k|	}
 5637|   157k|	if (orig != NULL) {
  ------------------
  |  Branch (5637:6): [True: 132k, False: 24.9k]
  ------------------
 5638|       |	    /*
 5639|       |	     * Ugly mechanism to save the raw entity value.
 5640|       |	     */
 5641|   132k|	    xmlEntityPtr cur = NULL;
 5642|       |
 5643|   132k|	    if (isParameter) {
  ------------------
  |  Branch (5643:10): [True: 69.5k, False: 63.0k]
  ------------------
 5644|  69.5k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5644:14): [True: 69.5k, False: 0]
  ------------------
 5645|  69.5k|		    (ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (5645:7): [True: 69.5k, False: 0]
  ------------------
 5646|  69.5k|		    cur = ctxt->sax->getParameterEntity(ctxt->userData, name);
 5647|  69.5k|	    } else {
 5648|  63.0k|	        if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (5648:14): [True: 63.0k, False: 0]
  ------------------
 5649|  63.0k|		    (ctxt->sax->getEntity != NULL))
  ------------------
  |  Branch (5649:7): [True: 63.0k, False: 0]
  ------------------
 5650|  63.0k|		    cur = ctxt->sax->getEntity(ctxt->userData, name);
 5651|  63.0k|		if ((cur == NULL) && (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (5651:7): [True: 945, False: 62.1k]
  |  Branch (5651:24): [True: 945, False: 0]
  ------------------
 5652|    945|		    cur = xmlSAX2GetEntity(ctxt, name);
 5653|    945|		}
 5654|  63.0k|	    }
 5655|   132k|            if ((cur != NULL) && (cur->orig == NULL)) {
  ------------------
  |  Branch (5655:17): [True: 127k, False: 4.75k]
  |  Branch (5655:34): [True: 13.6k, False: 114k]
  ------------------
 5656|  13.6k|		cur->orig = orig;
 5657|  13.6k|                orig = NULL;
 5658|  13.6k|	    }
 5659|   132k|	}
 5660|       |
 5661|   157k|done:
 5662|   157k|	if (value != NULL) xmlFree(value);
  ------------------
  |  Branch (5662:6): [True: 132k, False: 24.9k]
  ------------------
 5663|   157k|	if (URI != NULL) xmlFree(URI);
  ------------------
  |  Branch (5663:6): [True: 14.1k, False: 143k]
  ------------------
 5664|   157k|	if (literal != NULL) xmlFree(literal);
  ------------------
  |  Branch (5664:6): [True: 3.71k, False: 153k]
  ------------------
 5665|   157k|        if (orig != NULL) xmlFree(orig);
  ------------------
  |  Branch (5665:13): [True: 118k, False: 38.5k]
  ------------------
 5666|   157k|    }
 5667|   192k|}
xmlParseDefaultDecl:
 5699|  98.2k|xmlParseDefaultDecl(xmlParserCtxt *ctxt, xmlChar **value) {
 5700|  98.2k|    int val;
 5701|  98.2k|    xmlChar *ret;
 5702|       |
 5703|  98.2k|    *value = NULL;
 5704|  98.2k|    if (CMP9(CUR_PTR, '#', 'R', 'E', 'Q', 'U', 'I', 'R', 'E', 'D')) {
  ------------------
  |  | 2279|  98.2k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|   196k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|   196k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|   196k|  ( 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: 36.5k, False: 61.6k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.46k, False: 32.0k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  98.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.46k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.46k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.45k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.45k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 4.45k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 4.44k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  98.2k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 4.44k, False: 2]
  |  |  ------------------
  ------------------
 5705|  4.44k|	SKIP(9);
  ------------------
  |  | 2285|  4.44k|#define SKIP(val) do {							\
  |  | 2286|  4.44k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.44k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 82, False: 4.36k]
  |  |  ------------------
  |  | 2288|  4.44k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.44k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.44k]
  |  |  ------------------
  ------------------
 5706|  4.44k|	return(XML_ATTRIBUTE_REQUIRED);
 5707|  4.44k|    }
 5708|  93.7k|    if (CMP8(CUR_PTR, '#', 'I', 'M', 'P', 'L', 'I', 'E', 'D')) {
  ------------------
  |  | 2277|  93.7k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   187k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   187k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   187k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   187k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 32.0k, False: 61.6k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 19.0k, False: 13.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  93.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 19.0k, False: 6]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 19.0k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 19.0k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 19.0k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 19.0k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 19.0k, False: 1]
  |  |  ------------------
  ------------------
 5709|  19.0k|	SKIP(8);
  ------------------
  |  | 2285|  19.0k|#define SKIP(val) do {							\
  |  | 2286|  19.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  19.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 494, False: 18.5k]
  |  |  ------------------
  |  | 2288|  19.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  19.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 19.0k]
  |  |  ------------------
  ------------------
 5710|  19.0k|	return(XML_ATTRIBUTE_IMPLIED);
 5711|  19.0k|    }
 5712|  74.7k|    val = XML_ATTRIBUTE_NONE;
 5713|  74.7k|    if (CMP6(CUR_PTR, '#', 'F', 'I', 'X', 'E', 'D')) {
  ------------------
  |  | 2273|  74.7k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   149k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   149k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 13.0k, False: 61.6k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 13.0k, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  74.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 13.0k, False: 1]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 13.0k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 13.0k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 13.0k, False: 1]
  |  |  ------------------
  ------------------
 5714|  13.0k|	SKIP(6);
  ------------------
  |  | 2285|  13.0k|#define SKIP(val) do {							\
  |  | 2286|  13.0k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  13.0k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 72, False: 12.9k]
  |  |  ------------------
  |  | 2288|  13.0k|        xmlParserGrow(ctxt);						\
  |  | 2289|  13.0k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 13.0k]
  |  |  ------------------
  ------------------
 5715|  13.0k|	val = XML_ATTRIBUTE_FIXED;
 5716|  13.0k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  13.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5716:6): [True: 406, False: 12.6k]
  ------------------
 5717|    406|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5718|    406|			   "Space required after '#FIXED'\n");
 5719|    406|	}
 5720|  13.0k|    }
 5721|  74.7k|    ret = xmlParseAttValue(ctxt);
 5722|  74.7k|    if (ret == NULL) {
  ------------------
  |  Branch (5722:9): [True: 42.0k, False: 32.7k]
  ------------------
 5723|  42.0k|	xmlFatalErrMsg(ctxt, (xmlParserErrors)ctxt->errNo,
 5724|  42.0k|		       "Attribute default value declaration error\n");
 5725|  42.0k|    } else
 5726|  32.7k|        *value = ret;
 5727|  74.7k|    return(val);
 5728|  93.7k|}
xmlParseNotationType:
 5748|  4.22k|xmlParseNotationType(xmlParserCtxt *ctxt) {
 5749|  4.22k|    const xmlChar *name;
 5750|  4.22k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5751|       |
 5752|  4.22k|    if (RAW != '(') {
  ------------------
  |  | 2261|  4.22k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5752:9): [True: 369, False: 3.85k]
  ------------------
 5753|    369|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
 5754|    369|	return(NULL);
 5755|    369|    }
 5756|  4.61k|    do {
 5757|  4.61k|        NEXT;
  ------------------
  |  | 2316|  4.61k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5758|  4.61k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.61k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5759|  4.61k|        name = xmlParseName(ctxt);
 5760|  4.61k|	if (name == NULL) {
  ------------------
  |  Branch (5760:6): [True: 256, False: 4.35k]
  ------------------
 5761|    256|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 5762|    256|			   "Name expected in NOTATION declaration\n");
 5763|    256|            xmlFreeEnumeration(ret);
 5764|    256|	    return(NULL);
 5765|    256|	}
 5766|  4.35k|        tmp = NULL;
 5767|  4.35k|#ifdef LIBXML_VALID_ENABLED
 5768|  4.35k|        if (ctxt->validate) {
  ------------------
  |  Branch (5768:13): [True: 1.85k, False: 2.50k]
  ------------------
 5769|  1.85k|            tmp = ret;
 5770|  2.87k|            while (tmp != NULL) {
  ------------------
  |  Branch (5770:20): [True: 1.12k, False: 1.75k]
  ------------------
 5771|  1.12k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5771:21): [True: 105, False: 1.02k]
  ------------------
 5772|    105|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5773|    105|              "standalone: attribute notation value token %s duplicated\n",
 5774|    105|                                     name, NULL);
 5775|    105|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5775:25): [True: 0, False: 105]
  ------------------
 5776|      0|                        xmlFree((xmlChar *) name);
 5777|    105|                    break;
 5778|    105|                }
 5779|  1.02k|                tmp = tmp->next;
 5780|  1.02k|            }
 5781|  1.85k|        }
 5782|  4.35k|#endif /* LIBXML_VALID_ENABLED */
 5783|  4.35k|	if (tmp == NULL) {
  ------------------
  |  Branch (5783:6): [True: 4.25k, False: 105]
  ------------------
 5784|  4.25k|	    cur = xmlCreateEnumeration(name);
 5785|  4.25k|	    if (cur == NULL) {
  ------------------
  |  Branch (5785:10): [True: 1, False: 4.25k]
  ------------------
 5786|      1|                xmlErrMemory(ctxt);
 5787|      1|                xmlFreeEnumeration(ret);
 5788|      1|                return(NULL);
 5789|      1|            }
 5790|  4.25k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5790:10): [True: 3.60k, False: 645]
  ------------------
 5791|    645|	    else {
 5792|    645|		last->next = cur;
 5793|    645|		last = cur;
 5794|    645|	    }
 5795|  4.25k|	}
 5796|  4.35k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  4.35k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5797|  4.35k|    } while (RAW == '|');
  ------------------
  |  | 2261|  4.35k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5797:14): [True: 754, False: 3.60k]
  ------------------
 5798|  3.60k|    if (RAW != ')') {
  ------------------
  |  | 2261|  3.60k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5798:9): [True: 853, False: 2.74k]
  ------------------
 5799|    853|	xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_FINISHED, NULL);
 5800|    853|        xmlFreeEnumeration(ret);
 5801|    853|	return(NULL);
 5802|    853|    }
 5803|  2.74k|    NEXT;
  ------------------
  |  | 2316|  2.74k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5804|  2.74k|    return(ret);
 5805|  3.60k|}
xmlParseEnumerationType:
 5823|  18.9k|xmlParseEnumerationType(xmlParserCtxt *ctxt) {
 5824|  18.9k|    xmlChar *name;
 5825|  18.9k|    xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
 5826|       |
 5827|  18.9k|    if (RAW != '(') {
  ------------------
  |  | 2261|  18.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5827:9): [True: 2.76k, False: 16.1k]
  ------------------
 5828|  2.76k|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
 5829|  2.76k|	return(NULL);
 5830|  2.76k|    }
 5831|  23.6k|    do {
 5832|  23.6k|        NEXT;
  ------------------
  |  | 2316|  23.6k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5833|  23.6k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  23.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5834|  23.6k|        name = xmlParseNmtoken(ctxt);
 5835|  23.6k|	if (name == NULL) {
  ------------------
  |  Branch (5835:6): [True: 358, False: 23.3k]
  ------------------
 5836|    358|	    xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
 5837|    358|	    return(ret);
 5838|    358|	}
 5839|  23.3k|        tmp = NULL;
 5840|  23.3k|#ifdef LIBXML_VALID_ENABLED
 5841|  23.3k|        if (ctxt->validate) {
  ------------------
  |  Branch (5841:13): [True: 16.8k, False: 6.43k]
  ------------------
 5842|  16.8k|            tmp = ret;
 5843|  36.4k|            while (tmp != NULL) {
  ------------------
  |  Branch (5843:20): [True: 20.0k, False: 16.3k]
  ------------------
 5844|  20.0k|                if (xmlStrEqual(name, tmp->name)) {
  ------------------
  |  Branch (5844:21): [True: 522, False: 19.5k]
  ------------------
 5845|    522|                    xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
 5846|    522|              "standalone: attribute enumeration value token %s duplicated\n",
 5847|    522|                                     name, NULL);
 5848|    522|                    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5848:25): [True: 522, False: 0]
  ------------------
 5849|    522|                        xmlFree(name);
 5850|    522|                    break;
 5851|    522|                }
 5852|  19.5k|                tmp = tmp->next;
 5853|  19.5k|            }
 5854|  16.8k|        }
 5855|  23.3k|#endif /* LIBXML_VALID_ENABLED */
 5856|  23.3k|	if (tmp == NULL) {
  ------------------
  |  Branch (5856:6): [True: 22.7k, False: 522]
  ------------------
 5857|  22.7k|	    cur = xmlCreateEnumeration(name);
 5858|  22.7k|	    if (!xmlDictOwns(ctxt->dict, name))
  ------------------
  |  Branch (5858:10): [True: 22.7k, False: 0]
  ------------------
 5859|  22.7k|		xmlFree(name);
 5860|  22.7k|	    if (cur == NULL) {
  ------------------
  |  Branch (5860:10): [True: 4, False: 22.7k]
  ------------------
 5861|      4|                xmlErrMemory(ctxt);
 5862|      4|                xmlFreeEnumeration(ret);
 5863|      4|                return(NULL);
 5864|      4|            }
 5865|  22.7k|	    if (last == NULL) ret = last = cur;
  ------------------
  |  Branch (5865:10): [True: 15.7k, False: 6.98k]
  ------------------
 5866|  6.98k|	    else {
 5867|  6.98k|		last->next = cur;
 5868|  6.98k|		last = cur;
 5869|  6.98k|	    }
 5870|  22.7k|	}
 5871|  23.3k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  23.3k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 5872|  23.3k|    } while (RAW == '|');
  ------------------
  |  | 2261|  23.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5872:14): [True: 7.51k, False: 15.7k]
  ------------------
 5873|  15.7k|    if (RAW != ')') {
  ------------------
  |  | 2261|  15.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (5873:9): [True: 915, False: 14.8k]
  ------------------
 5874|    915|	xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_FINISHED, NULL);
 5875|    915|	return(ret);
 5876|    915|    }
 5877|  14.8k|    NEXT;
  ------------------
  |  | 2316|  14.8k|#define NEXT xmlNextChar(ctxt)
  ------------------
 5878|  14.8k|    return(ret);
 5879|  15.7k|}
xmlParseEnumeratedType:
 5896|  23.4k|xmlParseEnumeratedType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5897|  23.4k|    if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
  ------------------
  |  | 2277|  23.4k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|  46.9k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|  46.9k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|  46.9k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|  46.9k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 4.61k, False: 18.8k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 4.60k, False: 15]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  23.4k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 4.59k, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 4.59k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 4.59k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 4.58k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 4.58k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 4.58k, False: 1]
  |  |  ------------------
  ------------------
 5898|  4.58k|	SKIP(8);
  ------------------
  |  | 2285|  4.58k|#define SKIP(val) do {							\
  |  | 2286|  4.58k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  4.58k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 253, False: 4.32k]
  |  |  ------------------
  |  | 2288|  4.58k|        xmlParserGrow(ctxt);						\
  |  | 2289|  4.58k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4.58k]
  |  |  ------------------
  ------------------
 5899|  4.58k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  4.58k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (5899:6): [True: 354, False: 4.22k]
  ------------------
 5900|    354|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 5901|    354|			   "Space required after 'NOTATION'\n");
 5902|    354|	    return(0);
 5903|    354|	}
 5904|  4.22k|	*tree = xmlParseNotationType(ctxt);
 5905|  4.22k|	if (*tree == NULL) return(0);
  ------------------
  |  Branch (5905:6): [True: 1.47k, False: 2.74k]
  ------------------
 5906|  2.74k|	return(XML_ATTRIBUTE_NOTATION);
 5907|  4.22k|    }
 5908|  18.9k|    *tree = xmlParseEnumerationType(ctxt);
 5909|  18.9k|    if (*tree == NULL) return(0);
  ------------------
  |  Branch (5909:9): [True: 3.11k, False: 15.7k]
  ------------------
 5910|  15.7k|    return(XML_ATTRIBUTE_ENUMERATION);
 5911|  18.9k|}
xmlParseAttributeType:
 5959|   105k|xmlParseAttributeType(xmlParserCtxt *ctxt, xmlEnumeration **tree) {
 5960|   105k|    if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2271|   105k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   210k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 12.5k, False: 92.8k]
  |  |  |  |  |  Branch (2268:41): [True: 12.5k, False: 5]
  |  |  |  |  ------------------
  |  |  |  | 2269|   105k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 12.5k, False: 2]
  |  |  |  |  |  Branch (2269:41): [True: 12.5k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 12.5k, False: 1]
  |  |  ------------------
  ------------------
 5961|  12.5k|	SKIP(5);
  ------------------
  |  | 2285|  12.5k|#define SKIP(val) do {							\
  |  | 2286|  12.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  12.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 222, False: 12.3k]
  |  |  ------------------
  |  | 2288|  12.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  12.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 12.5k]
  |  |  ------------------
  ------------------
 5962|  12.5k|	return(XML_ATTRIBUTE_CDATA);
 5963|  92.8k|     } else if (CMP6(CUR_PTR, 'I', 'D', 'R', 'E', 'F', 'S')) {
  ------------------
  |  | 2273|  92.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   185k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   185k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 17.6k, False: 75.2k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 17.6k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  92.8k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.03k, False: 10.6k]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.02k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.02k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 5.25k, False: 1.77k]
  |  |  ------------------
  ------------------
 5964|  5.25k|	SKIP(6);
  ------------------
  |  | 2285|  5.25k|#define SKIP(val) do {							\
  |  | 2286|  5.25k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.25k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 78, False: 5.17k]
  |  |  ------------------
  |  | 2288|  5.25k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.25k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.25k]
  |  |  ------------------
  ------------------
 5965|  5.25k|	return(XML_ATTRIBUTE_IDREFS);
 5966|  87.6k|     } else if (CMP5(CUR_PTR, 'I', 'D', 'R', 'E', 'F')) {
  ------------------
  |  | 2271|  87.6k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   175k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 12.3k, False: 75.2k]
  |  |  |  |  |  Branch (2268:41): [True: 12.3k, False: 3]
  |  |  |  |  ------------------
  |  |  |  | 2269|  87.6k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 1.78k, False: 10.6k]
  |  |  |  |  |  Branch (2269:41): [True: 1.77k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 1.77k, False: 1]
  |  |  ------------------
  ------------------
 5967|  1.77k|	SKIP(5);
  ------------------
  |  | 2285|  1.77k|#define SKIP(val) do {							\
  |  | 2286|  1.77k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.77k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 90, False: 1.68k]
  |  |  ------------------
  |  | 2288|  1.77k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.77k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.77k]
  |  |  ------------------
  ------------------
 5968|  1.77k|	return(XML_ATTRIBUTE_IDREF);
 5969|  85.8k|     } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2261|  85.8k|#define RAW (*ctxt->input->cur)
  ------------------
                   } else if ((RAW == 'I') && (NXT(1) == 'D')) {
  ------------------
  |  | 2263|  10.6k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (5969:17): [True: 10.6k, False: 75.2k]
  |  Branch (5969:33): [True: 10.6k, False: 3]
  ------------------
 5970|  10.6k|        SKIP(2);
  ------------------
  |  | 2285|  10.6k|#define SKIP(val) do {							\
  |  | 2286|  10.6k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  10.6k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 215, False: 10.4k]
  |  |  ------------------
  |  | 2288|  10.6k|        xmlParserGrow(ctxt);						\
  |  | 2289|  10.6k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 5971|  10.6k|	return(XML_ATTRIBUTE_ID);
 5972|  75.2k|     } else if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
  ------------------
  |  | 2273|  75.2k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   150k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   150k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 7.52k, False: 67.7k]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.52k, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  75.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.51k, False: 1]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.51k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 7.50k, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 5.95k, False: 1.55k]
  |  |  ------------------
  ------------------
 5973|  5.95k|	SKIP(6);
  ------------------
  |  | 2285|  5.95k|#define SKIP(val) do {							\
  |  | 2286|  5.95k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  5.95k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 85, False: 5.86k]
  |  |  ------------------
  |  | 2288|  5.95k|        xmlParserGrow(ctxt);						\
  |  | 2289|  5.95k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 5.95k]
  |  |  ------------------
  ------------------
 5974|  5.95k|	return(XML_ATTRIBUTE_ENTITY);
 5975|  69.2k|     } else if (CMP8(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'I', 'E', 'S')) {
  ------------------
  |  | 2277|  69.2k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   138k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   138k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   138k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   138k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 1.57k, False: 67.7k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 1.56k, False: 4]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  69.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 1.56k, False: 1]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 1.55k, False: 9]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 1.55k, 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: 210, 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|  67.7k|     } else if (CMP8(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N', 'S')) {
  ------------------
  |  | 2277|  67.7k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   135k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   135k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   135k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   135k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 48.8k, False: 18.8k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 44.2k, False: 4.60k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|  67.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 44.2k, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 44.2k, False: 7]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 44.2k, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 44.2k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 44.2k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 37.2k, False: 7.03k]
  |  |  ------------------
  ------------------
 5979|  37.2k|	SKIP(8);
  ------------------
  |  | 2285|  37.2k|#define SKIP(val) do {							\
  |  | 2286|  37.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  37.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 225, False: 36.9k]
  |  |  ------------------
  |  | 2288|  37.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  37.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 37.2k]
  |  |  ------------------
  ------------------
 5980|  37.2k|	return(XML_ATTRIBUTE_NMTOKENS);
 5981|  37.2k|     } else if (CMP7(CUR_PTR, 'N', 'M', 'T', 'O', 'K', 'E', 'N')) {
  ------------------
  |  | 2275|  30.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  61.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  61.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  61.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 11.6k, False: 18.8k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 7.04k, False: 4.60k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  30.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 7.04k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 7.04k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 7.03k, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 7.03k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 7.03k, False: 1]
  |  |  ------------------
  ------------------
 5982|  7.03k|	SKIP(7);
  ------------------
  |  | 2285|  7.03k|#define SKIP(val) do {							\
  |  | 2286|  7.03k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  7.03k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 119, False: 6.91k]
  |  |  ------------------
  |  | 2288|  7.03k|        xmlParserGrow(ctxt);						\
  |  | 2289|  7.03k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 7.03k]
  |  |  ------------------
  ------------------
 5983|  7.03k|	return(XML_ATTRIBUTE_NMTOKEN);
 5984|  7.03k|     }
 5985|  23.4k|     return(xmlParseEnumeratedType(ctxt, tree));
 5986|   105k|}
xmlParseAttributeListDecl:
 5999|  86.5k|xmlParseAttributeListDecl(xmlParserCtxt *ctxt) {
 6000|  86.5k|    const xmlChar *elemName;
 6001|  86.5k|    const xmlChar *attrName;
 6002|  86.5k|    xmlEnumerationPtr tree;
 6003|       |
 6004|  86.5k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  86.5k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  86.5k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6004:9): [True: 0, False: 86.5k]
  |  Branch (6004:25): [True: 0, False: 86.5k]
  ------------------
 6005|      0|        return;
 6006|  86.5k|    SKIP(2);
  ------------------
  |  | 2285|  86.5k|#define SKIP(val) do {							\
  |  | 2286|  86.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  86.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 86.5k]
  |  |  ------------------
  |  | 2288|  86.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  86.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 86.5k]
  |  |  ------------------
  ------------------
 6007|       |
 6008|  86.5k|    if (CMP7(CUR_PTR, 'A', 'T', 'T', 'L', 'I', 'S', 'T')) {
  ------------------
  |  | 2275|  86.5k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   173k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   173k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   173k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 86.5k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 86.5k, False: 19]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  86.5k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 86.5k, False: 24]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 86.5k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 86.5k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 86.5k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 86.5k, False: 13]
  |  |  ------------------
  ------------------
 6009|  86.5k|#ifdef LIBXML_VALID_ENABLED
 6010|  86.5k|	int oldInputNr = ctxt->inputNr;
 6011|  86.5k|#endif
 6012|       |
 6013|  86.5k|	SKIP(7);
  ------------------
  |  | 2285|  86.5k|#define SKIP(val) do {							\
  |  | 2286|  86.5k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  86.5k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 363, False: 86.1k]
  |  |  ------------------
  |  | 2288|  86.5k|        xmlParserGrow(ctxt);						\
  |  | 2289|  86.5k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 86.5k]
  |  |  ------------------
  ------------------
 6014|  86.5k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  86.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6014:6): [True: 2.17k, False: 84.3k]
  ------------------
 6015|  2.17k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6016|  2.17k|		                 "Space required after '<!ATTLIST'\n");
 6017|  2.17k|	}
 6018|  86.5k|        elemName = xmlParseName(ctxt);
 6019|  86.5k|	if (elemName == NULL) {
  ------------------
  |  Branch (6019:6): [True: 979, False: 85.5k]
  ------------------
 6020|    979|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6021|    979|			   "ATTLIST: no name for Element\n");
 6022|    979|	    return;
 6023|    979|	}
 6024|  85.5k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  85.5k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6025|  85.5k|	GROW;
  ------------------
  |  | 2308|  85.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  85.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  85.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 79.4k, False: 6.05k]
  |  |  ------------------
  |  | 2309|  85.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  79.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 38.6k, False: 40.8k]
  |  |  ------------------
  |  | 2310|  85.5k|	xmlParserGrow(ctxt);
  ------------------
 6026|   144k|	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|   144k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW != '>') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   114k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6026:9): [True: 114k, False: 30.3k]
  |  Branch (6026:25): [True: 114k, False: 24]
  ------------------
 6027|   114k|	    int type;
 6028|   114k|	    int def;
 6029|   114k|	    xmlChar *defaultValue = NULL;
 6030|       |
 6031|   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: 13.2k]
  |  |  ------------------
  |  | 2309|   114k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   101k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 48.7k, False: 52.3k]
  |  |  ------------------
  |  | 2310|   114k|	xmlParserGrow(ctxt);
  ------------------
 6032|   114k|            tree = NULL;
 6033|   114k|	    attrName = xmlParseName(ctxt);
 6034|   114k|	    if (attrName == NULL) {
  ------------------
  |  Branch (6034:10): [True: 6.17k, False: 108k]
  ------------------
 6035|  6.17k|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6036|  6.17k|			       "ATTLIST: no name for Attribute\n");
 6037|  6.17k|		break;
 6038|  6.17k|	    }
 6039|   108k|	    GROW;
  ------------------
  |  | 2308|   108k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   108k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   108k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 95.1k, False: 13.0k]
  |  |  ------------------
  |  | 2309|   108k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  95.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 46.7k, False: 48.4k]
  |  |  ------------------
  |  | 2310|   108k|	xmlParserGrow(ctxt);
  ------------------
 6040|   108k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   108k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6040:10): [True: 2.74k, False: 105k]
  ------------------
 6041|  2.74k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6042|  2.74k|		        "Space required after the attribute name\n");
 6043|  2.74k|		break;
 6044|  2.74k|	    }
 6045|       |
 6046|   105k|	    type = xmlParseAttributeType(ctxt, &tree);
 6047|   105k|	    if (type <= 0) {
  ------------------
  |  Branch (6047:10): [True: 4.94k, False: 100k]
  ------------------
 6048|  4.94k|	        break;
 6049|  4.94k|	    }
 6050|       |
 6051|   100k|	    GROW;
  ------------------
  |  | 2308|   100k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   100k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   100k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 87.8k, False: 12.6k]
  |  |  ------------------
  |  | 2309|   100k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  87.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 41.6k, False: 46.2k]
  |  |  ------------------
  |  | 2310|   100k|	xmlParserGrow(ctxt);
  ------------------
 6052|   100k|	    if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|   100k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6052:10): [True: 2.32k, False: 98.2k]
  ------------------
 6053|  2.32k|		xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6054|  2.32k|			       "Space required after the attribute type\n");
 6055|  2.32k|	        if (tree != NULL)
  ------------------
  |  Branch (6055:14): [True: 937, False: 1.38k]
  ------------------
 6056|    937|		    xmlFreeEnumeration(tree);
 6057|  2.32k|		break;
 6058|  2.32k|	    }
 6059|       |
 6060|  98.2k|	    def = xmlParseDefaultDecl(ctxt, &defaultValue);
 6061|  98.2k|	    if (def <= 0) {
  ------------------
  |  Branch (6061:10): [True: 0, False: 98.2k]
  ------------------
 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|  98.2k|	    if ((type != XML_ATTRIBUTE_CDATA) && (defaultValue != NULL))
  ------------------
  |  Branch (6068:10): [True: 85.8k, False: 12.3k]
  |  Branch (6068:43): [True: 30.4k, False: 55.4k]
  ------------------
 6069|  30.4k|	        xmlAttrNormalizeSpace(defaultValue, defaultValue);
 6070|       |
 6071|  98.2k|	    GROW;
  ------------------
  |  | 2308|  98.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  98.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  98.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 85.6k, False: 12.5k]
  |  |  ------------------
  |  | 2309|  98.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  85.6k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 64.8k, False: 20.8k]
  |  |  ------------------
  |  | 2310|  98.2k|	xmlParserGrow(ctxt);
  ------------------
 6072|  98.2k|            if (RAW != '>') {
  ------------------
  |  | 2261|  98.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6072:17): [True: 73.9k, False: 24.2k]
  ------------------
 6073|  73.9k|		if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  73.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6073:7): [True: 39.0k, False: 34.9k]
  ------------------
 6074|  39.0k|		    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6075|  39.0k|			"Space required after the attribute default value\n");
 6076|  39.0k|		    if (defaultValue != NULL)
  ------------------
  |  Branch (6076:11): [True: 592, False: 38.4k]
  ------------------
 6077|    592|			xmlFree(defaultValue);
 6078|  39.0k|		    if (tree != NULL)
  ------------------
  |  Branch (6078:11): [True: 2.44k, False: 36.5k]
  ------------------
 6079|  2.44k|			xmlFreeEnumeration(tree);
 6080|  39.0k|		    break;
 6081|  39.0k|		}
 6082|  73.9k|	    }
 6083|  59.1k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6083:10): [True: 59.1k, False: 0]
  |  Branch (6083:33): [True: 56.0k, False: 3.12k]
  ------------------
 6084|  56.0k|		(ctxt->sax->attributeDecl != NULL))
  ------------------
  |  Branch (6084:3): [True: 56.0k, False: 0]
  ------------------
 6085|  56.0k|		ctxt->sax->attributeDecl(ctxt->userData, elemName, attrName,
 6086|  56.0k|	                        type, def, defaultValue, tree);
 6087|  3.12k|	    else if (tree != NULL)
  ------------------
  |  Branch (6087:15): [True: 803, False: 2.32k]
  ------------------
 6088|    803|		xmlFreeEnumeration(tree);
 6089|       |
 6090|  59.1k|	    if ((ctxt->sax2) && (defaultValue != NULL) &&
  ------------------
  |  Branch (6090:10): [True: 47.1k, False: 12.0k]
  |  Branch (6090:26): [True: 24.7k, False: 22.3k]
  ------------------
 6091|  24.7k|	        (def != XML_ATTRIBUTE_IMPLIED) &&
  ------------------
  |  Branch (6091:10): [True: 24.7k, False: 0]
  ------------------
 6092|  24.7k|		(def != XML_ATTRIBUTE_REQUIRED)) {
  ------------------
  |  Branch (6092:3): [True: 24.7k, False: 0]
  ------------------
 6093|  24.7k|		xmlAddDefAttrs(ctxt, elemName, attrName, defaultValue);
 6094|  24.7k|	    }
 6095|  59.1k|	    if (ctxt->sax2) {
  ------------------
  |  Branch (6095:10): [True: 47.1k, False: 12.0k]
  ------------------
 6096|  47.1k|		xmlAddSpecialAttr(ctxt, elemName, attrName, type);
 6097|  47.1k|	    }
 6098|  59.1k|	    if (defaultValue != NULL)
  ------------------
  |  Branch (6098:10): [True: 32.1k, False: 27.0k]
  ------------------
 6099|  32.1k|	        xmlFree(defaultValue);
 6100|  59.1k|	    GROW;
  ------------------
  |  | 2308|  59.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  59.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 46.9k, False: 12.2k]
  |  |  ------------------
  |  | 2309|  59.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  46.9k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 20.1k, False: 26.8k]
  |  |  ------------------
  |  | 2310|  59.1k|	xmlParserGrow(ctxt);
  ------------------
 6101|  59.1k|	}
 6102|  85.5k|	if (RAW == '>') {
  ------------------
  |  | 2261|  85.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6102:6): [True: 31.3k, False: 54.1k]
  ------------------
 6103|  31.3k|#ifdef LIBXML_VALID_ENABLED
 6104|  31.3k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6104:10): [True: 25.0k, False: 6.33k]
  |  Branch (6104:30): [True: 178, False: 24.8k]
  ------------------
 6105|    178|		xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6106|    178|                                 "Attribute list declaration doesn't start and"
 6107|    178|                                 " stop in the same entity\n",
 6108|    178|                                 NULL, NULL);
 6109|    178|	    }
 6110|  31.3k|#endif
 6111|  31.3k|	    NEXT;
  ------------------
  |  | 2316|  31.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6112|  31.3k|	}
 6113|  85.5k|    }
 6114|  86.5k|}
xmlParseElementMixedContentDecl:
 6179|  6.92k|xmlParseElementMixedContentDecl(xmlParserCtxt *ctxt, int openInputNr) {
 6180|  6.92k|    xmlElementContentPtr ret = NULL, cur = NULL, n;
 6181|  6.92k|    const xmlChar *elem = NULL;
 6182|       |
 6183|  6.92k|    GROW;
  ------------------
  |  | 2308|  6.92k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.92k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.92k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 5.32k, False: 1.59k]
  |  |  ------------------
  |  | 2309|  6.92k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  5.32k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.83k, False: 2.49k]
  |  |  ------------------
  |  | 2310|  6.92k|	xmlParserGrow(ctxt);
  ------------------
 6184|  6.92k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  6.92k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  13.8k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  13.8k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  13.8k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 6.92k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 6.92k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  6.92k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 6.92k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 6.92k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 6.92k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 6.92k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 6.92k, False: 0]
  |  |  ------------------
  ------------------
 6185|  6.92k|	SKIP(7);
  ------------------
  |  | 2285|  6.92k|#define SKIP(val) do {							\
  |  | 2286|  6.92k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.92k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 205, False: 6.71k]
  |  |  ------------------
  |  | 2288|  6.92k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.92k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.92k]
  |  |  ------------------
  ------------------
 6186|  6.92k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6187|  6.92k|	if (RAW == ')') {
  ------------------
  |  | 2261|  6.92k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6187:6): [True: 3.64k, False: 3.27k]
  ------------------
 6188|  3.64k|#ifdef LIBXML_VALID_ENABLED
 6189|  3.64k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6189:10): [True: 2.52k, False: 1.12k]
  |  Branch (6189:30): [True: 10, False: 2.51k]
  ------------------
 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.64k|#endif
 6196|  3.64k|	    NEXT;
  ------------------
  |  | 2316|  3.64k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6197|  3.64k|	    ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6198|  3.64k|	    if (ret == NULL)
  ------------------
  |  Branch (6198:10): [True: 1, False: 3.64k]
  ------------------
 6199|      1|                goto mem_error;
 6200|  3.64k|	    if (RAW == '*') {
  ------------------
  |  | 2261|  3.64k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6200:10): [True: 146, False: 3.49k]
  ------------------
 6201|    146|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6202|    146|		NEXT;
  ------------------
  |  | 2316|    146|#define NEXT xmlNextChar(ctxt)
  ------------------
 6203|    146|	    }
 6204|  3.64k|	    return(ret);
 6205|  3.64k|	}
 6206|  3.27k|	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  3.27k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '(') || (RAW == '|')) {
  ------------------
  |  | 2261|  3.27k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6206:6): [True: 1, False: 3.27k]
  |  Branch (6206:22): [True: 2.53k, False: 744]
  ------------------
 6207|  2.53k|	    ret = cur = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
 6208|  2.53k|	    if (ret == NULL)
  ------------------
  |  Branch (6208:10): [True: 1, False: 2.53k]
  ------------------
 6209|      1|                goto mem_error;
 6210|  2.53k|	}
 6211|  21.3k|	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  | 2261|  21.3k|#define RAW (*ctxt->input->cur)
  ------------------
              	while ((RAW == '|') && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  18.2k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6211:9): [True: 18.2k, False: 3.12k]
  |  Branch (6211:25): [True: 18.2k, False: 1]
  ------------------
 6212|  18.2k|	    NEXT;
  ------------------
  |  | 2316|  18.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6213|  18.2k|            n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6214|  18.2k|            if (n == NULL)
  ------------------
  |  Branch (6214:17): [True: 2, False: 18.2k]
  ------------------
 6215|      2|                goto mem_error;
 6216|  18.2k|	    if (elem == NULL) {
  ------------------
  |  Branch (6216:10): [True: 2.52k, False: 15.6k]
  ------------------
 6217|  2.52k|		n->c1 = cur;
 6218|  2.52k|		if (cur != NULL)
  ------------------
  |  Branch (6218:7): [True: 2.52k, False: 0]
  ------------------
 6219|  2.52k|		    cur->parent = n;
 6220|  2.52k|		ret = cur = n;
 6221|  15.6k|	    } else {
 6222|  15.6k|	        cur->c2 = n;
 6223|  15.6k|		n->parent = cur;
 6224|  15.6k|		n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6225|  15.6k|                if (n->c1 == NULL)
  ------------------
  |  Branch (6225:21): [True: 2, False: 15.6k]
  ------------------
 6226|      2|                    goto mem_error;
 6227|  15.6k|		n->c1->parent = n;
 6228|  15.6k|		cur = n;
 6229|  15.6k|	    }
 6230|  18.2k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6231|  18.2k|	    elem = xmlParseName(ctxt);
 6232|  18.2k|	    if (elem == NULL) {
  ------------------
  |  Branch (6232:10): [True: 151, False: 18.0k]
  ------------------
 6233|    151|		xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6234|    151|			"xmlParseElementMixedContentDecl : Name expected\n");
 6235|    151|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6236|    151|		return(NULL);
 6237|    151|	    }
 6238|  18.0k|            xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6239|  18.0k|	}
 6240|  3.12k|	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2261|  3.12k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == ')') && (NXT(1) == '*')) {
  ------------------
  |  | 2263|  2.30k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6240:6): [True: 2.30k, False: 812]
  |  Branch (6240:22): [True: 2.30k, False: 6]
  ------------------
 6241|  2.30k|	    if (elem != NULL) {
  ------------------
  |  Branch (6241:10): [True: 2.30k, False: 0]
  ------------------
 6242|  2.30k|		cur->c2 = xmlNewDocElementContent(ctxt->myDoc, elem,
 6243|  2.30k|		                               XML_ELEMENT_CONTENT_ELEMENT);
 6244|  2.30k|		if (cur->c2 == NULL)
  ------------------
  |  Branch (6244:7): [True: 1, False: 2.30k]
  ------------------
 6245|      1|                    goto mem_error;
 6246|  2.30k|		cur->c2->parent = cur;
 6247|  2.30k|            }
 6248|  2.30k|            if (ret != NULL)
  ------------------
  |  Branch (6248:17): [True: 2.30k, False: 0]
  ------------------
 6249|  2.30k|                ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6250|  2.30k|#ifdef LIBXML_VALID_ENABLED
 6251|  2.30k|	    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6251:10): [True: 1.93k, False: 363]
  |  Branch (6251:30): [True: 1, False: 1.93k]
  ------------------
 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.30k|#endif
 6258|  2.30k|	    SKIP(2);
  ------------------
  |  | 2285|  2.30k|#define SKIP(val) do {							\
  |  | 2286|  2.30k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.30k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 472, False: 1.83k]
  |  |  ------------------
  |  | 2288|  2.30k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.30k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.30k]
  |  |  ------------------
  ------------------
 6259|  2.30k|	} else {
 6260|    818|	    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6261|    818|	    xmlFatalErr(ctxt, XML_ERR_MIXED_NOT_STARTED, NULL);
 6262|    818|	    return(NULL);
 6263|    818|	}
 6264|       |
 6265|  3.12k|    } else {
 6266|      0|	xmlFatalErr(ctxt, XML_ERR_PCDATA_REQUIRED, NULL);
 6267|      0|    }
 6268|  2.30k|    return(ret);
 6269|       |
 6270|      7|mem_error:
 6271|      7|    xmlErrMemory(ctxt);
 6272|      7|    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6273|       |    return(NULL);
 6274|  6.92k|}
xmlParseElementContentDecl:
 6629|  16.3k|                           xmlElementContent **result) {
 6630|       |
 6631|  16.3k|    xmlElementContentPtr tree = NULL;
 6632|  16.3k|    int openInputNr = ctxt->inputNr;
 6633|  16.3k|    int res;
 6634|       |
 6635|  16.3k|    *result = NULL;
 6636|       |
 6637|  16.3k|    if (RAW != '(') {
  ------------------
  |  | 2261|  16.3k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6637:9): [True: 0, False: 16.3k]
  ------------------
 6638|      0|	xmlFatalErrMsgStr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6639|      0|		"xmlParseElementContentDecl : %s '(' expected\n", name);
 6640|      0|	return(-1);
 6641|      0|    }
 6642|  16.3k|    NEXT;
  ------------------
  |  | 2316|  16.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6643|  16.3k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6644|  16.3k|    if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
  ------------------
  |  | 2275|  16.3k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  32.7k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  32.7k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  32.7k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 6.94k, False: 9.44k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 6.93k, False: 6]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  16.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 6.93k, False: 2]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 6.93k, False: 2]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 6.93k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 6.93k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 6.92k, False: 8]
  |  |  ------------------
  ------------------
 6645|  6.92k|        tree = xmlParseElementMixedContentDecl(ctxt, openInputNr);
 6646|  6.92k|	res = XML_ELEMENT_TYPE_MIXED;
 6647|  9.46k|    } else {
 6648|  9.46k|        tree = xmlParseElementChildrenContentDeclPriv(ctxt, openInputNr, 1);
 6649|  9.46k|	res = XML_ELEMENT_TYPE_ELEMENT;
 6650|  9.46k|    }
 6651|  16.3k|    if (tree == NULL)
  ------------------
  |  Branch (6651:9): [True: 3.36k, False: 13.0k]
  ------------------
 6652|  3.36k|        return(-1);
 6653|  13.0k|    SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  13.0k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6654|  13.0k|    *result = tree;
 6655|  13.0k|    return(res);
 6656|  16.3k|}
xmlParseElementDecl:
 6672|  25.7k|xmlParseElementDecl(xmlParserCtxt *ctxt) {
 6673|  25.7k|    const xmlChar *name;
 6674|  25.7k|    int ret = -1;
 6675|  25.7k|    xmlElementContentPtr content  = NULL;
 6676|       |
 6677|  25.7k|    if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2262|  25.7k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!'))
  ------------------
  |  | 2263|  25.7k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6677:9): [True: 0, False: 25.7k]
  |  Branch (6677:25): [True: 0, False: 25.7k]
  ------------------
 6678|      0|        return(ret);
 6679|  25.7k|    SKIP(2);
  ------------------
  |  | 2285|  25.7k|#define SKIP(val) do {							\
  |  | 2286|  25.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  25.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 25.7k]
  |  |  ------------------
  |  | 2288|  25.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  25.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 25.7k]
  |  |  ------------------
  ------------------
 6680|       |
 6681|       |    /* GROW; done in the caller */
 6682|  25.7k|    if (CMP7(CUR_PTR, 'E', 'L', 'E', 'M', 'E', 'N', 'T')) {
  ------------------
  |  | 2275|  25.7k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|  51.5k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|  51.5k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|  51.5k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 25.7k, False: 0]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 25.7k, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  25.7k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 25.7k, False: 18]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 25.7k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 25.7k, False: 14]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 25.7k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 25.7k, False: 4]
  |  |  ------------------
  ------------------
 6683|  25.7k|#ifdef LIBXML_VALID_ENABLED
 6684|  25.7k|	int oldInputNr = ctxt->inputNr;
 6685|  25.7k|#endif
 6686|       |
 6687|  25.7k|	SKIP(7);
  ------------------
  |  | 2285|  25.7k|#define SKIP(val) do {							\
  |  | 2286|  25.7k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  25.7k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 286, False: 25.4k]
  |  |  ------------------
  |  | 2288|  25.7k|        xmlParserGrow(ctxt);						\
  |  | 2289|  25.7k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 25.7k]
  |  |  ------------------
  ------------------
 6688|  25.7k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  25.7k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6688:6): [True: 329, False: 25.4k]
  ------------------
 6689|    329|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6690|    329|		           "Space required after 'ELEMENT'\n");
 6691|    329|	    return(-1);
 6692|    329|	}
 6693|  25.4k|        name = xmlParseName(ctxt);
 6694|  25.4k|	if (name == NULL) {
  ------------------
  |  Branch (6694:6): [True: 404, False: 24.9k]
  ------------------
 6695|    404|	    xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 6696|    404|			   "xmlParseElementDecl: no name for Element\n");
 6697|    404|	    return(-1);
 6698|    404|	}
 6699|  24.9k|	if (SKIP_BLANKS_PE == 0) {
  ------------------
  |  | 2314|  24.9k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
  |  Branch (6699:6): [True: 1.59k, False: 23.3k]
  ------------------
 6700|  1.59k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 6701|  1.59k|			   "Space required after the element name\n");
 6702|  1.59k|	}
 6703|  24.9k|	if (CMP5(CUR_PTR, 'E', 'M', 'P', 'T', 'Y')) {
  ------------------
  |  | 2271|  24.9k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  49.9k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 6.35k, False: 18.6k]
  |  |  |  |  |  Branch (2268:41): [True: 6.34k, False: 9]
  |  |  |  |  ------------------
  |  |  |  | 2269|  24.9k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 6.34k, False: 3]
  |  |  |  |  |  Branch (2269:41): [True: 6.34k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 6.33k, False: 4]
  |  |  ------------------
  ------------------
 6704|  6.33k|	    SKIP(5);
  ------------------
  |  | 2285|  6.33k|#define SKIP(val) do {							\
  |  | 2286|  6.33k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  6.33k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 81, False: 6.25k]
  |  |  ------------------
  |  | 2288|  6.33k|        xmlParserGrow(ctxt);						\
  |  | 2289|  6.33k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 6.33k]
  |  |  ------------------
  ------------------
 6705|       |	    /*
 6706|       |	     * Element must always be empty.
 6707|       |	     */
 6708|  6.33k|	    ret = XML_ELEMENT_TYPE_EMPTY;
 6709|  18.6k|	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2261|  18.6k|#define RAW (*ctxt->input->cur)
  ------------------
              	} else if ((RAW == 'A') && (NXT(1) == 'N') &&
  ------------------
  |  | 2263|  1.25k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6709:13): [True: 1.25k, False: 17.4k]
  |  Branch (6709:29): [True: 1.25k, False: 1]
  ------------------
 6710|  1.25k|	           (NXT(2) == 'Y')) {
  ------------------
  |  | 2263|  1.25k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6710:13): [True: 1.25k, False: 1]
  ------------------
 6711|  1.25k|	    SKIP(3);
  ------------------
  |  | 2285|  1.25k|#define SKIP(val) do {							\
  |  | 2286|  1.25k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.25k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 130, False: 1.12k]
  |  |  ------------------
  |  | 2288|  1.25k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.25k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.25k]
  |  |  ------------------
  ------------------
 6712|       |	    /*
 6713|       |	     * Element is a generic container.
 6714|       |	     */
 6715|  1.25k|	    ret = XML_ELEMENT_TYPE_ANY;
 6716|  17.4k|	} else if (RAW == '(') {
  ------------------
  |  | 2261|  17.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6716:13): [True: 16.3k, False: 1.01k]
  ------------------
 6717|  16.3k|	    ret = xmlParseElementContentDecl(ctxt, name, &content);
 6718|  16.3k|            if (ret <= 0)
  ------------------
  |  Branch (6718:17): [True: 3.36k, False: 13.0k]
  ------------------
 6719|  3.36k|                return(-1);
 6720|  16.3k|	} else {
 6721|       |	    /*
 6722|       |	     * [ WFC: PEs in Internal Subset ] error handling.
 6723|       |	     */
 6724|  1.01k|            xmlFatalErrMsg(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED,
 6725|  1.01k|                  "xmlParseElementDecl: 'EMPTY', 'ANY' or '(' expected\n");
 6726|  1.01k|	    return(-1);
 6727|  1.01k|	}
 6728|       |
 6729|  20.6k|	SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  20.6k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6730|       |
 6731|  20.6k|	if (RAW != '>') {
  ------------------
  |  | 2261|  20.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6731:6): [True: 1.45k, False: 19.1k]
  ------------------
 6732|  1.45k|	    xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 6733|  1.45k|	    if (content != NULL) {
  ------------------
  |  Branch (6733:10): [True: 972, False: 483]
  ------------------
 6734|    972|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6735|    972|	    }
 6736|  19.1k|	} else {
 6737|  19.1k|#ifdef LIBXML_VALID_ENABLED
 6738|  19.1k|	    if ((ctxt->validate) && (ctxt->inputNr > oldInputNr)) {
  ------------------
  |  Branch (6738:10): [True: 14.2k, False: 4.95k]
  |  Branch (6738:30): [True: 70, False: 14.1k]
  ------------------
 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|  19.1k|#endif
 6745|       |
 6746|  19.1k|	    NEXT;
  ------------------
  |  | 2316|  19.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6747|  19.1k|	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (6747:10): [True: 19.1k, False: 0]
  |  Branch (6747:33): [True: 16.9k, False: 2.20k]
  ------------------
 6748|  16.9k|		(ctxt->sax->elementDecl != NULL)) {
  ------------------
  |  Branch (6748:3): [True: 16.9k, False: 0]
  ------------------
 6749|  16.9k|		if (content != NULL)
  ------------------
  |  Branch (6749:7): [True: 10.7k, False: 6.21k]
  ------------------
 6750|  10.7k|		    content->parent = NULL;
 6751|  16.9k|	        ctxt->sax->elementDecl(ctxt->userData, name, ret,
 6752|  16.9k|		                       content);
 6753|  16.9k|		if ((content != NULL) && (content->parent == NULL)) {
  ------------------
  |  Branch (6753:7): [True: 10.7k, False: 6.21k]
  |  Branch (6753:28): [True: 2.81k, False: 7.93k]
  ------------------
 6754|       |		    /*
 6755|       |		     * this is a trick: if xmlAddElementDecl is called,
 6756|       |		     * instead of copying the full tree it is plugged directly
 6757|       |		     * if called from the parser. Avoid duplicating the
 6758|       |		     * interfaces or change the API/ABI
 6759|       |		     */
 6760|  2.81k|		    xmlFreeDocElementContent(ctxt->myDoc, content);
 6761|  2.81k|		}
 6762|  16.9k|	    } else if (content != NULL) {
  ------------------
  |  Branch (6762:17): [True: 1.30k, False: 894]
  ------------------
 6763|  1.30k|		xmlFreeDocElementContent(ctxt->myDoc, content);
 6764|  1.30k|	    }
 6765|  19.1k|	}
 6766|  20.6k|    }
 6767|  20.6k|    return(ret);
 6768|  25.7k|}
xmlParseMarkupDecl:
 6943|   599k|xmlParseMarkupDecl(xmlParserCtxt *ctxt) {
 6944|   599k|    GROW;
  ------------------
  |  | 2308|   599k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   599k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   599k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 565k, False: 33.8k]
  |  |  ------------------
  |  | 2309|   599k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   565k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 230k, False: 334k]
  |  |  ------------------
  |  | 2310|   599k|	xmlParserGrow(ctxt);
  ------------------
 6945|   599k|    if (CUR == '<') {
  ------------------
  |  | 2262|   599k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6945:9): [True: 599k, False: 0]
  ------------------
 6946|   599k|        if (NXT(1) == '!') {
  ------------------
  |  | 2263|   599k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6946:13): [True: 574k, False: 25.2k]
  ------------------
 6947|   574k|	    switch (NXT(2)) {
  ------------------
  |  | 2263|   574k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
 6948|   218k|	        case 'E':
  ------------------
  |  Branch (6948:10): [True: 218k, False: 355k]
  ------------------
 6949|   218k|		    if (NXT(3) == 'L')
  ------------------
  |  | 2263|   218k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6949:11): [True: 25.7k, False: 192k]
  ------------------
 6950|  25.7k|			xmlParseElementDecl(ctxt);
 6951|   192k|		    else if (NXT(3) == 'N')
  ------------------
  |  | 2263|   192k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6951:16): [True: 192k, False: 37]
  ------------------
 6952|   192k|			xmlParseEntityDecl(ctxt);
 6953|     37|                    else
 6954|     37|                        SKIP(2);
  ------------------
  |  | 2285|     37|#define SKIP(val) do {							\
  |  | 2286|     37|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|     37|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 37]
  |  |  ------------------
  |  | 2288|     37|        xmlParserGrow(ctxt);						\
  |  | 2289|     37|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 37]
  |  |  ------------------
  ------------------
 6955|   218k|		    break;
 6956|  86.5k|	        case 'A':
  ------------------
  |  Branch (6956:10): [True: 86.5k, False: 487k]
  ------------------
 6957|  86.5k|		    xmlParseAttributeListDecl(ctxt);
 6958|  86.5k|		    break;
 6959|  3.61k|	        case 'N':
  ------------------
  |  Branch (6959:10): [True: 3.61k, False: 570k]
  ------------------
 6960|  3.61k|		    xmlParseNotationDecl(ctxt);
 6961|  3.61k|		    break;
 6962|   255k|	        case '-':
  ------------------
  |  Branch (6962:10): [True: 255k, False: 319k]
  ------------------
 6963|   255k|		    xmlParseComment(ctxt);
 6964|   255k|		    break;
 6965|  10.3k|		default:
  ------------------
  |  Branch (6965:3): [True: 10.3k, False: 563k]
  ------------------
 6966|  10.3k|                    xmlFatalErr(ctxt,
 6967|  10.3k|                                ctxt->inSubset == 2 ?
  ------------------
  |  Branch (6967:33): [True: 890, False: 9.44k]
  ------------------
 6968|    890|                                    XML_ERR_EXT_SUBSET_NOT_FINISHED :
 6969|  10.3k|                                    XML_ERR_INT_SUBSET_NOT_FINISHED,
 6970|  10.3k|                                NULL);
 6971|  10.3k|                    SKIP(2);
  ------------------
  |  | 2285|  10.3k|#define SKIP(val) do {							\
  |  | 2286|  10.3k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  10.3k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 296, False: 10.0k]
  |  |  ------------------
  |  | 2288|  10.3k|        xmlParserGrow(ctxt);						\
  |  | 2289|  10.3k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 10.3k]
  |  |  ------------------
  ------------------
 6972|  10.3k|		    break;
 6973|   574k|	    }
 6974|   574k|	} else if (NXT(1) == '?') {
  ------------------
  |  | 2263|  25.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6974:13): [True: 25.2k, False: 0]
  ------------------
 6975|  25.2k|	    xmlParsePI(ctxt);
 6976|  25.2k|	}
 6977|   599k|    }
 6978|   599k|}
xmlParseTextDecl:
 6990|   215k|xmlParseTextDecl(xmlParserCtxt *ctxt) {
 6991|   215k|    xmlChar *version;
 6992|       |
 6993|       |    /*
 6994|       |     * We know that '<?xml' is here.
 6995|       |     */
 6996|   215k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   215k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   430k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 215k, False: 0]
  |  |  |  |  |  Branch (2268:41): [True: 215k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2269|   215k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 215k, False: 0]
  |  |  |  |  |  Branch (2269:41): [True: 215k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 215k, False: 0]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   215k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   215k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 212k, False: 2.47k]
  |  |  |  |  ------------------
  |  |  |  |   91|   215k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.47k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.18k, False: 1.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|   215k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.29k, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6997|   215k|	SKIP(5);
  ------------------
  |  | 2285|   215k|#define SKIP(val) do {							\
  |  | 2286|   215k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   215k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 215k]
  |  |  ------------------
  |  | 2288|   215k|        xmlParserGrow(ctxt);						\
  |  | 2289|   215k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 215k]
  |  |  ------------------
  ------------------
 6998|   215k|    } else {
 6999|      8|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_STARTED, NULL);
 7000|      8|	return;
 7001|      8|    }
 7002|       |
 7003|   215k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   215k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7003:9): [True: 0, False: 215k]
  ------------------
 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|   215k|    version = xmlParseVersionInfo(ctxt);
 7012|   215k|    if (version == NULL) {
  ------------------
  |  Branch (7012:9): [True: 208k, False: 6.56k]
  ------------------
 7013|   208k|	version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|   208k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
 7014|   208k|        if (version == NULL) {
  ------------------
  |  Branch (7014:13): [True: 8, False: 208k]
  ------------------
 7015|      8|            xmlErrMemory(ctxt);
 7016|      8|            return;
 7017|      8|        }
 7018|   208k|    } else {
 7019|  6.56k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  6.56k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7019:6): [True: 617, False: 5.95k]
  ------------------
 7020|    617|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7021|    617|		           "Space needed here\n");
 7022|    617|	}
 7023|  6.56k|    }
 7024|   215k|    ctxt->input->version = version;
 7025|       |
 7026|       |    /*
 7027|       |     * We must have the encoding declaration
 7028|       |     */
 7029|   215k|    xmlParseEncodingDecl(ctxt);
 7030|       |
 7031|   215k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   215k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7032|   215k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   215k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  3.31k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7032:9): [True: 3.31k, False: 211k]
  |  Branch (7032:25): [True: 2.61k, False: 695]
  ------------------
 7033|  2.61k|        SKIP(2);
  ------------------
  |  | 2285|  2.61k|#define SKIP(val) do {							\
  |  | 2286|  2.61k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.61k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 483, False: 2.13k]
  |  |  ------------------
  |  | 2288|  2.61k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.61k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.61k]
  |  |  ------------------
  ------------------
 7034|   212k|    } else if (RAW == '>') {
  ------------------
  |  | 2261|   212k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7034:16): [True: 334, False: 212k]
  ------------------
 7035|       |        /* Deprecated old WD ... */
 7036|    334|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7037|    334|	NEXT;
  ------------------
  |  | 2316|    334|#define NEXT xmlNextChar(ctxt)
  ------------------
 7038|   212k|    } else {
 7039|   212k|        int c;
 7040|       |
 7041|   212k|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
 7042|   657M|        while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  |   44|   657M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
                      while ((PARSER_STOPPED(ctxt) == 0) && ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   657M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (7042:16): [True: 657M, False: 44]
  |  Branch (7042:47): [True: 657M, False: 10.0k]
  ------------------
 7043|   657M|            NEXT;
  ------------------
  |  | 2316|   657M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7044|   657M|            if (c == '>')
  ------------------
  |  Branch (7044:17): [True: 202k, False: 657M]
  ------------------
 7045|   202k|                break;
 7046|   657M|        }
 7047|   212k|    }
 7048|   215k|}
xmlParseExternalSubset:
 7065|  1.60k|                       const xmlChar *systemId) {
 7066|  1.60k|    int oldInputNr;
 7067|       |
 7068|  1.60k|    xmlCtxtInitializeLate(ctxt);
 7069|       |
 7070|  1.60k|    xmlDetectEncoding(ctxt);
 7071|       |
 7072|  1.60k|    if (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) {
  ------------------
  |  | 2271|  1.60k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  3.21k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.47k, False: 134]
  |  |  |  |  |  Branch (2268:41): [True: 152, False: 1.32k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  1.60k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 113, False: 39]
  |  |  |  |  |  Branch (2269:41): [True: 110, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 98, False: 12]
  |  |  ------------------
  ------------------
 7073|     98|	xmlParseTextDecl(ctxt);
 7074|     98|    }
 7075|  1.60k|    if (ctxt->myDoc == NULL) {
  ------------------
  |  Branch (7075:9): [True: 0, False: 1.60k]
  ------------------
 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.60k|    if ((ctxt->myDoc->intSubset == NULL) &&
  ------------------
  |  Branch (7083:9): [True: 0, False: 1.60k]
  ------------------
 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.60k|    ctxt->inSubset = 2;
 7089|  1.60k|    oldInputNr = ctxt->inputNr;
 7090|       |
 7091|  1.60k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.60k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7092|   166k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   166k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (7092:12): [True: 165k, False: 135]
  ------------------
 7093|   165k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (7093:13): [True: 1.77k, False: 164k]
  ------------------
 7094|  1.77k|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (7094:17): [True: 700, False: 1.07k]
  ------------------
 7095|    700|                xmlParserCheckEOF(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED);
 7096|    700|                break;
 7097|    700|            }
 7098|       |
 7099|  1.07k|            xmlPopPE(ctxt);
 7100|   164k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   164k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   161k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   146k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7100:20): [True: 161k, False: 3.04k]
  |  Branch (7100:36): [True: 146k, False: 15.0k]
  |  Branch (7100:55): [True: 1.25k, False: 144k]
  ------------------
 7101|  1.25k|            xmlParseConditionalSections(ctxt);
 7102|   162k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   162k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   159k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  15.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7102:20): [True: 159k, False: 3.04k]
  |  Branch (7102:37): [True: 144k, False: 15.0k]
  |  Branch (7102:56): [True: 14.9k, False: 67]
  ------------------
 7103|   159k|            xmlParseMarkupDecl(ctxt);
 7104|   159k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  3.10k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7104:20): [True: 2.33k, False: 771]
  ------------------
 7105|  2.33k|            xmlParsePERefInternal(ctxt, 1);
 7106|  2.33k|        } else {
 7107|    771|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 7108|       |
 7109|    948|            while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (7109:20): [True: 177, False: 771]
  ------------------
 7110|    177|                xmlPopPE(ctxt);
 7111|    771|            break;
 7112|    771|        }
 7113|   164k|        SKIP_BLANKS;
  ------------------
  |  | 2312|   164k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7114|   164k|        SHRINK;
  ------------------
  |  | 2304|   164k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   164k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   164k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 164k, False: 0]
  |  |  ------------------
  |  | 2305|   164k|	xmlParserShrink(ctxt);
  ------------------
 7115|   164k|        GROW;
  ------------------
  |  | 2308|   164k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   164k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   164k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 164k, False: 0]
  |  |  ------------------
  |  | 2309|   164k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   164k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.2k, False: 154k]
  |  |  ------------------
  |  | 2310|   164k|	xmlParserGrow(ctxt);
  ------------------
 7116|   164k|    }
 7117|  1.60k|}
xmlParseReference:
 7133|   132k|xmlParseReference(xmlParserCtxt *ctxt) {
 7134|   132k|    xmlEntityPtr ent = NULL;
 7135|   132k|    const xmlChar *name;
 7136|   132k|    xmlChar *val;
 7137|       |
 7138|   132k|    if (RAW != '&')
  ------------------
  |  | 2261|   132k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7138:9): [True: 0, False: 132k]
  ------------------
 7139|      0|        return;
 7140|       |
 7141|       |    /*
 7142|       |     * Simple case of a CharRef
 7143|       |     */
 7144|   132k|    if (NXT(1) == '#') {
  ------------------
  |  | 2263|   132k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (7144:9): [True: 41.0k, False: 91.7k]
  ------------------
 7145|  41.0k|	int i = 0;
 7146|  41.0k|	xmlChar out[16];
 7147|  41.0k|	int value = xmlParseCharRef(ctxt);
 7148|       |
 7149|  41.0k|	if (value == 0)
  ------------------
  |  Branch (7149:6): [True: 8.01k, False: 33.0k]
  ------------------
 7150|  8.01k|	    return;
 7151|       |
 7152|       |        /*
 7153|       |         * Just encode the value in UTF-8
 7154|       |         */
 7155|  33.0k|        COPY_BUF(out, i, value);
  ------------------
  |  | 2333|  33.0k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 32.4k, False: 597]
  |  |  ------------------
  |  | 2334|  33.0k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 7156|  33.0k|        out[i] = 0;
 7157|  33.0k|        if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7157:13): [True: 33.0k, False: 0]
  |  Branch (7157:36): [True: 33.0k, False: 0]
  ------------------
 7158|  33.0k|            (!ctxt->disableSAX))
  ------------------
  |  Branch (7158:13): [True: 6.93k, False: 26.0k]
  ------------------
 7159|  6.93k|            ctxt->sax->characters(ctxt->userData, out, i);
 7160|  33.0k|	return;
 7161|  41.0k|    }
 7162|       |
 7163|       |    /*
 7164|       |     * We are seeing an entity reference
 7165|       |     */
 7166|  91.7k|    name = xmlParseEntityRefInternal(ctxt);
 7167|  91.7k|    if (name == NULL)
  ------------------
  |  Branch (7167:9): [True: 20.8k, False: 70.8k]
  ------------------
 7168|  20.8k|        return;
 7169|  70.8k|    ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 0);
 7170|  70.8k|    if (ent == NULL) {
  ------------------
  |  Branch (7170:9): [True: 44.2k, False: 26.5k]
  ------------------
 7171|       |        /*
 7172|       |         * Create a reference for undeclared entities.
 7173|       |         */
 7174|  44.2k|        if ((ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7174:13): [True: 34.4k, False: 9.88k]
  ------------------
 7175|  34.4k|            (ctxt->sax != NULL) &&
  ------------------
  |  Branch (7175:13): [True: 34.4k, False: 0]
  ------------------
 7176|  34.4k|            (ctxt->disableSAX == 0) &&
  ------------------
  |  Branch (7176:13): [True: 20.8k, False: 13.5k]
  ------------------
 7177|  20.8k|            (ctxt->sax->reference != NULL)) {
  ------------------
  |  Branch (7177:13): [True: 20.8k, False: 0]
  ------------------
 7178|  20.8k|            ctxt->sax->reference(ctxt->userData, name);
 7179|  20.8k|        }
 7180|  44.2k|        return;
 7181|  44.2k|    }
 7182|  26.5k|    if (!ctxt->wellFormed)
  ------------------
  |  Branch (7182:9): [True: 6.90k, False: 19.6k]
  ------------------
 7183|  6.90k|	return;
 7184|       |
 7185|       |    /* special case of predefined entities */
 7186|  19.6k|    if ((ent->name == NULL) ||
  ------------------
  |  Branch (7186:9): [True: 0, False: 19.6k]
  ------------------
 7187|  19.6k|        (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (7187:9): [True: 1.31k, False: 18.3k]
  ------------------
 7188|  1.31k|	val = ent->content;
 7189|  1.31k|	if (val == NULL) return;
  ------------------
  |  Branch (7189:6): [True: 0, False: 1.31k]
  ------------------
 7190|       |	/*
 7191|       |	 * inline the entity.
 7192|       |	 */
 7193|  1.31k|	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
  ------------------
  |  Branch (7193:6): [True: 1.31k, False: 0]
  |  Branch (7193:29): [True: 1.31k, False: 0]
  ------------------
 7194|  1.31k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (7194:6): [True: 1.31k, False: 0]
  ------------------
 7195|  1.31k|	    ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
 7196|  1.31k|	return;
 7197|  1.31k|    }
 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.3k|    if (((ent->flags & XML_ENT_PARSED) == 0) && (ent->children != NULL))
  ------------------
  |  |   19|  18.3k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7204:9): [True: 4.66k, False: 13.6k]
  |  Branch (7204:49): [True: 0, False: 4.66k]
  ------------------
 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.3k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (7247:9): [True: 9.17k, False: 9.14k]
  ------------------
 7248|  9.14k|        (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (7248:10): [True: 8.62k, False: 524]
  ------------------
 7249|  8.62k|         ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (7249:11): [True: 6.23k, False: 2.38k]
  ------------------
 7250|  17.5k|          (ctxt->validate)))) {
  ------------------
  |  Branch (7250:11): [True: 2.11k, False: 275]
  ------------------
 7251|  17.5k|        if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  17.5k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (7251:13): [True: 3.86k, False: 13.6k]
  ------------------
 7252|  3.86k|            xmlCtxtParseEntity(ctxt, ent);
 7253|  13.6k|        } else if (ent->children == NULL) {
  ------------------
  |  Branch (7253:20): [True: 4.19k, False: 9.46k]
  ------------------
 7254|       |            /*
 7255|       |             * Probably running in SAX mode and the callbacks don't
 7256|       |             * build the entity content. Parse the entity again.
 7257|       |             *
 7258|       |             * This will also be triggered in normal tree builder mode
 7259|       |             * if an entity happens to be empty, causing unnecessary
 7260|       |             * reloads. It's hard to come up with a reliable check in
 7261|       |             * which mode we're running.
 7262|       |             */
 7263|  4.19k|            xmlCtxtParseEntity(ctxt, ent);
 7264|  4.19k|        }
 7265|  17.5k|    }
 7266|       |
 7267|       |    /*
 7268|       |     * We also check for amplification if entities aren't substituted.
 7269|       |     * They might be expanded later.
 7270|       |     */
 7271|  18.3k|    if (xmlParserEntityCheck(ctxt, ent->expandedSize))
  ------------------
  |  Branch (7271:9): [True: 43, False: 18.2k]
  ------------------
 7272|     43|        return;
 7273|       |
 7274|  18.2k|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (7274:9): [True: 0, False: 18.2k]
  |  Branch (7274:32): [True: 875, False: 17.4k]
  ------------------
 7275|    875|        return;
 7276|       |
 7277|  17.4k|    if (ctxt->replaceEntities == 0) {
  ------------------
  |  Branch (7277:9): [True: 6.08k, False: 11.3k]
  ------------------
 7278|       |	/*
 7279|       |	 * Create a reference
 7280|       |	 */
 7281|  6.08k|        if (ctxt->sax->reference != NULL)
  ------------------
  |  Branch (7281:13): [True: 6.08k, False: 0]
  ------------------
 7282|  6.08k|	    ctxt->sax->reference(ctxt->userData, ent->name);
 7283|  11.3k|    } else if ((ent->children != NULL) && (ctxt->node != NULL)) {
  ------------------
  |  Branch (7283:16): [True: 7.24k, False: 4.07k]
  |  Branch (7283:43): [True: 7.24k, False: 0]
  ------------------
 7284|  7.24k|        xmlNodePtr copy, cur;
 7285|       |
 7286|       |        /*
 7287|       |         * Seems we are generating the DOM content, copy the tree
 7288|       |	 */
 7289|  7.24k|        cur = ent->children;
 7290|       |
 7291|       |        /*
 7292|       |         * Handle first text node with SAX to coalesce text efficiently
 7293|       |         */
 7294|  7.24k|        if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7294:13): [True: 5.81k, False: 1.43k]
  ------------------
 7295|  5.98k|            (cur->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (7295:13): [True: 173, False: 1.26k]
  ------------------
 7296|  5.98k|            int len = xmlStrlen(cur->content);
 7297|       |
 7298|  5.98k|            if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7298:17): [True: 5.81k, False: 173]
  ------------------
 7299|  5.81k|                (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7299:17): [True: 0, False: 173]
  ------------------
 7300|  5.81k|                if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7300:21): [True: 5.81k, False: 0]
  ------------------
 7301|  5.81k|                    ctxt->sax->characters(ctxt->userData, cur->content, len);
 7302|  5.81k|            } else {
 7303|    173|                if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7303:21): [True: 173, False: 0]
  ------------------
 7304|    173|                    ctxt->sax->cdataBlock(ctxt->userData, cur->content, len);
 7305|    173|            }
 7306|       |
 7307|  5.98k|            cur = cur->next;
 7308|  5.98k|        }
 7309|       |
 7310|  68.7k|        while (cur != NULL) {
  ------------------
  |  Branch (7310:16): [True: 63.6k, False: 5.07k]
  ------------------
 7311|  63.6k|            xmlNodePtr last;
 7312|       |
 7313|       |            /*
 7314|       |             * Handle last text node with SAX to coalesce text efficiently
 7315|       |             */
 7316|  63.6k|            if ((cur->next == NULL) &&
  ------------------
  |  Branch (7316:17): [True: 4.03k, False: 59.6k]
  ------------------
 7317|  4.03k|                ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7317:18): [True: 1.83k, False: 2.20k]
  ------------------
 7318|  2.20k|                 (cur->type == XML_CDATA_SECTION_NODE))) {
  ------------------
  |  Branch (7318:18): [True: 282, False: 1.92k]
  ------------------
 7319|  2.11k|                int len = xmlStrlen(cur->content);
 7320|       |
 7321|  2.11k|                if ((cur->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (7321:21): [True: 1.83k, False: 282]
  ------------------
 7322|  1.83k|                    (ctxt->options & XML_PARSE_NOCDATA)) {
  ------------------
  |  Branch (7322:21): [True: 0, False: 282]
  ------------------
 7323|  1.83k|                    if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (7323:25): [True: 1.83k, False: 0]
  ------------------
 7324|  1.83k|                        ctxt->sax->characters(ctxt->userData, cur->content,
 7325|  1.83k|                                              len);
 7326|  1.83k|                } else {
 7327|    282|                    if (ctxt->sax->cdataBlock != NULL)
  ------------------
  |  Branch (7327:25): [True: 282, False: 0]
  ------------------
 7328|    282|                        ctxt->sax->cdataBlock(ctxt->userData, cur->content,
 7329|    282|                                              len);
 7330|    282|                }
 7331|       |
 7332|  2.11k|                break;
 7333|  2.11k|            }
 7334|       |
 7335|       |            /*
 7336|       |             * Reset coalesce buffer stats only for non-text nodes.
 7337|       |             */
 7338|  61.5k|            ctxt->nodemem = 0;
 7339|  61.5k|            ctxt->nodelen = 0;
 7340|       |
 7341|  61.5k|            copy = xmlDocCopyNode(cur, ctxt->myDoc, 1);
 7342|       |
 7343|  61.5k|            if (copy == NULL) {
  ------------------
  |  Branch (7343:17): [True: 56, False: 61.5k]
  ------------------
 7344|     56|                xmlErrMemory(ctxt);
 7345|     56|                break;
 7346|     56|            }
 7347|       |
 7348|  61.5k|            if (ctxt->parseMode == XML_PARSE_READER) {
  ------------------
  |  Branch (7348:17): [True: 60.8k, False: 693]
  ------------------
 7349|       |                /* Needed for reader */
 7350|  60.8k|                copy->extra = cur->extra;
 7351|       |                /* Maybe needed for reader */
 7352|  60.8k|                copy->_private = cur->_private;
 7353|  60.8k|            }
 7354|       |
 7355|  61.5k|            copy->parent = ctxt->node;
 7356|  61.5k|            last = ctxt->node->last;
 7357|  61.5k|            if (last == NULL) {
  ------------------
  |  Branch (7357:17): [True: 362, False: 61.1k]
  ------------------
 7358|    362|                ctxt->node->children = copy;
 7359|  61.1k|            } else {
 7360|  61.1k|                last->next = copy;
 7361|  61.1k|                copy->prev = last;
 7362|  61.1k|            }
 7363|  61.5k|            ctxt->node->last = copy;
 7364|       |
 7365|  61.5k|            cur = cur->next;
 7366|  61.5k|        }
 7367|  7.24k|    }
 7368|  17.4k|}
xmlParseDocTypeDecl:
 7971|  20.1k|xmlParseDocTypeDecl(xmlParserCtxt *ctxt) {
 7972|  20.1k|    const xmlChar *name = NULL;
 7973|  20.1k|    xmlChar *publicId = NULL;
 7974|  20.1k|    xmlChar *URI = NULL;
 7975|       |
 7976|       |    /*
 7977|       |     * We know that '<!DOCTYPE' has been detected.
 7978|       |     */
 7979|  20.1k|    SKIP(9);
  ------------------
  |  | 2285|  20.1k|#define SKIP(val) do {							\
  |  | 2286|  20.1k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  20.1k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 6, False: 20.1k]
  |  |  ------------------
  |  | 2288|  20.1k|        xmlParserGrow(ctxt);						\
  |  | 2289|  20.1k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 20.1k]
  |  |  ------------------
  ------------------
 7980|       |
 7981|  20.1k|    if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  20.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (7981:9): [True: 1.28k, False: 18.8k]
  ------------------
 7982|  1.28k|        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 7983|  1.28k|                       "Space required after 'DOCTYPE'\n");
 7984|  1.28k|    }
 7985|       |
 7986|       |    /*
 7987|       |     * Parse the DOCTYPE name.
 7988|       |     */
 7989|  20.1k|    name = xmlParseName(ctxt);
 7990|  20.1k|    if (name == NULL) {
  ------------------
  |  Branch (7990:9): [True: 1.02k, False: 19.1k]
  ------------------
 7991|  1.02k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7992|  1.02k|		       "xmlParseDocTypeDecl : no DOCTYPE name !\n");
 7993|  1.02k|    }
 7994|  20.1k|    ctxt->intSubName = name;
 7995|       |
 7996|  20.1k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  20.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 7997|       |
 7998|       |    /*
 7999|       |     * Check for public and system identifier (URI)
 8000|       |     */
 8001|  20.1k|    URI = xmlParseExternalID(ctxt, &publicId, 1);
 8002|       |
 8003|  20.1k|    if ((URI != NULL) || (publicId != NULL)) {
  ------------------
  |  Branch (8003:9): [True: 3.02k, False: 17.1k]
  |  Branch (8003:26): [True: 23, False: 17.1k]
  ------------------
 8004|  3.04k|        ctxt->hasExternalSubset = 1;
 8005|  3.04k|    }
 8006|  20.1k|    ctxt->extSubURI = URI;
 8007|  20.1k|    ctxt->extSubSystem = publicId;
 8008|       |
 8009|  20.1k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  20.1k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8010|       |
 8011|       |    /*
 8012|       |     * Create and update the internal subset.
 8013|       |     */
 8014|  20.1k|    if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
  ------------------
  |  Branch (8014:9): [True: 20.1k, False: 0]
  |  Branch (8014:32): [True: 20.1k, False: 0]
  ------------------
 8015|  20.1k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8015:2): [True: 20.0k, False: 144]
  ------------------
 8016|  20.0k|	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 8017|       |
 8018|  20.1k|    if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  20.1k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '[') && (RAW != '>')) {
  ------------------
  |  | 2261|  5.48k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8018:9): [True: 5.48k, False: 14.6k]
  |  Branch (8018:25): [True: 246, False: 5.24k]
  ------------------
 8019|       |	xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8020|    246|    }
 8021|  20.1k|}
xmlParseAttribute:
 8127|   229k|xmlParseAttribute(xmlParserCtxt *ctxt, xmlChar **value) {
 8128|   229k|    const xmlChar *name;
 8129|   229k|    xmlChar *val;
 8130|       |
 8131|   229k|    *value = NULL;
 8132|   229k|    GROW;
  ------------------
  |  | 2308|   229k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   229k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   229k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 161k, False: 67.3k]
  |  |  ------------------
  |  | 2309|   229k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   161k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.0k, False: 150k]
  |  |  ------------------
  |  | 2310|   229k|	xmlParserGrow(ctxt);
  ------------------
 8133|   229k|    name = xmlParseName(ctxt);
 8134|   229k|    if (name == NULL) {
  ------------------
  |  Branch (8134:9): [True: 83.9k, False: 145k]
  ------------------
 8135|  83.9k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8136|  83.9k|	               "error parsing attribute name\n");
 8137|  83.9k|        return(NULL);
 8138|  83.9k|    }
 8139|       |
 8140|       |    /*
 8141|       |     * read the value
 8142|       |     */
 8143|   145k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   145k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8144|   145k|    if (RAW == '=') {
  ------------------
  |  | 2261|   145k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8144:9): [True: 132k, False: 12.9k]
  ------------------
 8145|   132k|        NEXT;
  ------------------
  |  | 2316|   132k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8146|   132k|	SKIP_BLANKS;
  ------------------
  |  | 2312|   132k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8147|   132k|	val = xmlParseAttValue(ctxt);
 8148|   132k|    } else {
 8149|  12.9k|	xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8150|  12.9k|	       "Specification mandates value for attribute %s\n", name);
 8151|  12.9k|	return(name);
 8152|  12.9k|    }
 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|   132k|    if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "xml:lang"))) {
  ------------------
  |  |   34|  79.8k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8159:9): [True: 79.8k, False: 52.6k]
  |  Branch (8159:29): [True: 9.43k, False: 70.4k]
  ------------------
 8160|  9.43k|	if (!xmlCheckLanguageID(val)) {
  ------------------
  |  Branch (8160:6): [True: 6.92k, False: 2.50k]
  ------------------
 8161|  6.92k|	    xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8162|  6.92k|		          "Malformed value for xml:lang : %s\n",
 8163|  6.92k|			  val, NULL);
 8164|  6.92k|	}
 8165|  9.43k|    }
 8166|       |
 8167|       |    /*
 8168|       |     * Check that xml:space conforms to the specification
 8169|       |     */
 8170|   132k|    if (xmlStrEqual(name, BAD_CAST "xml:space")) {
  ------------------
  |  |   34|   132k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8170:9): [True: 839, False: 131k]
  ------------------
 8171|    839|	if (xmlStrEqual(val, BAD_CAST "default"))
  ------------------
  |  |   34|    839|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8171:6): [True: 197, False: 642]
  ------------------
 8172|    197|	    *(ctxt->space) = 0;
 8173|    642|	else if (xmlStrEqual(val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    642|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8173:11): [True: 397, False: 245]
  ------------------
 8174|    397|	    *(ctxt->space) = 1;
 8175|    245|	else {
 8176|    245|		xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8177|    245|"Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8178|    245|                                 val, NULL);
 8179|    245|	}
 8180|    839|    }
 8181|       |
 8182|   132k|    *value = val;
 8183|   132k|    return(name);
 8184|   145k|}
xmlParseStartTag:
 8214|   454k|xmlParseStartTag(xmlParserCtxt *ctxt) {
 8215|   454k|    const xmlChar *name;
 8216|   454k|    const xmlChar *attname;
 8217|   454k|    xmlChar *attvalue;
 8218|   454k|    const xmlChar **atts = ctxt->atts;
 8219|   454k|    int nbatts = 0;
 8220|   454k|    int maxatts = ctxt->maxatts;
 8221|   454k|    int i;
 8222|       |
 8223|   454k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   454k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8223:9): [True: 0, False: 454k]
  ------------------
 8224|   454k|    NEXT1;
  ------------------
  |  | 2318|   454k|#define NEXT1 {								\
  |  | 2319|   454k|	ctxt->input->col++;						\
  |  | 2320|   454k|	ctxt->input->cur++;						\
  |  | 2321|   454k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 560, False: 453k]
  |  |  ------------------
  |  | 2322|   454k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   454k|    }
  ------------------
 8225|       |
 8226|   454k|    name = xmlParseName(ctxt);
 8227|   454k|    if (name == NULL) {
  ------------------
  |  Branch (8227:9): [True: 14.1k, False: 440k]
  ------------------
 8228|  14.1k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8229|  14.1k|	     "xmlParseStartTag: invalid element name\n");
 8230|  14.1k|        return(NULL);
 8231|  14.1k|    }
 8232|       |
 8233|       |    /*
 8234|       |     * Now parse the attributes, it ends up with the ending
 8235|       |     *
 8236|       |     * (S Attribute)* S?
 8237|       |     */
 8238|   440k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   440k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8239|   440k|    GROW;
  ------------------
  |  | 2308|   440k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   440k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   440k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 338k, False: 102k]
  |  |  ------------------
  |  | 2309|   440k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   338k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 27.2k, False: 311k]
  |  |  ------------------
  |  | 2310|   440k|	xmlParserGrow(ctxt);
  ------------------
 8240|       |
 8241|   499k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   499k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8241:13): [True: 326k, False: 173k]
  ------------------
 8242|   326k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   326k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|  93.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8242:6): [True: 233k, False: 93.0k]
  |  Branch (8242:22): [True: 3.82k, False: 89.2k]
  ------------------
 8243|   236k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   236k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   236k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 230k, False: 6.12k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 230k]
  |  |  |  |  ------------------
  |  |  |  |  109|   236k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 236k]
  |  |  |  |  ------------------
  |  |  |  |  110|   236k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 229k, False: 7.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   229k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8243:29): [True: 229k, False: 137]
  ------------------
 8244|   229k|	attname = xmlParseAttribute(ctxt, &attvalue);
 8245|   229k|        if (attname == NULL)
  ------------------
  |  Branch (8245:13): [True: 83.9k, False: 145k]
  ------------------
 8246|  83.9k|	    break;
 8247|   145k|        if (attvalue != NULL) {
  ------------------
  |  Branch (8247:13): [True: 129k, False: 15.9k]
  ------------------
 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|   258k|	    for (i = 0; i < nbatts;i += 2) {
  ------------------
  |  Branch (8253:18): [True: 140k, False: 118k]
  ------------------
 8254|   140k|	        if (xmlStrEqual(atts[i], attname)) {
  ------------------
  |  Branch (8254:14): [True: 11.2k, False: 129k]
  ------------------
 8255|  11.2k|		    xmlErrAttributeDup(ctxt, NULL, attname);
 8256|  11.2k|		    goto failed;
 8257|  11.2k|		}
 8258|   140k|	    }
 8259|       |	    /*
 8260|       |	     * Add the pair to atts
 8261|       |	     */
 8262|   118k|	    if (nbatts + 4 > maxatts) {
  ------------------
  |  Branch (8262:10): [True: 19.7k, False: 98.4k]
  ------------------
 8263|  19.7k|	        const xmlChar **n;
 8264|  19.7k|                int newSize;
 8265|       |
 8266|  19.7k|                newSize = xmlGrowCapacity(maxatts, sizeof(n[0]) * 2,
 8267|  19.7k|                                          11, XML_MAX_ATTRS);
  ------------------
  |  |   93|  19.7k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 8268|  19.7k|                if (newSize < 0) {
  ------------------
  |  Branch (8268:21): [True: 0, False: 19.7k]
  ------------------
 8269|      0|		    xmlErrMemory(ctxt);
 8270|      0|		    goto failed;
 8271|      0|		}
 8272|  19.7k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 8273|  19.7k|                if (newSize < 2)
  ------------------
  |  Branch (8273:21): [True: 12.2k, False: 7.45k]
  ------------------
 8274|  12.2k|                    newSize = 2;
 8275|  19.7k|#endif
 8276|  19.7k|	        n = xmlRealloc(atts, newSize * sizeof(n[0]) * 2);
 8277|  19.7k|		if (n == NULL) {
  ------------------
  |  Branch (8277:7): [True: 3, False: 19.7k]
  ------------------
 8278|      3|		    xmlErrMemory(ctxt);
 8279|      3|		    goto failed;
 8280|      3|		}
 8281|  19.7k|		atts = n;
 8282|  19.7k|                maxatts = newSize * 2;
 8283|  19.7k|		ctxt->atts = atts;
 8284|  19.7k|		ctxt->maxatts = maxatts;
 8285|  19.7k|	    }
 8286|       |
 8287|   118k|	    atts[nbatts++] = attname;
 8288|   118k|	    atts[nbatts++] = attvalue;
 8289|   118k|	    atts[nbatts] = NULL;
 8290|   118k|	    atts[nbatts + 1] = NULL;
 8291|       |
 8292|   118k|            attvalue = NULL;
 8293|   118k|	}
 8294|       |
 8295|   145k|failed:
 8296|       |
 8297|   145k|        if (attvalue != NULL)
  ------------------
  |  Branch (8297:13): [True: 11.2k, False: 134k]
  ------------------
 8298|  11.2k|            xmlFree(attvalue);
 8299|       |
 8300|   145k|	GROW
  ------------------
  |  | 2308|   145k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   145k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   145k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 89.4k, False: 55.9k]
  |  |  ------------------
  |  | 2309|   145k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  89.4k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 9.95k, False: 79.5k]
  |  |  ------------------
  |  | 2310|   145k|	xmlParserGrow(ctxt);
  ------------------
 8301|   145k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   145k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   120k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  62.0k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8301:6): [True: 24.9k, False: 120k]
  |  Branch (8301:24): [True: 62.0k, False: 58.3k]
  |  Branch (8301:40): [True: 61.4k, False: 654]
  ------------------
 8302|  86.3k|	    break;
 8303|  59.0k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|  59.0k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (8303:6): [True: 20.8k, False: 38.2k]
  ------------------
 8304|  20.8k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 8305|  20.8k|			   "attributes construct error\n");
 8306|  20.8k|	}
 8307|  59.0k|	SHRINK;
  ------------------
  |  | 2304|  59.0k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  59.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 26.1k, False: 32.8k]
  |  |  ------------------
  |  | 2305|  59.0k|	xmlParserShrink(ctxt);
  ------------------
 8308|  59.0k|        GROW;
  ------------------
  |  | 2308|  59.0k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  59.0k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  59.0k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 26.1k, False: 32.8k]
  |  |  ------------------
  |  | 2309|  59.0k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  26.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.32k, False: 20.8k]
  |  |  ------------------
  |  | 2310|  59.0k|	xmlParserGrow(ctxt);
  ------------------
 8309|  59.0k|    }
 8310|       |
 8311|       |    /*
 8312|       |     * SAX: Start of Element !
 8313|       |     */
 8314|   440k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL) &&
  ------------------
  |  Branch (8314:9): [True: 440k, False: 0]
  |  Branch (8314:32): [True: 440k, False: 0]
  ------------------
 8315|   440k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (8315:2): [True: 311k, False: 128k]
  ------------------
 8316|   311k|	if (nbatts > 0)
  ------------------
  |  Branch (8316:6): [True: 93.6k, False: 218k]
  ------------------
 8317|  93.6k|	    ctxt->sax->startElement(ctxt->userData, name, atts);
 8318|   218k|	else
 8319|   218k|	    ctxt->sax->startElement(ctxt->userData, name, NULL);
 8320|   311k|    }
 8321|       |
 8322|   440k|    if (atts != NULL) {
  ------------------
  |  Branch (8322:9): [True: 363k, False: 76.4k]
  ------------------
 8323|       |        /* Free only the content strings */
 8324|   482k|        for (i = 1;i < nbatts;i+=2)
  ------------------
  |  Branch (8324:20): [True: 118k, False: 363k]
  ------------------
 8325|   118k|	    if (atts[i] != NULL)
  ------------------
  |  Branch (8325:10): [True: 118k, False: 0]
  ------------------
 8326|   118k|	       xmlFree((xmlChar *) atts[i]);
 8327|   363k|    }
 8328|   440k|    return(name);
 8329|   440k|}
xmlParseCDSect:
 9480|   105k|xmlParseCDSect(xmlParserCtxt *ctxt) {
 9481|   105k|    xmlChar *buf = NULL;
 9482|   105k|    int len = 0;
 9483|   105k|    int size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|   105k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 9484|   105k|    int r, rl;
 9485|   105k|    int	s, sl;
 9486|   105k|    int cur, l;
 9487|   105k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9487:21): [True: 42.5k, False: 63.0k]
  ------------------
 9488|  42.5k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  42.5k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 9489|   105k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  63.0k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9490|       |
 9491|   105k|    if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2262|   105k|#define CUR (*ctxt->input->cur)
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|   105k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                  if ((CUR != '<') || (NXT(1) != '!') || (NXT(2) != '['))
  ------------------
  |  | 2263|   105k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9491:9): [True: 0, False: 105k]
  |  Branch (9491:25): [True: 0, False: 105k]
  |  Branch (9491:44): [True: 0, False: 105k]
  ------------------
 9492|      0|        return;
 9493|   105k|    SKIP(3);
  ------------------
  |  | 2285|   105k|#define SKIP(val) do {							\
  |  | 2286|   105k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   105k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 105k]
  |  |  ------------------
  |  | 2288|   105k|        xmlParserGrow(ctxt);						\
  |  | 2289|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
 9494|       |
 9495|   105k|    if (!CMP6(CUR_PTR, 'C', 'D', 'A', 'T', 'A', '['))
  ------------------
  |  | 2273|   105k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|   211k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|   211k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 105k, False: 0]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 105k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|   105k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 105k, False: 0]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 105k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 105k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 105k, False: 0]
  |  |  ------------------
  ------------------
 9496|      0|        return;
 9497|   105k|    SKIP(6);
  ------------------
  |  | 2285|   105k|#define SKIP(val) do {							\
  |  | 2286|   105k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   105k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 237, False: 105k]
  |  |  ------------------
  |  | 2288|   105k|        xmlParserGrow(ctxt);						\
  |  | 2289|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
 9498|       |
 9499|   105k|    r = xmlCurrentCharRecover(ctxt, &rl);
 9500|   105k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   105k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   105k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 103k, False: 2.00k]
  |  |  |  |  ------------------
  |  |  |  |  118|   105k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   103k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 103k, False: 244]
  |  |  |  |  |  |  |  Branch (108:44): [True: 825, False: 102k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   103k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 102k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   103k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 102k, False: 281]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   105k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.00k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 240, False: 1.76k]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.00k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.76k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 1.14k, False: 615]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.00k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 543, False: 72]
  |  |  |  |  |  Branch (121:27): [True: 543, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9500:9): [True: 353, False: 105k]
  ------------------
 9501|    353|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9502|    353|        goto out;
 9503|    353|    }
 9504|   105k|    NEXTL(rl);
  ------------------
  |  | 2325|   105k|#define NEXTL(l) do {							\
  |  | 2326|   105k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 816, False: 104k]
  |  |  ------------------
  |  | 2327|    816|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   104k|    } else ctxt->input->col++;						\
  |  | 2329|   105k|    ctxt->input->cur += l;				\
  |  | 2330|   105k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 105k]
  |  |  ------------------
  ------------------
 9505|   105k|    s = xmlCurrentCharRecover(ctxt, &sl);
 9506|   105k|    if (!IS_CHAR(s)) {
  ------------------
  |  |  115|   105k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   105k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 103k, False: 1.70k]
  |  |  |  |  ------------------
  |  |  |  |  118|   105k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   103k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 102k, False: 776]
  |  |  |  |  |  |  |  Branch (108:44): [True: 248, False: 102k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   103k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 103k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   103k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 102k, False: 905]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   105k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.70k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 299, False: 1.40k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.70k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 975, False: 432]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.70k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 236, False: 196]
  |  |  |  |  |  Branch (121:27): [True: 236, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (9506:9): [True: 1.10k, False: 104k]
  ------------------
 9507|  1.10k|	xmlFatalErr(ctxt, XML_ERR_CDATA_NOT_FINISHED, NULL);
 9508|  1.10k|        goto out;
 9509|  1.10k|    }
 9510|   104k|    NEXTL(sl);
  ------------------
  |  | 2325|   104k|#define NEXTL(l) do {							\
  |  | 2326|   104k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 226, False: 103k]
  |  |  ------------------
  |  | 2327|    226|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   103k|    } else ctxt->input->col++;						\
  |  | 2329|   104k|    ctxt->input->cur += l;				\
  |  | 2330|   104k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 104k]
  |  |  ------------------
  ------------------
 9511|   104k|    cur = xmlCurrentCharRecover(ctxt, &l);
 9512|   104k|    buf = xmlMalloc(size);
 9513|   104k|    if (buf == NULL) {
  ------------------
  |  Branch (9513:9): [True: 2, False: 104k]
  ------------------
 9514|      2|	xmlErrMemory(ctxt);
 9515|      2|        goto out;
 9516|      2|    }
 9517|   671k|    while (IS_CHAR(cur) &&
  ------------------
  |  |  115|   671k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.34M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 668k, False: 2.99k]
  |  |  |  |  |  Branch (117:25): [True: 500k, False: 171k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.34M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   500k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 498k, False: 1.24k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 87.8k, False: 411k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   500k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 412k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   500k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 409k, False: 2.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.34M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 171k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 473, False: 170k]
  |  |  |  |  ------------------
  |  |  |  |  120|   171k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 170k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 170k, False: 587]
  |  |  |  |  ------------------
  |  |  |  |  121|   171k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 341, False: 246]
  |  |  |  |  |  Branch (121:27): [True: 341, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9518|   668k|           ((r != ']') || (s != ']') || (cur != '>'))) {
  ------------------
  |  Branch (9518:13): [True: 565k, False: 103k]
  |  Branch (9518:27): [True: 1.17k, False: 102k]
  |  Branch (9518:41): [True: 1.16k, False: 101k]
  ------------------
 9519|   567k|	if (len + 5 >= size) {
  ------------------
  |  Branch (9519:6): [True: 1.37k, False: 566k]
  ------------------
 9520|  1.37k|	    xmlChar *tmp;
 9521|  1.37k|            int newSize;
 9522|       |
 9523|  1.37k|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9524|  1.37k|            if (newSize < 0) {
  ------------------
  |  Branch (9524:17): [True: 0, False: 1.37k]
  ------------------
 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.37k|	    tmp = xmlRealloc(buf, newSize);
 9530|  1.37k|	    if (tmp == NULL) {
  ------------------
  |  Branch (9530:10): [True: 1, False: 1.37k]
  ------------------
 9531|      1|		xmlErrMemory(ctxt);
 9532|      1|                goto out;
 9533|      1|	    }
 9534|  1.37k|	    buf = tmp;
 9535|  1.37k|	    size = newSize;
 9536|  1.37k|	}
 9537|   567k|	COPY_BUF(buf, len, r);
  ------------------
  |  | 2333|   567k|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 310k, False: 257k]
  |  |  ------------------
  |  | 2334|   567k|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 9538|   567k|	r = s;
 9539|   567k|	rl = sl;
 9540|   567k|	s = cur;
 9541|   567k|	sl = l;
 9542|   567k|	NEXTL(l);
  ------------------
  |  | 2325|   567k|#define NEXTL(l) do {							\
  |  | 2326|   567k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 4.95k, False: 562k]
  |  |  ------------------
  |  | 2327|  4.95k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   562k|    } else ctxt->input->col++;						\
  |  | 2329|   567k|    ctxt->input->cur += l;				\
  |  | 2330|   567k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 567k]
  |  |  ------------------
  ------------------
 9543|   567k|	cur = xmlCurrentCharRecover(ctxt, &l);
 9544|   567k|    }
 9545|   104k|    buf[len] = 0;
 9546|   104k|    if (cur != '>') {
  ------------------
  |  Branch (9546:9): [True: 2.99k, False: 101k]
  ------------------
 9547|  2.99k|	xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
 9548|  2.99k|	                     "CData section not finished\n%.50s\n", buf);
 9549|  2.99k|        goto out;
 9550|  2.99k|    }
 9551|   101k|    NEXTL(l);
  ------------------
  |  | 2325|   101k|#define NEXTL(l) do {							\
  |  | 2326|   101k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 101k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   101k|    } else ctxt->input->col++;						\
  |  | 2329|   101k|    ctxt->input->cur += l;				\
  |  | 2330|   101k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 101k]
  |  |  ------------------
  ------------------
 9552|       |
 9553|       |    /*
 9554|       |     * OK the buffer is to be consumed as cdata.
 9555|       |     */
 9556|   101k|    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
  ------------------
  |  Branch (9556:9): [True: 101k, False: 0]
  |  Branch (9556:32): [True: 100k, False: 529]
  ------------------
 9557|   100k|        if ((ctxt->sax->cdataBlock != NULL) &&
  ------------------
  |  Branch (9557:13): [True: 100k, False: 0]
  ------------------
 9558|   100k|            ((ctxt->options & XML_PARSE_NOCDATA) == 0)) {
  ------------------
  |  Branch (9558:13): [True: 92.9k, False: 7.68k]
  ------------------
 9559|  92.9k|            ctxt->sax->cdataBlock(ctxt->userData, buf, len);
 9560|  92.9k|        } else if (ctxt->sax->characters != NULL) {
  ------------------
  |  Branch (9560:20): [True: 7.68k, False: 0]
  ------------------
 9561|  7.68k|            ctxt->sax->characters(ctxt->userData, buf, len);
 9562|  7.68k|        }
 9563|   100k|    }
 9564|       |
 9565|   105k|out:
 9566|   105k|    xmlFree(buf);
 9567|   105k|}
xmlParseElement:
 9707|  8.42k|xmlParseElement(xmlParserCtxt *ctxt) {
 9708|  8.42k|    if (xmlParseElementStart(ctxt) != 0)
  ------------------
  |  Branch (9708:9): [True: 3.38k, False: 5.04k]
  ------------------
 9709|  3.38k|        return;
 9710|       |
 9711|  5.04k|    xmlParseContentInternal(ctxt);
 9712|       |
 9713|  5.04k|    if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (9713:9): [True: 486, False: 4.55k]
  ------------------
 9714|    486|        if (ctxt->wellFormed) {
  ------------------
  |  Branch (9714:13): [True: 3, False: 483]
  ------------------
 9715|      3|            const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9716|      3|            int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9717|      3|            xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9718|      3|                    "Premature end of data in tag %s line %d\n",
 9719|      3|                    name, line, NULL);
 9720|      3|        }
 9721|    486|        return;
 9722|    486|    }
 9723|       |
 9724|  4.55k|    xmlParseElementEnd(ctxt);
 9725|  4.55k|}
xmlParseVersionNum:
 9905|  13.1k|xmlParseVersionNum(xmlParserCtxt *ctxt) {
 9906|  13.1k|    xmlChar *buf = NULL;
 9907|  13.1k|    int len = 0;
 9908|  13.1k|    int size = 10;
 9909|  13.1k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (9909:21): [True: 4.47k, False: 8.63k]
  ------------------
 9910|  4.47k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  4.47k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 9911|  13.1k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  8.63k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 9912|  13.1k|    xmlChar cur;
 9913|       |
 9914|  13.1k|    buf = xmlMalloc(size);
 9915|  13.1k|    if (buf == NULL) {
  ------------------
  |  Branch (9915:9): [True: 2, False: 13.1k]
  ------------------
 9916|      2|	xmlErrMemory(ctxt);
 9917|      2|	return(NULL);
 9918|      2|    }
 9919|  13.1k|    cur = CUR;
  ------------------
  |  | 2262|  13.1k|#define CUR (*ctxt->input->cur)
  ------------------
 9920|  13.1k|    if (!((cur >= '0') && (cur <= '9'))) {
  ------------------
  |  Branch (9920:11): [True: 12.8k, False: 233]
  |  Branch (9920:27): [True: 12.5k, False: 356]
  ------------------
 9921|    589|	xmlFree(buf);
 9922|    589|	return(NULL);
 9923|    589|    }
 9924|  12.5k|    buf[len++] = cur;
 9925|  12.5k|    NEXT;
  ------------------
  |  | 2316|  12.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9926|  12.5k|    cur=CUR;
  ------------------
  |  | 2262|  12.5k|#define CUR (*ctxt->input->cur)
  ------------------
 9927|  12.5k|    if (cur != '.') {
  ------------------
  |  Branch (9927:9): [True: 3.40k, False: 9.11k]
  ------------------
 9928|  3.40k|	xmlFree(buf);
 9929|  3.40k|	return(NULL);
 9930|  3.40k|    }
 9931|  9.11k|    buf[len++] = cur;
 9932|  9.11k|    NEXT;
  ------------------
  |  | 2316|  9.11k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9933|  9.11k|    cur=CUR;
  ------------------
  |  | 2262|  9.11k|#define CUR (*ctxt->input->cur)
  ------------------
 9934|   214k|    while ((cur >= '0') && (cur <= '9')) {
  ------------------
  |  Branch (9934:12): [True: 205k, False: 8.76k]
  |  Branch (9934:28): [True: 204k, False: 349]
  ------------------
 9935|   204k|	if (len + 1 >= size) {
  ------------------
  |  Branch (9935:6): [True: 485, False: 204k]
  ------------------
 9936|    485|	    xmlChar *tmp;
 9937|    485|            int newSize;
 9938|       |
 9939|    485|            newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 9940|    485|            if (newSize < 0) {
  ------------------
  |  Branch (9940:17): [True: 1, False: 484]
  ------------------
 9941|      1|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "VersionNum");
 9942|      1|                xmlFree(buf);
 9943|      1|                return(NULL);
 9944|      1|            }
 9945|    484|	    tmp = xmlRealloc(buf, newSize);
 9946|    484|	    if (tmp == NULL) {
  ------------------
  |  Branch (9946:10): [True: 3, False: 481]
  ------------------
 9947|      3|		xmlErrMemory(ctxt);
 9948|      3|	        xmlFree(buf);
 9949|      3|		return(NULL);
 9950|      3|	    }
 9951|    481|	    buf = tmp;
 9952|    481|            size = newSize;
 9953|    481|	}
 9954|   204k|	buf[len++] = cur;
 9955|   204k|	NEXT;
  ------------------
  |  | 2316|   204k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9956|   204k|	cur=CUR;
  ------------------
  |  | 2262|   204k|#define CUR (*ctxt->input->cur)
  ------------------
 9957|   204k|    }
 9958|  9.10k|    buf[len] = 0;
 9959|  9.10k|    return(buf);
 9960|  9.11k|}
xmlParseVersionInfo:
 9976|   218k|xmlParseVersionInfo(xmlParserCtxt *ctxt) {
 9977|   218k|    xmlChar *version = NULL;
 9978|       |
 9979|   218k|    if (CMP7(CUR_PTR, 'v', 'e', 'r', 's', 'i', 'o', 'n')) {
  ------------------
  |  | 2275|   218k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  ------------------
  |  |  |  | 2273|   437k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2271|   437k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2268|   437k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 17.1k, False: 201k]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 16.8k, False: 309]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|   218k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 16.1k, False: 693]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 15.8k, False: 251]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 15.1k, False: 699]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 14.5k, False: 592]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 14.2k, False: 347]
  |  |  ------------------
  ------------------
 9980|  14.2k|	SKIP(7);
  ------------------
  |  | 2285|  14.2k|#define SKIP(val) do {							\
  |  | 2286|  14.2k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  14.2k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 85, False: 14.1k]
  |  |  ------------------
  |  | 2288|  14.2k|        xmlParserGrow(ctxt);						\
  |  | 2289|  14.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 14.2k]
  |  |  ------------------
  ------------------
 9981|  14.2k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  14.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9982|  14.2k|	if (RAW != '=') {
  ------------------
  |  | 2261|  14.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9982:6): [True: 741, False: 13.4k]
  ------------------
 9983|    741|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
 9984|    741|	    return(NULL);
 9985|    741|        }
 9986|  13.4k|	NEXT;
  ------------------
  |  | 2316|  13.4k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9987|  13.4k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  13.4k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9988|  13.4k|	if (RAW == '"') {
  ------------------
  |  | 2261|  13.4k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9988:6): [True: 2.92k, False: 10.5k]
  ------------------
 9989|  2.92k|	    NEXT;
  ------------------
  |  | 2316|  2.92k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9990|  2.92k|	    version = xmlParseVersionNum(ctxt);
 9991|  2.92k|	    if (RAW != '"') {
  ------------------
  |  | 2261|  2.92k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9991:10): [True: 307, False: 2.61k]
  ------------------
 9992|    307|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
 9993|    307|	    } else
 9994|  2.61k|	        NEXT;
  ------------------
  |  | 2316|  2.61k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9995|  10.5k|	} else if (RAW == '\''){
  ------------------
  |  | 2261|  10.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9995:13): [True: 10.1k, False: 386]
  ------------------
 9996|  10.1k|	    NEXT;
  ------------------
  |  | 2316|  10.1k|#define NEXT xmlNextChar(ctxt)
  ------------------
 9997|  10.1k|	    version = xmlParseVersionNum(ctxt);
 9998|  10.1k|	    if (RAW != '\'') {
  ------------------
  |  | 2261|  10.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9998:10): [True: 4.05k, False: 6.12k]
  ------------------
 9999|  4.05k|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10000|  4.05k|	    } else
10001|  6.12k|	        NEXT;
  ------------------
  |  | 2316|  6.12k|#define NEXT xmlNextChar(ctxt)
  ------------------
10002|  10.1k|	} else {
10003|    386|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10004|    386|	}
10005|  13.4k|    }
10006|   217k|    return(version);
10007|   218k|}
xmlParseEncName:
10020|  7.68k|xmlParseEncName(xmlParserCtxt *ctxt) {
10021|  7.68k|    xmlChar *buf = NULL;
10022|  7.68k|    int len = 0;
10023|  7.68k|    int size = 10;
10024|  7.68k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (10024:21): [True: 2.75k, False: 4.93k]
  ------------------
10025|  2.75k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  2.75k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
10026|  7.68k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  4.93k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
10027|  7.68k|    xmlChar cur;
10028|       |
10029|  7.68k|    cur = CUR;
  ------------------
  |  | 2262|  7.68k|#define CUR (*ctxt->input->cur)
  ------------------
10030|  7.68k|    if (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10030:10): [True: 747, False: 6.93k]
  |  Branch (10030:26): [True: 534, False: 213]
  ------------------
10031|  7.20k|        ((cur >= 'A') && (cur <= 'Z'))) {
  ------------------
  |  Branch (10031:10): [True: 6.88k, False: 265]
  |  Branch (10031:26): [True: 6.66k, False: 213]
  ------------------
10032|  7.20k|	buf = xmlMalloc(size);
10033|  7.20k|	if (buf == NULL) {
  ------------------
  |  Branch (10033:6): [True: 2, False: 7.20k]
  ------------------
10034|      2|	    xmlErrMemory(ctxt);
10035|      2|	    return(NULL);
10036|      2|	}
10037|       |
10038|  7.20k|	buf[len++] = cur;
10039|  7.20k|	NEXT;
  ------------------
  |  | 2316|  7.20k|#define NEXT xmlNextChar(ctxt)
  ------------------
10040|  7.20k|	cur = CUR;
  ------------------
  |  | 2262|  7.20k|#define CUR (*ctxt->input->cur)
  ------------------
10041|   312k|	while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (10041:10): [True: 63.9k, False: 248k]
  |  Branch (10041:26): [True: 63.5k, False: 407]
  ------------------
10042|   248k|	       ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (10042:10): [True: 210k, False: 37.5k]
  |  Branch (10042:26): [True: 210k, False: 622]
  ------------------
10043|  38.2k|	       ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (10043:10): [True: 22.1k, False: 16.0k]
  |  Branch (10043:26): [True: 21.5k, False: 637]
  ------------------
10044|  16.6k|	       (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (10044:9): [True: 561, False: 16.1k]
  |  Branch (10044:25): [True: 213, False: 15.9k]
  ------------------
10045|   304k|	       (cur == '-')) {
  ------------------
  |  Branch (10045:9): [True: 8.70k, False: 7.19k]
  ------------------
10046|   304k|	    if (len + 1 >= size) {
  ------------------
  |  Branch (10046:10): [True: 4.83k, False: 300k]
  ------------------
10047|  4.83k|	        xmlChar *tmp;
10048|  4.83k|                int newSize;
10049|       |
10050|  4.83k|                newSize = xmlGrowCapacity(size, 1, 1, maxLength);
10051|  4.83k|                if (newSize < 0) {
  ------------------
  |  Branch (10051:21): [True: 1, False: 4.83k]
  ------------------
10052|      1|                    xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
10053|      1|                    xmlFree(buf);
10054|      1|                    return(NULL);
10055|      1|                }
10056|  4.83k|		tmp = xmlRealloc(buf, newSize);
10057|  4.83k|		if (tmp == NULL) {
  ------------------
  |  Branch (10057:7): [True: 3, False: 4.83k]
  ------------------
10058|      3|		    xmlErrMemory(ctxt);
10059|      3|		    xmlFree(buf);
10060|      3|		    return(NULL);
10061|      3|		}
10062|  4.83k|		buf = tmp;
10063|  4.83k|                size = newSize;
10064|  4.83k|	    }
10065|   304k|	    buf[len++] = cur;
10066|   304k|	    NEXT;
  ------------------
  |  | 2316|   304k|#define NEXT xmlNextChar(ctxt)
  ------------------
10067|   304k|	    cur = CUR;
  ------------------
  |  | 2262|   304k|#define CUR (*ctxt->input->cur)
  ------------------
10068|   304k|        }
10069|  7.19k|	buf[len] = 0;
10070|  7.19k|    } else {
10071|    478|	xmlFatalErr(ctxt, XML_ERR_ENCODING_NAME, NULL);
10072|    478|    }
10073|  7.67k|    return(buf);
10074|  7.68k|}
xmlParseEncodingDecl:
10091|   217k|xmlParseEncodingDecl(xmlParserCtxt *ctxt) {
10092|   217k|    xmlChar *encoding = NULL;
10093|       |
10094|   217k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   217k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10095|   217k|    if (CMP8(CUR_PTR, 'e', 'n', 'c', 'o', 'd', 'i', 'n', 'g') == 0)
  ------------------
  |  | 2277|   217k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  ------------------
  |  |  |  | 2275|   434k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2273|   434k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2271|   434k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2268|   434k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 10.7k, False: 206k]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 10.2k, False: 443]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2269|   217k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 10.0k, False: 285]
  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 9.73k, False: 277]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 9.43k, False: 293]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2273:38): [True: 9.14k, False: 293]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2275:42): [True: 8.63k, False: 507]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2277:46): [True: 8.39k, False: 248]
  |  |  ------------------
  ------------------
  |  Branch (10095:9): [True: 208k, False: 8.39k]
  ------------------
10096|   208k|        return(NULL);
10097|       |
10098|  8.39k|    SKIP(8);
  ------------------
  |  | 2285|  8.39k|#define SKIP(val) do {							\
  |  | 2286|  8.39k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  8.39k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 219, False: 8.17k]
  |  |  ------------------
  |  | 2288|  8.39k|        xmlParserGrow(ctxt);						\
  |  | 2289|  8.39k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 8.39k]
  |  |  ------------------
  ------------------
10099|  8.39k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  8.39k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10100|  8.39k|    if (RAW != '=') {
  ------------------
  |  | 2261|  8.39k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10100:9): [True: 249, False: 8.14k]
  ------------------
10101|    249|        xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10102|    249|        return(NULL);
10103|    249|    }
10104|  8.14k|    NEXT;
  ------------------
  |  | 2316|  8.14k|#define NEXT xmlNextChar(ctxt)
  ------------------
10105|  8.14k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  8.14k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10106|  8.14k|    if (RAW == '"') {
  ------------------
  |  | 2261|  8.14k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10106:9): [True: 1.23k, False: 6.90k]
  ------------------
10107|  1.23k|        NEXT;
  ------------------
  |  | 2316|  1.23k|#define NEXT xmlNextChar(ctxt)
  ------------------
10108|  1.23k|        encoding = xmlParseEncName(ctxt);
10109|  1.23k|        if (RAW != '"') {
  ------------------
  |  | 2261|  1.23k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10109:13): [True: 330, False: 905]
  ------------------
10110|    330|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10111|    330|            xmlFree(encoding);
10112|    330|            return(NULL);
10113|    330|        } else
10114|    905|            NEXT;
  ------------------
  |  | 2316|    905|#define NEXT xmlNextChar(ctxt)
  ------------------
10115|  6.90k|    } else if (RAW == '\''){
  ------------------
  |  | 2261|  6.90k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10115:16): [True: 6.44k, False: 461]
  ------------------
10116|  6.44k|        NEXT;
  ------------------
  |  | 2316|  6.44k|#define NEXT xmlNextChar(ctxt)
  ------------------
10117|  6.44k|        encoding = xmlParseEncName(ctxt);
10118|  6.44k|        if (RAW != '\'') {
  ------------------
  |  | 2261|  6.44k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10118:13): [True: 771, False: 5.67k]
  ------------------
10119|    771|            xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10120|    771|            xmlFree(encoding);
10121|    771|            return(NULL);
10122|    771|        } else
10123|  5.67k|            NEXT;
  ------------------
  |  | 2316|  5.67k|#define NEXT xmlNextChar(ctxt)
  ------------------
10124|  6.44k|    } else {
10125|    461|        xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10126|    461|    }
10127|       |
10128|  7.04k|    if (encoding == NULL)
  ------------------
  |  Branch (10128:9): [True: 466, False: 6.57k]
  ------------------
10129|    466|        return(NULL);
10130|       |
10131|  6.57k|    xmlSetDeclaredEncoding(ctxt, encoding);
10132|       |
10133|  6.57k|    return(ctxt->encoding);
10134|  7.04k|}
xmlParseSDDecl:
10168|  1.29k|xmlParseSDDecl(xmlParserCtxt *ctxt) {
10169|  1.29k|    int standalone = -2;
10170|       |
10171|  1.29k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.29k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10172|  1.29k|    if (CMP10(CUR_PTR, 's', 't', 'a', 'n', 'd', 'a', 'l', 'o', 'n', 'e')) {
  ------------------
  |  | 2282|  1.29k|  ( CMP9( s, c1, c2, c3, c4, c5, c6, c7, c8, c9 ) && \
  |  |  ------------------
  |  |  |  | 2279|  2.59k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  |  |  ------------------
  |  |  |  |  |  | 2277|  2.59k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2275|  2.59k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2273|  2.59k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2271|  2.59k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2268|  2.59k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 333, False: 966]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 328, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  | 2269|  1.29k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 326, False: 2]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 322, False: 4]
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 317, False: 5]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 311, False: 6]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2275:42): [True: 310, False: 1]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2277:46): [True: 308, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2280|  2.59k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2280:5): [True: 306, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2283|  1.29k|    ((unsigned char *) s)[ 9 ] == c10 )
  |  |  ------------------
  |  |  |  Branch (2283:5): [True: 304, False: 2]
  |  |  ------------------
  ------------------
10173|    304|	SKIP(10);
  ------------------
  |  | 2285|    304|#define SKIP(val) do {							\
  |  | 2286|    304|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    304|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 303]
  |  |  ------------------
  |  | 2288|    304|        xmlParserGrow(ctxt);						\
  |  | 2289|    304|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 304]
  |  |  ------------------
  ------------------
10174|    304|        SKIP_BLANKS;
  ------------------
  |  | 2312|    304|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10175|    304|	if (RAW != '=') {
  ------------------
  |  | 2261|    304|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10175:6): [True: 1, False: 303]
  ------------------
10176|      1|	    xmlFatalErr(ctxt, XML_ERR_EQUAL_REQUIRED, NULL);
10177|      1|	    return(standalone);
10178|      1|        }
10179|    303|	NEXT;
  ------------------
  |  | 2316|    303|#define NEXT xmlNextChar(ctxt)
  ------------------
10180|    303|	SKIP_BLANKS;
  ------------------
  |  | 2312|    303|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10181|    303|        if (RAW == '\''){
  ------------------
  |  | 2261|    303|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10181:13): [True: 284, False: 19]
  ------------------
10182|    284|	    NEXT;
  ------------------
  |  | 2316|    284|#define NEXT xmlNextChar(ctxt)
  ------------------
10183|    284|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|    284|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      5|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10183:10): [True: 5, False: 279]
  |  Branch (10183:26): [True: 4, False: 1]
  ------------------
10184|      4|	        standalone = 0;
10185|      4|                SKIP(2);
  ------------------
  |  | 2285|      4|#define SKIP(val) do {							\
  |  | 2286|      4|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      4|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 3]
  |  |  ------------------
  |  | 2288|      4|        xmlParserGrow(ctxt);						\
  |  | 2289|      4|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 4]
  |  |  ------------------
  ------------------
10186|    280|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|    280|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|    274|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10186:17): [True: 274, False: 6]
  |  Branch (10186:33): [True: 273, False: 1]
  ------------------
10187|    273|	               (NXT(2) == 's')) {
  ------------------
  |  | 2263|    273|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10187:17): [True: 272, False: 1]
  ------------------
10188|    272|	        standalone = 1;
10189|    272|		SKIP(3);
  ------------------
  |  | 2285|    272|#define SKIP(val) do {							\
  |  | 2286|    272|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    272|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 271]
  |  |  ------------------
  |  | 2288|    272|        xmlParserGrow(ctxt);						\
  |  | 2289|    272|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 272]
  |  |  ------------------
  ------------------
10190|    272|            } else {
10191|      8|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10192|      8|	    }
10193|    284|	    if (RAW != '\'') {
  ------------------
  |  | 2261|    284|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10193:10): [True: 17, False: 267]
  ------------------
10194|     17|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10195|     17|	    } else
10196|    267|	        NEXT;
  ------------------
  |  | 2316|    267|#define NEXT xmlNextChar(ctxt)
  ------------------
10197|    284|	} else if (RAW == '"'){
  ------------------
  |  | 2261|     19|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10197:13): [True: 9, False: 10]
  ------------------
10198|      9|	    NEXT;
  ------------------
  |  | 2316|      9|#define NEXT xmlNextChar(ctxt)
  ------------------
10199|      9|	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
              	    if ((RAW == 'n') && (NXT(1) == 'o')) {
  ------------------
  |  | 2263|      3|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10199:10): [True: 3, False: 6]
  |  Branch (10199:26): [True: 2, False: 1]
  ------------------
10200|      2|	        standalone = 0;
10201|      2|		SKIP(2);
  ------------------
  |  | 2285|      2|#define SKIP(val) do {							\
  |  | 2286|      2|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|      2|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 1]
  |  |  ------------------
  |  | 2288|      2|        xmlParserGrow(ctxt);						\
  |  | 2289|      2|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2]
  |  |  ------------------
  ------------------
10202|      7|	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2261|      7|#define RAW (*ctxt->input->cur)
  ------------------
              	    } else if ((RAW == 'y') && (NXT(1) == 'e') &&
  ------------------
  |  | 2263|      5|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10202:17): [True: 5, False: 2]
  |  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|      4|            } else {
10207|      4|		xmlFatalErr(ctxt, XML_ERR_STANDALONE_VALUE, NULL);
10208|      4|	    }
10209|      9|	    if (RAW != '"') {
  ------------------
  |  | 2261|      9|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10209:10): [True: 7, False: 2]
  ------------------
10210|      7|		xmlFatalErr(ctxt, XML_ERR_STRING_NOT_CLOSED, NULL);
10211|      7|	    } else
10212|      2|	        NEXT;
  ------------------
  |  | 2316|      2|#define NEXT xmlNextChar(ctxt)
  ------------------
10213|     10|	} else {
10214|     10|	    xmlFatalErr(ctxt, XML_ERR_STRING_NOT_STARTED, NULL);
10215|     10|        }
10216|    303|    }
10217|  1.29k|    return(standalone);
10218|  1.29k|}
xmlParseXMLDecl:
10230|  3.42k|xmlParseXMLDecl(xmlParserCtxt *ctxt) {
10231|  3.42k|    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.42k|    ctxt->standalone = -2;
10240|       |
10241|       |    /*
10242|       |     * We know that '<?xml' is here.
10243|       |     */
10244|  3.42k|    SKIP(5);
  ------------------
  |  | 2285|  3.42k|#define SKIP(val) do {							\
  |  | 2286|  3.42k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.42k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 0, False: 3.42k]
  |  |  ------------------
  |  | 2288|  3.42k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.42k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.42k]
  |  |  ------------------
  ------------------
10245|       |
10246|  3.42k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.42k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.42k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.38k, False: 46]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.42k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 46, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 30, False: 16]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.42k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 16, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10247|      0|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
10248|      0|	               "Blank needed after '<?xml'\n");
10249|      0|    }
10250|  3.42k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  3.42k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10251|       |
10252|       |    /*
10253|       |     * We must have the VersionInfo here.
10254|       |     */
10255|  3.42k|    version = xmlParseVersionInfo(ctxt);
10256|  3.42k|    if (version == NULL) {
  ------------------
  |  Branch (10256:9): [True: 887, False: 2.54k]
  ------------------
10257|    887|	xmlFatalErr(ctxt, XML_ERR_VERSION_MISSING, NULL);
10258|  2.54k|    } else {
10259|  2.54k|	if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
  ------------------
  |  |   42|  2.54k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
  |  Branch (10259:6): [True: 212, False: 2.32k]
  ------------------
10260|       |	    /*
10261|       |	     * Changed here for XML-1.0 5th edition
10262|       |	     */
10263|    212|	    if (ctxt->options & XML_PARSE_OLD10) {
  ------------------
  |  Branch (10263:10): [True: 25, False: 187]
  ------------------
10264|     25|		xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10265|     25|			          "Unsupported version '%s'\n",
10266|     25|			          version);
10267|    187|	    } else {
10268|    187|	        if ((version[0] == '1') && ((version[1] == '.'))) {
  ------------------
  |  Branch (10268:14): [True: 153, False: 34]
  |  Branch (10268:37): [True: 153, False: 0]
  ------------------
10269|    153|		    xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
10270|    153|		                  "Unsupported version '%s'\n",
10271|    153|				  version, NULL);
10272|    153|		} else {
10273|     34|		    xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
10274|     34|				      "Unsupported version '%s'\n",
10275|     34|				      version);
10276|     34|		}
10277|    187|	    }
10278|    212|	}
10279|  2.54k|	if (ctxt->version != NULL)
  ------------------
  |  Branch (10279:6): [True: 0, False: 2.54k]
  ------------------
10280|      0|	    xmlFree(ctxt->version);
10281|  2.54k|	ctxt->version = version;
10282|  2.54k|    }
10283|       |
10284|       |    /*
10285|       |     * We may have the encoding declaration
10286|       |     */
10287|  3.42k|    if (!IS_BLANK_CH(RAW)) {
  ------------------
  |  |  137|  3.42k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.42k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 1.11k, False: 2.31k]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.42k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.29k, False: 22]
  |  |  |  |  |  Branch (91:23): [True: 5, False: 2.29k]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.42k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 9, False: 2.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10288|  2.30k|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  2.30k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|  1.39k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10288:13): [True: 1.39k, False: 908]
  |  Branch (10288:29): [True: 1.38k, False: 15]
  ------------------
10289|  1.38k|	    SKIP(2);
  ------------------
  |  | 2285|  1.38k|#define SKIP(val) do {							\
  |  | 2286|  1.38k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  1.38k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 2, False: 1.37k]
  |  |  ------------------
  |  | 2288|  1.38k|        xmlParserGrow(ctxt);						\
  |  | 2289|  1.38k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 1.38k]
  |  |  ------------------
  ------------------
10290|  1.38k|	    return;
10291|  1.38k|	}
10292|    923|	xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED, "Blank needed here\n");
10293|    923|    }
10294|  2.04k|    xmlParseEncodingDecl(ctxt);
10295|       |
10296|       |    /*
10297|       |     * We may have the standalone status.
10298|       |     */
10299|  2.04k|    if ((ctxt->encoding != NULL) && (!IS_BLANK_CH(RAW))) {
  ------------------
  |  |  137|    876|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    876|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 38, False: 838]
  |  |  |  |  ------------------
  |  |  |  |   91|    876|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 826, False: 12]
  |  |  |  |  |  Branch (91:23): [True: 13, False: 813]
  |  |  |  |  ------------------
  |  |  |  |   92|    876|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 3, False: 822]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (10299:9): [True: 876, False: 1.17k]
  ------------------
10300|    822|        if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|    822|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    766|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10300:13): [True: 766, False: 56]
  |  Branch (10300:29): [True: 749, False: 17]
  ------------------
10301|    749|	    SKIP(2);
  ------------------
  |  | 2285|    749|#define SKIP(val) do {							\
  |  | 2286|    749|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    749|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 2, False: 747]
  |  |  ------------------
  |  | 2288|    749|        xmlParserGrow(ctxt);						\
  |  | 2289|    749|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 749]
  |  |  ------------------
  ------------------
10302|    749|	    return;
10303|    749|	}
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.29k|    GROW;
  ------------------
  |  | 2308|  1.29k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.29k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.29k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 58, False: 1.24k]
  |  |  ------------------
  |  | 2309|  1.29k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|     58|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 37, False: 21]
  |  |  ------------------
  |  | 2310|  1.29k|	xmlParserGrow(ctxt);
  ------------------
10311|       |
10312|  1.29k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.29k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10313|  1.29k|    ctxt->standalone = xmlParseSDDecl(ctxt);
10314|       |
10315|  1.29k|    SKIP_BLANKS;
  ------------------
  |  | 2312|  1.29k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10316|  1.29k|    if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|  1.29k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '?') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|    361|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10316:9): [True: 361, False: 938]
  |  Branch (10316:25): [True: 322, False: 39]
  ------------------
10317|    322|        SKIP(2);
  ------------------
  |  | 2285|    322|#define SKIP(val) do {							\
  |  | 2286|    322|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    322|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1, False: 321]
  |  |  ------------------
  |  | 2288|    322|        xmlParserGrow(ctxt);						\
  |  | 2289|    322|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 322]
  |  |  ------------------
  ------------------
10318|    977|    } else if (RAW == '>') {
  ------------------
  |  | 2261|    977|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10318:16): [True: 25, False: 952]
  ------------------
10319|       |        /* Deprecated old WD ... */
10320|     25|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10321|     25|	NEXT;
  ------------------
  |  | 2316|     25|#define NEXT xmlNextChar(ctxt)
  ------------------
10322|    952|    } else {
10323|    952|        int c;
10324|       |
10325|    952|	xmlFatalErr(ctxt, XML_ERR_XMLDECL_NOT_FINISHED, NULL);
10326|   360k|        while ((PARSER_STOPPED(ctxt) == 0) &&
  ------------------
  |  |   44|   360k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10326:16): [True: 360k, False: 50]
  ------------------
10327|   360k|               ((c = CUR) != 0)) {
  ------------------
  |  | 2262|   360k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10327:16): [True: 360k, False: 419]
  ------------------
10328|   360k|            NEXT;
  ------------------
  |  | 2316|   360k|#define NEXT xmlNextChar(ctxt)
  ------------------
10329|   360k|            if (c == '>')
  ------------------
  |  Branch (10329:17): [True: 483, False: 359k]
  ------------------
10330|    483|                break;
10331|   360k|        }
10332|    952|    }
10333|  1.29k|}
xmlParseMisc:
10373|  19.3k|xmlParseMisc(xmlParserCtxt *ctxt) {
10374|  21.3k|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  21.3k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (10374:12): [True: 21.2k, False: 188]
  ------------------
10375|  21.2k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  21.2k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10376|  21.2k|        GROW;
  ------------------
  |  | 2308|  21.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  21.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  21.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 21.2k, False: 0]
  |  |  ------------------
  |  | 2309|  21.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  21.2k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 16.6k, False: 4.55k]
  |  |  ------------------
  |  | 2310|  21.2k|	xmlParserGrow(ctxt);
  ------------------
10377|  21.2k|        if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2261|  21.2k|#define RAW (*ctxt->input->cur)
  ------------------
                      if ((RAW == '<') && (NXT(1) == '?')) {
  ------------------
  |  | 2263|  13.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (10377:13): [True: 13.2k, False: 7.91k]
  |  Branch (10377:29): [True: 960, False: 12.3k]
  ------------------
10378|    960|	    xmlParsePI(ctxt);
10379|  20.2k|        } else if (CMP4(CUR_PTR, '<', '!', '-', '-')) {
  ------------------
  |  | 2268|  20.2k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 12.3k, False: 7.91k]
  |  |  |  Branch (2268:41): [True: 3.55k, False: 8.77k]
  |  |  ------------------
  |  | 2269|  20.2k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 1.07k, False: 2.47k]
  |  |  |  Branch (2269:41): [True: 1.07k, False: 2]
  |  |  ------------------
  ------------------
10380|  1.07k|	    xmlParseComment(ctxt);
10381|  19.1k|        } else {
10382|  19.1k|            break;
10383|  19.1k|        }
10384|  21.2k|    }
10385|  19.3k|}
xmlParseDocument:
10418|  8.52k|xmlParseDocument(xmlParserCtxt *ctxt) {
10419|  8.52k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (10419:9): [True: 0, False: 8.52k]
  |  Branch (10419:27): [True: 0, False: 8.52k]
  ------------------
10420|      0|        return(-1);
10421|       |
10422|  8.52k|    GROW;
  ------------------
  |  | 2308|  8.52k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.52k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.52k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.52k, False: 0]
  |  |  ------------------
  |  | 2309|  8.52k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.52k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.03k, False: 2.48k]
  |  |  ------------------
  |  | 2310|  8.52k|	xmlParserGrow(ctxt);
  ------------------
10423|       |
10424|       |    /*
10425|       |     * SAX: detecting the level.
10426|       |     */
10427|  8.52k|    xmlCtxtInitializeLate(ctxt);
10428|       |
10429|  8.52k|    if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10429:9): [True: 8.52k, False: 0]
  |  Branch (10429:24): [True: 8.52k, False: 0]
  ------------------
10430|  8.52k|        ctxt->sax->setDocumentLocator(ctxt->userData,
10431|  8.52k|                (xmlSAXLocator *) &xmlDefaultSAXLocator);
10432|  8.52k|    }
10433|       |
10434|  8.52k|    xmlDetectEncoding(ctxt);
10435|       |
10436|  8.52k|    if (CUR == 0) {
  ------------------
  |  | 2262|  8.52k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (10436:9): [True: 3, False: 8.52k]
  ------------------
10437|      3|	xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
10438|      3|	return(-1);
10439|      3|    }
10440|       |
10441|  8.52k|    GROW;
  ------------------
  |  | 2308|  8.52k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.52k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.52k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.52k, False: 0]
  |  |  ------------------
  |  | 2309|  8.52k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.52k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.03k, False: 2.48k]
  |  |  ------------------
  |  | 2310|  8.52k|	xmlParserGrow(ctxt);
  ------------------
10442|  8.52k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|  8.52k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  17.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 8.43k, False: 86]
  |  |  |  |  |  Branch (2268:41): [True: 682, False: 7.75k]
  |  |  |  |  ------------------
  |  |  |  | 2269|  8.52k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 391, False: 291]
  |  |  |  |  |  Branch (2269:41): [True: 201, False: 190]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 198, False: 3]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    198|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    198|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 185, False: 13]
  |  |  |  |  ------------------
  |  |  |  |   91|    198|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 12, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 7, False: 5]
  |  |  |  |  ------------------
  |  |  |  |   92|    198|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 3, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10443|       |
10444|       |	/*
10445|       |	 * Note that we will switch encoding on the fly.
10446|       |	 */
10447|    195|	xmlParseXMLDecl(ctxt);
10448|    195|	SKIP_BLANKS;
  ------------------
  |  | 2312|    195|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
10449|  8.32k|    } else {
10450|  8.32k|	ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  8.32k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10451|  8.32k|        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10451:13): [True: 1, False: 8.32k]
  ------------------
10452|      1|            xmlErrMemory(ctxt);
10453|      1|            return(-1);
10454|      1|        }
10455|  8.32k|    }
10456|  8.52k|    if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
  ------------------
  |  Branch (10456:9): [True: 8.52k, False: 0]
  |  Branch (10456:24): [True: 8.52k, False: 0]
  |  Branch (10456:54): [True: 8.46k, False: 54]
  ------------------
10457|  8.46k|        ctxt->sax->startDocument(ctxt->userData);
10458|  8.52k|    if ((ctxt->myDoc != NULL) && (ctxt->input != NULL) &&
  ------------------
  |  Branch (10458:9): [True: 8.46k, False: 58]
  |  Branch (10458:34): [True: 8.46k, False: 0]
  ------------------
10459|  8.46k|        (ctxt->input->buf != NULL) && (ctxt->input->buf->compressed >= 0)) {
  ------------------
  |  Branch (10459:9): [True: 8.46k, False: 0]
  |  Branch (10459:39): [True: 0, False: 8.46k]
  ------------------
10460|      0|	ctxt->myDoc->compression = ctxt->input->buf->compressed;
10461|      0|    }
10462|       |
10463|       |    /*
10464|       |     * The Misc part of the Prolog
10465|       |     */
10466|  8.52k|    xmlParseMisc(ctxt);
10467|       |
10468|       |    /*
10469|       |     * Then possibly doc type declaration(s) and more Misc
10470|       |     * (doctypedecl Misc*)?
10471|       |     */
10472|  8.52k|    GROW;
  ------------------
  |  | 2308|  8.52k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.52k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.52k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.52k, False: 0]
  |  |  ------------------
  |  | 2309|  8.52k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.52k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.06k, False: 2.45k]
  |  |  ------------------
  |  | 2310|  8.52k|	xmlParserGrow(ctxt);
  ------------------
10473|  8.52k|    if (CMP9(CUR_PTR, '<', '!', 'D', 'O', 'C', 'T', 'Y', 'P', 'E')) {
  ------------------
  |  | 2279|  8.52k|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  17.0k|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  17.0k|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  17.0k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  17.0k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  17.0k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 8.51k, False: 10]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.44k, False: 6.06k]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  8.52k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.43k, False: 11]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.43k, False: 3]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 2.42k, False: 5]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 2.42k, False: 7]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 2.41k, False: 9]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 2.41k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  8.52k|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 2.40k, False: 3]
  |  |  ------------------
  ------------------
10474|       |
10475|  2.40k|	ctxt->inSubset = 1;
10476|  2.40k|	xmlParseDocTypeDecl(ctxt);
10477|  2.40k|	if (RAW == '[') {
  ------------------
  |  | 2261|  2.40k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10477:6): [True: 800, False: 1.60k]
  ------------------
10478|    800|	    xmlParseInternalSubset(ctxt);
10479|  1.60k|	} else if (RAW == '>') {
  ------------------
  |  | 2261|  1.60k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10479:13): [True: 1.58k, False: 27]
  ------------------
10480|  1.58k|            NEXT;
  ------------------
  |  | 2316|  1.58k|#define NEXT xmlNextChar(ctxt)
  ------------------
10481|  1.58k|        }
10482|       |
10483|       |	/*
10484|       |	 * Create and update the external subset.
10485|       |	 */
10486|  2.40k|	ctxt->inSubset = 2;
10487|  2.40k|	if ((ctxt->sax != NULL) && (ctxt->sax->externalSubset != NULL) &&
  ------------------
  |  Branch (10487:6): [True: 2.40k, False: 0]
  |  Branch (10487:29): [True: 2.40k, False: 0]
  ------------------
10488|  2.40k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (10488:6): [True: 2.32k, False: 86]
  ------------------
10489|  2.32k|	    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
10490|  2.32k|	                              ctxt->extSubSystem, ctxt->extSubURI);
10491|  2.40k|	ctxt->inSubset = 0;
10492|       |
10493|  2.40k|        xmlCleanSpecialAttr(ctxt);
10494|       |
10495|  2.40k|	xmlParseMisc(ctxt);
10496|  2.40k|    }
10497|       |
10498|       |    /*
10499|       |     * Time to start parsing the tree itself
10500|       |     */
10501|  8.52k|    GROW;
  ------------------
  |  | 2308|  8.52k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.52k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.52k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 8.52k, False: 0]
  |  |  ------------------
  |  | 2309|  8.52k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  8.52k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 6.23k, False: 2.29k]
  |  |  ------------------
  |  | 2310|  8.52k|	xmlParserGrow(ctxt);
  ------------------
10502|  8.52k|    if (RAW != '<') {
  ------------------
  |  | 2261|  8.52k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (10502:9): [True: 96, False: 8.42k]
  ------------------
10503|     96|        if (ctxt->wellFormed)
  ------------------
  |  Branch (10503:13): [True: 5, False: 91]
  ------------------
10504|      5|            xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10505|      5|                           "Start tag expected, '<' not found\n");
10506|  8.42k|    } else {
10507|  8.42k|	xmlParseElement(ctxt);
10508|       |
10509|       |	/*
10510|       |	 * The Misc part at the end
10511|       |	 */
10512|  8.42k|	xmlParseMisc(ctxt);
10513|       |
10514|  8.42k|        xmlParserCheckEOF(ctxt, XML_ERR_DOCUMENT_END);
10515|  8.42k|    }
10516|       |
10517|  8.52k|    ctxt->instate = XML_PARSER_EOF;
10518|  8.52k|    xmlFinishDocument(ctxt);
10519|       |
10520|  8.52k|    if (! ctxt->wellFormed) {
  ------------------
  |  Branch (10520:9): [True: 904, False: 7.61k]
  ------------------
10521|    904|	ctxt->valid = 0;
10522|    904|	return(-1);
10523|    904|    }
10524|       |
10525|  7.61k|    return(0);
10526|  8.52k|}
xmlParseChunk:
11275|   450k|              int terminate) {
11276|   450k|    size_t curBase;
11277|   450k|    size_t maxLength;
11278|   450k|    size_t pos;
11279|   450k|    int end_in_lf = 0;
11280|   450k|    int res;
11281|       |
11282|   450k|    if ((ctxt == NULL) || (size < 0))
  ------------------
  |  Branch (11282:9): [True: 0, False: 450k]
  |  Branch (11282:27): [True: 0, False: 450k]
  ------------------
11283|      0|        return(XML_ERR_ARGUMENT);
11284|   450k|    if ((chunk == NULL) && (size > 0))
  ------------------
  |  Branch (11284:9): [True: 0, False: 450k]
  |  Branch (11284:28): [True: 0, False: 0]
  ------------------
11285|      0|        return(XML_ERR_ARGUMENT);
11286|   450k|    if ((ctxt->input == NULL) || (ctxt->input->buf == NULL))
  ------------------
  |  Branch (11286:9): [True: 0, False: 450k]
  |  Branch (11286:34): [True: 0, False: 450k]
  ------------------
11287|      0|        return(XML_ERR_ARGUMENT);
11288|   450k|    if (ctxt->disableSAX != 0)
  ------------------
  |  Branch (11288:9): [True: 3.08k, False: 447k]
  ------------------
11289|  3.08k|        return(ctxt->errNo);
11290|       |
11291|   447k|    ctxt->input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|   447k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
11292|   447k|    if (ctxt->instate == XML_PARSER_START)
  ------------------
  |  Branch (11292:9): [True: 39.8k, False: 407k]
  ------------------
11293|  39.8k|        xmlCtxtInitializeLate(ctxt);
11294|   447k|    if ((size > 0) && (chunk != NULL) && (!terminate) &&
  ------------------
  |  Branch (11294:9): [True: 417k, False: 30.5k]
  |  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.13k, False: 415k]
  ------------------
11296|  2.13k|	end_in_lf = 1;
11297|  2.13k|	size--;
11298|  2.13k|    }
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|   447k|    pos = ctxt->input->cur - ctxt->input->base;
11305|   447k|    res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
11306|   447k|    xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11307|   447k|    if (res < 0) {
  ------------------
  |  Branch (11307:9): [True: 222, False: 447k]
  ------------------
11308|    222|        xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11309|    222|        return(ctxt->errNo);
11310|    222|    }
11311|       |
11312|   447k|    xmlParseTryOrFinish(ctxt, terminate);
11313|       |
11314|   447k|    curBase = ctxt->input->cur - ctxt->input->base;
11315|   447k|    maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (11315:17): [True: 210k, False: 236k]
  ------------------
11316|   210k|                XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   210k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
11317|   447k|                XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|   684k|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
11318|   447k|    if (curBase > maxLength) {
  ------------------
  |  Branch (11318:9): [True: 0, False: 447k]
  ------------------
11319|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
11320|      0|                    "Buffer size limit exceeded, try XML_PARSE_HUGE\n");
11321|      0|    }
11322|       |
11323|   447k|    if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX != 0))
  ------------------
  |  Branch (11323:9): [True: 82.6k, False: 364k]
  |  Branch (11323:40): [True: 12.0k, False: 70.5k]
  ------------------
11324|  12.0k|        return(ctxt->errNo);
11325|       |
11326|   435k|    if (end_in_lf == 1) {
  ------------------
  |  Branch (11326:9): [True: 2.12k, False: 433k]
  ------------------
11327|  2.12k|	pos = ctxt->input->cur - ctxt->input->base;
11328|  2.12k|	res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
11329|  2.12k|	xmlBufUpdateInput(ctxt->input->buf->buffer, ctxt->input, pos);
11330|  2.12k|        if (res < 0) {
  ------------------
  |  Branch (11330:13): [True: 2, False: 2.12k]
  ------------------
11331|      2|            xmlCtxtErrIO(ctxt, ctxt->input->buf->error, NULL);
11332|      2|            return(ctxt->errNo);
11333|      2|        }
11334|  2.12k|    }
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.3k, False: 9.69k]
  ------------------
11340|  11.3k|            (ctxt->instate != XML_PARSER_EPILOG)) {
  ------------------
  |  Branch (11340:13): [True: 5.73k, False: 5.58k]
  ------------------
11341|  5.73k|            if (ctxt->nameNr > 0) {
  ------------------
  |  Branch (11341:17): [True: 4.27k, False: 1.46k]
  ------------------
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: 23, False: 1.44k]
  ------------------
11348|     23|                xmlFatalErr(ctxt, XML_ERR_DOCUMENT_EMPTY, NULL);
11349|  1.44k|            } else {
11350|  1.44k|                xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
11351|  1.44k|                               "Start tag expected, '<' not found\n");
11352|  1.44k|            }
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.0k, False: 9.94k]
  ------------------
11357|  11.0k|            ctxt->instate = XML_PARSER_EOF;
11358|  11.0k|            xmlFinishDocument(ctxt);
11359|  11.0k|	}
11360|  21.0k|    }
11361|   435k|    if (ctxt->wellFormed == 0)
  ------------------
  |  Branch (11361:9): [True: 22.2k, False: 413k]
  ------------------
11362|  22.2k|	return((xmlParserErrors) ctxt->errNo);
11363|   413k|    else
11364|   413k|        return(0);
11365|   435k|}
xmlCreatePushParserCtxt:
11396|  39.6k|                        const char *chunk, int size, const char *filename) {
11397|  39.6k|    xmlParserCtxtPtr ctxt;
11398|  39.6k|    xmlParserInputPtr input;
11399|       |
11400|  39.6k|    ctxt = xmlNewSAXParserCtxt(sax, user_data);
11401|  39.6k|    if (ctxt == NULL)
  ------------------
  |  Branch (11401:9): [True: 22, False: 39.6k]
  ------------------
11402|     22|	return(NULL);
11403|       |
11404|  39.6k|    ctxt->options &= ~XML_PARSE_NODICT;
11405|  39.6k|    ctxt->dictNames = 1;
11406|       |
11407|  39.6k|    input = xmlNewPushInput(filename, chunk, size);
11408|  39.6k|    if (input == NULL) {
  ------------------
  |  Branch (11408:9): [True: 8, False: 39.6k]
  ------------------
11409|      8|	xmlFreeParserCtxt(ctxt);
11410|      8|	return(NULL);
11411|      8|    }
11412|  39.6k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (11412:9): [True: 0, False: 39.6k]
  ------------------
11413|      0|        xmlFreeInputStream(input);
11414|      0|        xmlFreeParserCtxt(ctxt);
11415|      0|        return(NULL);
11416|      0|    }
11417|       |
11418|  39.6k|    return(ctxt);
11419|  39.6k|}
xmlStopParser:
11428|  41.9k|xmlStopParser(xmlParserCtxt *ctxt) {
11429|  41.9k|    if (ctxt == NULL)
  ------------------
  |  Branch (11429:9): [True: 0, False: 41.9k]
  ------------------
11430|      0|        return;
11431|       |
11432|       |    /* This stops the parser */
11433|  41.9k|    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|  41.9k|    if (ctxt->errNo == XML_ERR_OK) {
  ------------------
  |  Branch (11441:9): [True: 3.56k, False: 38.4k]
  ------------------
11442|  3.56k|        ctxt->errNo = XML_ERR_USER_STOP;
11443|  3.56k|        ctxt->lastError.code = XML_ERR_USER_STOP;
11444|  3.56k|        ctxt->wellFormed = 0;
11445|  3.56k|    }
11446|  41.9k|}
xmlCtxtUseOptions:
13304|  49.1k|{
13305|  49.1k|    int keepMask;
13306|       |
13307|  49.1k|#ifdef LIBXML_HTML_ENABLED
13308|  49.1k|    if ((ctxt != NULL) && (ctxt->html))
  ------------------
  |  Branch (13308:9): [True: 49.1k, False: 0]
  |  Branch (13308:27): [True: 0, False: 49.1k]
  ------------------
13309|      0|        return(htmlCtxtUseOptions(ctxt, options));
13310|  49.1k|#endif
13311|       |
13312|       |    /*
13313|       |     * For historic reasons, some options can only be enabled.
13314|       |     */
13315|  49.1k|    keepMask = XML_PARSE_NOERROR |
13316|  49.1k|               XML_PARSE_NOWARNING |
13317|  49.1k|               XML_PARSE_NONET |
13318|  49.1k|               XML_PARSE_NSCLEAN |
13319|  49.1k|               XML_PARSE_NOCDATA |
13320|  49.1k|               XML_PARSE_COMPACT |
13321|  49.1k|               XML_PARSE_OLD10 |
13322|  49.1k|               XML_PARSE_HUGE |
13323|  49.1k|               XML_PARSE_OLDSAX |
13324|  49.1k|               XML_PARSE_IGNORE_ENC |
13325|  49.1k|               XML_PARSE_BIG_LINES;
13326|       |
13327|  49.1k|    return(xmlCtxtSetOptionsInternal(ctxt, options, keepMask));
13328|  49.1k|}
parser.c:xmlParserNsLookup:
 1525|  2.11M|                  xmlParserNsBucket **bucketPtr) {
 1526|  2.11M|    xmlParserNsBucket *bucket, *tombstone;
 1527|  2.11M|    unsigned index, hashValue;
 1528|       |
 1529|  2.11M|    if (prefix->name == NULL)
  ------------------
  |  Branch (1529:9): [True: 781k, False: 1.33M]
  ------------------
 1530|   781k|        return(ctxt->nsdb->defaultNsIndex);
 1531|       |
 1532|  1.33M|    if (ctxt->nsdb->hashSize == 0)
  ------------------
  |  Branch (1532:9): [True: 34.5k, False: 1.30M]
  ------------------
 1533|  34.5k|        return(INT_MAX);
 1534|       |
 1535|  1.30M|    hashValue = prefix->hashValue;
 1536|  1.30M|    index = hashValue & (ctxt->nsdb->hashSize - 1);
 1537|  1.30M|    bucket = &ctxt->nsdb->hash[index];
 1538|  1.30M|    tombstone = NULL;
 1539|       |
 1540|  1.91M|    while (bucket->hashValue) {
  ------------------
  |  Branch (1540:12): [True: 1.64M, False: 269k]
  ------------------
 1541|  1.64M|        if (bucket->index == INT_MAX) {
  ------------------
  |  Branch (1541:13): [True: 163k, False: 1.47M]
  ------------------
 1542|   163k|            if (tombstone == NULL)
  ------------------
  |  Branch (1542:17): [True: 145k, False: 18.0k]
  ------------------
 1543|   145k|                tombstone = bucket;
 1544|  1.47M|        } else if (bucket->hashValue == hashValue) {
  ------------------
  |  Branch (1544:20): [True: 1.03M, False: 444k]
  ------------------
 1545|  1.03M|            if (ctxt->nsTab[bucket->index * 2] == prefix->name) {
  ------------------
  |  Branch (1545:17): [True: 1.03M, False: 0]
  ------------------
 1546|  1.03M|                if (bucketPtr != NULL)
  ------------------
  |  Branch (1546:21): [True: 656k, False: 377k]
  ------------------
 1547|   656k|                    *bucketPtr = bucket;
 1548|  1.03M|                return(bucket->index);
 1549|  1.03M|            }
 1550|  1.03M|        }
 1551|       |
 1552|   607k|        index++;
 1553|   607k|        bucket++;
 1554|   607k|        if (index == ctxt->nsdb->hashSize) {
  ------------------
  |  Branch (1554:13): [True: 151k, False: 456k]
  ------------------
 1555|   151k|            index = 0;
 1556|   151k|            bucket = ctxt->nsdb->hash;
 1557|   151k|        }
 1558|   607k|    }
 1559|       |
 1560|   269k|    if (bucketPtr != NULL)
  ------------------
  |  Branch (1560:9): [True: 129k, False: 140k]
  ------------------
 1561|   129k|        *bucketPtr = tombstone ? tombstone : bucket;
  ------------------
  |  Branch (1561:22): [True: 125k, False: 3.90k]
  ------------------
 1562|       |    return(INT_MAX);
 1563|  1.30M|}
parser.c:xmlFatalErrMsg:
  259|  21.3M|{
  260|  21.3M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  261|  21.3M|               NULL, NULL, NULL, 0, "%s", msg);
  262|  21.3M|}
parser.c:xmlErrMemory:
  224|    469|xmlErrMemory(xmlParserCtxtPtr ctxt) {
  225|    469|    xmlCtxtErrMemory(ctxt);
  226|    469|}
parser.c:xmlFatalErrMsgInt:
  313|  7.15M|{
  314|  7.15M|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  315|  7.15M|               NULL, NULL, NULL, val, msg, val);
  316|  7.15M|}
parser.c:xmlIsNameChar:
 3068|  26.9M|xmlIsNameChar(int c, int old10) {
 3069|  26.9M|    if (!old10)
  ------------------
  |  Branch (3069:9): [True: 17.2M, False: 9.70M]
  ------------------
 3070|  17.2M|        return(xmlIsNameCharNew(c));
 3071|  9.70M|    else
 3072|  9.70M|        return(xmlIsNameCharOld(c));
 3073|  26.9M|}
parser.c:xmlIsNameCharNew:
 3010|  17.2M|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|  17.2M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3015:9): [True: 17.1M, False: 60.2k]
  |  Branch (3015:23): [True: 17.1M, False: 20.5k]
  |  Branch (3015:37): [True: 17.1M, False: 10.7k]
  ------------------
 3016|  17.1M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (3016:11): [True: 10.7M, False: 6.39M]
  |  Branch (3016:25): [True: 2.79M, False: 7.92M]
  ------------------
 3017|  14.3M|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (3017:11): [True: 11.7M, False: 2.57M]
  |  Branch (3017:25): [True: 3.78M, False: 7.95M]
  ------------------
 3018|  10.5M|         ((c >= '0') && (c <= '9')) || /* !start */
  ------------------
  |  Branch (3018:11): [True: 10.3M, False: 216k]
  |  Branch (3018:25): [True: 562k, False: 9.75M]
  ------------------
 3019|  9.96M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3019:10): [True: 17.8k, False: 9.95M]
  |  Branch (3019:24): [True: 17.5k, False: 9.93M]
  ------------------
 3020|  9.93M|         (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
  ------------------
  |  Branch (3020:10): [True: 66.4k, False: 9.86M]
  |  Branch (3020:24): [True: 29.6k, False: 9.83M]
  |  Branch (3020:38): [True: 369, False: 9.83M]
  ------------------
 3021|  9.83M|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (3021:11): [True: 7.91M, False: 1.92M]
  |  Branch (3021:26): [True: 167k, False: 7.74M]
  ------------------
 3022|  9.66M|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (3022:11): [True: 7.74M, False: 1.92M]
  |  Branch (3022:26): [True: 1.64k, False: 7.74M]
  ------------------
 3023|  9.66M|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (3023:11): [True: 7.74M, False: 1.92M]
  |  Branch (3023:26): [True: 1.36M, False: 6.37M]
  ------------------
 3024|  8.30M|         ((c >= 0x300) && (c <= 0x36F)) || /* !start */
  ------------------
  |  Branch (3024:11): [True: 6.37M, False: 1.92M]
  |  Branch (3024:27): [True: 1.66k, False: 6.37M]
  ------------------
 3025|  8.30M|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (3025:11): [True: 6.37M, False: 1.92M]
  |  Branch (3025:27): [True: 293, False: 6.37M]
  ------------------
 3026|  8.30M|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (3026:11): [True: 6.37M, False: 1.92M]
  |  Branch (3026:27): [True: 3.84M, False: 2.53M]
  ------------------
 3027|  4.45M|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (3027:11): [True: 2.53M, False: 1.92M]
  |  Branch (3027:28): [True: 303, False: 2.53M]
  ------------------
 3028|  4.45M|         ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
  ------------------
  |  Branch (3028:11): [True: 2.53M, False: 1.92M]
  |  Branch (3028:28): [True: 215, False: 2.53M]
  ------------------
 3029|  4.45M|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (3029:11): [True: 2.52M, False: 1.92M]
  |  Branch (3029:28): [True: 2.81k, False: 2.52M]
  ------------------
 3030|  4.45M|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3030:11): [True: 2.52M, False: 1.92M]
  |  Branch (3030:28): [True: 4.06k, False: 2.52M]
  ------------------
 3031|  4.44M|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3031:11): [True: 2.52M, False: 1.92M]
  |  Branch (3031:28): [True: 66.4k, False: 2.45M]
  ------------------
 3032|  4.38M|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3032:11): [True: 2.45M, False: 1.92M]
  |  Branch (3032:28): [True: 472, False: 2.45M]
  ------------------
 3033|  4.38M|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3033:11): [True: 2.45M, False: 1.92M]
  |  Branch (3033:28): [True: 2.44M, False: 12.2k]
  ------------------
 3034|  1.93M|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3034:11): [True: 12.2k, False: 1.92M]
  |  Branch (3034:29): [True: 2.02k, False: 10.1k]
  ------------------
 3035|  15.1M|         return(1);
 3036|  2.02M|    return(0);
 3037|  17.2M|}
parser.c:xmlIsNameCharOld:
 3048|  9.70M|xmlIsNameCharOld(int c) {
 3049|  9.70M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3049:9): [True: 9.70M, False: 4.10k]
  |  Branch (3049:23): [True: 9.70M, False: 1.22k]
  |  Branch (3049:37): [True: 9.69M, False: 703]
  ------------------
 3050|  9.69M|        ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  208|  9.69M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  9.69M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  19.3M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 7.17M, False: 2.52M]
  |  |  |  |  |  |  |  Branch (81:28): [True: 7.32M, False: 2.37M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  19.3M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  7.32M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 4.83M, False: 2.49M]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 947k, False: 3.88M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  7.32M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 3.87M, False: 2.50M]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.07M, False: 2.79M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  7.32M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 2.79M, False: 2.51M]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 2.78M, False: 9.48k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  7.32M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 9.48k, False: 2.51M]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 1.87k, False: 7.60k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  7.32M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 7.60k, False: 2.51M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  19.3M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|  2.52M|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|  2.52M|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.33k, False: 2.52M]
  |  |  |  |  |  |  |  Branch (169:31): [True: 2.51M, False: 13.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|  2.52M|				 0 :\
  |  |  |  |  |  |  171|  2.52M|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 10.8k, False: 2.94k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 770, False: 10.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  13.7k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 200, False: 12.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  13.7k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 10.4k, False: 2.31k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 363, False: 10.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
  ------------------
  |  |  153|  2.52M|#define IS_DIGIT(c) xmlIsDigitQ(c)
  |  |  ------------------
  |  |  |  |  144|  2.52M|#define xmlIsDigitQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (144:26): [True: 2.51M, False: 12.4k]
  |  |  |  |  ------------------
  |  |  |  |  145|  2.52M|				 xmlIsDigit_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  137|  2.51M|#define xmlIsDigit_ch(c)	(((0x30 <= (c)) && ((c) <= 0x39)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (137:28): [True: 2.48M, False: 22.0k]
  |  |  |  |  |  |  |  Branch (137:45): [True: 677k, False: 1.81M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  146|  2.52M|				 xmlCharInRange((c), &xmlIsDigitGroup))
  |  |  ------------------
  ------------------
  |  Branch (3050:28): [True: 677k, False: 1.84M]
  ------------------
 3051|  1.84M|         (c == '.') || (c == '-') ||
  ------------------
  |  Branch (3051:10): [True: 754, False: 1.84M]
  |  Branch (3051:24): [True: 2.40k, False: 1.84M]
  ------------------
 3052|  1.84M|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (3052:10): [True: 10.7k, False: 1.83M]
  |  Branch (3052:24): [True: 8.65k, False: 1.82M]
  ------------------
 3053|  1.82M|         (IS_COMBINING(c)) ||
  ------------------
  |  |  168|  1.82M|#define IS_COMBINING(c) xmlIsCombiningQ(c)
  |  |  ------------------
  |  |  |  |  128|  1.82M|#define xmlIsCombiningQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:29): [True: 1.81M, False: 12.2k]
  |  |  |  |  ------------------
  |  |  |  |  129|  1.82M|				 0 : \
  |  |  |  |  130|  1.82M|				 xmlCharInRange((c), &xmlIsCombiningGroup))
  |  |  ------------------
  ------------------
  |  Branch (3053:10): [True: 1.19k, False: 1.82M]
  ------------------
 3054|  1.82M|         (IS_EXTENDER(c))))
  ------------------
  |  |  185|  1.82M|#define IS_EXTENDER(c) xmlIsExtenderQ(c)
  |  |  ------------------
  |  |  |  |  160|  1.82M|#define xmlIsExtenderQ(c)	(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (160:28): [True: 1.81M, False: 11.0k]
  |  |  |  |  ------------------
  |  |  |  |  161|  1.82M|				 xmlIsExtender_ch((c)) : \
  |  |  |  |  ------------------
  |  |  |  |  |  |  153|  1.81M|#define xmlIsExtender_ch(c)	(((c) == 0xb7))
  |  |  |  |  ------------------
  |  |  |  |  162|  1.82M|				 xmlCharInRange((c), &xmlIsExtenderGroup))
  |  |  ------------------
  ------------------
  |  Branch (3054:10): [True: 793, False: 1.82M]
  ------------------
 3055|  7.87M|        return(1);
 3056|  1.82M|    return(0);
 3057|  9.70M|}
parser.c:xmlIsNameStartChar:
 3060|  4.29M|xmlIsNameStartChar(int c, int old10) {
 3061|  4.29M|    if (!old10)
  ------------------
  |  Branch (3061:9): [True: 2.28M, False: 2.01M]
  ------------------
 3062|  2.28M|        return(xmlIsNameStartCharNew(c));
 3063|  2.01M|    else
 3064|  2.01M|        return(xmlIsNameStartCharOld(c));
 3065|  4.29M|}
parser.c:xmlIsNameStartCharNew:
 2984|  2.28M|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|  2.28M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (2989:9): [True: 2.27M, False: 4.91k]
  |  Branch (2989:23): [True: 2.27M, False: 3.35k]
  |  Branch (2989:37): [True: 2.27M, False: 2.67k]
  ------------------
 2990|  2.27M|        (((c >= 'a') && (c <= 'z')) ||
  ------------------
  |  Branch (2990:11): [True: 1.98M, False: 287k]
  |  Branch (2990:25): [True: 1.94M, False: 44.7k]
  ------------------
 2991|   332k|         ((c >= 'A') && (c <= 'Z')) ||
  ------------------
  |  Branch (2991:11): [True: 108k, False: 223k]
  |  Branch (2991:25): [True: 55.1k, False: 53.7k]
  ------------------
 2992|   276k|         (c == '_') || (c == ':') ||
  ------------------
  |  Branch (2992:10): [True: 5.35k, False: 271k]
  |  Branch (2992:24): [True: 2.90k, False: 268k]
  ------------------
 2993|   268k|         ((c >= 0xC0) && (c <= 0xD6)) ||
  ------------------
  |  Branch (2993:11): [True: 41.4k, False: 227k]
  |  Branch (2993:26): [True: 597, False: 40.8k]
  ------------------
 2994|   268k|         ((c >= 0xD8) && (c <= 0xF6)) ||
  ------------------
  |  Branch (2994:11): [True: 40.8k, False: 227k]
  |  Branch (2994:26): [True: 1.21k, False: 39.6k]
  ------------------
 2995|   266k|         ((c >= 0xF8) && (c <= 0x2FF)) ||
  ------------------
  |  Branch (2995:11): [True: 39.6k, False: 227k]
  |  Branch (2995:26): [True: 2.12k, False: 37.5k]
  ------------------
 2996|   264k|         ((c >= 0x370) && (c <= 0x37D)) ||
  ------------------
  |  Branch (2996:11): [True: 37.5k, False: 227k]
  |  Branch (2996:27): [True: 271, False: 37.2k]
  ------------------
 2997|   264k|         ((c >= 0x37F) && (c <= 0x1FFF)) ||
  ------------------
  |  Branch (2997:11): [True: 37.2k, False: 227k]
  |  Branch (2997:27): [True: 3.51k, False: 33.7k]
  ------------------
 2998|   260k|         ((c >= 0x200C) && (c <= 0x200D)) ||
  ------------------
  |  Branch (2998:11): [True: 33.7k, False: 227k]
  |  Branch (2998:28): [True: 241, False: 33.4k]
  ------------------
 2999|   260k|         ((c >= 0x2070) && (c <= 0x218F)) ||
  ------------------
  |  Branch (2999:11): [True: 32.1k, False: 228k]
  |  Branch (2999:28): [True: 240, False: 31.8k]
  ------------------
 3000|   260k|         ((c >= 0x2C00) && (c <= 0x2FEF)) ||
  ------------------
  |  Branch (3000:11): [True: 31.8k, False: 228k]
  |  Branch (3000:28): [True: 460, False: 31.3k]
  ------------------
 3001|   260k|         ((c >= 0x3001) && (c <= 0xD7FF)) ||
  ------------------
  |  Branch (3001:11): [True: 31.3k, False: 228k]
  |  Branch (3001:28): [True: 2.50k, False: 28.8k]
  ------------------
 3002|   257k|         ((c >= 0xF900) && (c <= 0xFDCF)) ||
  ------------------
  |  Branch (3002:11): [True: 28.8k, False: 228k]
  |  Branch (3002:28): [True: 266, False: 28.5k]
  ------------------
 3003|   257k|         ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
  ------------------
  |  Branch (3003:11): [True: 28.5k, False: 228k]
  |  Branch (3003:28): [True: 7.27k, False: 21.3k]
  ------------------
 3004|   249k|         ((c >= 0x10000) && (c <= 0xEFFFF))))
  ------------------
  |  Branch (3004:11): [True: 21.3k, False: 228k]
  |  Branch (3004:29): [True: 1.39k, False: 19.9k]
  ------------------
 3005|  2.02M|        return(1);
 3006|   259k|    return(0);
 3007|  2.28M|}
parser.c:xmlIsNameStartCharOld:
 3040|  2.01M|xmlIsNameStartCharOld(int c) {
 3041|  2.01M|    if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
  ------------------
  |  Branch (3041:9): [True: 2.00M, False: 3.40k]
  |  Branch (3041:23): [True: 2.00M, False: 4.26k]
  |  Branch (3041:37): [True: 2.00M, False: 2.37k]
  ------------------
 3042|  2.00M|        ((IS_LETTER(c) || (c == '_') || (c == ':'))))
  ------------------
  |  |  208|  4.00M|#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  145|  2.00M|#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |   81|  4.00M|#define xmlIsBaseCharQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (81:27): [True: 1.81M, False: 186k]
  |  |  |  |  |  |  |  Branch (81:28): [True: 1.98M, False: 15.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   82|  4.00M|				 xmlIsBaseChar_ch((c)) : \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   70|  1.98M|#define xmlIsBaseChar_ch(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (70:31): [True: 1.81M, False: 168k]
  |  |  |  |  |  |  |  |  |  Branch (70:48): [True: 4.96k, False: 1.81M]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   71|  1.98M|				 ((0x61 <= (c)) && ((c) <= 0x7a)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (71:7): [True: 1.81M, False: 170k]
  |  |  |  |  |  |  |  |  |  Branch (71:24): [True: 1.80M, False: 3.15k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   72|  1.98M|				 ((0xc0 <= (c)) && ((c) <= 0xd6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (72:7): [True: 1.77k, False: 172k]
  |  |  |  |  |  |  |  |  |  Branch (72:24): [True: 448, False: 1.32k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   73|  1.98M|				 ((0xd8 <= (c)) && ((c) <= 0xf6)) || \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (73:7): [True: 1.32k, False: 172k]
  |  |  |  |  |  |  |  |  |  Branch (73:24): [True: 656, False: 670]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   74|  1.98M|				  (0xf8 <= (c)))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (74:7): [True: 670, False: 172k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |   83|  4.00M|				 xmlCharInRange((c), &xmlIsBaseCharGroup))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
  |  |  ------------------
  |  |  |  |  200|   186k|#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
  |  |  |  |  ------------------
  |  |  |  |  |  |  169|   186k|#define xmlIsIdeographicQ(c)	(((c) < 0x100) ? \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (169:30): [True: 1.34k, False: 185k]
  |  |  |  |  |  |  |  Branch (169:31): [True: 172k, False: 14.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  170|   186k|				 0 :\
  |  |  |  |  |  |  171|   186k|				(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (171:7): [True: 12.0k, False: 2.87k]
  |  |  |  |  |  |  |  Branch (171:26): [True: 804, False: 11.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  172|  14.9k|				 ((c) == 0x3007) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (172:6): [True: 201, False: 13.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  173|  14.9k|				 ((0x3021 <= (c)) && ((c) <= 0x3029))))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (173:7): [True: 11.7k, False: 2.13k]
  |  |  |  |  |  |  |  Branch (173:26): [True: 338, False: 11.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3042:27): [True: 624, False: 184k]
  |  Branch (3042:41): [True: 3.39k, False: 181k]
  ------------------
 3043|  1.82M|        return(1);
 3044|   191k|    return(0);
 3045|  2.01M|}
parser.c:xmlParseNameComplex:
 3123|   306k|xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
 3124|   306k|    const xmlChar *ret;
 3125|   306k|    int len = 0, l;
 3126|   306k|    int c;
 3127|   306k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3127:21): [True: 154k, False: 152k]
  ------------------
 3128|   154k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   154k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3129|   306k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|   152k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3130|   306k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3130:17): [True: 124k, False: 181k]
  ------------------
 3131|       |
 3132|       |    /*
 3133|       |     * Handler for more complex cases
 3134|       |     */
 3135|   306k|    c = xmlCurrentChar(ctxt, &l);
 3136|   306k|    if (!xmlIsNameStartChar(c, old10))
  ------------------
  |  Branch (3136:9): [True: 235k, False: 71.2k]
  ------------------
 3137|   235k|        return(NULL);
 3138|  71.2k|    len += l;
 3139|  71.2k|    NEXTL(l);
  ------------------
  |  | 2325|  71.2k|#define NEXTL(l) do {							\
  |  | 2326|  71.2k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 71.2k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  71.2k|    } else ctxt->input->col++;						\
  |  | 2329|  71.2k|    ctxt->input->cur += l;				\
  |  | 2330|  71.2k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 71.2k]
  |  |  ------------------
  ------------------
 3140|  71.2k|    c = xmlCurrentChar(ctxt, &l);
 3141|  7.19M|    while (xmlIsNameChar(c, old10)) {
  ------------------
  |  Branch (3141:12): [True: 7.12M, False: 71.2k]
  ------------------
 3142|  7.12M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3142:13): [True: 7.12M, False: 0]
  ------------------
 3143|  7.12M|            len += l;
 3144|  7.12M|        NEXTL(l);
  ------------------
  |  | 2325|  7.12M|#define NEXTL(l) do {							\
  |  | 2326|  7.12M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 7.12M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  7.12M|    } else ctxt->input->col++;						\
  |  | 2329|  7.12M|    ctxt->input->cur += l;				\
  |  | 2330|  7.12M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 7.12M]
  |  |  ------------------
  ------------------
 3145|  7.12M|        c = xmlCurrentChar(ctxt, &l);
 3146|  7.12M|    }
 3147|  71.2k|    if (len > maxLength) {
  ------------------
  |  Branch (3147:9): [True: 85, False: 71.1k]
  ------------------
 3148|     85|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
 3149|     85|        return(NULL);
 3150|     85|    }
 3151|  71.1k|    if (ctxt->input->cur - ctxt->input->base < len) {
  ------------------
  |  Branch (3151:9): [True: 0, False: 71.1k]
  ------------------
 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|  71.1k|    if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
  ------------------
  |  Branch (3161:9): [True: 3.73k, False: 67.3k]
  |  Branch (3161:40): [True: 252, False: 3.48k]
  ------------------
 3162|    252|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len);
 3163|  70.8k|    else
 3164|  70.8k|        ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
 3165|  71.1k|    if (ret == NULL)
  ------------------
  |  Branch (3165:9): [True: 2, False: 71.1k]
  ------------------
 3166|      2|        xmlErrMemory(ctxt);
 3167|  71.1k|    return(ret);
 3168|  71.1k|}
parser.c:xmlSBufInit:
  683|   587k|xmlSBufInit(xmlSBuf *buf, unsigned max) {
  684|       |    buf->mem = NULL;
  685|   587k|    buf->size = 0;
  686|   587k|    buf->cap = 0;
  687|   587k|    buf->max = max;
  688|   587k|    buf->code = XML_ERR_OK;
  689|   587k|}
parser.c:xmlExpandPEsInEntityValue:
 3498|   316k|                          const xmlChar *str, int length, int depth) {
 3499|   316k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3499:20): [True: 72.7k, False: 243k]
  ------------------
 3500|   316k|    const xmlChar *end, *chunk;
 3501|   316k|    int c, l;
 3502|       |
 3503|   316k|    if (str == NULL)
  ------------------
  |  Branch (3503:9): [True: 175k, False: 141k]
  ------------------
 3504|   175k|        return;
 3505|       |
 3506|   141k|    depth += 1;
 3507|   141k|    if (depth > maxDepth) {
  ------------------
  |  Branch (3507:9): [True: 0, False: 141k]
  ------------------
 3508|      0|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3509|      0|                       "Maximum entity nesting depth exceeded");
 3510|      0|	return;
 3511|      0|    }
 3512|       |
 3513|   141k|    end = str + length;
 3514|   141k|    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.1k]
  |  Branch (3516:27): [True: 111M, False: 114]
  ------------------
 3517|   111M|        c = *str;
 3518|       |
 3519|   111M|        if (c >= 0x80) {
  ------------------
  |  Branch (3519:13): [True: 53.5M, False: 58.2M]
  ------------------
 3520|  53.5M|            l = xmlUTF8MultibyteLen(ctxt, str,
 3521|  53.5M|                    "invalid character in entity value\n");
 3522|  53.5M|            if (l == 0) {
  ------------------
  |  Branch (3522:17): [True: 18.4M, False: 35.1M]
  ------------------
 3523|  18.4M|                if (chunk < str)
  ------------------
  |  Branch (3523:21): [True: 162k, False: 18.2M]
  ------------------
 3524|   162k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3525|  18.4M|                xmlSBufAddReplChar(buf);
 3526|  18.4M|                str += 1;
 3527|  18.4M|                chunk = str;
 3528|  35.1M|            } else {
 3529|  35.1M|                str += l;
 3530|  35.1M|            }
 3531|  58.2M|        } else if (c == '&') {
  ------------------
  |  Branch (3531:20): [True: 139k, False: 58.0M]
  ------------------
 3532|   139k|            if (str[1] == '#') {
  ------------------
  |  Branch (3532:17): [True: 32.1k, False: 107k]
  ------------------
 3533|  32.1k|                if (chunk < str)
  ------------------
  |  Branch (3533:21): [True: 28.1k, False: 3.98k]
  ------------------
 3534|  28.1k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3535|       |
 3536|  32.1k|                c = xmlParseStringCharRef(ctxt, &str);
 3537|  32.1k|                if (c == 0)
  ------------------
  |  Branch (3537:21): [True: 3.32k, False: 28.7k]
  ------------------
 3538|  3.32k|                    return;
 3539|       |
 3540|  28.7k|                xmlSBufAddChar(buf, c);
 3541|       |
 3542|  28.7k|                chunk = str;
 3543|   107k|            } else {
 3544|   107k|                xmlChar *name;
 3545|       |
 3546|       |                /*
 3547|       |                 * General entity references are checked for
 3548|       |                 * syntactic validity.
 3549|       |                 */
 3550|   107k|                str++;
 3551|   107k|                name = xmlParseStringName(ctxt, &str);
 3552|       |
 3553|   107k|                if ((name == NULL) || (*str++ != ';')) {
  ------------------
  |  Branch (3553:21): [True: 5.20k, False: 102k]
  |  Branch (3553:39): [True: 6.03k, False: 96.4k]
  ------------------
 3554|  11.2k|                    xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_CHAR_ERROR,
 3555|  11.2k|                            "EntityValue: '&' forbidden except for entities "
 3556|  11.2k|                            "references\n");
 3557|  11.2k|                    xmlFree(name);
 3558|  11.2k|                    return;
 3559|  11.2k|                }
 3560|       |
 3561|  96.4k|                xmlFree(name);
 3562|  96.4k|            }
 3563|  58.0M|        } else if (c == '%') {
  ------------------
  |  Branch (3563:20): [True: 246k, False: 57.8M]
  ------------------
 3564|   246k|            xmlEntityPtr ent;
 3565|       |
 3566|   246k|            if (chunk < str)
  ------------------
  |  Branch (3566:17): [True: 113k, False: 132k]
  ------------------
 3567|   113k|                xmlSBufAddString(buf, chunk, str - chunk);
 3568|       |
 3569|   246k|            ent = xmlParseStringPEReference(ctxt, &str);
 3570|   246k|            if (ent == NULL)
  ------------------
  |  Branch (3570:17): [True: 62.9k, False: 184k]
  ------------------
 3571|  62.9k|                return;
 3572|       |
 3573|   184k|            if (!PARSER_EXTERNAL(ctxt)) {
  ------------------
  |  |   55|   184k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 7.57k, False: 176k]
  |  |  ------------------
  |  |   56|   184k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 176k, False: 205]
  |  |  ------------------
  |  |   57|   176k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 176k, False: 0]
  |  |  ------------------
  ------------------
 3574|    205|                xmlFatalErr(ctxt, XML_ERR_ENTITY_PE_INTERNAL, NULL);
 3575|    205|                return;
 3576|    205|            }
 3577|       |
 3578|   183k|            if (ent->content == NULL) {
  ------------------
  |  Branch (3578:17): [True: 175k, False: 8.38k]
  ------------------
 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|   175k|                if (((ctxt->options & XML_PARSE_NO_XXE) == 0) &&
  ------------------
  |  Branch (3585:21): [True: 175k, False: 0]
  ------------------
 3586|   175k|                    ((ctxt->replaceEntities) ||
  ------------------
  |  Branch (3586:22): [True: 163k, False: 11.9k]
  ------------------
 3587|   175k|                     (ctxt->validate))) {
  ------------------
  |  Branch (3587:22): [True: 11.6k, False: 244]
  ------------------
 3588|   175k|                    xmlLoadEntityContent(ctxt, ent);
 3589|   175k|                } else {
 3590|    244|                    xmlWarningMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
 3591|    244|                                  "not validating will not read content for "
 3592|    244|                                  "PE entity %s\n", ent->name, NULL);
 3593|    244|                }
 3594|   175k|            }
 3595|       |
 3596|       |            /*
 3597|       |             * TODO: Skip if ent->content is still NULL.
 3598|       |             */
 3599|       |
 3600|   183k|            if (xmlParserEntityCheck(ctxt, ent->length))
  ------------------
  |  Branch (3600:17): [True: 32, False: 183k]
  ------------------
 3601|     32|                return;
 3602|       |
 3603|   183k|            if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   183k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3603:17): [True: 58, False: 183k]
  ------------------
 3604|     58|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3605|     58|                return;
 3606|     58|            }
 3607|       |
 3608|   183k|            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   183k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3609|   183k|            xmlExpandPEsInEntityValue(ctxt, buf, ent->content, ent->length,
 3610|   183k|                                      depth);
 3611|   183k|            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   183k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3612|       |
 3613|   183k|            chunk = str;
 3614|  57.8M|        } else {
 3615|       |            /* Normal ASCII char */
 3616|  57.8M|            if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  57.8M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  57.8M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 55.3M, False: 2.49M]
  |  |  |  |  |  Branch (108:44): [True: 9.48M, False: 45.8M]
  |  |  |  |  ------------------
  |  |  |  |  109|  57.8M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 72.8k, False: 48.2M]
  |  |  |  |  ------------------
  |  |  |  |  110|  57.8M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 45.7M, False: 2.52M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3617|  2.52M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 3618|  2.52M|                        "invalid character in entity value\n");
 3619|  2.52M|                if (chunk < str)
  ------------------
  |  Branch (3619:21): [True: 8.05k, False: 2.51M]
  ------------------
 3620|  8.05k|                    xmlSBufAddString(buf, chunk, str - chunk);
 3621|  2.52M|                xmlSBufAddReplChar(buf);
 3622|  2.52M|                str += 1;
 3623|  2.52M|                chunk = str;
 3624|  55.3M|            } else {
 3625|  55.3M|                str += 1;
 3626|  55.3M|            }
 3627|  57.8M|        }
 3628|   111M|    }
 3629|       |
 3630|  63.3k|    if (chunk < str)
  ------------------
  |  Branch (3630:9): [True: 59.7k, False: 3.59k]
  ------------------
 3631|  59.7k|        xmlSBufAddString(buf, chunk, str - chunk);
 3632|  63.3k|}
parser.c:xmlUTF8MultibyteLen:
  818|   127M|                    const char *errMsg) {
  819|   127M|    int c = str[0];
  820|   127M|    int c1 = str[1];
  821|       |
  822|   127M|    if ((c1 & 0xC0) != 0x80)
  ------------------
  |  Branch (822:9): [True: 63.3M, False: 63.6M]
  ------------------
  823|  63.3M|        goto encoding_error;
  824|       |
  825|  63.6M|    if (c < 0xE0) {
  ------------------
  |  Branch (825:9): [True: 22.2M, False: 41.4M]
  ------------------
  826|       |        /* 2-byte sequence */
  827|  22.2M|        if (c < 0xC2)
  ------------------
  |  Branch (827:13): [True: 21.5M, False: 693k]
  ------------------
  828|  21.5M|            goto encoding_error;
  829|       |
  830|   693k|        return(2);
  831|  41.4M|    } else {
  832|  41.4M|        int c2 = str[2];
  833|       |
  834|  41.4M|        if ((c2 & 0xC0) != 0x80)
  ------------------
  |  Branch (834:13): [True: 10.3k, False: 41.3M]
  ------------------
  835|  10.3k|            goto encoding_error;
  836|       |
  837|  41.3M|        if (c < 0xF0) {
  ------------------
  |  Branch (837:13): [True: 41.3M, False: 46.3k]
  ------------------
  838|       |            /* 3-byte sequence */
  839|  41.3M|            if (c == 0xE0) {
  ------------------
  |  Branch (839:17): [True: 6.60M, False: 34.7M]
  ------------------
  840|       |                /* overlong */
  841|  6.60M|                if (c1 < 0xA0)
  ------------------
  |  Branch (841:21): [True: 3.05k, False: 6.60M]
  ------------------
  842|  3.05k|                    goto encoding_error;
  843|  34.7M|            } else if (c == 0xED) {
  ------------------
  |  Branch (843:24): [True: 547, False: 34.7M]
  ------------------
  844|       |                /* surrogate */
  845|    547|                if (c1 >= 0xA0)
  ------------------
  |  Branch (845:21): [True: 198, False: 349]
  ------------------
  846|    198|                    goto encoding_error;
  847|  34.7M|            } else if (c == 0xEF) {
  ------------------
  |  Branch (847:24): [True: 27.3M, False: 7.39M]
  ------------------
  848|       |                /* U+FFFE and U+FFFF are invalid Chars */
  849|  27.3M|                if ((c1 == 0xBF) && (c2 >= 0xBE))
  ------------------
  |  Branch (849:21): [True: 27.3M, False: 3.53k]
  |  Branch (849:37): [True: 215, False: 27.3M]
  ------------------
  850|    215|                    xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR, errMsg);
  851|  27.3M|            }
  852|       |
  853|  41.3M|            return(3);
  854|  41.3M|        } else {
  855|       |            /* 4-byte sequence */
  856|  46.3k|            if ((str[3] & 0xC0) != 0x80)
  ------------------
  |  Branch (856:17): [True: 2.32k, False: 43.9k]
  ------------------
  857|  2.32k|                goto encoding_error;
  858|  43.9k|            if (c == 0xF0) {
  ------------------
  |  Branch (858:17): [True: 956, False: 43.0k]
  ------------------
  859|       |                /* overlong */
  860|    956|                if (c1 < 0x90)
  ------------------
  |  Branch (860:21): [True: 584, False: 372]
  ------------------
  861|    584|                    goto encoding_error;
  862|  43.0k|            } else if (c >= 0xF4) {
  ------------------
  |  Branch (862:24): [True: 7.23k, False: 35.7k]
  ------------------
  863|       |                /* greater than 0x10FFFF */
  864|  7.23k|                if ((c > 0xF4) || (c1 >= 0x90))
  ------------------
  |  Branch (864:21): [True: 6.73k, False: 499]
  |  Branch (864:35): [True: 222, False: 277]
  ------------------
  865|  6.96k|                    goto encoding_error;
  866|  7.23k|            }
  867|       |
  868|  36.4k|            return(4);
  869|  43.9k|        }
  870|  41.3M|    }
  871|       |
  872|  84.9M|encoding_error:
  873|       |    /* Only report the first error */
  874|  84.9M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  84.9M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (874:9): [True: 21.9k, False: 84.9M]
  ------------------
  875|  21.9k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  876|  21.9k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  21.9k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  877|  21.9k|    }
  878|       |
  879|  84.9M|    return(0);
  880|  63.6M|}
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: 509k, False: 125M]
  ------------------
  727|   509k|        if (xmlSBufGrow(buf, len) < 0)
  ------------------
  |  Branch (727:13): [True: 94, False: 509k]
  ------------------
  728|     94|            return;
  729|   509k|    }
  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|   514k|xmlSBufGrow(xmlSBuf *buf, unsigned len) {
  693|   514k|    xmlChar *mem;
  694|   514k|    unsigned cap;
  695|       |
  696|   514k|    if (len >= UINT_MAX / 2 - buf->size) {
  ------------------
  |  Branch (696:9): [True: 0, False: 514k]
  ------------------
  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|   514k|    cap = (buf->size + len) * 2;
  703|   514k|    if (cap < 240)
  ------------------
  |  Branch (703:9): [True: 349k, False: 164k]
  ------------------
  704|   349k|        cap = 240;
  705|       |
  706|   514k|    mem = xmlRealloc(buf->mem, cap);
  707|   514k|    if (mem == NULL) {
  ------------------
  |  Branch (707:9): [True: 101, False: 514k]
  ------------------
  708|    101|        buf->code = XML_ERR_NO_MEMORY;
  709|    101|        return(-1);
  710|    101|    }
  711|       |
  712|   514k|    buf->mem = mem;
  713|   514k|    buf->cap = cap;
  714|       |
  715|   514k|    return(0);
  716|   514k|}
parser.c:xmlSBufAddReplChar:
  767|   105M|xmlSBufAddReplChar(xmlSBuf *buf) {
  768|   105M|    xmlSBufAddCString(buf, "\xEF\xBF\xBD", 3);
  769|   105M|}
parser.c:xmlSBufAddCString:
  737|   116M|xmlSBufAddCString(xmlSBuf *buf, const char *str, unsigned len) {
  738|   116M|    xmlSBufAddString(buf, (const xmlChar *) str, len);
  739|   116M|}
parser.c:xmlParseStringCharRef:
 2671|  1.42M|xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 2672|  1.42M|    const xmlChar *ptr;
 2673|  1.42M|    xmlChar cur;
 2674|  1.42M|    int val = 0;
 2675|       |
 2676|  1.42M|    if ((str == NULL) || (*str == NULL)) return(0);
  ------------------
  |  Branch (2676:9): [True: 0, False: 1.42M]
  |  Branch (2676:26): [True: 0, False: 1.42M]
  ------------------
 2677|  1.42M|    ptr = *str;
 2678|  1.42M|    cur = *ptr;
 2679|  1.42M|    if ((cur == '&') && (ptr[1] == '#') && (ptr[2] == 'x')) {
  ------------------
  |  Branch (2679:9): [True: 1.42M, False: 0]
  |  Branch (2679:25): [True: 1.42M, False: 0]
  |  Branch (2679:44): [True: 27.0k, False: 1.39M]
  ------------------
 2680|  27.0k|	ptr += 3;
 2681|  27.0k|	cur = *ptr;
 2682|  92.7k|	while (cur != ';') { /* Non input consuming loop */
  ------------------
  |  Branch (2682:9): [True: 66.3k, False: 26.3k]
  ------------------
 2683|  66.3k|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2683:10): [True: 66.1k, False: 253]
  |  Branch (2683:26): [True: 34.9k, False: 31.1k]
  ------------------
 2684|  34.9k|	        val = val * 16 + (cur - '0');
 2685|  31.4k|	    else if ((cur >= 'a') && (cur <= 'f'))
  ------------------
  |  Branch (2685:15): [True: 10.4k, False: 21.0k]
  |  Branch (2685:31): [True: 10.1k, False: 274]
  ------------------
 2686|  10.1k|	        val = val * 16 + (cur - 'a') + 10;
 2687|  21.2k|	    else if ((cur >= 'A') && (cur <= 'F'))
  ------------------
  |  Branch (2687:15): [True: 21.0k, False: 280]
  |  Branch (2687:31): [True: 20.5k, False: 434]
  ------------------
 2688|  20.5k|	        val = val * 16 + (cur - 'A') + 10;
 2689|    714|	    else {
 2690|    714|		xmlFatalErr(ctxt, XML_ERR_INVALID_HEX_CHARREF, NULL);
 2691|    714|		val = 0;
 2692|    714|		break;
 2693|    714|	    }
 2694|  65.6k|	    if (val > 0x110000)
  ------------------
  |  Branch (2694:10): [True: 885, False: 64.7k]
  ------------------
 2695|    885|	        val = 0x110000;
 2696|       |
 2697|  65.6k|	    ptr++;
 2698|  65.6k|	    cur = *ptr;
 2699|  65.6k|	}
 2700|  27.0k|	if (cur == ';')
  ------------------
  |  Branch (2700:6): [True: 26.3k, False: 714]
  ------------------
 2701|  26.3k|	    ptr++;
 2702|  1.39M|    } else if  ((cur == '&') && (ptr[1] == '#')){
  ------------------
  |  Branch (2702:17): [True: 1.39M, False: 0]
  |  Branch (2702:33): [True: 1.39M, False: 0]
  ------------------
 2703|  1.39M|	ptr += 2;
 2704|  1.39M|	cur = *ptr;
 2705|  4.19M|	while (cur != ';') { /* Non input consuming loops */
  ------------------
  |  Branch (2705:9): [True: 2.79M, False: 1.39M]
  ------------------
 2706|  2.79M|	    if ((cur >= '0') && (cur <= '9'))
  ------------------
  |  Branch (2706:10): [True: 2.79M, False: 303]
  |  Branch (2706:26): [True: 2.79M, False: 775]
  ------------------
 2707|  2.79M|	        val = val * 10 + (cur - '0');
 2708|  1.07k|	    else {
 2709|  1.07k|		xmlFatalErr(ctxt, XML_ERR_INVALID_DEC_CHARREF, NULL);
 2710|  1.07k|		val = 0;
 2711|  1.07k|		break;
 2712|  1.07k|	    }
 2713|  2.79M|	    if (val > 0x110000)
  ------------------
  |  Branch (2713:10): [True: 1.76k, False: 2.79M]
  ------------------
 2714|  1.76k|	        val = 0x110000;
 2715|       |
 2716|  2.79M|	    ptr++;
 2717|  2.79M|	    cur = *ptr;
 2718|  2.79M|	}
 2719|  1.39M|	if (cur == ';')
  ------------------
  |  Branch (2719:6): [True: 1.39M, False: 1.07k]
  ------------------
 2720|  1.39M|	    ptr++;
 2721|  1.39M|    } else {
 2722|      0|	xmlFatalErr(ctxt, XML_ERR_INVALID_CHARREF, NULL);
 2723|      0|	return(0);
 2724|      0|    }
 2725|  1.42M|    *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.42M|    if (val >= 0x110000) {
  ------------------
  |  Branch (2732:9): [True: 214, False: 1.42M]
  ------------------
 2733|    214|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2734|    214|                "xmlParseStringCharRef: character reference out of bounds\n",
 2735|    214|                val);
 2736|  1.42M|    } else if (IS_CHAR(val)) {
  ------------------
  |  |  115|  1.42M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  1.42M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 1.41M, False: 3.12k]
  |  |  |  |  |  Branch (117:25): [True: 1.41M, False: 11.1k]
  |  |  |  |  ------------------
  |  |  |  |  118|  1.42M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  1.41M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 1.40M, False: 2.56k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 658, False: 1.40M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  1.41M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 1.55k, False: 1.40M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  1.41M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 1.40M, False: 2.77k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  1.42M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 11.1k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 8.25k, False: 2.92k]
  |  |  |  |  ------------------
  |  |  |  |  120|  11.1k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.81k, False: 115]
  |  |  |  |  |  Branch (120:26): [True: 291, False: 2.52k]
  |  |  |  |  ------------------
  |  |  |  |  121|  11.1k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 2.28k, False: 348]
  |  |  |  |  |  Branch (121:27): [True: 2.28k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2737|  1.41M|        return(val);
 2738|  1.41M|    } else {
 2739|  3.12k|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 2740|  3.12k|			  "xmlParseStringCharRef: invalid xmlChar value %d\n",
 2741|  3.12k|			  val);
 2742|  3.12k|    }
 2743|  3.33k|    return(0);
 2744|  1.42M|}
parser.c:xmlSBufAddChar:
  742|  1.45M|xmlSBufAddChar(xmlSBuf *buf, int c) {
  743|  1.45M|    xmlChar *end;
  744|       |
  745|  1.45M|    if (buf->max - buf->size < 4) {
  ------------------
  |  Branch (745:9): [True: 0, False: 1.45M]
  ------------------
  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.45M|    if (buf->cap - buf->size <= 4) {
  ------------------
  |  Branch (751:9): [True: 5.51k, False: 1.45M]
  ------------------
  752|  5.51k|        if (xmlSBufGrow(buf, 4) < 0)
  ------------------
  |  Branch (752:13): [True: 7, False: 5.50k]
  ------------------
  753|      7|            return;
  754|  5.51k|    }
  755|       |
  756|  1.45M|    end = buf->mem + buf->size;
  757|       |
  758|  1.45M|    if (c < 0x80) {
  ------------------
  |  Branch (758:9): [True: 1.45M, False: 5.85k]
  ------------------
  759|  1.45M|        *end = (xmlChar) c;
  760|  1.45M|        buf->size += 1;
  761|  1.45M|    } else {
  762|  5.85k|        buf->size += xmlCopyCharMultiByte(end, c);
  763|  5.85k|    }
  764|  1.45M|}
parser.c:xmlParseStringName:
 3377|  3.55M|xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
 3378|  3.55M|    xmlChar *ret;
 3379|  3.55M|    const xmlChar *cur = *str;
 3380|  3.55M|    int flags = 0;
 3381|  3.55M|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3381:21): [True: 1.16M, False: 2.38M]
  ------------------
 3382|  1.16M|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|  1.16M|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3383|  3.55M|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  2.38M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3384|       |
 3385|  3.55M|    if (ctxt->options & XML_PARSE_OLD10)
  ------------------
  |  Branch (3385:9): [True: 1.78M, False: 1.77M]
  ------------------
 3386|  1.78M|        flags |= XML_SCAN_OLD10;
  ------------------
  |  |   71|  1.78M|#define XML_SCAN_OLD10      4
  ------------------
 3387|       |
 3388|  3.55M|    cur = xmlScanName(*str, maxLength, flags);
 3389|  3.55M|    if (cur == NULL) {
  ------------------
  |  Branch (3389:9): [True: 59, False: 3.55M]
  ------------------
 3390|     59|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3391|     59|        return(NULL);
 3392|     59|    }
 3393|  3.55M|    if (cur == *str)
  ------------------
  |  Branch (3393:9): [True: 9.23k, False: 3.54M]
  ------------------
 3394|  9.23k|        return(NULL);
 3395|       |
 3396|  3.54M|    ret = xmlStrndup(*str, cur - *str);
 3397|  3.54M|    if (ret == NULL)
  ------------------
  |  Branch (3397:9): [True: 30, False: 3.54M]
  ------------------
 3398|     30|        xmlErrMemory(ctxt);
 3399|  3.54M|    *str = cur;
 3400|  3.54M|    return(ret);
 3401|  3.55M|}
parser.c:xmlParseStringPEReference:
 7898|   246k|xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
 7899|   246k|    const xmlChar *ptr;
 7900|   246k|    xmlChar cur;
 7901|   246k|    xmlChar *name;
 7902|   246k|    xmlEntityPtr entity = NULL;
 7903|       |
 7904|   246k|    if ((str == NULL) || (*str == NULL)) return(NULL);
  ------------------
  |  Branch (7904:9): [True: 0, False: 246k]
  |  Branch (7904:26): [True: 0, False: 246k]
  ------------------
 7905|   246k|    ptr = *str;
 7906|   246k|    cur = *ptr;
 7907|   246k|    if (cur != '%')
  ------------------
  |  Branch (7907:9): [True: 0, False: 246k]
  ------------------
 7908|      0|        return(NULL);
 7909|   246k|    ptr++;
 7910|   246k|    name = xmlParseStringName(ctxt, &ptr);
 7911|   246k|    if (name == NULL) {
  ------------------
  |  Branch (7911:9): [True: 4.08k, False: 242k]
  ------------------
 7912|  4.08k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7913|  4.08k|		       "xmlParseStringPEReference: no name\n");
 7914|  4.08k|	*str = ptr;
 7915|  4.08k|	return(NULL);
 7916|  4.08k|    }
 7917|   242k|    cur = *ptr;
 7918|   242k|    if (cur != ';') {
  ------------------
  |  Branch (7918:9): [True: 3.20k, False: 239k]
  ------------------
 7919|  3.20k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7920|  3.20k|	xmlFree(name);
 7921|  3.20k|	*str = ptr;
 7922|  3.20k|	return(NULL);
 7923|  3.20k|    }
 7924|   239k|    ptr++;
 7925|       |
 7926|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7927|   239k|    ctxt->hasPErefs = 1;
 7928|       |
 7929|       |    /*
 7930|       |     * Request the entity from SAX
 7931|       |     */
 7932|   239k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7932:9): [True: 239k, False: 0]
  ------------------
 7933|   239k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7933:2): [True: 239k, False: 0]
  ------------------
 7934|   239k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7935|       |
 7936|   239k|    if (entity == NULL) {
  ------------------
  |  Branch (7936:9): [True: 55.6k, False: 184k]
  ------------------
 7937|  55.6k|        xmlHandleUndeclaredEntity(ctxt, name);
 7938|   184k|    } else {
 7939|       |	/*
 7940|       |	 * Internal checking in case the entity quest barfed
 7941|       |	 */
 7942|   184k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7942:6): [True: 175k, False: 8.04k]
  ------------------
 7943|   175k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7943:6): [True: 0, False: 175k]
  ------------------
 7944|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7945|      0|			  "%%%s; is not a parameter entity\n",
 7946|      0|			  name, NULL);
 7947|      0|	}
 7948|   184k|    }
 7949|       |
 7950|   239k|    xmlFree(name);
 7951|   239k|    *str = ptr;
 7952|   239k|    return(entity);
 7953|   242k|}
parser.c:xmlHandleUndeclaredEntity:
 7371|   480k|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|   480k|    if ((ctxt->standalone == 1) ||
  ------------------
  |  Branch (7393:9): [True: 690, False: 480k]
  ------------------
 7394|   480k|        ((ctxt->hasExternalSubset == 0) &&
  ------------------
  |  Branch (7394:10): [True: 475k, False: 4.68k]
  ------------------
 7395|   475k|         (ctxt->hasPErefs == 0))) {
  ------------------
  |  Branch (7395:10): [True: 135k, False: 339k]
  ------------------
 7396|   136k|        xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
 7397|   136k|                          "Entity '%s' not defined\n", name);
 7398|   136k|#ifdef LIBXML_VALID_ENABLED
 7399|   344k|    } else if (ctxt->validate) {
  ------------------
  |  Branch (7399:16): [True: 299k, False: 45.6k]
  ------------------
 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|  45.6k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7410:16): [True: 29.8k, False: 15.7k]
  ------------------
 7411|  15.7k|               ((ctxt->replaceEntities) &&
  ------------------
  |  Branch (7411:17): [True: 15.2k, False: 530]
  ------------------
 7412|  44.3k|                ((ctxt->options & XML_PARSE_NO_XXE) == 0))) {
  ------------------
  |  Branch (7412:17): [True: 14.4k, False: 800]
  ------------------
 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|  44.3k|        xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7422|  44.3k|                     "Entity '%s' not defined\n", name);
 7423|  44.3k|    } else {
 7424|  1.33k|        xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7425|  1.33k|                      "Entity '%s' not defined\n", name, NULL);
 7426|  1.33k|    }
 7427|       |
 7428|   480k|    ctxt->valid = 0;
 7429|   480k|}
parser.c:xmlErrMsgStr:
  364|  44.3k|{
  365|  44.3k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR,
  366|  44.3k|               val, NULL, NULL, 0, msg, val);
  367|  44.3k|}
parser.c:xmlLoadEntityContent:
 7735|   175k|xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
 7736|   175k|    xmlParserInputPtr oldinput, input = NULL;
 7737|   175k|    xmlParserInputPtr *oldinputTab;
 7738|   175k|    xmlChar *oldencoding;
 7739|   175k|    xmlChar *content = NULL;
 7740|   175k|    xmlResourceType rtype;
 7741|   175k|    size_t length, i;
 7742|   175k|    int oldinputNr, oldinputMax;
 7743|   175k|    int ret = -1;
 7744|   175k|    int res;
 7745|       |
 7746|   175k|    if ((ctxt == NULL) || (entity == NULL) ||
  ------------------
  |  Branch (7746:9): [True: 0, False: 175k]
  |  Branch (7746:27): [True: 0, False: 175k]
  ------------------
 7747|   175k|        ((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7747:10): [True: 0, False: 175k]
  ------------------
 7748|      0|	 (entity->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY)) ||
  ------------------
  |  Branch (7748:3): [True: 0, False: 0]
  ------------------
 7749|   175k|	(entity->content != NULL)) {
  ------------------
  |  Branch (7749:2): [True: 0, False: 175k]
  ------------------
 7750|      0|	xmlFatalErr(ctxt, XML_ERR_ARGUMENT,
 7751|      0|	            "xmlLoadEntityContent parameter error");
 7752|      0|        return(-1);
 7753|      0|    }
 7754|       |
 7755|   175k|    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (7755:9): [True: 175k, False: 0]
  ------------------
 7756|   175k|        rtype = XML_RESOURCE_PARAMETER_ENTITY;
 7757|      0|    else
 7758|      0|        rtype = XML_RESOURCE_GENERAL_ENTITY;
 7759|       |
 7760|   175k|    input = xmlLoadResource(ctxt, (char *) entity->URI,
 7761|   175k|                            (char *) entity->ExternalID, rtype);
 7762|   175k|    if (input == NULL)
  ------------------
  |  Branch (7762:9): [True: 662, False: 174k]
  ------------------
 7763|    662|        return(-1);
 7764|       |
 7765|   174k|    oldinput = ctxt->input;
 7766|   174k|    oldinputNr = ctxt->inputNr;
 7767|   174k|    oldinputMax = ctxt->inputMax;
 7768|   174k|    oldinputTab = ctxt->inputTab;
 7769|   174k|    oldencoding = ctxt->encoding;
 7770|       |
 7771|   174k|    ctxt->input = NULL;
 7772|   174k|    ctxt->inputNr = 0;
 7773|   174k|    ctxt->inputMax = 1;
 7774|   174k|    ctxt->encoding = NULL;
 7775|   174k|    ctxt->inputTab = xmlMalloc(sizeof(xmlParserInputPtr));
 7776|   174k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (7776:9): [True: 8, False: 174k]
  ------------------
 7777|      8|        xmlErrMemory(ctxt);
 7778|      8|        xmlFreeInputStream(input);
 7779|      8|        goto error;
 7780|      8|    }
 7781|       |
 7782|   174k|    xmlBufResetInput(input->buf->buffer, input);
 7783|       |
 7784|   174k|    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7784:9): [True: 9, False: 174k]
  ------------------
 7785|      9|        xmlFreeInputStream(input);
 7786|      9|        goto error;
 7787|      9|    }
 7788|       |
 7789|   174k|    xmlDetectEncoding(ctxt);
 7790|       |
 7791|       |    /*
 7792|       |     * Parse a possible text declaration first
 7793|       |     */
 7794|   174k|    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  | 2271|   174k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   349k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 170k, False: 4.09k]
  |  |  |  |  |  Branch (2268:41): [True: 168k, False: 1.67k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   174k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 168k, False: 307]
  |  |  |  |  |  Branch (2269:41): [True: 168k, False: 225]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 167k, False: 444]
  |  |  ------------------
  ------------------
                  if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|   167k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   167k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 166k, False: 1.63k]
  |  |  |  |  ------------------
  |  |  |  |   91|   167k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.42k, False: 206]
  |  |  |  |  |  Branch (91:23): [True: 541, False: 886]
  |  |  |  |  ------------------
  |  |  |  |   92|   167k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 684, False: 408]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7795|   167k|	xmlParseTextDecl(ctxt);
 7796|       |        /*
 7797|       |         * An XML-1.0 document can't reference an entity not XML-1.0
 7798|       |         */
 7799|   167k|        if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|   167k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7799:13): [True: 1.88k, False: 165k]
  ------------------
 7800|  1.88k|            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|  1.88k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (7800:13): [True: 298, False: 1.58k]
  ------------------
 7801|    298|            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
 7802|    298|                           "Version mismatch between document and entity\n");
 7803|    298|        }
 7804|   167k|    }
 7805|       |
 7806|   174k|    length = input->cur - input->base;
 7807|   174k|    xmlBufShrink(input->buf->buffer, length);
 7808|   174k|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7809|       |
 7810|   177k|    while ((res = xmlParserInputBufferGrow(input->buf, 4096)) > 0)
  ------------------
  |  Branch (7810:12): [True: 2.89k, False: 174k]
  ------------------
 7811|  2.89k|        ;
 7812|       |
 7813|   174k|    xmlBufResetInput(input->buf->buffer, input);
 7814|       |
 7815|   174k|    if (res < 0) {
  ------------------
  |  Branch (7815:9): [True: 1.17k, False: 173k]
  ------------------
 7816|  1.17k|        xmlCtxtErrIO(ctxt, input->buf->error, NULL);
 7817|  1.17k|        goto error;
 7818|  1.17k|    }
 7819|       |
 7820|   173k|    length = xmlBufUse(input->buf->buffer);
 7821|   173k|    if (length > INT_MAX) {
  ------------------
  |  Branch (7821:9): [True: 0, False: 173k]
  ------------------
 7822|      0|        xmlErrMemory(ctxt);
 7823|      0|        goto error;
 7824|      0|    }
 7825|       |
 7826|   173k|    content = xmlStrndup(xmlBufContent(input->buf->buffer), length);
 7827|   173k|    if (content == NULL) {
  ------------------
  |  Branch (7827:9): [True: 1, False: 173k]
  ------------------
 7828|      1|        xmlErrMemory(ctxt);
 7829|      1|        goto error;
 7830|      1|    }
 7831|       |
 7832|  22.1M|    for (i = 0; i < length; ) {
  ------------------
  |  Branch (7832:17): [True: 22.1M, False: 164]
  ------------------
 7833|  22.1M|        int clen = length - i;
 7834|  22.1M|        int c = xmlGetUTF8Char(content + i, &clen);
 7835|       |
 7836|  22.1M|        if ((c < 0) || (!IS_CHAR(c))) {
  ------------------
  |  |  115|  21.9M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  21.9M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 20.1M, False: 1.84M]
  |  |  |  |  ------------------
  |  |  |  |  118|  21.9M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  20.1M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 20.1M, False: 4.97k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 307k, False: 19.8M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  20.1M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 229k, False: 19.5M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  20.1M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 19.5M, False: 5.37k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  21.9M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 1.84M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.84M, False: 5.33k]
  |  |  |  |  ------------------
  |  |  |  |  120|  1.84M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.33k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 3.42k, False: 1.90k]
  |  |  |  |  ------------------
  |  |  |  |  121|  1.84M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 933, False: 974]
  |  |  |  |  |  Branch (121:27): [True: 933, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (7836:13): [True: 166k, False: 21.9M]
  |  Branch (7836:24): [True: 6.34k, False: 21.9M]
  ------------------
 7837|   173k|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 7838|   173k|                              "xmlLoadEntityContent: invalid char value %d\n",
 7839|   173k|                              content[i]);
 7840|   173k|            goto error;
 7841|   173k|        }
 7842|  21.9M|        i += clen;
 7843|  21.9M|    }
 7844|       |
 7845|    164|    xmlSaturatedAdd(&ctxt->sizeentities, length);
 7846|    164|    entity->content = content;
 7847|    164|    entity->length = length;
 7848|    164|    content = NULL;
 7849|    164|    ret = 0;
 7850|       |
 7851|   174k|error:
 7852|   349k|    while (ctxt->inputNr > 0)
  ------------------
  |  Branch (7852:12): [True: 174k, False: 174k]
  ------------------
 7853|   174k|        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 7854|   174k|    xmlFree(ctxt->inputTab);
 7855|   174k|    xmlFree(ctxt->encoding);
 7856|       |
 7857|   174k|    ctxt->input = oldinput;
 7858|   174k|    ctxt->inputNr = oldinputNr;
 7859|   174k|    ctxt->inputMax = oldinputMax;
 7860|   174k|    ctxt->inputTab = oldinputTab;
 7861|   174k|    ctxt->encoding = oldencoding;
 7862|       |
 7863|   174k|    xmlFree(content);
 7864|       |
 7865|   174k|    return(ret);
 7866|    164|}
parser.c:xmlSBufFinish:
  781|   346k|              const char *errMsg) {
  782|   346k|    if (buf->mem == NULL) {
  ------------------
  |  Branch (782:9): [True: 27.1k, False: 319k]
  ------------------
  783|  27.1k|        buf->mem = xmlMalloc(1);
  784|  27.1k|        if (buf->mem == NULL) {
  ------------------
  |  Branch (784:13): [True: 8, False: 27.0k]
  ------------------
  785|      8|            buf->code = XML_ERR_NO_MEMORY;
  786|  27.0k|        } else {
  787|  27.0k|            buf->mem[0] = 0;
  788|  27.0k|        }
  789|   319k|    } else {
  790|   319k|        buf->mem[buf->size] = 0;
  791|   319k|    }
  792|       |
  793|   346k|    if (buf->code == XML_ERR_OK) {
  ------------------
  |  Branch (793:9): [True: 346k, False: 75]
  ------------------
  794|   346k|        if (sizeOut != NULL)
  ------------------
  |  Branch (794:13): [True: 32.0k, False: 314k]
  ------------------
  795|  32.0k|            *sizeOut = buf->size;
  796|   346k|        return(buf->mem);
  797|   346k|    }
  798|       |
  799|     75|    xmlSBufReportError(buf, ctxt, errMsg);
  800|       |
  801|     75|    xmlFree(buf->mem);
  802|       |
  803|     75|    if (sizeOut != NULL)
  ------------------
  |  Branch (803:9): [True: 13, False: 62]
  ------------------
  804|     13|        *sizeOut = 0;
  805|       |    return(NULL);
  806|   346k|}
parser.c:xmlSBufReportError:
  772|    109|xmlSBufReportError(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  773|    109|    if (buf->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (773:9): [True: 109, False: 0]
  ------------------
  774|    109|        xmlCtxtErrMemory(ctxt);
  775|      0|    else
  776|      0|        xmlFatalErr(ctxt, buf->code, errMsg);
  777|    109|}
parser.c:xmlSBufCleanup:
  809|   235k|xmlSBufCleanup(xmlSBuf *buf, xmlParserCtxtPtr ctxt, const char *errMsg) {
  810|   235k|    if (buf->code != XML_ERR_OK)
  ------------------
  |  Branch (810:9): [True: 34, False: 235k]
  ------------------
  811|     34|        xmlSBufReportError(buf, ctxt, errMsg);
  812|       |
  813|   235k|    xmlFree(buf->mem);
  814|   235k|}
parser.c:xmlExpandEntityInAttValue:
 3839|  2.19M|                          int *inSpace, int depth, int check) {
 3840|  2.19M|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3840:20): [True: 613k, False: 1.58M]
  ------------------
 3841|  2.19M|    int c, chunkSize;
 3842|  2.19M|    int normChange = 0;
 3843|       |
 3844|  2.19M|    if (str == NULL)
  ------------------
  |  Branch (3844:9): [True: 106, False: 2.19M]
  ------------------
 3845|    106|        return(0);
 3846|       |
 3847|  2.19M|    depth += 1;
 3848|  2.19M|    if (depth > maxDepth) {
  ------------------
  |  Branch (3848:9): [True: 1, False: 2.19M]
  ------------------
 3849|      1|	xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
 3850|      1|                       "Maximum entity nesting depth exceeded");
 3851|      1|	return(0);
 3852|      1|    }
 3853|       |
 3854|  2.19M|    if (pent != NULL) {
  ------------------
  |  Branch (3854:9): [True: 2.17M, False: 19.9k]
  ------------------
 3855|  2.17M|        if (pent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  2.17M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (3855:13): [True: 4, False: 2.17M]
  ------------------
 3856|      4|            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 3857|      4|            return(0);
 3858|      4|        }
 3859|       |
 3860|  2.17M|        if (check) {
  ------------------
  |  Branch (3860:13): [True: 2.17M, False: 1.90k]
  ------------------
 3861|  2.17M|            if (xmlParserEntityCheck(ctxt, pent->length))
  ------------------
  |  Branch (3861:17): [True: 33, False: 2.17M]
  ------------------
 3862|     33|                return(0);
 3863|  2.17M|        }
 3864|  2.17M|    }
 3865|       |
 3866|  2.19M|    chunkSize = 0;
 3867|       |
 3868|       |    /*
 3869|       |     * Note that entity values are already validated. No special
 3870|       |     * handling for multi-byte characters is needed.
 3871|       |     */
 3872|   341M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   341M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3872:12): [True: 341M, False: 292]
  ------------------
 3873|   341M|        c = *str;
 3874|       |
 3875|   341M|	if (c != '&') {
  ------------------
  |  Branch (3875:6): [True: 336M, False: 4.56M]
  ------------------
 3876|   336M|            if (c == 0)
  ------------------
  |  Branch (3876:17): [True: 2.06M, False: 334M]
  ------------------
 3877|  2.06M|                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|   334M|            if ((pent != NULL) && (c == '<')) {
  ------------------
  |  Branch (3884:17): [True: 329M, False: 4.82M]
  |  Branch (3884:35): [True: 131k, False: 329M]
  ------------------
 3885|   131k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3886|   131k|                        "'<' in entity '%s' is not allowed in attributes "
 3887|   131k|                        "values\n", pent->name);
 3888|   131k|                break;
 3889|   131k|            }
 3890|       |
 3891|   334M|            if (c <= 0x20) {
  ------------------
  |  Branch (3891:17): [True: 16.9M, False: 317M]
  ------------------
 3892|  16.9M|                if ((normalize) && (*inSpace)) {
  ------------------
  |  Branch (3892:21): [True: 476k, False: 16.5M]
  |  Branch (3892:36): [True: 407k, False: 68.3k]
  ------------------
 3893|       |                    /* Skip char */
 3894|   407k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3894:25): [True: 23.8k, False: 384k]
  ------------------
 3895|  23.8k|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3896|  23.8k|                        chunkSize = 0;
 3897|  23.8k|                    }
 3898|   407k|                    normChange = 1;
 3899|  16.5M|                } else if (c < 0x20) {
  ------------------
  |  Branch (3899:28): [True: 4.30M, False: 12.2M]
  ------------------
 3900|  4.30M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (3900:25): [True: 1.39M, False: 2.90M]
  ------------------
 3901|  1.39M|                        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3902|  1.39M|                        chunkSize = 0;
 3903|  1.39M|                    }
 3904|       |
 3905|  4.30M|                    xmlSBufAddCString(buf, " ", 1);
 3906|  12.2M|                } else {
 3907|  12.2M|                    chunkSize += 1;
 3908|  12.2M|                }
 3909|       |
 3910|  16.9M|                *inSpace = 1;
 3911|   317M|            } else {
 3912|   317M|                chunkSize += 1;
 3913|   317M|                *inSpace = 0;
 3914|   317M|            }
 3915|       |
 3916|   334M|            str += 1;
 3917|   334M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3917:20): [True: 1.38M, False: 3.18M]
  ------------------
 3918|  1.38M|            int val;
 3919|       |
 3920|  1.38M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3920:17): [True: 1.37M, False: 5.58k]
  ------------------
 3921|  1.37M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3922|  1.37M|                chunkSize = 0;
 3923|  1.37M|            }
 3924|       |
 3925|  1.38M|	    val = xmlParseStringCharRef(ctxt, &str);
 3926|  1.38M|	    if (val == 0) {
  ------------------
  |  Branch (3926:10): [True: 3, False: 1.38M]
  ------------------
 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.38M|            if (val == ' ') {
  ------------------
  |  Branch (3932:17): [True: 7.37k, False: 1.37M]
  ------------------
 3933|  7.37k|                if ((normalize) && (*inSpace))
  ------------------
  |  Branch (3933:21): [True: 3.29k, False: 4.07k]
  |  Branch (3933:36): [True: 2.59k, False: 699]
  ------------------
 3934|  2.59k|                    normChange = 1;
 3935|  4.77k|                else
 3936|  4.77k|                    xmlSBufAddCString(buf, " ", 1);
 3937|  7.37k|                *inSpace = 1;
 3938|  1.37M|            } else {
 3939|  1.37M|                xmlSBufAddChar(buf, val);
 3940|  1.37M|                *inSpace = 0;
 3941|  1.37M|            }
 3942|  3.18M|	} else {
 3943|  3.18M|            xmlChar *name;
 3944|  3.18M|            xmlEntityPtr ent;
 3945|       |
 3946|  3.18M|            if (chunkSize > 0) {
  ------------------
  |  Branch (3946:17): [True: 1.72M, False: 1.45M]
  ------------------
 3947|  1.72M|                xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3948|  1.72M|                chunkSize = 0;
 3949|  1.72M|            }
 3950|       |
 3951|  3.18M|	    name = xmlParseStringEntityRef(ctxt, &str);
 3952|  3.18M|            if (name == NULL) {
  ------------------
  |  Branch (3952:17): [True: 24, False: 3.18M]
  ------------------
 3953|     24|                if (pent != NULL)
  ------------------
  |  Branch (3953:21): [True: 23, False: 1]
  ------------------
 3954|     23|                    pent->content[0] = 0;
 3955|     24|                break;
 3956|     24|            }
 3957|       |
 3958|  3.18M|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3959|  3.18M|            xmlFree(name);
 3960|       |
 3961|  3.18M|	    if ((ent != NULL) &&
  ------------------
  |  Branch (3961:10): [True: 3.10M, False: 75.9k]
  ------------------
 3962|  3.10M|		(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3962:3): [True: 1.65M, False: 1.45M]
  ------------------
 3963|  1.65M|		if (ent->content == NULL) {
  ------------------
  |  Branch (3963:7): [True: 0, False: 1.65M]
  ------------------
 3964|      0|		    xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 3965|      0|			    "predefined entity has no content\n");
 3966|      0|                    break;
 3967|      0|                }
 3968|       |
 3969|  1.65M|                xmlSBufAddString(buf, ent->content, ent->length);
 3970|       |
 3971|  1.65M|                *inSpace = 0;
 3972|  1.65M|	    } else if ((ent != NULL) && (ent->content != NULL)) {
  ------------------
  |  Branch (3972:17): [True: 1.45M, False: 75.9k]
  |  Branch (3972:34): [True: 1.45M, False: 78]
  ------------------
 3973|  1.45M|                if (pent != NULL)
  ------------------
  |  Branch (3973:21): [True: 1.45M, False: 654]
  ------------------
 3974|  1.45M|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.45M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3975|  1.45M|		normChange |= xmlExpandEntityInAttValue(ctxt, buf,
 3976|  1.45M|                        ent->content, ent, normalize, inSpace, depth, check);
 3977|  1.45M|                if (pent != NULL)
  ------------------
  |  Branch (3977:21): [True: 1.45M, False: 654]
  ------------------
 3978|  1.45M|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.45M|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3979|  1.45M|	    }
 3980|  3.18M|        }
 3981|   341M|    }
 3982|       |
 3983|  2.19M|    if (chunkSize > 0)
  ------------------
  |  Branch (3983:9): [True: 1.43M, False: 762k]
  ------------------
 3984|  1.43M|        xmlSBufAddString(buf, str - chunkSize, chunkSize);
 3985|       |
 3986|  2.19M|    return(normChange);
 3987|  2.19M|}
parser.c:xmlParseStringEntityRef:
 7573|  3.20M|xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
 7574|  3.20M|    xmlChar *name;
 7575|  3.20M|    const xmlChar *ptr;
 7576|  3.20M|    xmlChar cur;
 7577|       |
 7578|  3.20M|    if ((str == NULL) || (*str == NULL))
  ------------------
  |  Branch (7578:9): [True: 0, False: 3.20M]
  |  Branch (7578:26): [True: 0, False: 3.20M]
  ------------------
 7579|      0|        return(NULL);
 7580|  3.20M|    ptr = *str;
 7581|  3.20M|    cur = *ptr;
 7582|  3.20M|    if (cur != '&')
  ------------------
  |  Branch (7582:9): [True: 0, False: 3.20M]
  ------------------
 7583|      0|	return(NULL);
 7584|       |
 7585|  3.20M|    ptr++;
 7586|  3.20M|    name = xmlParseStringName(ctxt, &ptr);
 7587|  3.20M|    if (name == NULL) {
  ------------------
  |  Branch (7587:9): [True: 28, False: 3.20M]
  ------------------
 7588|     28|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7589|     28|		       "xmlParseStringEntityRef: no name\n");
 7590|     28|	*str = ptr;
 7591|     28|	return(NULL);
 7592|     28|    }
 7593|  3.20M|    if (*ptr != ';') {
  ------------------
  |  Branch (7593:9): [True: 11, False: 3.20M]
  ------------------
 7594|     11|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7595|     11|        xmlFree(name);
 7596|     11|	*str = ptr;
 7597|     11|	return(NULL);
 7598|     11|    }
 7599|  3.20M|    ptr++;
 7600|       |
 7601|  3.20M|    *str = ptr;
 7602|  3.20M|    return(name);
 7603|  3.20M|}
parser.c:xmlParseAttValueInternal:
 4056|   430k|                         int special, int isNamespace) {
 4057|   430k|    unsigned maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4057:26): [True: 224k, False: 205k]
  ------------------
 4058|   224k|                         XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|   224k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4059|   430k|                         XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|   636k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4060|   430k|    xmlSBuf buf;
 4061|   430k|    xmlChar *ret;
 4062|   430k|    int c, l, quote, entFlags, chunkSize;
 4063|   430k|    int inSpace = 1;
 4064|   430k|    int replaceEntities;
 4065|   430k|    int normalize = (special & XML_SPECIAL_TYPE_MASK) > XML_ATTRIBUTE_CDATA;
  ------------------
  |  |   96|   430k|#define XML_SPECIAL_TYPE_MASK   (XML_SPECIAL_EXTERNAL - 1)
  |  |  ------------------
  |  |  |  |   95|   430k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  |  |  ------------------
  ------------------
 4066|   430k|    int attvalFlags = 0;
 4067|       |
 4068|       |    /* Always expand namespace URIs */
 4069|   430k|    replaceEntities = (ctxt->replaceEntities) || (isNamespace);
  ------------------
  |  Branch (4069:23): [True: 314k, False: 116k]
  |  Branch (4069:50): [True: 16.7k, False: 99.3k]
  ------------------
 4070|       |
 4071|   430k|    xmlSBufInit(&buf, maxLength);
 4072|       |
 4073|   430k|    GROW;
  ------------------
  |  | 2308|   430k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   430k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   430k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 247k, False: 183k]
  |  |  ------------------
  |  | 2309|   430k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   247k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 45.2k, False: 201k]
  |  |  ------------------
  |  | 2310|   430k|	xmlParserGrow(ctxt);
  ------------------
 4074|       |
 4075|   430k|    quote = CUR;
  ------------------
  |  | 2262|   430k|#define CUR (*ctxt->input->cur)
  ------------------
 4076|   430k|    if ((quote != '"') && (quote != '\'')) {
  ------------------
  |  Branch (4076:9): [True: 274k, False: 156k]
  |  Branch (4076:27): [True: 5.10k, False: 269k]
  ------------------
 4077|  5.10k|	xmlFatalErr(ctxt, XML_ERR_ATTRIBUTE_NOT_STARTED, NULL);
 4078|  5.10k|	return(NULL);
 4079|  5.10k|    }
 4080|   425k|    NEXTL(1);
  ------------------
  |  | 2325|   425k|#define NEXTL(l) do {							\
  |  | 2326|   425k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 425k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   425k|    } else ctxt->input->col++;						\
  |  | 2329|   425k|    ctxt->input->cur += l;				\
  |  | 2330|   425k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 425k]
  |  |  ------------------
  ------------------
 4081|       |
 4082|   425k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (4082:9): [True: 351k, False: 73.8k]
  ------------------
 4083|   351k|        entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   20|   351k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
                      entFlags = XML_ENT_CHECKED | XML_ENT_VALIDATED;
  ------------------
  |  |   21|   351k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4084|  73.8k|    else
 4085|  73.8k|        entFlags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|  73.8k|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 4086|       |
 4087|   425k|    inSpace = 1;
 4088|   425k|    chunkSize = 0;
 4089|       |
 4090|   158M|    while (1) {
  ------------------
  |  Branch (4090:12): [True: 158M, Folded]
  ------------------
 4091|   158M|        if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|   158M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 120, False: 158M]
  |  |  ------------------
  ------------------
 4092|    120|            goto error;
 4093|       |
 4094|   158M|        if (CUR_PTR >= ctxt->input->end) {
  ------------------
  |  | 2264|   158M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4094:13): [True: 41.8k, False: 158M]
  ------------------
 4095|  41.8k|            xmlFatalErrMsg(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
 4096|  41.8k|                           "AttValue: ' expected\n");
 4097|  41.8k|            goto error;
 4098|  41.8k|        }
 4099|       |
 4100|       |        /*
 4101|       |         * TODO: Check growth threshold
 4102|       |         */
 4103|   158M|        if (ctxt->input->end - CUR_PTR < 10)
  ------------------
  |  | 2264|   158M|#define CUR_PTR ctxt->input->cur
  ------------------
  |  Branch (4103:13): [True: 451k, False: 158M]
  ------------------
 4104|   451k|            GROW;
  ------------------
  |  | 2308|   451k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   451k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   451k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 398k, False: 53.0k]
  |  |  ------------------
  |  | 2309|   451k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   398k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 398k, False: 0]
  |  |  ------------------
  |  | 2310|   451k|	xmlParserGrow(ctxt);
  ------------------
 4105|       |
 4106|   158M|        c = CUR;
  ------------------
  |  | 2262|   158M|#define CUR (*ctxt->input->cur)
  ------------------
 4107|       |
 4108|   158M|        if (c >= 0x80) {
  ------------------
  |  Branch (4108:13): [True: 73.4M, False: 84.9M]
  ------------------
 4109|  73.4M|            l = xmlUTF8MultibyteLen(ctxt, CUR_PTR,
  ------------------
  |  | 2264|  73.4M|#define CUR_PTR ctxt->input->cur
  ------------------
 4110|  73.4M|                    "invalid character in attribute value\n");
 4111|  73.4M|            if (l == 0) {
  ------------------
  |  Branch (4111:17): [True: 66.5M, False: 6.96M]
  ------------------
 4112|  66.5M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4112:21): [True: 310k, False: 66.1M]
  ------------------
 4113|   310k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   310k|#define CUR_PTR ctxt->input->cur
  ------------------
 4114|   310k|                    chunkSize = 0;
 4115|   310k|                }
 4116|  66.5M|                xmlSBufAddReplChar(&buf);
 4117|  66.5M|                NEXTL(1);
  ------------------
  |  | 2325|  66.5M|#define NEXTL(l) do {							\
  |  | 2326|  66.5M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 66.5M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  66.5M|    } else ctxt->input->col++;						\
  |  | 2329|  66.5M|    ctxt->input->cur += l;				\
  |  | 2330|  66.5M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 66.5M]
  |  |  ------------------
  ------------------
 4118|  66.5M|            } else {
 4119|  6.96M|                chunkSize += l;
 4120|  6.96M|                NEXTL(l);
  ------------------
  |  | 2325|  6.96M|#define NEXTL(l) do {							\
  |  | 2326|  6.96M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.96M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.96M|    } else ctxt->input->col++;						\
  |  | 2329|  6.96M|    ctxt->input->cur += l;				\
  |  | 2330|  6.96M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
 4121|  6.96M|            }
 4122|       |
 4123|  73.4M|            inSpace = 0;
 4124|  84.9M|        } else if (c != '&') {
  ------------------
  |  Branch (4124:20): [True: 83.7M, False: 1.25M]
  ------------------
 4125|  83.7M|            if (c > 0x20) {
  ------------------
  |  Branch (4125:17): [True: 56.7M, False: 26.9M]
  ------------------
 4126|  56.7M|                if (c == quote)
  ------------------
  |  Branch (4126:21): [True: 381k, False: 56.3M]
  ------------------
 4127|   381k|                    break;
 4128|       |
 4129|  56.3M|                if (c == '<')
  ------------------
  |  Branch (4129:21): [True: 928k, False: 55.4M]
  ------------------
 4130|   928k|                    xmlFatalErr(ctxt, XML_ERR_LT_IN_ATTRIBUTE, NULL);
 4131|       |
 4132|  56.3M|                chunkSize += 1;
 4133|  56.3M|                inSpace = 0;
 4134|  56.3M|            } else if (!IS_BYTE_CHAR(c)) {
  ------------------
  |  |  103|  26.9M|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|  26.9M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 8.89M, False: 18.0M]
  |  |  |  |  |  Branch (108:44): [True: 6.29M, False: 2.59M]
  |  |  |  |  ------------------
  |  |  |  |  109|  26.9M|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 423k, False: 20.2M]
  |  |  |  |  ------------------
  |  |  |  |  110|  26.9M|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 2.12M, False: 18.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4135|  18.1M|                xmlFatalErrMsg(ctxt, XML_ERR_INVALID_CHAR,
 4136|  18.1M|                        "invalid character in attribute value\n");
 4137|  18.1M|                if (chunkSize > 0) {
  ------------------
  |  Branch (4137:21): [True: 88.1k, False: 18.0M]
  ------------------
 4138|  88.1k|                    xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  88.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4139|  88.1k|                    chunkSize = 0;
 4140|  88.1k|                }
 4141|  18.1M|                xmlSBufAddReplChar(&buf);
 4142|  18.1M|                inSpace = 0;
 4143|  18.1M|            } else {
 4144|       |                /* Whitespace */
 4145|  8.83M|                if ((normalize) && (inSpace)) {
  ------------------
  |  Branch (4145:21): [True: 90.0k, False: 8.74M]
  |  Branch (4145:36): [True: 62.7k, False: 27.2k]
  ------------------
 4146|       |                    /* Skip char */
 4147|  62.7k|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4147:25): [True: 17.1k, False: 45.6k]
  ------------------
 4148|  17.1k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  17.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4149|  17.1k|                        chunkSize = 0;
 4150|  17.1k|                    }
 4151|  62.7k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  62.7k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4152|  8.77M|                } else if (c < 0x20) {
  ------------------
  |  Branch (4152:28): [True: 6.68M, False: 2.09M]
  ------------------
 4153|       |                    /* Convert to space */
 4154|  6.68M|                    if (chunkSize > 0) {
  ------------------
  |  Branch (4154:25): [True: 208k, False: 6.47M]
  ------------------
 4155|   208k|                        xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   208k|#define CUR_PTR ctxt->input->cur
  ------------------
 4156|   208k|                        chunkSize = 0;
 4157|   208k|                    }
 4158|       |
 4159|  6.68M|                    xmlSBufAddCString(&buf, " ", 1);
 4160|  6.68M|                } else {
 4161|  2.09M|                    chunkSize += 1;
 4162|  2.09M|                }
 4163|       |
 4164|  8.83M|                inSpace = 1;
 4165|       |
 4166|  8.83M|                if ((c == 0xD) && (NXT(1) == 0xA))
  ------------------
  |  | 2263|   423k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4166:21): [True: 423k, False: 8.41M]
  |  Branch (4166:35): [True: 69.2k, False: 354k]
  ------------------
 4167|  69.2k|                    CUR_PTR++;
  ------------------
  |  | 2264|  69.2k|#define CUR_PTR ctxt->input->cur
  ------------------
 4168|  8.83M|            }
 4169|       |
 4170|  83.3M|            NEXTL(1);
  ------------------
  |  | 2325|  83.3M|#define NEXTL(l) do {							\
  |  | 2326|  83.3M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 6.30M, False: 77.0M]
  |  |  ------------------
  |  | 2327|  6.30M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  77.0M|    } else ctxt->input->col++;						\
  |  | 2329|  83.3M|    ctxt->input->cur += l;				\
  |  | 2330|  83.3M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 83.3M]
  |  |  ------------------
  ------------------
 4171|  83.3M|        } else if (NXT(1) == '#') {
  ------------------
  |  | 2263|  1.25M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4171:20): [True: 63.0k, False: 1.19M]
  ------------------
 4172|  63.0k|            int val;
 4173|       |
 4174|  63.0k|            if (chunkSize > 0) {
  ------------------
  |  Branch (4174:17): [True: 42.1k, False: 20.9k]
  ------------------
 4175|  42.1k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|  42.1k|#define CUR_PTR ctxt->input->cur
  ------------------
 4176|  42.1k|                chunkSize = 0;
 4177|  42.1k|            }
 4178|       |
 4179|  63.0k|            val = xmlParseCharRef(ctxt);
 4180|  63.0k|            if (val == 0)
  ------------------
  |  Branch (4180:17): [True: 2.44k, False: 60.6k]
  ------------------
 4181|  2.44k|                goto error;
 4182|       |
 4183|  60.6k|            if ((val == '&') && (!replaceEntities)) {
  ------------------
  |  Branch (4183:17): [True: 5.53k, False: 55.1k]
  |  Branch (4183:33): [True: 2.25k, False: 3.28k]
  ------------------
 4184|       |                /*
 4185|       |                 * The reparsing will be done in xmlNodeParseContent()
 4186|       |                 * called from SAX2.c
 4187|       |                 */
 4188|  2.25k|                xmlSBufAddCString(&buf, "&#38;", 5);
 4189|  2.25k|                inSpace = 0;
 4190|  58.3k|            } else if (val == ' ') {
  ------------------
  |  Branch (4190:24): [True: 1.40k, False: 56.9k]
  ------------------
 4191|  1.40k|                if ((normalize) && (inSpace))
  ------------------
  |  Branch (4191:21): [True: 458, False: 944]
  |  Branch (4191:36): [True: 224, False: 234]
  ------------------
 4192|    224|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    224|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4193|  1.17k|                else
 4194|  1.17k|                    xmlSBufAddCString(&buf, " ", 1);
 4195|  1.40k|                inSpace = 1;
 4196|  56.9k|            } else {
 4197|  56.9k|                xmlSBufAddChar(&buf, val);
 4198|  56.9k|                inSpace = 0;
 4199|  56.9k|            }
 4200|  1.19M|        } else {
 4201|  1.19M|            const xmlChar *name;
 4202|  1.19M|            xmlEntityPtr ent;
 4203|       |
 4204|  1.19M|            if (chunkSize > 0) {
  ------------------
  |  Branch (4204:17): [True: 736k, False: 454k]
  ------------------
 4205|   736k|                xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   736k|#define CUR_PTR ctxt->input->cur
  ------------------
 4206|   736k|                chunkSize = 0;
 4207|   736k|            }
 4208|       |
 4209|  1.19M|            name = xmlParseEntityRefInternal(ctxt);
 4210|  1.19M|            if (name == NULL) {
  ------------------
  |  Branch (4210:17): [True: 150k, False: 1.04M]
  ------------------
 4211|       |                /*
 4212|       |                 * Probably a literal '&' which wasn't escaped.
 4213|       |                 * TODO: Handle gracefully in recovery mode.
 4214|       |                 */
 4215|   150k|                continue;
 4216|   150k|            }
 4217|       |
 4218|  1.04M|            ent = xmlLookupGeneralEntity(ctxt, name, /* isAttr */ 1);
 4219|  1.04M|            if (ent == NULL)
  ------------------
  |  Branch (4219:17): [True: 243k, False: 797k]
  ------------------
 4220|   243k|                continue;
 4221|       |
 4222|   797k|            if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (4222:17): [True: 27.8k, False: 769k]
  ------------------
 4223|  27.8k|                if ((ent->content[0] == '&') && (!replaceEntities))
  ------------------
  |  Branch (4223:21): [True: 5.23k, False: 22.6k]
  |  Branch (4223:49): [True: 3.80k, False: 1.43k]
  ------------------
 4224|  3.80k|                    xmlSBufAddCString(&buf, "&#38;", 5);
 4225|  24.0k|                else
 4226|  24.0k|                    xmlSBufAddString(&buf, ent->content, ent->length);
 4227|  27.8k|                inSpace = 0;
 4228|   769k|            } else if (replaceEntities) {
  ------------------
  |  Branch (4228:24): [True: 723k, False: 46.3k]
  ------------------
 4229|   723k|                if (xmlExpandEntityInAttValue(ctxt, &buf,
  ------------------
  |  Branch (4229:21): [True: 4.38k, False: 719k]
  ------------------
 4230|   723k|                        ent->content, ent, normalize, &inSpace, ctxt->inputNr,
 4231|   723k|                        /* check */ 1) > 0)
 4232|  4.38k|                    attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|  4.38k|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4233|   723k|            } else {
 4234|  46.3k|                if ((ent->flags & entFlags) != entFlags)
  ------------------
  |  Branch (4234:21): [True: 1.03k, False: 45.2k]
  ------------------
 4235|  1.03k|                    xmlCheckEntityInAttValue(ctxt, ent, ctxt->inputNr);
 4236|       |
 4237|  46.3k|                if (xmlParserEntityCheck(ctxt, ent->expandedSize)) {
  ------------------
  |  Branch (4237:21): [True: 98, False: 46.2k]
  ------------------
 4238|     98|                    ent->content[0] = 0;
 4239|     98|                    goto error;
 4240|     98|                }
 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|   797k|	}
 4252|   158M|    }
 4253|       |
 4254|   381k|    if ((buf.mem == NULL) && (outFlags != NULL)) {
  ------------------
  |  Branch (4254:9): [True: 324k, False: 56.8k]
  |  Branch (4254:30): [True: 186k, False: 137k]
  ------------------
 4255|   186k|        ret = (xmlChar *) CUR_PTR - chunkSize;
  ------------------
  |  | 2264|   186k|#define CUR_PTR ctxt->input->cur
  ------------------
 4256|       |
 4257|   186k|        if (attlen != NULL)
  ------------------
  |  Branch (4257:13): [True: 186k, False: 0]
  ------------------
 4258|   186k|            *attlen = chunkSize;
 4259|   186k|        if ((normalize) && (inSpace) && (chunkSize > 0)) {
  ------------------
  |  Branch (4259:13): [True: 1.91k, False: 184k]
  |  Branch (4259:28): [True: 662, False: 1.24k]
  |  Branch (4259:41): [True: 328, False: 334]
  ------------------
 4260|    328|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    328|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4261|    328|            *attlen -= 1;
 4262|    328|        }
 4263|       |
 4264|       |        /* Report potential error */
 4265|   186k|        xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4266|   194k|    } else {
 4267|   194k|        if (chunkSize > 0)
  ------------------
  |  Branch (4267:13): [True: 168k, False: 26.1k]
  ------------------
 4268|   168k|            xmlSBufAddString(&buf, CUR_PTR - chunkSize, chunkSize);
  ------------------
  |  | 2264|   168k|#define CUR_PTR ctxt->input->cur
  ------------------
 4269|       |
 4270|   194k|        if ((normalize) && (inSpace) && (buf.size > 0)) {
  ------------------
  |  Branch (4270:13): [True: 1.99k, False: 192k]
  |  Branch (4270:28): [True: 368, False: 1.62k]
  |  Branch (4270:41): [True: 368, False: 0]
  ------------------
 4271|    368|            attvalFlags |= XML_ATTVAL_NORM_CHANGE;
  ------------------
  |  |   99|    368|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
 4272|    368|            buf.size--;
 4273|    368|        }
 4274|       |
 4275|   194k|        ret = xmlSBufFinish(&buf, attlen, ctxt, "AttValue length too long");
 4276|   194k|        attvalFlags |= XML_ATTVAL_ALLOC;
  ------------------
  |  |   98|   194k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 4277|       |
 4278|   194k|        if (ret != NULL) {
  ------------------
  |  Branch (4278:13): [True: 194k, False: 23]
  ------------------
 4279|   194k|            if (attlen != NULL)
  ------------------
  |  Branch (4279:17): [True: 32.0k, False: 162k]
  ------------------
 4280|  32.0k|                *attlen = buf.size;
 4281|   194k|        }
 4282|   194k|    }
 4283|       |
 4284|   381k|    if (outFlags != NULL)
  ------------------
  |  Branch (4284:9): [True: 218k, False: 162k]
  ------------------
 4285|   218k|        *outFlags = attvalFlags;
 4286|       |
 4287|   381k|    NEXTL(1);
  ------------------
  |  | 2325|   381k|#define NEXTL(l) do {							\
  |  | 2326|   381k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 381k]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   381k|    } else ctxt->input->col++;						\
  |  | 2329|   381k|    ctxt->input->cur += l;				\
  |  | 2330|   381k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 381k]
  |  |  ------------------
  ------------------
 4288|       |
 4289|   381k|    return(ret);
 4290|       |
 4291|  44.4k|error:
 4292|  44.4k|    xmlSBufCleanup(&buf, ctxt, "AttValue length too long");
 4293|       |    return(NULL);
 4294|   425k|}
parser.c:xmlCheckEntityInAttValue:
 3729|  4.92k|xmlCheckEntityInAttValue(xmlParserCtxtPtr ctxt, xmlEntityPtr pent, int depth) {
 3730|  4.92k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 40 : 20;
  ------------------
  |  Branch (3730:20): [True: 3.83k, False: 1.08k]
  ------------------
 3731|  4.92k|    const xmlChar *str;
 3732|  4.92k|    unsigned long expandedSize = pent->length;
 3733|  4.92k|    int c, flags;
 3734|       |
 3735|  4.92k|    depth += 1;
 3736|  4.92k|    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: 203]
  ------------------
 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|    203|    else
 3755|    203|        flags = XML_ENT_VALIDATED;
  ------------------
  |  |   21|    203|#define XML_ENT_VALIDATED   (1u << 2)
  ------------------
 3756|       |
 3757|  4.90k|    str = pent->content;
 3758|  4.90k|    if (str == NULL)
  ------------------
  |  Branch (3758:9): [True: 3, False: 4.90k]
  ------------------
 3759|      3|        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|  31.7M|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  31.7M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (3767:12): [True: 31.7M, False: 119]
  ------------------
 3768|  31.7M|        c = *str;
 3769|       |
 3770|  31.7M|	if (c != '&') {
  ------------------
  |  Branch (3770:6): [True: 31.6M, False: 30.2k]
  ------------------
 3771|  31.6M|            if (c == 0)
  ------------------
  |  Branch (3771:17): [True: 4.76k, False: 31.6M]
  ------------------
 3772|  4.76k|                break;
 3773|       |
 3774|  31.6M|            if (c == '<')
  ------------------
  |  Branch (3774:17): [True: 3.10k, False: 31.6M]
  ------------------
 3775|  3.10k|                xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
 3776|  3.10k|                        "'<' in entity '%s' is not allowed in attributes "
 3777|  3.10k|                        "values\n", pent->name);
 3778|       |
 3779|  31.6M|            str += 1;
 3780|  31.6M|        } else if (str[1] == '#') {
  ------------------
  |  Branch (3780:20): [True: 8.20k, False: 22.0k]
  ------------------
 3781|  8.20k|            int val;
 3782|       |
 3783|  8.20k|	    val = xmlParseStringCharRef(ctxt, &str);
 3784|  8.20k|	    if (val == 0) {
  ------------------
  |  Branch (3784:10): [True: 5, False: 8.19k]
  ------------------
 3785|      5|                pent->content[0] = 0;
 3786|      5|                break;
 3787|      5|            }
 3788|  22.0k|	} else {
 3789|  22.0k|            xmlChar *name;
 3790|  22.0k|            xmlEntityPtr ent;
 3791|       |
 3792|  22.0k|	    name = xmlParseStringEntityRef(ctxt, &str);
 3793|  22.0k|	    if (name == NULL) {
  ------------------
  |  Branch (3793:10): [True: 15, False: 22.0k]
  ------------------
 3794|     15|                pent->content[0] = 0;
 3795|     15|                break;
 3796|     15|            }
 3797|       |
 3798|  22.0k|            ent = xmlLookupGeneralEntity(ctxt, name, /* inAttr */ 1);
 3799|  22.0k|            xmlFree(name);
 3800|       |
 3801|  22.0k|            if ((ent != NULL) &&
  ------------------
  |  Branch (3801:17): [True: 10.1k, False: 11.8k]
  ------------------
 3802|  10.1k|                (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (3802:17): [True: 7.68k, False: 2.51k]
  ------------------
 3803|  7.68k|                if ((ent->flags & flags) != flags) {
  ------------------
  |  Branch (3803:21): [True: 3.88k, False: 3.80k]
  ------------------
 3804|  3.88k|                    pent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.88k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3805|  3.88k|                    xmlCheckEntityInAttValue(ctxt, ent, depth);
 3806|  3.88k|                    pent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  3.88k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 3807|  3.88k|                }
 3808|       |
 3809|  7.68k|                xmlSaturatedAdd(&expandedSize, ent->expandedSize);
 3810|  7.68k|                xmlSaturatedAdd(&expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  7.68k|#define XML_ENT_FIXED_COST 20
  ------------------
 3811|  7.68k|            }
 3812|  22.0k|        }
 3813|  31.7M|    }
 3814|       |
 3815|  4.90k|done:
 3816|  4.90k|    if (ctxt->inSubset == 0)
  ------------------
  |  Branch (3816:9): [True: 4.70k, False: 203]
  ------------------
 3817|  4.70k|        pent->expandedSize = expandedSize;
 3818|       |
 3819|  4.90k|    pent->flags |= flags;
 3820|  4.90k|}
parser.c:xmlCurrentCharRecover:
 2337|  48.7M|xmlCurrentCharRecover(xmlParserCtxtPtr ctxt, int *len) {
 2338|  48.7M|    int c = xmlCurrentChar(ctxt, len);
 2339|       |
 2340|  48.7M|    if (c == XML_INVALID_CHAR)
  ------------------
  |  |    9|  48.7M|#define XML_INVALID_CHAR 0x200000
  ------------------
  |  Branch (2340:9): [True: 12.4M, False: 36.3M]
  ------------------
 2341|  12.4M|        c = 0xFFFD; /* replacement character */
 2342|       |
 2343|  48.7M|    return(c);
 2344|  48.7M|}
parser.c:xmlParseCharDataInternal:
 4570|  7.86M|xmlParseCharDataInternal(xmlParserCtxtPtr ctxt, int partial) {
 4571|  7.86M|    const xmlChar *in;
 4572|  7.86M|    int line = ctxt->input->line;
 4573|  7.86M|    int col = ctxt->input->col;
 4574|  7.86M|    int ccol;
 4575|  7.86M|    int terminate = 0;
 4576|       |
 4577|  7.86M|    GROW;
  ------------------
  |  | 2308|  7.86M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.86M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.86M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 4.39M, False: 3.47M]
  |  |  ------------------
  |  | 2309|  7.86M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  4.39M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 41.2k, False: 4.35M]
  |  |  ------------------
  |  | 2310|  7.86M|	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.86M|    in = ctxt->input->cur;
 4583|  7.86M|    do {
 4584|  7.98M|get_more_space:
 4585|  8.17M|        while (*in == 0x20) { in++; ctxt->input->col++; }
  ------------------
  |  Branch (4585:16): [True: 188k, False: 7.98M]
  ------------------
 4586|  7.98M|        if (*in == 0xA) {
  ------------------
  |  Branch (4586:13): [True: 116k, False: 7.86M]
  ------------------
 4587|  4.14M|            do {
 4588|  4.14M|                ctxt->input->line++; ctxt->input->col = 1;
 4589|  4.14M|                in++;
 4590|  4.14M|            } while (*in == 0xA);
  ------------------
  |  Branch (4590:22): [True: 4.02M, False: 116k]
  ------------------
 4591|   116k|            goto get_more_space;
 4592|   116k|        }
 4593|  7.86M|        if (*in == '<') {
  ------------------
  |  Branch (4593:13): [True: 88.0k, False: 7.78M]
  ------------------
 4594|   176k|            while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4594:20): [True: 88.0k, False: 88.0k]
  ------------------
 4595|  88.0k|                const xmlChar *tmp = ctxt->input->cur;
 4596|  88.0k|                size_t nbchar = in - tmp;
 4597|       |
 4598|  88.0k|                if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|  88.0k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4598:21): [True: 0, False: 88.0k]
  ------------------
 4599|      0|                    nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4600|  88.0k|                ctxt->input->cur += nbchar;
 4601|       |
 4602|  88.0k|                xmlCharacters(ctxt, tmp, nbchar, 1);
 4603|  88.0k|            }
 4604|  88.0k|            return;
 4605|  88.0k|        }
 4606|       |
 4607|  8.33M|get_more:
 4608|  8.33M|        ccol = ctxt->input->col;
 4609|  20.2M|        while (test_char_data[*in]) {
  ------------------
  |  Branch (4609:16): [True: 11.9M, False: 8.33M]
  ------------------
 4610|  11.9M|            in++;
 4611|  11.9M|            ccol++;
 4612|  11.9M|        }
 4613|  8.33M|        ctxt->input->col = ccol;
 4614|  8.33M|        if (*in == 0xA) {
  ------------------
  |  Branch (4614:13): [True: 48.7k, False: 8.28M]
  ------------------
 4615|  3.01M|            do {
 4616|  3.01M|                ctxt->input->line++; ctxt->input->col = 1;
 4617|  3.01M|                in++;
 4618|  3.01M|            } while (*in == 0xA);
  ------------------
  |  Branch (4618:22): [True: 2.96M, False: 48.7k]
  ------------------
 4619|  48.7k|            goto get_more;
 4620|  48.7k|        }
 4621|  8.28M|        if (*in == ']') {
  ------------------
  |  Branch (4621:13): [True: 505k, False: 7.78M]
  ------------------
 4622|   505k|            size_t avail = ctxt->input->end - in;
 4623|       |
 4624|   505k|            if (partial && avail < 2) {
  ------------------
  |  Branch (4624:17): [True: 429k, False: 75.6k]
  |  Branch (4624:28): [True: 37, False: 429k]
  ------------------
 4625|     37|                terminate = 1;
 4626|     37|                goto invoke_callback;
 4627|     37|            }
 4628|   505k|            if (in[1] == ']') {
  ------------------
  |  Branch (4628:17): [True: 421k, False: 83.5k]
  ------------------
 4629|   421k|                if (partial && avail < 3) {
  ------------------
  |  Branch (4629:21): [True: 411k, False: 9.88k]
  |  Branch (4629:32): [True: 470, False: 411k]
  ------------------
 4630|    470|                    terminate = 1;
 4631|    470|                    goto invoke_callback;
 4632|    470|                }
 4633|   421k|                if (in[2] == '>')
  ------------------
  |  Branch (4633:21): [True: 2.73k, False: 418k]
  ------------------
 4634|  2.73k|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4635|   421k|            }
 4636|       |
 4637|   504k|            in++;
 4638|   504k|            ctxt->input->col++;
 4639|   504k|            goto get_more;
 4640|   505k|        }
 4641|       |
 4642|  7.78M|invoke_callback:
 4643|  8.61M|        while (in > ctxt->input->cur) {
  ------------------
  |  Branch (4643:16): [True: 836k, False: 7.78M]
  ------------------
 4644|   836k|            const xmlChar *tmp = ctxt->input->cur;
 4645|   836k|            size_t nbchar = in - tmp;
 4646|       |
 4647|   836k|            if (nbchar > XML_MAX_ITEMS)
  ------------------
  |  |   13|   836k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (4647:17): [True: 0, False: 836k]
  ------------------
 4648|      0|                nbchar = XML_MAX_ITEMS;
  ------------------
  |  |   13|      0|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 4649|   836k|            ctxt->input->cur += nbchar;
 4650|       |
 4651|   836k|            xmlCharacters(ctxt, tmp, nbchar, 0);
 4652|       |
 4653|   836k|            line = ctxt->input->line;
 4654|   836k|            col = ctxt->input->col;
 4655|   836k|        }
 4656|  7.78M|        ctxt->input->cur = in;
 4657|  7.78M|        if (*in == 0xD) {
  ------------------
  |  Branch (4657:13): [True: 13.2k, False: 7.76M]
  ------------------
 4658|  13.2k|            in++;
 4659|  13.2k|            if (*in == 0xA) {
  ------------------
  |  Branch (4659:17): [True: 5.01k, False: 8.27k]
  ------------------
 4660|  5.01k|                ctxt->input->cur = in;
 4661|  5.01k|                in++;
 4662|  5.01k|                ctxt->input->line++; ctxt->input->col = 1;
 4663|  5.01k|                continue; /* while */
 4664|  5.01k|            }
 4665|  8.27k|            in--;
 4666|  8.27k|        }
 4667|  7.77M|        if (*in == '<') {
  ------------------
  |  Branch (4667:13): [True: 694k, False: 7.08M]
  ------------------
 4668|   694k|            return;
 4669|   694k|        }
 4670|  7.08M|        if (*in == '&') {
  ------------------
  |  Branch (4670:13): [True: 46.2k, False: 7.03M]
  ------------------
 4671|  46.2k|            return;
 4672|  46.2k|        }
 4673|  7.03M|        if (terminate) {
  ------------------
  |  Branch (4673:13): [True: 507, False: 7.03M]
  ------------------
 4674|    507|            return;
 4675|    507|        }
 4676|  7.03M|        SHRINK;
  ------------------
  |  | 2304|  7.03M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  7.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 3.71M, False: 3.32M]
  |  |  ------------------
  |  | 2305|  7.03M|	xmlParserShrink(ctxt);
  ------------------
 4677|  7.03M|        GROW;
  ------------------
  |  | 2308|  7.03M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  7.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  7.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 3.71M, False: 3.32M]
  |  |  ------------------
  |  | 2309|  7.03M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  3.71M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 17.5k, False: 3.69M]
  |  |  ------------------
  |  | 2310|  7.03M|	xmlParserGrow(ctxt);
  ------------------
 4678|  7.03M|        in = ctxt->input->cur;
 4679|  7.04M|    } while (((*in >= 0x20) && (*in <= 0x7F)) ||
  ------------------
  |  Branch (4679:15): [True: 102k, False: 6.93M]
  |  Branch (4679:32): [True: 1.33k, False: 100k]
  ------------------
 4680|  7.03M|             (*in == 0x09) || (*in == 0x0a));
  ------------------
  |  Branch (4680:14): [True: 2.07k, False: 7.03M]
  |  Branch (4680:31): [True: 1.37k, False: 7.03M]
  ------------------
 4681|  7.03M|    ctxt->input->line = line;
 4682|  7.03M|    ctxt->input->col = col;
 4683|  7.03M|    xmlParseCharDataComplex(ctxt, partial);
 4684|  7.03M|}
parser.c:xmlCharacters:
 4524|  1.13M|              int isBlank) {
 4525|  1.13M|    int checkBlanks;
 4526|       |
 4527|  1.13M|    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
  ------------------
  |  Branch (4527:9): [True: 0, False: 1.13M]
  |  Branch (4527:32): [True: 205k, False: 931k]
  ------------------
 4528|   205k|        return;
 4529|       |
 4530|   931k|    checkBlanks = (!ctxt->keepBlanks) ||
  ------------------
  |  Branch (4530:19): [True: 493k, False: 437k]
  ------------------
 4531|   437k|                  (ctxt->sax->ignorableWhitespace != ctxt->sax->characters);
  ------------------
  |  Branch (4531:19): [True: 0, False: 437k]
  ------------------
 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|   931k|    if ((checkBlanks) &&
  ------------------
  |  Branch (4538:9): [True: 493k, False: 437k]
  ------------------
 4539|   493k|        (areBlanks(ctxt, buf, size, isBlank))) {
  ------------------
  |  Branch (4539:9): [True: 12.0k, False: 481k]
  ------------------
 4540|  12.0k|        if ((ctxt->sax->ignorableWhitespace != NULL) &&
  ------------------
  |  Branch (4540:13): [True: 12.0k, False: 0]
  ------------------
 4541|  12.0k|            (ctxt->keepBlanks))
  ------------------
  |  Branch (4541:13): [True: 0, False: 12.0k]
  ------------------
 4542|      0|            ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
 4543|   919k|    } else {
 4544|   919k|        if (ctxt->sax->characters != NULL)
  ------------------
  |  Branch (4544:13): [True: 919k, False: 0]
  ------------------
 4545|   919k|            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|   919k|        if ((checkBlanks) && (*ctxt->space == -1))
  ------------------
  |  Branch (4551:13): [True: 481k, False: 437k]
  |  Branch (4551:30): [True: 114k, False: 366k]
  ------------------
 4552|   114k|            *ctxt->space = -2;
 4553|   919k|    }
 4554|   931k|}
parser.c:areBlanks:
 2852|   493k|                     int blank_chars) {
 2853|   493k|    int i;
 2854|   493k|    xmlNodePtr lastChild;
 2855|       |
 2856|       |    /*
 2857|       |     * Check for xml:space value.
 2858|       |     */
 2859|   493k|    if ((ctxt->space == NULL) || (*(ctxt->space) == 1) ||
  ------------------
  |  Branch (2859:9): [True: 0, False: 493k]
  |  Branch (2859:34): [True: 319, False: 493k]
  ------------------
 2860|   493k|        (*(ctxt->space) == -2))
  ------------------
  |  Branch (2860:9): [True: 364k, False: 128k]
  ------------------
 2861|   364k|	return(0);
 2862|       |
 2863|       |    /*
 2864|       |     * Check that the string is made of blanks
 2865|       |     */
 2866|   128k|    if (blank_chars == 0) {
  ------------------
  |  Branch (2866:9): [True: 118k, False: 10.5k]
  ------------------
 2867|   212k|	for (i = 0;i < len;i++)
  ------------------
  |  Branch (2867:13): [True: 206k, False: 5.73k]
  ------------------
 2868|   206k|	    if (!(IS_BLANK_CH(str[i]))) return(0);
  ------------------
  |  |  137|   206k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   206k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 16.1k, False: 190k]
  |  |  |  |  ------------------
  |  |  |  |   91|   206k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 190k, False: 0]
  |  |  |  |  |  Branch (91:23): [True: 77.8k, False: 112k]
  |  |  |  |  ------------------
  |  |  |  |   92|   206k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2869|   118k|    }
 2870|       |
 2871|       |    /*
 2872|       |     * Look if the element is mixed content in the DTD if available
 2873|       |     */
 2874|  16.2k|    if (ctxt->node == NULL) return(0);
  ------------------
  |  Branch (2874:9): [True: 0, False: 16.2k]
  ------------------
 2875|  16.2k|    if (ctxt->myDoc != NULL) {
  ------------------
  |  Branch (2875:9): [True: 16.2k, False: 0]
  ------------------
 2876|  16.2k|        xmlElementPtr elemDecl = NULL;
 2877|  16.2k|        xmlDocPtr doc = ctxt->myDoc;
 2878|  16.2k|        const xmlChar *prefix = NULL;
 2879|       |
 2880|  16.2k|        if (ctxt->node->ns)
  ------------------
  |  Branch (2880:13): [True: 2.08k, False: 14.1k]
  ------------------
 2881|  2.08k|            prefix = ctxt->node->ns->prefix;
 2882|  16.2k|        if (doc->intSubset != NULL)
  ------------------
  |  Branch (2882:13): [True: 9.35k, False: 6.91k]
  ------------------
 2883|  9.35k|            elemDecl = xmlHashLookup2(doc->intSubset->elements, ctxt->node->name,
 2884|  9.35k|                                      prefix);
 2885|  16.2k|        if ((elemDecl == NULL) && (doc->extSubset != NULL))
  ------------------
  |  Branch (2885:13): [True: 13.7k, False: 2.49k]
  |  Branch (2885:35): [True: 595, False: 13.1k]
  ------------------
 2886|    595|            elemDecl = xmlHashLookup2(doc->extSubset->elements, ctxt->node->name,
 2887|    595|                                      prefix);
 2888|  16.2k|        if (elemDecl != NULL) {
  ------------------
  |  Branch (2888:13): [True: 2.58k, False: 13.6k]
  ------------------
 2889|  2.58k|            if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT)
  ------------------
  |  Branch (2889:17): [True: 1.64k, False: 945]
  ------------------
 2890|  1.64k|                return(1);
 2891|    945|            if ((elemDecl->etype == XML_ELEMENT_TYPE_ANY) ||
  ------------------
  |  Branch (2891:17): [True: 278, False: 667]
  ------------------
 2892|    667|                (elemDecl->etype == XML_ELEMENT_TYPE_MIXED))
  ------------------
  |  Branch (2892:17): [True: 229, False: 438]
  ------------------
 2893|    507|                return(0);
 2894|    945|        }
 2895|  16.2k|    }
 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|  14.1k|    if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  14.1k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') && (RAW != 0xD)) return(0);
  ------------------
  |  | 2261|  3.94k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (2904:9): [True: 3.94k, False: 10.1k]
  |  Branch (2904:25): [True: 1.83k, False: 2.11k]
  ------------------
 2905|  12.2k|    if ((ctxt->node->children == NULL) &&
  ------------------
  |  Branch (2905:9): [True: 8.85k, False: 3.43k]
  ------------------
 2906|  8.85k|	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2261|  8.85k|#define RAW (*ctxt->input->cur)
  ------------------
              	(RAW == '<') && (NXT(1) == '/')) return(0);
  ------------------
  |  | 2263|  7.32k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2906:2): [True: 7.32k, False: 1.52k]
  |  Branch (2906:18): [True: 440, False: 6.88k]
  ------------------
 2907|       |
 2908|  11.8k|    lastChild = xmlGetLastChild(ctxt->node);
 2909|  11.8k|    if (lastChild == NULL) {
  ------------------
  |  Branch (2909:9): [True: 8.41k, False: 3.43k]
  ------------------
 2910|  8.41k|        if ((ctxt->node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (2910:13): [True: 0, False: 8.41k]
  ------------------
 2911|      0|            (ctxt->node->content != NULL)) return(0);
  ------------------
  |  Branch (2911:13): [True: 0, False: 0]
  ------------------
 2912|  8.41k|    } else if (xmlNodeIsText(lastChild))
  ------------------
  |  Branch (2912:16): [True: 923, False: 2.51k]
  ------------------
 2913|    923|        return(0);
 2914|  2.51k|    else if ((ctxt->node->children != NULL) &&
  ------------------
  |  Branch (2914:14): [True: 2.51k, False: 0]
  ------------------
 2915|  2.51k|             (xmlNodeIsText(ctxt->node->children)))
  ------------------
  |  Branch (2915:14): [True: 536, False: 1.97k]
  ------------------
 2916|    536|        return(0);
 2917|  10.3k|    return(1);
 2918|  11.8k|}
parser.c:xmlParseCharDataComplex:
 4697|  7.03M|xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int partial) {
 4698|  7.03M|    xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
 4699|  7.03M|    int nbchar = 0;
 4700|  7.03M|    int cur, l;
 4701|       |
 4702|  7.03M|    cur = xmlCurrentCharRecover(ctxt, &l);
 4703|  22.8M|    while ((cur != '<') && /* checked */
  ------------------
  |  Branch (4703:12): [True: 22.8M, False: 59.1k]
  ------------------
 4704|  22.8M|           (cur != '&') &&
  ------------------
  |  Branch (4704:12): [True: 22.8M, False: 5.63k]
  ------------------
 4705|  22.8M|	   (IS_CHAR(cur))) {
  ------------------
  |  |  115|  22.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  22.8M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 13.7M, False: 9.00M]
  |  |  |  |  ------------------
  |  |  |  |  118|  22.8M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  13.7M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 6.92M, False: 6.86M]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.55M, False: 4.37M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  13.7M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 11.2M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  13.7M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 4.27M, False: 6.96M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  22.8M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 9.00M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 3.06M, False: 5.94M]
  |  |  |  |  ------------------
  |  |  |  |  120|  9.00M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 5.94M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 5.93M, False: 8.78k]
  |  |  |  |  ------------------
  |  |  |  |  121|  9.00M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 6.29k, False: 2.49k]
  |  |  |  |  |  Branch (121:27): [True: 6.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4705:5): [True: 15.8M, False: 6.96M]
  ------------------
 4706|  15.8M|        if (cur == ']') {
  ------------------
  |  Branch (4706:13): [True: 1.06M, False: 14.7M]
  ------------------
 4707|  1.06M|            size_t avail = ctxt->input->end - ctxt->input->cur;
 4708|       |
 4709|  1.06M|            if (partial && avail < 2)
  ------------------
  |  Branch (4709:17): [True: 1.05M, False: 8.03k]
  |  Branch (4709:28): [True: 59, False: 1.05M]
  ------------------
 4710|     59|                break;
 4711|  1.06M|            if (NXT(1) == ']') {
  ------------------
  |  | 2263|  1.06M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4711:17): [True: 1.03M, False: 25.0k]
  ------------------
 4712|  1.03M|                if (partial && avail < 3)
  ------------------
  |  Branch (4712:21): [True: 1.03M, False: 3.03k]
  |  Branch (4712:32): [True: 2.36k, False: 1.03M]
  ------------------
 4713|  2.36k|                    break;
 4714|  1.03M|                if (NXT(2) == '>')
  ------------------
  |  | 2263|  1.03M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (4714:21): [True: 954, False: 1.03M]
  ------------------
 4715|    954|                    xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
 4716|  1.03M|            }
 4717|  1.06M|        }
 4718|       |
 4719|  15.8M|	COPY_BUF(buf, nbchar, cur);
  ------------------
  |  | 2333|  15.8M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 5.47M, False: 10.3M]
  |  |  ------------------
  |  | 2334|  15.8M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4720|       |	/* move current position before possible calling of ctxt->sax->characters */
 4721|  15.8M|	NEXTL(l);
  ------------------
  |  | 2325|  15.8M|#define NEXTL(l) do {							\
  |  | 2326|  15.8M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.49M, False: 13.3M]
  |  |  ------------------
  |  | 2327|  2.49M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  13.3M|    } else ctxt->input->col++;						\
  |  | 2329|  15.8M|    ctxt->input->cur += l;				\
  |  | 2330|  15.8M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 15.8M]
  |  |  ------------------
  ------------------
 4722|  15.8M|	if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  15.8M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (4722:6): [True: 105k, False: 15.7M]
  ------------------
 4723|   105k|	    buf[nbchar] = 0;
 4724|       |
 4725|   105k|            xmlCharacters(ctxt, buf, nbchar, 0);
 4726|   105k|	    nbchar = 0;
 4727|   105k|            SHRINK;
  ------------------
  |  | 2304|   105k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   105k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   105k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 87.0k, False: 18.4k]
  |  |  ------------------
  |  | 2305|   105k|	xmlParserShrink(ctxt);
  ------------------
 4728|   105k|	}
 4729|  15.8M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4730|  15.8M|    }
 4731|  7.03M|    if (nbchar != 0) {
  ------------------
  |  Branch (4731:9): [True: 106k, False: 6.92M]
  ------------------
 4732|   106k|        buf[nbchar] = 0;
 4733|       |
 4734|   106k|        xmlCharacters(ctxt, buf, nbchar, 0);
 4735|   106k|    }
 4736|       |    /*
 4737|       |     * cur == 0 can mean
 4738|       |     *
 4739|       |     * - End of buffer.
 4740|       |     * - An actual 0 character.
 4741|       |     * - An incomplete UTF-8 sequence. This is allowed if partial is set.
 4742|       |     */
 4743|  7.03M|    if (ctxt->input->cur < ctxt->input->end) {
  ------------------
  |  Branch (4743:9): [True: 7.03M, False: 3.80k]
  ------------------
 4744|  7.03M|        if ((cur == 0) && (CUR != 0)) {
  ------------------
  |  | 2262|  6.71M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (4744:13): [True: 6.71M, False: 319k]
  |  Branch (4744:27): [True: 697, False: 6.71M]
  ------------------
 4745|    697|            if (partial == 0) {
  ------------------
  |  Branch (4745:17): [True: 446, False: 251]
  ------------------
 4746|    446|                xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4747|    446|                        "Incomplete UTF-8 sequence starting with %02X\n", CUR);
  ------------------
  |  | 2262|    446|#define CUR (*ctxt->input->cur)
  ------------------
 4748|    446|                NEXTL(1);
  ------------------
  |  | 2325|    446|#define NEXTL(l) do {							\
  |  | 2326|    446|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 446]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|    446|    } else ctxt->input->col++;						\
  |  | 2329|    446|    ctxt->input->cur += l;				\
  |  | 2330|    446|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 446]
  |  |  ------------------
  ------------------
 4749|    446|            }
 4750|  7.03M|        } else if ((cur != '<') && (cur != '&') && (cur != ']')) {
  ------------------
  |  Branch (4750:20): [True: 6.97M, False: 59.1k]
  |  Branch (4750:36): [True: 6.96M, False: 5.63k]
  |  Branch (4750:52): [True: 6.96M, False: 2.42k]
  ------------------
 4751|       |            /* Generate the error and skip the offending character */
 4752|  6.96M|            xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4753|  6.96M|                              "PCDATA invalid Char value %d\n", cur);
 4754|  6.96M|            NEXTL(l);
  ------------------
  |  | 2325|  6.96M|#define NEXTL(l) do {							\
  |  | 2326|  6.96M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 6.96M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  6.96M|    } else ctxt->input->col++;						\
  |  | 2329|  6.96M|    ctxt->input->cur += l;				\
  |  | 2330|  6.96M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 6.96M]
  |  |  ------------------
  ------------------
 4755|  6.96M|        }
 4756|  7.03M|    }
 4757|  7.03M|}
parser.c:xmlFatalErrMsgStr:
  348|   618k|{
  349|   618k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  350|   618k|               val, NULL, NULL, 0, msg, val);
  351|   618k|}
parser.c:xmlParseCommentComplex:
 4856|   150k|                       size_t len, size_t size) {
 4857|   150k|    int q, ql;
 4858|   150k|    int r, rl;
 4859|   150k|    int cur, l;
 4860|   150k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (4860:21): [True: 55.3k, False: 95.1k]
  ------------------
 4861|  55.3k|                    XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  55.3k|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
 4862|   150k|                    XML_MAX_TEXT_LENGTH;
  ------------------
  |  |   50|  95.1k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 4863|       |
 4864|   150k|    if (buf == NULL) {
  ------------------
  |  Branch (4864:9): [True: 22.7k, False: 127k]
  ------------------
 4865|  22.7k|        len = 0;
 4866|  22.7k|	size = XML_PARSER_BUFFER_SIZE;
  ------------------
  |  |  172|  22.7k|#define XML_PARSER_BUFFER_SIZE 100
  ------------------
 4867|  22.7k|	buf = xmlMalloc(size);
 4868|  22.7k|	if (buf == NULL) {
  ------------------
  |  Branch (4868:6): [True: 1, False: 22.7k]
  ------------------
 4869|      1|	    xmlErrMemory(ctxt);
 4870|      1|	    return;
 4871|      1|	}
 4872|  22.7k|    }
 4873|   150k|    q = xmlCurrentCharRecover(ctxt, &ql);
 4874|   150k|    if (q == 0)
  ------------------
  |  Branch (4874:9): [True: 1.33k, False: 149k]
  ------------------
 4875|  1.33k|        goto not_terminated;
 4876|   149k|    if (!IS_CHAR(q)) {
  ------------------
  |  |  115|   149k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   149k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 82.3k, False: 66.8k]
  |  |  |  |  ------------------
  |  |  |  |  118|   149k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  82.3k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 82.0k, False: 295]
  |  |  |  |  |  |  |  Branch (108:44): [True: 78.2k, False: 3.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  82.3k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 4.05k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  82.3k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 3.51k, False: 543]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   149k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 66.8k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 10.5k, False: 56.2k]
  |  |  |  |  ------------------
  |  |  |  |  120|  66.8k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 56.2k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 55.5k, False: 715]
  |  |  |  |  ------------------
  |  |  |  |  121|  66.8k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 511, False: 204]
  |  |  |  |  |  Branch (121:27): [True: 511, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4876:9): [True: 747, False: 148k]
  ------------------
 4877|    747|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4878|    747|                          "xmlParseComment: invalid xmlChar value %d\n",
 4879|    747|	                  q);
 4880|    747|	xmlFree (buf);
 4881|    747|	return;
 4882|    747|    }
 4883|   148k|    NEXTL(ql);
  ------------------
  |  | 2325|   148k|#define NEXTL(l) do {							\
  |  | 2326|   148k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 293, False: 148k]
  |  |  ------------------
  |  | 2327|    293|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   148k|    } else ctxt->input->col++;						\
  |  | 2329|   148k|    ctxt->input->cur += l;				\
  |  | 2330|   148k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 148k]
  |  |  ------------------
  ------------------
 4884|   148k|    r = xmlCurrentCharRecover(ctxt, &rl);
 4885|   148k|    if (r == 0)
  ------------------
  |  Branch (4885:9): [True: 434, False: 147k]
  ------------------
 4886|    434|        goto not_terminated;
 4887|   147k|    if (!IS_CHAR(r)) {
  ------------------
  |  |  115|   147k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   147k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 115k, False: 32.7k]
  |  |  |  |  ------------------
  |  |  |  |  118|   147k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   115k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 114k, False: 373]
  |  |  |  |  |  |  |  Branch (108:44): [True: 96.4k, False: 18.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   115k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 18.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   115k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 18.4k, False: 431]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   147k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 32.7k, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 1.16k, False: 31.5k]
  |  |  |  |  ------------------
  |  |  |  |  120|  32.7k|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 31.5k, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 30.9k, False: 614]
  |  |  |  |  ------------------
  |  |  |  |  121|  32.7k|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 310, False: 304]
  |  |  |  |  |  Branch (121:27): [True: 310, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4887:9): [True: 735, False: 147k]
  ------------------
 4888|    735|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4889|    735|                          "xmlParseComment: invalid xmlChar value %d\n",
 4890|    735|	                  r);
 4891|    735|	xmlFree (buf);
 4892|    735|	return;
 4893|    735|    }
 4894|   147k|    NEXTL(rl);
  ------------------
  |  | 2325|   147k|#define NEXTL(l) do {							\
  |  | 2326|   147k|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 23.5k, False: 123k]
  |  |  ------------------
  |  | 2327|  23.5k|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|   123k|    } else ctxt->input->col++;						\
  |  | 2329|   147k|    ctxt->input->cur += l;				\
  |  | 2330|   147k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 147k]
  |  |  ------------------
  ------------------
 4895|   147k|    cur = xmlCurrentCharRecover(ctxt, &l);
 4896|   147k|    if (cur == 0)
  ------------------
  |  Branch (4896:9): [True: 498, False: 146k]
  ------------------
 4897|    498|        goto not_terminated;
 4898|  13.8M|    while (IS_CHAR(cur) && /* checked */
  ------------------
  |  |  115|  13.8M|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  27.7M|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:24): [True: 13.8M, False: 5.23k]
  |  |  |  |  |  Branch (117:25): [True: 11.6M, False: 2.22M]
  |  |  |  |  ------------------
  |  |  |  |  118|  27.7M|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  11.6M|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 11.6M, False: 4.66k]
  |  |  |  |  |  |  |  Branch (108:44): [True: 2.75M, False: 8.88M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  11.6M|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 8.89M]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  11.6M|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 8.88M, False: 4.78k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  27.7M|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 2.22M, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 145k, False: 2.07M]
  |  |  |  |  ------------------
  |  |  |  |  120|  2.22M|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 2.07M, False: 735]
  |  |  |  |  ------------------
  |  |  |  |  121|  2.22M|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 284, False: 451]
  |  |  |  |  |  Branch (121:27): [True: 284, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4899|  13.8M|           ((cur != '>') ||
  ------------------
  |  Branch (4899:13): [True: 13.4M, False: 388k]
  ------------------
 4900|  13.7M|	    (r != '-') || (q != '-'))) {
  ------------------
  |  Branch (4900:6): [True: 225k, False: 162k]
  |  Branch (4900:20): [True: 21.2k, False: 141k]
  ------------------
 4901|  13.7M|	if ((r == '-') && (q == '-')) {
  ------------------
  |  Branch (4901:6): [True: 721k, False: 13.0M]
  |  Branch (4901:20): [True: 363k, False: 357k]
  ------------------
 4902|   363k|	    xmlFatalErr(ctxt, XML_ERR_HYPHEN_IN_COMMENT, NULL);
 4903|   363k|	}
 4904|  13.7M|	if (len + 5 >= size) {
  ------------------
  |  Branch (4904:6): [True: 63.6k, False: 13.6M]
  ------------------
 4905|  63.6k|	    xmlChar *tmp;
 4906|  63.6k|            int newSize;
 4907|       |
 4908|  63.6k|	    newSize = xmlGrowCapacity(size, 1, 1, maxLength);
 4909|  63.6k|            if (newSize < 0) {
  ------------------
  |  Branch (4909:17): [True: 0, False: 63.6k]
  ------------------
 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|  63.6k|	    tmp = xmlRealloc(buf, newSize);
 4916|  63.6k|	    if (tmp == NULL) {
  ------------------
  |  Branch (4916:10): [True: 8, False: 63.6k]
  ------------------
 4917|      8|		xmlErrMemory(ctxt);
 4918|      8|		xmlFree(buf);
 4919|      8|		return;
 4920|      8|	    }
 4921|  63.6k|	    buf = tmp;
 4922|  63.6k|            size = newSize;
 4923|  63.6k|	}
 4924|  13.7M|	COPY_BUF(buf, len, q);
  ------------------
  |  | 2333|  13.7M|    if (v < 0x80) b[i++] = v;						\
  |  |  ------------------
  |  |  |  Branch (2333:9): [True: 11.0M, False: 2.69M]
  |  |  ------------------
  |  | 2334|  13.7M|    else i += xmlCopyCharMultiByte(&b[i],v)
  ------------------
 4925|       |
 4926|  13.7M|	q = r;
 4927|  13.7M|	ql = rl;
 4928|  13.7M|	r = cur;
 4929|  13.7M|	rl = l;
 4930|       |
 4931|  13.7M|	NEXTL(l);
  ------------------
  |  | 2325|  13.7M|#define NEXTL(l) do {							\
  |  | 2326|  13.7M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 2.11M, False: 11.6M]
  |  |  ------------------
  |  | 2327|  2.11M|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  11.6M|    } else ctxt->input->col++;						\
  |  | 2329|  13.7M|    ctxt->input->cur += l;				\
  |  | 2330|  13.7M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 13.7M]
  |  |  ------------------
  ------------------
 4932|  13.7M|	cur = xmlCurrentCharRecover(ctxt, &l);
 4933|       |
 4934|  13.7M|    }
 4935|   146k|    buf[len] = 0;
 4936|   146k|    if (cur == 0) {
  ------------------
  |  Branch (4936:9): [True: 4.24k, False: 142k]
  ------------------
 4937|  4.24k|	xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4938|  4.24k|	                     "Comment not terminated \n<!--%.50s\n", buf);
 4939|   142k|    } else if (!IS_CHAR(cur)) {
  ------------------
  |  |  115|   142k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|   142k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 142k, False: 451]
  |  |  |  |  ------------------
  |  |  |  |  118|   142k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|   142k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 141k, False: 422]
  |  |  |  |  |  |  |  Branch (108:44): [True: 0, False: 141k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|   142k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 0, False: 142k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|   142k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 141k, False: 535]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|   142k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 451, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 0, False: 451]
  |  |  |  |  ------------------
  |  |  |  |  120|    451|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 451, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 0, False: 451]
  |  |  |  |  ------------------
  |  |  |  |  121|    451|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 0, False: 451]
  |  |  |  |  |  Branch (121:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4939:16): [True: 986, False: 141k]
  ------------------
 4940|    986|        xmlFatalErrMsgInt(ctxt, XML_ERR_INVALID_CHAR,
 4941|    986|                          "xmlParseComment: invalid xmlChar value %d\n",
 4942|    986|	                  cur);
 4943|   141k|    } else {
 4944|   141k|        NEXT;
  ------------------
  |  | 2316|   141k|#define NEXT xmlNextChar(ctxt)
  ------------------
 4945|   141k|	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
  ------------------
  |  Branch (4945:6): [True: 141k, False: 0]
  |  Branch (4945:29): [True: 141k, False: 0]
  ------------------
 4946|   141k|	    (!ctxt->disableSAX))
  ------------------
  |  Branch (4946:6): [True: 136k, False: 5.33k]
  ------------------
 4947|   136k|	    ctxt->sax->comment(ctxt->userData, buf);
 4948|   141k|    }
 4949|   146k|    xmlFree(buf);
 4950|   146k|    return;
 4951|  2.26k|not_terminated:
 4952|  2.26k|    xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
 4953|       |			 "Comment not terminated\n", NULL);
 4954|  2.26k|    xmlFree(buf);
 4955|  2.26k|}
parser.c:xmlNsErr:
  384|   200k|{
  385|   200k|    ctxt->nsWellFormed = 0;
  386|       |
  387|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR,
  388|   200k|               info1, info2, info3, 0, msg, info1, info2, info3);
  389|   200k|}
parser.c:xmlSkipBlankCharsPE:
 2437|  1.23M|xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) {
 2438|  1.23M|    int res = 0;
 2439|  1.23M|    int inParam;
 2440|  1.23M|    int expandParam;
 2441|       |
 2442|  1.23M|    inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  1.23M|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 1.02M, False: 201k]
  |  |  ------------------
  |  |   51|  1.23M|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 136k, False: 892k]
  |  |  ------------------
  |  |   52|  1.02M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 892k, False: 0]
  |  |  ------------------
  ------------------
 2443|  1.23M|    expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  1.23M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 139k, False: 1.09M]
  |  |  ------------------
  |  |   56|  1.23M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 926k, False: 165k]
  |  |  ------------------
  |  |   57|  1.09M|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 889k, False: 36.7k]
  |  |  ------------------
  ------------------
 2444|       |
 2445|  1.23M|    if (!inParam && !expandParam)
  ------------------
  |  Branch (2445:9): [True: 201k, False: 1.02M]
  |  Branch (2445:21): [True: 165k, False: 36.6k]
  ------------------
 2446|   165k|        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.27M|    while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  2.27M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (2452:12): [True: 2.27M, False: 368]
  ------------------
 2453|  2.27M|        if (IS_BLANK_CH(CUR)) { /* CHECKED tstblanks.xml */
  ------------------
  |  |  137|  2.27M|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.27M|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 760k, False: 1.51M]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.27M|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.45M, False: 65.6k]
  |  |  |  |  |  Branch (91:23): [True: 381k, False: 1.06M]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.27M|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 40.5k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|  1.18M|            NEXT;
  ------------------
  |  | 2316|  1.18M|#define NEXT xmlNextChar(ctxt)
  ------------------
 2455|  1.18M|        } else if (CUR == '%') {
  ------------------
  |  | 2262|  1.09M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2455:20): [True: 96.3k, False: 997k]
  ------------------
 2456|  96.3k|            if ((expandParam == 0) ||
  ------------------
  |  Branch (2456:17): [True: 13, False: 96.3k]
  ------------------
 2457|  96.3k|                (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  |  137|  96.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  96.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 73.1k, False: 23.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|  96.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 20.8k, False: 2.29k]
  |  |  |  |  |  Branch (91:23): [True: 671, False: 20.1k]
  |  |  |  |  ------------------
  |  |  |  |   92|  96.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 234, False: 22.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (IS_BLANK_CH(NXT(1))) || (NXT(1) == 0))
  ------------------
  |  | 2263|  22.2k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (2457:42): [True: 2.29k, False: 19.9k]
  ------------------
 2458|  76.3k|                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|  19.9k|            xmlParsePERefInternal(ctxt, 0);
 2467|       |
 2468|  19.9k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  19.9k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 19.1k, False: 811]
  |  |  ------------------
  |  |   51|  19.9k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 4.73k, False: 14.3k]
  |  |  ------------------
  |  |   52|  19.1k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 14.3k, False: 0]
  |  |  ------------------
  ------------------
 2469|  19.9k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  19.9k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 3.86k, False: 16.0k]
  |  |  ------------------
  |  |   56|  19.9k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 16.0k, False: 0]
  |  |  ------------------
  |  |   57|  16.0k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 13.3k, False: 2.72k]
  |  |  ------------------
  ------------------
 2470|   997k|        } else if (CUR == 0) {
  ------------------
  |  | 2262|   997k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (2470:20): [True: 65.6k, False: 931k]
  ------------------
 2471|  65.6k|            if (inParam == 0)
  ------------------
  |  Branch (2471:17): [True: 162, False: 65.4k]
  ------------------
 2472|    162|                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|  65.4k|            if (ctxt->input->flags & XML_INPUT_MARKUP_DECL)
  ------------------
  |  |   42|  65.4k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
  |  Branch (2479:17): [True: 56.4k, False: 8.96k]
  ------------------
 2480|  56.4k|                break;
 2481|       |
 2482|  8.96k|            xmlPopPE(ctxt);
 2483|       |
 2484|  8.96k|            inParam = PARSER_IN_PE(ctxt);
  ------------------
  |  |   50|  8.96k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 6.89k, False: 2.07k]
  |  |  ------------------
  |  |   51|  8.96k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 3, False: 6.88k]
  |  |  ------------------
  |  |   52|  6.89k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 6.88k, False: 0]
  |  |  ------------------
  ------------------
 2485|  8.96k|            expandParam = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  8.96k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 2.56k, False: 6.40k]
  |  |  ------------------
  |  |   56|  8.96k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 6.39k, False: 3]
  |  |  ------------------
  |  |   57|  6.40k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 6.39k, False: 0]
  |  |  ------------------
  ------------------
 2486|   931k|        } else {
 2487|   931k|            break;
 2488|   931k|        }
 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.21M|        if (res < INT_MAX)
  ------------------
  |  Branch (2497:13): [True: 1.21M, False: 0]
  ------------------
 2498|  1.21M|            res++;
 2499|  1.21M|    }
 2500|       |
 2501|  1.06M|    return(res);
 2502|  1.23M|}
parser.c:xmlValidityError:
  294|   301k|{
  295|   301k|    ctxt->valid = 0;
  296|       |
  297|   301k|    xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR,
  298|       |               str1, str2, NULL, 0, msg, str1, str2);
  299|   301k|}
parser.c:xmlAddDefAttrs:
 1057|  24.7k|               const xmlChar *value) {
 1058|  24.7k|    xmlDefAttrsPtr defaults;
 1059|  24.7k|    xmlDefAttr *attr;
 1060|  24.7k|    int len, expandedSize;
 1061|  24.7k|    xmlHashedString name;
 1062|  24.7k|    xmlHashedString prefix;
 1063|  24.7k|    xmlHashedString hvalue;
 1064|  24.7k|    const xmlChar *localname;
 1065|       |
 1066|       |    /*
 1067|       |     * Allows to detect attribute redefinitions
 1068|       |     */
 1069|  24.7k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (1069:9): [True: 21.9k, False: 2.79k]
  ------------------
 1070|  21.9k|        if (xmlHashLookup2(ctxt->attsSpecial, fullname, fullattr) != NULL)
  ------------------
  |  Branch (1070:13): [True: 14.7k, False: 7.20k]
  ------------------
 1071|  14.7k|	    return;
 1072|  21.9k|    }
 1073|       |
 1074|  9.99k|    if (ctxt->attsDefault == NULL) {
  ------------------
  |  Branch (1074:9): [True: 2.90k, False: 7.09k]
  ------------------
 1075|  2.90k|        ctxt->attsDefault = xmlHashCreateDict(10, ctxt->dict);
 1076|  2.90k|	if (ctxt->attsDefault == NULL)
  ------------------
  |  Branch (1076:6): [True: 1, False: 2.90k]
  ------------------
 1077|      1|	    goto mem_error;
 1078|  2.90k|    }
 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|  9.99k|    localname = xmlSplitQName3(fullname, &len);
 1085|  9.99k|    if (localname == NULL) {
  ------------------
  |  Branch (1085:9): [True: 9.50k, False: 494]
  ------------------
 1086|  9.50k|        name = xmlDictLookupHashed(ctxt->dict, fullname, -1);
 1087|  9.50k|	prefix.name = NULL;
 1088|  9.50k|    } else {
 1089|    494|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1090|    494|	prefix = xmlDictLookupHashed(ctxt->dict, fullname, len);
 1091|    494|        if (prefix.name == NULL)
  ------------------
  |  Branch (1091:13): [True: 1, False: 493]
  ------------------
 1092|      1|            goto mem_error;
 1093|    494|    }
 1094|  9.99k|    if (name.name == NULL)
  ------------------
  |  Branch (1094:9): [True: 2, False: 9.99k]
  ------------------
 1095|      2|        goto mem_error;
 1096|       |
 1097|       |    /*
 1098|       |     * make sure there is some storage
 1099|       |     */
 1100|  9.99k|    defaults = xmlHashLookup2(ctxt->attsDefault, name.name, prefix.name);
 1101|  9.99k|    if ((defaults == NULL) ||
  ------------------
  |  Branch (1101:9): [True: 3.38k, False: 6.61k]
  ------------------
 1102|  6.61k|        (defaults->nbAttrs >= defaults->maxAttrs)) {
  ------------------
  |  Branch (1102:9): [True: 750, False: 5.86k]
  ------------------
 1103|  4.13k|        xmlDefAttrsPtr temp;
 1104|  4.13k|        int newSize;
 1105|       |
 1106|  4.13k|        if (defaults == NULL) {
  ------------------
  |  Branch (1106:13): [True: 3.38k, False: 750]
  ------------------
 1107|  3.38k|            newSize = 4;
 1108|  3.38k|        } else {
 1109|    750|            if ((defaults->maxAttrs >= XML_MAX_ATTRS) ||
  ------------------
  |  |   93|    750|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1109:17): [True: 0, False: 750]
  ------------------
 1110|    750|                ((size_t) defaults->maxAttrs >
  ------------------
  |  Branch (1110:17): [True: 0, False: 750]
  ------------------
 1111|    750|                     SIZE_MAX / 2 / sizeof(temp[0]) - sizeof(*defaults)))
 1112|      0|                goto mem_error;
 1113|       |
 1114|    750|            if (defaults->maxAttrs > XML_MAX_ATTRS / 2)
  ------------------
  |  |   93|    750|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (1114:17): [True: 0, False: 750]
  ------------------
 1115|      0|                newSize = XML_MAX_ATTRS;
  ------------------
  |  |   93|      0|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1116|    750|            else
 1117|    750|                newSize = defaults->maxAttrs * 2;
 1118|    750|        }
 1119|  4.13k|        temp = xmlRealloc(defaults,
 1120|  4.13k|                          sizeof(*defaults) + newSize * sizeof(xmlDefAttr));
 1121|  4.13k|	if (temp == NULL)
  ------------------
  |  Branch (1121:6): [True: 1, False: 4.13k]
  ------------------
 1122|      1|	    goto mem_error;
 1123|  4.13k|        if (defaults == NULL)
  ------------------
  |  Branch (1123:13): [True: 3.38k, False: 750]
  ------------------
 1124|  3.38k|            temp->nbAttrs = 0;
 1125|  4.13k|	temp->maxAttrs = newSize;
 1126|  4.13k|        defaults = temp;
 1127|  4.13k|	if (xmlHashUpdateEntry2(ctxt->attsDefault, name.name, prefix.name,
  ------------------
  |  Branch (1127:6): [True: 0, False: 4.13k]
  ------------------
 1128|  4.13k|	                        defaults, NULL) < 0) {
 1129|      0|	    xmlFree(defaults);
 1130|      0|	    goto mem_error;
 1131|      0|	}
 1132|  4.13k|    }
 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|  9.99k|    localname = xmlSplitQName3(fullattr, &len);
 1139|  9.99k|    if (localname == NULL) {
  ------------------
  |  Branch (1139:9): [True: 6.32k, False: 3.66k]
  ------------------
 1140|  6.32k|        name = xmlDictLookupHashed(ctxt->dict, fullattr, -1);
 1141|  6.32k|	prefix.name = NULL;
 1142|  6.32k|    } else {
 1143|  3.66k|        name = xmlDictLookupHashed(ctxt->dict, localname, -1);
 1144|  3.66k|	prefix = xmlDictLookupHashed(ctxt->dict, fullattr, len);
 1145|  3.66k|        if (prefix.name == NULL)
  ------------------
  |  Branch (1145:13): [True: 1, False: 3.66k]
  ------------------
 1146|      1|            goto mem_error;
 1147|  3.66k|    }
 1148|  9.99k|    if (name.name == NULL)
  ------------------
  |  Branch (1148:9): [True: 1, False: 9.99k]
  ------------------
 1149|      1|        goto mem_error;
 1150|       |
 1151|       |    /* intern the string and precompute the end */
 1152|  9.99k|    len = strlen((const char *) value);
 1153|  9.99k|    hvalue = xmlDictLookupHashed(ctxt->dict, value, len);
 1154|  9.99k|    if (hvalue.name == NULL)
  ------------------
  |  Branch (1154:9): [True: 1, False: 9.99k]
  ------------------
 1155|      1|        goto mem_error;
 1156|       |
 1157|  9.99k|    expandedSize = strlen((const char *) name.name);
 1158|  9.99k|    if (prefix.name != NULL)
  ------------------
  |  Branch (1158:9): [True: 3.66k, False: 6.32k]
  ------------------
 1159|  3.66k|        expandedSize += strlen((const char *) prefix.name);
 1160|  9.99k|    expandedSize += len;
 1161|       |
 1162|  9.99k|    attr = &defaults->attrs[defaults->nbAttrs++];
 1163|  9.99k|    attr->name = name;
 1164|  9.99k|    attr->prefix = prefix;
 1165|  9.99k|    attr->value = hvalue;
 1166|  9.99k|    attr->valueEnd = hvalue.name + len;
 1167|  9.99k|    attr->external = PARSER_EXTERNAL(ctxt);
  ------------------
  |  |   55|  9.99k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 507, False: 9.48k]
  |  |  ------------------
  |  |   56|  9.99k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 716, False: 8.76k]
  |  |  ------------------
  |  |   57|  9.48k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 634, False: 82]
  |  |  ------------------
  ------------------
 1168|  9.99k|    attr->expandedSize = expandedSize;
 1169|       |
 1170|  9.99k|    return;
 1171|       |
 1172|      8|mem_error:
 1173|      8|    xmlErrMemory(ctxt);
 1174|      8|}
parser.c:xmlAddSpecialAttr:
 1189|  47.1k|{
 1190|  47.1k|    if (ctxt->attsSpecial == NULL) {
  ------------------
  |  Branch (1190:9): [True: 3.54k, False: 43.5k]
  ------------------
 1191|  3.54k|        ctxt->attsSpecial = xmlHashCreateDict(10, ctxt->dict);
 1192|  3.54k|	if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1192:6): [True: 1, False: 3.54k]
  ------------------
 1193|      1|	    goto mem_error;
 1194|  3.54k|    }
 1195|       |
 1196|  47.1k|    if (PARSER_EXTERNAL(ctxt))
  ------------------
  |  |   55|  47.1k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 15.4k, False: 31.6k]
  |  |  ------------------
  |  |   56|  47.1k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 21.4k, False: 10.2k]
  |  |  ------------------
  |  |   57|  31.6k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 16.6k, False: 4.74k]
  |  |  ------------------
  ------------------
 1197|  32.1k|        type |= XML_SPECIAL_EXTERNAL;
  ------------------
  |  |   95|  32.1k|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
 1198|       |
 1199|  47.1k|    if (xmlHashAdd2(ctxt->attsSpecial, fullname, fullattr,
  ------------------
  |  Branch (1199:9): [True: 1, False: 47.1k]
  ------------------
 1200|  47.1k|                    XML_INT_TO_PTR(type)) < 0)
  ------------------
  |  |   59|  47.1k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 1201|      1|        goto mem_error;
 1202|  47.1k|    return;
 1203|       |
 1204|  47.1k|mem_error:
 1205|      2|    xmlErrMemory(ctxt);
 1206|      2|}
parser.c:xmlSkipBlankCharsPEBalanced:
 6124|   597k|xmlSkipBlankCharsPEBalanced(xmlParserCtxt *ctxt, int openInputNr) {
 6125|   597k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   597k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6126|   597k|    GROW;
  ------------------
  |  | 2308|   597k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   597k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   597k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 75.8k, False: 521k]
  |  |  ------------------
  |  | 2309|   597k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  75.8k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 54.5k, False: 21.2k]
  |  |  ------------------
  |  | 2310|   597k|	xmlParserGrow(ctxt);
  ------------------
 6127|       |
 6128|   597k|    (void) openInputNr;
 6129|       |
 6130|   597k|    if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   55|  1.19M|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 17.0k, False: 580k]
  |  |  ------------------
  |  |   56|  1.19M|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 57.6k, False: 522k]
  |  |  ------------------
  |  |   57|   580k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 35.5k, False: 22.1k]
  |  |  ------------------
  ------------------
                  if (!PARSER_EXTERNAL(ctxt) && !PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|   544k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 22.1k, False: 522k]
  |  |  ------------------
  |  |   51|   544k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 22.1k, False: 0]
  |  |  ------------------
  |  |   52|  22.1k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6131|   522k|        return;
 6132|       |
 6133|  83.2k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  83.2k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6133:12): [True: 82.9k, False: 238]
  ------------------
 6134|  82.9k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6134:13): [True: 2.70k, False: 80.2k]
  ------------------
 6135|  2.70k|#ifdef LIBXML_VALID_ENABLED
 6136|  2.70k|            if ((ctxt->validate) && (ctxt->inputNr <= openInputNr)) {
  ------------------
  |  Branch (6136:17): [True: 1.73k, False: 970]
  |  Branch (6136:37): [True: 680, False: 1.05k]
  ------------------
 6137|    680|                xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6138|    680|                                 "Element content declaration doesn't start "
 6139|    680|                                 "and stop in the same entity\n",
 6140|    680|                                 NULL, NULL);
 6141|    680|            }
 6142|  2.70k|#endif
 6143|  2.70k|            if (PARSER_IN_PE(ctxt))
  ------------------
  |  |   50|  2.70k|    (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (50:6): [True: 2.65k, False: 47]
  |  |  ------------------
  |  |   51|  2.70k|     (((ctxt)->input->entity->etype == XML_INTERNAL_PARAMETER_ENTITY) || \
  |  |  ------------------
  |  |  |  Branch (51:7): [True: 1.02k, False: 1.62k]
  |  |  ------------------
  |  |   52|  2.65k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (52:7): [True: 1.62k, False: 0]
  |  |  ------------------
  ------------------
 6144|  2.65k|                xmlPopPE(ctxt);
 6145|     47|            else
 6146|     47|                break;
 6147|  80.2k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  80.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6147:20): [True: 5.88k, False: 74.4k]
  ------------------
 6148|  5.88k|            xmlParsePERefInternal(ctxt, 0);
 6149|  74.4k|        } else {
 6150|  74.4k|            break;
 6151|  74.4k|        }
 6152|       |
 6153|  8.53k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  8.53k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6154|  8.53k|        GROW;
  ------------------
  |  | 2308|  8.53k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  8.53k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  8.53k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.01k, False: 2.52k]
  |  |  ------------------
  |  | 2309|  8.53k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.01k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.79k, False: 1.22k]
  |  |  ------------------
  |  | 2310|  8.53k|	xmlParserGrow(ctxt);
  ------------------
 6155|  8.53k|    }
 6156|  74.6k|}
parser.c:xmlParseElementChildrenContentDeclPriv:
 6308|  76.6k|                                       int depth) {
 6309|  76.6k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (6309:20): [True: 59.7k, False: 16.9k]
  ------------------
 6310|  76.6k|    xmlElementContentPtr ret = NULL, cur = NULL, last = NULL, op = NULL;
 6311|  76.6k|    const xmlChar *elem;
 6312|  76.6k|    xmlChar type = 0;
 6313|       |
 6314|  76.6k|    if (depth > maxDepth) {
  ------------------
  |  Branch (6314:9): [True: 3, False: 76.6k]
  ------------------
 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|  76.6k|    xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6321|  76.6k|    if (RAW == '(') {
  ------------------
  |  | 2261|  76.6k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6321:9): [True: 31.9k, False: 44.6k]
  ------------------
 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.8k, False: 2.13k]
  ------------------
 6329|  29.8k|            return(NULL);
 6330|  44.6k|    } else {
 6331|  44.6k|	elem = xmlParseName(ctxt);
 6332|  44.6k|	if (elem == NULL) {
  ------------------
  |  Branch (6332:6): [True: 445, False: 44.2k]
  ------------------
 6333|    445|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6334|    445|	    return(NULL);
 6335|    445|	}
 6336|  44.2k|        cur = ret = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6337|  44.2k|	if (cur == NULL) {
  ------------------
  |  Branch (6337:6): [True: 6, False: 44.2k]
  ------------------
 6338|      6|	    xmlErrMemory(ctxt);
 6339|      6|	    return(NULL);
 6340|      6|	}
 6341|  44.2k|	GROW;
  ------------------
  |  | 2308|  44.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  44.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  44.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.41k, False: 37.8k]
  |  |  ------------------
  |  | 2309|  44.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.41k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.05k, False: 2.35k]
  |  |  ------------------
  |  | 2310|  44.2k|	xmlParserGrow(ctxt);
  ------------------
 6342|  44.2k|	if (RAW == '?') {
  ------------------
  |  | 2261|  44.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6342:6): [True: 1.49k, False: 42.7k]
  ------------------
 6343|  1.49k|	    cur->ocur = XML_ELEMENT_CONTENT_OPT;
 6344|  1.49k|	    NEXT;
  ------------------
  |  | 2316|  1.49k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6345|  42.7k|	} else if (RAW == '*') {
  ------------------
  |  | 2261|  42.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6345:13): [True: 1.58k, False: 41.1k]
  ------------------
 6346|  1.58k|	    cur->ocur = XML_ELEMENT_CONTENT_MULT;
 6347|  1.58k|	    NEXT;
  ------------------
  |  | 2316|  1.58k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6348|  41.1k|	} else if (RAW == '+') {
  ------------------
  |  | 2261|  41.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6348:13): [True: 598, False: 40.5k]
  ------------------
 6349|    598|	    cur->ocur = XML_ELEMENT_CONTENT_PLUS;
 6350|    598|	    NEXT;
  ------------------
  |  | 2316|    598|#define NEXT xmlNextChar(ctxt)
  ------------------
 6351|  40.5k|	} else {
 6352|  40.5k|	    cur->ocur = XML_ELEMENT_CONTENT_ONCE;
 6353|  40.5k|	}
 6354|  44.2k|	GROW;
  ------------------
  |  | 2308|  44.2k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  44.2k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  44.2k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.41k, False: 37.8k]
  |  |  ------------------
  |  | 2309|  44.2k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.41k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.05k, False: 2.35k]
  |  |  ------------------
  |  | 2310|  44.2k|	xmlParserGrow(ctxt);
  ------------------
 6355|  44.2k|    }
 6356|   254k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   254k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6356:12): [True: 252k, False: 1.78k]
  ------------------
 6357|   252k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6358|   252k|        if (RAW == ')')
  ------------------
  |  | 2261|   252k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6358:13): [True: 42.2k, False: 210k]
  ------------------
 6359|  42.2k|            break;
 6360|       |        /*
 6361|       |	 * Each loop we parse one separator and one element.
 6362|       |	 */
 6363|   210k|        if (RAW == ',') {
  ------------------
  |  | 2261|   210k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6363:13): [True: 131k, False: 78.7k]
  ------------------
 6364|   131k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  7.87k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6364:10): [True: 7.87k, False: 123k]
  ------------------
 6365|       |
 6366|       |	    /*
 6367|       |	     * Detect "Name | Name , Name" error
 6368|       |	     */
 6369|   123k|	    else if (type != CUR) {
  ------------------
  |  | 2262|   123k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6369:15): [True: 1, False: 123k]
  ------------------
 6370|      1|		xmlFatalErrMsgInt(ctxt, XML_ERR_SEPARATOR_REQUIRED,
 6371|      1|		    "xmlParseElementChildrenContentDecl : '%c' expected\n",
 6372|      1|		                  type);
 6373|      1|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6373:7): [True: 1, False: 0]
  |  Branch (6373:25): [True: 1, False: 0]
  ------------------
 6374|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6375|      1|		if (ret != NULL)
  ------------------
  |  Branch (6375:7): [True: 1, False: 0]
  ------------------
 6376|      1|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6377|      1|		return(NULL);
 6378|      1|	    }
 6379|   131k|	    NEXT;
  ------------------
  |  | 2316|   131k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6380|       |
 6381|   131k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_SEQ);
 6382|   131k|	    if (op == NULL) {
  ------------------
  |  Branch (6382:10): [True: 3, False: 131k]
  ------------------
 6383|      3|                xmlErrMemory(ctxt);
 6384|      3|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6384:7): [True: 1, False: 2]
  |  Branch (6384:25): [True: 1, False: 0]
  ------------------
 6385|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6386|      3|	        xmlFreeDocElementContent(ctxt->myDoc, ret);
 6387|      3|		return(NULL);
 6388|      3|	    }
 6389|   131k|	    if (last == NULL) {
  ------------------
  |  Branch (6389:10): [True: 7.87k, False: 123k]
  ------------------
 6390|  7.87k|		op->c1 = ret;
 6391|  7.87k|		if (ret != NULL)
  ------------------
  |  Branch (6391:7): [True: 7.87k, False: 0]
  ------------------
 6392|  7.87k|		    ret->parent = op;
 6393|  7.87k|		ret = cur = op;
 6394|   123k|	    } else {
 6395|   123k|	        cur->c2 = op;
 6396|   123k|		if (op != NULL)
  ------------------
  |  Branch (6396:7): [True: 123k, False: 0]
  ------------------
 6397|   123k|		    op->parent = cur;
 6398|   123k|		op->c1 = last;
 6399|   123k|		if (last != NULL)
  ------------------
  |  Branch (6399:7): [True: 123k, False: 0]
  ------------------
 6400|   123k|		    last->parent = op;
 6401|   123k|		cur =op;
 6402|   123k|		last = NULL;
 6403|   123k|	    }
 6404|   131k|	} else if (RAW == '|') {
  ------------------
  |  | 2261|  78.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6404:13): [True: 77.0k, False: 1.67k]
  ------------------
 6405|  77.0k|	    if (type == 0) type = CUR;
  ------------------
  |  | 2262|  25.2k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6405:10): [True: 25.2k, False: 51.7k]
  ------------------
 6406|       |
 6407|       |	    /*
 6408|       |	     * Detect "Name , Name | Name" error
 6409|       |	     */
 6410|  51.7k|	    else if (type != CUR) {
  ------------------
  |  | 2262|  51.7k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (6410:15): [True: 1, False: 51.7k]
  ------------------
 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|  77.0k|	    NEXT;
  ------------------
  |  | 2316|  77.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6421|       |
 6422|  77.0k|	    op = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
 6423|  77.0k|	    if (op == NULL) {
  ------------------
  |  Branch (6423:10): [True: 3, False: 77.0k]
  ------------------
 6424|      3|                xmlErrMemory(ctxt);
 6425|      3|		if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6425:7): [True: 1, False: 2]
  |  Branch (6425:25): [True: 1, False: 0]
  ------------------
 6426|      1|		    xmlFreeDocElementContent(ctxt->myDoc, last);
 6427|      3|		if (ret != NULL)
  ------------------
  |  Branch (6427:7): [True: 3, False: 0]
  ------------------
 6428|      3|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6429|      3|		return(NULL);
 6430|      3|	    }
 6431|  77.0k|	    if (last == NULL) {
  ------------------
  |  Branch (6431:10): [True: 25.2k, False: 51.7k]
  ------------------
 6432|  25.2k|		op->c1 = ret;
 6433|  25.2k|		if (ret != NULL)
  ------------------
  |  Branch (6433:7): [True: 25.2k, False: 0]
  ------------------
 6434|  25.2k|		    ret->parent = op;
 6435|  25.2k|		ret = cur = op;
 6436|  51.7k|	    } else {
 6437|  51.7k|	        cur->c2 = op;
 6438|  51.7k|		if (op != NULL)
  ------------------
  |  Branch (6438:7): [True: 51.7k, False: 0]
  ------------------
 6439|  51.7k|		    op->parent = cur;
 6440|  51.7k|		op->c1 = last;
 6441|  51.7k|		if (last != NULL)
  ------------------
  |  Branch (6441:7): [True: 51.7k, False: 0]
  ------------------
 6442|  51.7k|		    last->parent = op;
 6443|  51.7k|		cur =op;
 6444|  51.7k|		last = NULL;
 6445|  51.7k|	    }
 6446|  77.0k|	} else {
 6447|  1.67k|	    xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_FINISHED, NULL);
 6448|  1.67k|	    if ((last != NULL) && (last != ret))
  ------------------
  |  Branch (6448:10): [True: 589, False: 1.09k]
  |  Branch (6448:28): [True: 589, False: 0]
  ------------------
 6449|    589|	        xmlFreeDocElementContent(ctxt->myDoc, last);
 6450|  1.67k|	    if (ret != NULL)
  ------------------
  |  Branch (6450:10): [True: 1.67k, False: 0]
  ------------------
 6451|  1.67k|		xmlFreeDocElementContent(ctxt->myDoc, ret);
 6452|  1.67k|	    return(NULL);
 6453|  1.67k|	}
 6454|   208k|        xmlSkipBlankCharsPEBalanced(ctxt, openInputNr);
 6455|   208k|        if (RAW == '(') {
  ------------------
  |  | 2261|   208k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6455:13): [True: 35.2k, False: 173k]
  ------------------
 6456|  35.2k|            int newInputNr = ctxt->inputNr;
 6457|       |
 6458|       |	    /* Recurse on second child */
 6459|  35.2k|	    NEXT;
  ------------------
  |  | 2316|  35.2k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6460|  35.2k|	    last = xmlParseElementChildrenContentDeclPriv(ctxt, newInputNr,
 6461|  35.2k|                                                          depth + 1);
 6462|  35.2k|            if (last == NULL) {
  ------------------
  |  Branch (6462:17): [True: 434, False: 34.7k]
  ------------------
 6463|    434|		if (ret != NULL)
  ------------------
  |  Branch (6463:7): [True: 434, False: 0]
  ------------------
 6464|    434|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6465|    434|		return(NULL);
 6466|    434|            }
 6467|   173k|	} else {
 6468|   173k|	    elem = xmlParseName(ctxt);
 6469|   173k|	    if (elem == NULL) {
  ------------------
  |  Branch (6469:10): [True: 242, False: 173k]
  ------------------
 6470|    242|		xmlFatalErr(ctxt, XML_ERR_ELEMCONTENT_NOT_STARTED, NULL);
 6471|    242|		if (ret != NULL)
  ------------------
  |  Branch (6471:7): [True: 242, False: 0]
  ------------------
 6472|    242|		    xmlFreeDocElementContent(ctxt->myDoc, ret);
 6473|    242|		return(NULL);
 6474|    242|	    }
 6475|   173k|	    last = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
 6476|   173k|	    if (last == NULL) {
  ------------------
  |  Branch (6476:10): [True: 2, False: 173k]
  ------------------
 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|   173k|	    if (RAW == '?') {
  ------------------
  |  | 2261|   173k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6482:10): [True: 13.0k, False: 160k]
  ------------------
 6483|  13.0k|		last->ocur = XML_ELEMENT_CONTENT_OPT;
 6484|  13.0k|		NEXT;
  ------------------
  |  | 2316|  13.0k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6485|   160k|	    } else if (RAW == '*') {
  ------------------
  |  | 2261|   160k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6485:17): [True: 13.5k, False: 146k]
  ------------------
 6486|  13.5k|		last->ocur = XML_ELEMENT_CONTENT_MULT;
 6487|  13.5k|		NEXT;
  ------------------
  |  | 2316|  13.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6488|   146k|	    } else if (RAW == '+') {
  ------------------
  |  | 2261|   146k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6488:17): [True: 19.5k, False: 126k]
  ------------------
 6489|  19.5k|		last->ocur = XML_ELEMENT_CONTENT_PLUS;
 6490|  19.5k|		NEXT;
  ------------------
  |  | 2316|  19.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6491|   126k|	    } else {
 6492|   126k|		last->ocur = XML_ELEMENT_CONTENT_ONCE;
 6493|   126k|	    }
 6494|   173k|	}
 6495|   208k|    }
 6496|  43.9k|    if ((cur != NULL) && (last != NULL)) {
  ------------------
  |  Branch (6496:9): [True: 43.9k, False: 0]
  |  Branch (6496:26): [True: 31.8k, False: 12.1k]
  ------------------
 6497|  31.8k|        cur->c2 = last;
 6498|  31.8k|	if (last != NULL)
  ------------------
  |  Branch (6498:6): [True: 31.8k, False: 0]
  ------------------
 6499|  31.8k|	    last->parent = cur;
 6500|  31.8k|    }
 6501|  43.9k|#ifdef LIBXML_VALID_ENABLED
 6502|  43.9k|    if ((ctxt->validate) && (ctxt->inputNr > openInputNr)) {
  ------------------
  |  Branch (6502:9): [True: 38.2k, False: 5.73k]
  |  Branch (6502:29): [True: 102, False: 38.1k]
  ------------------
 6503|    102|        xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
 6504|    102|                         "Element content declaration doesn't start "
 6505|    102|                         "and stop in the same entity\n",
 6506|    102|                         NULL, NULL);
 6507|    102|    }
 6508|  43.9k|#endif
 6509|  43.9k|    NEXT;
  ------------------
  |  | 2316|  43.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6510|  43.9k|    if (RAW == '?') {
  ------------------
  |  | 2261|  43.9k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6510:9): [True: 6.82k, False: 37.1k]
  ------------------
 6511|  6.82k|	if (ret != NULL) {
  ------------------
  |  Branch (6511:6): [True: 6.82k, False: 0]
  ------------------
 6512|  6.82k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_PLUS) ||
  ------------------
  |  Branch (6512:10): [True: 83, False: 6.73k]
  ------------------
 6513|  6.73k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6513:10): [True: 78, False: 6.66k]
  ------------------
 6514|    161|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6515|  6.66k|	    else
 6516|  6.66k|	        ret->ocur = XML_ELEMENT_CONTENT_OPT;
 6517|  6.82k|	}
 6518|  6.82k|	NEXT;
  ------------------
  |  | 2316|  6.82k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6519|  37.1k|    } else if (RAW == '*') {
  ------------------
  |  | 2261|  37.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6519:16): [True: 14.9k, False: 22.1k]
  ------------------
 6520|  14.9k|	if (ret != NULL) {
  ------------------
  |  Branch (6520:6): [True: 14.9k, False: 0]
  ------------------
 6521|  14.9k|	    ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6522|  14.9k|	    cur = ret;
 6523|       |	    /*
 6524|       |	     * Some normalization:
 6525|       |	     * (a | b* | c?)* == (a | b | c)*
 6526|       |	     */
 6527|  60.2k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6527:13): [True: 60.2k, False: 0]
  |  Branch (6527:30): [True: 45.2k, False: 14.9k]
  ------------------
 6528|  45.2k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6528:7): [True: 45.2k, False: 0]
  ------------------
 6529|  45.2k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6529:15): [True: 388, False: 44.8k]
  ------------------
 6530|  44.8k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6530:8): [True: 529, False: 44.3k]
  ------------------
 6531|    917|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6532|  45.2k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6532:7): [True: 45.2k, False: 0]
  ------------------
 6533|  45.2k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6533:15): [True: 137, False: 45.1k]
  ------------------
 6534|  45.1k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT)))
  ------------------
  |  Branch (6534:8): [True: 19, False: 45.1k]
  ------------------
 6535|    156|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6536|  45.2k|		cur = cur->c2;
 6537|  45.2k|	    }
 6538|  14.9k|	}
 6539|  14.9k|	NEXT;
  ------------------
  |  | 2316|  14.9k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6540|  22.1k|    } else if (RAW == '+') {
  ------------------
  |  | 2261|  22.1k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6540:16): [True: 5.03k, False: 17.1k]
  ------------------
 6541|  5.03k|	if (ret != NULL) {
  ------------------
  |  Branch (6541:6): [True: 5.03k, False: 0]
  ------------------
 6542|  5.03k|	    int found = 0;
 6543|       |
 6544|  5.03k|	    if ((ret->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6544:10): [True: 295, False: 4.74k]
  ------------------
 6545|  4.74k|	        (ret->ocur == XML_ELEMENT_CONTENT_MULT))
  ------------------
  |  Branch (6545:10): [True: 74, False: 4.66k]
  ------------------
 6546|    369|	        ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6547|  4.66k|	    else
 6548|  4.66k|	        ret->ocur = XML_ELEMENT_CONTENT_PLUS;
 6549|       |	    /*
 6550|       |	     * Some normalization:
 6551|       |	     * (a | b*)+ == (a | b)*
 6552|       |	     * (a | b?)+ == (a | b)*
 6553|       |	     */
 6554|  9.36k|	    while ((cur != NULL) && (cur->type == XML_ELEMENT_CONTENT_OR)) {
  ------------------
  |  Branch (6554:13): [True: 9.36k, False: 0]
  |  Branch (6554:30): [True: 4.33k, False: 5.03k]
  ------------------
 6555|  4.33k|		if ((cur->c1 != NULL) &&
  ------------------
  |  Branch (6555:7): [True: 4.33k, False: 0]
  ------------------
 6556|  4.33k|	            ((cur->c1->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6556:15): [True: 202, False: 4.13k]
  ------------------
 6557|  4.13k|		     (cur->c1->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6557:8): [True: 302, False: 3.82k]
  ------------------
 6558|    504|		    cur->c1->ocur = XML_ELEMENT_CONTENT_ONCE;
 6559|    504|		    found = 1;
 6560|    504|		}
 6561|  4.33k|		if ((cur->c2 != NULL) &&
  ------------------
  |  Branch (6561:7): [True: 4.33k, False: 0]
  ------------------
 6562|  4.33k|	            ((cur->c2->ocur == XML_ELEMENT_CONTENT_OPT) ||
  ------------------
  |  Branch (6562:15): [True: 68, False: 4.26k]
  ------------------
 6563|  4.26k|		     (cur->c2->ocur == XML_ELEMENT_CONTENT_MULT))) {
  ------------------
  |  Branch (6563:8): [True: 18, False: 4.24k]
  ------------------
 6564|     86|		    cur->c2->ocur = XML_ELEMENT_CONTENT_ONCE;
 6565|     86|		    found = 1;
 6566|     86|		}
 6567|  4.33k|		cur = cur->c2;
 6568|  4.33k|	    }
 6569|  5.03k|	    if (found)
  ------------------
  |  Branch (6569:10): [True: 466, False: 4.56k]
  ------------------
 6570|    466|		ret->ocur = XML_ELEMENT_CONTENT_MULT;
 6571|  5.03k|	}
 6572|  5.03k|	NEXT;
  ------------------
  |  | 2316|  5.03k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6573|  5.03k|    }
 6574|  43.9k|    return(ret);
 6575|  46.3k|}
parser.c:xmlCtxtInitializeLate:
  897|  50.0k|xmlCtxtInitializeLate(xmlParserCtxtPtr ctxt) {
  898|  50.0k|    xmlSAXHandlerPtr sax;
  899|       |
  900|       |    /* Avoid unused variable warning if features are disabled. */
  901|  50.0k|    (void) sax;
  902|       |
  903|       |    /*
  904|       |     * Changing the SAX struct directly is still widespread practice
  905|       |     * in internal and external code.
  906|       |     */
  907|  50.0k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (907:9): [True: 0, False: 50.0k]
  ------------------
  908|  50.0k|    sax = ctxt->sax;
  909|  50.0k|#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|  50.0k|    if (((ctxt->options & XML_PARSE_SAX1) == 0) &&
  ------------------
  |  Branch (914:9): [True: 28.5k, False: 21.4k]
  ------------------
  915|  28.5k|        (sax) &&
  ------------------
  |  Branch (915:9): [True: 28.5k, False: 0]
  ------------------
  916|  28.5k|        (sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|  28.5k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (916:9): [True: 28.5k, False: 0]
  ------------------
  917|  28.5k|        ((sax->startElementNs != NULL) ||
  ------------------
  |  Branch (917:10): [True: 28.5k, 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|  28.5k|        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|  50.0k|    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
  ------------------
  |  |   34|  50.0k|#define BAD_CAST (xmlChar *)
  ------------------
  930|  50.0k|    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
  ------------------
  |  |   34|  50.0k|#define BAD_CAST (xmlChar *)
  ------------------
  931|  50.0k|    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
  ------------------
  |  |  146|  50.0k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  932|  50.0k|    if ((ctxt->str_xml==NULL) || (ctxt->str_xmlns==NULL) ||
  ------------------
  |  Branch (932:9): [True: 14, False: 50.0k]
  |  Branch (932:34): [True: 0, False: 50.0k]
  ------------------
  933|  50.0k|		(ctxt->str_xml_ns == NULL)) {
  ------------------
  |  Branch (933:3): [True: 0, False: 50.0k]
  ------------------
  934|     14|        xmlErrMemory(ctxt);
  935|     14|    }
  936|       |
  937|  50.0k|    xmlDictSetLimit(ctxt->dict,
  938|  50.0k|                    (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (938:21): [True: 24.4k, False: 25.5k]
  ------------------
  939|  24.4k|                        0 :
  940|  50.0k|                        XML_MAX_DICTIONARY_LIMIT);
  ------------------
  |  |   73|  75.6k|#define XML_MAX_DICTIONARY_LIMIT 100000000
  ------------------
  941|       |
  942|  50.0k|#ifdef LIBXML_VALID_ENABLED
  943|  50.0k|    if (ctxt->validate)
  ------------------
  |  Branch (943:9): [True: 24.0k, False: 26.0k]
  ------------------
  944|  24.0k|        ctxt->vctxt.flags |= XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  24.0k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  945|  26.0k|    else
  946|  26.0k|        ctxt->vctxt.flags &= ~XML_VCTXT_VALIDATE;
  ------------------
  |  |   24|  26.0k|#define XML_VCTXT_VALIDATE (1u << 2)
  ------------------
  947|  50.0k|#endif /* LIBXML_VALID_ENABLED */
  948|  50.0k|}
parser.c:xmlPopPE:
 2384|   115k|xmlPopPE(xmlParserCtxtPtr ctxt) {
 2385|   115k|    unsigned long consumed;
 2386|   115k|    xmlEntityPtr ent;
 2387|       |
 2388|   115k|    ent = ctxt->input->entity;
 2389|       |
 2390|   115k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|   115k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 2391|       |
 2392|   115k|    if ((ent->flags & XML_ENT_CHECKED) == 0) {
  ------------------
  |  |   20|   115k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (2392:9): [True: 4.83k, False: 111k]
  ------------------
 2393|  4.83k|        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.06k|        do {
 2400|  5.06k|            ctxt->input->cur = ctxt->input->end;
 2401|  5.06k|            xmlParserShrink(ctxt);
 2402|  5.06k|            result = xmlParserGrow(ctxt);
 2403|  5.06k|        } while (result > 0);
  ------------------
  |  Branch (2403:18): [True: 229, False: 4.83k]
  ------------------
 2404|       |
 2405|  4.83k|        consumed = ctxt->input->consumed;
 2406|  4.83k|        xmlSaturatedAddSizeT(&consumed,
 2407|  4.83k|                             ctxt->input->end - ctxt->input->base);
 2408|       |
 2409|  4.83k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
 2410|       |
 2411|       |        /*
 2412|       |         * Add to sizeentities when parsing an external entity
 2413|       |         * for the first time.
 2414|       |         */
 2415|  4.83k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (2415:13): [True: 3.63k, False: 1.19k]
  ------------------
 2416|  3.63k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
 2417|  3.63k|        }
 2418|       |
 2419|  4.83k|        ent->flags |= XML_ENT_CHECKED;
  ------------------
  |  |   20|  4.83k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
 2420|  4.83k|    }
 2421|       |
 2422|   115k|    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 2423|       |
 2424|   115k|    xmlParserEntityCheck(ctxt, ent->expandedSize);
 2425|       |
 2426|   115k|    GROW;
  ------------------
  |  | 2308|   115k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   115k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   115k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 103k, False: 12.5k]
  |  |  ------------------
  |  | 2309|   115k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   103k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 74.6k, False: 28.8k]
  |  |  ------------------
  |  | 2310|   115k|	xmlParserGrow(ctxt);
  ------------------
 2427|   115k|}
parser.c:xmlParseConditionalSections:
 6783|  6.12k|xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
 6784|  6.12k|    size_t depth = 0;
 6785|  6.12k|    int isFreshPE = 0;
 6786|  6.12k|    int oldInputNr = ctxt->inputNr;
 6787|  6.12k|    int declInputNr = ctxt->inputNr;
 6788|       |
 6789|  12.9k|    while (!PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|  12.9k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6789:12): [True: 12.9k, False: 8]
  ------------------
 6790|  12.9k|        if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (6790:13): [True: 708, False: 12.2k]
  ------------------
 6791|    708|            if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (6791:17): [True: 419, False: 289]
  ------------------
 6792|    419|                xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6793|    419|                return;
 6794|    419|            }
 6795|       |
 6796|    289|            xmlPopPE(ctxt);
 6797|    289|            declInputNr = ctxt->inputNr;
 6798|  12.2k|        } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|  12.2k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  8.85k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  8.47k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6798:20): [True: 8.85k, False: 3.37k]
  |  Branch (6798:36): [True: 8.47k, False: 371]
  |  Branch (6798:55): [True: 6.80k, False: 1.67k]
  ------------------
 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: 260, False: 6.54k]
  |  |  ------------------
  |  | 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.16k, False: 633]
  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 3.36k, False: 2.80k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2269|  6.80k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 3.35k, False: 4]
  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 3.35k, False: 4]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2271:34): [True: 3.35k, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2273:38): [True: 3.35k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2275:42): [True: 3.34k, False: 2]
  |  |  ------------------
  ------------------
 6805|  3.34k|                SKIP(7);
  ------------------
  |  | 2285|  3.34k|#define SKIP(val) do {							\
  |  | 2286|  3.34k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  3.34k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 54, False: 3.29k]
  |  |  ------------------
  |  | 2288|  3.34k|        xmlParserGrow(ctxt);						\
  |  | 2289|  3.34k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 3.34k]
  |  |  ------------------
  ------------------
 6806|  3.34k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  3.34k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6807|  3.34k|                if (RAW != '[') {
  ------------------
  |  | 2261|  3.34k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6807:21): [True: 253, False: 3.09k]
  ------------------
 6808|    253|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6809|    253|                    return;
 6810|    253|                }
 6811|  3.09k|#ifdef LIBXML_VALID_ENABLED
 6812|  3.09k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6812:21): [True: 1.43k, False: 1.65k]
  |  Branch (6812:41): [True: 45, False: 1.39k]
  ------------------
 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.09k|#endif
 6819|  3.09k|                NEXT;
  ------------------
  |  | 2316|  3.09k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6820|       |
 6821|  3.09k|                depth++;
 6822|  3.45k|            } else if (CMP6(CUR_PTR, 'I', 'G', 'N', 'O', 'R', 'E')) {
  ------------------
  |  | 2273|  3.45k|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  ------------------
  |  |  |  | 2271|  6.90k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2268|  6.90k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2268:5): [True: 2.82k, False: 633]
  |  |  |  |  |  |  |  Branch (2268:41): [True: 2.80k, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2269|  3.45k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2269:5): [True: 2.79k, False: 3]
  |  |  |  |  |  |  |  Branch (2269:41): [True: 2.79k, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2271:34): [True: 2.79k, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2273:38): [True: 2.79k, False: 1]
  |  |  ------------------
  ------------------
 6823|  2.79k|                size_t ignoreDepth = 0;
 6824|       |
 6825|  2.79k|                SKIP(6);
  ------------------
  |  | 2285|  2.79k|#define SKIP(val) do {							\
  |  | 2286|  2.79k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.79k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 251, False: 2.54k]
  |  |  ------------------
  |  | 2288|  2.79k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.79k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.79k]
  |  |  ------------------
  ------------------
 6826|  2.79k|                SKIP_BLANKS_PE;
  ------------------
  |  | 2314|  2.79k|#define SKIP_BLANKS_PE xmlSkipBlankCharsPE(ctxt)
  ------------------
 6827|  2.79k|                if (RAW != '[') {
  ------------------
  |  | 2261|  2.79k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6827:21): [True: 769, False: 2.02k]
  ------------------
 6828|    769|                    xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
 6829|    769|                    return;
 6830|    769|                }
 6831|  2.02k|#ifdef LIBXML_VALID_ENABLED
 6832|  2.02k|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6832:21): [True: 1.24k, False: 781]
  |  Branch (6832:41): [True: 7, False: 1.23k]
  ------------------
 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.02k|#endif
 6839|  2.02k|                NEXT;
  ------------------
  |  | 2316|  2.02k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6840|       |
 6841|  46.2k|                while (PARSER_STOPPED(ctxt) == 0) {
  ------------------
  |  |   44|  46.2k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (6841:24): [True: 46.2k, False: 3]
  ------------------
 6842|  46.2k|                    if (RAW == 0) {
  ------------------
  |  | 2261|  46.2k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6842:25): [True: 1.28k, False: 44.9k]
  ------------------
 6843|  1.28k|                        xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
 6844|  1.28k|                        return;
 6845|  1.28k|                    }
 6846|  44.9k|                    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|  44.9k|#define RAW (*ctxt->input->cur)
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  2.47k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                  if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|  1.02k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6846:25): [True: 2.47k, False: 42.5k]
  |  Branch (6846:41): [True: 1.02k, False: 1.44k]
  |  Branch (6846:60): [True: 647, False: 379]
  ------------------
 6847|    647|                        SKIP(3);
  ------------------
  |  | 2285|    647|#define SKIP(val) do {							\
  |  | 2286|    647|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    647|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 155, False: 492]
  |  |  ------------------
  |  | 2288|    647|        xmlParserGrow(ctxt);						\
  |  | 2289|    647|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 647]
  |  |  ------------------
  ------------------
 6848|    647|                        ignoreDepth++;
 6849|       |                        /* Check for integer overflow */
 6850|    647|                        if (ignoreDepth == 0) {
  ------------------
  |  Branch (6850:29): [True: 0, False: 647]
  ------------------
 6851|      0|                            xmlErrMemory(ctxt);
 6852|      0|                            return;
 6853|      0|                        }
 6854|  44.3k|                    } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2261|  44.3k|#define RAW (*ctxt->input->cur)
  ------------------
                                  } else if ((RAW == ']') && (NXT(1) == ']') &&
  ------------------
  |  | 2263|  3.08k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6854:32): [True: 3.08k, False: 41.2k]
  |  Branch (6854:48): [True: 1.29k, False: 1.78k]
  ------------------
 6855|  1.29k|                               (NXT(2) == '>')) {
  ------------------
  |  | 2263|  1.29k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6855:32): [True: 949, False: 349]
  ------------------
 6856|    949|                        SKIP(3);
  ------------------
  |  | 2285|    949|#define SKIP(val) do {							\
  |  | 2286|    949|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|    949|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 262, False: 687]
  |  |  ------------------
  |  | 2288|    949|        xmlParserGrow(ctxt);						\
  |  | 2289|    949|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 949]
  |  |  ------------------
  ------------------
 6857|    949|                        if (ignoreDepth == 0)
  ------------------
  |  Branch (6857:29): [True: 735, False: 214]
  ------------------
 6858|    735|                            break;
 6859|    214|                        ignoreDepth--;
 6860|  43.3k|                    } else {
 6861|  43.3k|                        NEXT;
  ------------------
  |  | 2316|  43.3k|#define NEXT xmlNextChar(ctxt)
  ------------------
 6862|  43.3k|                    }
 6863|  44.9k|                }
 6864|       |
 6865|    738|#ifdef LIBXML_VALID_ENABLED
 6866|    738|                if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6866:21): [True: 436, False: 302]
  |  Branch (6866:41): [True: 6, False: 430]
  ------------------
 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|    738|#endif
 6873|    738|            } else {
 6874|    661|                xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID_KEYWORD, NULL);
 6875|    661|                return;
 6876|    661|            }
 6877|  6.80k|        } else if ((depth > 0) &&
  ------------------
  |  Branch (6877:20): [True: 5.42k, False: 0]
  ------------------
 6878|  5.42k|                   (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2261|  5.42k|#define RAW (*ctxt->input->cur)
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.20k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                 (RAW == ']') && (NXT(1) == ']') && (NXT(2) == '>')) {
  ------------------
  |  | 2263|  2.19k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6878:20): [True: 2.20k, False: 3.22k]
  |  Branch (6878:36): [True: 2.19k, False: 8]
  |  Branch (6878:55): [True: 2.19k, False: 1]
  ------------------
 6879|  2.19k|            if (isFreshPE) {
  ------------------
  |  Branch (6879:17): [True: 1, False: 2.19k]
  ------------------
 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.19k|            depth--;
 6887|  2.19k|#ifdef LIBXML_VALID_ENABLED
 6888|  2.19k|            if ((ctxt->validate) && (ctxt->inputNr > declInputNr)) {
  ------------------
  |  Branch (6888:17): [True: 885, False: 1.31k]
  |  Branch (6888:37): [True: 31, False: 854]
  ------------------
 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.19k|#endif
 6895|  2.19k|            SKIP(3);
  ------------------
  |  | 2285|  2.19k|#define SKIP(val) do {							\
  |  | 2286|  2.19k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|  2.19k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.15k, False: 1.04k]
  |  |  ------------------
  |  | 2288|  2.19k|        xmlParserGrow(ctxt);						\
  |  | 2289|  2.19k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 2.19k]
  |  |  ------------------
  ------------------
 6896|  3.22k|        } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|  3.22k|#define RAW (*ctxt->input->cur)
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  2.04k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                      } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|    371|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (6896:20): [True: 2.04k, False: 1.18k]
  |  Branch (6896:37): [True: 1.67k, False: 371]
  |  Branch (6896:56): [True: 367, False: 4]
  ------------------
 6897|  2.04k|            isFreshPE = 0;
 6898|  2.04k|            xmlParseMarkupDecl(ctxt);
 6899|  2.04k|        } else if (RAW == '%') {
  ------------------
  |  | 2261|  1.18k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (6899:20): [True: 1.13k, False: 54]
  ------------------
 6900|  1.13k|            xmlParsePERefInternal(ctxt, 1);
 6901|  1.13k|            if (ctxt->inputNr > declInputNr) {
  ------------------
  |  Branch (6901:17): [True: 289, False: 842]
  ------------------
 6902|    289|                isFreshPE = 1;
 6903|    289|                declInputNr = ctxt->inputNr;
 6904|    289|            }
 6905|  1.13k|        } else {
 6906|     54|            xmlFatalErr(ctxt, XML_ERR_EXT_SUBSET_NOT_FINISHED, NULL);
 6907|     54|            return;
 6908|     54|        }
 6909|       |
 6910|  9.49k|        if (depth == 0)
  ------------------
  |  Branch (6910:13): [True: 2.67k, False: 6.82k]
  ------------------
 6911|  2.67k|            break;
 6912|       |
 6913|  6.82k|        SKIP_BLANKS;
  ------------------
  |  | 2312|  6.82k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 6914|  6.82k|        SHRINK;
  ------------------
  |  | 2304|  6.82k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.82k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.82k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 6.73k, False: 92]
  |  |  ------------------
  |  | 2305|  6.82k|	xmlParserShrink(ctxt);
  ------------------
 6915|  6.82k|        GROW;
  ------------------
  |  | 2308|  6.82k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.82k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.82k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.73k, False: 92]
  |  |  ------------------
  |  | 2309|  6.82k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.73k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 4.75k, False: 1.97k]
  |  |  ------------------
  |  | 2310|  6.82k|	xmlParserGrow(ctxt);
  ------------------
 6916|  6.82k|    }
 6917|  6.12k|}
parser.c:xmlParserEntityCheck:
  435|  3.29M|{
  436|  3.29M|    unsigned long consumed;
  437|  3.29M|    unsigned long *expandedSize;
  438|  3.29M|    xmlParserInputPtr input = ctxt->input;
  439|  3.29M|    xmlEntityPtr entity = input->entity;
  440|       |
  441|  3.29M|    if ((entity) && (entity->flags & XML_ENT_CHECKED))
  ------------------
  |  |   20|   640k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (441:9): [True: 640k, False: 2.65M]
  |  Branch (441:21): [True: 411k, False: 229k]
  ------------------
  442|   411k|        return(0);
  443|       |
  444|       |    /*
  445|       |     * Compute total consumed bytes so far, including input streams of
  446|       |     * external entities.
  447|       |     */
  448|  2.88M|    consumed = input->consumed;
  449|  2.88M|    xmlSaturatedAddSizeT(&consumed, input->cur - input->base);
  450|  2.88M|    xmlSaturatedAdd(&consumed, ctxt->sizeentities);
  451|       |
  452|  2.88M|    if (entity)
  ------------------
  |  Branch (452:9): [True: 229k, False: 2.65M]
  ------------------
  453|   229k|        expandedSize = &entity->expandedSize;
  454|  2.65M|    else
  455|  2.65M|        expandedSize = &ctxt->sizeentcopy;
  456|       |
  457|       |    /*
  458|       |     * Add extra cost and some fixed cost.
  459|       |     */
  460|  2.88M|    xmlSaturatedAdd(expandedSize, extra);
  461|  2.88M|    xmlSaturatedAdd(expandedSize, XML_ENT_FIXED_COST);
  ------------------
  |  |  169|  2.88M|#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.88M|    if ((ctxt->maxAmpl > 0) &&
  ------------------
  |  Branch (468:9): [True: 2.88M, False: 0]
  ------------------
  469|  2.88M|        (*expandedSize > XML_PARSER_ALLOWED_EXPANSION) &&
  ------------------
  |  |  162|  2.88M|#define XML_PARSER_ALLOWED_EXPANSION 1000000
  ------------------
  |  Branch (469:9): [True: 949k, False: 1.93M]
  ------------------
  470|   949k|        ((*expandedSize >= ULONG_MAX) ||
  ------------------
  |  Branch (470:10): [True: 0, False: 949k]
  ------------------
  471|   949k|         (*expandedSize / ctxt->maxAmpl > consumed))) {
  ------------------
  |  Branch (471:10): [True: 291, False: 949k]
  ------------------
  472|    291|        xmlFatalErrMsg(ctxt, XML_ERR_RESOURCE_LIMIT,
  473|    291|                       "Maximum entity amplification factor exceeded, see "
  474|    291|                       "xmlCtxtSetMaxAmplification.\n");
  475|    291|        return(1);
  476|    291|    }
  477|       |
  478|  2.88M|    return(0);
  479|  2.88M|}
parser.c:xmlLookupGeneralEntity:
 7432|  4.31M|xmlLookupGeneralEntity(xmlParserCtxtPtr ctxt, const xmlChar *name, int inAttr) {
 7433|  4.31M|    xmlEntityPtr ent = NULL;
 7434|       |
 7435|       |    /*
 7436|       |     * Predefined entities override any extra definition
 7437|       |     */
 7438|  4.31M|    if ((ctxt->options & XML_PARSE_OLDSAX) == 0) {
  ------------------
  |  Branch (7438:9): [True: 1.79M, False: 2.51M]
  ------------------
 7439|  1.79M|        ent = xmlGetPredefinedEntity(name);
 7440|  1.79M|        if (ent != NULL)
  ------------------
  |  Branch (7440:13): [True: 678k, False: 1.11M]
  ------------------
 7441|   678k|            return(ent);
 7442|  1.79M|    }
 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.63M|    if (ctxt->sax != NULL) {
  ------------------
  |  Branch (7448:9): [True: 3.63M, False: 0]
  ------------------
 7449|  3.63M|	if (ctxt->sax->getEntity != NULL)
  ------------------
  |  Branch (7449:6): [True: 3.63M, False: 0]
  ------------------
 7450|  3.63M|	    ent = ctxt->sax->getEntity(ctxt->userData, name);
 7451|  3.63M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7451:6): [True: 33.6k, False: 3.60M]
  |  Branch (7451:34): [True: 3.47k, False: 30.1k]
  ------------------
 7452|  3.47k|	    (ctxt->options & XML_PARSE_OLDSAX))
  ------------------
  |  Branch (7452:6): [True: 1.07k, False: 2.39k]
  ------------------
 7453|  1.07k|	    ent = xmlGetPredefinedEntity(name);
 7454|  3.63M|	if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
  ------------------
  |  Branch (7454:6): [True: 33.6k, False: 3.60M]
  |  Branch (7454:34): [True: 3.47k, False: 30.1k]
  ------------------
 7455|  3.47k|	    (ctxt->userData==ctxt)) {
  ------------------
  |  Branch (7455:6): [True: 3.47k, False: 0]
  ------------------
 7456|  3.47k|	    ent = xmlSAX2GetEntity(ctxt, name);
 7457|  3.47k|	}
 7458|  3.63M|    }
 7459|       |
 7460|  3.63M|    if (ent == NULL) {
  ------------------
  |  Branch (7460:9): [True: 373k, False: 3.26M]
  ------------------
 7461|   373k|        xmlHandleUndeclaredEntity(ctxt, name);
 7462|   373k|    }
 7463|       |
 7464|       |    /*
 7465|       |     * [ WFC: Parsed Entity ]
 7466|       |     * An entity reference must not contain the name of an
 7467|       |     * unparsed entity
 7468|       |     */
 7469|  3.26M|    else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (7469:14): [True: 236, False: 3.26M]
  ------------------
 7470|    236|	xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
 7471|    236|		 "Entity reference to unparsed entity %s\n", name);
 7472|    236|        ent = NULL;
 7473|    236|    }
 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.26M|    else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
  ------------------
  |  Branch (7480:14): [True: 13.7k, False: 3.24M]
  ------------------
 7481|  13.7k|        if (inAttr) {
  ------------------
  |  Branch (7481:13): [True: 1.21k, False: 12.5k]
  ------------------
 7482|  1.21k|            xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
 7483|  1.21k|                 "Attribute references external entity '%s'\n", name);
 7484|  1.21k|            ent = NULL;
 7485|  1.21k|        }
 7486|  13.7k|    }
 7487|       |
 7488|  3.63M|    return(ent);
 7489|  4.31M|}
parser.c:xmlParseEntityRefInternal:
 7500|  1.28M|xmlParseEntityRefInternal(xmlParserCtxtPtr ctxt) {
 7501|  1.28M|    const xmlChar *name;
 7502|       |
 7503|  1.28M|    GROW;
  ------------------
  |  | 2308|  1.28M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.28M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.28M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 584k, False: 698k]
  |  |  ------------------
  |  | 2309|  1.28M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   584k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 303k, False: 280k]
  |  |  ------------------
  |  | 2310|  1.28M|	xmlParserGrow(ctxt);
  ------------------
 7504|       |
 7505|  1.28M|    if (RAW != '&')
  ------------------
  |  | 2261|  1.28M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7505:9): [True: 0, False: 1.28M]
  ------------------
 7506|      0|        return(NULL);
 7507|  1.28M|    NEXT;
  ------------------
  |  | 2316|  1.28M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7508|  1.28M|    name = xmlParseName(ctxt);
 7509|  1.28M|    if (name == NULL) {
  ------------------
  |  Branch (7509:9): [True: 61.6k, False: 1.22M]
  ------------------
 7510|  61.6k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 7511|  61.6k|		       "xmlParseEntityRef: no name\n");
 7512|  61.6k|        return(NULL);
 7513|  61.6k|    }
 7514|  1.22M|    if (RAW != ';') {
  ------------------
  |  | 2261|  1.22M|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7514:9): [True: 109k, False: 1.11M]
  ------------------
 7515|   109k|	xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
 7516|   109k|	return(NULL);
 7517|   109k|    }
 7518|  1.11M|    NEXT;
  ------------------
  |  | 2316|  1.11M|#define NEXT xmlNextChar(ctxt)
  ------------------
 7519|       |
 7520|  1.11M|    return(name);
 7521|  1.22M|}
parser.c:xmlParsePERefInternal:
 7636|   200k|xmlParsePERefInternal(xmlParserCtxt *ctxt, int markupDecl) {
 7637|   200k|    const xmlChar *name;
 7638|   200k|    xmlEntityPtr entity = NULL;
 7639|   200k|    xmlParserInputPtr input;
 7640|       |
 7641|   200k|    if (RAW != '%')
  ------------------
  |  | 2261|   200k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7641:9): [True: 0, False: 200k]
  ------------------
 7642|      0|        return;
 7643|   200k|    NEXT;
  ------------------
  |  | 2316|   200k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7644|   200k|    name = xmlParseName(ctxt);
 7645|   200k|    if (name == NULL) {
  ------------------
  |  Branch (7645:9): [True: 15.0k, False: 185k]
  ------------------
 7646|  15.0k|	xmlFatalErrMsg(ctxt, XML_ERR_PEREF_NO_NAME, "PEReference: no name\n");
 7647|  15.0k|	return;
 7648|  15.0k|    }
 7649|   185k|    if (RAW != ';') {
  ------------------
  |  | 2261|   185k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (7649:9): [True: 14.2k, False: 171k]
  ------------------
 7650|  14.2k|	xmlFatalErr(ctxt, XML_ERR_PEREF_SEMICOL_MISSING, NULL);
 7651|  14.2k|        return;
 7652|  14.2k|    }
 7653|       |
 7654|   171k|    NEXT;
  ------------------
  |  | 2316|   171k|#define NEXT xmlNextChar(ctxt)
  ------------------
 7655|       |
 7656|       |    /* Must be set before xmlHandleUndeclaredEntity */
 7657|   171k|    ctxt->hasPErefs = 1;
 7658|       |
 7659|       |    /*
 7660|       |     * Request the entity from SAX
 7661|       |     */
 7662|   171k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (7662:9): [True: 171k, False: 0]
  ------------------
 7663|   171k|	(ctxt->sax->getParameterEntity != NULL))
  ------------------
  |  Branch (7663:2): [True: 171k, False: 0]
  ------------------
 7664|   171k|	entity = ctxt->sax->getParameterEntity(ctxt->userData, name);
 7665|       |
 7666|   171k|    if (entity == NULL) {
  ------------------
  |  Branch (7666:9): [True: 51.4k, False: 120k]
  ------------------
 7667|  51.4k|        xmlHandleUndeclaredEntity(ctxt, name);
 7668|   120k|    } else {
 7669|       |	/*
 7670|       |	 * Internal checking in case the entity quest barfed
 7671|       |	 */
 7672|   120k|	if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7672:6): [True: 112k, False: 7.85k]
  ------------------
 7673|   112k|	    (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (7673:6): [True: 0, False: 112k]
  ------------------
 7674|      0|	    xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
 7675|      0|		  "Internal: %%%s; is not a parameter entity\n",
 7676|      0|			  name, NULL);
 7677|   120k|	} else {
 7678|   120k|	    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
  ------------------
  |  Branch (7678:10): [True: 112k, False: 7.85k]
  ------------------
 7679|   112k|                ((ctxt->options & XML_PARSE_NO_XXE) ||
  ------------------
  |  Branch (7679:18): [True: 197, False: 112k]
  ------------------
 7680|   112k|		 (((ctxt->loadsubset & ~XML_SKIP_IDS) == 0) &&
  ------------------
  |  |  210|   112k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (7680:5): [True: 26.5k, False: 85.6k]
  ------------------
 7681|  26.5k|		  (ctxt->replaceEntities == 0) &&
  ------------------
  |  Branch (7681:5): [True: 8.84k, False: 17.6k]
  ------------------
 7682|  8.84k|		  (ctxt->validate == 0))))
  ------------------
  |  Branch (7682:5): [True: 197, False: 8.64k]
  ------------------
 7683|    394|		return;
 7684|       |
 7685|   119k|            if (entity->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|   119k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (7685:17): [True: 23, False: 119k]
  ------------------
 7686|     23|                xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
 7687|     23|                return;
 7688|     23|            }
 7689|       |
 7690|   119k|	    input = xmlNewEntityInputStream(ctxt, entity);
 7691|   119k|	    if (xmlCtxtPushInput(ctxt, input) < 0) {
  ------------------
  |  Branch (7691:10): [True: 3.07k, False: 116k]
  ------------------
 7692|  3.07k|                xmlFreeInputStream(input);
 7693|  3.07k|		return;
 7694|  3.07k|            }
 7695|       |
 7696|   116k|            entity->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|   116k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 7697|       |
 7698|   116k|            if (markupDecl)
  ------------------
  |  Branch (7698:17): [True: 105k, False: 11.6k]
  ------------------
 7699|   105k|                input->flags |= XML_INPUT_MARKUP_DECL;
  ------------------
  |  |   42|   105k|#define XML_INPUT_MARKUP_DECL       (1u << 7)
  ------------------
 7700|       |
 7701|   116k|            GROW;
  ------------------
  |  | 2308|   116k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   116k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   116k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 116k, False: 0]
  |  |  ------------------
  |  | 2309|   116k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   116k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 72.8k, False: 43.8k]
  |  |  ------------------
  |  | 2310|   116k|	xmlParserGrow(ctxt);
  ------------------
 7702|       |
 7703|   116k|	    if (entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) {
  ------------------
  |  Branch (7703:10): [True: 108k, False: 7.84k]
  ------------------
 7704|   108k|                xmlDetectEncoding(ctxt);
 7705|       |
 7706|   108k|                if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|   108k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|   217k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 84.7k, False: 24.1k]
  |  |  |  |  |  Branch (2268:41): [True: 55.5k, False: 29.2k]
  |  |  |  |  ------------------
  |  |  |  | 2269|   108k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 50.9k, False: 4.52k]
  |  |  |  |  |  Branch (2269:41): [True: 50.1k, False: 817]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 48.3k, False: 1.82k]
  |  |  ------------------
  ------------------
 7707|  48.3k|                    (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|  48.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  48.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 46.2k, False: 2.05k]
  |  |  |  |  ------------------
  |  |  |  |   91|  48.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.97k, False: 81]
  |  |  |  |  |  Branch (91:23): [True: 594, False: 1.38k]
  |  |  |  |  ------------------
  |  |  |  |   92|  48.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 588, False: 877]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 7708|  47.4k|                    xmlParseTextDecl(ctxt);
 7709|  47.4k|                }
 7710|   108k|            }
 7711|   116k|	}
 7712|   120k|    }
 7713|   171k|}
parser.c:xmlErrAttributeDup:
  238|  75.2k|{
  239|  75.2k|    if (prefix == NULL)
  ------------------
  |  Branch (239:9): [True: 15.4k, False: 59.8k]
  ------------------
  240|  15.4k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  241|  15.4k|                   XML_ERR_FATAL, localname, NULL, NULL, 0,
  242|  15.4k|                   "Attribute %s redefined\n", localname);
  243|  59.8k|    else
  244|  59.8k|        xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED,
  245|       |                   XML_ERR_FATAL, prefix, localname, NULL, 0,
  246|  59.8k|                   "Attribute %s:%s redefined\n", prefix, localname);
  247|  75.2k|}
parser.c:xmlParseEndTag1:
 8344|   112k|xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
 8345|   112k|    const xmlChar *name;
 8346|       |
 8347|   112k|    GROW;
  ------------------
  |  | 2308|   112k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   112k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   112k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 101k, False: 11.1k]
  |  |  ------------------
  |  | 2309|   112k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   101k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 10.9k, False: 90.0k]
  |  |  ------------------
  |  | 2310|   112k|	xmlParserGrow(ctxt);
  ------------------
 8348|   112k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   112k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   112k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8348:9): [True: 19, False: 112k]
  |  Branch (8348:25): [True: 14, False: 112k]
  ------------------
 8349|     33|	xmlFatalErrMsg(ctxt, XML_ERR_LTSLASH_REQUIRED,
 8350|     33|		       "xmlParseEndTag: '</' not found\n");
 8351|     33|	return;
 8352|     33|    }
 8353|   112k|    SKIP(2);
  ------------------
  |  | 2285|   112k|#define SKIP(val) do {							\
  |  | 2286|   112k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   112k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 361, False: 111k]
  |  |  ------------------
  |  | 2288|   112k|        xmlParserGrow(ctxt);						\
  |  | 2289|   112k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 112k]
  |  |  ------------------
  ------------------
 8354|       |
 8355|   112k|    name = xmlParseNameAndCompare(ctxt,ctxt->name);
 8356|       |
 8357|       |    /*
 8358|       |     * We should definitely be at the ending "S? '>'" part
 8359|       |     */
 8360|   112k|    GROW;
  ------------------
  |  | 2308|   112k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   112k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   112k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 101k, False: 11.1k]
  |  |  ------------------
  |  | 2309|   112k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   101k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.0k, False: 89.9k]
  |  |  ------------------
  |  | 2310|   112k|	xmlParserGrow(ctxt);
  ------------------
 8361|   112k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   112k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8362|   112k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   112k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   112k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 109k, False: 2.77k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 109k]
  |  |  |  |  ------------------
  |  |  |  |  109|   112k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 112k]
  |  |  |  |  ------------------
  |  |  |  |  110|   112k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 109k, False: 2.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   109k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8362:33): [True: 4.94k, False: 104k]
  ------------------
 8363|  7.90k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 8364|  7.90k|    } else
 8365|   104k|	NEXT1;
  ------------------
  |  | 2318|   104k|#define NEXT1 {								\
  |  | 2319|   104k|	ctxt->input->col++;						\
  |  | 2320|   104k|	ctxt->input->cur++;						\
  |  | 2321|   104k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.48k, False: 102k]
  |  |  ------------------
  |  | 2322|   104k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   104k|    }
  ------------------
 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|   112k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (8373:9): [True: 6.83k, False: 105k]
  ------------------
 8374|  6.83k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  2.16k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8374:13): [True: 2.16k, False: 4.66k]
  ------------------
 8375|  6.83k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 8376|  6.83k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 8377|  6.83k|		                ctxt->name, line, name);
 8378|  6.83k|    }
 8379|       |
 8380|       |    /*
 8381|       |     * SAX: End of Tag
 8382|       |     */
 8383|   112k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (8383:9): [True: 112k, False: 0]
  |  Branch (8383:32): [True: 112k, False: 0]
  ------------------
 8384|   112k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (8384:2): [True: 76.6k, False: 35.4k]
  ------------------
 8385|  76.6k|        ctxt->sax->endElement(ctxt->userData, ctxt->name);
 8386|       |
 8387|   112k|    namePop(ctxt);
 8388|   112k|    spacePop(ctxt);
 8389|   112k|}
parser.c:xmlParseNameAndCompare:
 3340|   326k|xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
 3341|   326k|    register const xmlChar *cmp = other;
 3342|   326k|    register const xmlChar *in;
 3343|   326k|    const xmlChar *ret;
 3344|       |
 3345|   326k|    GROW;
  ------------------
  |  | 2308|   326k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   326k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   326k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 296k, False: 30.3k]
  |  |  ------------------
  |  | 2309|   326k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   296k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 20.9k, False: 275k]
  |  |  ------------------
  |  | 2310|   326k|	xmlParserGrow(ctxt);
  ------------------
 3346|       |
 3347|   326k|    in = ctxt->input->cur;
 3348|   855k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (3348:12): [True: 851k, False: 3.89k]
  |  Branch (3348:24): [True: 528k, False: 322k]
  ------------------
 3349|   528k|	++in;
 3350|   528k|	++cmp;
 3351|   528k|    }
 3352|   326k|    if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  9.55k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  9.55k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 605, False: 8.95k]
  |  |  |  |  ------------------
  |  |  |  |   91|  9.55k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 6.85k, False: 2.09k]
  |  |  |  |  |  Branch (91:23): [True: 2.23k, False: 4.62k]
  |  |  |  |  ------------------
  |  |  |  |   92|  9.55k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 1.29k, False: 5.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3352:9): [True: 310k, False: 16.1k]
  |  Branch (3352:23): [True: 301k, False: 9.55k]
  ------------------
 3353|       |	/* success */
 3354|   305k|	ctxt->input->col += in - ctxt->input->cur;
 3355|   305k|	ctxt->input->cur = in;
 3356|   305k|	return (const xmlChar*) 1;
 3357|   305k|    }
 3358|       |    /* failure (or end of input buffer), check with full function */
 3359|  21.5k|    ret = xmlParseName (ctxt);
 3360|       |    /* strings coming from the dictionary direct compare possible */
 3361|  21.5k|    if (ret == other) {
  ------------------
  |  Branch (3361:9): [True: 3.99k, False: 17.5k]
  ------------------
 3362|  3.99k|	return (const xmlChar*) 1;
 3363|  3.99k|    }
 3364|  17.5k|    return ret;
 3365|  21.5k|}
parser.c:namePop:
 2175|   952k|{
 2176|   952k|    const xmlChar *ret;
 2177|       |
 2178|   952k|    if ((ctxt == NULL) || (ctxt->nameNr <= 0))
  ------------------
  |  Branch (2178:9): [True: 0, False: 952k]
  |  Branch (2178:27): [True: 3, False: 952k]
  ------------------
 2179|      3|        return (NULL);
 2180|   952k|    ctxt->nameNr--;
 2181|   952k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2181:9): [True: 943k, False: 9.08k]
  ------------------
 2182|   943k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2183|  9.08k|    else
 2184|  9.08k|        ctxt->name = NULL;
 2185|   952k|    ret = ctxt->nameTab[ctxt->nameNr];
 2186|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2187|   952k|    return (ret);
 2188|   952k|}
parser.c:spacePop:
 2216|  1.17M|static int spacePop(xmlParserCtxtPtr ctxt) {
 2217|  1.17M|    int ret;
 2218|  1.17M|    if (ctxt->spaceNr <= 0) return(0);
  ------------------
  |  Branch (2218:9): [True: 0, False: 1.17M]
  ------------------
 2219|  1.17M|    ctxt->spaceNr--;
 2220|  1.17M|    if (ctxt->spaceNr > 0)
  ------------------
  |  Branch (2220:9): [True: 1.17M, False: 24]
  ------------------
 2221|  1.17M|	ctxt->space = &ctxt->spaceTab[ctxt->spaceNr - 1];
 2222|     24|    else
 2223|     24|        ctxt->space = &ctxt->spaceTab[0];
 2224|  1.17M|    ret = ctxt->spaceTab[ctxt->spaceNr];
 2225|  1.17M|    ctxt->spaceTab[ctxt->spaceNr] = -1;
 2226|  1.17M|    return(ret);
 2227|  1.17M|}
parser.c:xmlParseContentInternal:
 9577|  11.1k|xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
 9578|  11.1k|    int oldNameNr = ctxt->nameNr;
 9579|  11.1k|    int oldSpaceNr = ctxt->spaceNr;
 9580|  11.1k|    int oldNodeNr = ctxt->nodeNr;
 9581|       |
 9582|  11.1k|    GROW;
  ------------------
  |  | 2308|  11.1k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  11.1k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  11.1k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 11.1k, False: 0]
  |  |  ------------------
  |  | 2309|  11.1k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  11.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 8.78k, False: 2.36k]
  |  |  ------------------
  |  | 2310|  11.1k|	xmlParserGrow(ctxt);
  ------------------
 9583|  6.04M|    while ((ctxt->input->cur < ctxt->input->end) &&
  ------------------
  |  Branch (9583:12): [True: 6.04M, False: 6.18k]
  ------------------
 9584|  6.04M|	   (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|  6.04M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (9584:5): [True: 6.04M, False: 455]
  ------------------
 9585|  6.04M|	const xmlChar *cur = ctxt->input->cur;
 9586|       |
 9587|       |	/*
 9588|       |	 * First case : a Processing Instruction.
 9589|       |	 */
 9590|  6.04M|	if ((*cur == '<') && (cur[1] == '?')) {
  ------------------
  |  Branch (9590:6): [True: 1.54M, False: 4.50M]
  |  Branch (9590:23): [True: 155k, False: 1.38M]
  ------------------
 9591|   155k|	    xmlParsePI(ctxt);
 9592|   155k|	}
 9593|       |
 9594|       |	/*
 9595|       |	 * Second case : a CDSection
 9596|       |	 */
 9597|       |	/* 2.6.0 test was *cur not RAW */
 9598|  5.88M|	else if (CMP9(CUR_PTR, '<', '!', '[', 'C', 'D', 'A', 'T', 'A', '[')) {
  ------------------
  |  | 2279|  5.88M|  ( CMP8( s, c1, c2, c3, c4, c5, c6, c7, c8 ) && \
  |  |  ------------------
  |  |  |  | 2277|  11.7M|  ( CMP7( s, c1, c2, c3, c4, c5, c6, c7 ) && ((unsigned char *) s)[ 7 ] == c8 )
  |  |  |  |  ------------------
  |  |  |  |  |  | 2275|  11.7M|  ( CMP6( s, c1, c2, c3, c4, c5, c6 ) && ((unsigned char *) s)[ 6 ] == c7 )
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 2273|  11.7M|  ( CMP5( s, c1, c2, c3, c4, c5 ) && ((unsigned char *) s)[ 5 ] == c6 )
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  | 2271|  11.7M|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2268|  11.7M|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:5): [True: 1.38M, False: 4.50M]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2268:41): [True: 131k, False: 1.25M]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  | 2269|  5.88M|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:5): [True: 100k, False: 30.9k]
  |  |  |  |  |  |  |  |  |  |  |  |  |  Branch (2269:41): [True: 99.6k, False: 857]
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (2271:34): [True: 99.2k, False: 392]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (2273:38): [True: 98.8k, False: 377]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2275:42): [True: 98.6k, False: 244]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2277:46): [True: 98.3k, False: 279]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2280|  5.88M|    ((unsigned char *) s)[ 8 ] == c9 )
  |  |  ------------------
  |  |  |  Branch (2280:5): [True: 98.0k, False: 255]
  |  |  ------------------
  ------------------
 9599|  98.0k|	    xmlParseCDSect(ctxt);
 9600|  98.0k|	}
 9601|       |
 9602|       |	/*
 9603|       |	 * Third case :  a comment
 9604|       |	 */
 9605|  5.78M|	else if ((*cur == '<') && (NXT(1) == '!') &&
  ------------------
  |  | 2263|  1.28M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9605:11): [True: 1.28M, False: 4.50M]
  |  Branch (9605:28): [True: 33.3k, False: 1.25M]
  ------------------
 9606|  33.3k|		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  33.3k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
              		 (NXT(2) == '-') && (NXT(3) == '-')) {
  ------------------
  |  | 2263|  15.4k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9606:4): [True: 15.4k, False: 17.9k]
  |  Branch (9606:23): [True: 15.1k, False: 304]
  ------------------
 9607|  15.1k|	    xmlParseComment(ctxt);
 9608|  15.1k|	}
 9609|       |
 9610|       |	/*
 9611|       |	 * Fourth case :  a sub-element.
 9612|       |	 */
 9613|  5.77M|	else if (*cur == '<') {
  ------------------
  |  Branch (9613:11): [True: 1.27M, False: 4.50M]
  ------------------
 9614|  1.27M|            if (NXT(1) == '/') {
  ------------------
  |  | 2263|  1.27M|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9614:17): [True: 309k, False: 962k]
  ------------------
 9615|   309k|                if (ctxt->nameNr <= oldNameNr)
  ------------------
  |  Branch (9615:21): [True: 4.50k, False: 305k]
  ------------------
 9616|  4.50k|                    break;
 9617|   305k|	        xmlParseElementEnd(ctxt);
 9618|   962k|            } else {
 9619|   962k|	        xmlParseElementStart(ctxt);
 9620|   962k|            }
 9621|  1.27M|	}
 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.50M|	else if (*cur == '&') {
  ------------------
  |  Branch (9628:11): [True: 107k, False: 4.39M]
  ------------------
 9629|   107k|	    xmlParseReference(ctxt);
 9630|   107k|	}
 9631|       |
 9632|       |	/*
 9633|       |	 * Last case, text. Note that References are handled directly.
 9634|       |	 */
 9635|  4.39M|	else {
 9636|  4.39M|	    xmlParseCharDataInternal(ctxt, 0);
 9637|  4.39M|	}
 9638|       |
 9639|  6.03M|	SHRINK;
  ------------------
  |  | 2304|  6.03M|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|  6.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 6.03M, False: 0]
  |  |  ------------------
  |  | 2305|  6.03M|	xmlParserShrink(ctxt);
  ------------------
 9640|  6.03M|	GROW;
  ------------------
  |  | 2308|  6.03M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  6.03M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  6.03M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 6.03M, False: 0]
  |  |  ------------------
  |  | 2309|  6.03M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  6.03M|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 138k, False: 5.90M]
  |  |  ------------------
  |  | 2310|  6.03M|	xmlParserGrow(ctxt);
  ------------------
 9641|  6.03M|    }
 9642|       |
 9643|  11.1k|    if ((ctxt->nameNr > oldNameNr) &&
  ------------------
  |  Branch (9643:9): [True: 1.64k, False: 9.50k]
  ------------------
 9644|  1.64k|        (ctxt->input->cur >= ctxt->input->end) &&
  ------------------
  |  Branch (9644:9): [True: 1.44k, False: 197]
  ------------------
 9645|  1.44k|        (ctxt->wellFormed)) {
  ------------------
  |  Branch (9645:9): [True: 33, False: 1.41k]
  ------------------
 9646|     33|        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
 9647|     33|        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
 9648|     33|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
 9649|     33|                "Premature end of data in tag %s line %d\n",
 9650|     33|                name, line, NULL);
 9651|     33|    }
 9652|       |
 9653|       |    /*
 9654|       |     * Clean up in error case
 9655|       |     */
 9656|       |
 9657|  86.5k|    while (ctxt->nodeNr > oldNodeNr)
  ------------------
  |  Branch (9657:12): [True: 75.3k, False: 11.1k]
  ------------------
 9658|  75.3k|        nodePop(ctxt);
 9659|       |
 9660|   112k|    while (ctxt->nameNr > oldNameNr) {
  ------------------
  |  Branch (9660:12): [True: 101k, False: 11.1k]
  ------------------
 9661|   101k|        xmlStartTag *tag = &ctxt->pushTab[ctxt->nameNr - 1];
 9662|       |
 9663|   101k|        if (tag->nsNr != 0)
  ------------------
  |  Branch (9663:13): [True: 21.6k, False: 80.1k]
  ------------------
 9664|  21.6k|            xmlParserNsPop(ctxt, tag->nsNr);
 9665|       |
 9666|   101k|        namePop(ctxt);
 9667|   101k|    }
 9668|       |
 9669|   112k|    while (ctxt->spaceNr > oldSpaceNr)
  ------------------
  |  Branch (9669:12): [True: 101k, False: 11.1k]
  ------------------
 9670|   101k|        spacePop(ctxt);
 9671|  11.1k|}
parser.c:xmlFatalErrMsgStrIntStr:
  332|   294k|{
  333|   294k|    xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL,
  334|       |               str1, str2, NULL, val, msg, str1, val, str2);
  335|   294k|}
parser.c:xmlParseElementStart:
 9736|   971k|xmlParseElementStart(xmlParserCtxtPtr ctxt) {
 9737|   971k|    int maxDepth = (ctxt->options & XML_PARSE_HUGE) ? 2048 : 256;
  ------------------
  |  Branch (9737:20): [True: 665k, False: 305k]
  ------------------
 9738|   971k|    const xmlChar *name;
 9739|   971k|    const xmlChar *prefix = NULL;
 9740|   971k|    const xmlChar *URI = NULL;
 9741|   971k|    xmlParserNodeInfo node_info;
 9742|   971k|    int line;
 9743|   971k|    xmlNodePtr cur;
 9744|   971k|    int nbNs = 0;
 9745|       |
 9746|   971k|    if (ctxt->nameNr > maxDepth) {
  ------------------
  |  Branch (9746:9): [True: 11, False: 971k]
  ------------------
 9747|     11|        xmlFatalErrMsgInt(ctxt, XML_ERR_RESOURCE_LIMIT,
 9748|     11|                "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
 9749|     11|                ctxt->nameNr);
 9750|     11|	return(-1);
 9751|     11|    }
 9752|       |
 9753|       |    /* Capture start position */
 9754|   971k|    if (ctxt->record_info) {
  ------------------
  |  Branch (9754:9): [True: 0, False: 971k]
  ------------------
 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|   971k|    if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (9760:9): [True: 0, False: 971k]
  ------------------
 9761|      0|	spacePush(ctxt, -1);
 9762|   971k|    else if (*ctxt->space == -2)
  ------------------
  |  Branch (9762:14): [True: 166k, False: 804k]
  ------------------
 9763|   166k|	spacePush(ctxt, -1);
 9764|   804k|    else
 9765|   804k|	spacePush(ctxt, *ctxt->space);
 9766|       |
 9767|   971k|    line = ctxt->input->line;
 9768|   971k|#ifdef LIBXML_SAX1_ENABLED
 9769|   971k|    if (ctxt->sax2)
  ------------------
  |  Branch (9769:9): [True: 619k, False: 351k]
  ------------------
 9770|   619k|#endif /* LIBXML_SAX1_ENABLED */
 9771|   619k|        name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
 9772|   351k|#ifdef LIBXML_SAX1_ENABLED
 9773|   351k|    else
 9774|   351k|	name = xmlParseStartTag(ctxt);
 9775|   971k|#endif /* LIBXML_SAX1_ENABLED */
 9776|   971k|    if (name == NULL) {
  ------------------
  |  Branch (9776:9): [True: 35.7k, False: 935k]
  ------------------
 9777|  35.7k|	spacePop(ctxt);
 9778|  35.7k|        return(-1);
 9779|  35.7k|    }
 9780|   935k|    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
 9781|   935k|    cur = ctxt->node;
 9782|       |
 9783|   935k|#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|   935k|    if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (9789:9): [True: 281k, False: 654k]
  |  Branch (9789:27): [True: 9.01k, False: 271k]
  |  Branch (9789:47): [True: 9.01k, False: 0]
  ------------------
 9790|  9.01k|        ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (9790:9): [True: 9.01k, False: 0]
  |  Branch (9790:23): [True: 0, False: 9.01k]
  ------------------
 9791|      0|        ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
 9792|   935k|#endif /* LIBXML_VALID_ENABLED */
 9793|       |
 9794|       |    /*
 9795|       |     * Check for an Empty Element.
 9796|       |     */
 9797|   935k|    if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   935k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   268k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9797:9): [True: 268k, False: 667k]
  |  Branch (9797:25): [True: 259k, False: 8.87k]
  ------------------
 9798|   259k|        SKIP(2);
  ------------------
  |  | 2285|   259k|#define SKIP(val) do {							\
  |  | 2286|   259k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   259k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 825, False: 258k]
  |  |  ------------------
  |  | 2288|   259k|        xmlParserGrow(ctxt);						\
  |  | 2289|   259k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 259k]
  |  |  ------------------
  ------------------
 9799|   259k|	if (ctxt->sax2) {
  ------------------
  |  Branch (9799:6): [True: 131k, False: 128k]
  ------------------
 9800|   131k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9800:10): [True: 131k, False: 0]
  |  Branch (9800:33): [True: 131k, False: 0]
  ------------------
 9801|   131k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9801:3): [True: 94.5k, False: 36.7k]
  ------------------
 9802|  94.5k|		ctxt->sax->endElementNs(ctxt->userData, name, prefix, URI);
 9803|   131k|#ifdef LIBXML_SAX1_ENABLED
 9804|   131k|	} else {
 9805|   128k|	    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (9805:10): [True: 128k, False: 0]
  |  Branch (9805:33): [True: 128k, False: 0]
  ------------------
 9806|   128k|		(!ctxt->disableSAX))
  ------------------
  |  Branch (9806:3): [True: 108k, False: 19.8k]
  ------------------
 9807|   108k|		ctxt->sax->endElement(ctxt->userData, name);
 9808|   128k|#endif /* LIBXML_SAX1_ENABLED */
 9809|   128k|	}
 9810|   259k|	namePop(ctxt);
 9811|   259k|	spacePop(ctxt);
 9812|   259k|	if (nbNs > 0)
  ------------------
  |  Branch (9812:6): [True: 48.2k, False: 211k]
  ------------------
 9813|  48.2k|	    xmlParserNsPop(ctxt, nbNs);
 9814|   259k|	if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9814:6): [True: 203k, False: 55.7k]
  |  Branch (9814:21): [True: 0, False: 203k]
  ------------------
 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|   259k|	return(1);
 9822|   259k|    }
 9823|   675k|    if (RAW == '>') {
  ------------------
  |  | 2261|   675k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9823:9): [True: 411k, False: 264k]
  ------------------
 9824|   411k|        NEXT1;
  ------------------
  |  | 2318|   411k|#define NEXT1 {								\
  |  | 2319|   411k|	ctxt->input->col++;						\
  |  | 2320|   411k|	ctxt->input->cur++;						\
  |  | 2321|   411k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.00k, False: 410k]
  |  |  ------------------
  |  | 2322|   411k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   411k|    }
  ------------------
 9825|   411k|        if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9825:13): [True: 297k, False: 114k]
  |  Branch (9825:28): [True: 0, False: 297k]
  ------------------
 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|   411k|    } else {
 9832|   264k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
 9833|   264k|		     "Couldn't find end of Start Tag %s line %d\n",
 9834|   264k|		                name, line, NULL);
 9835|       |
 9836|       |	/*
 9837|       |	 * end of parsing of this node.
 9838|       |	 */
 9839|   264k|	nodePop(ctxt);
 9840|   264k|	namePop(ctxt);
 9841|   264k|	spacePop(ctxt);
 9842|   264k|	if (nbNs > 0)
  ------------------
  |  Branch (9842:6): [True: 120k, False: 144k]
  ------------------
 9843|   120k|	    xmlParserNsPop(ctxt, nbNs);
 9844|   264k|	return(-1);
 9845|   264k|    }
 9846|       |
 9847|   411k|    return(0);
 9848|   675k|}
parser.c:spacePush:
 2190|  1.30M|static int spacePush(xmlParserCtxtPtr ctxt, int val) {
 2191|  1.30M|    if (ctxt->spaceNr >= ctxt->spaceMax) {
  ------------------
  |  Branch (2191:9): [True: 88.6k, False: 1.22M]
  ------------------
 2192|  88.6k|        int *tmp;
 2193|  88.6k|        int newSize;
 2194|       |
 2195|  88.6k|        newSize = xmlGrowCapacity(ctxt->spaceMax, sizeof(tmp[0]),
 2196|  88.6k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  88.6k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2197|  88.6k|        if (newSize < 0) {
  ------------------
  |  Branch (2197:13): [True: 0, False: 88.6k]
  ------------------
 2198|      0|	    xmlErrMemory(ctxt);
 2199|      0|	    return(-1);
 2200|      0|        }
 2201|       |
 2202|  88.6k|        tmp = xmlRealloc(ctxt->spaceTab, newSize * sizeof(tmp[0]));
 2203|  88.6k|        if (tmp == NULL) {
  ------------------
  |  Branch (2203:13): [True: 52, False: 88.6k]
  ------------------
 2204|     52|	    xmlErrMemory(ctxt);
 2205|     52|	    return(-1);
 2206|     52|	}
 2207|  88.6k|	ctxt->spaceTab = tmp;
 2208|       |
 2209|  88.6k|        ctxt->spaceMax = newSize;
 2210|  88.6k|    }
 2211|  1.30M|    ctxt->spaceTab[ctxt->spaceNr] = val;
 2212|  1.30M|    ctxt->space = &ctxt->spaceTab[ctxt->spaceNr];
 2213|  1.30M|    return(ctxt->spaceNr++);
 2214|  1.30M|}
parser.c:xmlParseStartTag2:
 8788|   848k|                  const xmlChar **URI, int *nbNsPtr) {
 8789|   848k|    xmlHashedString hlocalname;
 8790|   848k|    xmlHashedString hprefix;
 8791|   848k|    xmlHashedString hattname;
 8792|   848k|    xmlHashedString haprefix;
 8793|   848k|    const xmlChar *localname;
 8794|   848k|    const xmlChar *prefix;
 8795|   848k|    const xmlChar *attname;
 8796|   848k|    const xmlChar *aprefix;
 8797|   848k|    const xmlChar *uri;
 8798|   848k|    xmlChar *attvalue = NULL;
 8799|   848k|    const xmlChar **atts = ctxt->atts;
 8800|   848k|    unsigned attrHashSize = 0;
 8801|   848k|    int maxatts = ctxt->maxatts;
 8802|   848k|    int nratts, nbatts, nbdef;
 8803|   848k|    int i, j, nbNs, nbTotalDef, attval, nsIndex, maxAtts;
 8804|   848k|    int alloc = 0;
 8805|   848k|    int numNsErr = 0;
 8806|   848k|    int numDupErr = 0;
 8807|       |
 8808|   848k|    if (RAW != '<') return(NULL);
  ------------------
  |  | 2261|   848k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8808:9): [True: 0, False: 848k]
  ------------------
 8809|   848k|    NEXT1;
  ------------------
  |  | 2318|   848k|#define NEXT1 {								\
  |  | 2319|   848k|	ctxt->input->col++;						\
  |  | 2320|   848k|	ctxt->input->cur++;						\
  |  | 2321|   848k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.14k, False: 847k]
  |  |  ------------------
  |  | 2322|   848k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   848k|    }
  ------------------
 8810|       |
 8811|   848k|    nbatts = 0;
 8812|   848k|    nratts = 0;
 8813|   848k|    nbdef = 0;
 8814|   848k|    nbNs = 0;
 8815|   848k|    nbTotalDef = 0;
 8816|   848k|    attval = 0;
 8817|       |
 8818|   848k|    if (xmlParserNsStartElement(ctxt->nsdb) < 0) {
  ------------------
  |  Branch (8818:9): [True: 0, False: 848k]
  ------------------
 8819|      0|        xmlErrMemory(ctxt);
 8820|      0|        return(NULL);
 8821|      0|    }
 8822|       |
 8823|   848k|    hlocalname = xmlParseQNameHashed(ctxt, &hprefix);
 8824|   848k|    if (hlocalname.name == NULL) {
  ------------------
  |  Branch (8824:9): [True: 23.5k, False: 824k]
  ------------------
 8825|  23.5k|	xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8826|  23.5k|		       "StartTag: invalid element name\n");
 8827|  23.5k|        return(NULL);
 8828|  23.5k|    }
 8829|   824k|    localname = hlocalname.name;
 8830|   824k|    prefix = hprefix.name;
 8831|       |
 8832|       |    /*
 8833|       |     * Now parse the attributes, it ends up with the ending
 8834|       |     *
 8835|       |     * (S Attribute)* S?
 8836|       |     */
 8837|   824k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   824k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8838|   824k|    GROW;
  ------------------
  |  | 2308|   824k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   824k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   824k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 597k, False: 227k]
  |  |  ------------------
  |  | 2309|   824k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   597k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 33.9k, False: 563k]
  |  |  ------------------
  |  | 2310|   824k|	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|   943k|    while (((RAW != '>') &&
  ------------------
  |  | 2261|   943k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8864:13): [True: 596k, False: 347k]
  ------------------
 8865|   596k|	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2261|   596k|#define RAW (*ctxt->input->cur)
  ------------------
              	   ((RAW != '/') || (NXT(1) != '>')) &&
  ------------------
  |  | 2263|   171k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8865:6): [True: 424k, False: 171k]
  |  Branch (8865:22): [True: 6.91k, False: 164k]
  ------------------
 8866|   431k|	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |  103|   431k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   431k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 420k, False: 11.6k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 420k]
  |  |  |  |  ------------------
  |  |  |  |  109|   431k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 431k]
  |  |  |  |  ------------------
  |  |  |  |  110|   431k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 419k, False: 12.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	   (IS_BYTE_CHAR(RAW))) && (PARSER_STOPPED(ctxt) == 0)) {
  ------------------
  |  |   44|   419k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  ------------------
  |  Branch (8866:29): [True: 419k, False: 39]
  ------------------
 8867|   419k|	int len = -1;
 8868|       |
 8869|   419k|	hattname = xmlParseAttribute2(ctxt, prefix, localname,
 8870|   419k|                                          &haprefix, &attvalue, &len,
 8871|   419k|                                          &alloc);
 8872|   419k|        if (hattname.name == NULL)
  ------------------
  |  Branch (8872:13): [True: 177k, False: 242k]
  ------------------
 8873|   177k|	    break;
 8874|   242k|        if (attvalue == NULL)
  ------------------
  |  Branch (8874:13): [True: 23.3k, False: 218k]
  ------------------
 8875|  23.3k|            goto next_attr;
 8876|   218k|        attname = hattname.name;
 8877|   218k|        aprefix = haprefix.name;
 8878|   218k|	if (len < 0) len = xmlStrlen(attvalue);
  ------------------
  |  Branch (8878:6): [True: 0, False: 218k]
  ------------------
 8879|       |
 8880|   218k|        if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (8880:13): [True: 14.7k, False: 204k]
  |  Branch (8880:45): [True: 14.5k, False: 232]
  ------------------
 8881|  14.5k|            xmlHashedString huri;
 8882|  14.5k|            xmlURIPtr parsedUri;
 8883|       |
 8884|  14.5k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8885|  14.5k|            uri = huri.name;
 8886|  14.5k|            if (uri == NULL) {
  ------------------
  |  Branch (8886:17): [True: 1, False: 14.5k]
  ------------------
 8887|      1|                xmlErrMemory(ctxt);
 8888|      1|                goto next_attr;
 8889|      1|            }
 8890|  14.5k|            if (*uri != 0) {
  ------------------
  |  Branch (8890:17): [True: 7.58k, False: 6.97k]
  ------------------
 8891|  7.58k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8891:21): [True: 20, False: 7.56k]
  ------------------
 8892|     20|                    xmlErrMemory(ctxt);
 8893|     20|                    goto next_attr;
 8894|     20|                }
 8895|  7.56k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8895:21): [True: 2.34k, False: 5.21k]
  ------------------
 8896|  2.34k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8897|  2.34k|                             "xmlns: '%s' is not a valid URI\n",
 8898|  2.34k|                                       uri, NULL, NULL);
 8899|  5.21k|                } else {
 8900|  5.21k|                    if (parsedUri->scheme == NULL) {
  ------------------
  |  Branch (8900:25): [True: 2.80k, False: 2.41k]
  ------------------
 8901|  2.80k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8902|  2.80k|                                  "xmlns: URI %s is not absolute\n",
 8903|  2.80k|                                  uri, NULL, NULL);
 8904|  2.80k|                    }
 8905|  5.21k|                    xmlFreeURI(parsedUri);
 8906|  5.21k|                }
 8907|  7.56k|                if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8907:21): [True: 198, False: 7.36k]
  ------------------
 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|  7.36k|                if ((len == 29) &&
  ------------------
  |  Branch (8915:21): [True: 1.22k, False: 6.13k]
  ------------------
 8916|  1.22k|                    (xmlStrEqual(uri,
  ------------------
  |  Branch (8916:21): [True: 424, False: 802]
  ------------------
 8917|  1.22k|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|  1.22k|#define BAD_CAST (xmlChar *)
  ------------------
 8918|    424|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8919|    424|                         "reuse of the xmlns namespace name is forbidden\n",
 8920|    424|                             NULL, NULL, NULL);
 8921|    424|                    goto next_attr;
 8922|    424|                }
 8923|  7.36k|            }
 8924|       |
 8925|  13.9k|            if (xmlParserNsPush(ctxt, NULL, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8925:17): [True: 8.70k, False: 5.20k]
  ------------------
 8926|  8.70k|                nbNs++;
 8927|   204k|        } else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (8927:20): [True: 64.9k, False: 139k]
  ------------------
 8928|  64.9k|            xmlHashedString huri;
 8929|  64.9k|            xmlURIPtr parsedUri;
 8930|       |
 8931|  64.9k|            huri = xmlDictLookupHashed(ctxt->dict, attvalue, len);
 8932|  64.9k|            uri = huri.name;
 8933|  64.9k|            if (uri == NULL) {
  ------------------
  |  Branch (8933:17): [True: 2, False: 64.9k]
  ------------------
 8934|      2|                xmlErrMemory(ctxt);
 8935|      2|                goto next_attr;
 8936|      2|            }
 8937|       |
 8938|  64.9k|            if (attname == ctxt->str_xml) {
  ------------------
  |  Branch (8938:17): [True: 448, False: 64.5k]
  ------------------
 8939|    448|                if (uri != ctxt->str_xml_ns) {
  ------------------
  |  Branch (8939:21): [True: 250, False: 198]
  ------------------
 8940|    250|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8941|    250|                             "xml namespace prefix mapped to wrong URI\n",
 8942|    250|                             NULL, NULL, NULL);
 8943|    250|                }
 8944|       |                /*
 8945|       |                 * Do not keep a namespace definition node
 8946|       |                 */
 8947|    448|                goto next_attr;
 8948|    448|            }
 8949|  64.5k|            if (uri == ctxt->str_xml_ns) {
  ------------------
  |  Branch (8949:17): [True: 400, False: 64.1k]
  ------------------
 8950|    400|                if (attname != ctxt->str_xml) {
  ------------------
  |  Branch (8950:21): [True: 400, False: 0]
  ------------------
 8951|    400|                    xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8952|    400|                             "xml namespace URI mapped to wrong prefix\n",
 8953|    400|                             NULL, NULL, NULL);
 8954|    400|                }
 8955|    400|                goto next_attr;
 8956|    400|            }
 8957|  64.1k|            if (attname == ctxt->str_xmlns) {
  ------------------
  |  Branch (8957:17): [True: 203, False: 63.9k]
  ------------------
 8958|    203|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8959|    203|                         "redefinition of the xmlns prefix is forbidden\n",
 8960|    203|                         NULL, NULL, NULL);
 8961|    203|                goto next_attr;
 8962|    203|            }
 8963|  63.9k|            if ((len == 29) &&
  ------------------
  |  Branch (8963:17): [True: 470, False: 63.4k]
  ------------------
 8964|    470|                (xmlStrEqual(uri,
  ------------------
  |  Branch (8964:17): [True: 198, False: 272]
  ------------------
 8965|    470|                             BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
  ------------------
  |  |   34|    470|#define BAD_CAST (xmlChar *)
  ------------------
 8966|    198|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8967|    198|                         "reuse of the xmlns namespace name is forbidden\n",
 8968|    198|                         NULL, NULL, NULL);
 8969|    198|                goto next_attr;
 8970|    198|            }
 8971|  63.7k|            if ((uri == NULL) || (uri[0] == 0)) {
  ------------------
  |  Branch (8971:17): [True: 0, False: 63.7k]
  |  Branch (8971:34): [True: 93, False: 63.6k]
  ------------------
 8972|     93|                xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
 8973|     93|                         "xmlns:%s: Empty XML namespace is not allowed\n",
 8974|     93|                              attname, NULL, NULL);
 8975|     93|                goto next_attr;
 8976|  63.6k|            } else {
 8977|  63.6k|                if (xmlParseURISafe((const char *) uri, &parsedUri) < 0) {
  ------------------
  |  Branch (8977:21): [True: 6, False: 63.6k]
  ------------------
 8978|      6|                    xmlErrMemory(ctxt);
 8979|      6|                    goto next_attr;
 8980|      6|                }
 8981|  63.6k|                if (parsedUri == NULL) {
  ------------------
  |  Branch (8981:21): [True: 4.22k, False: 59.3k]
  ------------------
 8982|  4.22k|                    xmlNsErr(ctxt, XML_WAR_NS_URI,
 8983|  4.22k|                         "xmlns:%s: '%s' is not a valid URI\n",
 8984|  4.22k|                                       attname, uri, NULL);
 8985|  59.3k|                } else {
 8986|  59.3k|                    if ((ctxt->pedantic) && (parsedUri->scheme == NULL)) {
  ------------------
  |  Branch (8986:25): [True: 16.3k, False: 43.0k]
  |  Branch (8986:45): [True: 14.5k, False: 1.74k]
  ------------------
 8987|  14.5k|                        xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
 8988|  14.5k|                                  "xmlns:%s: URI %s is not absolute\n",
 8989|  14.5k|                                  attname, uri, NULL);
 8990|  14.5k|                    }
 8991|  59.3k|                    xmlFreeURI(parsedUri);
 8992|  59.3k|                }
 8993|  63.6k|            }
 8994|       |
 8995|  63.6k|            if (xmlParserNsPush(ctxt, &hattname, &huri, NULL, 0) > 0)
  ------------------
  |  Branch (8995:17): [True: 62.2k, False: 1.38k]
  ------------------
 8996|  62.2k|                nbNs++;
 8997|   139k|        } else {
 8998|       |            /*
 8999|       |             * Populate attributes array, see above for repurposing
 9000|       |             * of xmlChar pointers.
 9001|       |             */
 9002|   139k|            if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9002:17): [True: 11.9k, False: 127k]
  |  Branch (9002:35): [True: 10.1k, False: 117k]
  ------------------
 9003|  22.1k|                int res = xmlCtxtGrowAttrs(ctxt);
 9004|       |
 9005|  22.1k|                maxatts = ctxt->maxatts;
 9006|  22.1k|                atts = ctxt->atts;
 9007|       |
 9008|  22.1k|                if (res < 0)
  ------------------
  |  Branch (9008:21): [True: 8, False: 22.1k]
  ------------------
 9009|      8|                    goto next_attr;
 9010|  22.1k|            }
 9011|   139k|            ctxt->attallocs[nratts++] = (hattname.hashValue & 0x7FFFFFFF) |
 9012|   139k|                                        ((unsigned) alloc << 31);
 9013|   139k|            atts[nbatts++] = attname;
 9014|   139k|            atts[nbatts++] = aprefix;
 9015|   139k|            atts[nbatts++] = XML_INT_TO_PTR(haprefix.hashValue);
  ------------------
  |  |   59|   139k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9016|   139k|            if (alloc) {
  ------------------
  |  Branch (9016:17): [True: 27.4k, False: 111k]
  ------------------
 9017|  27.4k|                atts[nbatts++] = attvalue;
 9018|  27.4k|                attvalue += len;
 9019|  27.4k|                atts[nbatts++] = attvalue;
 9020|   111k|            } 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|   111k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   111k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9027|   111k|                attvalue += len;
 9028|   111k|                atts[nbatts++] = XML_INT_TO_PTR(attvalue - BASE_PTR);
  ------------------
  |  |   59|   111k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9029|   111k|            }
 9030|       |            /*
 9031|       |             * tag if some deallocation is needed
 9032|       |             */
 9033|   139k|            if (alloc != 0) attval = 1;
  ------------------
  |  Branch (9033:17): [True: 27.4k, False: 111k]
  ------------------
 9034|   139k|            attvalue = NULL; /* moved into atts */
 9035|   139k|        }
 9036|       |
 9037|   242k|next_attr:
 9038|   242k|        if ((attvalue != NULL) && (alloc != 0)) {
  ------------------
  |  Branch (9038:13): [True: 79.5k, False: 162k]
  |  Branch (9038:35): [True: 4.59k, False: 74.9k]
  ------------------
 9039|  4.59k|            xmlFree(attvalue);
 9040|  4.59k|            attvalue = NULL;
 9041|  4.59k|        }
 9042|       |
 9043|   242k|	GROW
  ------------------
  |  | 2308|   242k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   242k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   242k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 113k, False: 128k]
  |  |  ------------------
  |  | 2309|   242k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   113k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 11.3k, False: 101k]
  |  |  ------------------
  |  | 2310|   242k|	xmlParserGrow(ctxt);
  ------------------
 9044|   242k|	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   242k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2261|   204k|#define RAW (*ctxt->input->cur)
  ------------------
              	if ((RAW == '>') || (((RAW == '/') && (NXT(1) == '>'))))
  ------------------
  |  | 2263|  56.9k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9044:6): [True: 37.5k, False: 204k]
  |  Branch (9044:24): [True: 56.9k, False: 147k]
  |  Branch (9044:40): [True: 55.9k, False: 1.03k]
  ------------------
 9045|  93.5k|	    break;
 9046|   148k|	if (SKIP_BLANKS == 0) {
  ------------------
  |  | 2312|   148k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
  |  Branch (9046:6): [True: 29.7k, False: 118k]
  ------------------
 9047|  29.7k|	    xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
 9048|  29.7k|			   "attributes construct error\n");
 9049|  29.7k|	    break;
 9050|  29.7k|	}
 9051|   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: 31.1k, False: 87.8k]
  |  |  ------------------
  |  | 2309|   118k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  31.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 5.54k, False: 25.5k]
  |  |  ------------------
  |  | 2310|   118k|	xmlParserGrow(ctxt);
  ------------------
 9052|   118k|    }
 9053|       |
 9054|       |    /*
 9055|       |     * Namespaces from default attributes
 9056|       |     */
 9057|   824k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9057:9): [True: 350k, False: 474k]
  ------------------
 9058|   350k|        xmlDefAttrsPtr defaults;
 9059|       |
 9060|   350k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9061|   350k|	if (defaults != NULL) {
  ------------------
  |  Branch (9061:6): [True: 274k, False: 76.0k]
  ------------------
 9062|  1.03M|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9062:18): [True: 760k, False: 274k]
  ------------------
 9063|   760k|                xmlDefAttr *attr = &defaults->attrs[i];
 9064|       |
 9065|   760k|	        attname = attr->name.name;
 9066|   760k|		aprefix = attr->prefix.name;
 9067|       |
 9068|   760k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL)) {
  ------------------
  |  Branch (9068:7): [True: 38.4k, False: 722k]
  |  Branch (9068:39): [True: 36.5k, False: 1.96k]
  ------------------
 9069|  36.5k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9070|       |
 9071|  36.5k|                    if (xmlParserNsPush(ctxt, NULL, &attr->value, NULL, 1) > 0)
  ------------------
  |  Branch (9071:25): [True: 34.7k, False: 1.81k]
  ------------------
 9072|  34.7k|                        nbNs++;
 9073|   724k|		} else if (aprefix == ctxt->str_xmlns) {
  ------------------
  |  Branch (9073:14): [True: 387k, False: 336k]
  ------------------
 9074|   387k|                    xmlParserEntityCheck(ctxt, attr->expandedSize);
 9075|       |
 9076|   387k|                    if (xmlParserNsPush(ctxt, &attr->name, &attr->value,
  ------------------
  |  Branch (9076:25): [True: 355k, False: 32.1k]
  ------------------
 9077|   387k|                                      NULL, 1) > 0)
 9078|   355k|                        nbNs++;
 9079|   387k|		} else {
 9080|   336k|                    if (nratts + nbTotalDef >= XML_MAX_ATTRS) {
  ------------------
  |  |   93|   336k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
  |  Branch (9080:25): [True: 0, False: 336k]
  ------------------
 9081|      0|                        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 9082|      0|                                    "Maximum number of attributes exceeded");
 9083|      0|                        break;
 9084|      0|                    }
 9085|   336k|                    nbTotalDef += 1;
 9086|   336k|                }
 9087|   760k|	    }
 9088|   274k|	}
 9089|   350k|    }
 9090|       |
 9091|       |    /*
 9092|       |     * Resolve attribute namespaces
 9093|       |     */
 9094|   964k|    for (i = 0; i < nbatts; i += 5) {
  ------------------
  |  Branch (9094:17): [True: 139k, False: 824k]
  ------------------
 9095|   139k|        attname = atts[i];
 9096|   139k|        aprefix = atts[i+1];
 9097|       |
 9098|       |        /*
 9099|       |	* The default namespace does not apply to attribute names.
 9100|       |	*/
 9101|   139k|	if (aprefix == NULL) {
  ------------------
  |  Branch (9101:6): [True: 53.8k, False: 85.4k]
  ------------------
 9102|  53.8k|            nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  53.8k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9103|  85.4k|        } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9103:20): [True: 61.1k, False: 24.2k]
  ------------------
 9104|  61.1k|            nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  61.1k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9105|  61.1k|        } else {
 9106|  24.2k|            haprefix.name = aprefix;
 9107|  24.2k|            haprefix.hashValue = (size_t) atts[i+2];
 9108|  24.2k|            nsIndex = xmlParserNsLookup(ctxt, &haprefix, NULL);
 9109|       |
 9110|  24.2k|	    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9110:10): [True: 12.9k, False: 11.3k]
  |  Branch (9110:34): [True: 197, False: 11.1k]
  ------------------
 9111|  13.1k|                xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9112|  13.1k|		    "Namespace prefix %s for %s on %s is not defined\n",
 9113|  13.1k|		    aprefix, attname, localname);
 9114|  13.1k|                nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|  13.1k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9115|  13.1k|            }
 9116|  24.2k|        }
 9117|       |
 9118|   139k|        atts[i+2] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   139k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9119|   139k|    }
 9120|       |
 9121|       |    /*
 9122|       |     * Maximum number of attributes including default attributes.
 9123|       |     */
 9124|   824k|    maxAtts = nratts + nbTotalDef;
 9125|       |
 9126|       |    /*
 9127|       |     * Verify that attribute names are unique.
 9128|       |     */
 9129|   824k|    if (maxAtts > 1) {
  ------------------
  |  Branch (9129:9): [True: 59.5k, False: 765k]
  ------------------
 9130|  59.5k|        attrHashSize = 4;
 9131|   147k|        while (attrHashSize / 2 < (unsigned) maxAtts)
  ------------------
  |  Branch (9131:16): [True: 87.8k, False: 59.5k]
  ------------------
 9132|  87.8k|            attrHashSize *= 2;
 9133|       |
 9134|  59.5k|        if (attrHashSize > ctxt->attrHashMax) {
  ------------------
  |  Branch (9134:13): [True: 7.08k, False: 52.4k]
  ------------------
 9135|  7.08k|            xmlAttrHashBucket *tmp;
 9136|       |
 9137|  7.08k|            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
 9138|  7.08k|            if (tmp == NULL) {
  ------------------
  |  Branch (9138:17): [True: 1, False: 7.07k]
  ------------------
 9139|      1|                xmlErrMemory(ctxt);
 9140|      1|                goto done;
 9141|      1|            }
 9142|       |
 9143|  7.07k|            ctxt->attrHash = tmp;
 9144|  7.07k|            ctxt->attrHashMax = attrHashSize;
 9145|  7.07k|        }
 9146|       |
 9147|  59.5k|        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
 9148|       |
 9149|   165k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9149:28): [True: 105k, False: 59.5k]
  ------------------
 9150|   105k|            const xmlChar *nsuri;
 9151|   105k|            unsigned hashValue, nameHashValue, uriHashValue;
 9152|   105k|            int res;
 9153|       |
 9154|   105k|            attname = atts[i];
 9155|   105k|            aprefix = atts[i+1];
 9156|   105k|            nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   105k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9157|       |            /* Hash values always have bit 31 set, see dict.c */
 9158|   105k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9159|       |
 9160|   105k|            if (nsIndex == NS_INDEX_EMPTY) {
  ------------------
  |  |   80|   105k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (9160:17): [True: 40.4k, False: 65.4k]
  ------------------
 9161|       |                /*
 9162|       |                 * Prefix with empty namespace means an undeclared
 9163|       |                 * prefix which was already reported above.
 9164|       |                 */
 9165|  40.4k|                if (aprefix != NULL)
  ------------------
  |  Branch (9165:21): [True: 10.6k, False: 29.7k]
  ------------------
 9166|  10.6k|                    continue;
 9167|  29.7k|                nsuri = NULL;
 9168|  29.7k|                uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|  29.7k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9169|  65.4k|            } else if (nsIndex == NS_INDEX_XML) {
  ------------------
  |  |   81|  65.4k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (9169:24): [True: 55.2k, False: 10.2k]
  ------------------
 9170|  55.2k|                nsuri = ctxt->str_xml_ns;
 9171|  55.2k|                uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  55.2k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9172|  55.2k|            } else {
 9173|  10.2k|                nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9174|  10.2k|                uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9175|  10.2k|            }
 9176|       |
 9177|  95.1k|            hashValue = xmlDictCombineHash(nameHashValue, uriHashValue);
 9178|  95.1k|            res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9179|  95.1k|                                    hashValue, i);
 9180|  95.1k|            if (res < 0)
  ------------------
  |  Branch (9180:17): [True: 0, False: 95.1k]
  ------------------
 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|  95.1k|            if (res < INT_MAX) {
  ------------------
  |  Branch (9189:17): [True: 63.8k, False: 31.2k]
  ------------------
 9190|  63.8k|                if (aprefix == atts[res+1]) {
  ------------------
  |  Branch (9190:21): [True: 60.4k, False: 3.42k]
  ------------------
 9191|  60.4k|                    xmlErrAttributeDup(ctxt, aprefix, attname);
 9192|  60.4k|                    numDupErr += 1;
 9193|  60.4k|                } else {
 9194|  3.42k|                    xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9195|  3.42k|                             "Namespaced Attribute %s in '%s' redefined\n",
 9196|  3.42k|                             attname, nsuri, NULL);
 9197|  3.42k|                    numNsErr += 1;
 9198|  3.42k|                }
 9199|  63.8k|            }
 9200|  95.1k|        }
 9201|  59.5k|    }
 9202|       |
 9203|       |    /*
 9204|       |     * Default attributes
 9205|       |     */
 9206|   824k|    if (ctxt->attsDefault != NULL) {
  ------------------
  |  Branch (9206:9): [True: 350k, False: 474k]
  ------------------
 9207|   350k|        xmlDefAttrsPtr defaults;
 9208|       |
 9209|   350k|	defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
 9210|   350k|	if (defaults != NULL) {
  ------------------
  |  Branch (9210:6): [True: 274k, False: 76.0k]
  ------------------
 9211|  1.03M|	    for (i = 0; i < defaults->nbAttrs; i++) {
  ------------------
  |  Branch (9211:18): [True: 760k, False: 274k]
  ------------------
 9212|   760k|                xmlDefAttr *attr = &defaults->attrs[i];
 9213|   760k|                const xmlChar *nsuri = NULL;
 9214|   760k|                unsigned hashValue, uriHashValue = 0;
 9215|   760k|                int res;
 9216|       |
 9217|   760k|	        attname = attr->name.name;
 9218|   760k|		aprefix = attr->prefix.name;
 9219|       |
 9220|   760k|		if ((attname == ctxt->str_xmlns) && (aprefix == NULL))
  ------------------
  |  Branch (9220:7): [True: 38.4k, False: 722k]
  |  Branch (9220:39): [True: 36.5k, False: 1.96k]
  ------------------
 9221|  36.5k|                    continue;
 9222|   724k|		if (aprefix == ctxt->str_xmlns)
  ------------------
  |  Branch (9222:7): [True: 387k, False: 336k]
  ------------------
 9223|   387k|                    continue;
 9224|       |
 9225|   336k|                if (aprefix == NULL) {
  ------------------
  |  Branch (9225:21): [True: 145k, False: 190k]
  ------------------
 9226|   145k|                    nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   145k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9227|   145k|                    nsuri = NULL;
 9228|   145k|                    uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   145k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9229|   190k|                } else if (aprefix == ctxt->str_xml) {
  ------------------
  |  Branch (9229:28): [True: 51.8k, False: 139k]
  ------------------
 9230|  51.8k|                    nsIndex = NS_INDEX_XML;
  ------------------
  |  |   81|  51.8k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
 9231|  51.8k|                    nsuri = ctxt->str_xml_ns;
 9232|  51.8k|                    uriHashValue = URI_HASH_XML;
  ------------------
  |  |   83|  51.8k|#define URI_HASH_XML    0xF0451F02
  ------------------
 9233|   139k|                } else {
 9234|   139k|                    nsIndex = xmlParserNsLookup(ctxt, &attr->prefix, NULL);
 9235|   139k|                    if ((nsIndex == INT_MAX) ||
  ------------------
  |  Branch (9235:25): [True: 117k, False: 21.5k]
  ------------------
 9236|   117k|                        (nsIndex < ctxt->nsdb->minNsIndex)) {
  ------------------
  |  Branch (9236:25): [True: 253, False: 21.2k]
  ------------------
 9237|   117k|                        xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9238|   117k|                                 "Namespace prefix %s for %s on %s is not "
 9239|   117k|                                 "defined\n",
 9240|   117k|                                 aprefix, attname, localname);
 9241|   117k|                        nsIndex = NS_INDEX_EMPTY;
  ------------------
  |  |   80|   117k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
 9242|   117k|                        nsuri = NULL;
 9243|   117k|                        uriHashValue = URI_HASH_EMPTY;
  ------------------
  |  |   82|   117k|#define URI_HASH_EMPTY  0xD943A04E
  ------------------
 9244|   117k|                    } else {
 9245|  21.2k|                        nsuri = ctxt->nsTab[nsIndex * 2 + 1];
 9246|  21.2k|                        uriHashValue = ctxt->nsdb->extra[nsIndex].uriHashValue;
 9247|  21.2k|                    }
 9248|   139k|                }
 9249|       |
 9250|       |                /*
 9251|       |                 * Check whether the attribute exists
 9252|       |                 */
 9253|   336k|                if (maxAtts > 1) {
  ------------------
  |  Branch (9253:21): [True: 300k, False: 36.1k]
  ------------------
 9254|   300k|                    hashValue = xmlDictCombineHash(attr->name.hashValue,
 9255|   300k|                                                   uriHashValue);
 9256|   300k|                    res = xmlAttrHashInsert(ctxt, attrHashSize, attname, nsuri,
 9257|   300k|                                            hashValue, nbatts);
 9258|   300k|                    if (res < 0)
  ------------------
  |  Branch (9258:25): [True: 0, False: 300k]
  ------------------
 9259|      0|                        continue;
 9260|   300k|                    if (res < INT_MAX) {
  ------------------
  |  Branch (9260:25): [True: 9.87k, False: 290k]
  ------------------
 9261|  9.87k|                        if (aprefix == atts[res+1])
  ------------------
  |  Branch (9261:29): [True: 1.51k, False: 8.35k]
  ------------------
 9262|  1.51k|                            continue;
 9263|  8.35k|                        xmlNsErr(ctxt, XML_NS_ERR_ATTRIBUTE_REDEFINED,
 9264|  8.35k|                                 "Namespaced Attribute %s in '%s' redefined\n",
 9265|  8.35k|                                 attname, nsuri, NULL);
 9266|  8.35k|                    }
 9267|   300k|                }
 9268|       |
 9269|   334k|                xmlParserEntityCheck(ctxt, attr->expandedSize);
 9270|       |
 9271|   334k|                if ((atts == NULL) || (nbatts + 5 > maxatts)) {
  ------------------
  |  Branch (9271:21): [True: 1.42k, False: 333k]
  |  Branch (9271:39): [True: 1.14k, False: 332k]
  ------------------
 9272|  2.56k|                    res = xmlCtxtGrowAttrs(ctxt);
 9273|       |
 9274|  2.56k|                    maxatts = ctxt->maxatts;
 9275|  2.56k|                    atts = ctxt->atts;
 9276|       |
 9277|  2.56k|                    if (res < 0) {
  ------------------
  |  Branch (9277:25): [True: 4, False: 2.56k]
  ------------------
 9278|      4|                        localname = NULL;
 9279|      4|                        goto done;
 9280|      4|                    }
 9281|  2.56k|                }
 9282|       |
 9283|   334k|                atts[nbatts++] = attname;
 9284|   334k|                atts[nbatts++] = aprefix;
 9285|   334k|                atts[nbatts++] = XML_INT_TO_PTR(nsIndex);
  ------------------
  |  |   59|   334k|#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
  ------------------
 9286|   334k|                atts[nbatts++] = attr->value.name;
 9287|   334k|                atts[nbatts++] = attr->valueEnd;
 9288|       |
 9289|   334k|#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|   334k|                if ((ctxt->validate) &&
  ------------------
  |  Branch (9294:21): [True: 193k, False: 141k]
  ------------------
 9295|   193k|                    (ctxt->standalone == 1) &&
  ------------------
  |  Branch (9295:21): [True: 912, False: 192k]
  ------------------
 9296|    912|                    (attr->external != 0)) {
  ------------------
  |  Branch (9296:21): [True: 691, False: 221]
  ------------------
 9297|    691|                    xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
 9298|    691|                            "standalone: attribute %s on %s defaulted "
 9299|    691|                            "from external subset\n",
 9300|    691|                            attname, localname);
 9301|    691|                }
 9302|   334k|#endif
 9303|   334k|                nbdef++;
 9304|   334k|	    }
 9305|   274k|	}
 9306|   350k|    }
 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|   824k|    if ((numDupErr == 0) && (numNsErr > 1)) {
  ------------------
  |  Branch (9320:9): [True: 823k, False: 1.52k]
  |  Branch (9320:29): [True: 1.01k, False: 822k]
  ------------------
 9321|  1.01k|        memset(ctxt->attrHash, -1,
 9322|  1.01k|               attrHashSize * sizeof(ctxt->attrHash[0]));
 9323|       |
 9324|  6.81k|        for (i = 0, j = 0; j < nratts; i += 5, j++) {
  ------------------
  |  Branch (9324:28): [True: 5.80k, False: 1.01k]
  ------------------
 9325|  5.80k|            unsigned hashValue, nameHashValue, prefixHashValue;
 9326|  5.80k|            int res;
 9327|       |
 9328|  5.80k|            aprefix = atts[i+1];
 9329|  5.80k|            if (aprefix == NULL)
  ------------------
  |  Branch (9329:17): [True: 333, False: 5.46k]
  ------------------
 9330|    333|                continue;
 9331|       |
 9332|  5.46k|            attname = atts[i];
 9333|       |            /* Hash values always have bit 31 set, see dict.c */
 9334|  5.46k|            nameHashValue = ctxt->attallocs[j] | 0x80000000;
 9335|  5.46k|            prefixHashValue = xmlDictComputeHash(ctxt->dict, aprefix);
 9336|       |
 9337|  5.46k|            hashValue = xmlDictCombineHash(nameHashValue, prefixHashValue);
 9338|  5.46k|            res = xmlAttrHashInsertQName(ctxt, attrHashSize, attname,
 9339|  5.46k|                                         aprefix, hashValue, i);
 9340|  5.46k|            if (res < INT_MAX)
  ------------------
  |  Branch (9340:17): [True: 2.42k, False: 3.04k]
  ------------------
 9341|  2.42k|                xmlErrAttributeDup(ctxt, aprefix, attname);
 9342|  5.46k|        }
 9343|  1.01k|    }
 9344|       |
 9345|       |    /*
 9346|       |     * Reconstruct attribute pointers
 9347|       |     */
 9348|  1.29M|    for (i = 0, j = 0; i < nbatts; i += 5, j++) {
  ------------------
  |  Branch (9348:24): [True: 473k, False: 824k]
  ------------------
 9349|       |        /* namespace URI */
 9350|   473k|        nsIndex = XML_PTR_TO_INT(atts[i+2]);
  ------------------
  |  |   58|   473k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9351|   473k|        if (nsIndex == INT_MAX)
  ------------------
  |  Branch (9351:13): [True: 328k, False: 144k]
  ------------------
 9352|   328k|            atts[i+2] = NULL;
 9353|   144k|        else if (nsIndex == INT_MAX - 1)
  ------------------
  |  Branch (9353:18): [True: 112k, False: 32.4k]
  ------------------
 9354|   112k|            atts[i+2] = ctxt->str_xml_ns;
 9355|  32.4k|        else
 9356|  32.4k|            atts[i+2] = ctxt->nsTab[nsIndex * 2 + 1];
 9357|       |
 9358|   473k|        if ((j < nratts) && (ctxt->attallocs[j] & 0x80000000) == 0) {
  ------------------
  |  Branch (9358:13): [True: 139k, False: 334k]
  |  Branch (9358:29): [True: 111k, False: 27.4k]
  ------------------
 9359|   111k|            atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  | 2265|   111k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+3] = BASE_PTR + XML_PTR_TO_INT(atts[i+3]);  /* value */
  ------------------
  |  |   58|   111k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9360|   111k|            atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  | 2265|   111k|#define BASE_PTR ctxt->input->base
  ------------------
                          atts[i+4] = BASE_PTR + XML_PTR_TO_INT(atts[i+4]);  /* valuend */
  ------------------
  |  |   58|   111k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 9361|   111k|        }
 9362|   473k|    }
 9363|       |
 9364|   824k|    uri = xmlParserNsLookupUri(ctxt, &hprefix);
 9365|   824k|    if ((prefix != NULL) && (uri == NULL)) {
  ------------------
  |  Branch (9365:9): [True: 98.9k, False: 725k]
  |  Branch (9365:29): [True: 36.1k, False: 62.7k]
  ------------------
 9366|  36.1k|	xmlNsErr(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
 9367|  36.1k|	         "Namespace prefix %s on %s is not defined\n",
 9368|  36.1k|		 prefix, localname, NULL);
 9369|  36.1k|    }
 9370|   824k|    *pref = prefix;
 9371|   824k|    *URI = uri;
 9372|       |
 9373|       |    /*
 9374|       |     * SAX callback
 9375|       |     */
 9376|   824k|    if ((ctxt->sax != NULL) && (ctxt->sax->startElementNs != NULL) &&
  ------------------
  |  Branch (9376:9): [True: 824k, False: 0]
  |  Branch (9376:32): [True: 824k, False: 0]
  ------------------
 9377|   824k|	(!ctxt->disableSAX)) {
  ------------------
  |  Branch (9377:2): [True: 563k, False: 261k]
  ------------------
 9378|   563k|	if (nbNs > 0)
  ------------------
  |  Branch (9378:6): [True: 122k, False: 440k]
  ------------------
 9379|   122k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9380|   122k|                          nbNs, ctxt->nsTab + 2 * (ctxt->nsNr - nbNs),
 9381|   122k|			  nbatts / 5, nbdef, atts);
 9382|   440k|	else
 9383|   440k|	    ctxt->sax->startElementNs(ctxt->userData, localname, prefix, uri,
 9384|   440k|                          0, NULL, nbatts / 5, nbdef, atts);
 9385|   563k|    }
 9386|       |
 9387|   824k|done:
 9388|       |    /*
 9389|       |     * Free allocated attribute values
 9390|       |     */
 9391|   824k|    if (attval != 0) {
  ------------------
  |  Branch (9391:9): [True: 12.3k, False: 812k]
  ------------------
 9392|  89.5k|	for (i = 0, j = 0; j < nratts; i += 5, j++)
  ------------------
  |  Branch (9392:21): [True: 77.1k, False: 12.3k]
  ------------------
 9393|  77.1k|	    if (ctxt->attallocs[j] & 0x80000000)
  ------------------
  |  Branch (9393:10): [True: 27.4k, False: 49.7k]
  ------------------
 9394|  27.4k|	        xmlFree((xmlChar *) atts[i+3]);
 9395|  12.3k|    }
 9396|       |
 9397|   824k|    *nbNsPtr = nbNs;
 9398|   824k|    return(localname);
 9399|   824k|}
parser.c:xmlParserNsStartElement:
 1504|   848k|xmlParserNsStartElement(xmlParserNsData *nsdb) {
 1505|   848k|    if (nsdb->elementId == UINT_MAX)
  ------------------
  |  Branch (1505:9): [True: 0, False: 848k]
  ------------------
 1506|      0|        return(-1);
 1507|   848k|    nsdb->elementId++;
 1508|       |
 1509|   848k|    return(0);
 1510|   848k|}
parser.c:xmlParseQNameHashed:
 8429|  1.28M|xmlParseQNameHashed(xmlParserCtxtPtr ctxt, xmlHashedString *prefix) {
 8430|  1.28M|    xmlHashedString l, p;
 8431|  1.28M|    int start, isNCName = 0;
 8432|       |
 8433|  1.28M|    l.name = NULL;
 8434|  1.28M|    p.name = NULL;
 8435|       |
 8436|  1.28M|    GROW;
  ------------------
  |  | 2308|  1.28M|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  1.28M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  1.28M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 905k, False: 375k]
  |  |  ------------------
  |  | 2309|  1.28M|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   905k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 50.8k, False: 854k]
  |  |  ------------------
  |  | 2310|  1.28M|	xmlParserGrow(ctxt);
  ------------------
 8437|  1.28M|    start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|  1.28M|#define CUR_PTR ctxt->input->cur
  ------------------
                  start = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|  1.28M|#define BASE_PTR ctxt->input->base
  ------------------
 8438|       |
 8439|  1.28M|    l = xmlParseNCName(ctxt);
 8440|  1.28M|    if (l.name != NULL) {
  ------------------
  |  Branch (8440:9): [True: 1.07M, False: 206k]
  ------------------
 8441|  1.07M|        isNCName = 1;
 8442|  1.07M|        if (CUR == ':') {
  ------------------
  |  | 2262|  1.07M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8442:13): [True: 263k, False: 811k]
  ------------------
 8443|   263k|            NEXT;
  ------------------
  |  | 2316|   263k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8444|   263k|            p = l;
 8445|   263k|            l = xmlParseNCName(ctxt);
 8446|   263k|        }
 8447|  1.07M|    }
 8448|  1.28M|    if ((l.name == NULL) || (CUR == ':')) {
  ------------------
  |  | 2262|  1.07M|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8448:9): [True: 210k, False: 1.07M]
  |  Branch (8448:29): [True: 1.91k, False: 1.06M]
  ------------------
 8449|   212k|        xmlChar *tmp;
 8450|       |
 8451|   212k|        l.name = NULL;
 8452|   212k|        p.name = NULL;
 8453|   212k|        if ((isNCName == 0) && (CUR != ':'))
  ------------------
  |  | 2262|   206k|#define CUR (*ctxt->input->cur)
  ------------------
  |  Branch (8453:13): [True: 206k, False: 5.76k]
  |  Branch (8453:32): [True: 201k, False: 4.42k]
  ------------------
 8454|   201k|            return(l);
 8455|  10.1k|        tmp = xmlParseNmtoken(ctxt);
 8456|  10.1k|        if (tmp != NULL)
  ------------------
  |  Branch (8456:13): [True: 7.32k, False: 2.86k]
  ------------------
 8457|  7.32k|            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.07M|    *prefix = p;
 8469|  1.07M|    return(l);
 8470|  1.28M|}
parser.c:xmlParseNCName:
 3283|  1.54M|xmlParseNCName(xmlParserCtxtPtr ctxt) {
 3284|  1.54M|    const xmlChar *in, *e;
 3285|  1.54M|    xmlHashedString ret;
 3286|  1.54M|    size_t count = 0;
 3287|  1.54M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3287:24): [True: 945k, False: 599k]
  ------------------
 3288|   945k|                       XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   945k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3289|  1.54M|                       XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  2.14M|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3290|       |
 3291|  1.54M|    ret.name = NULL;
 3292|       |
 3293|       |    /*
 3294|       |     * Accelerator for simple ASCII names
 3295|       |     */
 3296|  1.54M|    in = ctxt->input->cur;
 3297|  1.54M|    e = ctxt->input->end;
 3298|  1.54M|    if ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3298:11): [True: 1.33M, False: 212k]
  |  Branch (3298:28): [True: 1.31M, False: 16.1k]
  ------------------
 3299|   228k|	 ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3299:4): [True: 32.2k, False: 196k]
  |  Branch (3299:21): [True: 13.9k, False: 18.3k]
  ------------------
 3300|  1.33M|	 (*in == '_')) && (in < e)) {
  ------------------
  |  Branch (3300:3): [True: 912, False: 213k]
  |  Branch (3300:20): [True: 1.33M, False: 0]
  ------------------
 3301|  1.33M|	in++;
 3302|  5.31M|	while ((((*in >= 0x61) && (*in <= 0x7A)) ||
  ------------------
  |  Branch (3302:11): [True: 3.18M, False: 2.13M]
  |  Branch (3302:28): [True: 3.17M, False: 9.72k]
  ------------------
 3303|  2.14M|	        ((*in >= 0x41) && (*in <= 0x5A)) ||
  ------------------
  |  Branch (3303:11): [True: 281k, False: 1.86M]
  |  Branch (3303:28): [True: 267k, False: 13.4k]
  ------------------
 3304|  1.87M|	        ((*in >= 0x30) && (*in <= 0x39)) ||
  ------------------
  |  Branch (3304:11): [True: 1.52M, False: 347k]
  |  Branch (3304:28): [True: 531k, False: 994k]
  ------------------
 3305|  1.34M|	        (*in == '_') || (*in == '-') ||
  ------------------
  |  Branch (3305:10): [True: 2.86k, False: 1.33M]
  |  Branch (3305:26): [True: 6.55k, False: 1.33M]
  ------------------
 3306|  3.98M|	        (*in == '.')) && (in < e))
  ------------------
  |  Branch (3306:10): [True: 1.80k, False: 1.33M]
  |  Branch (3306:27): [True: 3.98M, False: 0]
  ------------------
 3307|  3.98M|	    in++;
 3308|  1.33M|	if (in >= e)
  ------------------
  |  Branch (3308:6): [True: 556, False: 1.33M]
  ------------------
 3309|    556|	    goto complex;
 3310|  1.33M|	if ((*in > 0) && (*in < 0x80)) {
  ------------------
  |  Branch (3310:6): [True: 1.32M, False: 8.17k]
  |  Branch (3310:19): [True: 1.31M, False: 9.03k]
  ------------------
 3311|  1.31M|	    count = in - ctxt->input->cur;
 3312|  1.31M|            if (count > maxLength) {
  ------------------
  |  Branch (3312:17): [True: 23, False: 1.31M]
  ------------------
 3313|     23|                xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3314|     23|                return(ret);
 3315|     23|            }
 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: 4, False: 1.31M]
  ------------------
 3320|      4|	        xmlErrMemory(ctxt);
 3321|      4|	    }
 3322|  1.31M|	    return(ret);
 3323|  1.31M|	}
 3324|  1.33M|    }
 3325|   231k|complex:
 3326|   231k|    return(xmlParseNCNameComplex(ctxt));
 3327|  1.54M|}
parser.c:xmlParseNCNameComplex:
 3230|   231k|xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
 3231|   231k|    xmlHashedString ret;
 3232|   231k|    int len = 0, l;
 3233|   231k|    int c;
 3234|   231k|    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (3234:21): [True: 184k, False: 46.8k]
  ------------------
 3235|   184k|                    XML_MAX_TEXT_LENGTH :
  ------------------
  |  |   50|   184k|#define XML_MAX_TEXT_LENGTH 10000000
  ------------------
 3236|   231k|                    XML_MAX_NAME_LENGTH;
  ------------------
  |  |   65|  46.8k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 3237|   231k|    int old10 = (ctxt->options & XML_PARSE_OLD10) ? 1 : 0;
  ------------------
  |  Branch (3237:17): [True: 94.1k, False: 137k]
  ------------------
 3238|   231k|    size_t startPosition = 0;
 3239|       |
 3240|   231k|    ret.name = NULL;
 3241|   231k|    ret.hashValue = 0;
 3242|       |
 3243|       |    /*
 3244|       |     * Handler for more complex cases
 3245|       |     */
 3246|   231k|    startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2264|   231k|#define CUR_PTR ctxt->input->cur
  ------------------
                  startPosition = CUR_PTR - BASE_PTR;
  ------------------
  |  | 2265|   231k|#define BASE_PTR ctxt->input->base
  ------------------
 3247|   231k|    c = xmlCurrentChar(ctxt, &l);
 3248|   231k|    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
  ------------------
  |  Branch (3248:9): [True: 661, False: 230k]
  |  Branch (3248:23): [True: 1.48k, False: 229k]
  |  Branch (3248:37): [True: 7.49k, False: 221k]
  ------------------
 3249|   221k|	(!xmlIsNameStartChar(c, old10) || (c == ':'))) {
  ------------------
  |  Branch (3249:3): [True: 195k, False: 26.3k]
  |  Branch (3249:36): [True: 4.88k, False: 21.4k]
  ------------------
 3250|   210k|	return(ret);
 3251|   210k|    }
 3252|       |
 3253|  5.52M|    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
  ------------------
  |  Branch (3253:12): [True: 5.52M, False: 542]
  |  Branch (3253:26): [True: 5.52M, False: 994]
  |  Branch (3253:40): [True: 5.52M, False: 243]
  ------------------
 3254|  5.52M|	   (xmlIsNameChar(c, old10) && (c != ':'))) {
  ------------------
  |  Branch (3254:6): [True: 5.50M, False: 18.6k]
  |  Branch (3254:33): [True: 5.50M, False: 1.05k]
  ------------------
 3255|  5.50M|        if (len <= INT_MAX - l)
  ------------------
  |  Branch (3255:13): [True: 5.50M, False: 0]
  ------------------
 3256|  5.50M|	    len += l;
 3257|  5.50M|	NEXTL(l);
  ------------------
  |  | 2325|  5.50M|#define NEXTL(l) do {							\
  |  | 2326|  5.50M|    if (*(ctxt->input->cur) == '\n') {					\
  |  |  ------------------
  |  |  |  Branch (2326:9): [True: 0, False: 5.50M]
  |  |  ------------------
  |  | 2327|      0|	ctxt->input->line++; ctxt->input->col = 1;			\
  |  | 2328|  5.50M|    } else ctxt->input->col++;						\
  |  | 2329|  5.50M|    ctxt->input->cur += l;				\
  |  | 2330|  5.50M|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2330:12): [Folded, False: 5.50M]
  |  |  ------------------
  ------------------
 3258|  5.50M|	c = xmlCurrentChar(ctxt, &l);
 3259|  5.50M|    }
 3260|  21.4k|    if (len > maxLength) {
  ------------------
  |  Branch (3260:9): [True: 48, False: 21.3k]
  ------------------
 3261|     48|        xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
 3262|     48|        return(ret);
 3263|     48|    }
 3264|  21.3k|    ret = xmlDictLookupHashed(ctxt->dict, (BASE_PTR + startPosition), len);
  ------------------
  |  | 2265|  21.3k|#define BASE_PTR ctxt->input->base
  ------------------
 3265|  21.3k|    if (ret.name == NULL)
  ------------------
  |  Branch (3265:9): [True: 2, False: 21.3k]
  ------------------
 3266|      2|        xmlErrMemory(ctxt);
 3267|  21.3k|    return(ret);
 3268|  21.4k|}
parser.c:xmlParseAttribute2:
 8567|   419k|{
 8568|   419k|    xmlHashedString hname;
 8569|   419k|    const xmlChar *prefix, *name;
 8570|   419k|    xmlChar *val = NULL, *internal_val = NULL;
 8571|   419k|    int special = 0;
 8572|   419k|    int isNamespace;
 8573|   419k|    int flags;
 8574|       |
 8575|   419k|    *value = NULL;
 8576|   419k|    GROW;
  ------------------
  |  | 2308|   419k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   419k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   419k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 276k, False: 143k]
  |  |  ------------------
  |  | 2309|   419k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   276k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 14.1k, False: 261k]
  |  |  ------------------
  |  | 2310|   419k|	xmlParserGrow(ctxt);
  ------------------
 8577|   419k|    hname = xmlParseQNameHashed(ctxt, hprefix);
 8578|   419k|    if (hname.name == NULL) {
  ------------------
  |  Branch (8578:9): [True: 177k, False: 242k]
  ------------------
 8579|   177k|        xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
 8580|   177k|                       "error parsing attribute name\n");
 8581|   177k|        return(hname);
 8582|   177k|    }
 8583|   242k|    name = hname.name;
 8584|   242k|    prefix = hprefix->name;
 8585|       |
 8586|       |    /*
 8587|       |     * get the type if needed
 8588|       |     */
 8589|   242k|    if (ctxt->attsSpecial != NULL) {
  ------------------
  |  Branch (8589:9): [True: 38.9k, False: 203k]
  ------------------
 8590|  38.9k|        special = XML_PTR_TO_INT(xmlHashQLookup2(ctxt->attsSpecial, pref, elem,
  ------------------
  |  |   58|  38.9k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8591|  38.9k|                                              prefix, name));
 8592|  38.9k|    }
 8593|       |
 8594|       |    /*
 8595|       |     * read the value
 8596|       |     */
 8597|   242k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   242k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8598|   242k|    if (RAW != '=') {
  ------------------
  |  | 2261|   242k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8598:9): [True: 18.7k, False: 223k]
  ------------------
 8599|  18.7k|        xmlFatalErrMsgStr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
 8600|  18.7k|                          "Specification mandates value for attribute %s\n",
 8601|  18.7k|                          name);
 8602|  18.7k|        goto error;
 8603|  18.7k|    }
 8604|       |
 8605|       |
 8606|   223k|    NEXT;
  ------------------
  |  | 2316|   223k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8607|   223k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   223k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8608|   223k|    flags = 0;
 8609|   223k|    isNamespace = (((prefix == NULL) && (name == ctxt->str_xmlns)) ||
  ------------------
  |  Branch (8609:21): [True: 71.5k, False: 151k]
  |  Branch (8609:41): [True: 14.8k, False: 56.6k]
  ------------------
 8610|   208k|                   (prefix == ctxt->str_xmlns));
  ------------------
  |  Branch (8610:20): [True: 65.4k, False: 143k]
  ------------------
 8611|   223k|    val = xmlParseAttValueInternal(ctxt, len, &flags, special,
 8612|   223k|                                   isNamespace);
 8613|   223k|    if (val == NULL)
  ------------------
  |  Branch (8613:9): [True: 4.60k, False: 218k]
  ------------------
 8614|  4.60k|        goto error;
 8615|       |
 8616|   218k|    *alloc = (flags & XML_ATTVAL_ALLOC) != 0;
  ------------------
  |  |   98|   218k|#define XML_ATTVAL_ALLOC        (1 << 0)
  ------------------
 8617|       |
 8618|   218k|#ifdef LIBXML_VALID_ENABLED
 8619|   218k|    if ((ctxt->validate) &&
  ------------------
  |  Branch (8619:9): [True: 58.6k, False: 160k]
  ------------------
 8620|  58.6k|        (ctxt->standalone == 1) &&
  ------------------
  |  Branch (8620:9): [True: 428, False: 58.1k]
  ------------------
 8621|    428|        (special & XML_SPECIAL_EXTERNAL) &&
  ------------------
  |  |   95|    428|#define XML_SPECIAL_EXTERNAL    (1 << 20)
  ------------------
  |  Branch (8621:9): [True: 105, False: 323]
  ------------------
 8622|    105|        (flags & XML_ATTVAL_NORM_CHANGE)) {
  ------------------
  |  |   99|    105|#define XML_ATTVAL_NORM_CHANGE  (1 << 1)
  ------------------
  |  Branch (8622:9): [True: 36, False: 69]
  ------------------
 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|   218k|#endif
 8629|       |
 8630|   218k|    if (prefix == ctxt->str_xml) {
  ------------------
  |  Branch (8630:9): [True: 61.1k, False: 157k]
  ------------------
 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|  61.1k|        if ((ctxt->pedantic) && (xmlStrEqual(name, BAD_CAST "lang"))) {
  ------------------
  |  |   34|  35.2k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8636:13): [True: 35.2k, False: 25.9k]
  |  Branch (8636:33): [True: 32.8k, False: 2.41k]
  ------------------
 8637|  32.8k|            internal_val = xmlStrndup(val, *len);
 8638|  32.8k|            if (internal_val == NULL)
  ------------------
  |  Branch (8638:17): [True: 2, False: 32.8k]
  ------------------
 8639|      2|                goto mem_error;
 8640|  32.8k|            if (!xmlCheckLanguageID(internal_val)) {
  ------------------
  |  Branch (8640:17): [True: 28.6k, False: 4.20k]
  ------------------
 8641|  28.6k|                xmlWarningMsg(ctxt, XML_WAR_LANG_VALUE,
 8642|  28.6k|                              "Malformed value for xml:lang : %s\n",
 8643|  28.6k|                              internal_val, NULL);
 8644|  28.6k|            }
 8645|  32.8k|        }
 8646|       |
 8647|       |        /*
 8648|       |         * Check that xml:space conforms to the specification
 8649|       |         */
 8650|  61.1k|        if (xmlStrEqual(name, BAD_CAST "space")) {
  ------------------
  |  |   34|  61.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8650:13): [True: 690, False: 60.5k]
  ------------------
 8651|    690|            internal_val = xmlStrndup(val, *len);
 8652|    690|            if (internal_val == NULL)
  ------------------
  |  Branch (8652:17): [True: 1, False: 689]
  ------------------
 8653|      1|                goto mem_error;
 8654|    689|            if (xmlStrEqual(internal_val, BAD_CAST "default"))
  ------------------
  |  |   34|    689|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8654:17): [True: 239, False: 450]
  ------------------
 8655|    239|                *(ctxt->space) = 0;
 8656|    450|            else if (xmlStrEqual(internal_val, BAD_CAST "preserve"))
  ------------------
  |  |   34|    450|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8656:22): [True: 214, False: 236]
  ------------------
 8657|    214|                *(ctxt->space) = 1;
 8658|    236|            else {
 8659|    236|                xmlWarningMsg(ctxt, XML_WAR_SPACE_VALUE,
 8660|    236|                              "Invalid value \"%s\" for xml:space : \"default\" or \"preserve\" expected\n",
 8661|    236|                              internal_val, NULL);
 8662|    236|            }
 8663|    689|        }
 8664|  61.1k|        if (internal_val) {
  ------------------
  |  Branch (8664:13): [True: 33.5k, False: 27.6k]
  ------------------
 8665|  33.5k|            xmlFree(internal_val);
 8666|  33.5k|        }
 8667|  61.1k|    }
 8668|       |
 8669|   218k|    *value = val;
 8670|   218k|    return (hname);
 8671|       |
 8672|      3|mem_error:
 8673|      3|    xmlErrMemory(ctxt);
 8674|  23.3k|error:
 8675|  23.3k|    if ((val != NULL) && (*alloc != 0))
  ------------------
  |  Branch (8675:9): [True: 3, False: 23.3k]
  |  Branch (8675:26): [True: 1, False: 2]
  ------------------
 8676|      1|        xmlFree(val);
 8677|  23.3k|    return(hname);
 8678|      3|}
parser.c:xmlNsWarn:
  406|  17.3k|{
  407|       |    xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING,
  408|  17.3k|               info1, info2, info3, 0, msg, info1, info2, info3);
  409|  17.3k|}
parser.c:xmlCtxtGrowAttrs:
 1886|  24.7k|xmlCtxtGrowAttrs(xmlParserCtxtPtr ctxt) {
 1887|  24.7k|    const xmlChar **atts;
 1888|  24.7k|    unsigned *attallocs;
 1889|  24.7k|    int newSize;
 1890|       |
 1891|  24.7k|    newSize = xmlGrowCapacity(ctxt->maxatts / 5,
 1892|  24.7k|                              sizeof(atts[0]) * 5 + sizeof(attallocs[0]),
 1893|  24.7k|                              10, XML_MAX_ATTRS);
  ------------------
  |  |   93|  24.7k|#define XML_MAX_ATTRS 100000000 /* 100 million */
  ------------------
 1894|  24.7k|    if (newSize < 0) {
  ------------------
  |  Branch (1894:9): [True: 0, False: 24.7k]
  ------------------
 1895|      0|        xmlFatalErr(ctxt, XML_ERR_RESOURCE_LIMIT,
 1896|      0|                    "Maximum number of attributes exceeded");
 1897|      0|        return(-1);
 1898|      0|    }
 1899|       |
 1900|  24.7k|    atts = xmlRealloc(ctxt->atts, newSize * sizeof(atts[0]) * 5);
 1901|  24.7k|    if (atts == NULL)
  ------------------
  |  Branch (1901:9): [True: 5, False: 24.7k]
  ------------------
 1902|      5|        goto mem_error;
 1903|  24.7k|    ctxt->atts = atts;
 1904|       |
 1905|  24.7k|    attallocs = xmlRealloc(ctxt->attallocs,
 1906|  24.7k|                           newSize * sizeof(attallocs[0]));
 1907|  24.7k|    if (attallocs == NULL)
  ------------------
  |  Branch (1907:9): [True: 7, False: 24.7k]
  ------------------
 1908|      7|        goto mem_error;
 1909|  24.7k|    ctxt->attallocs = attallocs;
 1910|       |
 1911|  24.7k|    ctxt->maxatts = newSize * 5;
 1912|       |
 1913|  24.7k|    return(0);
 1914|       |
 1915|     12|mem_error:
 1916|     12|    xmlErrMemory(ctxt);
 1917|     12|    return(-1);
 1918|  24.7k|}
parser.c:xmlAttrHashInsert:
 8694|   395k|                  const xmlChar *uri, unsigned hashValue, int aindex) {
 8695|   395k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8696|   395k|    xmlAttrHashBucket *bucket;
 8697|   395k|    unsigned hindex;
 8698|       |
 8699|   395k|    hindex = hashValue & (size - 1);
 8700|   395k|    bucket = &table[hindex];
 8701|       |
 8702|   445k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8702:12): [True: 123k, False: 321k]
  ------------------
 8703|   123k|        const xmlChar **atts = &ctxt->atts[bucket->index];
 8704|       |
 8705|   123k|        if (name == atts[0]) {
  ------------------
  |  Branch (8705:13): [True: 75.0k, False: 48.8k]
  ------------------
 8706|  75.0k|            int nsIndex = XML_PTR_TO_INT(atts[2]);
  ------------------
  |  |   58|  75.0k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 8707|       |
 8708|  75.0k|            if ((nsIndex == NS_INDEX_EMPTY) ? (uri == NULL) :
  ------------------
  |  |   80|  75.0k|#define NS_INDEX_EMPTY  INT_MAX
  ------------------
  |  Branch (8708:17): [True: 13.1k, False: 61.8k]
  |  Branch (8708:17): [True: 73.7k, False: 1.27k]
  ------------------
 8709|  75.0k|                (nsIndex == NS_INDEX_XML) ? (uri == ctxt->str_xml_ns) :
  ------------------
  |  |   81|  61.8k|#define NS_INDEX_XML    (INT_MAX - 1)
  ------------------
  |  Branch (8709:17): [True: 53.6k, False: 8.19k]
  ------------------
 8710|  61.8k|                (uri == ctxt->nsTab[nsIndex * 2 + 1]))
 8711|  73.7k|                return(bucket->index);
 8712|  75.0k|        }
 8713|       |
 8714|  50.1k|        hindex++;
 8715|  50.1k|        bucket++;
 8716|  50.1k|        if (hindex >= size) {
  ------------------
  |  Branch (8716:13): [True: 3.44k, False: 46.6k]
  ------------------
 8717|  3.44k|            hindex = 0;
 8718|  3.44k|            bucket = table;
 8719|  3.44k|        }
 8720|  50.1k|    }
 8721|       |
 8722|   321k|    bucket->index = aindex;
 8723|       |
 8724|       |    return(INT_MAX);
 8725|   395k|}
parser.c:xmlAttrHashInsertQName:
 8730|  5.46k|                       unsigned hashValue, int aindex) {
 8731|  5.46k|    xmlAttrHashBucket *table = ctxt->attrHash;
 8732|  5.46k|    xmlAttrHashBucket *bucket;
 8733|  5.46k|    unsigned hindex;
 8734|       |
 8735|  5.46k|    hindex = hashValue & (size - 1);
 8736|  5.46k|    bucket = &table[hindex];
 8737|       |
 8738|  6.92k|    while (bucket->index >= 0) {
  ------------------
  |  Branch (8738:12): [True: 3.88k, False: 3.04k]
  ------------------
 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: 631]
  |  Branch (8741:34): [True: 2.42k, False: 826]
  ------------------
 8742|  2.42k|            return(bucket->index);
 8743|       |
 8744|  1.45k|        hindex++;
 8745|  1.45k|        bucket++;
 8746|  1.45k|        if (hindex >= size) {
  ------------------
  |  Branch (8746:13): [True: 202, False: 1.25k]
  ------------------
 8747|    202|            hindex = 0;
 8748|    202|            bucket = table;
 8749|    202|        }
 8750|  1.45k|    }
 8751|       |
 8752|  3.04k|    bucket->index = aindex;
 8753|       |
 8754|       |    return(INT_MAX);
 8755|  5.46k|}
parser.c:xmlParserNsLookupUri:
 1573|   824k|xmlParserNsLookupUri(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix) {
 1574|   824k|    const xmlChar *ret;
 1575|   824k|    int nsIndex;
 1576|       |
 1577|   824k|    if (prefix->name == ctxt->str_xml)
  ------------------
  |  Branch (1577:9): [True: 511, False: 824k]
  ------------------
 1578|    511|        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|   824k|    nsIndex = xmlParserNsLookup(ctxt, prefix, NULL);
 1585|   824k|    if ((nsIndex == INT_MAX) || (nsIndex < ctxt->nsdb->minNsIndex))
  ------------------
  |  Branch (1585:9): [True: 692k, False: 131k]
  |  Branch (1585:33): [True: 589, False: 131k]
  ------------------
 1586|   692k|        return(NULL);
 1587|       |
 1588|   131k|    ret = ctxt->nsTab[nsIndex * 2 + 1];
 1589|   131k|    if (ret[0] == 0)
  ------------------
  |  Branch (1589:9): [True: 10.2k, False: 121k]
  ------------------
 1590|  10.2k|        ret = NULL;
 1591|   131k|    return(ret);
 1592|   824k|}
parser.c:nameNsPush:
 2098|  1.11M|{
 2099|  1.11M|    xmlStartTag *tag;
 2100|       |
 2101|  1.11M|    if (ctxt->nameNr >= ctxt->nameMax) {
  ------------------
  |  Branch (2101:9): [True: 47.3k, False: 1.06M]
  ------------------
 2102|  47.3k|        const xmlChar **tmp;
 2103|  47.3k|        xmlStartTag *tmp2;
 2104|  47.3k|        int newSize;
 2105|       |
 2106|  47.3k|        newSize = xmlGrowCapacity(ctxt->nameMax,
 2107|  47.3k|                                  sizeof(tmp[0]) + sizeof(tmp2[0]),
 2108|  47.3k|                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  47.3k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 2109|  47.3k|        if (newSize < 0)
  ------------------
  |  Branch (2109:13): [True: 0, False: 47.3k]
  ------------------
 2110|      0|            goto mem_error;
 2111|       |
 2112|  47.3k|        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
 2113|  47.3k|        if (tmp == NULL)
  ------------------
  |  Branch (2113:13): [True: 17, False: 47.3k]
  ------------------
 2114|     17|	    goto mem_error;
 2115|  47.3k|	ctxt->nameTab = tmp;
 2116|       |
 2117|  47.3k|        tmp2 = xmlRealloc(ctxt->pushTab, newSize * sizeof(tmp2[0]));
 2118|  47.3k|        if (tmp2 == NULL)
  ------------------
  |  Branch (2118:13): [True: 15, False: 47.3k]
  ------------------
 2119|     15|	    goto mem_error;
 2120|  47.3k|	ctxt->pushTab = tmp2;
 2121|       |
 2122|  47.3k|        ctxt->nameMax = newSize;
 2123|  1.06M|    } else if (ctxt->pushTab == NULL) {
  ------------------
  |  Branch (2123:16): [True: 30.0k, False: 1.03M]
  ------------------
 2124|  30.0k|        ctxt->pushTab = xmlMalloc(ctxt->nameMax * sizeof(ctxt->pushTab[0]));
 2125|  30.0k|        if (ctxt->pushTab == NULL)
  ------------------
  |  Branch (2125:13): [True: 12, False: 30.0k]
  ------------------
 2126|     12|            goto mem_error;
 2127|  30.0k|    }
 2128|  1.11M|    ctxt->nameTab[ctxt->nameNr] = value;
 2129|  1.11M|    ctxt->name = value;
 2130|  1.11M|    tag = &ctxt->pushTab[ctxt->nameNr];
 2131|  1.11M|    tag->prefix = prefix;
 2132|  1.11M|    tag->URI = URI;
 2133|  1.11M|    tag->line = line;
 2134|  1.11M|    tag->nsNr = nsNr;
 2135|  1.11M|    return (ctxt->nameNr++);
 2136|     44|mem_error:
 2137|     44|    xmlErrMemory(ctxt);
 2138|     44|    return (-1);
 2139|  1.11M|}
parser.c:xmlParseElementEnd:
 9856|   309k|xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
 9857|   309k|    xmlNodePtr cur = ctxt->node;
 9858|       |
 9859|   309k|    if (ctxt->nameNr <= 0) {
  ------------------
  |  Branch (9859:9): [True: 4, False: 309k]
  ------------------
 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|   309k|    if (ctxt->sax2) {
  ------------------
  |  Branch (9868:9): [True: 208k, False: 101k]
  ------------------
 9869|   208k|	xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
 9870|   208k|	namePop(ctxt);
 9871|   208k|    }
 9872|   101k|#ifdef LIBXML_SAX1_ENABLED
 9873|   101k|    else
 9874|   101k|	xmlParseEndTag1(ctxt, 0);
 9875|   309k|#endif /* LIBXML_SAX1_ENABLED */
 9876|       |
 9877|       |    /*
 9878|       |     * Capture end position
 9879|       |     */
 9880|   309k|    if (cur != NULL && ctxt->record_info) {
  ------------------
  |  Branch (9880:9): [True: 219k, False: 90.3k]
  |  Branch (9880:24): [True: 0, False: 219k]
  ------------------
 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|   309k|}
parser.c:xmlParseEndTag2:
 9414|   233k|xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
 9415|   233k|    const xmlChar *name;
 9416|       |
 9417|   233k|    GROW;
  ------------------
  |  | 2308|   233k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   233k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   233k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 208k, False: 24.6k]
  |  |  ------------------
  |  | 2309|   233k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   208k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.2k, False: 196k]
  |  |  ------------------
  |  | 2310|   233k|	xmlParserGrow(ctxt);
  ------------------
 9418|   233k|    if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2261|   233k|#define RAW (*ctxt->input->cur)
  ------------------
                  if ((RAW != '<') || (NXT(1) != '/')) {
  ------------------
  |  | 2263|   233k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (9418:9): [True: 39, False: 233k]
  |  Branch (9418:25): [True: 26, False: 233k]
  ------------------
 9419|     65|	xmlFatalErr(ctxt, XML_ERR_LTSLASH_REQUIRED, NULL);
 9420|     65|	return;
 9421|     65|    }
 9422|   233k|    SKIP(2);
  ------------------
  |  | 2285|   233k|#define SKIP(val) do {							\
  |  | 2286|   233k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   233k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 1.25k, False: 231k]
  |  |  ------------------
  |  | 2288|   233k|        xmlParserGrow(ctxt);						\
  |  | 2289|   233k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 233k]
  |  |  ------------------
  ------------------
 9423|       |
 9424|   233k|    if (tag->prefix == NULL)
  ------------------
  |  Branch (9424:9): [True: 214k, False: 18.5k]
  ------------------
 9425|   214k|        name = xmlParseNameAndCompare(ctxt, ctxt->name);
 9426|  18.5k|    else
 9427|  18.5k|        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 9428|       |
 9429|       |    /*
 9430|       |     * We should definitely be at the ending "S? '>'" part
 9431|       |     */
 9432|   233k|    GROW;
  ------------------
  |  | 2308|   233k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   233k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   233k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 208k, False: 24.6k]
  |  |  ------------------
  |  | 2309|   233k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   208k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 12.3k, False: 196k]
  |  |  ------------------
  |  | 2310|   233k|	xmlParserGrow(ctxt);
  ------------------
 9433|   233k|    SKIP_BLANKS;
  ------------------
  |  | 2312|   233k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 9434|   233k|    if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  |  103|   233k|#define IS_BYTE_CHAR(c)	 xmlIsChar_ch(c)
  |  |  ------------------
  |  |  |  |  108|   233k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (108:28): [True: 224k, False: 8.98k]
  |  |  |  |  |  Branch (108:44): [True: 0, False: 224k]
  |  |  |  |  ------------------
  |  |  |  |  109|   233k|				 ((c) == 0xd) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (109:6): [True: 0, False: 233k]
  |  |  |  |  ------------------
  |  |  |  |  110|   233k|				  (0x20 <= (c)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (110:7): [True: 223k, False: 9.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ((!IS_BYTE_CHAR(RAW)) || (RAW != '>')) {
  ------------------
  |  | 2261|   223k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (9434:33): [True: 15.2k, False: 208k]
  ------------------
 9435|  24.6k|	xmlFatalErr(ctxt, XML_ERR_GT_REQUIRED, NULL);
 9436|  24.6k|    } else
 9437|   208k|	NEXT1;
  ------------------
  |  | 2318|   208k|#define NEXT1 {								\
  |  | 2319|   208k|	ctxt->input->col++;						\
  |  | 2320|   208k|	ctxt->input->cur++;						\
  |  | 2321|   208k|	if (*ctxt->input->cur == 0)					\
  |  |  ------------------
  |  |  |  Branch (2321:6): [True: 1.28k, False: 207k]
  |  |  ------------------
  |  | 2322|   208k|	    xmlParserGrow(ctxt);						\
  |  | 2323|   208k|    }
  ------------------
 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|   233k|    if (name != (xmlChar*)1) {
  ------------------
  |  Branch (9445:9): [True: 19.6k, False: 213k]
  ------------------
 9446|  19.6k|        if (name == NULL) name = BAD_CAST "unparsable";
  ------------------
  |  |   34|  4.86k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9446:13): [True: 4.86k, False: 14.7k]
  ------------------
 9447|  19.6k|        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 9448|  19.6k|		     "Opening and ending tag mismatch: %s line %d and %s\n",
 9449|  19.6k|		                ctxt->name, tag->line, name);
 9450|  19.6k|    }
 9451|       |
 9452|       |    /*
 9453|       |     * SAX: End of Tag
 9454|       |     */
 9455|   233k|    if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (9455:9): [True: 233k, False: 0]
  |  Branch (9455:32): [True: 233k, False: 0]
  ------------------
 9456|   233k|	(!ctxt->disableSAX))
  ------------------
  |  Branch (9456:2): [True: 173k, False: 60.0k]
  ------------------
 9457|   173k|	ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
 9458|   173k|                                tag->URI);
 9459|       |
 9460|   233k|    spacePop(ctxt);
 9461|   233k|    if (tag->nsNr != 0)
  ------------------
  |  Branch (9461:9): [True: 34.9k, False: 198k]
  ------------------
 9462|  34.9k|	xmlParserNsPop(ctxt, tag->nsNr);
 9463|   233k|}
parser.c:xmlParseQNameAndCompare:
 8508|  18.5k|                        xmlChar const *prefix) {
 8509|  18.5k|    const xmlChar *cmp;
 8510|  18.5k|    const xmlChar *in;
 8511|  18.5k|    const xmlChar *ret;
 8512|  18.5k|    const xmlChar *prefix2;
 8513|       |
 8514|  18.5k|    if (prefix == NULL) return(xmlParseNameAndCompare(ctxt, name));
  ------------------
  |  Branch (8514:9): [True: 0, False: 18.5k]
  ------------------
 8515|       |
 8516|  18.5k|    GROW;
  ------------------
  |  | 2308|  18.5k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|  18.5k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|  18.5k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 13.1k, False: 5.39k]
  |  |  ------------------
  |  | 2309|  18.5k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|  13.1k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 2.28k, False: 10.8k]
  |  |  ------------------
  |  | 2310|  18.5k|	xmlParserGrow(ctxt);
  ------------------
 8517|  18.5k|    in = ctxt->input->cur;
 8518|       |
 8519|  18.5k|    cmp = prefix;
 8520|  36.4k|    while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8520:12): [True: 35.5k, False: 911]
  |  Branch (8520:24): [True: 17.8k, False: 17.6k]
  ------------------
 8521|  17.8k|	++in;
 8522|  17.8k|	++cmp;
 8523|  17.8k|    }
 8524|  18.5k|    if ((*cmp == 0) && (*in == ':')) {
  ------------------
  |  Branch (8524:9): [True: 16.4k, False: 2.10k]
  |  Branch (8524:24): [True: 10.6k, False: 5.84k]
  ------------------
 8525|  10.6k|        in++;
 8526|  10.6k|	cmp = name;
 8527|  28.4k|	while (*in != 0 && *in == *cmp) {
  ------------------
  |  Branch (8527:9): [True: 25.5k, False: 2.89k]
  |  Branch (8527:21): [True: 17.8k, False: 7.72k]
  ------------------
 8528|  17.8k|	    ++in;
 8529|  17.8k|	    ++cmp;
 8530|  17.8k|	}
 8531|  10.6k|	if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
  ------------------
  |  |  137|  5.93k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  5.93k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 391, False: 5.53k]
  |  |  |  |  ------------------
  |  |  |  |   91|  5.93k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.19k, False: 4.34k]
  |  |  |  |  |  Branch (91:23): [True: 265, False: 933]
  |  |  |  |  ------------------
  |  |  |  |   92|  5.93k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 391, False: 4.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8531:6): [True: 9.73k, False: 877]
  |  Branch (8531:20): [True: 3.80k, False: 5.93k]
  ------------------
 8532|       |	    /* success */
 8533|  4.85k|            ctxt->input->col += in - ctxt->input->cur;
 8534|  4.85k|	    ctxt->input->cur = in;
 8535|  4.85k|	    return((const xmlChar*) 1);
 8536|  4.85k|	}
 8537|  10.6k|    }
 8538|       |    /*
 8539|       |     * all strings coms from the dictionary, equality can be done directly
 8540|       |     */
 8541|  13.7k|    ret = xmlParseQName (ctxt, &prefix2);
 8542|  13.7k|    if (ret == NULL)
  ------------------
  |  Branch (8542:9): [True: 1.26k, False: 12.4k]
  ------------------
 8543|  1.26k|        return(NULL);
 8544|  12.4k|    if ((ret == name) && (prefix == prefix2))
  ------------------
  |  Branch (8544:9): [True: 10.2k, False: 2.14k]
  |  Branch (8544:26): [True: 4.81k, False: 5.47k]
  ------------------
 8545|  4.81k|	return((const xmlChar*) 1);
 8546|  7.62k|    return ret;
 8547|  12.4k|}
parser.c:xmlParseQName:
 8485|  13.7k|xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
 8486|  13.7k|    xmlHashedString n, p;
 8487|       |
 8488|  13.7k|    n = xmlParseQNameHashed(ctxt, &p);
 8489|  13.7k|    if (n.name == NULL)
  ------------------
  |  Branch (8489:9): [True: 1.26k, False: 12.4k]
  ------------------
 8490|  1.26k|        return(NULL);
 8491|  12.4k|    *prefix = p.name;
 8492|  12.4k|    return(n.name);
 8493|  13.7k|}
parser.c:xmlParseInternalSubset:
 8031|  14.5k|xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
 8032|       |    /*
 8033|       |     * Is there any DTD definition ?
 8034|       |     */
 8035|  14.5k|    if (RAW == '[') {
  ------------------
  |  | 2261|  14.5k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8035:9): [True: 14.5k, False: 0]
  ------------------
 8036|  14.5k|        int oldInputNr = ctxt->inputNr;
 8037|       |
 8038|  14.5k|        NEXT;
  ------------------
  |  | 2316|  14.5k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8039|       |	/*
 8040|       |	 * Parse the succession of Markup declarations and
 8041|       |	 * PEReferences.
 8042|       |	 * Subsequence (markupdecl | PEReference | S)*
 8043|       |	 */
 8044|  14.5k|	SKIP_BLANKS;
  ------------------
  |  | 2312|  14.5k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8045|   730k|        while (1) {
  ------------------
  |  Branch (8045:16): [True: 730k, Folded]
  ------------------
 8046|   730k|            if (PARSER_STOPPED(ctxt)) {
  ------------------
  |  |   44|   730k|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 721, False: 730k]
  |  |  ------------------
  ------------------
 8047|    721|                return;
 8048|   730k|            } else if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (8048:24): [True: 103k, False: 626k]
  ------------------
 8049|   103k|                if (ctxt->inputNr <= oldInputNr) {
  ------------------
  |  Branch (8049:21): [True: 1.54k, False: 102k]
  ------------------
 8050|  1.54k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8051|  1.54k|                    return;
 8052|  1.54k|                }
 8053|   102k|                xmlPopPE(ctxt);
 8054|   626k|            } else if ((RAW == ']') && (ctxt->inputNr <= oldInputNr)) {
  ------------------
  |  | 2261|   626k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8054:24): [True: 9.00k, False: 617k]
  |  Branch (8054:40): [True: 9.00k, False: 2]
  ------------------
 8055|  9.00k|                NEXT;
  ------------------
  |  | 2316|  9.00k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8056|  9.00k|                SKIP_BLANKS;
  ------------------
  |  | 2312|  9.00k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8057|  9.00k|                break;
 8058|   617k|            } else if ((PARSER_EXTERNAL(ctxt)) &&
  ------------------
  |  |   55|   617k|    (((ctxt)->inSubset == 2) || \
  |  |  ------------------
  |  |  |  Branch (55:6): [True: 0, False: 617k]
  |  |  ------------------
  |  |   56|   617k|     (((ctxt)->input->entity != NULL) && \
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 558k, False: 58.6k]
  |  |  ------------------
  |  |   57|   617k|      ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
  |  |  ------------------
  |  |  |  Branch (57:7): [True: 555k, False: 3.36k]
  |  |  ------------------
  ------------------
 8059|   555k|                       (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2261|   555k|#define RAW (*ctxt->input->cur)
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   404k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                                     (RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
  ------------------
  |  | 2263|   394k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8059:24): [True: 404k, False: 151k]
  |  Branch (8059:40): [True: 394k, False: 9.35k]
  |  Branch (8059:59): [True: 4.86k, False: 389k]
  ------------------
 8060|       |                /*
 8061|       |                 * Conditional sections are allowed in external entities
 8062|       |                 * included by PE References in the internal subset.
 8063|       |                 */
 8064|  4.86k|                xmlParseConditionalSections(ctxt);
 8065|   612k|            } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2261|   612k|#define RAW (*ctxt->input->cur)
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|   438k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
                          } else if ((RAW == '<') && ((NXT(1) == '!') || (NXT(1) == '?'))) {
  ------------------
  |  | 2263|  10.8k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (8065:24): [True: 438k, False: 174k]
  |  Branch (8065:41): [True: 427k, False: 10.8k]
  |  Branch (8065:60): [True: 9.96k, False: 868]
  ------------------
 8066|   437k|                xmlParseMarkupDecl(ctxt);
 8067|   437k|            } else if (RAW == '%') {
  ------------------
  |  | 2261|   174k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8067:24): [True: 171k, False: 3.29k]
  ------------------
 8068|   171k|                xmlParsePERefInternal(ctxt, 1);
 8069|   171k|            } else {
 8070|  3.29k|                xmlFatalErr(ctxt, XML_ERR_INT_SUBSET_NOT_FINISHED, NULL);
 8071|       |
 8072|  3.90k|                while (ctxt->inputNr > oldInputNr)
  ------------------
  |  Branch (8072:24): [True: 610, False: 3.29k]
  ------------------
 8073|    610|                    xmlPopPE(ctxt);
 8074|  3.29k|                return;
 8075|  3.29k|            }
 8076|   716k|            SKIP_BLANKS;
  ------------------
  |  | 2312|   716k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
 8077|   716k|            SHRINK;
  ------------------
  |  | 2304|   716k|    if (!PARSER_PROGRESSIVE(ctxt)) \
  |  |  ------------------
  |  |  |  |   47|   716k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   716k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2304:9): [True: 663k, False: 52.6k]
  |  |  ------------------
  |  | 2305|   716k|	xmlParserShrink(ctxt);
  ------------------
 8078|   716k|            GROW;
  ------------------
  |  | 2308|   716k|    if ((!PARSER_PROGRESSIVE(ctxt)) && \
  |  |  ------------------
  |  |  |  |   47|   716k|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  |  |  ------------------
  |  |  |  |  |  |   41|   716k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2308:9): [True: 663k, False: 52.6k]
  |  |  ------------------
  |  | 2309|   716k|        (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)) \
  |  |  ------------------
  |  |  |  |   63|   663k|#define INPUT_CHUNK	250
  |  |  ------------------
  |  |  |  Branch (2309:9): [True: 435k, False: 228k]
  |  |  ------------------
  |  | 2310|   716k|	xmlParserGrow(ctxt);
  ------------------
 8079|   716k|        }
 8080|  14.5k|    }
 8081|       |
 8082|       |    /*
 8083|       |     * We should be at the end of the DOCTYPE declaration.
 8084|       |     */
 8085|  9.00k|    if (RAW != '>') {
  ------------------
  |  | 2261|  9.00k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (8085:9): [True: 160, False: 8.84k]
  ------------------
 8086|    160|        xmlFatalErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED, NULL);
 8087|    160|        return;
 8088|    160|    }
 8089|  8.84k|    NEXT;
  ------------------
  |  | 2316|  8.84k|#define NEXT xmlNextChar(ctxt)
  ------------------
 8090|  8.84k|}
parser.c:xmlCleanSpecialAttr:
 1231|  20.0k|{
 1232|  20.0k|    if (ctxt->attsSpecial == NULL)
  ------------------
  |  Branch (1232:9): [True: 16.5k, False: 3.54k]
  ------------------
 1233|  16.5k|        return;
 1234|       |
 1235|  3.54k|    xmlHashScanFull(ctxt->attsSpecial, xmlCleanSpecialAttrCallback, ctxt);
 1236|       |
 1237|  3.54k|    if (xmlHashSize(ctxt->attsSpecial) == 0) {
  ------------------
  |  Branch (1237:9): [True: 163, False: 3.38k]
  ------------------
 1238|    163|        xmlHashFree(ctxt->attsSpecial, NULL);
 1239|       |        ctxt->attsSpecial = NULL;
 1240|    163|    }
 1241|  3.54k|}
parser.c:xmlCleanSpecialAttrCallback:
 1214|  24.2k|                            const xmlChar *unused ATTRIBUTE_UNUSED) {
 1215|  24.2k|    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) data;
 1216|       |
 1217|  24.2k|    if (XML_PTR_TO_INT(payload) == XML_ATTRIBUTE_CDATA) {
  ------------------
  |  |   58|  24.2k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
  |  Branch (1217:9): [True: 2.20k, False: 22.0k]
  ------------------
 1218|       |        xmlHashRemoveEntry2(ctxt->attsSpecial, fullname, fullattr, NULL);
 1219|  2.20k|    }
 1220|  24.2k|}
parser.c:xmlFinishDocument:
10388|  26.0k|xmlFinishDocument(xmlParserCtxtPtr ctxt) {
10389|  26.0k|    xmlDocPtr doc;
10390|       |
10391|       |    /*
10392|       |     * SAX: end of the document processing.
10393|       |     */
10394|  26.0k|    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
  ------------------
  |  Branch (10394:9): [True: 26.0k, False: 0]
  |  Branch (10394:24): [True: 26.0k, False: 0]
  ------------------
10395|  26.0k|        ctxt->sax->endDocument(ctxt->userData);
10396|       |
10397|       |    /*
10398|       |     * Remove locally kept entity definitions if the tree was not built
10399|       |     */
10400|  26.0k|    doc = ctxt->myDoc;
10401|  26.0k|    if ((doc != NULL) &&
  ------------------
  |  Branch (10401:9): [True: 26.0k, False: 70]
  ------------------
10402|  26.0k|        (xmlStrEqual(doc->version, SAX_COMPAT_MODE))) {
  ------------------
  |  |  173|  26.0k|#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
  |  |  ------------------
  |  |  |  |   34|  26.0k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (10402:9): [True: 19, False: 25.9k]
  ------------------
10403|     19|        xmlFreeDoc(doc);
10404|       |        ctxt->myDoc = NULL;
10405|     19|    }
10406|  26.0k|}
parser.c:xmlParseTryOrFinish:
10867|   447k|xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
10868|   447k|    int ret = 0;
10869|   447k|    size_t avail;
10870|   447k|    xmlChar cur, next;
10871|       |
10872|   447k|    if (ctxt->input == NULL)
  ------------------
  |  Branch (10872:9): [True: 0, False: 447k]
  ------------------
10873|      0|        return(0);
10874|       |
10875|   447k|    if ((ctxt->input != NULL) &&
  ------------------
  |  Branch (10875:9): [True: 447k, False: 0]
  ------------------
10876|   447k|        (ctxt->input->cur - ctxt->input->base > 4096)) {
  ------------------
  |  Branch (10876:9): [True: 2.53k, False: 445k]
  ------------------
10877|  2.53k|        xmlParserShrink(ctxt);
10878|  2.53k|    }
10879|       |
10880|  4.98M|    while (ctxt->disableSAX == 0) {
  ------------------
  |  Branch (10880:12): [True: 4.97M, False: 11.2k]
  ------------------
10881|  4.97M|        avail = ctxt->input->end - ctxt->input->cur;
10882|  4.97M|        if (avail < 1)
  ------------------
  |  Branch (10882:13): [True: 22.4k, False: 4.95M]
  ------------------
10883|  22.4k|	    goto done;
10884|  4.95M|        switch (ctxt->instate) {
10885|  5.57k|            case XML_PARSER_EOF:
  ------------------
  |  Branch (10885:13): [True: 5.57k, False: 4.94M]
  ------------------
10886|       |	        /*
10887|       |		 * Document parsing is done !
10888|       |		 */
10889|  5.57k|	        goto done;
10890|  39.8k|            case XML_PARSER_START:
  ------------------
  |  Branch (10890:13): [True: 39.8k, False: 4.91M]
  ------------------
10891|       |                /*
10892|       |                 * Very first chars read from the document flow.
10893|       |                 */
10894|  39.8k|                if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (10894:21): [True: 38.6k, False: 1.16k]
  |  Branch (10894:37): [True: 473, False: 38.2k]
  ------------------
10895|    473|                    goto done;
10896|       |
10897|       |                /*
10898|       |                 * We need more bytes to detect EBCDIC code pages.
10899|       |                 * See xmlDetectEBCDIC.
10900|       |                 */
10901|  39.3k|                if ((CMP4(CUR_PTR, 0x4C, 0x6F, 0xA7, 0x94)) &&
  ------------------
  |  | 2268|  39.3k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  ------------------
  |  |  |  Branch (2268:5): [True: 814, False: 38.5k]
  |  |  |  Branch (2268:41): [True: 794, False: 20]
  |  |  ------------------
  |  | 2269|  39.3k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  ------------------
  |  |  |  Branch (2269:5): [True: 780, False: 14]
  |  |  |  Branch (2269:41): [True: 770, False: 10]
  |  |  ------------------
  ------------------
10902|    770|                    (!terminate) && (avail < 200))
  ------------------
  |  Branch (10902:21): [True: 400, False: 370]
  |  Branch (10902:37): [True: 366, False: 34]
  ------------------
10903|    366|                    goto done;
10904|       |
10905|  39.0k|                xmlDetectEncoding(ctxt);
10906|  39.0k|                ctxt->instate = XML_PARSER_XML_DECL;
10907|  39.0k|		break;
10908|       |
10909|  55.5k|            case XML_PARSER_XML_DECL:
  ------------------
  |  Branch (10909:13): [True: 55.5k, False: 4.89M]
  ------------------
10910|  55.5k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10910:7): [True: 53.2k, False: 2.24k]
  |  Branch (10910:23): [True: 4, False: 53.2k]
  ------------------
10911|      4|		    goto done;
10912|  55.5k|		cur = ctxt->input->cur[0];
10913|  55.5k|		next = ctxt->input->cur[1];
10914|  55.5k|	        if ((cur == '<') && (next == '?')) {
  ------------------
  |  Branch (10914:14): [True: 54.6k, False: 895]
  |  Branch (10914:30): [True: 25.7k, False: 28.8k]
  ------------------
10915|       |		    /* PI or XML decl */
10916|  25.7k|		    if ((!terminate) &&
  ------------------
  |  Branch (10916:11): [True: 24.2k, False: 1.47k]
  ------------------
10917|  24.2k|                        (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (10917:25): [True: 16.5k, False: 7.73k]
  ------------------
10918|  16.5k|			goto done;
10919|  9.21k|		    if ((ctxt->input->cur[2] == 'x') &&
  ------------------
  |  Branch (10919:11): [True: 7.44k, False: 1.77k]
  ------------------
10920|  7.44k|			(ctxt->input->cur[3] == 'm') &&
  ------------------
  |  Branch (10920:4): [True: 6.45k, False: 984]
  ------------------
10921|  6.45k|			(ctxt->input->cur[4] == 'l') &&
  ------------------
  |  Branch (10921:4): [True: 3.34k, False: 3.11k]
  ------------------
10922|  3.34k|			(IS_BLANK_CH(ctxt->input->cur[5]))) {
  ------------------
  |  |  137|  3.34k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  3.34k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.19k, False: 145]
  |  |  |  |  ------------------
  |  |  |  |   91|  3.34k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 140, False: 5]
  |  |  |  |  |  Branch (91:23): [True: 23, False: 117]
  |  |  |  |  ------------------
  |  |  |  |   92|  3.34k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 13, False: 109]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10923|  3.23k|			ret += 5;
10924|  3.23k|			xmlParseXMLDecl(ctxt);
10925|  5.98k|		    } else {
10926|  5.98k|			ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  5.98k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10927|  5.98k|                        if (ctxt->version == NULL) {
  ------------------
  |  Branch (10927:29): [True: 4, False: 5.97k]
  ------------------
10928|      4|                            xmlErrMemory(ctxt);
10929|      4|                            break;
10930|      4|                        }
10931|  5.98k|		    }
10932|  29.7k|		} else {
10933|  29.7k|		    ctxt->version = xmlCharStrdup(XML_DEFAULT_VERSION);
  ------------------
  |  |   42|  29.7k|#define XML_DEFAULT_VERSION	"1.0"
  ------------------
10934|  29.7k|		    if (ctxt->version == NULL) {
  ------------------
  |  Branch (10934:11): [True: 2, False: 29.7k]
  ------------------
10935|      2|		        xmlErrMemory(ctxt);
10936|      2|			break;
10937|      2|		    }
10938|  29.7k|		}
10939|  38.9k|                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
  ------------------
  |  Branch (10939:21): [True: 38.9k, False: 0]
  |  Branch (10939:36): [True: 38.9k, False: 0]
  ------------------
10940|  38.9k|                    ctxt->sax->setDocumentLocator(ctxt->userData,
10941|  38.9k|                            (xmlSAXLocator *) &xmlDefaultSAXLocator);
10942|  38.9k|                }
10943|  38.9k|                if ((ctxt->sax) && (ctxt->sax->startDocument) &&
  ------------------
  |  Branch (10943:21): [True: 38.9k, False: 0]
  |  Branch (10943:36): [True: 38.9k, False: 0]
  ------------------
10944|  38.9k|                    (!ctxt->disableSAX))
  ------------------
  |  Branch (10944:21): [True: 38.6k, False: 354]
  ------------------
10945|  38.6k|                    ctxt->sax->startDocument(ctxt->userData);
10946|  38.9k|                ctxt->instate = XML_PARSER_MISC;
10947|  38.9k|		break;
10948|   581k|            case XML_PARSER_START_TAG: {
  ------------------
  |  Branch (10948:13): [True: 581k, False: 4.36M]
  ------------------
10949|   581k|	        const xmlChar *name;
10950|   581k|		const xmlChar *prefix = NULL;
10951|   581k|		const xmlChar *URI = NULL;
10952|   581k|                int line = ctxt->input->line;
10953|   581k|		int nbNs = 0;
10954|       |
10955|   581k|		if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (10955:7): [True: 501k, False: 80.3k]
  |  Branch (10955:23): [True: 131, False: 501k]
  ------------------
10956|    131|		    goto done;
10957|   581k|		cur = ctxt->input->cur[0];
10958|   581k|	        if (cur != '<') {
  ------------------
  |  Branch (10958:14): [True: 2.23k, False: 579k]
  ------------------
10959|  2.23k|		    xmlFatalErrMsg(ctxt, XML_ERR_DOCUMENT_EMPTY,
10960|  2.23k|                                   "Start tag expected, '<' not found");
10961|  2.23k|                    ctxt->instate = XML_PARSER_EOF;
10962|  2.23k|                    xmlFinishDocument(ctxt);
10963|  2.23k|		    goto done;
10964|  2.23k|		}
10965|   579k|		if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (10965:7): [True: 500k, False: 78.6k]
  |  Branch (10965:23): [True: 248k, False: 252k]
  ------------------
10966|   248k|                    goto done;
10967|   331k|		if (ctxt->spaceNr == 0)
  ------------------
  |  Branch (10967:7): [True: 0, False: 331k]
  ------------------
10968|      0|		    spacePush(ctxt, -1);
10969|   331k|		else if (*ctxt->space == -2)
  ------------------
  |  Branch (10969:12): [True: 57.6k, False: 273k]
  ------------------
10970|  57.6k|		    spacePush(ctxt, -1);
10971|   273k|		else
10972|   273k|		    spacePush(ctxt, *ctxt->space);
10973|   331k|#ifdef LIBXML_SAX1_ENABLED
10974|   331k|		if (ctxt->sax2)
  ------------------
  |  Branch (10974:7): [True: 228k, False: 102k]
  ------------------
10975|   228k|#endif /* LIBXML_SAX1_ENABLED */
10976|   228k|		    name = xmlParseStartTag2(ctxt, &prefix, &URI, &nbNs);
10977|   102k|#ifdef LIBXML_SAX1_ENABLED
10978|   102k|		else
10979|   102k|		    name = xmlParseStartTag(ctxt);
10980|   331k|#endif /* LIBXML_SAX1_ENABLED */
10981|   331k|		if (name == NULL) {
  ------------------
  |  Branch (10981:7): [True: 1.96k, False: 329k]
  ------------------
10982|  1.96k|		    spacePop(ctxt);
10983|  1.96k|                    ctxt->instate = XML_PARSER_EOF;
10984|  1.96k|                    xmlFinishDocument(ctxt);
10985|  1.96k|		    goto done;
10986|  1.96k|		}
10987|   329k|#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|   329k|		if (ctxt->validate && ctxt->wellFormed && ctxt->myDoc &&
  ------------------
  |  Branch (10993:7): [True: 154k, False: 174k]
  |  Branch (10993:25): [True: 118k, False: 36.1k]
  |  Branch (10993:45): [True: 118k, False: 0]
  ------------------
10994|   118k|		    ctxt->node && (ctxt->node == ctxt->myDoc->children))
  ------------------
  |  Branch (10994:7): [True: 118k, False: 0]
  |  Branch (10994:21): [True: 0, False: 118k]
  ------------------
10995|      0|		    ctxt->valid &= xmlValidateRoot(&ctxt->vctxt, ctxt->myDoc);
10996|   329k|#endif /* LIBXML_VALID_ENABLED */
10997|       |
10998|       |		/*
10999|       |		 * Check for an Empty Element.
11000|       |		 */
11001|   329k|		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2261|   329k|#define RAW (*ctxt->input->cur)
  ------------------
              		if ((RAW == '/') && (NXT(1) == '>')) {
  ------------------
  |  | 2263|   114k|#define NXT(val) ctxt->input->cur[(val)]
  ------------------
  |  Branch (11001:7): [True: 114k, False: 215k]
  |  Branch (11001:23): [True: 111k, False: 2.89k]
  ------------------
11002|   111k|		    SKIP(2);
  ------------------
  |  | 2285|   111k|#define SKIP(val) do {							\
  |  | 2286|   111k|    ctxt->input->cur += (val),ctxt->input->col+=(val);			\
  |  | 2287|   111k|    if (*ctxt->input->cur == 0)						\
  |  |  ------------------
  |  |  |  Branch (2287:9): [True: 937, False: 110k]
  |  |  ------------------
  |  | 2288|   111k|        xmlParserGrow(ctxt);						\
  |  | 2289|   111k|  } while (0)
  |  |  ------------------
  |  |  |  Branch (2289:12): [Folded, False: 111k]
  |  |  ------------------
  ------------------
11003|       |
11004|   111k|		    if (ctxt->sax2) {
  ------------------
  |  Branch (11004:11): [True: 89.1k, False: 22.3k]
  ------------------
11005|  89.1k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11005:8): [True: 89.1k, False: 0]
  ------------------
11006|  89.1k|			    (ctxt->sax->endElementNs != NULL) &&
  ------------------
  |  Branch (11006:8): [True: 89.1k, False: 0]
  ------------------
11007|  89.1k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11007:8): [True: 89.0k, False: 65]
  ------------------
11008|  89.0k|			    ctxt->sax->endElementNs(ctxt->userData, name,
11009|  89.0k|			                            prefix, URI);
11010|  89.1k|			if (nbNs > 0)
  ------------------
  |  Branch (11010:8): [True: 5.56k, False: 83.5k]
  ------------------
11011|  5.56k|			    xmlParserNsPop(ctxt, nbNs);
11012|  89.1k|#ifdef LIBXML_SAX1_ENABLED
11013|  89.1k|		    } else {
11014|  22.3k|			if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11014:8): [True: 22.3k, False: 0]
  ------------------
11015|  22.3k|			    (ctxt->sax->endElement != NULL) &&
  ------------------
  |  Branch (11015:8): [True: 22.3k, False: 0]
  ------------------
11016|  22.3k|			    (!ctxt->disableSAX))
  ------------------
  |  Branch (11016:8): [True: 22.3k, False: 18]
  ------------------
11017|  22.3k|			    ctxt->sax->endElement(ctxt->userData, name);
11018|  22.3k|#endif /* LIBXML_SAX1_ENABLED */
11019|  22.3k|		    }
11020|   111k|		    spacePop(ctxt);
11021|   217k|		} else if (RAW == '>') {
  ------------------
  |  | 2261|   217k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11021:14): [True: 171k, False: 46.8k]
  ------------------
11022|   171k|		    NEXT;
  ------------------
  |  | 2316|   171k|#define NEXT xmlNextChar(ctxt)
  ------------------
11023|   171k|                    nameNsPush(ctxt, name, prefix, URI, line, nbNs);
11024|   171k|		} else {
11025|  46.8k|		    xmlFatalErrMsgStr(ctxt, XML_ERR_GT_REQUIRED,
11026|  46.8k|					 "Couldn't find end of Start Tag %s\n",
11027|  46.8k|					 name);
11028|  46.8k|		    nodePop(ctxt);
11029|  46.8k|		    spacePop(ctxt);
11030|  46.8k|                    if (nbNs > 0)
  ------------------
  |  Branch (11030:25): [True: 5.79k, False: 41.0k]
  ------------------
11031|  5.79k|                        xmlParserNsPop(ctxt, nbNs);
11032|  46.8k|		}
11033|       |
11034|   329k|                if (ctxt->nameNr == 0)
  ------------------
  |  Branch (11034:21): [True: 8.75k, False: 320k]
  ------------------
11035|  8.75k|                    ctxt->instate = XML_PARSER_EPILOG;
11036|   320k|                else
11037|   320k|                    ctxt->instate = XML_PARSER_CONTENT;
11038|   329k|                break;
11039|   331k|	    }
11040|  3.96M|            case XML_PARSER_CONTENT: {
  ------------------
  |  Branch (11040:13): [True: 3.96M, False: 988k]
  ------------------
11041|  3.96M|		cur = ctxt->input->cur[0];
11042|       |
11043|  3.96M|		if (cur == '<') {
  ------------------
  |  Branch (11043:7): [True: 445k, False: 3.51M]
  ------------------
11044|   445k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11044:25): [True: 356k, False: 88.7k]
  |  Branch (11044:41): [True: 1.21k, False: 355k]
  ------------------
11045|  1.21k|                        goto done;
11046|   443k|		    next = ctxt->input->cur[1];
11047|       |
11048|   443k|                    if (next == '/') {
  ------------------
  |  Branch (11048:25): [True: 36.9k, False: 406k]
  ------------------
11049|  36.9k|                        ctxt->instate = XML_PARSER_END_TAG;
11050|  36.9k|                        break;
11051|   406k|                    } else if (next == '?') {
  ------------------
  |  Branch (11051:32): [True: 23.4k, False: 383k]
  ------------------
11052|  23.4k|                        if ((!terminate) &&
  ------------------
  |  Branch (11052:29): [True: 18.6k, False: 4.73k]
  ------------------
11053|  18.6k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11053:29): [True: 4.97k, False: 13.7k]
  ------------------
11054|  4.97k|                            goto done;
11055|  18.4k|                        xmlParsePI(ctxt);
11056|  18.4k|                        ctxt->instate = XML_PARSER_CONTENT;
11057|  18.4k|                        break;
11058|   383k|                    } else if (next == '!') {
  ------------------
  |  Branch (11058:32): [True: 81.4k, False: 302k]
  ------------------
11059|  81.4k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11059:29): [True: 74.7k, False: 6.78k]
  |  Branch (11059:45): [True: 162, False: 74.5k]
  ------------------
11060|    162|                            goto done;
11061|  81.3k|                        next = ctxt->input->cur[2];
11062|       |
11063|  81.3k|                        if (next == '-') {
  ------------------
  |  Branch (11063:29): [True: 64.8k, False: 16.4k]
  ------------------
11064|  64.8k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11064:33): [True: 61.5k, False: 3.27k]
  |  Branch (11064:49): [True: 151, False: 61.4k]
  ------------------
11065|    151|                                goto done;
11066|  64.6k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11066:33): [True: 64.6k, False: 18]
  ------------------
11067|  64.6k|                                if ((!terminate) &&
  ------------------
  |  Branch (11067:37): [True: 61.3k, False: 3.26k]
  ------------------
11068|  61.3k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11068:37): [True: 4.64k, False: 56.7k]
  ------------------
11069|  4.64k|                                    goto done;
11070|  60.0k|                                xmlParseComment(ctxt);
11071|  60.0k|                                ctxt->instate = XML_PARSER_CONTENT;
11072|  60.0k|                                break;
11073|  64.6k|                            }
11074|  64.6k|                        } else if (next == '[') {
  ------------------
  |  Branch (11074:36): [True: 16.1k, False: 319]
  ------------------
11075|  16.1k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11075:33): [True: 12.7k, False: 3.39k]
  |  Branch (11075:49): [True: 78, False: 12.7k]
  ------------------
11076|     78|                                goto done;
11077|  16.0k|                            if ((ctxt->input->cur[2] == '[') &&
  ------------------
  |  Branch (11077:33): [True: 16.0k, False: 0]
  ------------------
11078|  16.0k|                                (ctxt->input->cur[3] == 'C') &&
  ------------------
  |  Branch (11078:33): [True: 16.0k, False: 22]
  ------------------
11079|  16.0k|                                (ctxt->input->cur[4] == 'D') &&
  ------------------
  |  Branch (11079:33): [True: 16.0k, False: 9]
  ------------------
11080|  16.0k|                                (ctxt->input->cur[5] == 'A') &&
  ------------------
  |  Branch (11080:33): [True: 16.0k, False: 6]
  ------------------
11081|  16.0k|                                (ctxt->input->cur[6] == 'T') &&
  ------------------
  |  Branch (11081:33): [True: 16.0k, False: 17]
  ------------------
11082|  16.0k|                                (ctxt->input->cur[7] == 'A') &&
  ------------------
  |  Branch (11082:33): [True: 16.0k, False: 12]
  ------------------
11083|  16.0k|                                (ctxt->input->cur[8] == '[')) {
  ------------------
  |  Branch (11083:33): [True: 16.0k, False: 8]
  ------------------
11084|  16.0k|                                if ((!terminate) &&
  ------------------
  |  Branch (11084:37): [True: 12.6k, False: 3.34k]
  ------------------
11085|  12.6k|                                    (!xmlParseLookupString(ctxt, 9, "]]>", 3)))
  ------------------
  |  Branch (11085:37): [True: 8.51k, False: 4.15k]
  ------------------
11086|  8.51k|                                    goto done;
11087|  7.50k|                                ctxt->instate = XML_PARSER_CDATA_SECTION;
11088|  7.50k|                                xmlParseCDSect(ctxt);
11089|  7.50k|                                ctxt->instate = XML_PARSER_CONTENT;
11090|  7.50k|                                break;
11091|  16.0k|                            }
11092|  16.0k|                        }
11093|  81.3k|                    }
11094|  3.51M|		} else if (cur == '&') {
  ------------------
  |  Branch (11094:14): [True: 40.3k, False: 3.47M]
  ------------------
11095|  40.3k|		    if ((!terminate) && (!xmlParseLookupChar(ctxt, ';')))
  ------------------
  |  Branch (11095:11): [True: 30.7k, False: 9.66k]
  |  Branch (11095:27): [True: 15.1k, False: 15.5k]
  ------------------
11096|  15.1k|			goto done;
11097|  25.2k|		    xmlParseReference(ctxt);
11098|  25.2k|                    break;
11099|  3.47M|		} 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.47M|		    if (avail < XML_PARSER_BIG_BUFFER_SIZE) {
  ------------------
  |  |  171|  3.47M|#define XML_PARSER_BIG_BUFFER_SIZE 300
  ------------------
  |  Branch (11112:11): [True: 119k, False: 3.35M]
  ------------------
11113|   119k|			if ((!terminate) && (!xmlParseLookupCharData(ctxt)))
  ------------------
  |  Branch (11113:8): [True: 94.3k, False: 24.7k]
  |  Branch (11113:24): [True: 8.05k, False: 86.2k]
  ------------------
11114|  8.05k|			    goto done;
11115|   119k|                    }
11116|  3.47M|                    ctxt->checkIndex = 0;
11117|  3.47M|		    xmlParseCharDataInternal(ctxt, !terminate);
11118|  3.47M|                    break;
11119|  3.47M|		}
11120|       |
11121|   302k|                ctxt->instate = XML_PARSER_START_TAG;
11122|   302k|		break;
11123|  3.96M|	    }
11124|  40.8k|            case XML_PARSER_END_TAG:
  ------------------
  |  Branch (11124:13): [True: 40.8k, False: 4.91M]
  ------------------
11125|  40.8k|		if ((!terminate) && (!xmlParseLookupChar(ctxt, '>')))
  ------------------
  |  Branch (11125:7): [True: 32.8k, False: 7.96k]
  |  Branch (11125:23): [True: 5.07k, False: 27.7k]
  ------------------
11126|  5.07k|		    goto done;
11127|  35.7k|		if (ctxt->sax2) {
  ------------------
  |  Branch (11127:7): [True: 24.6k, False: 11.1k]
  ------------------
11128|  24.6k|	            xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
11129|  24.6k|		    nameNsPop(ctxt);
11130|  24.6k|		}
11131|  11.1k|#ifdef LIBXML_SAX1_ENABLED
11132|  11.1k|		  else
11133|  11.1k|		    xmlParseEndTag1(ctxt, 0);
11134|  35.7k|#endif /* LIBXML_SAX1_ENABLED */
11135|  35.7k|		if (ctxt->nameNr == 0) {
  ------------------
  |  Branch (11135:7): [True: 2.75k, False: 33.0k]
  ------------------
11136|  2.75k|		    ctxt->instate = XML_PARSER_EPILOG;
11137|  33.0k|		} else {
11138|  33.0k|		    ctxt->instate = XML_PARSER_CONTENT;
11139|  33.0k|		}
11140|  35.7k|		break;
11141|   116k|            case XML_PARSER_MISC:
  ------------------
  |  Branch (11141:13): [True: 116k, False: 4.83M]
  ------------------
11142|   208k|            case XML_PARSER_PROLOG:
  ------------------
  |  Branch (11142:13): [True: 91.8k, False: 4.86M]
  ------------------
11143|   214k|            case XML_PARSER_EPILOG:
  ------------------
  |  Branch (11143:13): [True: 6.09k, False: 4.94M]
  ------------------
11144|   214k|		SKIP_BLANKS;
  ------------------
  |  | 2312|   214k|#define SKIP_BLANKS xmlSkipBlankChars(ctxt)
  ------------------
11145|   214k|                avail = ctxt->input->end - ctxt->input->cur;
11146|   214k|		if (avail < 1)
  ------------------
  |  Branch (11146:7): [True: 3.44k, False: 211k]
  ------------------
11147|  3.44k|		    goto done;
11148|   211k|		if (ctxt->input->cur[0] == '<') {
  ------------------
  |  Branch (11148:7): [True: 207k, False: 4.18k]
  ------------------
11149|   207k|                    if ((!terminate) && (avail < 2))
  ------------------
  |  Branch (11149:25): [True: 201k, False: 5.42k]
  |  Branch (11149:41): [True: 269, False: 201k]
  ------------------
11150|    269|                        goto done;
11151|   206k|                    next = ctxt->input->cur[1];
11152|   206k|                    if (next == '?') {
  ------------------
  |  Branch (11152:25): [True: 41.1k, False: 165k]
  ------------------
11153|  41.1k|                        if ((!terminate) &&
  ------------------
  |  Branch (11153:29): [True: 39.8k, False: 1.24k]
  ------------------
11154|  39.8k|                            (!xmlParseLookupString(ctxt, 2, "?>", 2)))
  ------------------
  |  Branch (11154:29): [True: 8.64k, False: 31.2k]
  ------------------
11155|  8.64k|                            goto done;
11156|  32.4k|                        xmlParsePI(ctxt);
11157|  32.4k|                        break;
11158|   165k|                    } else if (next == '!') {
  ------------------
  |  Branch (11158:32): [True: 134k, False: 31.2k]
  ------------------
11159|   134k|                        if ((!terminate) && (avail < 3))
  ------------------
  |  Branch (11159:29): [True: 131k, False: 2.60k]
  |  Branch (11159:45): [True: 195, False: 131k]
  ------------------
11160|    195|                            goto done;
11161|       |
11162|   134k|                        if (ctxt->input->cur[2] == '-') {
  ------------------
  |  Branch (11162:29): [True: 87.4k, False: 46.9k]
  ------------------
11163|  87.4k|                            if ((!terminate) && (avail < 4))
  ------------------
  |  Branch (11163:33): [True: 86.7k, False: 715]
  |  Branch (11163:49): [True: 171, False: 86.5k]
  ------------------
11164|    171|                                goto done;
11165|  87.2k|                            if (ctxt->input->cur[3] == '-') {
  ------------------
  |  Branch (11165:33): [True: 87.2k, False: 18]
  ------------------
11166|  87.2k|                                if ((!terminate) &&
  ------------------
  |  Branch (11166:37): [True: 86.5k, False: 708]
  ------------------
11167|  86.5k|                                    (!xmlParseLookupString(ctxt, 4, "-->", 3)))
  ------------------
  |  Branch (11167:37): [True: 13.0k, False: 73.5k]
  ------------------
11168|  13.0k|                                    goto done;
11169|  74.2k|                                xmlParseComment(ctxt);
11170|  74.2k|                                break;
11171|  87.2k|                            }
11172|  87.2k|                        } else if (ctxt->instate == XML_PARSER_MISC) {
  ------------------
  |  Branch (11172:36): [True: 46.8k, False: 82]
  ------------------
11173|  46.8k|                            if ((!terminate) && (avail < 9))
  ------------------
  |  Branch (11173:33): [True: 44.9k, False: 1.83k]
  |  Branch (11173:49): [True: 22, False: 44.9k]
  ------------------
11174|     22|                                goto done;
11175|  46.8k|                            if ((ctxt->input->cur[2] == 'D') &&
  ------------------
  |  Branch (11175:33): [True: 46.7k, False: 16]
  ------------------
11176|  46.7k|                                (ctxt->input->cur[3] == 'O') &&
  ------------------
  |  Branch (11176:33): [True: 46.7k, False: 6]
  ------------------
11177|  46.7k|                                (ctxt->input->cur[4] == 'C') &&
  ------------------
  |  Branch (11177:33): [True: 46.7k, False: 10]
  ------------------
11178|  46.7k|                                (ctxt->input->cur[5] == 'T') &&
  ------------------
  |  Branch (11178:33): [True: 46.7k, False: 3]
  ------------------
11179|  46.7k|                                (ctxt->input->cur[6] == 'Y') &&
  ------------------
  |  Branch (11179:33): [True: 46.7k, False: 7]
  ------------------
11180|  46.7k|                                (ctxt->input->cur[7] == 'P') &&
  ------------------
  |  Branch (11180:33): [True: 46.7k, False: 1]
  ------------------
11181|  46.7k|                                (ctxt->input->cur[8] == 'E')) {
  ------------------
  |  Branch (11181:33): [True: 46.7k, False: 4]
  ------------------
11182|  46.7k|                                if ((!terminate) && (!xmlParseLookupGt(ctxt)))
  ------------------
  |  Branch (11182:37): [True: 44.9k, False: 1.80k]
  |  Branch (11182:53): [True: 29.0k, False: 15.9k]
  ------------------
11183|  29.0k|                                    goto done;
11184|  17.7k|                                ctxt->inSubset = 1;
11185|  17.7k|                                xmlParseDocTypeDecl(ctxt);
11186|  17.7k|                                if (RAW == '[') {
  ------------------
  |  | 2261|  17.7k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11186:37): [True: 13.8k, False: 3.87k]
  ------------------
11187|  13.8k|                                    ctxt->instate = XML_PARSER_DTD;
11188|  13.8k|                                } else {
11189|  3.87k|                                    if (RAW == '>')
  ------------------
  |  | 2261|  3.87k|#define RAW (*ctxt->input->cur)
  ------------------
  |  Branch (11189:41): [True: 3.65k, False: 219]
  ------------------
11190|  3.65k|                                        NEXT;
  ------------------
  |  | 2316|  3.65k|#define NEXT xmlNextChar(ctxt)
  ------------------
11191|       |                                    /*
11192|       |                                     * Create and update the external subset.
11193|       |                                     */
11194|  3.87k|                                    ctxt->inSubset = 2;
11195|  3.87k|                                    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (11195:41): [True: 3.87k, False: 0]
  ------------------
11196|  3.87k|                                        (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11196:41): [True: 3.78k, False: 97]
  ------------------
11197|  3.78k|                                        (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11197:41): [True: 3.78k, False: 0]
  ------------------
11198|  3.78k|                                        ctxt->sax->externalSubset(
11199|  3.78k|                                                ctxt->userData,
11200|  3.78k|                                                ctxt->intSubName,
11201|  3.78k|                                                ctxt->extSubSystem,
11202|  3.78k|                                                ctxt->extSubURI);
11203|  3.87k|                                    ctxt->inSubset = 0;
11204|  3.87k|                                    xmlCleanSpecialAttr(ctxt);
11205|  3.87k|                                    ctxt->instate = XML_PARSER_PROLOG;
11206|  3.87k|                                }
11207|  17.7k|                                break;
11208|  46.7k|                            }
11209|  46.8k|                        }
11210|   134k|                    }
11211|   206k|                }
11212|       |
11213|  35.5k|                if (ctxt->instate == XML_PARSER_EPILOG) {
  ------------------
  |  Branch (11213:21): [True: 2.29k, False: 33.2k]
  ------------------
11214|  2.29k|                    if (ctxt->errNo == XML_ERR_OK)
  ------------------
  |  Branch (11214:25): [True: 28, False: 2.26k]
  ------------------
11215|     28|                        xmlFatalErr(ctxt, XML_ERR_DOCUMENT_END, NULL);
11216|  2.29k|		    ctxt->instate = XML_PARSER_EOF;
11217|  2.29k|                    xmlFinishDocument(ctxt);
11218|  33.2k|                } else {
11219|  33.2k|		    ctxt->instate = XML_PARSER_START_TAG;
11220|  33.2k|		}
11221|  35.5k|		break;
11222|  49.5k|            case XML_PARSER_DTD: {
  ------------------
  |  Branch (11222:13): [True: 49.5k, False: 4.90M]
  ------------------
11223|  49.5k|                if ((!terminate) && (!xmlParseLookupInternalSubset(ctxt)))
  ------------------
  |  Branch (11223:21): [True: 44.4k, False: 5.13k]
  |  Branch (11223:37): [True: 35.8k, False: 8.63k]
  ------------------
11224|  35.8k|                    goto done;
11225|  13.7k|		xmlParseInternalSubset(ctxt);
11226|  13.7k|		ctxt->inSubset = 2;
11227|  13.7k|		if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
  ------------------
  |  Branch (11227:7): [True: 13.7k, False: 0]
  |  Branch (11227:30): [True: 11.4k, False: 2.31k]
  ------------------
11228|  11.4k|		    (ctxt->sax->externalSubset != NULL))
  ------------------
  |  Branch (11228:7): [True: 11.4k, False: 0]
  ------------------
11229|  11.4k|		    ctxt->sax->externalSubset(ctxt->userData, ctxt->intSubName,
11230|  11.4k|			    ctxt->extSubSystem, ctxt->extSubURI);
11231|  13.7k|		ctxt->inSubset = 0;
11232|  13.7k|		xmlCleanSpecialAttr(ctxt);
11233|  13.7k|		ctxt->instate = XML_PARSER_PROLOG;
11234|  13.7k|                break;
11235|  49.5k|	    }
11236|      0|            default:
  ------------------
  |  Branch (11236:13): [True: 0, False: 4.95M]
  ------------------
11237|      0|                xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
11238|      0|			"PP: internal error\n");
11239|      0|		ctxt->instate = XML_PARSER_EOF;
11240|      0|		break;
11241|  4.95M|	}
11242|  4.95M|    }
11243|   447k|done:
11244|   447k|    return(ret);
11245|   447k|}
parser.c:xmlParseLookupString:
10647|   243k|                     const char *str, size_t strLen) {
10648|   243k|    const xmlChar *cur, *term;
10649|       |
10650|   243k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10650:9): [True: 189k, False: 53.9k]
  ------------------
10651|   189k|        cur = ctxt->input->cur + startDelta;
10652|   189k|    } else {
10653|  53.9k|        cur = ctxt->input->cur + ctxt->checkIndex;
10654|  53.9k|    }
10655|       |
10656|   243k|    term = BAD_CAST strstr((const char *) cur, str);
  ------------------
  |  |   34|   243k|#define BAD_CAST (xmlChar *)
  ------------------
10657|   243k|    if (term == NULL) {
  ------------------
  |  Branch (10657:9): [True: 56.3k, False: 187k]
  ------------------
10658|  56.3k|        const xmlChar *end = ctxt->input->end;
10659|  56.3k|        size_t index;
10660|       |
10661|       |        /* Rescan (strLen - 1) characters. */
10662|  56.3k|        if ((size_t) (end - cur) < strLen)
  ------------------
  |  Branch (10662:13): [True: 1.13k, False: 55.2k]
  ------------------
10663|  1.13k|            end = cur;
10664|  55.2k|        else
10665|  55.2k|            end -= strLen - 1;
10666|  56.3k|        index = end - ctxt->input->cur;
10667|  56.3k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10667:13): [True: 0, False: 56.3k]
  ------------------
10668|      0|            ctxt->checkIndex = 0;
10669|      0|            return(ctxt->input->end - strLen);
10670|      0|        }
10671|  56.3k|        ctxt->checkIndex = index;
10672|   187k|    } else {
10673|   187k|        ctxt->checkIndex = 0;
10674|   187k|    }
10675|       |
10676|   243k|    return(term);
10677|   243k|}
parser.c:xmlParseLookupGt:
10714|   545k|xmlParseLookupGt(xmlParserCtxtPtr ctxt) {
10715|   545k|    const xmlChar *cur;
10716|   545k|    const xmlChar *end = ctxt->input->end;
10717|   545k|    int state = ctxt->endCheckState;
10718|   545k|    size_t index;
10719|       |
10720|   545k|    if (ctxt->checkIndex == 0)
  ------------------
  |  Branch (10720:9): [True: 278k, False: 267k]
  ------------------
10721|   278k|        cur = ctxt->input->cur + 1;
10722|   267k|    else
10723|   267k|        cur = ctxt->input->cur + ctxt->checkIndex;
10724|       |
10725|   151M|    while (cur < end) {
  ------------------
  |  Branch (10725:12): [True: 151M, False: 277k]
  ------------------
10726|   151M|        if (state) {
  ------------------
  |  Branch (10726:13): [True: 134M, False: 16.8M]
  ------------------
10727|   134M|            if (*cur == state)
  ------------------
  |  Branch (10727:17): [True: 222k, False: 134M]
  ------------------
10728|   222k|                state = 0;
10729|   134M|        } else if (*cur == '\'' || *cur == '"') {
  ------------------
  |  Branch (10729:20): [True: 81.8k, False: 16.7M]
  |  Branch (10729:36): [True: 143k, False: 16.5M]
  ------------------
10730|   225k|            state = *cur;
10731|  16.5M|        } else if (*cur == '>') {
  ------------------
  |  Branch (10731:20): [True: 268k, False: 16.3M]
  ------------------
10732|   268k|            ctxt->checkIndex = 0;
10733|   268k|            ctxt->endCheckState = 0;
10734|   268k|            return(1);
10735|   268k|        }
10736|   150M|        cur++;
10737|   150M|    }
10738|       |
10739|   277k|    index = cur - ctxt->input->cur;
10740|   277k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10740:9): [True: 0, False: 277k]
  ------------------
10741|      0|        ctxt->checkIndex = 0;
10742|      0|        ctxt->endCheckState = 0;
10743|      0|        return(1);
10744|      0|    }
10745|   277k|    ctxt->checkIndex = index;
10746|   277k|    ctxt->endCheckState = state;
10747|   277k|    return(0);
10748|   277k|}
parser.c:xmlParseLookupChar:
10613|  63.5k|xmlParseLookupChar(xmlParserCtxtPtr ctxt, int c) {
10614|  63.5k|    const xmlChar *cur;
10615|       |
10616|  63.5k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10616:9): [True: 47.1k, False: 16.3k]
  ------------------
10617|  47.1k|        cur = ctxt->input->cur + 1;
10618|  47.1k|    } else {
10619|  16.3k|        cur = ctxt->input->cur + ctxt->checkIndex;
10620|  16.3k|    }
10621|       |
10622|  63.5k|    if (memchr(cur, c, ctxt->input->end - cur) == NULL) {
  ------------------
  |  Branch (10622:9): [True: 20.1k, False: 43.3k]
  ------------------
10623|  20.1k|        size_t index = ctxt->input->end - ctxt->input->cur;
10624|       |
10625|  20.1k|        if (index > LONG_MAX) {
  ------------------
  |  Branch (10625:13): [True: 0, False: 20.1k]
  ------------------
10626|      0|            ctxt->checkIndex = 0;
10627|      0|            return(1);
10628|      0|        }
10629|  20.1k|        ctxt->checkIndex = index;
10630|  20.1k|        return(0);
10631|  43.3k|    } else {
10632|  43.3k|        ctxt->checkIndex = 0;
10633|  43.3k|        return(1);
10634|  43.3k|    }
10635|  63.5k|}
parser.c:xmlParseLookupCharData:
10685|  94.3k|xmlParseLookupCharData(xmlParserCtxtPtr ctxt) {
10686|  94.3k|    const xmlChar *cur = ctxt->input->cur + ctxt->checkIndex;
10687|  94.3k|    const xmlChar *end = ctxt->input->end;
10688|  94.3k|    size_t index;
10689|       |
10690|   927k|    while (cur < end) {
  ------------------
  |  Branch (10690:12): [True: 919k, False: 8.05k]
  ------------------
10691|   919k|        if ((*cur == '<') || (*cur == '&')) {
  ------------------
  |  Branch (10691:13): [True: 79.5k, False: 839k]
  |  Branch (10691:30): [True: 6.76k, False: 833k]
  ------------------
10692|  86.2k|            ctxt->checkIndex = 0;
10693|  86.2k|            return(1);
10694|  86.2k|        }
10695|   833k|        cur++;
10696|   833k|    }
10697|       |
10698|  8.05k|    index = cur - ctxt->input->cur;
10699|  8.05k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10699:9): [True: 0, False: 8.05k]
  ------------------
10700|      0|        ctxt->checkIndex = 0;
10701|      0|        return(1);
10702|      0|    }
10703|  8.05k|    ctxt->checkIndex = index;
10704|  8.05k|    return(0);
10705|  8.05k|}
parser.c:nameNsPop:
 2149|  24.6k|{
 2150|  24.6k|    const xmlChar *ret;
 2151|       |
 2152|  24.6k|    if (ctxt->nameNr <= 0)
  ------------------
  |  Branch (2152:9): [True: 0, False: 24.6k]
  ------------------
 2153|      0|        return (NULL);
 2154|  24.6k|    ctxt->nameNr--;
 2155|  24.6k|    if (ctxt->nameNr > 0)
  ------------------
  |  Branch (2155:9): [True: 23.1k, False: 1.50k]
  ------------------
 2156|  23.1k|        ctxt->name = ctxt->nameTab[ctxt->nameNr - 1];
 2157|  1.50k|    else
 2158|  1.50k|        ctxt->name = NULL;
 2159|  24.6k|    ret = ctxt->nameTab[ctxt->nameNr];
 2160|       |    ctxt->nameTab[ctxt->nameNr] = NULL;
 2161|  24.6k|    return (ret);
 2162|  24.6k|}
parser.c:xmlParseLookupInternalSubset:
10757|  44.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|  44.4k|    const xmlChar *cur, *start;
10766|  44.4k|    const xmlChar *end = ctxt->input->end;
10767|  44.4k|    int state = ctxt->endCheckState;
10768|  44.4k|    size_t index;
10769|       |
10770|  44.4k|    if (ctxt->checkIndex == 0) {
  ------------------
  |  Branch (10770:9): [True: 12.2k, False: 32.2k]
  ------------------
10771|  12.2k|        cur = ctxt->input->cur + 1;
10772|  32.2k|    } else {
10773|  32.2k|        cur = ctxt->input->cur + ctxt->checkIndex;
10774|  32.2k|    }
10775|  44.4k|    start = cur;
10776|       |
10777|  28.7M|    while (cur < end) {
  ------------------
  |  Branch (10777:12): [True: 28.7M, False: 35.8k]
  ------------------
10778|  28.7M|        if (state == '-') {
  ------------------
  |  Branch (10778:13): [True: 142k, False: 28.5M]
  ------------------
10779|   142k|            if ((*cur == '-') &&
  ------------------
  |  Branch (10779:17): [True: 36.1k, False: 106k]
  ------------------
10780|  36.1k|                (cur[1] == '-') &&
  ------------------
  |  Branch (10780:17): [True: 26.2k, False: 9.90k]
  ------------------
10781|  26.2k|                (cur[2] == '>')) {
  ------------------
  |  Branch (10781:17): [True: 15.3k, False: 10.9k]
  ------------------
10782|  15.3k|                state = 0;
10783|  15.3k|                cur += 3;
10784|  15.3k|                start = cur;
10785|  15.3k|                continue;
10786|  15.3k|            }
10787|   142k|        }
10788|  28.5M|        else if (state == ']') {
  ------------------
  |  Branch (10788:18): [True: 10.9k, False: 28.5M]
  ------------------
10789|  10.9k|            if (*cur == '>') {
  ------------------
  |  Branch (10789:17): [True: 8.39k, False: 2.50k]
  ------------------
10790|  8.39k|                ctxt->checkIndex = 0;
10791|  8.39k|                ctxt->endCheckState = 0;
10792|  8.39k|                return(1);
10793|  8.39k|            }
10794|  2.50k|            if (IS_BLANK_CH(*cur)) {
  ------------------
  |  |  137|  2.50k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  2.50k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 260, False: 2.24k]
  |  |  |  |  ------------------
  |  |  |  |   91|  2.50k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 2.02k, False: 223]
  |  |  |  |  |  Branch (91:23): [True: 468, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |   92|  2.50k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 524, False: 1.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10795|  1.25k|                state = ' ';
10796|  1.25k|            } else if (*cur != ']') {
  ------------------
  |  Branch (10796:24): [True: 599, False: 653]
  ------------------
10797|    599|                state = 0;
10798|    599|                start = cur;
10799|    599|                continue;
10800|    599|            }
10801|  2.50k|        }
10802|  28.5M|        else if (state == ' ') {
  ------------------
  |  Branch (10802:18): [True: 2.02k, False: 28.5M]
  ------------------
10803|  2.02k|            if (*cur == '>') {
  ------------------
  |  Branch (10803:17): [True: 236, False: 1.78k]
  ------------------
10804|    236|                ctxt->checkIndex = 0;
10805|    236|                ctxt->endCheckState = 0;
10806|    236|                return(1);
10807|    236|            }
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: 222, False: 1.56k]
  |  |  |  |  ------------------
  |  |  |  |   91|  1.78k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 1.31k, False: 245]
  |  |  |  |  |  Branch (91:23): [True: 305, False: 1.01k]
  |  |  |  |  ------------------
  |  |  |  |   92|  1.78k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 250, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
10809|  1.00k|                state = 0;
10810|  1.00k|                start = cur;
10811|  1.00k|                continue;
10812|  1.00k|            }
10813|  1.78k|        }
10814|  28.5M|        else if (state != 0) {
  ------------------
  |  Branch (10814:18): [True: 23.0M, False: 5.47M]
  ------------------
10815|  23.0M|            if (*cur == state) {
  ------------------
  |  Branch (10815:17): [True: 35.4k, False: 23.0M]
  ------------------
10816|  35.4k|                state = 0;
10817|  35.4k|                start = cur + 1;
10818|  35.4k|            }
10819|  23.0M|        }
10820|  5.47M|        else if (*cur == '<') {
  ------------------
  |  Branch (10820:18): [True: 60.1k, False: 5.41M]
  ------------------
10821|  60.1k|            if ((cur[1] == '!') &&
  ------------------
  |  Branch (10821:17): [True: 47.2k, False: 12.9k]
  ------------------
10822|  47.2k|                (cur[2] == '-') &&
  ------------------
  |  Branch (10822:17): [True: 15.7k, False: 31.5k]
  ------------------
10823|  15.7k|                (cur[3] == '-')) {
  ------------------
  |  Branch (10823:17): [True: 15.4k, False: 293]
  ------------------
10824|  15.4k|                state = '-';
10825|  15.4k|                cur += 4;
10826|       |                /* Don't treat <!--> as comment */
10827|  15.4k|                start = cur;
10828|  15.4k|                continue;
10829|  15.4k|            }
10830|  60.1k|        }
10831|  5.41M|        else if ((*cur == '"') || (*cur == '\'') || (*cur == ']')) {
  ------------------
  |  Branch (10831:18): [True: 23.5k, False: 5.38M]
  |  Branch (10831:35): [True: 12.2k, False: 5.37M]
  |  Branch (10831:53): [True: 10.2k, False: 5.36M]
  ------------------
10832|  46.1k|            state = *cur;
10833|  46.1k|        }
10834|       |
10835|  28.6M|        cur++;
10836|  28.6M|    }
10837|       |
10838|       |    /*
10839|       |     * Rescan the three last characters to detect "<!--" and "-->"
10840|       |     * split across chunks.
10841|       |     */
10842|  35.8k|    if ((state == 0) || (state == '-')) {
  ------------------
  |  Branch (10842:9): [True: 7.05k, False: 28.7k]
  |  Branch (10842:25): [True: 403, False: 28.3k]
  ------------------
10843|  7.45k|        if (cur - start < 3)
  ------------------
  |  Branch (10843:13): [True: 578, False: 6.87k]
  ------------------
10844|    578|            cur = start;
10845|  6.87k|        else
10846|  6.87k|            cur -= 3;
10847|  7.45k|    }
10848|  35.8k|    index = cur - ctxt->input->cur;
10849|  35.8k|    if (index > LONG_MAX) {
  ------------------
  |  Branch (10849:9): [True: 0, False: 35.8k]
  ------------------
10850|      0|        ctxt->checkIndex = 0;
10851|      0|        ctxt->endCheckState = 0;
10852|      0|        return(1);
10853|      0|    }
10854|  35.8k|    ctxt->checkIndex = index;
10855|  35.8k|    ctxt->endCheckState = state;
10856|  35.8k|    return(0);
10857|  35.8k|}
parser.c:xmlCtxtParseEntity:
11796|  8.05k|xmlCtxtParseEntity(xmlParserCtxtPtr ctxt, xmlEntityPtr ent) {
11797|  8.05k|    xmlParserInputPtr input;
11798|  8.05k|    xmlNodePtr list;
11799|  8.05k|    unsigned long consumed;
11800|  8.05k|    int isExternal;
11801|  8.05k|    int buildTree;
11802|  8.05k|    int oldMinNsIndex;
11803|  8.05k|    int oldNodelen, oldNodemem;
11804|       |
11805|  8.05k|    isExternal = (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY);
11806|  8.05k|    buildTree = (ctxt->node != NULL);
11807|       |
11808|       |    /*
11809|       |     * Recursion check
11810|       |     */
11811|  8.05k|    if (ent->flags & XML_ENT_EXPANDING) {
  ------------------
  |  |   22|  8.05k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (11811:9): [True: 6, False: 8.05k]
  ------------------
11812|      6|        xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
11813|      6|        goto error;
11814|      6|    }
11815|       |
11816|       |    /*
11817|       |     * Load entity
11818|       |     */
11819|  8.05k|    input = xmlNewEntityInputStream(ctxt, ent);
11820|  8.05k|    if (input == NULL)
  ------------------
  |  Branch (11820:9): [True: 1.94k, False: 6.10k]
  ------------------
11821|  1.94k|        goto error;
11822|       |
11823|       |    /*
11824|       |     * When building a tree, we need to limit the scope of namespace
11825|       |     * declarations, so that entities don't reference xmlNs structs
11826|       |     * from the parent of a reference.
11827|       |     */
11828|  6.10k|    oldMinNsIndex = ctxt->nsdb->minNsIndex;
11829|  6.10k|    if (buildTree)
  ------------------
  |  Branch (11829:9): [True: 6.10k, False: 0]
  ------------------
11830|  6.10k|        ctxt->nsdb->minNsIndex = ctxt->nsNr;
11831|       |
11832|  6.10k|    oldNodelen = ctxt->nodelen;
11833|  6.10k|    oldNodemem = ctxt->nodemem;
11834|  6.10k|    ctxt->nodelen = 0;
11835|  6.10k|    ctxt->nodemem = 0;
11836|       |
11837|       |    /*
11838|       |     * Parse content
11839|       |     *
11840|       |     * This initiates a recursive call chain:
11841|       |     *
11842|       |     * - xmlCtxtParseContentInternal
11843|       |     * - xmlParseContentInternal
11844|       |     * - xmlParseReference
11845|       |     * - xmlCtxtParseEntity
11846|       |     *
11847|       |     * The nesting depth is limited by the maximum number of inputs,
11848|       |     * see xmlCtxtPushInput.
11849|       |     *
11850|       |     * It's possible to make this non-recursive (minNsIndex must be
11851|       |     * stored in the input struct) at the expense of code readability.
11852|       |     */
11853|       |
11854|  6.10k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.10k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11855|       |
11856|  6.10k|    list = xmlCtxtParseContentInternal(ctxt, input, isExternal, buildTree);
11857|       |
11858|  6.10k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  6.10k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
11859|       |
11860|  6.10k|    ctxt->nsdb->minNsIndex = oldMinNsIndex;
11861|  6.10k|    ctxt->nodelen = oldNodelen;
11862|  6.10k|    ctxt->nodemem = oldNodemem;
11863|       |
11864|       |    /*
11865|       |     * Entity size accounting
11866|       |     */
11867|  6.10k|    consumed = input->consumed;
11868|  6.10k|    xmlSaturatedAddSizeT(&consumed, input->end - input->base);
11869|       |
11870|  6.10k|    if ((ent->flags & XML_ENT_CHECKED) == 0)
  ------------------
  |  |   20|  6.10k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
  |  Branch (11870:9): [True: 3.63k, False: 2.47k]
  ------------------
11871|  3.63k|        xmlSaturatedAdd(&ent->expandedSize, consumed);
11872|       |
11873|  6.10k|    if ((ent->flags & XML_ENT_PARSED) == 0) {
  ------------------
  |  |   19|  6.10k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (11873:9): [True: 3.63k, False: 2.47k]
  ------------------
11874|  3.63k|        if (isExternal)
  ------------------
  |  Branch (11874:13): [True: 1.71k, False: 1.92k]
  ------------------
11875|  1.71k|            xmlSaturatedAdd(&ctxt->sizeentities, consumed);
11876|       |
11877|  3.63k|        ent->children = list;
11878|       |
11879|  37.6k|        while (list != NULL) {
  ------------------
  |  Branch (11879:16): [True: 33.9k, False: 3.63k]
  ------------------
11880|  33.9k|            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.9k|            if (list->doc != ent->doc)
  ------------------
  |  Branch (11887:17): [True: 0, False: 33.9k]
  ------------------
11888|      0|                xmlSetTreeDoc(list, ent->doc);
11889|       |
11890|  33.9k|            if (list->next == NULL)
  ------------------
  |  Branch (11890:17): [True: 2.59k, False: 31.3k]
  ------------------
11891|  2.59k|                ent->last = list;
11892|  33.9k|            list = list->next;
11893|  33.9k|        }
11894|  3.63k|    } else {
11895|  2.47k|        xmlFreeNodeList(list);
11896|  2.47k|    }
11897|       |
11898|  6.10k|    xmlFreeInputStream(input);
11899|       |
11900|  8.05k|error:
11901|  8.05k|    ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   19|  8.05k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
                  ent->flags |= XML_ENT_PARSED | XML_ENT_CHECKED;
  ------------------
  |  |   20|  8.05k|#define XML_ENT_CHECKED     (1u << 1)
  ------------------
11902|  8.05k|}
parser.c:xmlCtxtParseContentInternal:
11706|  6.10k|                            int hasTextDecl, int buildTree) {
11707|  6.10k|    xmlNodePtr root = NULL;
11708|  6.10k|    xmlNodePtr list = NULL;
11709|  6.10k|    xmlChar *rootName = BAD_CAST "#root";
  ------------------
  |  |   34|  6.10k|#define BAD_CAST (xmlChar *)
  ------------------
11710|  6.10k|    int result;
11711|       |
11712|  6.10k|    if (buildTree) {
  ------------------
  |  Branch (11712:9): [True: 6.10k, False: 0]
  ------------------
11713|  6.10k|        root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
11714|  6.10k|        if (root == NULL) {
  ------------------
  |  Branch (11714:13): [True: 1, False: 6.10k]
  ------------------
11715|      1|            xmlErrMemory(ctxt);
11716|      1|            goto error;
11717|      1|        }
11718|  6.10k|    }
11719|       |
11720|  6.10k|    if (xmlCtxtPushInput(ctxt, input) < 0)
  ------------------
  |  Branch (11720:9): [True: 2, False: 6.10k]
  ------------------
11721|      2|        goto error;
11722|       |
11723|  6.10k|    nameNsPush(ctxt, rootName, NULL, NULL, 0, 0);
11724|  6.10k|    spacePush(ctxt, -1);
11725|       |
11726|  6.10k|    if (buildTree)
  ------------------
  |  Branch (11726:9): [True: 6.10k, False: 0]
  ------------------
11727|  6.10k|        nodePush(ctxt, root);
11728|       |
11729|  6.10k|    if (hasTextDecl) {
  ------------------
  |  Branch (11729:9): [True: 2.02k, False: 4.07k]
  ------------------
11730|  2.02k|        xmlDetectEncoding(ctxt);
11731|       |
11732|       |        /*
11733|       |         * Parse a possible text declaration first
11734|       |         */
11735|  2.02k|        if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
  ------------------
  |  | 2271|  2.02k|  ( CMP4( s, c1, c2, c3, c4 ) && ((unsigned char *) s)[ 4 ] == c5 )
  |  |  ------------------
  |  |  |  | 2268|  4.05k|  ( ((unsigned char *) s)[ 0 ] == c1 && ((unsigned char *) s)[ 1 ] == c2 && \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2268:5): [True: 1.31k, False: 718]
  |  |  |  |  |  Branch (2268:41): [True: 375, False: 935]
  |  |  |  |  ------------------
  |  |  |  | 2269|  2.02k|    ((unsigned char *) s)[ 2 ] == c3 && ((unsigned char *) s)[ 3 ] == c4 )
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2269:5): [True: 350, False: 25]
  |  |  |  |  |  Branch (2269:41): [True: 345, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (2271:34): [True: 340, False: 5]
  |  |  ------------------
  ------------------
11736|    340|            (IS_BLANK_CH(NXT(5)))) {
  ------------------
  |  |  137|    340|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|    340|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 282, False: 58]
  |  |  |  |  ------------------
  |  |  |  |   91|    340|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 57, False: 1]
  |  |  |  |  |  Branch (91:23): [True: 38, False: 19]
  |  |  |  |  ------------------
  |  |  |  |   92|    340|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 18, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
11737|    338|            xmlParseTextDecl(ctxt);
11738|       |            /*
11739|       |             * An XML-1.0 document can't reference an entity not XML-1.0
11740|       |             */
11741|    338|            if ((xmlStrEqual(ctxt->version, BAD_CAST "1.0")) &&
  ------------------
  |  |   34|    338|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11741:17): [True: 333, False: 5]
  ------------------
11742|    333|                (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
  ------------------
  |  |   34|    333|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (11742:17): [True: 93, False: 240]
  ------------------
11743|     93|                xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
11744|     93|                               "Version mismatch between document and "
11745|     93|                               "entity\n");
11746|     93|            }
11747|    338|        }
11748|  2.02k|    }
11749|       |
11750|  6.10k|    xmlParseContentInternal(ctxt);
11751|       |
11752|  6.10k|    if (ctxt->input->cur < ctxt->input->end)
  ------------------
  |  Branch (11752:9): [True: 404, False: 5.70k]
  ------------------
11753|    404|	xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
11754|       |
11755|  6.10k|    if ((ctxt->wellFormed) ||
  ------------------
  |  Branch (11755:9): [True: 4.31k, False: 1.79k]
  ------------------
11756|  5.26k|        ((ctxt->recovery) && (!xmlCtxtIsCatastrophicError(ctxt)))) {
  ------------------
  |  Branch (11756:10): [True: 1.12k, False: 669]
  |  Branch (11756:30): [True: 951, False: 173]
  ------------------
11757|  5.26k|        if (root != NULL) {
  ------------------
  |  Branch (11757:13): [True: 5.26k, False: 0]
  ------------------
11758|  5.26k|            xmlNodePtr cur;
11759|       |
11760|       |            /*
11761|       |             * Unlink newly created node list.
11762|       |             */
11763|  5.26k|            list = root->children;
11764|  5.26k|            root->children = NULL;
11765|  5.26k|            root->last = NULL;
11766|  39.2k|            for (cur = list; cur != NULL; cur = cur->next)
  ------------------
  |  Branch (11766:30): [True: 33.9k, False: 5.26k]
  ------------------
11767|  33.9k|                cur->parent = NULL;
11768|  5.26k|        }
11769|  5.26k|    }
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.30k|    do {
11776|  6.30k|        ctxt->input->cur = ctxt->input->end;
11777|  6.30k|        xmlParserShrink(ctxt);
11778|  6.30k|        result = xmlParserGrow(ctxt);
11779|  6.30k|    } while (result > 0);
  ------------------
  |  Branch (11779:14): [True: 202, False: 6.10k]
  ------------------
11780|       |
11781|  6.10k|    if (buildTree)
  ------------------
  |  Branch (11781:9): [True: 6.10k, False: 0]
  ------------------
11782|  6.10k|        nodePop(ctxt);
11783|       |
11784|  6.10k|    namePop(ctxt);
11785|  6.10k|    spacePop(ctxt);
11786|       |
11787|  6.10k|    xmlCtxtPopInput(ctxt);
11788|       |
11789|  6.10k|error:
11790|  6.10k|    xmlFreeNode(root);
11791|       |
11792|  6.10k|    return(list);
11793|  6.10k|}
parser.c:xmlParserNsPush:
 1703|   501k|                const xmlHashedString *uri, void *saxData, int defAttr) {
 1704|   501k|    xmlParserNsBucket *bucket = NULL;
 1705|   501k|    xmlParserNsExtra *extra;
 1706|   501k|    const xmlChar **ns;
 1707|   501k|    unsigned hashValue, nsIndex, oldIndex;
 1708|       |
 1709|   501k|    if ((prefix != NULL) && (prefix->name == ctxt->str_xml))
  ------------------
  |  Branch (1709:9): [True: 451k, False: 50.4k]
  |  Branch (1709:29): [True: 197, False: 451k]
  ------------------
 1710|    197|        return(0);
 1711|       |
 1712|   501k|    if ((ctxt->nsNr >= ctxt->nsMax) && (xmlParserNsGrow(ctxt) < 0)) {
  ------------------
  |  Branch (1712:9): [True: 17.2k, False: 484k]
  |  Branch (1712:40): [True: 22, False: 17.1k]
  ------------------
 1713|     22|        xmlErrMemory(ctxt);
 1714|     22|        return(-1);
 1715|     22|    }
 1716|       |
 1717|       |    /*
 1718|       |     * Default namespace and 'xml' namespace
 1719|       |     */
 1720|   501k|    if ((prefix == NULL) || (prefix->name == NULL)) {
  ------------------
  |  Branch (1720:9): [True: 50.4k, False: 451k]
  |  Branch (1720:29): [True: 0, False: 451k]
  ------------------
 1721|  50.4k|        oldIndex = ctxt->nsdb->defaultNsIndex;
 1722|       |
 1723|  50.4k|        if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1723:13): [True: 47.5k, False: 2.82k]
  ------------------
 1724|  47.5k|            extra = &ctxt->nsdb->extra[oldIndex];
 1725|       |
 1726|  47.5k|            if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1726:17): [True: 602, False: 46.9k]
  ------------------
 1727|    602|                if (defAttr == 0)
  ------------------
  |  Branch (1727:21): [True: 358, False: 244]
  ------------------
 1728|    358|                    xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
  ------------------
  |  |   34|    358|#define BAD_CAST (xmlChar *)
  ------------------
 1729|    602|                return(0);
 1730|    602|            }
 1731|       |
 1732|  46.9k|            if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1732:17): [True: 9.02k, False: 37.9k]
  ------------------
 1733|  9.02k|                (uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
  ------------------
  |  Branch (1733:17): [True: 6.39k, False: 2.63k]
  ------------------
 1734|  6.39k|                return(0);
 1735|  46.9k|        }
 1736|       |
 1737|  43.4k|        ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
 1738|  43.4k|        goto populate_entry;
 1739|  50.4k|    }
 1740|       |
 1741|       |    /*
 1742|       |     * Hash table lookup
 1743|       |     */
 1744|   451k|    oldIndex = xmlParserNsLookup(ctxt, prefix, &bucket);
 1745|   451k|    if (oldIndex != INT_MAX) {
  ------------------
  |  Branch (1745:9): [True: 313k, False: 137k]
  ------------------
 1746|   313k|        extra = &ctxt->nsdb->extra[oldIndex];
 1747|       |
 1748|       |        /*
 1749|       |         * Check for duplicate definitions on the same element.
 1750|       |         */
 1751|   313k|        if (extra->elementId == ctxt->nsdb->elementId) {
  ------------------
  |  Branch (1751:13): [True: 821, False: 312k]
  ------------------
 1752|    821|            if (defAttr == 0)
  ------------------
  |  Branch (1752:17): [True: 753, False: 68]
  ------------------
 1753|    753|                xmlErrAttributeDup(ctxt, BAD_CAST "xmlns", prefix->name);
  ------------------
  |  |   34|    753|#define BAD_CAST (xmlChar *)
  ------------------
 1754|    821|            return(0);
 1755|    821|        }
 1756|       |
 1757|   312k|        if ((ctxt->options & XML_PARSE_NSCLEAN) &&
  ------------------
  |  Branch (1757:13): [True: 33.2k, False: 279k]
  ------------------
 1758|  33.2k|            (uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
  ------------------
  |  Branch (1758:13): [True: 32.4k, False: 787]
  ------------------
 1759|  32.4k|            return(0);
 1760|       |
 1761|   280k|        bucket->index = ctxt->nsNr;
 1762|   280k|        goto populate_entry;
 1763|   312k|    }
 1764|       |
 1765|       |    /*
 1766|       |     * Insert new bucket
 1767|       |     */
 1768|       |
 1769|   137k|    hashValue = prefix->hashValue;
 1770|       |
 1771|       |    /*
 1772|       |     * Grow hash table, 50% fill factor
 1773|       |     */
 1774|   137k|    if (ctxt->nsdb->hashElems + 1 > ctxt->nsdb->hashSize / 2) {
  ------------------
  |  Branch (1774:9): [True: 9.15k, False: 128k]
  ------------------
 1775|  9.15k|        xmlParserNsBucket *newHash;
 1776|  9.15k|        unsigned newSize, i, index;
 1777|       |
 1778|  9.15k|        if (ctxt->nsdb->hashSize > UINT_MAX / 2) {
  ------------------
  |  Branch (1778:13): [True: 0, False: 9.15k]
  ------------------
 1779|      0|            xmlErrMemory(ctxt);
 1780|      0|            return(-1);
 1781|      0|        }
 1782|  9.15k|        newSize = ctxt->nsdb->hashSize ? ctxt->nsdb->hashSize * 2 : 16;
  ------------------
  |  Branch (1782:19): [True: 791, False: 8.36k]
  ------------------
 1783|  9.15k|        newHash = xmlMalloc(newSize * sizeof(newHash[0]));
 1784|  9.15k|        if (newHash == NULL) {
  ------------------
  |  Branch (1784:13): [True: 4, False: 9.14k]
  ------------------
 1785|      4|            xmlErrMemory(ctxt);
 1786|      4|            return(-1);
 1787|      4|        }
 1788|  9.14k|        memset(newHash, 0, newSize * sizeof(newHash[0]));
 1789|       |
 1790|   424k|        for (i = 0; i < ctxt->nsdb->hashSize; i++) {
  ------------------
  |  Branch (1790:21): [True: 415k, False: 9.14k]
  ------------------
 1791|   415k|            unsigned hv = ctxt->nsdb->hash[i].hashValue;
 1792|   415k|            unsigned newIndex;
 1793|       |
 1794|   415k|            if ((hv == 0) || (ctxt->nsdb->hash[i].index == INT_MAX))
  ------------------
  |  Branch (1794:17): [True: 412k, False: 3.04k]
  |  Branch (1794:30): [True: 1.17k, False: 1.86k]
  ------------------
 1795|   413k|                continue;
 1796|  1.86k|            newIndex = hv & (newSize - 1);
 1797|       |
 1798|  2.86k|            while (newHash[newIndex].hashValue != 0) {
  ------------------
  |  Branch (1798:20): [True: 999, False: 1.86k]
  ------------------
 1799|    999|                newIndex++;
 1800|    999|                if (newIndex == newSize)
  ------------------
  |  Branch (1800:21): [True: 232, False: 767]
  ------------------
 1801|    232|                    newIndex = 0;
 1802|    999|            }
 1803|       |
 1804|  1.86k|            newHash[newIndex] = ctxt->nsdb->hash[i];
 1805|  1.86k|        }
 1806|       |
 1807|  9.14k|        xmlFree(ctxt->nsdb->hash);
 1808|  9.14k|        ctxt->nsdb->hash = newHash;
 1809|  9.14k|        ctxt->nsdb->hashSize = newSize;
 1810|       |
 1811|       |        /*
 1812|       |         * Relookup
 1813|       |         */
 1814|  9.14k|        index = hashValue & (newSize - 1);
 1815|       |
 1816|  9.50k|        while (newHash[index].hashValue != 0) {
  ------------------
  |  Branch (1816:16): [True: 356, False: 9.14k]
  ------------------
 1817|    356|            index++;
 1818|    356|            if (index == newSize)
  ------------------
  |  Branch (1818:17): [True: 54, False: 302]
  ------------------
 1819|     54|                index = 0;
 1820|    356|        }
 1821|       |
 1822|  9.14k|        bucket = &newHash[index];
 1823|  9.14k|    }
 1824|       |
 1825|   137k|    bucket->hashValue = hashValue;
 1826|   137k|    bucket->index = ctxt->nsNr;
 1827|   137k|    ctxt->nsdb->hashElems++;
 1828|   137k|    oldIndex = INT_MAX;
 1829|       |
 1830|   461k|populate_entry:
 1831|   461k|    nsIndex = ctxt->nsNr;
 1832|       |
 1833|   461k|    ns = &ctxt->nsTab[nsIndex * 2];
 1834|   461k|    ns[0] = prefix ? prefix->name : NULL;
  ------------------
  |  Branch (1834:13): [True: 417k, False: 43.4k]
  ------------------
 1835|   461k|    ns[1] = uri->name;
 1836|       |
 1837|   461k|    extra = &ctxt->nsdb->extra[nsIndex];
 1838|   461k|    extra->saxData = saxData;
 1839|   461k|    extra->prefixHashValue = prefix ? prefix->hashValue : 0;
  ------------------
  |  Branch (1839:30): [True: 417k, False: 43.4k]
  ------------------
 1840|   461k|    extra->uriHashValue = uri->hashValue;
 1841|   461k|    extra->elementId = ctxt->nsdb->elementId;
 1842|   461k|    extra->oldIndex = oldIndex;
 1843|       |
 1844|   461k|    ctxt->nsNr++;
 1845|       |
 1846|   461k|    return(1);
 1847|   137k|}
parser.c:xmlParserNsGrow:
 1661|  17.2k|xmlParserNsGrow(xmlParserCtxtPtr ctxt) {
 1662|  17.2k|    const xmlChar **table;
 1663|  17.2k|    xmlParserNsExtra *extra;
 1664|  17.2k|    int newSize;
 1665|       |
 1666|  17.2k|    newSize = xmlGrowCapacity(ctxt->nsMax,
 1667|  17.2k|                              sizeof(table[0]) + sizeof(extra[0]),
 1668|  17.2k|                              16, XML_MAX_ITEMS);
  ------------------
  |  |   13|  17.2k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1669|  17.2k|    if (newSize < 0)
  ------------------
  |  Branch (1669:9): [True: 0, False: 17.2k]
  ------------------
 1670|      0|        goto error;
 1671|       |
 1672|  17.2k|    table = xmlRealloc(ctxt->nsTab, 2 * newSize * sizeof(table[0]));
 1673|  17.2k|    if (table == NULL)
  ------------------
  |  Branch (1673:9): [True: 7, False: 17.2k]
  ------------------
 1674|      7|        goto error;
 1675|  17.2k|    ctxt->nsTab = table;
 1676|       |
 1677|  17.2k|    extra = xmlRealloc(ctxt->nsdb->extra, newSize * sizeof(extra[0]));
 1678|  17.2k|    if (extra == NULL)
  ------------------
  |  Branch (1678:9): [True: 15, False: 17.1k]
  ------------------
 1679|     15|        goto error;
 1680|  17.1k|    ctxt->nsdb->extra = extra;
 1681|       |
 1682|  17.1k|    ctxt->nsMax = newSize;
 1683|  17.1k|    return(0);
 1684|       |
 1685|     22|error:
 1686|     22|    xmlErrMemory(ctxt);
 1687|     22|    return(-1);
 1688|  17.2k|}
parser.c:xmlParserNsPop:
 1858|   236k|{
 1859|   236k|    int i;
 1860|       |
 1861|       |    /* assert(nr <= ctxt->nsNr); */
 1862|       |
 1863|   598k|    for (i = ctxt->nsNr - 1; i >= ctxt->nsNr - nr; i--) {
  ------------------
  |  Branch (1863:30): [True: 361k, False: 236k]
  ------------------
 1864|   361k|        const xmlChar *prefix = ctxt->nsTab[i * 2];
 1865|   361k|        xmlParserNsExtra *extra = &ctxt->nsdb->extra[i];
 1866|       |
 1867|   361k|        if (prefix == NULL) {
  ------------------
  |  Branch (1867:13): [True: 19.3k, False: 342k]
  ------------------
 1868|  19.3k|            ctxt->nsdb->defaultNsIndex = extra->oldIndex;
 1869|   342k|        } else {
 1870|   342k|            xmlHashedString hprefix;
 1871|   342k|            xmlParserNsBucket *bucket = NULL;
 1872|       |
 1873|   342k|            hprefix.name = prefix;
 1874|   342k|            hprefix.hashValue = extra->prefixHashValue;
 1875|   342k|            xmlParserNsLookup(ctxt, &hprefix, &bucket);
 1876|       |            /* assert(bucket && bucket->hashValue); */
 1877|   342k|            bucket->index = extra->oldIndex;
 1878|   342k|        }
 1879|   361k|    }
 1880|       |
 1881|   236k|    ctxt->nsNr -= nr;
 1882|   236k|    return(nr);
 1883|   236k|}
parser.c:xmlCtxtSetOptionsInternal:
13169|  49.1k|{
13170|  49.1k|    int allMask;
13171|       |
13172|  49.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (13172:9): [True: 0, False: 49.1k]
  ------------------
13173|      0|        return(-1);
13174|       |
13175|       |    /*
13176|       |     * XInclude options aren't handled by the parser.
13177|       |     *
13178|       |     * XML_PARSE_XINCLUDE
13179|       |     * XML_PARSE_NOXINCNODE
13180|       |     * XML_PARSE_NOBASEFIX
13181|       |     */
13182|  49.1k|    allMask = XML_PARSE_RECOVER |
13183|  49.1k|              XML_PARSE_NOENT |
13184|  49.1k|              XML_PARSE_DTDLOAD |
13185|  49.1k|              XML_PARSE_DTDATTR |
13186|  49.1k|              XML_PARSE_DTDVALID |
13187|  49.1k|              XML_PARSE_NOERROR |
13188|  49.1k|              XML_PARSE_NOWARNING |
13189|  49.1k|              XML_PARSE_PEDANTIC |
13190|  49.1k|              XML_PARSE_NOBLANKS |
13191|  49.1k|#ifdef LIBXML_SAX1_ENABLED
13192|  49.1k|              XML_PARSE_SAX1 |
13193|  49.1k|#endif
13194|  49.1k|              XML_PARSE_NONET |
13195|  49.1k|              XML_PARSE_NODICT |
13196|  49.1k|              XML_PARSE_NSCLEAN |
13197|  49.1k|              XML_PARSE_NOCDATA |
13198|  49.1k|              XML_PARSE_COMPACT |
13199|  49.1k|              XML_PARSE_OLD10 |
13200|  49.1k|              XML_PARSE_HUGE |
13201|  49.1k|              XML_PARSE_OLDSAX |
13202|  49.1k|              XML_PARSE_IGNORE_ENC |
13203|  49.1k|              XML_PARSE_BIG_LINES |
13204|  49.1k|              XML_PARSE_NO_XXE |
13205|  49.1k|              XML_PARSE_UNZIP |
13206|  49.1k|              XML_PARSE_NO_SYS_CATALOG |
13207|  49.1k|              XML_PARSE_CATALOG_PI;
13208|       |
13209|  49.1k|    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
13210|       |
13211|       |    /*
13212|       |     * For some options, struct members are historically the source
13213|       |     * of truth. The values are initalized from global variables and
13214|       |     * old code could also modify them directly. Several older API
13215|       |     * functions that don't take an options argument rely on these
13216|       |     * deprecated mechanisms.
13217|       |     *
13218|       |     * Once public access to struct members and the globals are
13219|       |     * disabled, we can use the options bitmask as source of
13220|       |     * truth, making all these struct members obsolete.
13221|       |     *
13222|       |     * The XML_DETECT_IDS flags is misnamed. It simply enables
13223|       |     * loading of the external subset.
13224|       |     */
13225|  49.1k|    ctxt->recovery = (options & XML_PARSE_RECOVER) ? 1 : 0;
  ------------------
  |  Branch (13225:22): [True: 25.2k, False: 23.8k]
  ------------------
13226|  49.1k|    ctxt->replaceEntities = (options & XML_PARSE_NOENT) ? 1 : 0;
  ------------------
  |  Branch (13226:29): [True: 24.9k, False: 24.1k]
  ------------------
13227|  49.1k|    ctxt->loadsubset = (options & XML_PARSE_DTDLOAD) ? XML_DETECT_IDS : 0;
  ------------------
  |  |  208|  27.3k|#define XML_DETECT_IDS		2
  ------------------
  |  Branch (13227:24): [True: 27.3k, False: 21.7k]
  ------------------
13228|  49.1k|    ctxt->loadsubset |= (options & XML_PARSE_DTDATTR) ? XML_COMPLETE_ATTRS : 0;
  ------------------
  |  |  209|  23.5k|#define XML_COMPLETE_ATTRS	4
  ------------------
  |  Branch (13228:25): [True: 23.5k, False: 25.5k]
  ------------------
13229|  49.1k|    ctxt->loadsubset |= (options & XML_PARSE_SKIP_IDS) ? XML_SKIP_IDS : 0;
  ------------------
  |  |  210|  23.7k|#define XML_SKIP_IDS		8
  ------------------
  |  Branch (13229:25): [True: 23.7k, False: 25.3k]
  ------------------
13230|  49.1k|    ctxt->validate = (options & XML_PARSE_DTDVALID) ? 1 : 0;
  ------------------
  |  Branch (13230:22): [True: 23.2k, False: 25.8k]
  ------------------
13231|  49.1k|    ctxt->pedantic = (options & XML_PARSE_PEDANTIC) ? 1 : 0;
  ------------------
  |  Branch (13231:22): [True: 11.3k, False: 37.7k]
  ------------------
13232|  49.1k|    ctxt->keepBlanks = (options & XML_PARSE_NOBLANKS) ? 0 : 1;
  ------------------
  |  Branch (13232:24): [True: 22.7k, False: 26.3k]
  ------------------
13233|  49.1k|    ctxt->dictNames = (options & XML_PARSE_NODICT) ? 0 : 1;
  ------------------
  |  Branch (13233:23): [True: 20.8k, False: 28.2k]
  ------------------
13234|       |
13235|  49.1k|    return(options & ~allMask);
13236|  49.1k|}

xmlCtxtSetErrorHandler:
  122|  49.1k|{
  123|  49.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (123:9): [True: 0, False: 49.1k]
  ------------------
  124|      0|        return;
  125|  49.1k|    ctxt->errorHandler = handler;
  126|  49.1k|    ctxt->errorCtxt = data;
  127|  49.1k|}
xmlCtxtErrMemory:
  179|  14.7k|{
  180|  14.7k|    xmlStructuredErrorFunc schannel = NULL;
  181|  14.7k|    xmlGenericErrorFunc channel = NULL;
  182|  14.7k|    void *data;
  183|       |
  184|  14.7k|    if (ctxt == NULL) {
  ------------------
  |  Branch (184:9): [True: 0, False: 14.7k]
  ------------------
  185|      0|        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  186|      0|        return;
  187|      0|    }
  188|       |
  189|  14.7k|    ctxt->errNo = XML_ERR_NO_MEMORY;
  190|  14.7k|    ctxt->instate = XML_PARSER_EOF; /* TODO: Remove after refactoring */
  191|  14.7k|    ctxt->wellFormed = 0;
  192|  14.7k|    ctxt->disableSAX = 2;
  193|       |
  194|  14.7k|    if (ctxt->errorHandler) {
  ------------------
  |  Branch (194:9): [True: 14.7k, False: 0]
  ------------------
  195|  14.7k|        schannel = ctxt->errorHandler;
  196|  14.7k|        data = ctxt->errorCtxt;
  197|  14.7k|    } else if ((ctxt->sax->initialized == XML_SAX2_MAGIC) &&
  ------------------
  |  |  953|      0|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (197:16): [True: 0, False: 0]
  ------------------
  198|      0|        (ctxt->sax->serror != NULL)) {
  ------------------
  |  Branch (198:9): [True: 0, False: 0]
  ------------------
  199|      0|        schannel = ctxt->sax->serror;
  200|      0|        data = ctxt->userData;
  201|      0|    } else {
  202|      0|        channel = ctxt->sax->error;
  203|      0|        data = ctxt->userData;
  204|      0|    }
  205|       |
  206|  14.7k|    xmlRaiseMemoryError(schannel, channel, data, XML_FROM_PARSER,
  207|  14.7k|                        &ctxt->lastError);
  208|  14.7k|}
xmlCtxtErrIO:
  221|   251k|{
  222|   251k|    const char *errstr, *msg, *str1, *str2;
  223|   251k|    xmlErrorLevel level;
  224|       |
  225|   251k|    if (ctxt == NULL)
  ------------------
  |  Branch (225:9): [True: 0, False: 251k]
  ------------------
  226|      0|        return;
  227|       |
  228|   251k|    if (((code == XML_IO_ENOENT) ||
  ------------------
  |  Branch (228:10): [True: 6.48k, False: 244k]
  ------------------
  229|   244k|         (code == XML_IO_UNKNOWN))) {
  ------------------
  |  Branch (229:10): [True: 0, False: 244k]
  ------------------
  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.48k|        if (ctxt->validate == 0)
  ------------------
  |  Branch (236:13): [True: 3.48k, False: 2.99k]
  ------------------
  237|  3.48k|            level = XML_ERR_WARNING;
  238|  2.99k|        else
  239|  2.99k|            level = XML_ERR_ERROR;
  240|   244k|    } else if (code == XML_IO_NETWORK_ATTEMPT) {
  ------------------
  |  Branch (240:16): [True: 0, False: 244k]
  ------------------
  241|      0|        level = XML_ERR_ERROR;
  242|   244k|    } else {
  243|   244k|        level = XML_ERR_FATAL;
  244|   244k|    }
  245|       |
  246|   251k|    errstr = xmlErrString(code);
  247|       |
  248|   251k|    if (uri == NULL) {
  ------------------
  |  Branch (248:9): [True: 244k, False: 6.56k]
  ------------------
  249|   244k|        msg = "%s\n";
  250|   244k|        str1 = errstr;
  251|   244k|        str2 = NULL;
  252|   244k|    } else {
  253|  6.56k|        msg = "failed to load \"%s\": %s\n";
  254|  6.56k|        str1 = uri;
  255|  6.56k|        str2 = errstr;
  256|  6.56k|    }
  257|       |
  258|   251k|    xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level,
  259|   251k|               (const xmlChar *) uri, NULL, NULL, 0,
  260|   251k|               msg, str1, str2);
  261|   251k|}
xmlCtxtIsCatastrophicError:
  268|  39.1M|xmlCtxtIsCatastrophicError(xmlParserCtxt *ctxt) {
  269|  39.1M|    if (ctxt == NULL)
  ------------------
  |  Branch (269:9): [True: 0, False: 39.1M]
  ------------------
  270|      0|        return(1);
  271|       |
  272|  39.1M|    return(xmlIsCatastrophicError(ctxt->lastError.level,
  273|  39.1M|                                  ctxt->lastError.code));
  274|  39.1M|}
xmlCtxtVErr:
  296|  39.3M|{
  297|  39.3M|    xmlStructuredErrorFunc schannel = NULL;
  298|  39.3M|    xmlGenericErrorFunc channel = NULL;
  299|  39.3M|    void *data = NULL;
  300|  39.3M|    const char *file = NULL;
  301|  39.3M|    int line = 0;
  302|  39.3M|    int col = 0;
  303|  39.3M|    int res;
  304|       |
  305|  39.3M|    if (code == XML_ERR_NO_MEMORY) {
  ------------------
  |  Branch (305:9): [True: 3.52k, False: 39.3M]
  ------------------
  306|  3.52k|        xmlCtxtErrMemory(ctxt);
  307|  3.52k|        return;
  308|  3.52k|    }
  309|       |
  310|  39.3M|    if (ctxt == NULL) {
  ------------------
  |  Branch (310:9): [True: 0, False: 39.3M]
  ------------------
  311|      0|        res = xmlVRaiseError(NULL, NULL, NULL, NULL, node, domain, code,
  312|      0|                             level, NULL, 0, (const char *) str1,
  313|      0|                             (const char *) str2, (const char *) str3,
  314|      0|                             int1, 0, msg, ap);
  315|      0|        if (res < 0)
  ------------------
  |  Branch (315:13): [True: 0, False: 0]
  ------------------
  316|      0|            xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_PARSER, NULL);
  317|       |
  318|      0|        return;
  319|      0|    }
  320|       |
  321|  39.3M|    if (PARSER_STOPPED(ctxt))
  ------------------
  |  |   44|  39.3M|#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
  |  |  ------------------
  |  |  |  Branch (44:30): [True: 252k, False: 39.0M]
  |  |  ------------------
  ------------------
  322|   252k|	return;
  323|       |
  324|       |    /* Don't overwrite catastrophic errors */
  325|  39.0M|    if (xmlCtxtIsCatastrophicError(ctxt))
  ------------------
  |  Branch (325:9): [True: 0, False: 39.0M]
  ------------------
  326|      0|        return;
  327|       |
  328|  39.0M|    if (level == XML_ERR_WARNING) {
  ------------------
  |  Branch (328:9): [True: 162k, False: 38.9M]
  ------------------
  329|   162k|        if (ctxt->nbWarnings >= XML_MAX_ERRORS)
  ------------------
  |  |   54|   162k|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (329:13): [True: 113k, False: 49.3k]
  ------------------
  330|   113k|            return;
  331|  49.3k|        ctxt->nbWarnings += 1;
  332|  38.9M|    } 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|  38.9M|        if (xmlIsCatastrophicError(level, code) ||
  ------------------
  |  Branch (341:13): [True: 21, False: 38.9M]
  ------------------
  342|  38.9M|            code == XML_ERR_RESOURCE_LIMIT ||
  ------------------
  |  Branch (342:13): [True: 305, False: 38.9M]
  ------------------
  343|  38.9M|            code == XML_ERR_ENTITY_LOOP) {
  ------------------
  |  Branch (343:13): [True: 98, False: 38.9M]
  ------------------
  344|    424|            ctxt->disableSAX = 2; /* really stop parser */
  345|  38.9M|        } else {
  346|       |            /* Report at least one fatal error. */
  347|  38.9M|            if (ctxt->nbErrors >= XML_MAX_ERRORS &&
  ------------------
  |  |   54|  77.8M|#define XML_MAX_ERRORS 100
  ------------------
  |  Branch (347:17): [True: 38.3M, False: 611k]
  ------------------
  348|  38.3M|                (level < XML_ERR_FATAL || ctxt->wellFormed == 0))
  ------------------
  |  Branch (348:18): [True: 719k, False: 37.6M]
  |  Branch (348:43): [True: 37.6M, False: 221]
  ------------------
  349|  38.3M|                return;
  350|       |
  351|   611k|            if (level == XML_ERR_FATAL && ctxt->recovery == 0)
  ------------------
  |  Branch (351:17): [True: 463k, False: 147k]
  |  Branch (351:43): [True: 112k, False: 351k]
  ------------------
  352|   112k|                ctxt->disableSAX = 1;
  353|   611k|        }
  354|       |
  355|   612k|        if (level == XML_ERR_FATAL)
  ------------------
  |  Branch (355:13): [True: 464k, False: 147k]
  ------------------
  356|   464k|            ctxt->wellFormed = 0;
  357|   612k|        ctxt->errNo = code;
  358|   612k|        ctxt->nbErrors += 1;
  359|   612k|    }
  360|       |
  361|   661k|    if (((ctxt->options & XML_PARSE_NOERROR) == 0) &&
  ------------------
  |  Branch (361:9): [True: 250k, False: 411k]
  ------------------
  362|   250k|        ((level != XML_ERR_WARNING) ||
  ------------------
  |  Branch (362:10): [True: 231k, False: 18.7k]
  ------------------
  363|   241k|         ((ctxt->options & XML_PARSE_NOWARNING) == 0))) {
  ------------------
  |  Branch (363:10): [True: 9.97k, False: 8.75k]
  ------------------
  364|   241k|        if (ctxt->errorHandler) {
  ------------------
  |  Branch (364:13): [True: 241k, False: 0]
  ------------------
  365|   241k|            schannel = ctxt->errorHandler;
  366|   241k|            data = ctxt->errorCtxt;
  367|   241k|        } 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|   241k|    }
  385|       |
  386|   661k|    if (ctxt->input != NULL) {
  ------------------
  |  Branch (386:9): [True: 659k, False: 2.42k]
  ------------------
  387|   659k|        xmlParserInputPtr input = ctxt->input;
  388|       |
  389|   659k|        if ((input->filename == NULL) &&
  ------------------
  |  Branch (389:13): [True: 384k, False: 275k]
  ------------------
  390|   384k|            (ctxt->inputNr > 1)) {
  ------------------
  |  Branch (390:13): [True: 21.8k, False: 362k]
  ------------------
  391|  21.8k|            input = ctxt->inputTab[ctxt->inputNr - 2];
  392|  21.8k|        }
  393|   659k|        file = input->filename;
  394|   659k|        line = input->line;
  395|   659k|        col = input->col;
  396|   659k|    }
  397|       |
  398|   661k|    res = xmlVRaiseError(schannel, channel, data, ctxt, node, domain, code,
  399|   661k|                         level, file, line, (const char *) str1,
  400|   661k|                         (const char *) str2, (const char *) str3, int1, col,
  401|   661k|                         msg, ap);
  402|       |
  403|   661k|    if (res < 0) {
  ------------------
  |  Branch (403:9): [True: 2.49k, False: 659k]
  ------------------
  404|  2.49k|        xmlCtxtErrMemory(ctxt);
  405|  2.49k|        return;
  406|  2.49k|    }
  407|   661k|}
xmlCtxtErr:
  429|  38.9M|{
  430|  38.9M|    va_list ap;
  431|       |
  432|  38.9M|    va_start(ap, msg);
  433|  38.9M|    xmlCtxtVErr(ctxt, node, domain, code, level,
  434|  38.9M|                str1, str2, str3, int1, msg, ap);
  435|       |    va_end(ap);
  436|  38.9M|}
xmlFatalErr:
  481|  8.52M|{
  482|  8.52M|    const char *errmsg;
  483|  8.52M|    xmlErrorDomain domain = XML_FROM_PARSER;
  484|  8.52M|    xmlErrorLevel level = XML_ERR_FATAL;
  485|       |
  486|  8.52M|    errmsg = xmlErrString(code);
  487|       |
  488|  8.52M|    if ((ctxt != NULL) && (ctxt->html)) {
  ------------------
  |  Branch (488:9): [True: 8.52M, False: 0]
  |  Branch (488:27): [True: 0, False: 8.52M]
  ------------------
  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.52M|    if (info == NULL) {
  ------------------
  |  Branch (496:9): [True: 1.75M, False: 6.76M]
  ------------------
  497|  1.75M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  498|  1.75M|                   NULL, NULL, NULL, 0, "%s\n", errmsg);
  499|  6.76M|    } else {
  500|  6.76M|        xmlCtxtErr(ctxt, NULL, domain, code, level,
  501|  6.76M|                   (const xmlChar *) info, NULL, NULL, 0,
  502|  6.76M|                   "%s: %s\n", errmsg, info);
  503|  6.76M|    }
  504|  8.52M|}
xmlParserGrow:
  616|  9.58M|xmlParserGrow(xmlParserCtxt *ctxt) {
  617|  9.58M|    xmlParserInputPtr in = ctxt->input;
  618|  9.58M|    xmlParserInputBufferPtr buf = in->buf;
  619|  9.58M|    size_t curEnd = in->end - in->cur;
  620|  9.58M|    size_t curBase = in->cur - in->base;
  621|  9.58M|    size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
  ------------------
  |  Branch (621:24): [True: 3.34M, False: 6.24M]
  ------------------
  622|  3.34M|                       XML_MAX_HUGE_LENGTH :
  ------------------
  |  |   55|  3.34M|#define XML_MAX_HUGE_LENGTH 1000000000
  ------------------
  623|  9.58M|                       XML_MAX_LOOKUP_LIMIT;
  ------------------
  |  |   81|  15.8M|#define XML_MAX_LOOKUP_LIMIT 10000000
  ------------------
  624|  9.58M|    int ret;
  625|       |
  626|  9.58M|    if (buf == NULL)
  ------------------
  |  Branch (626:9): [True: 0, False: 9.58M]
  ------------------
  627|      0|        return(0);
  628|       |    /* Don't grow push parser buffer. */
  629|  9.58M|    if (PARSER_PROGRESSIVE(ctxt))
  ------------------
  |  |   47|  9.58M|    ((ctxt)->input->flags & XML_INPUT_PROGRESSIVE)
  |  |  ------------------
  |  |  |  |   41|  9.58M|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  |  |  ------------------
  |  |  |  Branch (47:5): [True: 2.81M, False: 6.77M]
  |  |  ------------------
  ------------------
  630|  2.81M|        return(0);
  631|       |    /* Don't grow memory buffers. */
  632|  6.77M|    if ((buf->encoder == NULL) && (buf->readcallback == NULL))
  ------------------
  |  Branch (632:9): [True: 6.26M, False: 503k]
  |  Branch (632:35): [True: 6.26M, False: 0]
  ------------------
  633|  6.26M|        return(0);
  634|   503k|    if (buf->error != 0)
  ------------------
  |  Branch (634:9): [True: 103k, False: 400k]
  ------------------
  635|   103k|        return(-1);
  636|       |
  637|   400k|    if (curBase > maxLength) {
  ------------------
  |  Branch (637:9): [True: 0, False: 400k]
  ------------------
  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|   400k|    if (curEnd >= INPUT_CHUNK)
  ------------------
  |  |   63|   400k|#define INPUT_CHUNK	250
  ------------------
  |  Branch (643:9): [True: 423, False: 400k]
  ------------------
  644|    423|        return(0);
  645|       |
  646|   400k|    ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
  ------------------
  |  |   63|   400k|#define INPUT_CHUNK	250
  ------------------
  647|   400k|    xmlBufUpdateInput(buf->buffer, in, curBase);
  648|       |
  649|   400k|    if (ret < 0) {
  ------------------
  |  Branch (649:9): [True: 393, False: 399k]
  ------------------
  650|    393|        xmlCtxtErrIO(ctxt, buf->error, NULL);
  651|    393|    }
  652|       |
  653|   400k|    return(ret);
  654|   400k|}
xmlParserCheckEOF:
  664|  24.4k|xmlParserCheckEOF(xmlParserCtxt *ctxt, xmlParserErrors code) {
  665|  24.4k|    xmlParserInputPtr in = ctxt->input;
  666|  24.4k|    xmlParserInputBufferPtr buf;
  667|       |
  668|  24.4k|    if (ctxt->errNo != XML_ERR_OK)
  ------------------
  |  Branch (668:9): [True: 20.1k, False: 4.26k]
  ------------------
  669|  20.1k|        return;
  670|       |
  671|  4.26k|    if (in->cur < in->end) {
  ------------------
  |  Branch (671:9): [True: 2, False: 4.26k]
  ------------------
  672|      2|        xmlFatalErr(ctxt, code, NULL);
  673|      2|        return;
  674|      2|    }
  675|       |
  676|  4.26k|    buf = in->buf;
  677|  4.26k|    if ((buf != NULL) && (buf->encoder != NULL)) {
  ------------------
  |  Branch (677:9): [True: 4.26k, False: 0]
  |  Branch (677:26): [True: 8, False: 4.25k]
  ------------------
  678|      8|        size_t curBase = in->cur - in->base;
  679|      8|        size_t sizeOut = 64;
  680|      8|        xmlCharEncError ret;
  681|       |
  682|       |        /*
  683|       |         * Check for truncated multi-byte sequence
  684|       |         */
  685|      8|        ret = xmlCharEncInput(buf, &sizeOut, /* flush */ 1);
  686|      8|        xmlBufUpdateInput(buf->buffer, in, curBase);
  687|      8|        if (ret != XML_ENC_ERR_SUCCESS) {
  ------------------
  |  Branch (687:13): [True: 0, False: 8]
  ------------------
  688|      0|            xmlCtxtErrIO(ctxt, buf->error, NULL);
  689|      0|            return;
  690|      0|        }
  691|       |
  692|       |        /* Shouldn't happen */
  693|      8|        if (in->cur < in->end)
  ------------------
  |  Branch (693:13): [True: 0, False: 8]
  ------------------
  694|      0|            xmlFatalErr(ctxt, XML_ERR_INTERNAL_ERROR, "expected EOF");
  695|      8|    }
  696|  4.26k|}
xmlParserShrink:
  749|  11.4M|xmlParserShrink(xmlParserCtxt *ctxt) {
  750|  11.4M|    xmlParserInputPtr in = ctxt->input;
  751|  11.4M|    xmlParserInputBufferPtr buf = in->buf;
  752|  11.4M|    size_t used, res;
  753|       |
  754|  11.4M|    if (buf == NULL)
  ------------------
  |  Branch (754:9): [True: 0, False: 11.4M]
  ------------------
  755|      0|        return;
  756|       |
  757|  11.4M|    used = in->cur - in->base;
  758|       |
  759|  11.4M|    if (used > LINE_LEN) {
  ------------------
  |  |  595|  11.4M|#define LINE_LEN        80
  ------------------
  |  Branch (759:9): [True: 7.34M, False: 4.06M]
  ------------------
  760|  7.34M|        res = xmlBufShrink(buf->buffer, used - LINE_LEN);
  ------------------
  |  |  595|  7.34M|#define LINE_LEN        80
  ------------------
  761|       |
  762|  7.34M|        if (res > 0) {
  ------------------
  |  Branch (762:13): [True: 7.34M, False: 217]
  ------------------
  763|  7.34M|            used -= res;
  764|  7.34M|            xmlSaturatedAddSizeT(&in->consumed, res);
  765|  7.34M|        }
  766|       |
  767|  7.34M|        xmlBufUpdateInput(buf->buffer, in, used);
  768|  7.34M|    }
  769|  11.4M|}
xmlNextChar:
  818|   665M|{
  819|   665M|    const unsigned char *cur;
  820|   665M|    size_t avail;
  821|   665M|    int c;
  822|       |
  823|   665M|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (823:9): [True: 0, False: 665M]
  |  Branch (823:27): [True: 0, False: 665M]
  ------------------
  824|      0|        return;
  825|       |
  826|   665M|    avail = ctxt->input->end - ctxt->input->cur;
  827|       |
  828|   665M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|   665M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (828:9): [True: 2.52M, False: 662M]
  ------------------
  829|  2.52M|        xmlParserGrow(ctxt);
  830|  2.52M|        if (ctxt->input->cur >= ctxt->input->end)
  ------------------
  |  Branch (830:13): [True: 775, False: 2.52M]
  ------------------
  831|    775|            return;
  832|  2.52M|        avail = ctxt->input->end - ctxt->input->cur;
  833|  2.52M|    }
  834|       |
  835|   665M|    cur = ctxt->input->cur;
  836|   665M|    c = *cur;
  837|       |
  838|   665M|    if (c < 0x80) {
  ------------------
  |  Branch (838:9): [True: 638M, False: 26.5M]
  ------------------
  839|   638M|        if (c == '\n') {
  ------------------
  |  Branch (839:13): [True: 254k, False: 638M]
  ------------------
  840|   254k|            ctxt->input->cur++;
  841|   254k|            ctxt->input->line++;
  842|   254k|            ctxt->input->col = 1;
  843|   638M|        } else if (c == '\r') {
  ------------------
  |  Branch (843:20): [True: 41.5k, False: 638M]
  ------------------
  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|  41.5k|            ctxt->input->cur += ((cur[1] == '\n') ? 2 : 1);
  ------------------
  |  Branch (850:34): [True: 39.8k, False: 1.72k]
  ------------------
  851|  41.5k|            ctxt->input->line++;
  852|  41.5k|            ctxt->input->col = 1;
  853|  41.5k|            return;
  854|   638M|        } else {
  855|   638M|            ctxt->input->cur++;
  856|   638M|            ctxt->input->col++;
  857|   638M|        }
  858|   638M|    } else {
  859|  26.5M|        ctxt->input->col++;
  860|       |
  861|  26.5M|        if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (861:13): [True: 2.13k, False: 26.5M]
  |  Branch (861:28): [True: 23.7M, False: 2.79M]
  ------------------
  862|  23.7M|            goto encoding_error;
  863|       |
  864|  2.79M|        if (c < 0xe0) {
  ------------------
  |  Branch (864:13): [True: 2.36M, False: 423k]
  ------------------
  865|       |            /* 2-byte code */
  866|  2.36M|            if (c < 0xc2)
  ------------------
  |  Branch (866:17): [True: 557k, False: 1.81M]
  ------------------
  867|   557k|                goto encoding_error;
  868|  1.81M|            ctxt->input->cur += 2;
  869|  1.81M|        } else {
  870|   423k|            unsigned int val = (c << 8) | cur[1];
  871|       |
  872|   423k|            if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (872:17): [True: 317, False: 422k]
  |  Branch (872:32): [True: 6.85k, False: 415k]
  ------------------
  873|  7.16k|                goto encoding_error;
  874|       |
  875|   415k|            if (c < 0xf0) {
  ------------------
  |  Branch (875:17): [True: 392k, False: 23.9k]
  ------------------
  876|       |                /* 3-byte code */
  877|   392k|                if ((val < 0xe0a0) || ((val >= 0xeda0) && (val < 0xee00)))
  ------------------
  |  Branch (877:21): [True: 198, False: 391k]
  |  Branch (877:40): [True: 23.5k, False: 368k]
  |  Branch (877:59): [True: 5.67k, False: 17.9k]
  ------------------
  878|  5.86k|                    goto encoding_error;
  879|   386k|                ctxt->input->cur += 3;
  880|   386k|            } else {
  881|  23.9k|                if ((avail < 4) || ((cur[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (881:21): [True: 348, False: 23.5k]
  |  Branch (881:36): [True: 763, False: 22.8k]
  ------------------
  882|  1.11k|                    goto encoding_error;
  883|       |
  884|       |                /* 4-byte code */
  885|  22.8k|                if ((val < 0xf090) || (val >= 0xf490))
  ------------------
  |  Branch (885:21): [True: 572, False: 22.2k]
  |  Branch (885:39): [True: 243, False: 22.0k]
  ------------------
  886|    815|                    goto encoding_error;
  887|  22.0k|                ctxt->input->cur += 4;
  888|  22.0k|            }
  889|   415k|        }
  890|  2.79M|    }
  891|       |
  892|   640M|    return;
  893|       |
  894|   640M|encoding_error:
  895|       |    /* Only report the first error */
  896|  24.3M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  24.3M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (896:9): [True: 204k, False: 24.1M]
  ------------------
  897|   204k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
  898|   204k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|   204k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  899|   204k|    }
  900|  24.3M|    ctxt->input->cur++;
  901|  24.3M|}
xmlCurrentChar:
  924|  65.6M|xmlCurrentChar(xmlParserCtxt *ctxt, int *len) {
  925|  65.6M|    const unsigned char *cur;
  926|  65.6M|    size_t avail;
  927|  65.6M|    int c;
  928|       |
  929|  65.6M|    if ((ctxt == NULL) || (len == NULL) || (ctxt->input == NULL)) return(0);
  ------------------
  |  Branch (929:9): [True: 0, False: 65.6M]
  |  Branch (929:27): [True: 0, False: 65.6M]
  |  Branch (929:44): [True: 0, False: 65.6M]
  ------------------
  930|       |
  931|  65.6M|    avail = ctxt->input->end - ctxt->input->cur;
  932|       |
  933|  65.6M|    if (avail < INPUT_CHUNK) {
  ------------------
  |  |   63|  65.6M|#define INPUT_CHUNK	250
  ------------------
  |  Branch (933:9): [True: 3.25M, False: 62.3M]
  ------------------
  934|  3.25M|        xmlParserGrow(ctxt);
  935|  3.25M|        avail = ctxt->input->end - ctxt->input->cur;
  936|  3.25M|    }
  937|       |
  938|  65.6M|    cur = ctxt->input->cur;
  939|  65.6M|    c = *cur;
  940|       |
  941|  65.6M|    if (c < 0x80) {
  ------------------
  |  Branch (941:9): [True: 31.8M, False: 33.7M]
  ------------------
  942|       |	/* 1-byte code */
  943|  31.8M|        if (c < 0x20) {
  ------------------
  |  Branch (943:13): [True: 12.9M, False: 18.8M]
  ------------------
  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|  12.9M|            if (c == '\r') {
  ------------------
  |  Branch (950:17): [True: 934k, False: 12.0M]
  ------------------
  951|       |                /*
  952|       |                 * TODO: This function shouldn't change the 'cur' pointer
  953|       |                 * as side effect, but the NEXTL macro in parser.c relies
  954|       |                 * on this behavior when incrementing line numbers.
  955|       |                 */
  956|   934k|                if (cur[1] == '\n')
  ------------------
  |  Branch (956:21): [True: 21.2k, False: 913k]
  ------------------
  957|  21.2k|                    ctxt->input->cur++;
  958|   934k|                *len = 1;
  959|   934k|                c = '\n';
  960|  12.0M|            } else if (c == 0) {
  ------------------
  |  Branch (960:24): [True: 6.79M, False: 5.25M]
  ------------------
  961|  6.79M|                if (ctxt->input->cur >= ctxt->input->end) {
  ------------------
  |  Branch (961:21): [True: 34.2k, False: 6.76M]
  ------------------
  962|  34.2k|                    *len = 0;
  963|  6.76M|                } else {
  964|  6.76M|                    *len = 1;
  965|       |                    /*
  966|       |                     * TODO: Null bytes should be handled by callers,
  967|       |                     * but this can be tricky.
  968|       |                     */
  969|  6.76M|                    xmlFatalErr(ctxt, XML_ERR_INVALID_CHAR,
  970|  6.76M|                            "Char 0x0 out of allowed range\n");
  971|  6.76M|                }
  972|  6.79M|            } else {
  973|  5.25M|                *len = 1;
  974|  5.25M|            }
  975|  18.8M|        } else {
  976|  18.8M|            *len = 1;
  977|  18.8M|        }
  978|       |
  979|  31.8M|        return(c);
  980|  33.7M|    } else {
  981|  33.7M|        int val;
  982|       |
  983|  33.7M|        if (avail < 2)
  ------------------
  |  Branch (983:13): [True: 1.43k, False: 33.7M]
  ------------------
  984|  1.43k|            goto incomplete_sequence;
  985|  33.7M|        if ((cur[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (985:13): [True: 12.0M, False: 21.6M]
  ------------------
  986|  12.0M|            goto encoding_error;
  987|       |
  988|  21.6M|        if (c < 0xe0) {
  ------------------
  |  Branch (988:13): [True: 8.46M, False: 13.2M]
  ------------------
  989|       |            /* 2-byte code */
  990|  8.46M|            if (c < 0xc2)
  ------------------
  |  Branch (990:17): [True: 358k, False: 8.10M]
  ------------------
  991|   358k|                goto encoding_error;
  992|  8.10M|            val = (c & 0x1f) << 6;
  993|  8.10M|            val |= cur[1] & 0x3f;
  994|  8.10M|            *len = 2;
  995|  13.2M|        } else {
  996|  13.2M|            if (avail < 3)
  ------------------
  |  Branch (996:17): [True: 112, False: 13.2M]
  ------------------
  997|    112|                goto incomplete_sequence;
  998|  13.2M|            if ((cur[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (998:17): [True: 8.63k, False: 13.2M]
  ------------------
  999|  8.63k|                goto encoding_error;
 1000|       |
 1001|  13.2M|            if (c < 0xf0) {
  ------------------
  |  Branch (1001:17): [True: 13.1M, False: 20.3k]
  ------------------
 1002|       |                /* 3-byte code */
 1003|  13.1M|                val = (c & 0xf) << 12;
 1004|  13.1M|                val |= (cur[1] & 0x3f) << 6;
 1005|  13.1M|                val |= cur[2] & 0x3f;
 1006|  13.1M|                if ((val < 0x800) || ((val >= 0xd800) && (val < 0xe000)))
  ------------------
  |  Branch (1006:21): [True: 502, False: 13.1M]
  |  Branch (1006:39): [True: 2.71M, False: 10.4M]
  |  Branch (1006:58): [True: 260, False: 2.71M]
  ------------------
 1007|    762|                    goto encoding_error;
 1008|  13.1M|                *len = 3;
 1009|  13.1M|            } else {
 1010|  20.3k|                if (avail < 4)
  ------------------
  |  Branch (1010:21): [True: 265, False: 20.0k]
  ------------------
 1011|    265|                    goto incomplete_sequence;
 1012|  20.0k|                if ((cur[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (1012:21): [True: 2.25k, False: 17.8k]
  ------------------
 1013|  2.25k|                    goto encoding_error;
 1014|       |
 1015|       |                /* 4-byte code */
 1016|  17.8k|                val = (c & 0x0f) << 18;
 1017|  17.8k|                val |= (cur[1] & 0x3f) << 12;
 1018|  17.8k|                val |= (cur[2] & 0x3f) << 6;
 1019|  17.8k|                val |= cur[3] & 0x3f;
 1020|  17.8k|                if ((val < 0x10000) || (val >= 0x110000))
  ------------------
  |  Branch (1020:21): [True: 224, False: 17.6k]
  |  Branch (1020:40): [True: 4.86k, False: 12.7k]
  ------------------
 1021|  5.09k|                    goto encoding_error;
 1022|  12.7k|                *len = 4;
 1023|  12.7k|            }
 1024|  13.2M|        }
 1025|       |
 1026|  21.3M|        return(val);
 1027|  21.6M|    }
 1028|       |
 1029|  12.4M|encoding_error:
 1030|       |    /* Only report the first error */
 1031|  12.4M|    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
  ------------------
  |  |   40|  12.4M|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
  |  Branch (1031:9): [True: 13.6k, False: 12.4M]
  ------------------
 1032|  13.6k|        xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
 1033|  13.6k|        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
  ------------------
  |  |   40|  13.6k|#define XML_INPUT_ENCODING_ERROR    (1u << 5)
  ------------------
 1034|  13.6k|    }
 1035|  12.4M|    *len = 1;
 1036|  12.4M|    return(XML_INVALID_CHAR);
  ------------------
  |  |    9|  12.4M|#define XML_INVALID_CHAR 0x200000
  ------------------
 1037|       |
 1038|  1.81k|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.81k|    *len = 0;
 1046|  1.81k|    return(0);
 1047|  65.6M|}
xmlCopyCharMultiByte:
 1086|  25.0M|xmlCopyCharMultiByte(xmlChar *out, int val) {
 1087|  25.0M|    if ((out == NULL) || (val < 0)) return(0);
  ------------------
  |  Branch (1087:9): [True: 0, False: 25.0M]
  |  Branch (1087:26): [True: 0, False: 25.0M]
  ------------------
 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|  25.0M|    if  (val >= 0x80) {
  ------------------
  |  Branch (1097:10): [True: 25.0M, False: 7.86k]
  ------------------
 1098|  25.0M|	xmlChar *savedout = out;
 1099|  25.0M|	int bits;
 1100|  25.0M|	if (val <   0x800) { *out++= (val >>  6) | 0xC0;  bits=  0; }
  ------------------
  |  Branch (1100:6): [True: 4.94M, False: 20.1M]
  ------------------
 1101|  20.1M|	else if (val < 0x10000) { *out++= (val >> 12) | 0xE0;  bits=  6;}
  ------------------
  |  Branch (1101:11): [True: 20.0M, False: 12.3k]
  ------------------
 1102|  12.3k|	else if (val < 0x110000)  { *out++= (val >> 18) | 0xF0;  bits=  12; }
  ------------------
  |  Branch (1102:11): [True: 12.3k, 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|  70.2M|	for ( ; bits >= 0; bits-= 6)
  ------------------
  |  Branch (1109:10): [True: 45.1M, False: 25.0M]
  ------------------
 1110|  45.1M|	    *out++= ((val >> bits) & 0x3F) | 0x80 ;
 1111|  25.0M|	return (out - savedout);
 1112|  25.0M|    }
 1113|  7.86k|    *out = val;
 1114|  7.86k|    return 1;
 1115|  25.0M|}
xmlSwitchEncoding:
 1263|  6.50k|{
 1264|  6.50k|    xmlCharEncodingHandlerPtr handler = NULL;
 1265|  6.50k|    int ret;
 1266|  6.50k|    xmlParserErrors code;
 1267|       |
 1268|  6.50k|    if ((ctxt == NULL) || (ctxt->input == NULL))
  ------------------
  |  Branch (1268:9): [True: 0, False: 6.50k]
  |  Branch (1268:27): [True: 0, False: 6.50k]
  ------------------
 1269|      0|        return(-1);
 1270|       |
 1271|  6.50k|    code = xmlLookupCharEncodingHandler(enc, &handler);
 1272|  6.50k|    if (code != 0) {
  ------------------
  |  Branch (1272:9): [True: 4, False: 6.50k]
  ------------------
 1273|      4|        xmlFatalErr(ctxt, code, NULL);
 1274|      4|        return(-1);
 1275|      4|    }
 1276|       |
 1277|  6.50k|    ret = xmlSwitchToEncoding(ctxt, handler);
 1278|       |
 1279|  6.50k|    if ((ret >= 0) && (enc == XML_CHAR_ENCODING_NONE)) {
  ------------------
  |  Branch (1279:9): [True: 4.75k, False: 1.74k]
  |  Branch (1279:23): [True: 0, False: 4.75k]
  ------------------
 1280|      0|        ctxt->input->flags &= ~XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|      0|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1281|      0|    }
 1282|       |
 1283|  6.50k|    return(ret);
 1284|  6.50k|}
xmlInputSetEncodingHandler:
 1353|  16.0k|                           xmlCharEncodingHandler *handler) {
 1354|  16.0k|    xmlParserInputBufferPtr in;
 1355|  16.0k|    xmlBufPtr buf;
 1356|  16.0k|    xmlParserErrors code = XML_ERR_OK;
 1357|       |
 1358|  16.0k|    if ((input == NULL) || (input->buf == NULL)) {
  ------------------
  |  Branch (1358:9): [True: 0, False: 16.0k]
  |  Branch (1358:28): [True: 0, False: 16.0k]
  ------------------
 1359|      0|        xmlCharEncCloseFunc(handler);
 1360|      0|	return(XML_ERR_ARGUMENT);
 1361|      0|    }
 1362|  16.0k|    in = input->buf;
 1363|       |
 1364|  16.0k|    input->flags |= XML_INPUT_HAS_ENCODING;
  ------------------
  |  |   33|  16.0k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
 1365|       |
 1366|       |    /*
 1367|       |     * UTF-8 requires no encoding handler.
 1368|       |     */
 1369|  16.0k|    if ((handler != NULL) &&
  ------------------
  |  Branch (1369:9): [True: 15.3k, False: 725]
  ------------------
 1370|  15.3k|        (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  15.3k|#define BAD_CAST (xmlChar *)
  ------------------
                      (xmlStrcasecmp(BAD_CAST handler->name, BAD_CAST "UTF-8") == 0)) {
  ------------------
  |  |   34|  15.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1370:9): [True: 0, False: 15.3k]
  ------------------
 1371|      0|        xmlCharEncCloseFunc(handler);
 1372|      0|        handler = NULL;
 1373|      0|    }
 1374|       |
 1375|  16.0k|    if (in->encoder == handler)
  ------------------
  |  Branch (1375:9): [True: 725, False: 15.3k]
  ------------------
 1376|    725|        return(XML_ERR_OK);
 1377|       |
 1378|  15.3k|    if (in->encoder != NULL) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 15.3k]
  ------------------
 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|  15.3k|    buf = xmlBufCreate(XML_IO_BUFFER_SIZE);
  ------------------
  |  |   20|  15.3k|#define XML_IO_BUFFER_SIZE 6000
  ------------------
 1394|  15.3k|    if (buf == NULL) {
  ------------------
  |  Branch (1394:9): [True: 29, False: 15.3k]
  ------------------
 1395|     29|        xmlCharEncCloseFunc(handler);
 1396|     29|        return(XML_ERR_NO_MEMORY);
 1397|     29|    }
 1398|       |
 1399|  15.3k|    in->encoder = handler;
 1400|  15.3k|    in->raw = in->buffer;
 1401|  15.3k|    in->buffer = buf;
 1402|       |
 1403|       |    /*
 1404|       |     * Is there already some content down the pipe to convert ?
 1405|       |     */
 1406|  15.3k|    if (input->end > input->base) {
  ------------------
  |  Branch (1406:9): [True: 15.3k, False: 0]
  ------------------
 1407|  15.3k|        size_t processed;
 1408|  15.3k|        size_t nbchars;
 1409|  15.3k|        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|  15.3k|        processed = input->cur - input->base;
 1416|  15.3k|        xmlBufShrink(in->raw, processed);
 1417|  15.3k|        input->consumed += processed;
 1418|  15.3k|        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|  15.3k|        if (input->flags & XML_INPUT_PROGRESSIVE)
  ------------------
  |  |   41|  15.3k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
  |  Branch (1426:13): [True: 1.34k, False: 14.0k]
  ------------------
 1427|  1.34k|            nbchars = SIZE_MAX;
 1428|  14.0k|        else
 1429|  14.0k|            nbchars = 4000 /* MINLEN */;
 1430|  15.3k|        res = xmlCharEncInput(in, &nbchars, /* flush */ 0);
 1431|  15.3k|        if (res != XML_ENC_ERR_SUCCESS)
  ------------------
  |  Branch (1431:13): [True: 2.95k, False: 12.3k]
  ------------------
 1432|  2.95k|            code = in->error;
 1433|  15.3k|    }
 1434|       |
 1435|  15.3k|    xmlBufResetInput(in->buffer, input);
 1436|       |
 1437|  15.3k|    return(code);
 1438|  15.3k|}
xmlSwitchToEncoding:
 1475|  11.0k|{
 1476|  11.0k|    xmlParserErrors code;
 1477|       |
 1478|  11.0k|    if (ctxt == NULL)
  ------------------
  |  Branch (1478:9): [True: 0, False: 11.0k]
  ------------------
 1479|      0|        return(-1);
 1480|       |
 1481|  11.0k|    code = xmlInputSetEncodingHandler(ctxt->input, handler);
 1482|  11.0k|    if (code != XML_ERR_OK) {
  ------------------
  |  Branch (1482:9): [True: 1.90k, False: 9.17k]
  ------------------
 1483|  1.90k|        xmlCtxtErrIO(ctxt, code, NULL);
 1484|  1.90k|        return(-1);
 1485|  1.90k|    }
 1486|       |
 1487|  9.17k|    return(0);
 1488|  11.0k|}
xmlDetectEncoding:
 1498|   334k|xmlDetectEncoding(xmlParserCtxt *ctxt) {
 1499|   334k|    const xmlChar *in;
 1500|   334k|    xmlCharEncoding enc;
 1501|   334k|    int bomSize;
 1502|   334k|    int autoFlag = 0;
 1503|       |
 1504|   334k|    if (xmlParserGrow(ctxt) < 0)
  ------------------
  |  Branch (1504:9): [True: 0, False: 334k]
  ------------------
 1505|      0|        return;
 1506|   334k|    in = ctxt->input->cur;
 1507|   334k|    if (ctxt->input->end - in < 4)
  ------------------
  |  Branch (1507:9): [True: 1.15k, False: 333k]
  ------------------
 1508|  1.15k|        return;
 1509|       |
 1510|   333k|    if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|   333k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1510:9): [True: 0, False: 333k]
  ------------------
 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|   333k|    enc = XML_CHAR_ENCODING_NONE;
 1523|   333k|    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|   333k|    switch (in[0]) {
  ------------------
  |  Branch (1531:13): [True: 307k, False: 25.5k]
  ------------------
 1532|  1.80k|        case 0x00:
  ------------------
  |  Branch (1532:9): [True: 1.80k, False: 331k]
  ------------------
 1533|  1.80k|            if ((!ctxt->html) &&
  ------------------
  |  Branch (1533:17): [True: 1.80k, False: 0]
  ------------------
 1534|  1.80k|                (in[1] == 0x00) && (in[2] == 0x00) && (in[3] == 0x3C)) {
  ------------------
  |  Branch (1534:17): [True: 596, False: 1.21k]
  |  Branch (1534:36): [True: 390, False: 206]
  |  Branch (1534:55): [True: 116, False: 274]
  ------------------
 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.69k|            } else if ((in[1] == 0x3C) && (in[2] == 0x00) && (in[3] == 0x3F)) {
  ------------------
  |  Branch (1537:24): [True: 1.15k, False: 541]
  |  Branch (1537:43): [True: 1.06k, False: 87]
  |  Branch (1537:62): [True: 857, False: 208]
  ------------------
 1538|       |                /*
 1539|       |                 * TODO: The HTML5 spec requires to check that the
 1540|       |                 * next codepoint is an 'x'.
 1541|       |                 */
 1542|    857|                enc = XML_CHAR_ENCODING_UTF16BE;
 1543|    857|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|    857|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1544|    857|            }
 1545|  1.80k|            break;
 1546|       |
 1547|   298k|        case 0x3C:
  ------------------
  |  Branch (1547:9): [True: 298k, False: 35.3k]
  ------------------
 1548|   298k|            if (in[1] == 0x00) {
  ------------------
  |  Branch (1548:17): [True: 4.39k, False: 293k]
  ------------------
 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: 882, False: 221]
  ------------------
 1551|    882|                    enc = XML_CHAR_ENCODING_UCS4LE;
 1552|    882|                    autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|    882|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1553|  3.51k|                } else if ((in[2] == 0x3F) && (in[3] == 0x00)) {
  ------------------
  |  Branch (1553:28): [True: 3.07k, False: 446]
  |  Branch (1553:47): [True: 2.84k, False: 222]
  ------------------
 1554|       |                    /*
 1555|       |                     * TODO: The HTML5 spec requires to check that the
 1556|       |                     * next codepoint is an 'x'.
 1557|       |                     */
 1558|  2.84k|                    enc = XML_CHAR_ENCODING_UTF16LE;
 1559|  2.84k|                    autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|  2.84k|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1560|  2.84k|                }
 1561|  4.39k|            }
 1562|   298k|            break;
 1563|       |
 1564|  5.45k|        case 0x4C:
  ------------------
  |  Branch (1564:9): [True: 5.45k, False: 327k]
  ------------------
 1565|  5.45k|	    if ((!ctxt->html) &&
  ------------------
  |  Branch (1565:10): [True: 5.45k, False: 0]
  ------------------
 1566|  5.45k|                (in[1] == 0x6F) && (in[2] == 0xA7) && (in[3] == 0x94)) {
  ------------------
  |  Branch (1566:17): [True: 5.22k, False: 231]
  |  Branch (1566:36): [True: 4.93k, False: 287]
  |  Branch (1566:55): [True: 4.68k, False: 245]
  ------------------
 1567|  4.68k|	        enc = XML_CHAR_ENCODING_EBCDIC;
 1568|  4.68k|                autoFlag = XML_INPUT_AUTO_OTHER;
  ------------------
  |  |   38|  4.68k|#define XML_INPUT_AUTO_OTHER        (4u << 1)
  ------------------
 1569|  4.68k|            }
 1570|  5.45k|            break;
 1571|       |
 1572|    205|        case 0xEF:
  ------------------
  |  Branch (1572:9): [True: 205, False: 333k]
  ------------------
 1573|    205|            if ((in[1] == 0xBB) && (in[2] == 0xBF)) {
  ------------------
  |  Branch (1573:17): [True: 103, False: 102]
  |  Branch (1573:36): [True: 25, False: 78]
  ------------------
 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|    205|            break;
 1579|       |
 1580|  1.70k|        case 0xFE:
  ------------------
  |  Branch (1580:9): [True: 1.70k, False: 331k]
  ------------------
 1581|  1.70k|            if (in[1] == 0xFF) {
  ------------------
  |  Branch (1581:17): [True: 1.46k, False: 239]
  ------------------
 1582|  1.46k|                enc = XML_CHAR_ENCODING_UTF16BE;
 1583|  1.46k|                autoFlag = XML_INPUT_AUTO_UTF16BE;
  ------------------
  |  |   37|  1.46k|#define XML_INPUT_AUTO_UTF16BE      (3u << 1)
  ------------------
 1584|  1.46k|                bomSize = 2;
 1585|  1.46k|            }
 1586|  1.70k|            break;
 1587|       |
 1588|    553|        case 0xFF:
  ------------------
  |  Branch (1588:9): [True: 553, False: 332k]
  ------------------
 1589|    553|            if (in[1] == 0xFE) {
  ------------------
  |  Branch (1589:17): [True: 314, False: 239]
  ------------------
 1590|    314|                enc = XML_CHAR_ENCODING_UTF16LE;
 1591|    314|                autoFlag = XML_INPUT_AUTO_UTF16LE;
  ------------------
  |  |   36|    314|#define XML_INPUT_AUTO_UTF16LE      (2u << 1)
  ------------------
 1592|    314|                bomSize = 2;
 1593|    314|            }
 1594|    553|            break;
 1595|   333k|    }
 1596|       |
 1597|   333k|    if (bomSize > 0) {
  ------------------
  |  Branch (1597:9): [True: 1.80k, False: 331k]
  ------------------
 1598|  1.80k|        ctxt->input->cur += bomSize;
 1599|  1.80k|    }
 1600|       |
 1601|   333k|    if (enc != XML_CHAR_ENCODING_NONE) {
  ------------------
  |  Branch (1601:9): [True: 11.1k, False: 322k]
  ------------------
 1602|  11.1k|        ctxt->input->flags |= autoFlag;
 1603|       |
 1604|  11.1k|        if (enc == XML_CHAR_ENCODING_EBCDIC) {
  ------------------
  |  Branch (1604:13): [True: 4.68k, False: 6.50k]
  ------------------
 1605|  4.68k|            xmlCharEncodingHandlerPtr handler;
 1606|  4.68k|            xmlParserErrors res;
 1607|       |
 1608|  4.68k|            res = xmlDetectEBCDIC(ctxt, &handler);
 1609|  4.68k|            if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1609:17): [True: 111, False: 4.57k]
  ------------------
 1610|    111|                xmlFatalErr(ctxt, res, "detecting EBCDIC\n");
 1611|  4.57k|            } else {
 1612|  4.57k|                xmlSwitchToEncoding(ctxt, handler);
 1613|  4.57k|            }
 1614|  6.50k|        } else {
 1615|  6.50k|            xmlSwitchEncoding(ctxt, enc);
 1616|  6.50k|        }
 1617|  11.1k|    }
 1618|   333k|}
xmlSetDeclaredEncoding:
 1632|  6.57k|xmlSetDeclaredEncoding(xmlParserCtxt *ctxt, xmlChar *encoding) {
 1633|  6.57k|    if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
  ------------------
  |  |   33|  6.57k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1633:9): [True: 6.56k, False: 8]
  ------------------
 1634|  6.56k|        ((ctxt->options & XML_PARSE_IGNORE_ENC) == 0)) {
  ------------------
  |  Branch (1634:9): [True: 5.63k, False: 934]
  ------------------
 1635|  5.63k|        xmlCharEncodingHandlerPtr handler;
 1636|  5.63k|        xmlParserErrors res;
 1637|  5.63k|        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.63k|        if (ctxt->html)
  ------------------
  |  Branch (1644:13): [True: 0, False: 5.63k]
  ------------------
 1645|      0|            flags |= XML_ENC_HTML;
 1646|  5.63k|        res = xmlCreateCharEncodingHandler((const char *) encoding,
 1647|  5.63k|                flags, ctxt->convImpl, ctxt->convCtxt, &handler);
 1648|  5.63k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1648:13): [True: 612, False: 5.02k]
  ------------------
 1649|    612|            xmlFatalErr(ctxt, res, (const char *) encoding);
 1650|    612|            xmlFree(encoding);
 1651|    612|            return;
 1652|    612|        }
 1653|       |
 1654|  5.02k|        res  = xmlInputSetEncodingHandler(ctxt->input, handler);
 1655|  5.02k|        if (res != XML_ERR_OK) {
  ------------------
  |  Branch (1655:13): [True: 1.08k, False: 3.94k]
  ------------------
 1656|  1.08k|            xmlCtxtErrIO(ctxt, res, NULL);
 1657|  1.08k|            xmlFree(encoding);
 1658|  1.08k|            return;
 1659|  1.08k|        }
 1660|       |
 1661|  3.94k|        ctxt->input->flags |= XML_INPUT_USES_ENC_DECL;
  ------------------
  |  |   39|  3.94k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
 1662|  3.94k|    } else if (ctxt->input->flags & XML_INPUT_AUTO_ENCODING) {
  ------------------
  |  |   34|    942|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1662:16): [True: 8, False: 934]
  ------------------
 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.88k|    if (ctxt->encoding != NULL)
  ------------------
  |  Branch (1714:9): [True: 1.65k, False: 3.23k]
  ------------------
 1715|  1.65k|        xmlFree(ctxt->encoding);
 1716|  4.88k|    ctxt->encoding = encoding;
 1717|  4.88k|}
xmlGetActualEncoding:
 1740|  29.3k|xmlGetActualEncoding(xmlParserCtxt *ctxt) {
 1741|  29.3k|    const xmlChar *encoding = NULL;
 1742|       |
 1743|  29.3k|    if ((ctxt->input->flags & XML_INPUT_USES_ENC_DECL) ||
  ------------------
  |  |   39|  29.3k|#define XML_INPUT_USES_ENC_DECL     (1u << 4)
  ------------------
  |  Branch (1743:9): [True: 658, False: 28.7k]
  ------------------
 1744|  28.7k|        (ctxt->input->flags & XML_INPUT_AUTO_ENCODING)) {
  ------------------
  |  |   34|  28.7k|#define XML_INPUT_AUTO_ENCODING     (7u << 1)
  ------------------
  |  Branch (1744:9): [True: 504, False: 28.2k]
  ------------------
 1745|       |        /* Preserve encoding exactly */
 1746|  1.16k|        encoding = ctxt->encoding;
 1747|  28.2k|    } else if ((ctxt->input->buf) && (ctxt->input->buf->encoder)) {
  ------------------
  |  Branch (1747:16): [True: 28.2k, False: 0]
  |  Branch (1747:38): [True: 208, False: 28.0k]
  ------------------
 1748|    208|        encoding = BAD_CAST ctxt->input->buf->encoder->name;
  ------------------
  |  |   34|    208|#define BAD_CAST (xmlChar *)
  ------------------
 1749|  28.0k|    } else if (ctxt->input->flags & XML_INPUT_HAS_ENCODING) {
  ------------------
  |  |   33|  28.0k|#define XML_INPUT_HAS_ENCODING      (1u << 0)
  ------------------
  |  Branch (1749:16): [True: 234, False: 27.7k]
  ------------------
 1750|    234|        encoding = BAD_CAST "UTF-8";
  ------------------
  |  |   34|    234|#define BAD_CAST (xmlChar *)
  ------------------
 1751|    234|    }
 1752|       |
 1753|  29.3k|    return(encoding);
 1754|  29.3k|}
xmlFreeInputStream:
 1768|   350k|xmlFreeInputStream(xmlParserInput *input) {
 1769|   350k|    if (input == NULL) return;
  ------------------
  |  Branch (1769:9): [True: 3.12k, False: 347k]
  ------------------
 1770|       |
 1771|   347k|    if (input->filename != NULL) xmlFree((char *) input->filename);
  ------------------
  |  Branch (1771:9): [True: 295k, False: 51.5k]
  ------------------
 1772|   347k|    if (input->version != NULL) xmlFree((char *) input->version);
  ------------------
  |  Branch (1772:9): [True: 215k, False: 132k]
  ------------------
 1773|   347k|    if ((input->free != NULL) && (input->base != NULL))
  ------------------
  |  Branch (1773:9): [True: 0, False: 347k]
  |  Branch (1773:34): [True: 0, False: 0]
  ------------------
 1774|      0|        input->free((xmlChar *) input->base);
 1775|   347k|    if (input->buf != NULL)
  ------------------
  |  Branch (1775:9): [True: 347k, False: 0]
  ------------------
 1776|   347k|        xmlFreeParserInputBuffer(input->buf);
 1777|   347k|    xmlFree(input);
 1778|   347k|}
xmlNewInputFromMemory:
 1892|   295k|                      xmlParserInputFlags flags) {
 1893|   295k|    xmlParserInputBufferPtr buf;
 1894|       |
 1895|   295k|    if (mem == NULL)
  ------------------
  |  Branch (1895:9): [True: 0, False: 295k]
  ------------------
 1896|      0|	return(NULL);
 1897|       |
 1898|   295k|    buf = xmlNewInputBufferMemory(mem, size, flags, XML_CHAR_ENCODING_NONE);
 1899|   295k|    if (buf == NULL)
  ------------------
  |  Branch (1899:9): [True: 30, False: 295k]
  ------------------
 1900|     30|        return(NULL);
 1901|       |
 1902|   295k|    return(xmlNewInputInternal(buf, url));
 1903|   295k|}
xmlNewInputFromString:
 1954|  11.9k|                      xmlParserInputFlags flags) {
 1955|  11.9k|    xmlParserInputBufferPtr buf;
 1956|       |
 1957|  11.9k|    if (str == NULL)
  ------------------
  |  Branch (1957:9): [True: 0, False: 11.9k]
  ------------------
 1958|      0|	return(NULL);
 1959|       |
 1960|  11.9k|    buf = xmlNewInputBufferString(str, flags);
 1961|  11.9k|    if (buf == NULL)
  ------------------
  |  Branch (1961:9): [True: 7, False: 11.9k]
  ------------------
 1962|      7|        return(NULL);
 1963|       |
 1964|  11.9k|    return(xmlNewInputInternal(buf, url));
 1965|  11.9k|}
xmlCtxtNewInputFromString:
 1978|  11.9k|                          xmlParserInputFlags flags) {
 1979|  11.9k|    xmlParserInputPtr input;
 1980|       |
 1981|  11.9k|    if ((ctxt == NULL) || (str == NULL))
  ------------------
  |  Branch (1981:9): [True: 0, False: 11.9k]
  |  Branch (1981:27): [True: 0, False: 11.9k]
  ------------------
 1982|      0|	return(NULL);
 1983|       |
 1984|  11.9k|    input = xmlNewInputFromString(url, str, flags);
 1985|  11.9k|    if (input == NULL) {
  ------------------
  |  Branch (1985:9): [True: 9, False: 11.9k]
  ------------------
 1986|      9|        xmlCtxtErrMemory(ctxt);
 1987|      9|        return(NULL);
 1988|      9|    }
 1989|       |
 1990|  11.9k|    if (encoding != NULL)
  ------------------
  |  Branch (1990:9): [True: 0, False: 11.9k]
  ------------------
 1991|      0|        xmlSwitchInputEncodingName(ctxt, input, encoding);
 1992|       |
 1993|  11.9k|    return(input);
 1994|  11.9k|}
xmlNewPushInput:
 2155|  39.6k|xmlNewPushInput(const char *url, const char *chunk, int size) {
 2156|  39.6k|    xmlParserInputBufferPtr buf;
 2157|  39.6k|    xmlParserInputPtr input;
 2158|       |
 2159|  39.6k|    buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
 2160|  39.6k|    if (buf == NULL)
  ------------------
  |  Branch (2160:9): [True: 5, False: 39.6k]
  ------------------
 2161|      5|        return(NULL);
 2162|       |
 2163|  39.6k|    input = xmlNewInputInternal(buf, url);
 2164|  39.6k|    if (input == NULL)
  ------------------
  |  Branch (2164:9): [True: 3, False: 39.6k]
  ------------------
 2165|      3|	return(NULL);
 2166|       |
 2167|  39.6k|    input->flags |= XML_INPUT_PROGRESSIVE;
  ------------------
  |  |   41|  39.6k|#define XML_INPUT_PROGRESSIVE       (1u << 6)
  ------------------
 2168|       |
 2169|  39.6k|    if ((size > 0) && (chunk != NULL)) {
  ------------------
  |  Branch (2169:9): [True: 38.6k, False: 1.03k]
  |  Branch (2169:23): [True: 38.6k, False: 0]
  ------------------
 2170|  38.6k|        int res;
 2171|       |
 2172|  38.6k|	res = xmlParserInputBufferPush(input->buf, size, chunk);
 2173|  38.6k|        xmlBufResetInput(input->buf->buffer, input);
 2174|  38.6k|        if (res < 0) {
  ------------------
  |  Branch (2174:13): [True: 0, False: 38.6k]
  ------------------
 2175|      0|            xmlFreeInputStream(input);
 2176|      0|            return(NULL);
 2177|      0|        }
 2178|  38.6k|    }
 2179|       |
 2180|  39.6k|    return(input);
 2181|  39.6k|}
xmlNewEntityInputStream:
 2224|   127k|xmlNewEntityInputStream(xmlParserCtxt *ctxt, xmlEntity *ent) {
 2225|   127k|    xmlParserInputPtr input;
 2226|       |
 2227|   127k|    if ((ctxt == NULL) || (ent == NULL))
  ------------------
  |  Branch (2227:9): [True: 0, False: 127k]
  |  Branch (2227:27): [True: 0, False: 127k]
  ------------------
 2228|      0|	return(NULL);
 2229|       |
 2230|   127k|    if (ent->content != NULL) {
  ------------------
  |  Branch (2230:9): [True: 11.9k, False: 115k]
  ------------------
 2231|  11.9k|        input = xmlCtxtNewInputFromString(ctxt, NULL,
 2232|  11.9k|                (const char *) ent->content, NULL, XML_INPUT_BUF_STATIC);
 2233|   115k|    } else if (ent->URI != NULL) {
  ------------------
  |  Branch (2233:16): [True: 115k, False: 483]
  ------------------
 2234|   115k|        xmlResourceType rtype;
 2235|       |
 2236|   115k|        if (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)
  ------------------
  |  Branch (2236:13): [True: 111k, False: 3.76k]
  ------------------
 2237|   111k|            rtype = XML_RESOURCE_PARAMETER_ENTITY;
 2238|  3.76k|        else
 2239|  3.76k|            rtype = XML_RESOURCE_GENERAL_ENTITY;
 2240|       |
 2241|   115k|        input = xmlLoadResource(ctxt, (char *) ent->URI,
 2242|   115k|                                (char *) ent->ExternalID, rtype);
 2243|   115k|    } else {
 2244|    483|        return(NULL);
 2245|    483|    }
 2246|       |
 2247|   127k|    if (input == NULL)
  ------------------
  |  Branch (2247:9): [True: 4.54k, False: 122k]
  ------------------
 2248|  4.54k|        return(NULL);
 2249|       |
 2250|   122k|    input->entity = ent;
 2251|       |
 2252|   122k|    return(input);
 2253|   127k|}
xmlCtxtSetResourceLoader:
 2645|  49.1k|                         void *vctxt) {
 2646|  49.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (2646:9): [True: 0, False: 49.1k]
  ------------------
 2647|      0|        return;
 2648|       |
 2649|  49.1k|    ctxt->resourceLoader = loader;
 2650|  49.1k|    ctxt->resourceCtxt = vctxt;
 2651|  49.1k|}
xmlLoadResource:
 2662|   302k|                xmlResourceType type) {
 2663|   302k|    char *canonicFilename;
 2664|   302k|    xmlParserInputPtr ret;
 2665|       |
 2666|   302k|    if (url == NULL)
  ------------------
  |  Branch (2666:9): [True: 231, False: 302k]
  ------------------
 2667|    231|        return(NULL);
 2668|       |
 2669|   302k|    if ((ctxt != NULL) && (ctxt->resourceLoader != NULL)) {
  ------------------
  |  Branch (2669:9): [True: 302k, False: 0]
  |  Branch (2669:27): [True: 302k, False: 0]
  ------------------
 2670|   302k|        char *resource = NULL;
 2671|   302k|        void *userData;
 2672|   302k|        xmlParserInputFlags flags = 0;
 2673|   302k|        int code;
 2674|       |
 2675|   302k|#ifdef LIBXML_CATALOG_ENABLED
 2676|   302k|        resource = xmlCtxtResolveFromCatalog(ctxt, url, publicId);
 2677|   302k|        if (resource != NULL)
  ------------------
  |  Branch (2677:13): [True: 0, False: 302k]
  ------------------
 2678|      0|            url = resource;
 2679|   302k|#endif
 2680|       |
 2681|   302k|        if (ctxt->options & XML_PARSE_UNZIP)
  ------------------
  |  Branch (2681:13): [True: 141k, False: 160k]
  ------------------
 2682|   141k|            flags |= XML_INPUT_UNZIP;
 2683|   302k|        if ((ctxt->options & XML_PARSE_NONET) == 0)
  ------------------
  |  Branch (2683:13): [True: 217k, False: 84.3k]
  ------------------
 2684|   217k|            flags |= XML_INPUT_NETWORK;
 2685|       |
 2686|   302k|        userData = ctxt->resourceCtxt;
 2687|   302k|        if (userData == NULL)
  ------------------
  |  Branch (2687:13): [True: 302k, False: 0]
  ------------------
 2688|   302k|            userData = ctxt;
 2689|       |
 2690|   302k|        code = ctxt->resourceLoader(userData, url, publicId, type,
 2691|   302k|                                    flags, &ret);
 2692|   302k|        if (code != XML_ERR_OK) {
  ------------------
  |  Branch (2692:13): [True: 6.56k, False: 295k]
  ------------------
 2693|  6.56k|            xmlCtxtErrIO(ctxt, code, url);
 2694|  6.56k|            ret = NULL;
 2695|  6.56k|        }
 2696|   302k|        if (resource != NULL)
  ------------------
  |  Branch (2696:13): [True: 0, False: 302k]
  ------------------
 2697|      0|            xmlFree(resource);
 2698|   302k|        return(ret);
 2699|   302k|    }
 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|  49.1k|{
 2948|  49.1k|    xmlParserInputPtr input;
 2949|       |
 2950|  49.1k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (2950:9): [True: 32, False: 49.1k]
  ------------------
 2951|       |
 2952|  97.9k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2952:12): [True: 48.8k, False: 49.1k]
  ------------------
 2953|  48.8k|        xmlFreeInputStream(input);
 2954|  48.8k|    }
 2955|  49.1k|    if (ctxt->spaceTab != NULL) xmlFree(ctxt->spaceTab);
  ------------------
  |  Branch (2955:9): [True: 49.1k, False: 28]
  ------------------
 2956|  49.1k|    if (ctxt->nameTab != NULL) xmlFree((xmlChar * *)ctxt->nameTab);
  ------------------
  |  Branch (2956:9): [True: 49.1k, False: 24]
  ------------------
 2957|  49.1k|    if (ctxt->nodeTab != NULL) xmlFree(ctxt->nodeTab);
  ------------------
  |  Branch (2957:9): [True: 49.1k, False: 16]
  ------------------
 2958|  49.1k|    if (ctxt->nodeInfoTab != NULL) xmlFree(ctxt->nodeInfoTab);
  ------------------
  |  Branch (2958:9): [True: 0, False: 49.1k]
  ------------------
 2959|  49.1k|    if (ctxt->inputTab != NULL) xmlFree(ctxt->inputTab);
  ------------------
  |  Branch (2959:9): [True: 49.1k, False: 13]
  ------------------
 2960|  49.1k|    if (ctxt->version != NULL) xmlFree(ctxt->version);
  ------------------
  |  Branch (2960:9): [True: 46.5k, False: 2.54k]
  ------------------
 2961|  49.1k|    if (ctxt->encoding != NULL) xmlFree(ctxt->encoding);
  ------------------
  |  Branch (2961:9): [True: 1.08k, False: 48.0k]
  ------------------
 2962|  49.1k|    if (ctxt->extSubURI != NULL) xmlFree(ctxt->extSubURI);
  ------------------
  |  Branch (2962:9): [True: 3.02k, False: 46.1k]
  ------------------
 2963|  49.1k|    if (ctxt->extSubSystem != NULL) xmlFree(ctxt->extSubSystem);
  ------------------
  |  Branch (2963:9): [True: 778, False: 48.3k]
  ------------------
 2964|  49.1k|#ifdef LIBXML_SAX1_ENABLED
 2965|  49.1k|    if ((ctxt->sax != NULL) &&
  ------------------
  |  Branch (2965:9): [True: 49.1k, False: 9]
  ------------------
 2966|  49.1k|        (ctxt->sax != (xmlSAXHandlerPtr) &xmlDefaultSAXHandler))
  ------------------
  |  Branch (2966:9): [True: 49.1k, False: 0]
  ------------------
 2967|       |#else
 2968|       |    if (ctxt->sax != NULL)
 2969|       |#endif /* LIBXML_SAX1_ENABLED */
 2970|  49.1k|        xmlFree(ctxt->sax);
 2971|  49.1k|    if (ctxt->directory != NULL) xmlFree(ctxt->directory);
  ------------------
  |  Branch (2971:9): [True: 10.4k, False: 38.6k]
  ------------------
 2972|  49.1k|    if (ctxt->vctxt.nodeTab != NULL) xmlFree(ctxt->vctxt.nodeTab);
  ------------------
  |  Branch (2972:9): [True: 0, False: 49.1k]
  ------------------
 2973|  49.1k|    if (ctxt->atts != NULL) xmlFree((xmlChar * *)ctxt->atts);
  ------------------
  |  Branch (2973:9): [True: 25.6k, False: 23.4k]
  ------------------
 2974|  49.1k|    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
  ------------------
  |  Branch (2974:9): [True: 49.1k, False: 3]
  ------------------
 2975|  49.1k|    if (ctxt->nsTab != NULL) xmlFree(ctxt->nsTab);
  ------------------
  |  Branch (2975:9): [True: 9.68k, False: 39.4k]
  ------------------
 2976|  49.1k|    if (ctxt->nsdb != NULL) xmlParserNsFree(ctxt->nsdb);
  ------------------
  |  Branch (2976:9): [True: 49.1k, False: 30]
  ------------------
 2977|  49.1k|    if (ctxt->attrHash != NULL) xmlFree(ctxt->attrHash);
  ------------------
  |  Branch (2977:9): [True: 6.89k, False: 42.2k]
  ------------------
 2978|  49.1k|    if (ctxt->pushTab != NULL) xmlFree(ctxt->pushTab);
  ------------------
  |  Branch (2978:9): [True: 30.0k, False: 19.0k]
  ------------------
 2979|  49.1k|    if (ctxt->attallocs != NULL) xmlFree(ctxt->attallocs);
  ------------------
  |  Branch (2979:9): [True: 13.4k, False: 35.7k]
  ------------------
 2980|  49.1k|    if (ctxt->attsDefault != NULL)
  ------------------
  |  Branch (2980:9): [True: 2.90k, False: 46.2k]
  ------------------
 2981|  2.90k|        xmlHashFree(ctxt->attsDefault, xmlHashDefaultDeallocator);
 2982|  49.1k|    if (ctxt->attsSpecial != NULL)
  ------------------
  |  Branch (2982:9): [True: 3.38k, False: 45.7k]
  ------------------
 2983|  3.38k|        xmlHashFree(ctxt->attsSpecial, NULL);
 2984|  49.1k|    if (ctxt->freeElems != NULL) {
  ------------------
  |  Branch (2984:9): [True: 26.1k, False: 22.9k]
  ------------------
 2985|  26.1k|        xmlNodePtr cur, next;
 2986|       |
 2987|  26.1k|	cur = ctxt->freeElems;
 2988|  52.2k|	while (cur != NULL) {
  ------------------
  |  Branch (2988:9): [True: 26.1k, False: 26.1k]
  ------------------
 2989|  26.1k|	    next = cur->next;
 2990|  26.1k|	    xmlFree(cur);
 2991|  26.1k|	    cur = next;
 2992|  26.1k|	}
 2993|  26.1k|    }
 2994|  49.1k|    if (ctxt->freeAttrs != NULL) {
  ------------------
  |  Branch (2994:9): [True: 14.9k, False: 34.1k]
  ------------------
 2995|  14.9k|        xmlAttrPtr cur, next;
 2996|       |
 2997|  14.9k|	cur = ctxt->freeAttrs;
 2998|  29.9k|	while (cur != NULL) {
  ------------------
  |  Branch (2998:9): [True: 14.9k, False: 14.9k]
  ------------------
 2999|  14.9k|	    next = cur->next;
 3000|  14.9k|	    xmlFree(cur);
 3001|  14.9k|	    cur = next;
 3002|  14.9k|	}
 3003|  14.9k|    }
 3004|       |    /*
 3005|       |     * cleanup the error strings
 3006|       |     */
 3007|  49.1k|    if (ctxt->lastError.message != NULL)
  ------------------
  |  Branch (3007:9): [True: 34.2k, False: 14.8k]
  ------------------
 3008|  34.2k|        xmlFree(ctxt->lastError.message);
 3009|  49.1k|    if (ctxt->lastError.file != NULL)
  ------------------
  |  Branch (3009:9): [True: 8.93k, False: 40.2k]
  ------------------
 3010|  8.93k|        xmlFree(ctxt->lastError.file);
 3011|  49.1k|    if (ctxt->lastError.str1 != NULL)
  ------------------
  |  Branch (3011:9): [True: 19.4k, False: 29.7k]
  ------------------
 3012|  19.4k|        xmlFree(ctxt->lastError.str1);
 3013|  49.1k|    if (ctxt->lastError.str2 != NULL)
  ------------------
  |  Branch (3013:9): [True: 6.12k, False: 43.0k]
  ------------------
 3014|  6.12k|        xmlFree(ctxt->lastError.str2);
 3015|  49.1k|    if (ctxt->lastError.str3 != NULL)
  ------------------
  |  Branch (3015:9): [True: 574, False: 48.5k]
  ------------------
 3016|    574|        xmlFree(ctxt->lastError.str3);
 3017|       |
 3018|  49.1k|#ifdef LIBXML_CATALOG_ENABLED
 3019|  49.1k|    if (ctxt->catalogs != NULL)
  ------------------
  |  Branch (3019:9): [True: 0, False: 49.1k]
  ------------------
 3020|      0|	xmlCatalogFreeLocal(ctxt->catalogs);
 3021|  49.1k|#endif
 3022|  49.1k|    xmlFree(ctxt);
 3023|  49.1k|}
xmlNewParserCtxt:
 3033|  9.47k|{
 3034|  9.47k|    return(xmlNewSAXParserCtxt(NULL, NULL));
 3035|  9.47k|}
xmlNewSAXParserCtxt:
 3054|  49.1k|{
 3055|  49.1k|    xmlParserCtxtPtr ctxt;
 3056|       |
 3057|  49.1k|    xmlInitParser();
 3058|       |
 3059|  49.1k|    ctxt = (xmlParserCtxtPtr) xmlMalloc(sizeof(xmlParserCtxt));
 3060|  49.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (3060:9): [True: 4, False: 49.1k]
  ------------------
 3061|      4|	return(NULL);
 3062|  49.1k|    memset(ctxt, 0, sizeof(xmlParserCtxt));
 3063|  49.1k|    if (xmlInitSAXParserCtxt(ctxt, sax, userData) < 0) {
  ------------------
  |  Branch (3063:9): [True: 30, False: 49.1k]
  ------------------
 3064|     30|        xmlFreeParserCtxt(ctxt);
 3065|     30|	return(NULL);
 3066|     30|    }
 3067|  49.1k|    return(ctxt);
 3068|  49.1k|}
xmlInitNodeInfoSeq:
 3547|  49.1k|{
 3548|  49.1k|    if (seq == NULL)
  ------------------
  |  Branch (3548:9): [True: 0, False: 49.1k]
  ------------------
 3549|      0|        return;
 3550|  49.1k|    seq->length = 0;
 3551|  49.1k|    seq->maximum = 0;
 3552|       |    seq->buffer = NULL;
 3553|  49.1k|}
parserInternals.c:xmlDetectEBCDIC:
 1168|  4.68k|xmlDetectEBCDIC(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr *hout) {
 1169|  4.68k|    xmlChar out[200];
 1170|  4.68k|    xmlParserInputPtr input = ctxt->input;
 1171|  4.68k|    xmlCharEncodingHandlerPtr handler;
 1172|  4.68k|    int inlen, outlen, i;
 1173|  4.68k|    xmlParserErrors code;
 1174|  4.68k|    xmlCharEncError res;
 1175|       |
 1176|  4.68k|    *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.68k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1183|  4.68k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1184|  4.68k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1184:9): [True: 7, False: 4.68k]
  ------------------
 1185|      7|        return(code);
 1186|  4.68k|    outlen = sizeof(out) - 1;
 1187|  4.68k|    inlen = input->end - input->cur;
 1188|  4.68k|    res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen,
 1189|  4.68k|                           /* flush */ 0);
 1190|       |    /*
 1191|       |     * Return the EBCDIC handler if decoding failed. The error will
 1192|       |     * be reported later.
 1193|       |     */
 1194|  4.68k|    if (res < 0)
  ------------------
  |  Branch (1194:9): [True: 958, False: 3.72k]
  ------------------
 1195|    958|        goto done;
 1196|  3.72k|    out[outlen] = 0;
 1197|       |
 1198|   103k|    for (i = 0; i < outlen; i++) {
  ------------------
  |  Branch (1198:17): [True: 102k, False: 1.79k]
  ------------------
 1199|   102k|        if (out[i] == '>')
  ------------------
  |  Branch (1199:13): [True: 265, False: 101k]
  ------------------
 1200|    265|            break;
 1201|   101k|        if ((out[i] == 'e') &&
  ------------------
  |  Branch (1201:13): [True: 4.42k, False: 97.3k]
  ------------------
 1202|  4.42k|            (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
  ------------------
  |  |   34|  4.42k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1202:13): [True: 1.66k, False: 2.75k]
  ------------------
 1203|  1.66k|            int start, cur, quote;
 1204|       |
 1205|  1.66k|            i += 8;
 1206|  1.66k|            while (IS_BLANK_CH(out[i]))
 1207|    830|                i += 1;
 1208|  1.66k|            if (out[i++] != '=')
  ------------------
  |  Branch (1208:17): [True: 368, False: 1.30k]
  ------------------
 1209|    368|                break;
 1210|  1.30k|            while (IS_BLANK_CH(out[i]))
 1211|    790|                i += 1;
 1212|  1.30k|            quote = out[i++];
 1213|  1.30k|            if ((quote != '\'') && (quote != '"'))
  ------------------
  |  Branch (1213:17): [True: 1.05k, False: 243]
  |  Branch (1213:36): [True: 498, False: 559]
  ------------------
 1214|    498|                break;
 1215|    802|            start = i;
 1216|    802|            cur = out[i];
 1217|  4.39k|            while (((cur >= 'a') && (cur <= 'z')) ||
  ------------------
  |  Branch (1217:21): [True: 1.10k, False: 3.28k]
  |  Branch (1217:37): [True: 818, False: 289]
  ------------------
 1218|  3.57k|                   ((cur >= 'A') && (cur <= 'Z')) ||
  ------------------
  |  Branch (1218:21): [True: 2.12k, False: 1.45k]
  |  Branch (1218:37): [True: 940, False: 1.18k]
  ------------------
 1219|  2.63k|                   ((cur >= '0') && (cur <= '9')) ||
  ------------------
  |  Branch (1219:21): [True: 1.56k, False: 1.07k]
  |  Branch (1219:37): [True: 371, False: 1.19k]
  ------------------
 1220|  2.26k|                   (cur == '.') || (cur == '_') ||
  ------------------
  |  Branch (1220:20): [True: 290, False: 1.97k]
  |  Branch (1220:36): [True: 891, False: 1.08k]
  ------------------
 1221|  1.08k|                   (cur == '-'))
  ------------------
  |  Branch (1221:20): [True: 278, False: 802]
  ------------------
 1222|  3.58k|                cur = out[++i];
 1223|    802|            if (cur != quote)
  ------------------
  |  Branch (1223:17): [True: 549, False: 253]
  ------------------
 1224|    549|                break;
 1225|    253|            out[i] = 0;
 1226|    253|            xmlCharEncCloseFunc(handler);
 1227|    253|            code = xmlCreateCharEncodingHandler((char *) out + start,
 1228|    253|                    XML_ENC_INPUT, ctxt->convImpl, ctxt->convCtxt,
 1229|    253|                    &handler);
 1230|    253|            if (code != XML_ERR_OK)
  ------------------
  |  Branch (1230:17): [True: 96, False: 157]
  ------------------
 1231|     96|                return(code);
 1232|    157|            *hout = handler;
 1233|    157|            return(XML_ERR_OK);
 1234|    253|        }
 1235|   101k|    }
 1236|       |
 1237|  4.42k|done:
 1238|       |    /*
 1239|       |     * Encoding handlers are stateful, so we have to recreate them.
 1240|       |     */
 1241|  4.42k|    xmlCharEncCloseFunc(handler);
 1242|  4.42k|    code = xmlCreateCharEncodingHandler("IBM037", XML_ENC_INPUT,
 1243|  4.42k|            ctxt->convImpl, ctxt->convCtxt, &handler);
 1244|  4.42k|    if (code != XML_ERR_OK)
  ------------------
  |  Branch (1244:9): [True: 8, False: 4.42k]
  ------------------
 1245|      8|        return(code);
 1246|  4.42k|    *hout = handler;
 1247|  4.42k|    return(XML_ERR_OK);
 1248|  4.42k|}
parserInternals.c:xmlNewInputInternal:
 1842|   347k|xmlNewInputInternal(xmlParserInputBufferPtr buf, const char *filename) {
 1843|   347k|    xmlParserInputPtr input;
 1844|       |
 1845|   347k|    input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput));
 1846|   347k|    if (input == NULL) {
  ------------------
  |  Branch (1846:9): [True: 16, False: 347k]
  ------------------
 1847|     16|	xmlFreeParserInputBuffer(buf);
 1848|     16|	return(NULL);
 1849|     16|    }
 1850|   347k|    memset(input, 0, sizeof(xmlParserInput));
 1851|   347k|    input->line = 1;
 1852|   347k|    input->col = 1;
 1853|       |
 1854|   347k|    input->buf = buf;
 1855|   347k|    xmlBufResetInput(input->buf->buffer, input);
 1856|       |
 1857|   347k|    if (filename != NULL) {
  ------------------
  |  Branch (1857:9): [True: 295k, False: 51.5k]
  ------------------
 1858|   295k|        input->filename = xmlMemStrdup(filename);
 1859|   295k|        if (input->filename == NULL) {
  ------------------
  |  Branch (1859:13): [True: 19, False: 295k]
  ------------------
 1860|     19|            xmlFreeInputStream(input);
 1861|     19|            return(NULL);
 1862|     19|        }
 1863|   295k|    }
 1864|       |
 1865|   347k|    return(input);
 1866|   347k|}
parserInternals.c:xmlCtxtResolveFromCatalog:
 2363|   302k|                          const char *publicId) {
 2364|   302k|    char *resource;
 2365|   302k|    void *localCatalogs = NULL;
 2366|   302k|    int allowGlobal = 1;
 2367|   302k|    xmlParserErrors code;
 2368|       |
 2369|   302k|    if (ctxt != NULL) {
  ------------------
  |  Branch (2369:9): [True: 302k, False: 0]
  ------------------
 2370|       |        /*
 2371|       |         * Loading of HTML documents shouldn't use XML catalogs.
 2372|       |         */
 2373|   302k|        if (ctxt->html)
  ------------------
  |  Branch (2373:13): [True: 0, False: 302k]
  ------------------
 2374|      0|            return(NULL);
 2375|       |
 2376|   302k|        localCatalogs = ctxt->catalogs;
 2377|       |
 2378|   302k|        if (ctxt->options & XML_PARSE_NO_SYS_CATALOG)
  ------------------
  |  Branch (2378:13): [True: 43.0k, False: 259k]
  ------------------
 2379|  43.0k|            allowGlobal = 0;
 2380|   302k|    }
 2381|       |
 2382|   302k|    switch (xmlCatalogGetDefaults()) {
  ------------------
  |  Branch (2382:13): [True: 302k, False: 0]
  ------------------
 2383|   302k|        case XML_CATA_ALLOW_NONE:
  ------------------
  |  Branch (2383:9): [True: 302k, False: 0]
  ------------------
 2384|   302k|            return(NULL);
 2385|      0|        case XML_CATA_ALLOW_DOCUMENT:
  ------------------
  |  Branch (2385:9): [True: 0, False: 302k]
  ------------------
 2386|      0|            allowGlobal = 0;
 2387|      0|            break;
 2388|      0|        case XML_CATA_ALLOW_GLOBAL:
  ------------------
  |  Branch (2388:9): [True: 0, False: 302k]
  ------------------
 2389|      0|            localCatalogs = NULL;
 2390|      0|            break;
 2391|      0|        case XML_CATA_ALLOW_ALL:
  ------------------
  |  Branch (2391:9): [True: 0, False: 302k]
  ------------------
 2392|      0|            break;
 2393|   302k|    }
 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|   302k|}
parserInternals.c:xmlInitSAXParserCtxt:
 2766|  49.1k|{
 2767|  49.1k|    xmlParserInputPtr input;
 2768|  49.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2769|  49.1k|    size_t initialNodeTabSize = 1;
 2770|       |#else
 2771|       |    size_t initialNodeTabSize = 10;
 2772|       |#endif
 2773|       |
 2774|  49.1k|    if (ctxt == NULL)
  ------------------
  |  Branch (2774:9): [True: 0, False: 49.1k]
  ------------------
 2775|      0|        return(-1);
 2776|       |
 2777|  49.1k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2777:9): [True: 49.1k, False: 0]
  ------------------
 2778|  49.1k|	ctxt->dict = xmlDictCreate();
 2779|  49.1k|    if (ctxt->dict == NULL)
  ------------------
  |  Branch (2779:9): [True: 3, False: 49.1k]
  ------------------
 2780|      3|	return(-1);
 2781|       |
 2782|  49.1k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2782:9): [True: 49.1k, False: 0]
  ------------------
 2783|  49.1k|	ctxt->sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
 2784|  49.1k|    if (ctxt->sax == NULL)
  ------------------
  |  Branch (2784:9): [True: 6, False: 49.1k]
  ------------------
 2785|      6|	return(-1);
 2786|  49.1k|    if (sax == NULL) {
  ------------------
  |  Branch (2786:9): [True: 9.47k, False: 39.6k]
  ------------------
 2787|  9.47k|	memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2788|  9.47k|        xmlSAXVersion(ctxt->sax, 2);
 2789|  9.47k|        ctxt->userData = ctxt;
 2790|  39.6k|    } else {
 2791|  39.6k|	if (sax->initialized == XML_SAX2_MAGIC) {
  ------------------
  |  |  953|  39.6k|#define XML_SAX2_MAGIC 0xDEEDBEAF
  ------------------
  |  Branch (2791:6): [True: 39.6k, False: 0]
  ------------------
 2792|  39.6k|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandler));
 2793|  39.6k|        } else {
 2794|      0|	    memset(ctxt->sax, 0, sizeof(xmlSAXHandler));
 2795|      0|	    memcpy(ctxt->sax, sax, sizeof(xmlSAXHandlerV1));
 2796|      0|        }
 2797|  39.6k|        ctxt->userData = userData ? userData : ctxt;
  ------------------
  |  Branch (2797:26): [True: 0, False: 39.6k]
  ------------------
 2798|  39.6k|    }
 2799|       |
 2800|  49.1k|    ctxt->maxatts = 0;
 2801|  49.1k|    ctxt->atts = NULL;
 2802|       |    /* Allocate the Input stack */
 2803|  49.1k|    if (ctxt->inputTab == NULL) {
  ------------------
  |  Branch (2803:9): [True: 49.1k, False: 0]
  ------------------
 2804|  49.1k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 2805|  49.1k|        size_t initialSize = 1;
 2806|       |#else
 2807|       |        size_t initialSize = 5;
 2808|       |#endif
 2809|       |
 2810|  49.1k|	ctxt->inputTab = xmlMalloc(initialSize * sizeof(xmlParserInputPtr));
 2811|  49.1k|	ctxt->inputMax = initialSize;
 2812|  49.1k|    }
 2813|  49.1k|    if (ctxt->inputTab == NULL)
  ------------------
  |  Branch (2813:9): [True: 4, False: 49.1k]
  ------------------
 2814|      4|	return(-1);
 2815|  49.1k|    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
  ------------------
  |  Branch (2815:12): [True: 0, False: 49.1k]
  ------------------
 2816|      0|        xmlFreeInputStream(input);
 2817|      0|    }
 2818|  49.1k|    ctxt->inputNr = 0;
 2819|  49.1k|    ctxt->input = NULL;
 2820|       |
 2821|  49.1k|    ctxt->version = NULL;
 2822|  49.1k|    ctxt->encoding = NULL;
 2823|  49.1k|    ctxt->standalone = -1;
 2824|  49.1k|    ctxt->hasExternalSubset = 0;
 2825|  49.1k|    ctxt->hasPErefs = 0;
 2826|  49.1k|    ctxt->html = 0;
 2827|  49.1k|    ctxt->instate = XML_PARSER_START;
 2828|       |
 2829|       |    /* Allocate the Node stack */
 2830|  49.1k|    if (ctxt->nodeTab == NULL) {
  ------------------
  |  Branch (2830:9): [True: 49.1k, False: 0]
  ------------------
 2831|  49.1k|	ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(xmlNodePtr));
 2832|  49.1k|	ctxt->nodeMax = initialNodeTabSize;
 2833|  49.1k|    }
 2834|  49.1k|    if (ctxt->nodeTab == NULL)
  ------------------
  |  Branch (2834:9): [True: 3, False: 49.1k]
  ------------------
 2835|      3|	return(-1);
 2836|  49.1k|    ctxt->nodeNr = 0;
 2837|  49.1k|    ctxt->node = NULL;
 2838|       |
 2839|       |    /* Allocate the Name stack */
 2840|  49.1k|    if (ctxt->nameTab == NULL) {
  ------------------
  |  Branch (2840:9): [True: 49.1k, False: 0]
  ------------------
 2841|  49.1k|	ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
 2842|  49.1k|	ctxt->nameMax = initialNodeTabSize;
 2843|  49.1k|    }
 2844|  49.1k|    if (ctxt->nameTab == NULL)
  ------------------
  |  Branch (2844:9): [True: 8, False: 49.1k]
  ------------------
 2845|      8|	return(-1);
 2846|  49.1k|    ctxt->nameNr = 0;
 2847|  49.1k|    ctxt->name = NULL;
 2848|       |
 2849|       |    /* Allocate the space stack */
 2850|  49.1k|    if (ctxt->spaceTab == NULL) {
  ------------------
  |  Branch (2850:9): [True: 49.1k, False: 0]
  ------------------
 2851|  49.1k|	ctxt->spaceTab = xmlMalloc(initialNodeTabSize * sizeof(int));
 2852|  49.1k|	ctxt->spaceMax = initialNodeTabSize;
 2853|  49.1k|    }
 2854|  49.1k|    if (ctxt->spaceTab == NULL)
  ------------------
  |  Branch (2854:9): [True: 4, False: 49.1k]
  ------------------
 2855|      4|	return(-1);
 2856|  49.1k|    ctxt->spaceNr = 1;
 2857|  49.1k|    ctxt->spaceTab[0] = -1;
 2858|  49.1k|    ctxt->space = &ctxt->spaceTab[0];
 2859|  49.1k|    ctxt->myDoc = NULL;
 2860|  49.1k|    ctxt->wellFormed = 1;
 2861|  49.1k|    ctxt->nsWellFormed = 1;
 2862|  49.1k|    ctxt->valid = 1;
 2863|       |
 2864|  49.1k|    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|  49.1k|    ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
  ------------------
  |  | 1331|  49.1k|  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
  ------------------
 2873|  49.1k|    if (ctxt->loadsubset) {
  ------------------
  |  Branch (2873:9): [True: 0, False: 49.1k]
  ------------------
 2874|      0|        ctxt->options |= XML_PARSE_DTDLOAD;
 2875|      0|    }
 2876|  49.1k|    ctxt->validate = xmlDoValidityCheckingDefaultValue;
  ------------------
  |  | 1302|  49.1k|    (*__xmlDoValidityCheckingDefaultValue())
  ------------------
 2877|  49.1k|    if (ctxt->validate) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 49.1k]
  ------------------
 2878|      0|        ctxt->options |= XML_PARSE_DTDVALID;
 2879|      0|    }
 2880|  49.1k|    ctxt->pedantic = xmlPedanticParserDefaultValue;
  ------------------
  |  | 1339|  49.1k|    (*__xmlPedanticParserDefaultValue())
  ------------------
 2881|  49.1k|    if (ctxt->pedantic) {
  ------------------
  |  Branch (2881:9): [True: 0, False: 49.1k]
  ------------------
 2882|      0|        ctxt->options |= XML_PARSE_PEDANTIC;
 2883|      0|    }
 2884|  49.1k|    ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
  ------------------
  |  | 1316|  49.1k|  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
  ------------------
 2885|  49.1k|    if (ctxt->keepBlanks == 0) {
  ------------------
  |  Branch (2885:9): [True: 0, False: 49.1k]
  ------------------
 2886|      0|	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
 2887|      0|	ctxt->options |= XML_PARSE_NOBLANKS;
 2888|      0|    }
 2889|  49.1k|    ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
  ------------------
  |  | 1347|  49.1k|    (*__xmlSubstituteEntitiesDefaultValue())
  ------------------
 2890|  49.1k|    if (ctxt->replaceEntities) {
  ------------------
  |  Branch (2890:9): [True: 0, False: 49.1k]
  ------------------
 2891|      0|        ctxt->options |= XML_PARSE_NOENT;
 2892|      0|    }
 2893|  49.1k|    if (xmlGetWarningsDefaultValue == 0)
  ------------------
  |  | 1309|  49.1k|    (*__xmlGetWarningsDefaultValue())
  ------------------
  |  Branch (2893:9): [True: 0, False: 49.1k]
  ------------------
 2894|      0|        ctxt->options |= XML_PARSE_NOWARNING;
 2895|       |
 2896|  49.1k|    ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
  ------------------
  |  |   20|  49.1k|#define XML_VCTXT_USE_PCTXT (1u << 1)
  ------------------
 2897|  49.1k|    ctxt->vctxt.userData = ctxt;
 2898|  49.1k|    ctxt->vctxt.error = xmlParserValidityError;
 2899|  49.1k|    ctxt->vctxt.warning = xmlParserValidityWarning;
 2900|       |
 2901|  49.1k|    ctxt->record_info = 0;
 2902|  49.1k|    ctxt->checkIndex = 0;
 2903|  49.1k|    ctxt->inSubset = 0;
 2904|  49.1k|    ctxt->errNo = XML_ERR_OK;
 2905|  49.1k|    ctxt->depth = 0;
 2906|  49.1k|    ctxt->catalogs = NULL;
 2907|  49.1k|    ctxt->sizeentities = 0;
 2908|  49.1k|    ctxt->sizeentcopy = 0;
 2909|  49.1k|    ctxt->input_id = 1;
 2910|  49.1k|    ctxt->maxAmpl = XML_MAX_AMPLIFICATION_DEFAULT;
  ------------------
  |  |   60|  49.1k|#define XML_MAX_AMPLIFICATION_DEFAULT 5
  ------------------
 2911|  49.1k|    xmlInitNodeInfoSeq(&ctxt->node_seq);
 2912|       |
 2913|  49.1k|    if (ctxt->nsdb == NULL) {
  ------------------
  |  Branch (2913:9): [True: 49.1k, False: 0]
  ------------------
 2914|  49.1k|        ctxt->nsdb = xmlParserNsCreate();
 2915|  49.1k|        if (ctxt->nsdb == NULL)
  ------------------
  |  Branch (2915:13): [True: 2, False: 49.1k]
  ------------------
 2916|      2|            return(-1);
 2917|  49.1k|    }
 2918|       |
 2919|  49.1k|    return(0);
 2920|  49.1k|}

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|   152k|{
  125|   152k|    if (tok == NULL)
  ------------------
  |  Branch (125:9): [True: 0, False: 152k]
  ------------------
  126|      0|        return;
  127|   152k|#ifdef HAVE_POSIX_THREADS
  128|       |    /*
  129|       |     * This assumes that __libc_single_threaded won't change while the
  130|       |     * lock is held.
  131|       |     */
  132|   152k|    pthread_mutex_lock(&tok->lock);
  133|       |#elif defined HAVE_WIN32_THREADS
  134|       |    EnterCriticalSection(&tok->cs);
  135|       |#endif
  136|       |
  137|   152k|}
xmlMutexUnlock:
  146|   152k|{
  147|   152k|    if (tok == NULL)
  ------------------
  |  Branch (147:9): [True: 0, False: 152k]
  ------------------
  148|      0|        return;
  149|   152k|#ifdef HAVE_POSIX_THREADS
  150|   152k|    pthread_mutex_unlock(&tok->lock);
  151|       |#elif defined HAVE_WIN32_THREADS
  152|       |    LeaveCriticalSection(&tok->cs);
  153|       |#endif
  154|   152k|}
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.62M|xmlInitParser(void) {
  405|  2.62M|#ifdef HAVE_POSIX_THREADS
  406|  2.62M|    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.62M|}
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.2k|void BINARY_INSERTION_SORT(SORT_TYPE *dst, const size_t size) {
  250|       |  /* don't bother sorting an array of size <= 1 */
  251|  20.2k|  if (size <= 1) {
  ------------------
  |  Branch (251:7): [True: 0, False: 20.2k]
  ------------------
  252|      0|    return;
  253|      0|  }
  254|       |
  255|  20.2k|  BINARY_INSERTION_SORT_START(dst, 1, size);
  ------------------
  |  |  149|  20.2k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  20.2k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.2k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.2k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|  20.2k|}
libxml_domnode_tim_sort:
  533|  31.5k|void TIM_SORT(SORT_TYPE *dst, const size_t size) {
  534|  31.5k|  size_t minrun;
  535|  31.5k|  TEMP_STORAGE_T _store, *store;
  536|  31.5k|  TIM_SORT_RUN_T run_stack[TIM_SORT_STACK_SIZE];
  537|  31.5k|  size_t stack_curr = 0;
  538|  31.5k|  size_t curr = 0;
  539|       |
  540|       |  /* don't bother sorting an array of size 1 */
  541|  31.5k|  if (size <= 1) {
  ------------------
  |  Branch (541:7): [True: 0, False: 31.5k]
  ------------------
  542|      0|    return;
  543|      0|  }
  544|       |
  545|  31.5k|  if (size < 64) {
  ------------------
  |  Branch (545:7): [True: 20.2k, False: 11.2k]
  ------------------
  546|  20.2k|    BINARY_INSERTION_SORT(dst, size);
  ------------------
  |  |  150|  20.2k|#define BINARY_INSERTION_SORT          SORT_MAKE_STR(binary_insertion_sort)
  |  |  ------------------
  |  |  |  |  146|  20.2k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  20.2k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  20.2k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  547|  20.2k|    return;
  548|  20.2k|  }
  549|       |
  550|       |  /* compute the minimum run length */
  551|  11.2k|  minrun = compute_minrun(size);
  552|       |  /* temporary storage for merges */
  553|  11.2k|  store = &_store;
  554|  11.2k|  store->alloc = 0;
  555|  11.2k|  store->storage = NULL;
  556|       |
  557|  11.2k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (557:7): [True: 0, False: 11.2k]
  ------------------
  558|      0|    return;
  559|      0|  }
  560|       |
  561|  11.2k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (561:7): [True: 8.59k, False: 2.64k]
  ------------------
  562|  8.59k|    return;
  563|  8.59k|  }
  564|       |
  565|  2.64k|  if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (565:7): [True: 2.21k, False: 428]
  ------------------
  566|  2.21k|    return;
  567|  2.21k|  }
  568|       |
  569|  5.11k|  while (1) {
  ------------------
  |  Branch (569:10): [True: 5.11k, Folded]
  ------------------
  570|  5.11k|    if (!CHECK_INVARIANT(run_stack, stack_curr)) {
  ------------------
  |  |  153|  5.11k|#define CHECK_INVARIANT                SORT_MAKE_STR(check_invariant)
  |  |  ------------------
  |  |  |  |  146|  5.11k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  5.11k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  5.11k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (570:9): [True: 1.97k, False: 3.13k]
  ------------------
  571|  1.97k|      stack_curr = TIM_SORT_COLLAPSE(dst, run_stack, stack_curr, store, size);
  ------------------
  |  |  157|  1.97k|#define TIM_SORT_COLLAPSE              SORT_MAKE_STR(tim_sort_collapse)
  |  |  ------------------
  |  |  |  |  146|  1.97k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  1.97k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  1.97k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  572|  1.97k|      continue;
  573|  1.97k|    }
  574|       |
  575|  3.13k|    if (!PUSH_NEXT(dst, size, store, minrun, run_stack, &stack_curr, &curr)) {
  ------------------
  |  Branch (575:9): [True: 428, False: 2.70k]
  ------------------
  576|    428|      return;
  577|    428|    }
  578|  3.13k|  }
  579|    428|}
xpath.c:libxml_domnode_binary_insertion_sort_start:
  219|  26.5k|static void BINARY_INSERTION_SORT_START(SORT_TYPE *dst, const size_t start, const size_t size) {
  220|  26.5k|  size_t i;
  221|       |
  222|   388k|  for (i = start; i < size; i++) {
  ------------------
  |  Branch (222:19): [True: 362k, False: 26.5k]
  ------------------
  223|   362k|    size_t j;
  224|   362k|    SORT_TYPE x;
  ------------------
  |  |  593|   362k|#define SORT_TYPE xmlNodePtr
  ------------------
  225|   362k|    size_t location;
  226|       |
  227|       |    /* If this entry is already correct, just move along */
  228|   362k|    if (SORT_CMP(dst[i - 1], dst[i]) <= 0) {
  ------------------
  |  |  617|   362k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (228:9): [True: 224k, False: 137k]
  ------------------
  229|   224k|      continue;
  230|   224k|    }
  231|       |
  232|       |    /* Else we need to find the right place, shift everything over, and squeeze in */
  233|   137k|    x = dst[i];
  234|   137k|    location = BINARY_INSERTION_FIND(dst, x, i);
  ------------------
  |  |  148|   137k|#define BINARY_INSERTION_FIND          SORT_MAKE_STR(binary_insertion_find)
  |  |  ------------------
  |  |  |  |  146|   137k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|   137k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|   137k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|       |
  236|   649k|    for (j = i - 1; j >= location; j--) {
  ------------------
  |  Branch (236:21): [True: 517k, False: 132k]
  ------------------
  237|   517k|      dst[j + 1] = dst[j];
  238|       |
  239|   517k|      if (j == 0) { /* check edge case because j is unsigned */
  ------------------
  |  Branch (239:11): [True: 4.49k, False: 512k]
  ------------------
  240|  4.49k|        break;
  241|  4.49k|      }
  242|   517k|    }
  243|       |
  244|   137k|    dst[location] = x;
  245|   137k|  }
  246|  26.5k|}
xpath.c:libxml_domnode_binary_insertion_find:
  180|   137k|    const size_t size) {
  181|   137k|  size_t l, c, r;
  182|   137k|  SORT_TYPE cx;
  ------------------
  |  |  593|   137k|#define SORT_TYPE xmlNodePtr
  ------------------
  183|   137k|  l = 0;
  184|   137k|  r = size - 1;
  185|   137k|  c = r >> 1;
  186|       |
  187|       |  /* check for out of bounds at the beginning. */
  188|   137k|  if (SORT_CMP(x, dst[0]) < 0) {
  ------------------
  |  |  617|   137k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (188:7): [True: 4.49k, False: 132k]
  ------------------
  189|  4.49k|    return 0;
  190|   132k|  } else if (SORT_CMP(x, dst[r]) > 0) {
  ------------------
  |  |  617|   132k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (190:14): [True: 0, False: 132k]
  ------------------
  191|      0|    return r;
  192|      0|  }
  193|       |
  194|   132k|  cx = dst[c];
  195|       |
  196|   557k|  while (1) {
  ------------------
  |  Branch (196:10): [True: 557k, Folded]
  ------------------
  197|   557k|    const int val = SORT_CMP(x, cx);
  ------------------
  |  |  617|   557k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  198|       |
  199|   557k|    if (val < 0) {
  ------------------
  |  Branch (199:9): [True: 97.7k, False: 460k]
  ------------------
  200|  97.7k|      if (c - l <= 1) {
  ------------------
  |  Branch (200:11): [True: 43.2k, False: 54.5k]
  ------------------
  201|  43.2k|        return c;
  202|  43.2k|      }
  203|       |
  204|  54.5k|      r = c;
  205|   460k|    } else { /* allow = for stability. The binary search favors the right. */
  206|   460k|      if (r - c <= 1) {
  ------------------
  |  Branch (206:11): [True: 89.6k, False: 370k]
  ------------------
  207|  89.6k|        return c + 1;
  208|  89.6k|      }
  209|       |
  210|   370k|      l = c;
  211|   370k|    }
  212|       |
  213|   425k|    c = l + ((r - l) >> 1);
  214|   425k|    cx = dst[c];
  215|   425k|  }
  216|   132k|}
xpath.c:compute_minrun:
  129|  11.2k|static __inline int compute_minrun(const uint64_t size) {
  130|  11.2k|  const int top_bit = 64 - CLZ(size);
  ------------------
  |  |   78|  11.2k|#define CLZ __builtin_clzll
  ------------------
  131|  11.2k|  const int shift = MAX(top_bit, 6) - 6;
  ------------------
  |  |   67|  11.2k|#define MAX(x,y) (((x) > (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (67:20): [True: 11.2k, False: 0]
  |  |  ------------------
  ------------------
  132|  11.2k|  const int minrun = size >> shift;
  133|  11.2k|  const uint64_t mask = (1ULL << shift) - 1;
  134|       |
  135|  11.2k|  if (mask & size) {
  ------------------
  |  Branch (135:7): [True: 7.09k, False: 4.14k]
  ------------------
  136|  7.09k|    return minrun + 1;
  137|  7.09k|  }
  138|       |
  139|  4.14k|  return minrun;
  140|  11.2k|}
xpath.c:PUSH_NEXT:
  496|  28.2k|                              size_t *curr) {
  497|  28.2k|  size_t len = COUNT_RUN(dst, *curr, size);
  ------------------
  |  |  152|  28.2k|#define COUNT_RUN                      SORT_MAKE_STR(count_run)
  |  |  ------------------
  |  |  |  |  146|  28.2k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  28.2k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  28.2k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  498|  28.2k|  size_t run = minrun;
  499|       |
  500|  28.2k|  if (run > size - *curr) {
  ------------------
  |  Branch (500:7): [True: 10.9k, False: 17.3k]
  ------------------
  501|  10.9k|    run = size - *curr;
  502|  10.9k|  }
  503|       |
  504|  28.2k|  if (run > len) {
  ------------------
  |  Branch (504:7): [True: 6.31k, False: 21.9k]
  ------------------
  505|  6.31k|    BINARY_INSERTION_SORT_START(&dst[*curr], len, run);
  ------------------
  |  |  149|  6.31k|#define BINARY_INSERTION_SORT_START    SORT_MAKE_STR(binary_insertion_sort_start)
  |  |  ------------------
  |  |  |  |  146|  6.31k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  6.31k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  6.31k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  506|  6.31k|    len = run;
  507|  6.31k|  }
  508|       |
  509|  28.2k|  run_stack[*stack_curr].start = *curr;
  510|  28.2k|  run_stack[*stack_curr].length = len;
  511|  28.2k|  (*stack_curr)++;
  512|  28.2k|  *curr += len;
  513|       |
  514|  28.2k|  if (*curr == size) {
  ------------------
  |  Branch (514:7): [True: 11.2k, False: 17.0k]
  ------------------
  515|       |    /* finish up */
  516|  24.9k|    while (*stack_curr > 1) {
  ------------------
  |  Branch (516:12): [True: 13.7k, False: 11.2k]
  ------------------
  517|  13.7k|      TIM_SORT_MERGE(dst, run_stack, *stack_curr, store);
  ------------------
  |  |  156|  13.7k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  13.7k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  13.7k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  13.7k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  518|  13.7k|      run_stack[*stack_curr - 2].length += run_stack[*stack_curr - 1].length;
  519|  13.7k|      (*stack_curr)--;
  520|  13.7k|    }
  521|       |
  522|  11.2k|    if (store->storage != NULL) {
  ------------------
  |  Branch (522:9): [True: 11.2k, False: 0]
  ------------------
  523|  11.2k|      free(store->storage);
  524|  11.2k|      store->storage = NULL;
  525|  11.2k|    }
  526|       |
  527|  11.2k|    return 0;
  528|  11.2k|  }
  529|       |
  530|  17.0k|  return 1;
  531|  28.2k|}
xpath.c:libxml_domnode_count_run:
  272|  28.2k|static size_t COUNT_RUN(SORT_TYPE *dst, const size_t start, const size_t size) {
  273|  28.2k|  size_t curr;
  274|       |
  275|  28.2k|  if (size - start == 1) {
  ------------------
  |  Branch (275:7): [True: 9.93k, False: 18.3k]
  ------------------
  276|  9.93k|    return 1;
  277|  9.93k|  }
  278|       |
  279|  18.3k|  if (start >= size - 2) {
  ------------------
  |  Branch (279:7): [True: 124, False: 18.1k]
  ------------------
  280|    124|    if (SORT_CMP(dst[size - 2], dst[size - 1]) > 0) {
  ------------------
  |  |  617|    124|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (280:9): [True: 45, False: 79]
  ------------------
  281|     45|      SORT_SWAP(dst[size - 2], dst[size - 1]);
  ------------------
  |  |   59|     45|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|     45|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  282|     45|    }
  283|       |
  284|    124|    return 2;
  285|    124|  }
  286|       |
  287|  18.1k|  curr = start + 2;
  288|       |
  289|  18.1k|  if (SORT_CMP(dst[start], dst[start + 1]) <= 0) {
  ------------------
  |  |  617|  18.1k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (289:7): [True: 16.9k, False: 1.22k]
  ------------------
  290|       |    /* increasing run */
  291|  1.78M|    while (1) {
  ------------------
  |  Branch (291:12): [True: 1.78M, Folded]
  ------------------
  292|  1.78M|      if (curr == size - 1) {
  ------------------
  |  Branch (292:11): [True: 10.7k, False: 1.77M]
  ------------------
  293|  10.7k|        break;
  294|  10.7k|      }
  295|       |
  296|  1.77M|      if (SORT_CMP(dst[curr - 1], dst[curr]) > 0) {
  ------------------
  |  |  617|  1.77M|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (296:11): [True: 6.18k, False: 1.77M]
  ------------------
  297|  6.18k|        break;
  298|  6.18k|      }
  299|       |
  300|  1.77M|      curr++;
  301|  1.77M|    }
  302|       |
  303|  16.9k|    return curr - start;
  304|  16.9k|  } else {
  305|       |    /* decreasing run */
  306|  2.24k|    while (1) {
  ------------------
  |  Branch (306:12): [True: 2.24k, Folded]
  ------------------
  307|  2.24k|      if (curr == size - 1) {
  ------------------
  |  Branch (307:11): [True: 179, False: 2.06k]
  ------------------
  308|    179|        break;
  309|    179|      }
  310|       |
  311|  2.06k|      if (SORT_CMP(dst[curr - 1], dst[curr]) <= 0) {
  ------------------
  |  |  617|  2.06k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (311:11): [True: 1.04k, False: 1.02k]
  ------------------
  312|  1.04k|        break;
  313|  1.04k|      }
  314|       |
  315|  1.02k|      curr++;
  316|  1.02k|    }
  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|  18.1k|}
xpath.c:libxml_domnode_reverse_elements:
  260|  1.22k|static __inline void REVERSE_ELEMENTS(SORT_TYPE *dst, size_t start, size_t end) {
  261|  2.75k|  while (1) {
  ------------------
  |  Branch (261:10): [True: 2.75k, Folded]
  ------------------
  262|  2.75k|    if (start >= end) {
  ------------------
  |  Branch (262:9): [True: 1.22k, False: 1.53k]
  ------------------
  263|  1.22k|      return;
  264|  1.22k|    }
  265|       |
  266|  1.53k|    SORT_SWAP(dst[start], dst[end]);
  ------------------
  |  |   59|  1.53k|#define SORT_SWAP(x,y) {SORT_TYPE __SORT_SWAP_t = (x); (x) = (y); (y) = __SORT_SWAP_t;}
  |  |  ------------------
  |  |  |  |  593|  1.53k|#define SORT_TYPE xmlNodePtr
  |  |  ------------------
  ------------------
  267|  1.53k|    start++;
  268|  1.53k|    end--;
  269|  1.53k|  }
  270|  1.22k|}
xpath.c:libxml_domnode_tim_sort_merge:
  374|  17.0k|                           TEMP_STORAGE_T *store) {
  375|  17.0k|  const size_t A = stack[stack_curr - 2].length;
  376|  17.0k|  const size_t B = stack[stack_curr - 1].length;
  377|  17.0k|  const size_t curr = stack[stack_curr - 2].start;
  378|  17.0k|  SORT_TYPE *storage;
  ------------------
  |  |  593|  17.0k|#define SORT_TYPE xmlNodePtr
  ------------------
  379|  17.0k|  size_t i, j, k;
  380|  17.0k|  TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |  155|  17.0k|#define TIM_SORT_RESIZE                SORT_MAKE_STR(tim_sort_resize)
  |  |  ------------------
  |  |  |  |  146|  17.0k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  17.0k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  17.0k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                TIM_SORT_RESIZE(store, MIN(A, B));
  ------------------
  |  |   71|  17.0k|#define MIN(x,y) (((x) < (y) ? (x) : (y)))
  |  |  ------------------
  |  |  |  Branch (71:20): [True: 3.61k, False: 13.3k]
  |  |  ------------------
  ------------------
  381|  17.0k|  storage = store->storage;
  382|       |
  383|       |  /* left merge */
  384|  17.0k|  if (A < B) {
  ------------------
  |  Branch (384:7): [True: 3.61k, False: 13.3k]
  ------------------
  385|  3.61k|    memcpy(storage, &dst[curr], A * sizeof(SORT_TYPE));
  386|  3.61k|    i = 0;
  387|  3.61k|    j = curr + A;
  388|       |
  389|   482k|    for (k = curr; k < curr + A + B; k++) {
  ------------------
  |  Branch (389:20): [True: 482k, False: 430]
  ------------------
  390|   482k|      if ((i < A) && (j < curr + A + B)) {
  ------------------
  |  Branch (390:11): [True: 479k, False: 3.18k]
  |  Branch (390:22): [True: 472k, False: 7.13k]
  ------------------
  391|   472k|        if (SORT_CMP(storage[i], dst[j]) <= 0) {
  ------------------
  |  |  617|   472k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (391:13): [True: 231k, False: 240k]
  ------------------
  392|   231k|          dst[k] = storage[i++];
  393|   240k|        } else {
  394|   240k|          dst[k] = dst[j++];
  395|   240k|        }
  396|   472k|      } else if (i < A) {
  ------------------
  |  Branch (396:18): [True: 7.13k, False: 3.18k]
  ------------------
  397|  7.13k|        dst[k] = storage[i++];
  398|  7.13k|      } else {
  399|  3.18k|        break;
  400|  3.18k|      }
  401|   482k|    }
  402|  13.3k|  } else {
  403|       |    /* right merge */
  404|  13.3k|    memcpy(storage, &dst[curr + A], B * sizeof(SORT_TYPE));
  405|  13.3k|    i = B;
  406|  13.3k|    j = curr + A;
  407|  13.3k|    k = curr + A + B;
  408|       |
  409|   429k|    while (k > curr) {
  ------------------
  |  Branch (409:12): [True: 429k, False: 603]
  ------------------
  410|   429k|      k--;
  411|   429k|      if ((i > 0) && (j > curr)) {
  ------------------
  |  Branch (411:11): [True: 416k, False: 12.7k]
  |  Branch (411:22): [True: 412k, False: 3.60k]
  ------------------
  412|   412k|        if (SORT_CMP(dst[j - 1], storage[i - 1]) > 0) {
  ------------------
  |  |  617|   412k|#define SORT_CMP(x, y)  (wrap_cmp(x, y))
  ------------------
  |  Branch (412:13): [True: 139k, False: 273k]
  ------------------
  413|   139k|          dst[k] = dst[--j];
  414|   273k|        } else {
  415|   273k|          dst[k] = storage[--i];
  416|   273k|        }
  417|   412k|      } else if (i > 0) {
  ------------------
  |  Branch (417:18): [True: 3.60k, False: 12.7k]
  ------------------
  418|  3.60k|        dst[k] = storage[--i];
  419|  12.7k|      } else {
  420|  12.7k|        break;
  421|  12.7k|      }
  422|   429k|    }
  423|  13.3k|  }
  424|  17.0k|}
xpath.c:libxml_domnode_tim_sort_resize:
  358|  17.0k|static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) {
  359|  17.0k|  if (store->alloc < new_size) {
  ------------------
  |  Branch (359:7): [True: 13.9k, False: 3.05k]
  ------------------
  360|  13.9k|    SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE));
  ------------------
  |  |  593|  13.9k|#define SORT_TYPE xmlNodePtr
  ------------------
  361|       |
  362|  13.9k|    if (tempstore == NULL) {
  ------------------
  |  Branch (362:9): [True: 0, False: 13.9k]
  ------------------
  363|      0|      fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes",
  364|      0|              (unsigned long)(sizeof(SORT_TYPE) * new_size));
  365|      0|      exit(1);
  366|      0|    }
  367|       |
  368|  13.9k|    store->storage = tempstore;
  369|  13.9k|    store->alloc = new_size;
  370|  13.9k|  }
  371|  17.0k|}
xpath.c:libxml_domnode_check_invariant:
  324|  5.11k|static int CHECK_INVARIANT(TIM_SORT_RUN_T *stack, const int stack_curr) {
  325|  5.11k|  size_t A, B, C;
  326|       |
  327|  5.11k|  if (stack_curr < 2) {
  ------------------
  |  Branch (327:7): [True: 334, False: 4.77k]
  ------------------
  328|    334|    return 1;
  329|    334|  }
  330|       |
  331|  4.77k|  if (stack_curr == 2) {
  ------------------
  |  Branch (331:7): [True: 637, False: 4.14k]
  ------------------
  332|    637|    const size_t A1 = stack[stack_curr - 2].length;
  333|    637|    const size_t B1 = stack[stack_curr - 1].length;
  334|       |
  335|    637|    if (A1 <= B1) {
  ------------------
  |  Branch (335:9): [True: 23, False: 614]
  ------------------
  336|     23|      return 0;
  337|     23|    }
  338|       |
  339|    614|    return 1;
  340|    637|  }
  341|       |
  342|  4.14k|  A = stack[stack_curr - 3].length;
  343|  4.14k|  B = stack[stack_curr - 2].length;
  344|  4.14k|  C = stack[stack_curr - 1].length;
  345|       |
  346|  4.14k|  if ((A <= B + C) || (B <= C)) {
  ------------------
  |  Branch (346:7): [True: 1.20k, False: 2.93k]
  |  Branch (346:23): [True: 751, False: 2.18k]
  ------------------
  347|  1.95k|    return 0;
  348|  1.95k|  }
  349|       |
  350|  2.18k|  return 1;
  351|  4.14k|}
xpath.c:libxml_domnode_tim_sort_collapse:
  427|  1.97k|                             TEMP_STORAGE_T *store, const size_t size) {
  428|  4.95k|  while (1) {
  ------------------
  |  Branch (428:10): [True: 4.95k, Folded]
  ------------------
  429|  4.95k|    size_t A, B, C, D;
  430|  4.95k|    int ABC, BCD, CD;
  431|       |
  432|       |    /* if the stack only has one thing on it, we are done with the collapse */
  433|  4.95k|    if (stack_curr <= 1) {
  ------------------
  |  Branch (433:9): [True: 0, False: 4.95k]
  ------------------
  434|      0|      break;
  435|      0|    }
  436|       |
  437|       |    /* if this is the last merge, just do it */
  438|  4.95k|    if ((stack_curr == 2) && (stack[0].length + stack[1].length == size)) {
  ------------------
  |  Branch (438:9): [True: 869, False: 4.08k]
  |  Branch (438:30): [True: 0, False: 869]
  ------------------
  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.95k|    else if ((stack_curr == 2) && (stack[0].length <= stack[1].length)) {
  ------------------
  |  Branch (445:14): [True: 869, False: 4.08k]
  |  Branch (445:35): [True: 334, False: 535]
  ------------------
  446|    334|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|    334|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    334|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    334|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    334|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  447|    334|      stack[0].length += stack[1].length;
  448|    334|      stack_curr--;
  449|    334|      break;
  450|  4.61k|    } else if (stack_curr == 2) {
  ------------------
  |  Branch (450:16): [True: 535, False: 4.08k]
  ------------------
  451|    535|      break;
  452|    535|    }
  453|       |
  454|  4.08k|    B = stack[stack_curr - 3].length;
  455|  4.08k|    C = stack[stack_curr - 2].length;
  456|  4.08k|    D = stack[stack_curr - 1].length;
  457|       |
  458|  4.08k|    if (stack_curr >= 4) {
  ------------------
  |  Branch (458:9): [True: 2.76k, False: 1.31k]
  ------------------
  459|  2.76k|      A = stack[stack_curr - 4].length;
  460|  2.76k|      ABC = (A <= B + C);
  461|  2.76k|    } else {
  462|  1.31k|      ABC = 0;
  463|  1.31k|    }
  464|       |
  465|  4.08k|    BCD = (B <= C + D) || ABC;
  ------------------
  |  Branch (465:11): [True: 1.71k, False: 2.37k]
  |  Branch (465:27): [True: 29, False: 2.34k]
  ------------------
  466|  4.08k|    CD = (C <= D);
  467|       |
  468|       |    /* Both invariants are good */
  469|  4.08k|    if (!BCD && !CD) {
  ------------------
  |  Branch (469:9): [True: 2.34k, False: 1.74k]
  |  Branch (469:17): [True: 1.10k, False: 1.23k]
  ------------------
  470|  1.10k|      break;
  471|  1.10k|    }
  472|       |
  473|       |    /* left merge */
  474|  2.97k|    if (BCD && !CD) {
  ------------------
  |  Branch (474:9): [True: 1.74k, False: 1.23k]
  |  Branch (474:16): [True: 715, False: 1.02k]
  ------------------
  475|    715|      TIM_SORT_MERGE(dst, stack, stack_curr - 1, store);
  ------------------
  |  |  156|    715|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|    715|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|    715|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    715|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  476|    715|      stack[stack_curr - 3].length += stack[stack_curr - 2].length;
  477|    715|      stack[stack_curr - 2] = stack[stack_curr - 1];
  478|    715|      stack_curr--;
  479|  2.26k|    } else {
  480|       |      /* right merge */
  481|  2.26k|      TIM_SORT_MERGE(dst, stack, stack_curr, store);
  ------------------
  |  |  156|  2.26k|#define TIM_SORT_MERGE                 SORT_MAKE_STR(tim_sort_merge)
  |  |  ------------------
  |  |  |  |  146|  2.26k|#define SORT_MAKE_STR(x) SORT_MAKE_STR1(SORT_NAME,x)
  |  |  |  |  ------------------
  |  |  |  |  |  |  145|  2.26k|#define SORT_MAKE_STR1(x, y) SORT_CONCAT(x,y)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|  2.26k|#define SORT_CONCAT(x, y) x ## _ ## y
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|  2.26k|      stack[stack_curr - 2].length += stack[stack_curr - 1].length;
  483|  2.26k|      stack_curr--;
  484|  2.26k|    }
  485|  2.97k|  }
  486|       |
  487|  1.97k|  return stack_curr;
  488|  1.97k|}

xmlBuildQName:
  170|   403k|	      xmlChar *memory, int len) {
  171|   403k|    size_t lenn, lenp;
  172|   403k|    xmlChar *ret;
  173|       |
  174|   403k|    if ((ncname == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (174:9): [True: 0, False: 403k]
  |  Branch (174:29): [True: 0, False: 403k]
  ------------------
  175|   403k|    if (prefix == NULL) return((xmlChar *) ncname);
  ------------------
  |  Branch (175:9): [True: 290k, False: 112k]
  ------------------
  176|       |
  177|   112k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  178|       |    /* Make allocation more likely */
  179|   112k|    if (len > 8)
  ------------------
  |  Branch (179:9): [True: 55.0k, False: 57.6k]
  ------------------
  180|  55.0k|        len = 8;
  181|   112k|#endif
  182|       |
  183|   112k|    lenn = strlen((char *) ncname);
  184|   112k|    lenp = strlen((char *) prefix);
  185|   112k|    if (lenn >= SIZE_MAX - lenp - 1)
  ------------------
  |  Branch (185:9): [True: 0, False: 112k]
  ------------------
  186|      0|        return(NULL);
  187|       |
  188|   112k|    if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) {
  ------------------
  |  Branch (188:9): [True: 57.6k, False: 55.0k]
  |  Branch (188:29): [True: 30.0k, False: 24.9k]
  ------------------
  189|  87.7k|	ret = xmlMalloc(lenn + lenp + 2);
  190|  87.7k|	if (ret == NULL)
  ------------------
  |  Branch (190:6): [True: 63, False: 87.6k]
  ------------------
  191|     63|	    return(NULL);
  192|  87.7k|    } else {
  193|  24.9k|	ret = memory;
  194|  24.9k|    }
  195|   112k|    memcpy(&ret[0], prefix, lenp);
  196|   112k|    ret[lenp] = ':';
  197|   112k|    memcpy(&ret[lenp + 1], ncname, lenn);
  198|   112k|    ret[lenn + lenp + 1] = 0;
  199|   112k|    return(ret);
  200|   112k|}
xmlSplitQName3:
  268|   258k|xmlSplitQName3(const xmlChar *name, int *len) {
  269|   258k|    int l = 0;
  270|       |
  271|   258k|    if (name == NULL) return(NULL);
  ------------------
  |  Branch (271:9): [True: 0, False: 258k]
  ------------------
  272|   258k|    if (len == NULL) return(NULL);
  ------------------
  |  Branch (272:9): [True: 0, False: 258k]
  ------------------
  273|       |
  274|       |    /* nasty but valid */
  275|   258k|    if (name[0] == ':')
  ------------------
  |  Branch (275:9): [True: 1.62k, False: 257k]
  ------------------
  276|  1.62k|	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.13M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (282:12): [True: 895k, False: 242k]
  |  Branch (282:30): [True: 880k, False: 14.7k]
  ------------------
  283|   880k|	l++;
  284|       |
  285|   257k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (285:9): [True: 242k, False: 14.7k]
  |  Branch (285:27): [True: 605, False: 14.1k]
  ------------------
  286|   243k|	return(NULL);
  287|       |
  288|  14.1k|    *len = l;
  289|       |
  290|  14.1k|    return(&name[l+1]);
  291|   257k|}
xmlSplitQName4:
  306|   617k|xmlSplitQName4(const xmlChar *name, xmlChar **prefixPtr) {
  307|   617k|    xmlChar *prefix;
  308|   617k|    int l = 0;
  309|       |
  310|   617k|    if ((name == NULL) || (prefixPtr == NULL))
  ------------------
  |  Branch (310:9): [True: 0, False: 617k]
  |  Branch (310:27): [True: 0, False: 617k]
  ------------------
  311|      0|        return(NULL);
  312|       |
  313|   617k|    *prefixPtr = NULL;
  314|       |
  315|       |    /* nasty but valid */
  316|   617k|    if (name[0] == ':')
  ------------------
  |  Branch (316:9): [True: 2.76k, False: 614k]
  ------------------
  317|  2.76k|	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.76M|    while ((name[l] != 0) && (name[l] != ':'))
  ------------------
  |  Branch (323:12): [True: 2.34M, False: 426k]
  |  Branch (323:30): [True: 2.15M, False: 187k]
  ------------------
  324|  2.15M|	l++;
  325|       |
  326|       |    /*
  327|       |     * TODO: What about names with multiple colons?
  328|       |     */
  329|   614k|    if ((name[l] == 0) || (name[l+1] == 0))
  ------------------
  |  Branch (329:9): [True: 426k, False: 187k]
  |  Branch (329:27): [True: 2.13k, False: 185k]
  ------------------
  330|   429k|	return(name);
  331|       |
  332|   185k|    prefix = xmlStrndup(name, l);
  333|   185k|    if (prefix == NULL)
  ------------------
  |  Branch (333:9): [True: 41, False: 185k]
  ------------------
  334|     41|        return(NULL);
  335|       |
  336|   185k|    *prefixPtr = prefix;
  337|   185k|    return(&name[l+1]);
  338|   185k|}
xmlValidateNCName:
  355|  3.00k|xmlValidateNCName(const xmlChar *value, int space) {
  356|  3.00k|    const xmlChar *cur;
  357|       |
  358|  3.00k|    if (value == NULL)
  ------------------
  |  Branch (358:9): [True: 0, False: 3.00k]
  ------------------
  359|      0|        return(-1);
  360|       |
  361|  3.00k|    cur = value;
  362|       |
  363|  3.00k|    if (space) {
  ------------------
  |  Branch (363:9): [True: 3.00k, False: 0]
  ------------------
  364|  3.00k|	while (IS_BLANK_CH(*cur))
  365|    774|            cur++;
  366|  3.00k|    }
  367|       |
  368|  3.00k|    value = cur;
  369|  3.00k|    cur = xmlScanName(value, SIZE_MAX, XML_SCAN_NC);
  ------------------
  |  |   69|  3.00k|#define XML_SCAN_NC         1
  ------------------
  370|  3.00k|    if ((cur == NULL) || (cur == value))
  ------------------
  |  Branch (370:9): [True: 0, False: 3.00k]
  |  Branch (370:26): [True: 546, False: 2.46k]
  ------------------
  371|    546|        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.10k|            cur++;
  376|  2.46k|    }
  377|       |
  378|  2.46k|    return(*cur != 0);
  379|  3.00k|}
xmlNewNs:
  517|  7.73M|xmlNewNs(xmlNode *node, const xmlChar *href, const xmlChar *prefix) {
  518|  7.73M|    xmlNsPtr cur;
  519|       |
  520|  7.73M|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (520:9): [True: 95.3k, False: 7.64M]
  |  Branch (520:27): [True: 0, False: 95.3k]
  ------------------
  521|      0|	return(NULL);
  522|       |
  523|       |    /*
  524|       |     * Allocate a new Namespace and fill the fields.
  525|       |     */
  526|  7.73M|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
  527|  7.73M|    if (cur == NULL)
  ------------------
  |  Branch (527:9): [True: 64, False: 7.73M]
  ------------------
  528|     64|	return(NULL);
  529|  7.73M|    memset(cur, 0, sizeof(xmlNs));
  530|  7.73M|    cur->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  7.73M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  531|       |
  532|  7.73M|    if (href != NULL) {
  ------------------
  |  Branch (532:9): [True: 7.71M, False: 25.1k]
  ------------------
  533|  7.71M|	cur->href = xmlStrdup(href);
  534|  7.71M|        if (cur->href == NULL)
  ------------------
  |  Branch (534:13): [True: 59, False: 7.71M]
  ------------------
  535|     59|            goto error;
  536|  7.71M|    }
  537|  7.73M|    if (prefix != NULL) {
  ------------------
  |  Branch (537:9): [True: 7.39M, False: 343k]
  ------------------
  538|  7.39M|	cur->prefix = xmlStrdup(prefix);
  539|  7.39M|        if (cur->prefix == NULL)
  ------------------
  |  Branch (539:13): [True: 48, False: 7.39M]
  ------------------
  540|     48|            goto error;
  541|  7.39M|    }
  542|       |
  543|       |    /*
  544|       |     * Add it at the end to preserve parsing order ...
  545|       |     * and checks for existing use of the prefix
  546|       |     */
  547|  7.73M|    if (node != NULL) {
  ------------------
  |  Branch (547:9): [True: 95.3k, False: 7.64M]
  ------------------
  548|  95.3k|	if (node->nsDef == NULL) {
  ------------------
  |  Branch (548:6): [True: 86.9k, False: 8.37k]
  ------------------
  549|  86.9k|	    node->nsDef = cur;
  550|  86.9k|	} else {
  551|  8.37k|	    xmlNsPtr prev = node->nsDef;
  552|       |
  553|  8.37k|	    if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (553:10): [True: 0, False: 8.37k]
  ------------------
  554|      0|                (prev->href != NULL))
  ------------------
  |  Branch (554:17): [True: 0, False: 0]
  ------------------
  555|      0|                goto error;
  556|  10.6k|	    while (prev->next != NULL) {
  ------------------
  |  Branch (556:13): [True: 2.31k, False: 8.37k]
  ------------------
  557|  2.31k|	        prev = prev->next;
  558|  2.31k|		if ((xmlStrEqual(prev->prefix, cur->prefix)) &&
  ------------------
  |  Branch (558:7): [True: 0, False: 2.31k]
  ------------------
  559|      0|                    (prev->href != NULL))
  ------------------
  |  Branch (559:21): [True: 0, False: 0]
  ------------------
  560|      0|                    goto error;
  561|  2.31k|	    }
  562|  8.37k|	    prev->next = cur;
  563|  8.37k|	}
  564|  95.3k|    }
  565|  7.73M|    return(cur);
  566|       |
  567|    107|error:
  568|    107|    xmlFreeNs(cur);
  569|       |    return(NULL);
  570|  7.73M|}
xmlSetNs:
  580|  85.0k|xmlSetNs(xmlNode *node, xmlNs *ns) {
  581|  85.0k|    if (node == NULL) {
  ------------------
  |  Branch (581:9): [True: 0, False: 85.0k]
  ------------------
  582|      0|	return;
  583|      0|    }
  584|  85.0k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (584:9): [True: 85.0k, False: 0]
  ------------------
  585|      0|        (node->type == XML_ATTRIBUTE_NODE))
  ------------------
  |  Branch (585:9): [True: 0, False: 0]
  ------------------
  586|  85.0k|	node->ns = ns;
  587|  85.0k|}
xmlFreeNs:
  595|  7.74M|xmlFreeNs(xmlNs *cur) {
  596|  7.74M|    if (cur == NULL) {
  ------------------
  |  Branch (596:9): [True: 0, False: 7.74M]
  ------------------
  597|      0|	return;
  598|      0|    }
  599|  7.74M|    if (cur->href != NULL) xmlFree((char *) cur->href);
  ------------------
  |  Branch (599:9): [True: 7.71M, False: 25.1k]
  ------------------
  600|  7.74M|    if (cur->prefix != NULL) xmlFree((char *) cur->prefix);
  ------------------
  |  Branch (600:9): [True: 7.39M, False: 343k]
  ------------------
  601|  7.74M|    xmlFree(cur);
  602|  7.74M|}
xmlFreeNsList:
  610|  5.93M|xmlFreeNsList(xmlNs *cur) {
  611|  5.93M|    xmlNsPtr next;
  612|  5.93M|    if (cur == NULL) {
  ------------------
  |  Branch (612:9): [True: 38, False: 5.93M]
  ------------------
  613|     38|	return;
  614|     38|    }
  615|  13.6M|    while (cur != NULL) {
  ------------------
  |  Branch (615:12): [True: 7.74M, False: 5.93M]
  ------------------
  616|  7.74M|        next = cur->next;
  617|  7.74M|        xmlFreeNs(cur);
  618|  7.74M|	cur = next;
  619|  7.74M|    }
  620|  5.93M|}
xmlNewDtd:
  640|  10.2k|          const xmlChar *systemId) {
  641|  10.2k|    xmlDtdPtr cur;
  642|       |
  643|  10.2k|    if ((doc != NULL) && (doc->extSubset != NULL)) {
  ------------------
  |  Branch (643:9): [True: 1.63k, False: 8.66k]
  |  Branch (643:26): [True: 0, False: 1.63k]
  ------------------
  644|      0|	return(NULL);
  645|      0|    }
  646|       |
  647|       |    /*
  648|       |     * Allocate a new DTD and fill the fields.
  649|       |     */
  650|  10.2k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  651|  10.2k|    if (cur == NULL)
  ------------------
  |  Branch (651:9): [True: 7, False: 10.2k]
  ------------------
  652|      7|	return(NULL);
  653|  10.2k|    memset(cur, 0 , sizeof(xmlDtd));
  654|  10.2k|    cur->type = XML_DTD_NODE;
  655|       |
  656|  10.2k|    if (name != NULL) {
  ------------------
  |  Branch (656:9): [True: 10.2k, False: 0]
  ------------------
  657|  10.2k|	cur->name = xmlStrdup(name);
  658|  10.2k|        if (cur->name == NULL)
  ------------------
  |  Branch (658:13): [True: 14, False: 10.2k]
  ------------------
  659|     14|            goto error;
  660|  10.2k|    }
  661|  10.2k|    if (publicId != NULL) {
  ------------------
  |  Branch (661:9): [True: 355, False: 9.91k]
  ------------------
  662|    355|	cur->ExternalID = xmlStrdup(publicId);
  663|    355|        if (cur->ExternalID == NULL)
  ------------------
  |  Branch (663:13): [True: 2, False: 353]
  ------------------
  664|      2|            goto error;
  665|    355|    }
  666|  10.2k|    if (systemId != NULL) {
  ------------------
  |  Branch (666:9): [True: 2.22k, False: 8.04k]
  ------------------
  667|  2.22k|	cur->SystemID = xmlStrdup(systemId);
  668|  2.22k|        if (cur->SystemID == NULL)
  ------------------
  |  Branch (668:13): [True: 4, False: 2.22k]
  ------------------
  669|      4|            goto error;
  670|  2.22k|    }
  671|  10.2k|    if (doc != NULL)
  ------------------
  |  Branch (671:9): [True: 1.62k, False: 8.63k]
  ------------------
  672|  1.62k|	doc->extSubset = cur;
  673|  10.2k|    cur->doc = doc;
  674|       |
  675|  10.2k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (675:9): [True: 0, False: 10.2k]
  |  Branch (675:35): [True: 0, False: 0]
  ------------------
  676|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  677|  10.2k|    return(cur);
  678|       |
  679|     20|error:
  680|     20|    xmlFreeDtd(cur);
  681|       |    return(NULL);
  682|  10.2k|}
xmlGetIntSubset:
  691|  80.5k|xmlGetIntSubset(const xmlDoc *doc) {
  692|  80.5k|    xmlNodePtr cur;
  693|       |
  694|  80.5k|    if (doc == NULL)
  ------------------
  |  Branch (694:9): [True: 8.34k, False: 72.2k]
  ------------------
  695|  8.34k|	return(NULL);
  696|  72.2k|    cur = doc->children;
  697|  85.6k|    while (cur != NULL) {
  ------------------
  |  Branch (697:12): [True: 39.7k, False: 45.9k]
  ------------------
  698|  39.7k|	if (cur->type == XML_DTD_NODE)
  ------------------
  |  Branch (698:6): [True: 26.3k, False: 13.4k]
  ------------------
  699|  26.3k|	    return((xmlDtdPtr) cur);
  700|  13.4k|	cur = cur->next;
  701|  13.4k|    }
  702|  45.9k|    return((xmlDtdPtr) doc->intSubset);
  703|  72.2k|}
xmlCreateIntSubset:
  722|  20.1k|                   const xmlChar *systemId) {
  723|  20.1k|    xmlDtdPtr cur;
  724|       |
  725|  20.1k|    if (doc != NULL) {
  ------------------
  |  Branch (725:9): [True: 20.1k, False: 0]
  ------------------
  726|  20.1k|        cur = xmlGetIntSubset(doc);
  727|  20.1k|        if (cur != NULL)
  ------------------
  |  Branch (727:13): [True: 0, False: 20.1k]
  ------------------
  728|      0|            return(cur);
  729|  20.1k|    }
  730|       |
  731|       |    /*
  732|       |     * Allocate a new DTD and fill the fields.
  733|       |     */
  734|  20.1k|    cur = (xmlDtdPtr) xmlMalloc(sizeof(xmlDtd));
  735|  20.1k|    if (cur == NULL)
  ------------------
  |  Branch (735:9): [True: 7, False: 20.1k]
  ------------------
  736|      7|	return(NULL);
  737|  20.1k|    memset(cur, 0, sizeof(xmlDtd));
  738|  20.1k|    cur->type = XML_DTD_NODE;
  739|       |
  740|  20.1k|    if (name != NULL) {
  ------------------
  |  Branch (740:9): [True: 19.1k, False: 1.00k]
  ------------------
  741|  19.1k|	cur->name = xmlStrdup(name);
  742|  19.1k|	if (cur->name == NULL)
  ------------------
  |  Branch (742:6): [True: 4, False: 19.1k]
  ------------------
  743|      4|            goto error;
  744|  19.1k|    }
  745|  20.1k|    if (publicId != NULL) {
  ------------------
  |  Branch (745:9): [True: 771, False: 19.3k]
  ------------------
  746|    771|	cur->ExternalID = xmlStrdup(publicId);
  747|    771|	if (cur->ExternalID  == NULL)
  ------------------
  |  Branch (747:6): [True: 1, False: 770]
  ------------------
  748|      1|            goto error;
  749|    771|    }
  750|  20.1k|    if (systemId != NULL) {
  ------------------
  |  Branch (750:9): [True: 2.96k, False: 17.1k]
  ------------------
  751|  2.96k|	cur->SystemID = xmlStrdup(systemId);
  752|  2.96k|	if (cur->SystemID == NULL)
  ------------------
  |  Branch (752:6): [True: 1, False: 2.96k]
  ------------------
  753|      1|            goto error;
  754|  2.96k|    }
  755|  20.1k|    if (doc != NULL) {
  ------------------
  |  Branch (755:9): [True: 20.1k, False: 0]
  ------------------
  756|  20.1k|	doc->intSubset = cur;
  757|  20.1k|	cur->parent = doc;
  758|  20.1k|	cur->doc = doc;
  759|  20.1k|	if (doc->children == NULL) {
  ------------------
  |  Branch (759:6): [True: 18.0k, False: 2.06k]
  ------------------
  760|  18.0k|	    doc->children = (xmlNodePtr) cur;
  761|  18.0k|	    doc->last = (xmlNodePtr) cur;
  762|  18.0k|	} else {
  763|  2.06k|	    if (doc->type == XML_HTML_DOCUMENT_NODE) {
  ------------------
  |  Branch (763:10): [True: 0, False: 2.06k]
  ------------------
  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.06k|	    } else {
  771|  2.06k|		xmlNodePtr next;
  772|       |
  773|  2.06k|		next = doc->children;
  774|  4.30k|		while ((next != NULL) && (next->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (774:10): [True: 2.39k, False: 1.91k]
  |  Branch (774:28): [True: 2.24k, False: 149]
  ------------------
  775|  2.24k|		    next = next->next;
  776|  2.06k|		if (next == NULL) {
  ------------------
  |  Branch (776:7): [True: 1.91k, False: 149]
  ------------------
  777|  1.91k|		    cur->prev = doc->last;
  778|  1.91k|		    cur->prev->next = (xmlNodePtr) cur;
  779|  1.91k|		    cur->next = NULL;
  780|  1.91k|		    doc->last = (xmlNodePtr) cur;
  781|  1.91k|		} else {
  782|    149|		    cur->next = next;
  783|    149|		    cur->prev = next->prev;
  784|    149|		    if (cur->prev == NULL)
  ------------------
  |  Branch (784:11): [True: 140, False: 9]
  ------------------
  785|    140|			doc->children = (xmlNodePtr) cur;
  786|      9|		    else
  787|      9|			cur->prev->next = (xmlNodePtr) cur;
  788|    149|		    next->prev = (xmlNodePtr) cur;
  789|    149|		}
  790|  2.06k|	    }
  791|  2.06k|	}
  792|  20.1k|    }
  793|       |
  794|  20.1k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (794:9): [True: 0, False: 20.1k]
  |  Branch (794:35): [True: 0, False: 0]
  ------------------
  795|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  796|  20.1k|    return(cur);
  797|       |
  798|      6|error:
  799|      6|    xmlFreeDtd(cur);
  800|       |    return(NULL);
  801|  20.1k|}
xmlFreeDtd:
  820|  30.4k|xmlFreeDtd(xmlDtd *cur) {
  821|  30.4k|    xmlDictPtr dict = NULL;
  822|       |
  823|  30.4k|    if (cur == NULL) {
  ------------------
  |  Branch (823:9): [True: 0, False: 30.4k]
  ------------------
  824|      0|	return;
  825|      0|    }
  826|  30.4k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (826:9): [True: 21.7k, False: 8.66k]
  ------------------
  827|       |
  828|  30.4k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (828:9): [True: 0, False: 30.4k]
  |  Branch (828:35): [True: 0, False: 0]
  ------------------
  829|      0|	xmlDeregisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  830|       |
  831|  30.4k|    if (cur->children != NULL) {
  ------------------
  |  Branch (831:9): [True: 20.7k, False: 9.73k]
  ------------------
  832|  20.7k|	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|   239k|        while (c != NULL) {
  ------------------
  |  Branch (838:16): [True: 218k, False: 20.7k]
  ------------------
  839|   218k|	    next = c->next;
  840|   218k|	    if ((c->type != XML_ELEMENT_DECL) &&
  ------------------
  |  Branch (840:10): [True: 202k, False: 16.5k]
  ------------------
  841|   202k|		(c->type != XML_ATTRIBUTE_DECL) &&
  ------------------
  |  Branch (841:3): [True: 166k, False: 36.0k]
  ------------------
  842|   166k|		(c->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (842:3): [True: 141k, False: 24.8k]
  ------------------
  843|   141k|		xmlUnlinkNodeInternal(c);
  844|   141k|		xmlFreeNode(c);
  845|   141k|	    }
  846|   218k|	    c = next;
  847|   218k|	}
  848|  20.7k|    }
  849|       |
  850|  30.4k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  30.4k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 29.4k, False: 1.02k]
  |  |  |  Branch (810:16): [True: 17.5k, False: 11.8k]
  |  |  ------------------
  |  |  811|  29.4k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 11.8k, False: 0]
  |  |  ------------------
  |  |  812|  30.4k|	    xmlFree((char *)(str));
  ------------------
  851|       |
  852|  30.4k|    if (cur->SystemID != NULL)
  ------------------
  |  Branch (852:9): [True: 5.18k, False: 25.2k]
  ------------------
  853|  5.18k|        xmlFree(cur->SystemID);
  854|  30.4k|    if (cur->ExternalID != NULL)
  ------------------
  |  Branch (854:9): [True: 1.12k, False: 29.3k]
  ------------------
  855|  1.12k|        xmlFree(cur->ExternalID);
  856|       |
  857|       |    /* TODO !!! */
  858|  30.4k|    if (cur->notations != NULL)
  ------------------
  |  Branch (858:9): [True: 1.52k, False: 28.9k]
  ------------------
  859|  1.52k|        xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
  860|       |
  861|  30.4k|    if (cur->elements != NULL)
  ------------------
  |  Branch (861:9): [True: 14.2k, False: 16.1k]
  ------------------
  862|  14.2k|        xmlFreeElementTable((xmlElementTablePtr) cur->elements);
  863|  30.4k|    if (cur->attributes != NULL)
  ------------------
  |  Branch (863:9): [True: 9.00k, False: 21.4k]
  ------------------
  864|  9.00k|        xmlFreeAttributeTable((xmlAttributeTablePtr) cur->attributes);
  865|  30.4k|    if (cur->entities != NULL)
  ------------------
  |  Branch (865:9): [True: 7.02k, False: 23.4k]
  ------------------
  866|  7.02k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->entities);
  867|  30.4k|    if (cur->pentities != NULL)
  ------------------
  |  Branch (867:9): [True: 3.79k, False: 26.6k]
  ------------------
  868|  3.79k|        xmlFreeEntitiesTable((xmlEntitiesTablePtr) cur->pentities);
  869|       |
  870|  30.4k|    xmlFree(cur);
  871|  30.4k|}
xmlNewDoc:
  880|  47.0k|xmlNewDoc(const xmlChar *version) {
  881|  47.0k|    xmlDocPtr cur;
  882|       |
  883|  47.0k|    if (version == NULL)
  ------------------
  |  Branch (883:9): [True: 559, False: 46.5k]
  ------------------
  884|    559|	version = (const xmlChar *) "1.0";
  885|       |
  886|       |    /*
  887|       |     * Allocate a new document and fill the fields.
  888|       |     */
  889|  47.0k|    cur = (xmlDocPtr) xmlMalloc(sizeof(xmlDoc));
  890|  47.0k|    if (cur == NULL)
  ------------------
  |  Branch (890:9): [True: 4, False: 47.0k]
  ------------------
  891|      4|	return(NULL);
  892|  47.0k|    memset(cur, 0, sizeof(xmlDoc));
  893|  47.0k|    cur->type = XML_DOCUMENT_NODE;
  894|       |
  895|  47.0k|    cur->version = xmlStrdup(version);
  896|  47.0k|    if (cur->version == NULL) {
  ------------------
  |  Branch (896:9): [True: 18, False: 47.0k]
  ------------------
  897|     18|	xmlFree(cur);
  898|     18|	return(NULL);
  899|     18|    }
  900|  47.0k|    cur->standalone = -1;
  901|  47.0k|    cur->compression = -1; /* not initialized */
  902|  47.0k|    cur->doc = cur;
  903|  47.0k|    cur->parseFlags = 0;
  904|  47.0k|    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|  47.0k|    cur->charset = XML_CHAR_ENCODING_UTF8;
  911|       |
  912|  47.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (912:9): [True: 0, False: 47.0k]
  |  Branch (912:35): [True: 0, False: 0]
  ------------------
  913|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  914|  47.0k|    return(cur);
  915|  47.0k|}
xmlFreeDoc:
  923|  14.1k|xmlFreeDoc(xmlDoc *cur) {
  924|  14.1k|    xmlDtdPtr extSubset, intSubset;
  925|  14.1k|    xmlDictPtr dict = NULL;
  926|       |
  927|  14.1k|    if (cur == NULL) {
  ------------------
  |  Branch (927:9): [True: 1.72k, False: 12.3k]
  ------------------
  928|  1.72k|	return;
  929|  1.72k|    }
  930|       |
  931|  12.3k|    dict = cur->dict;
  932|       |
  933|  12.3k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (933:9): [True: 0, False: 12.3k]
  |  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.3k|    if (cur->ids != NULL) xmlFreeIDTable((xmlIDTablePtr) cur->ids);
  ------------------
  |  Branch (939:9): [True: 218, False: 12.1k]
  ------------------
  940|  12.3k|    cur->ids = NULL;
  941|  12.3k|    if (cur->refs != NULL) xmlFreeRefTable((xmlRefTablePtr) cur->refs);
  ------------------
  |  Branch (941:9): [True: 318, False: 12.0k]
  ------------------
  942|  12.3k|    cur->refs = NULL;
  943|  12.3k|    extSubset = cur->extSubset;
  944|  12.3k|    intSubset = cur->intSubset;
  945|  12.3k|    if (intSubset == extSubset)
  ------------------
  |  Branch (945:9): [True: 8.03k, False: 4.35k]
  ------------------
  946|  8.03k|	extSubset = NULL;
  947|  12.3k|    if (extSubset != NULL) {
  ------------------
  |  Branch (947:9): [True: 203, False: 12.1k]
  ------------------
  948|    203|	xmlUnlinkNodeInternal((xmlNodePtr) cur->extSubset);
  949|    203|	cur->extSubset = NULL;
  950|    203|	xmlFreeDtd(extSubset);
  951|    203|    }
  952|  12.3k|    if (intSubset != NULL) {
  ------------------
  |  Branch (952:9): [True: 4.36k, False: 8.01k]
  ------------------
  953|  4.36k|	xmlUnlinkNodeInternal((xmlNodePtr) cur->intSubset);
  954|  4.36k|	cur->intSubset = NULL;
  955|  4.36k|	xmlFreeDtd(intSubset);
  956|  4.36k|    }
  957|       |
  958|  12.3k|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (958:9): [True: 11.7k, False: 647]
  ------------------
  959|  12.3k|    if (cur->oldNs != NULL) xmlFreeNsList(cur->oldNs);
  ------------------
  |  Branch (959:9): [True: 1.60k, False: 10.7k]
  ------------------
  960|       |
  961|  12.3k|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  12.3k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 0, False: 12.3k]
  |  |  |  Branch (810:16): [True: 0, False: 0]
  |  |  ------------------
  |  |  811|      0|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 0]
  |  |  ------------------
  |  |  812|  12.3k|	    xmlFree((char *)(str));
  ------------------
  962|       |
  963|  12.3k|    if (cur->version != NULL)
  ------------------
  |  Branch (963:9): [True: 12.3k, False: 0]
  ------------------
  964|  12.3k|        xmlFree(cur->version);
  965|  12.3k|    if (cur->encoding != NULL)
  ------------------
  |  Branch (965:9): [True: 95, False: 12.2k]
  ------------------
  966|     95|        xmlFree(cur->encoding);
  967|  12.3k|    if (cur->URL != NULL)
  ------------------
  |  Branch (967:9): [True: 8.45k, False: 3.93k]
  ------------------
  968|  8.45k|        xmlFree(cur->URL);
  969|       |
  970|  12.3k|    xmlFree(cur);
  971|  12.3k|    if (dict) xmlDictFree(dict);
  ------------------
  |  Branch (971:9): [True: 6.48k, False: 5.90k]
  ------------------
  972|  12.3k|}
xmlNodeParseAttValue:
  998|  64.3k|                     const xmlChar *value, size_t len, xmlNode **listPtr) {
  999|  64.3k|    xmlNodePtr head = NULL, last = NULL;
 1000|  64.3k|    xmlNodePtr node;
 1001|  64.3k|    xmlChar *val = NULL;
 1002|  64.3k|    const xmlChar *cur;
 1003|  64.3k|    const xmlChar *q;
 1004|  64.3k|    xmlEntityPtr ent;
 1005|  64.3k|    xmlBufPtr buf;
 1006|  64.3k|    size_t remaining = len;
 1007|       |
 1008|  64.3k|    if (listPtr != NULL)
  ------------------
  |  Branch (1008:9): [True: 0, False: 64.3k]
  ------------------
 1009|      0|        *listPtr = NULL;
 1010|       |
 1011|  64.3k|    if ((value == NULL) || (value[0] == 0))
  ------------------
  |  Branch (1011:9): [True: 0, False: 64.3k]
  |  Branch (1011:28): [True: 3.58k, False: 60.7k]
  ------------------
 1012|  3.58k|        goto done;
 1013|       |
 1014|  60.7k|    cur = value;
 1015|       |
 1016|  60.7k|    buf = xmlBufCreate(50);
 1017|  60.7k|    if (buf == NULL)
  ------------------
  |  Branch (1017:9): [True: 26, False: 60.7k]
  ------------------
 1018|     26|        return(-1);
 1019|       |
 1020|  60.7k|    q = cur;
 1021|  94.5M|    while ((remaining > 0) && (*cur != 0)) {
  ------------------
  |  Branch (1021:12): [True: 94.5M, False: 32.7k]
  |  Branch (1021:31): [True: 94.4M, False: 27.8k]
  ------------------
 1022|  94.4M|	if (cur[0] == '&') {
  ------------------
  |  Branch (1022:6): [True: 54.3k, False: 94.4M]
  ------------------
 1023|  54.3k|	    int charval = 0;
 1024|       |
 1025|       |	    /*
 1026|       |	     * Save the current text.
 1027|       |	     */
 1028|  54.3k|            if (cur != q) {
  ------------------
  |  Branch (1028:17): [True: 35.9k, False: 18.3k]
  ------------------
 1029|  35.9k|		if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1029:7): [True: 1, False: 35.9k]
  ------------------
 1030|      1|		    goto out;
 1031|  35.9k|	        q = cur;
 1032|  35.9k|	    }
 1033|       |
 1034|  54.3k|	    if ((remaining > 2) && (cur[1] == '#') && (cur[2] == 'x')) {
  ------------------
  |  Branch (1034:10): [True: 54.3k, False: 0]
  |  Branch (1034:29): [True: 15.8k, False: 38.5k]
  |  Branch (1034:48): [True: 7.95k, False: 7.87k]
  ------------------
 1035|  7.95k|	        int tmp = 0;
 1036|       |
 1037|  7.95k|		cur += 3;
 1038|  7.95k|                remaining -= 3;
 1039|  32.9k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1039:10): [True: 32.9k, False: 0]
  |  Branch (1039:29): [True: 25.0k, False: 7.95k]
  ------------------
 1040|  25.0k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1040:11): [True: 25.0k, False: 0]
  |  Branch (1040:27): [True: 1.12k, False: 23.9k]
  ------------------
 1041|  1.12k|			charval = charval * 16 + (tmp - '0');
 1042|  23.9k|		    else if ((tmp >= 'a') && (tmp <= 'f'))
  ------------------
  |  Branch (1042:16): [True: 7.55k, False: 16.3k]
  |  Branch (1042:32): [True: 7.55k, False: 0]
  ------------------
 1043|  7.55k|			charval = charval * 16 + (tmp - 'a') + 10;
 1044|  16.3k|		    else if ((tmp >= 'A') && (tmp <= 'F'))
  ------------------
  |  Branch (1044:16): [True: 16.3k, False: 0]
  |  Branch (1044:32): [True: 16.3k, False: 0]
  ------------------
 1045|  16.3k|			charval = charval * 16 + (tmp - 'A') + 10;
 1046|      0|		    else {
 1047|      0|			charval = 0;
 1048|      0|			break;
 1049|      0|		    }
 1050|  25.0k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1050:25): [True: 0, False: 25.0k]
  ------------------
 1051|      0|                        charval = 0x110000;
 1052|  25.0k|		    cur++;
 1053|  25.0k|                    remaining--;
 1054|  25.0k|		}
 1055|  7.95k|		if (tmp == ';') {
  ------------------
  |  Branch (1055:7): [True: 7.95k, False: 0]
  ------------------
 1056|  7.95k|		    cur++;
 1057|  7.95k|                    remaining--;
 1058|  7.95k|                }
 1059|  7.95k|		q = cur;
 1060|  46.3k|	    } else if ((remaining > 1) && (cur[1] == '#')) {
  ------------------
  |  Branch (1060:17): [True: 46.3k, False: 0]
  |  Branch (1060:36): [True: 7.87k, False: 38.5k]
  ------------------
 1061|  7.87k|	        int tmp = 0;
 1062|       |
 1063|  7.87k|		cur += 2;
 1064|  7.87k|                remaining -= 2;
 1065|  23.6k|		while ((remaining > 0) && ((tmp = *cur) != ';')) {
  ------------------
  |  Branch (1065:10): [True: 23.6k, False: 0]
  |  Branch (1065:29): [True: 15.7k, False: 7.87k]
  ------------------
 1066|  15.7k|		    if ((tmp >= '0') && (tmp <= '9'))
  ------------------
  |  Branch (1066:11): [True: 15.7k, False: 0]
  |  Branch (1066:27): [True: 15.7k, False: 0]
  ------------------
 1067|  15.7k|			charval = charval * 10 + (tmp - '0');
 1068|      0|		    else {
 1069|      0|			charval = 0;
 1070|      0|			break;
 1071|      0|		    }
 1072|  15.7k|                    if (charval > 0x110000)
  ------------------
  |  Branch (1072:25): [True: 0, False: 15.7k]
  ------------------
 1073|      0|                        charval = 0x110000;
 1074|  15.7k|		    cur++;
 1075|  15.7k|                    remaining--;
 1076|  15.7k|		}
 1077|  7.87k|		if (tmp == ';') {
  ------------------
  |  Branch (1077:7): [True: 7.87k, False: 0]
  ------------------
 1078|  7.87k|		    cur++;
 1079|  7.87k|                    remaining--;
 1080|  7.87k|                }
 1081|  7.87k|		q = cur;
 1082|  38.5k|	    } else {
 1083|       |		/*
 1084|       |		 * Read the entity string
 1085|       |		 */
 1086|  38.5k|		cur++;
 1087|  38.5k|                remaining--;
 1088|  38.5k|		q = cur;
 1089|   160k|		while ((remaining > 0) && (*cur != 0) && (*cur != ';')) {
  ------------------
  |  Branch (1089:10): [True: 160k, False: 0]
  |  Branch (1089:29): [True: 160k, False: 0]
  |  Branch (1089:44): [True: 122k, False: 38.5k]
  ------------------
 1090|   122k|                    cur++;
 1091|   122k|                    remaining--;
 1092|   122k|                }
 1093|  38.5k|		if ((remaining <= 0) || (*cur == 0))
  ------------------
  |  Branch (1093:7): [True: 0, False: 38.5k]
  |  Branch (1093:27): [True: 0, False: 38.5k]
  ------------------
 1094|      0|		    break;
 1095|  38.5k|		if (cur != q) {
  ------------------
  |  Branch (1095:7): [True: 38.5k, False: 0]
  ------------------
 1096|  38.5k|		    val = xmlStrndup(q, cur - q);
 1097|  38.5k|                    if (val == NULL)
  ------------------
  |  Branch (1097:25): [True: 10, False: 38.5k]
  ------------------
 1098|     10|                        goto out;
 1099|  38.5k|		    ent = xmlGetDocEntity(doc, val);
 1100|  38.5k|		    if ((ent != NULL) &&
  ------------------
  |  Branch (1100:11): [True: 30.0k, False: 8.46k]
  ------------------
 1101|  30.0k|			(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
  ------------------
  |  Branch (1101:4): [True: 343, False: 29.6k]
  ------------------
 1102|       |                        /*
 1103|       |                         * Predefined entities don't generate nodes
 1104|       |                         */
 1105|    343|			if (xmlBufCat(buf, ent->content))
  ------------------
  |  Branch (1105:8): [True: 1, False: 342]
  ------------------
 1106|      1|			    goto out;
 1107|  38.1k|                    } else if (ent == NULL ||
  ------------------
  |  Branch (1107:32): [True: 8.46k, False: 29.6k]
  ------------------
 1108|  38.1k|                               (ent->flags & XML_ENT_EXPANDING) == 0) {
  ------------------
  |  |   22|  29.6k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (1108:32): [True: 29.6k, False: 0]
  ------------------
 1109|       |			/*
 1110|       |			 * Flush buffer so far
 1111|       |			 */
 1112|  38.1k|			if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1112:8): [True: 28.7k, False: 9.45k]
  ------------------
 1113|  28.7k|			    node = xmlNewDocText(doc, NULL);
 1114|  28.7k|			    if (node == NULL)
  ------------------
  |  Branch (1114:12): [True: 4, False: 28.7k]
  ------------------
 1115|      4|				goto out;
 1116|  28.7k|			    node->content = xmlBufDetach(buf);
 1117|  28.7k|                            node->parent = (xmlNode *) attr;
 1118|       |
 1119|  28.7k|			    if (last == NULL) {
  ------------------
  |  Branch (1119:12): [True: 939, False: 27.7k]
  ------------------
 1120|    939|				head = node;
 1121|  27.7k|			    } else {
 1122|  27.7k|                                last->next = node;
 1123|  27.7k|                                node->prev = last;
 1124|  27.7k|			    }
 1125|  28.7k|                            last = node;
 1126|  28.7k|			}
 1127|       |
 1128|  38.1k|			if ((ent != NULL) &&
  ------------------
  |  Branch (1128:8): [True: 29.6k, False: 8.46k]
  ------------------
 1129|  29.6k|                            ((ent->flags & XML_ENT_PARSED) == 0) &&
  ------------------
  |  |   19|  29.6k|#define XML_ENT_PARSED      (1u << 0)
  ------------------
  |  Branch (1129:29): [True: 1.12k, False: 28.5k]
  ------------------
 1130|  1.12k|                            (ent->content != NULL)) {
  ------------------
  |  Branch (1130:29): [True: 1.03k, False: 81]
  ------------------
 1131|  1.03k|                            int res;
 1132|       |
 1133|  1.03k|                            ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.03k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1134|  1.03k|                            res = xmlNodeParseAttValue(doc, (xmlAttr *) ent,
 1135|  1.03k|                                                       ent->content, SIZE_MAX,
 1136|  1.03k|                                                       NULL);
 1137|  1.03k|                            ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  1.03k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 1138|  1.03k|                            if (res < 0)
  ------------------
  |  Branch (1138:33): [True: 123, False: 916]
  ------------------
 1139|    123|                                goto out;
 1140|    916|                            ent->flags |= XML_ENT_PARSED;
  ------------------
  |  |   19|    916|#define XML_ENT_PARSED      (1u << 0)
  ------------------
 1141|    916|			}
 1142|       |
 1143|       |			/*
 1144|       |			 * Create a new REFERENCE_REF node
 1145|       |			 */
 1146|  38.0k|			node = xmlNewEntityRef((xmlDocPtr) doc, val);
 1147|  38.0k|                        val = NULL;
 1148|  38.0k|			if (node == NULL)
  ------------------
  |  Branch (1148:8): [True: 7, False: 38.0k]
  ------------------
 1149|      7|			    goto out;
 1150|  38.0k|                        node->parent = (xmlNode *) attr;
 1151|  38.0k|                        node->last = (xmlNodePtr) ent;
 1152|  38.0k|                        if (ent != NULL) {
  ------------------
  |  Branch (1152:29): [True: 29.5k, False: 8.46k]
  ------------------
 1153|  29.5k|                            node->children = (xmlNodePtr) ent;
 1154|  29.5k|                            node->content = ent->content;
 1155|  29.5k|                        }
 1156|       |
 1157|  38.0k|			if (last == NULL) {
  ------------------
  |  Branch (1157:8): [True: 1.51k, False: 36.5k]
  ------------------
 1158|  1.51k|			    head = node;
 1159|  36.5k|			} else {
 1160|  36.5k|                            last->next = node;
 1161|  36.5k|                            node->prev = last;
 1162|  36.5k|			}
 1163|  38.0k|                        last = node;
 1164|  38.0k|		    }
 1165|  38.3k|		    xmlFree(val);
 1166|  38.3k|                    val = NULL;
 1167|  38.3k|		}
 1168|  38.3k|		cur++;
 1169|  38.3k|                remaining--;
 1170|  38.3k|		q = cur;
 1171|  38.3k|	    }
 1172|  54.1k|	    if (charval != 0) {
  ------------------
  |  Branch (1172:10): [True: 15.8k, False: 38.3k]
  ------------------
 1173|  15.8k|		xmlChar buffer[10];
 1174|  15.8k|		int l;
 1175|       |
 1176|  15.8k|                if (charval >= 0x110000)
  ------------------
  |  Branch (1176:21): [True: 0, False: 15.8k]
  ------------------
 1177|      0|                    charval = 0xFFFD; /* replacement character */
 1178|       |
 1179|  15.8k|		l = xmlCopyCharMultiByte(buffer, charval);
 1180|  15.8k|		buffer[l] = 0;
 1181|       |
 1182|  15.8k|		if (xmlBufCat(buf, buffer))
  ------------------
  |  Branch (1182:7): [True: 1, False: 15.8k]
  ------------------
 1183|      1|		    goto out;
 1184|  15.8k|	    }
 1185|  94.4M|	} else {
 1186|  94.4M|	    cur++;
 1187|  94.4M|            remaining--;
 1188|  94.4M|        }
 1189|  94.4M|    }
 1190|       |
 1191|  60.5k|    if (cur != q) {
  ------------------
  |  Branch (1191:9): [True: 58.7k, False: 1.82k]
  ------------------
 1192|       |        /*
 1193|       |	 * Handle the last piece of text.
 1194|       |	 */
 1195|  58.7k|	if (xmlBufAdd(buf, q, cur - q))
  ------------------
  |  Branch (1195:6): [True: 5, False: 58.7k]
  ------------------
 1196|      5|	    goto out;
 1197|  58.7k|    }
 1198|       |
 1199|  60.5k|    if (!xmlBufIsEmpty(buf)) {
  ------------------
  |  Branch (1199:9): [True: 59.6k, False: 967]
  ------------------
 1200|  59.6k|	node = xmlNewDocText(doc, NULL);
 1201|  59.6k|	if (node == NULL)
  ------------------
  |  Branch (1201:6): [True: 20, False: 59.5k]
  ------------------
 1202|     20|            goto out;
 1203|  59.5k|        node->parent = (xmlNode *) attr;
 1204|  59.5k|	node->content = xmlBufDetach(buf);
 1205|       |
 1206|  59.5k|	if (last == NULL) {
  ------------------
  |  Branch (1206:6): [True: 58.1k, False: 1.43k]
  ------------------
 1207|  58.1k|	    head = node;
 1208|  58.1k|	} else {
 1209|  1.43k|            last->next = node;
 1210|  1.43k|            node->prev = last;
 1211|  1.43k|	}
 1212|  59.5k|        last = node;
 1213|  59.5k|    } else if (head == NULL) {
  ------------------
  |  Branch (1213:16): [True: 0, False: 967]
  ------------------
 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|  60.5k|    xmlBufFree(buf);
 1222|       |
 1223|  64.1k|done:
 1224|  64.1k|    if (attr != NULL) {
  ------------------
  |  Branch (1224:9): [True: 64.1k, False: 0]
  ------------------
 1225|  64.1k|        if (attr->children != NULL)
  ------------------
  |  Branch (1225:13): [True: 0, False: 64.1k]
  ------------------
 1226|      0|            xmlFreeNodeList(attr->children);
 1227|  64.1k|        attr->children = head;
 1228|  64.1k|        attr->last = last;
 1229|  64.1k|    }
 1230|       |
 1231|  64.1k|    if (listPtr != NULL)
  ------------------
  |  Branch (1231:9): [True: 0, False: 64.1k]
  ------------------
 1232|      0|        *listPtr = head;
 1233|       |
 1234|  64.1k|    return(0);
 1235|       |
 1236|    172|out:
 1237|    172|    xmlBufFree(buf);
 1238|    172|    if (val != NULL)
  ------------------
  |  Branch (1238:9): [True: 128, False: 44]
  ------------------
 1239|    128|        xmlFree(val);
 1240|    172|    if (head != NULL)
  ------------------
  |  Branch (1240:9): [True: 58, False: 114]
  ------------------
 1241|     58|        xmlFreeNodeList(head);
 1242|    172|    return(-1);
 1243|  60.5k|}
xmlNodeListGetStringInternal:
 1297|  1.18k|xmlNodeListGetStringInternal(const xmlNode *node, int escape, int flags) {
 1298|  1.18k|    xmlBufPtr buf;
 1299|  1.18k|    xmlChar *ret;
 1300|       |
 1301|  1.18k|    if (node == NULL)
  ------------------
  |  Branch (1301:9): [True: 0, False: 1.18k]
  ------------------
 1302|      0|        return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1303|       |
 1304|  1.18k|    if ((escape == 0) &&
  ------------------
  |  Branch (1304:9): [True: 1.18k, False: 0]
  ------------------
 1305|  1.18k|        ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1305:10): [True: 836, False: 345]
  ------------------
 1306|    345|         (node->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (1306:10): [True: 0, False: 345]
  ------------------
 1307|    836|        (node->next == NULL)) {
  ------------------
  |  Branch (1307:9): [True: 544, False: 292]
  ------------------
 1308|    544|        if (node->content == NULL)
  ------------------
  |  Branch (1308:13): [True: 0, False: 544]
  ------------------
 1309|      0|            return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 1310|    544|        return(xmlStrdup(node->content));
 1311|    544|    }
 1312|       |
 1313|    637|    buf = xmlBufCreate(50);
 1314|    637|    if (buf == NULL)
  ------------------
  |  Branch (1314:9): [True: 8, False: 629]
  ------------------
 1315|      8|        return(NULL);
 1316|       |
 1317|  1.75k|    while (node != NULL) {
  ------------------
  |  Branch (1317:12): [True: 1.12k, False: 629]
  ------------------
 1318|  1.12k|        if ((node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (1318:13): [True: 400, False: 721]
  ------------------
 1319|    721|            (node->type == XML_CDATA_SECTION_NODE)) {
  ------------------
  |  Branch (1319:13): [True: 0, False: 721]
  ------------------
 1320|    400|            if (node->content != NULL) {
  ------------------
  |  Branch (1320:17): [True: 400, False: 0]
  ------------------
 1321|    400|                if (escape == 0) {
  ------------------
  |  Branch (1321:21): [True: 400, False: 0]
  ------------------
 1322|    400|                    xmlBufCat(buf, node->content);
 1323|    400|                } 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|    400|            }
 1333|    721|        } else if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (1333:20): [True: 721, False: 0]
  ------------------
 1334|    721|            if (escape == 0) {
  ------------------
  |  Branch (1334:17): [True: 721, False: 0]
  ------------------
 1335|    721|                xmlBufGetNodeContent(buf, node);
 1336|    721|            } 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|    721|        }
 1342|       |
 1343|  1.12k|        node = node->next;
 1344|  1.12k|    }
 1345|       |
 1346|    629|    ret = xmlBufDetach(buf);
 1347|    629|    xmlBufFree(buf);
 1348|    629|    return(ret);
 1349|       |
 1350|      0|error:
 1351|      0|    xmlBufFree(buf);
 1352|       |    return(NULL);
 1353|    629|}
xmlNodeListGetString:
 1374|  1.18k|{
 1375|  1.18k|    int flags = 0;
 1376|  1.18k|    int escape = 0;
 1377|       |
 1378|       |    /* backward compatibility */
 1379|  1.18k|    if (list == NULL)
  ------------------
  |  Branch (1379:9): [True: 0, False: 1.18k]
  ------------------
 1380|      0|        return(NULL);
 1381|       |
 1382|  1.18k|    if (!inLine) {
  ------------------
  |  Branch (1382:9): [True: 0, False: 1.18k]
  ------------------
 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.18k|    return(xmlNodeListGetStringInternal(list, escape, flags));
 1396|  1.18k|}
xmlNewNsProp:
 1572|  66.9k|           const xmlChar *value) {
 1573|       |
 1574|  66.9k|    if (name == NULL) {
  ------------------
  |  Branch (1574:9): [True: 0, False: 66.9k]
  ------------------
 1575|      0|	return(NULL);
 1576|      0|    }
 1577|       |
 1578|  66.9k|    return xmlNewPropInternal(node, ns, name, value, 0);
 1579|  66.9k|}
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.31k, False: 1.74M]
  ------------------
 1625|  4.31k|	return(NULL);
 1626|  4.31k|    }
 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: 20, False: 1.74M]
  ------------------
 1633|     20|	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: 238k, False: 1.50M]
  ------------------
 1638|   238k|	cur->name = xmlDictLookup(doc->dict, name, -1);
 1639|  1.50M|    else
 1640|  1.50M|	cur->name = xmlStrdup(name);
 1641|  1.74M|    if (cur->name == NULL)
  ------------------
  |  Branch (1641:9): [True: 14, False: 1.74M]
  ------------------
 1642|     14|        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|     14|error:
 1658|     14|    xmlFreeProp(cur);
 1659|       |    return(NULL);
 1660|  1.74M|}
xmlFreePropList:
 1668|   505k|xmlFreePropList(xmlAttr *cur) {
 1669|   505k|    xmlAttrPtr next;
 1670|   505k|    if (cur == NULL) return;
  ------------------
  |  Branch (1670:9): [True: 1.68k, False: 504k]
  ------------------
 1671|  2.27M|    while (cur != NULL) {
  ------------------
  |  Branch (1671:12): [True: 1.77M, False: 504k]
  ------------------
 1672|  1.77M|        next = cur->next;
 1673|  1.77M|        xmlFreeProp(cur);
 1674|  1.77M|	cur = next;
 1675|  1.77M|    }
 1676|   504k|}
xmlFreeProp:
 1684|  1.77M|xmlFreeProp(xmlAttr *cur) {
 1685|  1.77M|    xmlDictPtr dict = NULL;
 1686|  1.77M|    if (cur == NULL) return;
  ------------------
  |  Branch (1686:9): [True: 0, False: 1.77M]
  ------------------
 1687|       |
 1688|  1.77M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (1688:9): [True: 1.77M, False: 260]
  ------------------
 1689|       |
 1690|  1.77M|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (1690:9): [True: 0, False: 1.77M]
  |  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.77M|    if (cur->doc != NULL && cur->id != NULL) {
  ------------------
  |  Branch (1694:9): [True: 1.77M, False: 260]
  |  Branch (1694:29): [True: 2.24k, False: 1.77M]
  ------------------
 1695|  2.24k|        xmlRemoveID(cur->doc, cur);
 1696|  2.24k|    }
 1697|  1.77M|    if (cur->children != NULL) xmlFreeNodeList(cur->children);
  ------------------
  |  Branch (1697:9): [True: 1.76M, False: 9.50k]
  ------------------
 1698|  1.77M|    DICT_FREE(cur->name)
  ------------------
  |  |  810|  1.77M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 1.77M, False: 50]
  |  |  |  Branch (810:16): [True: 1.61M, False: 160k]
  |  |  ------------------
  |  |  811|  1.77M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 0, False: 160k]
  |  |  ------------------
  |  |  812|  1.77M|	    xmlFree((char *)(str));
  ------------------
 1699|  1.77M|    xmlFree(cur);
 1700|  1.77M|}
xmlNewDocPI:
 1753|   211k|xmlNewDocPI(xmlDoc *doc, const xmlChar *name, const xmlChar *content) {
 1754|   211k|    xmlNodePtr cur;
 1755|       |
 1756|   211k|    if (name == NULL) {
  ------------------
  |  Branch (1756:9): [True: 0, False: 211k]
  ------------------
 1757|      0|	return(NULL);
 1758|      0|    }
 1759|       |
 1760|       |    /*
 1761|       |     * Allocate a new node and fill the fields.
 1762|       |     */
 1763|   211k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1764|   211k|    if (cur == NULL)
  ------------------
  |  Branch (1764:9): [True: 4, False: 211k]
  ------------------
 1765|      4|	return(NULL);
 1766|   211k|    memset(cur, 0, sizeof(xmlNode));
 1767|   211k|    cur->type = XML_PI_NODE;
 1768|   211k|    cur->doc = doc;
 1769|       |
 1770|   211k|    if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1770:9): [True: 211k, False: 0]
  |  Branch (1770:26): [True: 123k, False: 87.4k]
  ------------------
 1771|   123k|        cur->name = xmlDictLookup(doc->dict, name, -1);
 1772|  87.4k|    else
 1773|  87.4k|	cur->name = xmlStrdup(name);
 1774|   211k|    if (cur->name == NULL)
  ------------------
  |  Branch (1774:9): [True: 3, False: 211k]
  ------------------
 1775|      3|        goto error;
 1776|   211k|    if (content != NULL) {
  ------------------
  |  Branch (1776:9): [True: 22.3k, False: 188k]
  ------------------
 1777|  22.3k|	cur->content = xmlStrdup(content);
 1778|  22.3k|        if (cur->content == NULL)
  ------------------
  |  Branch (1778:13): [True: 4, False: 22.2k]
  ------------------
 1779|      4|            goto error;
 1780|  22.3k|    }
 1781|       |
 1782|   211k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1782:9): [True: 0, False: 211k]
  |  Branch (1782:35): [True: 0, False: 0]
  ------------------
 1783|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1784|   211k|    return(cur);
 1785|       |
 1786|      7|error:
 1787|      7|    xmlFreeNode(cur);
 1788|       |    return(NULL);
 1789|   211k|}
xmlNewDocNode:
 1900|   556k|              const xmlChar *name, const xmlChar *content) {
 1901|   556k|    xmlNodePtr cur;
 1902|   556k|    xmlChar *copy;
 1903|       |
 1904|   556k|    if (name == NULL)
  ------------------
  |  Branch (1904:9): [True: 0, False: 556k]
  ------------------
 1905|      0|        return(NULL);
 1906|       |
 1907|   556k|    if ((doc != NULL) && (doc->dict != NULL)) {
  ------------------
  |  Branch (1907:9): [True: 556k, False: 0]
  |  Branch (1907:26): [True: 126k, False: 430k]
  ------------------
 1908|   126k|        const xmlChar *dictName = xmlDictLookup(doc->dict, name, -1);
 1909|       |
 1910|   126k|        if (dictName == NULL)
  ------------------
  |  Branch (1910:13): [True: 1, False: 126k]
  ------------------
 1911|      1|            return(NULL);
 1912|   126k|        return(xmlNewElem(doc, ns, dictName, content));
 1913|   126k|    }
 1914|       |
 1915|   430k|    copy = xmlStrdup(name);
 1916|   430k|    if (copy == NULL)
  ------------------
  |  Branch (1916:9): [True: 35, False: 430k]
  ------------------
 1917|     35|        return(NULL);
 1918|       |
 1919|   430k|    cur = xmlNewElem(doc, ns, copy, content);
 1920|   430k|    if (cur == NULL) {
  ------------------
  |  Branch (1920:9): [True: 39, False: 430k]
  ------------------
 1921|     39|        xmlFree(copy);
 1922|     39|        return(NULL);
 1923|     39|    }
 1924|       |
 1925|   430k|    return(cur);
 1926|   430k|}
xmlNewDocNodeEatName:
 1944|   333k|                     xmlChar *name, const xmlChar *content) {
 1945|   333k|    xmlNodePtr cur;
 1946|       |
 1947|   333k|    if (name == NULL)
  ------------------
  |  Branch (1947:9): [True: 0, False: 333k]
  ------------------
 1948|      0|        return(NULL);
 1949|       |
 1950|   333k|    cur = xmlNewElem(doc, ns, name, content);
 1951|   333k|    if (cur == NULL) {
  ------------------
  |  Branch (1951:9): [True: 38, False: 333k]
  ------------------
 1952|       |        /* if name doesn't come from the doc dictionary free it here */
 1953|     38|        if ((doc == NULL) ||
  ------------------
  |  Branch (1953:13): [True: 0, False: 38]
  ------------------
 1954|     38|            (doc->dict == NULL) ||
  ------------------
  |  Branch (1954:13): [True: 1, False: 37]
  ------------------
 1955|     37|            (!xmlDictOwns(doc->dict, name)))
  ------------------
  |  Branch (1955:13): [True: 0, False: 37]
  ------------------
 1956|      1|            xmlFree(name);
 1957|     38|        return(NULL);
 1958|     38|    }
 1959|       |
 1960|   333k|    return(cur);
 1961|   333k|}
xmlNewText:
 2037|   127k|xmlNewText(const xmlChar *content) {
 2038|   127k|    xmlNodePtr cur;
 2039|       |
 2040|       |    /*
 2041|       |     * Allocate a new node and fill the fields.
 2042|       |     */
 2043|   127k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2044|   127k|    if (cur == NULL)
  ------------------
  |  Branch (2044:9): [True: 45, False: 127k]
  ------------------
 2045|     45|	return(NULL);
 2046|   127k|    memset(cur, 0, sizeof(xmlNode));
 2047|   127k|    cur->type = XML_TEXT_NODE;
 2048|       |
 2049|   127k|    cur->name = xmlStringText;
 2050|   127k|    if (content != NULL) {
  ------------------
  |  Branch (2050:9): [True: 39.1k, False: 88.5k]
  ------------------
 2051|  39.1k|	cur->content = xmlStrdup(content);
 2052|  39.1k|        if (cur->content == NULL)
  ------------------
  |  Branch (2052:13): [True: 24, False: 39.0k]
  ------------------
 2053|     24|            goto error;
 2054|  39.1k|    }
 2055|       |
 2056|   127k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2056:9): [True: 0, False: 127k]
  |  Branch (2056:35): [True: 0, False: 0]
  ------------------
 2057|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2058|   127k|    return(cur);
 2059|       |
 2060|     24|error:
 2061|     24|    xmlFreeNode(cur);
 2062|       |    return(NULL);
 2063|   127k|}
xmlNewReference:
 2209|  26.9k|xmlNewReference(const xmlDoc *doc, const xmlChar *name) {
 2210|  26.9k|    xmlNodePtr cur;
 2211|  26.9k|    xmlEntityPtr ent;
 2212|       |
 2213|  26.9k|    if (name == NULL)
  ------------------
  |  Branch (2213:9): [True: 0, False: 26.9k]
  ------------------
 2214|      0|        return(NULL);
 2215|       |
 2216|       |    /*
 2217|       |     * Allocate a new node and fill the fields.
 2218|       |     */
 2219|  26.9k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2220|  26.9k|    if (cur == NULL)
  ------------------
  |  Branch (2220:9): [True: 6, False: 26.9k]
  ------------------
 2221|      6|	return(NULL);
 2222|  26.9k|    memset(cur, 0, sizeof(xmlNode));
 2223|  26.9k|    cur->type = XML_ENTITY_REF_NODE;
 2224|       |
 2225|  26.9k|    cur->doc = (xmlDoc *)doc;
 2226|  26.9k|    if (name[0] == '&') {
  ------------------
  |  Branch (2226:9): [True: 0, False: 26.9k]
  ------------------
 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.9k|	cur->name = xmlStrdup(name);
 2236|  26.9k|    if (cur->name == NULL)
  ------------------
  |  Branch (2236:9): [True: 5, False: 26.9k]
  ------------------
 2237|      5|        goto error;
 2238|       |
 2239|  26.9k|    ent = xmlGetDocEntity(doc, cur->name);
 2240|  26.9k|    if (ent != NULL) {
  ------------------
  |  Branch (2240:9): [True: 6.09k, False: 20.8k]
  ------------------
 2241|  6.09k|	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.09k|	cur->children = (xmlNodePtr) ent;
 2248|  6.09k|	cur->last = (xmlNodePtr) ent;
 2249|  6.09k|    }
 2250|       |
 2251|  26.9k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2251:9): [True: 0, False: 26.9k]
  |  Branch (2251:35): [True: 0, False: 0]
  ------------------
 2252|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2253|  26.9k|    return(cur);
 2254|       |
 2255|      5|error:
 2256|      5|    xmlFreeNode(cur);
 2257|       |    return(NULL);
 2258|  26.9k|}
xmlNewDocText:
 2269|   127k|xmlNewDocText(const xmlDoc *doc, const xmlChar *content) {
 2270|   127k|    xmlNodePtr cur;
 2271|       |
 2272|   127k|    cur = xmlNewText(content);
 2273|   127k|    if (cur != NULL) cur->doc = (xmlDoc *)doc;
  ------------------
  |  Branch (2273:9): [True: 127k, False: 69]
  ------------------
 2274|   127k|    return(cur);
 2275|   127k|}
xmlNewComment:
 2342|   265k|xmlNewComment(const xmlChar *content) {
 2343|   265k|    xmlNodePtr cur;
 2344|       |
 2345|       |    /*
 2346|       |     * Allocate a new node and fill the fields.
 2347|       |     */
 2348|   265k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2349|   265k|    if (cur == NULL)
  ------------------
  |  Branch (2349:9): [True: 3, False: 265k]
  ------------------
 2350|      3|	return(NULL);
 2351|   265k|    memset(cur, 0, sizeof(xmlNode));
 2352|   265k|    cur->type = XML_COMMENT_NODE;
 2353|       |
 2354|   265k|    cur->name = xmlStringComment;
 2355|   265k|    if (content != NULL) {
  ------------------
  |  Branch (2355:9): [True: 265k, False: 0]
  ------------------
 2356|   265k|	cur->content = xmlStrdup(content);
 2357|   265k|        if (cur->content == NULL)
  ------------------
  |  Branch (2357:13): [True: 6, False: 265k]
  ------------------
 2358|      6|            goto error;
 2359|   265k|    }
 2360|       |
 2361|   265k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2361:9): [True: 0, False: 265k]
  |  Branch (2361:35): [True: 0, False: 0]
  ------------------
 2362|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2363|   265k|    return(cur);
 2364|       |
 2365|      6|error:
 2366|      6|    xmlFreeNode(cur);
 2367|       |    return(NULL);
 2368|   265k|}
xmlNewCDataBlock:
 2380|  93.3k|xmlNewCDataBlock(xmlDoc *doc, const xmlChar *content, int len) {
 2381|  93.3k|    xmlNodePtr cur;
 2382|       |
 2383|       |    /*
 2384|       |     * Allocate a new node and fill the fields.
 2385|       |     */
 2386|  93.3k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2387|  93.3k|    if (cur == NULL)
  ------------------
  |  Branch (2387:9): [True: 1, False: 93.3k]
  ------------------
 2388|      1|	return(NULL);
 2389|  93.3k|    memset(cur, 0, sizeof(xmlNode));
 2390|  93.3k|    cur->type = XML_CDATA_SECTION_NODE;
 2391|  93.3k|    cur->doc = doc;
 2392|       |
 2393|  93.3k|    if (content != NULL) {
  ------------------
  |  Branch (2393:9): [True: 93.3k, False: 0]
  ------------------
 2394|  93.3k|	cur->content = xmlStrndup(content, len);
 2395|  93.3k|        if (cur->content == NULL) {
  ------------------
  |  Branch (2395:13): [True: 2, False: 93.3k]
  ------------------
 2396|      2|            xmlFree(cur);
 2397|      2|            return(NULL);
 2398|      2|        }
 2399|  93.3k|    }
 2400|       |
 2401|  93.3k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2401:9): [True: 0, False: 93.3k]
  |  Branch (2401:35): [True: 0, False: 0]
  ------------------
 2402|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2403|  93.3k|    return(cur);
 2404|  93.3k|}
xmlNewDocComment:
 2415|   265k|xmlNewDocComment(xmlDoc *doc, const xmlChar *content) {
 2416|   265k|    xmlNodePtr cur;
 2417|       |
 2418|   265k|    cur = xmlNewComment(content);
 2419|   265k|    if (cur != NULL) cur->doc = doc;
  ------------------
  |  Branch (2419:9): [True: 265k, False: 9]
  ------------------
 2420|   265k|    return(cur);
 2421|   265k|}
xmlAddNextSibling:
 2893|  12.3k|xmlAddNextSibling(xmlNode *prev, xmlNode *cur) {
 2894|  12.3k|    if ((prev == NULL) || (prev->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2894:9): [True: 0, False: 12.3k]
  |  Branch (2894:27): [True: 0, False: 12.3k]
  ------------------
 2895|  12.3k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2895:9): [True: 0, False: 12.3k]
  |  Branch (2895:26): [True: 0, False: 12.3k]
  ------------------
 2896|  12.3k|        (cur == prev))
  ------------------
  |  Branch (2896:9): [True: 0, False: 12.3k]
  ------------------
 2897|      0|	return(NULL);
 2898|       |
 2899|  12.3k|    if (cur == prev->next)
  ------------------
  |  Branch (2899:9): [True: 0, False: 12.3k]
  ------------------
 2900|      0|        return(cur);
 2901|       |
 2902|  12.3k|    return(xmlInsertNode(prev->doc, cur, prev->parent, prev, prev->next, 0));
 2903|  12.3k|}
xmlAddPrevSibling:
 2922|   214k|xmlAddPrevSibling(xmlNode *next, xmlNode *cur) {
 2923|   214k|    if ((next == NULL) || (next->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2923:9): [True: 0, False: 214k]
  |  Branch (2923:27): [True: 0, False: 214k]
  ------------------
 2924|   214k|        (cur == NULL) || (cur->type == XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2924:9): [True: 0, False: 214k]
  |  Branch (2924:26): [True: 0, False: 214k]
  ------------------
 2925|   214k|        (cur == next))
  ------------------
  |  Branch (2925:9): [True: 0, False: 214k]
  ------------------
 2926|      0|	return(NULL);
 2927|       |
 2928|   214k|    if (cur == next->prev)
  ------------------
  |  Branch (2928:9): [True: 0, False: 214k]
  ------------------
 2929|      0|        return(cur);
 2930|       |
 2931|   214k|    return(xmlInsertNode(next->doc, cur, next->parent, next->prev, next, 0));
 2932|   214k|}
xmlGetLastChild:
 3141|  11.8k|xmlGetLastChild(const xmlNode *parent) {
 3142|  11.8k|    if ((parent == NULL) || (parent->type == XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (3142:9): [True: 0, False: 11.8k]
  |  Branch (3142:29): [True: 0, False: 11.8k]
  ------------------
 3143|      0|	return(NULL);
 3144|      0|    }
 3145|  11.8k|    return(parent->last);
 3146|  11.8k|}
xmlFreeNodeList:
 3328|  1.79M|xmlFreeNodeList(xmlNode *cur) {
 3329|  1.79M|    xmlNodePtr next;
 3330|  1.79M|    xmlNodePtr parent;
 3331|  1.79M|    xmlDictPtr dict = NULL;
 3332|  1.79M|    size_t depth = 0;
 3333|       |
 3334|  1.79M|    if (cur == NULL) return;
  ------------------
  |  Branch (3334:9): [True: 8.70k, False: 1.79M]
  ------------------
 3335|  1.79M|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3335:9): [True: 0, False: 1.79M]
  ------------------
 3336|      0|	xmlFreeNsList((xmlNsPtr) cur);
 3337|      0|	return;
 3338|      0|    }
 3339|  1.79M|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3339:9): [True: 1.79M, False: 958]
  ------------------
 3340|  12.4M|    while (1) {
  ------------------
  |  Branch (3340:12): [True: 12.4M, Folded]
  ------------------
 3341|  16.6M|        while ((cur->children != NULL) &&
  ------------------
  |  Branch (3341:16): [True: 4.19M, False: 12.4M]
  ------------------
 3342|  4.19M|               (cur->type != XML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3342:16): [True: 4.19M, False: 0]
  ------------------
 3343|  4.19M|               (cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (3343:16): [True: 4.19M, False: 0]
  ------------------
 3344|  4.19M|               (cur->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (3344:16): [True: 4.19M, False: 0]
  ------------------
 3345|  4.19M|               (cur->type != XML_ENTITY_REF_NODE)) {
  ------------------
  |  Branch (3345:16): [True: 4.19M, False: 5.85k]
  ------------------
 3346|  4.19M|            cur = cur->children;
 3347|  4.19M|            depth += 1;
 3348|  4.19M|        }
 3349|       |
 3350|  12.4M|        next = cur->next;
 3351|  12.4M|        parent = cur->parent;
 3352|  12.4M|	if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (3352:6): [True: 0, False: 12.4M]
  ------------------
 3353|  12.4M|            (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (3353:13): [True: 0, False: 12.4M]
  ------------------
 3354|      0|            xmlFreeDoc((xmlDocPtr) cur);
 3355|  12.4M|        } else if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3355:20): [True: 0, False: 12.4M]
  ------------------
 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|  12.4M|        } else {
 3363|  12.4M|	    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3363:10): [True: 0, False: 12.4M]
  |  Branch (3363:36): [True: 0, False: 0]
  ------------------
 3364|      0|		xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3365|       |
 3366|  12.4M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3366:11): [True: 4.88M, False: 7.54M]
  ------------------
 3367|  7.54M|		 (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3367:4): [True: 4.20k, False: 7.54M]
  ------------------
 3368|  7.54M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3368:4): [True: 1.71M, False: 5.82M]
  ------------------
 3369|  6.60M|		(cur->properties != NULL))
  ------------------
  |  Branch (3369:3): [True: 495k, False: 6.11M]
  ------------------
 3370|   495k|		xmlFreePropList(cur->properties);
 3371|  12.4M|	    if ((cur->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3371:10): [True: 7.54M, False: 4.88M]
  ------------------
 3372|  7.54M|		(cur->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (3372:3): [True: 7.54M, False: 4.20k]
  ------------------
 3373|  7.54M|		(cur->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3373:3): [True: 5.82M, False: 1.71M]
  ------------------
 3374|  5.82M|		(cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3374:3): [True: 5.79M, False: 36.3k]
  ------------------
 3375|  5.79M|		(cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3375:3): [True: 5.57M, False: 216k]
  ------------------
 3376|  5.57M|		DICT_FREE(cur->content)
  ------------------
  |  |  810|  5.57M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 5.16M, False: 407k]
  |  |  |  Branch (810:16): [True: 2.78M, False: 2.38M]
  |  |  ------------------
  |  |  811|  5.16M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 2.38M, False: 468]
  |  |  ------------------
  |  |  812|  5.57M|	    xmlFree((char *)(str));
  ------------------
 3377|  5.57M|	    }
 3378|  12.4M|	    if (((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3378:11): [True: 4.88M, False: 7.54M]
  ------------------
 3379|  7.54M|	         (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3379:11): [True: 4.20k, False: 7.54M]
  ------------------
 3380|  7.54M|		 (cur->type == XML_XINCLUDE_END)) &&
  ------------------
  |  Branch (3380:4): [True: 1.71M, False: 5.82M]
  ------------------
 3381|  6.60M|		(cur->nsDef != NULL))
  ------------------
  |  Branch (3381:3): [True: 2.34M, False: 4.26M]
  ------------------
 3382|  2.34M|		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|  12.4M|	    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3390:10): [True: 12.1M, False: 244k]
  ------------------
 3391|  12.1M|		(cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3391:3): [True: 7.14M, False: 5.04M]
  ------------------
 3392|  7.14M|		(cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3392:3): [True: 7.05M, False: 90.8k]
  ------------------
 3393|  7.05M|		DICT_FREE(cur->name)
  ------------------
  |  |  810|  7.05M|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 7.05M, False: 0]
  |  |  |  Branch (810:16): [True: 1.31M, False: 5.73M]
  |  |  ------------------
  |  |  811|  7.05M|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 18.2k, False: 5.72M]
  |  |  ------------------
  |  |  812|  7.05M|	    xmlFree((char *)(str));
  ------------------
 3394|  12.4M|	    xmlFree(cur);
 3395|  12.4M|	}
 3396|       |
 3397|  12.4M|        if (next != NULL) {
  ------------------
  |  Branch (3397:13): [True: 6.44M, False: 5.98M]
  ------------------
 3398|  6.44M|	    cur = next;
 3399|  6.44M|        } else {
 3400|  5.98M|            if ((depth == 0) || (parent == NULL))
  ------------------
  |  Branch (3400:17): [True: 1.79M, False: 4.19M]
  |  Branch (3400:33): [True: 0, False: 4.19M]
  ------------------
 3401|  1.79M|                break;
 3402|  4.19M|            depth -= 1;
 3403|  4.19M|            cur = parent;
 3404|       |            cur->children = NULL;
 3405|  4.19M|        }
 3406|  12.4M|    }
 3407|  1.79M|}
xmlFreeNode:
 3418|   204k|xmlFreeNode(xmlNode *cur) {
 3419|   204k|    xmlDictPtr dict = NULL;
 3420|       |
 3421|   204k|    if (cur == NULL) return;
  ------------------
  |  Branch (3421:9): [True: 102, False: 204k]
  ------------------
 3422|       |
 3423|       |    /* use xmlFreeDtd for DTD nodes */
 3424|   204k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3424:9): [True: 8.34k, False: 196k]
  ------------------
 3425|  8.34k|	xmlFreeDtd((xmlDtdPtr) cur);
 3426|  8.34k|	return;
 3427|  8.34k|    }
 3428|   196k|    if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (3428:9): [True: 0, False: 196k]
  ------------------
 3429|      0|	xmlFreeNs((xmlNsPtr) cur);
 3430|      0|        return;
 3431|      0|    }
 3432|   196k|    if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3432:9): [True: 0, False: 196k]
  ------------------
 3433|      0|	xmlFreeProp((xmlAttrPtr) cur);
 3434|      0|	return;
 3435|      0|    }
 3436|   196k|    if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (3436:9): [True: 0, False: 196k]
  ------------------
 3437|      0|        xmlFreeEntity((xmlEntityPtr) cur);
 3438|      0|        return;
 3439|      0|    }
 3440|       |
 3441|   196k|    if ((xmlRegisterCallbacks) && (xmlDeregisterNodeDefaultValue))
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
  |  Branch (3441:9): [True: 0, False: 196k]
  |  Branch (3441:35): [True: 0, False: 0]
  ------------------
 3442|      0|	xmlDeregisterNodeDefaultValue(cur);
  ------------------
  |  |  934|      0|    (*__xmlDeregisterNodeDefaultValue())
  ------------------
 3443|       |
 3444|   196k|    if (cur->doc != NULL) dict = cur->doc->dict;
  ------------------
  |  Branch (3444:9): [True: 196k, False: 198]
  ------------------
 3445|       |
 3446|   196k|    if ((cur->children != NULL) &&
  ------------------
  |  Branch (3446:9): [True: 10.0k, False: 186k]
  ------------------
 3447|  10.0k|	(cur->type != XML_ENTITY_REF_NODE))
  ------------------
  |  Branch (3447:2): [True: 9.54k, False: 501]
  ------------------
 3448|  9.54k|	xmlFreeNodeList(cur->children);
 3449|       |
 3450|   196k|    if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3450:9): [True: 33.1k, False: 163k]
  ------------------
 3451|   163k|        (cur->type == XML_XINCLUDE_START) ||
  ------------------
  |  Branch (3451:9): [True: 1.02k, False: 162k]
  ------------------
 3452|   162k|        (cur->type == XML_XINCLUDE_END)) {
  ------------------
  |  Branch (3452:9): [True: 266, False: 161k]
  ------------------
 3453|  34.4k|        if (cur->properties != NULL)
  ------------------
  |  Branch (3453:13): [True: 5.57k, False: 28.8k]
  ------------------
 3454|  5.57k|            xmlFreePropList(cur->properties);
 3455|  34.4k|        if (cur->nsDef != NULL)
  ------------------
  |  Branch (3455:13): [True: 7.93k, False: 26.5k]
  ------------------
 3456|  7.93k|            xmlFreeNsList(cur->nsDef);
 3457|   161k|    } else if ((cur->content != NULL) &&
  ------------------
  |  Branch (3457:16): [True: 158k, False: 3.61k]
  ------------------
 3458|   158k|               (cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3458:16): [True: 158k, False: 268]
  ------------------
 3459|   158k|               (cur->content != (xmlChar *) &(cur->properties))) {
  ------------------
  |  Branch (3459:16): [True: 157k, False: 872]
  ------------------
 3460|   157k|        DICT_FREE(cur->content)
  ------------------
  |  |  810|   157k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 157k, False: 0]
  |  |  |  Branch (810:16): [True: 47.0k, False: 110k]
  |  |  ------------------
  |  |  811|   157k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 110k, False: 66]
  |  |  ------------------
  |  |  812|   157k|	    xmlFree((char *)(str));
  ------------------
 3461|   157k|    }
 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|   196k|    if ((cur->name != NULL) &&
  ------------------
  |  Branch (3468:9): [True: 195k, False: 794]
  ------------------
 3469|   195k|        (cur->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (3469:9): [True: 182k, False: 13.4k]
  ------------------
 3470|   182k|        (cur->type != XML_COMMENT_NODE))
  ------------------
  |  Branch (3470:9): [True: 52.6k, False: 129k]
  ------------------
 3471|  52.6k|	DICT_FREE(cur->name)
  ------------------
  |  |  810|  52.6k|	if ((str) && ((!dict) ||				\
  |  |  ------------------
  |  |  |  Branch (810:6): [True: 52.6k, False: 0]
  |  |  |  Branch (810:16): [True: 24.1k, False: 28.5k]
  |  |  ------------------
  |  |  811|  52.6k|	    (xmlDictOwns(dict, (const xmlChar *)(str)) == 0)))	\
  |  |  ------------------
  |  |  |  Branch (811:6): [True: 230, False: 28.2k]
  |  |  ------------------
  |  |  812|  52.6k|	    xmlFree((char *)(str));
  ------------------
 3472|       |
 3473|   196k|    xmlFree(cur);
 3474|   196k|}
xmlUnlinkNode:
 3518|   260k|xmlUnlinkNode(xmlNode *cur) {
 3519|   260k|    if (cur == NULL)
  ------------------
  |  Branch (3519:9): [True: 0, False: 260k]
  ------------------
 3520|      0|	return;
 3521|       |
 3522|   260k|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (3522:9): [True: 0, False: 260k]
  ------------------
 3523|      0|        return;
 3524|       |
 3525|   260k|    if (cur->type == XML_DTD_NODE) {
  ------------------
  |  Branch (3525:9): [True: 17.2k, False: 243k]
  ------------------
 3526|  17.2k|	xmlDocPtr doc = cur->doc;
 3527|       |
 3528|  17.2k|	if (doc != NULL) {
  ------------------
  |  Branch (3528:6): [True: 17.2k, False: 0]
  ------------------
 3529|  17.2k|	    if (doc->intSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3529:10): [True: 15.7k, False: 1.40k]
  ------------------
 3530|  15.7k|		doc->intSubset = NULL;
 3531|  17.2k|	    if (doc->extSubset == (xmlDtdPtr) cur)
  ------------------
  |  Branch (3531:10): [True: 1.40k, False: 15.7k]
  ------------------
 3532|  1.40k|		doc->extSubset = NULL;
 3533|  17.2k|	}
 3534|  17.2k|    }
 3535|       |
 3536|   260k|    if (cur->type == XML_ENTITY_DECL)
  ------------------
  |  Branch (3536:9): [True: 0, False: 260k]
  ------------------
 3537|      0|        xmlRemoveEntity((xmlEntityPtr) cur);
 3538|       |
 3539|   260k|    xmlUnlinkNodeInternal(cur);
 3540|   260k|}
xmlCopyNamespace:
 3616|  7.35M|xmlCopyNamespace(xmlNs *cur) {
 3617|  7.35M|    xmlNsPtr ret;
 3618|       |
 3619|  7.35M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (3619:9): [True: 0, False: 7.35M]
  ------------------
 3620|  7.35M|    switch (cur->type) {
 3621|  7.35M|	case XML_LOCAL_NAMESPACE:
  ------------------
  |  |  500|  7.35M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (3621:2): [True: 7.35M, False: 0]
  ------------------
 3622|  7.35M|	    ret = xmlNewNs(NULL, cur->href, cur->prefix);
 3623|  7.35M|	    break;
 3624|      0|	default:
  ------------------
  |  Branch (3624:2): [True: 0, False: 7.35M]
  ------------------
 3625|      0|	    return(NULL);
 3626|  7.35M|    }
 3627|  7.35M|    return(ret);
 3628|  7.35M|}
xmlCopyNamespaceList:
 3638|  5.71M|xmlCopyNamespaceList(xmlNs *cur) {
 3639|  5.71M|    xmlNsPtr ret = NULL;
 3640|  5.71M|    xmlNsPtr p = NULL,q;
 3641|       |
 3642|  13.0M|    while (cur != NULL) {
  ------------------
  |  Branch (3642:12): [True: 7.35M, False: 5.71M]
  ------------------
 3643|  7.35M|        q = xmlCopyNamespace(cur);
 3644|  7.35M|        if (q == NULL) {
  ------------------
  |  Branch (3644:13): [True: 50, False: 7.35M]
  ------------------
 3645|     50|            xmlFreeNsList(ret);
 3646|     50|            return(NULL);
 3647|     50|        }
 3648|  7.35M|	if (p == NULL) {
  ------------------
  |  Branch (3648:6): [True: 5.71M, False: 1.63M]
  ------------------
 3649|  5.71M|	    ret = p = q;
 3650|  5.71M|	} else {
 3651|  1.63M|	    p->next = q;
 3652|  1.63M|	    p = q;
 3653|  1.63M|	}
 3654|  7.35M|	cur = cur->next;
 3655|  7.35M|    }
 3656|  5.71M|    return(ret);
 3657|  5.71M|}
xmlCopyProp:
 3792|  1.74M|xmlCopyProp(xmlNode *target, xmlAttr *cur) {
 3793|       |	return xmlCopyPropInternal(NULL, target, cur);
 3794|  1.74M|}
xmlCopyPropList:
 3807|   574k|xmlCopyPropList(xmlNode *target, xmlAttr *cur) {
 3808|   574k|    xmlAttrPtr ret = NULL;
 3809|   574k|    xmlAttrPtr p = NULL,q;
 3810|       |
 3811|   574k|    if ((target != NULL) && (target->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (3811:9): [True: 574k, False: 0]
  |  Branch (3811:29): [True: 0, False: 574k]
  ------------------
 3812|      0|        return(NULL);
 3813|  2.31M|    while (cur != NULL) {
  ------------------
  |  Branch (3813:12): [True: 1.74M, False: 570k]
  ------------------
 3814|  1.74M|        q = xmlCopyProp(target, cur);
 3815|  1.74M|	if (q == NULL) {
  ------------------
  |  Branch (3815:6): [True: 4.40k, False: 1.74M]
  ------------------
 3816|  4.40k|            xmlFreePropList(ret);
 3817|  4.40k|	    return(NULL);
 3818|  4.40k|        }
 3819|  1.74M|	if (p == NULL) {
  ------------------
  |  Branch (3819:6): [True: 572k, False: 1.17M]
  ------------------
 3820|   572k|	    ret = p = q;
 3821|  1.17M|	} else {
 3822|  1.17M|	    p->next = q;
 3823|  1.17M|	    q->prev = p;
 3824|  1.17M|	    p = q;
 3825|  1.17M|	}
 3826|  1.74M|	cur = cur->next;
 3827|  1.74M|    }
 3828|   570k|    return(ret);
 3829|   574k|}
xmlStaticCopyNode:
 3861|  25.0M|                  int extended) {
 3862|  25.0M|    xmlNodePtr ret;
 3863|       |
 3864|  25.0M|    if (node == NULL) return(NULL);
  ------------------
  |  Branch (3864:9): [True: 0, False: 25.0M]
  ------------------
 3865|  25.0M|    switch (node->type) {
 3866|  7.90M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (3866:9): [True: 7.90M, False: 17.1M]
  ------------------
 3867|  8.06M|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (3867:9): [True: 157k, False: 24.8M]
  ------------------
 3868|  19.4M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (3868:9): [True: 11.4M, False: 13.6M]
  ------------------
 3869|  19.4M|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (3869:9): [True: 0, False: 25.0M]
  ------------------
 3870|  19.5M|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (3870:9): [True: 3.18k, False: 25.0M]
  ------------------
 3871|  19.7M|        case XML_PI_NODE:
  ------------------
  |  Branch (3871:9): [True: 260k, False: 24.7M]
  ------------------
 3872|  19.7M|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (3872:9): [True: 32.1k, False: 25.0M]
  ------------------
 3873|  19.7M|        case XML_XINCLUDE_START:
  ------------------
  |  Branch (3873:9): [True: 3.47k, False: 25.0M]
  ------------------
 3874|  25.0M|        case XML_XINCLUDE_END:
  ------------------
  |  Branch (3874:9): [True: 5.23M, False: 19.8M]
  ------------------
 3875|  25.0M|	    break;
 3876|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (3876:9): [True: 0, False: 25.0M]
  ------------------
 3877|      0|		return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
 3878|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (3878:9): [True: 0, False: 25.0M]
  ------------------
 3879|      0|	    return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
 3880|  8.66k|        case XML_DTD_NODE:
  ------------------
  |  Branch (3880:9): [True: 8.66k, False: 25.0M]
  ------------------
 3881|  8.66k|            return((xmlNodePtr) xmlCopyDtd((xmlDtdPtr) node));
 3882|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (3882:9): [True: 0, False: 25.0M]
  ------------------
 3883|      0|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (3883:9): [True: 0, False: 25.0M]
  ------------------
 3884|      0|	    return((xmlNodePtr) xmlCopyDoc((xmlDocPtr) node, extended));
 3885|      0|        default:
  ------------------
  |  Branch (3885:9): [True: 0, False: 25.0M]
  ------------------
 3886|      0|            return(NULL);
 3887|  25.0M|    }
 3888|       |
 3889|       |    /*
 3890|       |     * Allocate a new node and fill the fields.
 3891|       |     */
 3892|  25.0M|    ret = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 3893|  25.0M|    if (ret == NULL)
  ------------------
  |  Branch (3893:9): [True: 186, False: 25.0M]
  ------------------
 3894|    186|	return(NULL);
 3895|  25.0M|    memset(ret, 0, sizeof(xmlNode));
 3896|  25.0M|    ret->type = node->type;
 3897|       |
 3898|  25.0M|    ret->doc = doc;
 3899|  25.0M|    ret->parent = parent;
 3900|  25.0M|    if (node->name == xmlStringText)
  ------------------
  |  Branch (3900:9): [True: 7.90M, False: 17.1M]
  ------------------
 3901|  7.90M|	ret->name = xmlStringText;
 3902|  17.1M|    else if (node->name == xmlStringTextNoenc)
  ------------------
  |  Branch (3902:14): [True: 0, False: 17.1M]
  ------------------
 3903|      0|	ret->name = xmlStringTextNoenc;
 3904|  17.1M|    else if (node->name == xmlStringComment)
  ------------------
  |  Branch (3904:14): [True: 32.0k, False: 17.0M]
  ------------------
 3905|  32.0k|	ret->name = xmlStringComment;
 3906|  17.0M|    else if (node->name != NULL) {
  ------------------
  |  Branch (3906:14): [True: 16.9M, False: 157k]
  ------------------
 3907|  16.9M|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (3907:13): [True: 16.9M, False: 2.03k]
  |  Branch (3907:30): [True: 15.9M, False: 960k]
  ------------------
 3908|  15.9M|	    ret->name = xmlDictLookup(doc->dict, node->name, -1);
 3909|   962k|	else
 3910|   962k|	    ret->name = xmlStrdup(node->name);
 3911|  16.9M|        if (ret->name == NULL)
  ------------------
  |  Branch (3911:13): [True: 44, False: 16.9M]
  ------------------
 3912|     44|            goto error;
 3913|  16.9M|    }
 3914|  25.0M|    if ((node->type != XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (3914:9): [True: 13.5M, False: 11.4M]
  ------------------
 3915|  13.5M|	(node->content != NULL) &&
  ------------------
  |  Branch (3915:2): [True: 8.09M, False: 5.50M]
  ------------------
 3916|  8.09M|	(node->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (3916:2): [True: 8.09M, False: 1.42k]
  ------------------
 3917|  8.09M|	(node->type != XML_XINCLUDE_END) &&
  ------------------
  |  Branch (3917:2): [True: 8.09M, False: 0]
  ------------------
 3918|  8.09M|	(node->type != XML_XINCLUDE_START)) {
  ------------------
  |  Branch (3918:2): [True: 8.09M, False: 0]
  ------------------
 3919|  8.09M|	ret->content = xmlStrdup(node->content);
 3920|  8.09M|        if (ret->content == NULL)
  ------------------
  |  Branch (3920:13): [True: 94, False: 8.09M]
  ------------------
 3921|     94|            goto error;
 3922|  16.9M|    }else{
 3923|  16.9M|      if (node->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (3923:11): [True: 11.4M, False: 5.50M]
  ------------------
 3924|  11.4M|        ret->line = node->line;
 3925|  16.9M|    }
 3926|       |
 3927|  25.0M|    if (!extended)
  ------------------
  |  Branch (3927:9): [True: 159, False: 25.0M]
  ------------------
 3928|    159|	goto out;
 3929|  25.0M|    if (((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (3929:10): [True: 11.4M, False: 13.5M]
  ------------------
 3930|  13.5M|         (node->type == XML_XINCLUDE_START)) && (node->nsDef != NULL)) {
  ------------------
  |  Branch (3930:10): [True: 3.47k, False: 13.5M]
  |  Branch (3930:49): [True: 5.71M, False: 5.72M]
  ------------------
 3931|  5.71M|        ret->nsDef = xmlCopyNamespaceList(node->nsDef);
 3932|  5.71M|        if (ret->nsDef == NULL)
  ------------------
  |  Branch (3932:13): [True: 50, False: 5.71M]
  ------------------
 3933|     50|            goto error;
 3934|  5.71M|    }
 3935|       |
 3936|  25.0M|    if ((node->type == XML_ELEMENT_NODE) && (node->ns != NULL)) {
  ------------------
  |  Branch (3936:9): [True: 11.4M, False: 13.5M]
  |  Branch (3936:45): [True: 632k, False: 10.8M]
  ------------------
 3937|   632k|        xmlNsPtr ns = NULL;
 3938|   632k|        int res;
 3939|       |
 3940|   632k|	res = xmlSearchNsSafe(ret, node->ns->prefix, &ns);
 3941|   632k|        if (res < 0)
  ------------------
  |  Branch (3941:13): [True: 2, False: 632k]
  ------------------
 3942|      2|            goto error;
 3943|   632k|	if (ns == NULL) {
  ------------------
  |  Branch (3943:6): [True: 1.97k, False: 630k]
  ------------------
 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.97k|	    res = xmlSearchNsSafe(node, node->ns->prefix, &ns);
 3953|  1.97k|            if (res < 0)
  ------------------
  |  Branch (3953:17): [True: 0, False: 1.97k]
  ------------------
 3954|      0|                goto error;
 3955|  1.97k|	    if (ns != NULL) {
  ------------------
  |  Branch (3955:10): [True: 1.97k, False: 0]
  ------------------
 3956|  1.97k|	        xmlNodePtr root = ret;
 3957|       |
 3958|  10.7k|		while (root->parent != NULL) root = root->parent;
  ------------------
  |  Branch (3958:10): [True: 8.75k, False: 1.97k]
  ------------------
 3959|  1.97k|		ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3960|  1.97k|            } else {
 3961|      0|                ret->ns = xmlNewReconciledNs(ret, node->ns);
 3962|      0|	    }
 3963|  1.97k|            if (ret->ns == NULL)
  ------------------
  |  Branch (3963:17): [True: 1, False: 1.97k]
  ------------------
 3964|      1|                goto error;
 3965|   630k|	} else {
 3966|       |	    /*
 3967|       |	     * reference the existing namespace definition in our own tree.
 3968|       |	     */
 3969|   630k|	    ret->ns = ns;
 3970|   630k|	}
 3971|   632k|    }
 3972|  25.0M|    if ((node->type == XML_ELEMENT_NODE) && (node->properties != NULL)) {
  ------------------
  |  Branch (3972:9): [True: 11.4M, False: 13.5M]
  |  Branch (3972:45): [True: 574k, False: 10.8M]
  ------------------
 3973|   574k|        ret->properties = xmlCopyPropList(ret, node->properties);
 3974|   574k|        if (ret->properties == NULL)
  ------------------
  |  Branch (3974:13): [True: 4.40k, False: 570k]
  ------------------
 3975|  4.40k|            goto error;
 3976|   574k|    }
 3977|  25.0M|    if (node->type == XML_ENTITY_REF_NODE) {
  ------------------
  |  Branch (3977:9): [True: 3.18k, False: 25.0M]
  ------------------
 3978|  3.18k|	if ((doc == NULL) || (node->doc != doc)) {
  ------------------
  |  Branch (3978:6): [True: 766, False: 2.41k]
  |  Branch (3978:23): [True: 100, False: 2.31k]
  ------------------
 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|    866|	    ret->children = (xmlNodePtr) xmlGetDocEntity(doc, ret->name);
 3986|  2.31k|	} else {
 3987|  2.31k|            ret->children = node->children;
 3988|  2.31k|	}
 3989|  3.18k|	ret->last = ret->children;
 3990|  25.0M|    } else if ((node->children != NULL) && (extended != 2)) {
  ------------------
  |  Branch (3990:16): [True: 10.9M, False: 14.0M]
  |  Branch (3990:44): [True: 15.1k, False: 10.9M]
  ------------------
 3991|  15.1k|        xmlNodePtr cur, insert;
 3992|       |
 3993|  15.1k|        cur = node->children;
 3994|  15.1k|        insert = ret;
 3995|  21.5M|        while (cur != NULL) {
  ------------------
  |  Branch (3995:16): [True: 21.5M, False: 11.1k]
  ------------------
 3996|  21.5M|            xmlNodePtr copy = xmlStaticCopyNode(cur, doc, insert, 2);
 3997|  21.5M|            if (copy == NULL)
  ------------------
  |  Branch (3997:17): [True: 3.96k, False: 21.5M]
  ------------------
 3998|  3.96k|                goto error;
 3999|       |
 4000|       |            /* Check for coalesced text nodes */
 4001|  21.5M|            if (insert->last != copy) {
  ------------------
  |  Branch (4001:17): [True: 21.5M, False: 0]
  ------------------
 4002|  21.5M|                if (insert->last == NULL) {
  ------------------
  |  Branch (4002:21): [True: 10.7M, False: 10.8M]
  ------------------
 4003|  10.7M|                    insert->children = copy;
 4004|  10.8M|                } else {
 4005|  10.8M|                    copy->prev = insert->last;
 4006|  10.8M|                    insert->last->next = copy;
 4007|  10.8M|                }
 4008|  21.5M|                insert->last = copy;
 4009|  21.5M|            }
 4010|       |
 4011|  21.5M|            if ((cur->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4011:17): [True: 21.5M, False: 1.47k]
  ------------------
 4012|  21.5M|                (cur->children != NULL)) {
  ------------------
  |  Branch (4012:17): [True: 10.7M, False: 10.8M]
  ------------------
 4013|  10.7M|                cur = cur->children;
 4014|  10.7M|                insert = copy;
 4015|  10.7M|                continue;
 4016|  10.7M|            }
 4017|       |
 4018|  21.2M|            while (1) {
  ------------------
  |  Branch (4018:20): [True: 21.2M, Folded]
  ------------------
 4019|  21.2M|                if (cur->next != NULL) {
  ------------------
  |  Branch (4019:21): [True: 10.8M, False: 10.4M]
  ------------------
 4020|  10.8M|                    cur = cur->next;
 4021|  10.8M|                    break;
 4022|  10.8M|                }
 4023|       |
 4024|  10.4M|                cur = cur->parent;
 4025|  10.4M|                insert = insert->parent;
 4026|  10.4M|                if (cur == node) {
  ------------------
  |  Branch (4026:21): [True: 11.1k, False: 10.4M]
  ------------------
 4027|  11.1k|                    cur = NULL;
 4028|  11.1k|                    break;
 4029|  11.1k|                }
 4030|  10.4M|            }
 4031|  10.8M|        }
 4032|  15.1k|    }
 4033|       |
 4034|  25.0M|out:
 4035|  25.0M|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (4035:9): [True: 0, False: 25.0M]
  |  Branch (4035:35): [True: 0, False: 0]
  ------------------
 4036|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 4037|  25.0M|    return(ret);
 4038|       |
 4039|  8.55k|error:
 4040|  8.55k|    xmlFreeNode(ret);
 4041|       |    return(NULL);
 4042|  25.0M|}
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.47M|    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: 47, False: 1.73M]
  ------------------
 4103|  1.73M|	if (ret == NULL) {
  ------------------
  |  Branch (4103:6): [True: 1.73M, False: 2.74k]
  ------------------
 4104|  1.73M|	    q->prev = NULL;
 4105|  1.73M|	    ret = p = q;
 4106|  1.73M|	} else if (p != q) {
  ------------------
  |  Branch (4106:13): [True: 2.74k, False: 0]
  ------------------
 4107|       |	/* the test is required if xmlStaticCopyNode coalesced 2 text nodes */
 4108|  2.74k|	    p->next = q;
 4109|  2.74k|	    q->prev = p;
 4110|  2.74k|	    p = q;
 4111|  2.74k|	}
 4112|  1.73M|	node = next;
 4113|  1.73M|    }
 4114|  1.73M|    if ((doc != NULL) && (newSubset != NULL))
  ------------------
  |  Branch (4114:9): [True: 1.73M, False: 951]
  |  Branch (4114:26): [True: 0, False: 1.73M]
  ------------------
 4115|      0|        doc->intSubset = newSubset;
 4116|  1.73M|    return(ret);
 4117|     47|error:
 4118|     47|    xmlFreeNodeList(ret);
 4119|     47|    if (newSubset != NULL)
  ------------------
  |  Branch (4119:9): [True: 0, False: 47]
  ------------------
 4120|      0|        xmlFreeDtd(newSubset);
 4121|     47|    if (linkedSubset != 0) {
  ------------------
  |  Branch (4121:9): [True: 0, False: 47]
  ------------------
 4122|      0|        doc->intSubset->next = NULL;
 4123|      0|        doc->intSubset->prev = NULL;
 4124|      0|    }
 4125|       |    return(NULL);
 4126|  1.73M|}
xmlCopyNode:
 4146|    160|xmlCopyNode(xmlNode *node, int extended) {
 4147|    160|    xmlNodePtr ret;
 4148|       |
 4149|    160|    ret = xmlStaticCopyNode(node, NULL, NULL, extended);
 4150|    160|    return(ret);
 4151|    160|}
xmlDocCopyNode:
 4170|   108k|xmlDocCopyNode(xmlNode *node, xmlDoc *doc, int extended) {
 4171|   108k|    xmlNodePtr ret;
 4172|       |
 4173|       |    ret = xmlStaticCopyNode(node, doc, NULL, extended);
 4174|   108k|    return(ret);
 4175|   108k|}
xmlCopyDtd:
 4211|  8.66k|xmlCopyDtd(xmlDtd *dtd) {
 4212|  8.66k|    xmlDtdPtr ret;
 4213|  8.66k|    xmlNodePtr cur, p = NULL, q;
 4214|       |
 4215|  8.66k|    if (dtd == NULL) return(NULL);
  ------------------
  |  Branch (4215:9): [True: 0, False: 8.66k]
  ------------------
 4216|  8.66k|    ret = xmlNewDtd(NULL, dtd->name, dtd->ExternalID, dtd->SystemID);
 4217|  8.66k|    if (ret == NULL) return(NULL);
  ------------------
  |  Branch (4217:9): [True: 21, False: 8.63k]
  ------------------
 4218|  8.63k|    if (dtd->entities != NULL) {
  ------------------
  |  Branch (4218:9): [True: 1.82k, False: 6.81k]
  ------------------
 4219|  1.82k|        ret->entities = (void *) xmlCopyEntitiesTable(
 4220|  1.82k|	                    (xmlEntitiesTablePtr) dtd->entities);
 4221|  1.82k|        if (ret->entities == NULL)
  ------------------
  |  Branch (4221:13): [True: 47, False: 1.77k]
  ------------------
 4222|     47|            goto error;
 4223|  1.82k|    }
 4224|  8.59k|    if (dtd->notations != NULL) {
  ------------------
  |  Branch (4224:9): [True: 1.28k, False: 7.30k]
  ------------------
 4225|  1.28k|        ret->notations = (void *) xmlCopyNotationTable(
 4226|  1.28k|	                    (xmlNotationTablePtr) dtd->notations);
 4227|  1.28k|        if (ret->notations == NULL)
  ------------------
  |  Branch (4227:13): [True: 19, False: 1.26k]
  ------------------
 4228|     19|            goto error;
 4229|  1.28k|    }
 4230|  8.57k|    if (dtd->elements != NULL) {
  ------------------
  |  Branch (4230:9): [True: 6.15k, False: 2.42k]
  ------------------
 4231|  6.15k|        ret->elements = (void *) xmlCopyElementTable(
 4232|  6.15k|	                    (xmlElementTablePtr) dtd->elements);
 4233|  6.15k|        if (ret->elements == NULL)
  ------------------
  |  Branch (4233:13): [True: 114, False: 6.03k]
  ------------------
 4234|    114|            goto error;
 4235|  6.15k|    }
 4236|  8.45k|    if (dtd->attributes != NULL) {
  ------------------
  |  Branch (4236:9): [True: 3.84k, False: 4.61k]
  ------------------
 4237|  3.84k|        ret->attributes = (void *) xmlCopyAttributeTable(
 4238|  3.84k|	                    (xmlAttributeTablePtr) dtd->attributes);
 4239|  3.84k|        if (ret->attributes == NULL)
  ------------------
  |  Branch (4239:13): [True: 100, False: 3.74k]
  ------------------
 4240|    100|            goto error;
 4241|  3.84k|    }
 4242|  8.35k|    if (dtd->pentities != NULL) {
  ------------------
  |  Branch (4242:9): [True: 416, False: 7.94k]
  ------------------
 4243|    416|	ret->pentities = (void *) xmlCopyEntitiesTable(
 4244|    416|			    (xmlEntitiesTablePtr) dtd->pentities);
 4245|    416|        if (ret->pentities == NULL)
  ------------------
  |  Branch (4245:13): [True: 10, False: 406]
  ------------------
 4246|     10|            goto error;
 4247|    416|    }
 4248|       |
 4249|  8.34k|    cur = dtd->children;
 4250|  24.4k|    while (cur != NULL) {
  ------------------
  |  Branch (4250:12): [True: 16.0k, False: 8.34k]
  ------------------
 4251|  16.0k|	q = NULL;
 4252|       |
 4253|  16.0k|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (4253:6): [True: 3.09k, False: 12.9k]
  ------------------
 4254|  3.09k|	    xmlEntityPtr tmp = (xmlEntityPtr) cur;
 4255|  3.09k|	    switch (tmp->etype) {
  ------------------
  |  Branch (4255:14): [True: 3.09k, False: 0]
  ------------------
 4256|  1.29k|		case XML_INTERNAL_GENERAL_ENTITY:
  ------------------
  |  Branch (4256:3): [True: 1.29k, False: 1.80k]
  ------------------
 4257|  2.32k|		case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
  ------------------
  |  Branch (4257:3): [True: 1.03k, False: 2.05k]
  ------------------
 4258|  2.68k|		case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
  ------------------
  |  Branch (4258:3): [True: 355, False: 2.73k]
  ------------------
 4259|  2.68k|		    q = (xmlNodePtr) xmlGetEntityFromDtd(ret, tmp->name);
 4260|  2.68k|		    break;
 4261|    343|		case XML_INTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4261:3): [True: 343, False: 2.75k]
  ------------------
 4262|    410|		case XML_EXTERNAL_PARAMETER_ENTITY:
  ------------------
  |  Branch (4262:3): [True: 67, False: 3.02k]
  ------------------
 4263|    410|		    q = (xmlNodePtr)
 4264|    410|			xmlGetParameterEntityFromDtd(ret, tmp->name);
 4265|    410|		    break;
 4266|      0|		case XML_INTERNAL_PREDEFINED_ENTITY:
  ------------------
  |  Branch (4266:3): [True: 0, False: 3.09k]
  ------------------
 4267|      0|		    break;
 4268|  3.09k|	    }
 4269|  12.9k|	} else if (cur->type == XML_ELEMENT_DECL) {
  ------------------
  |  Branch (4269:13): [True: 5.66k, False: 7.33k]
  ------------------
 4270|  5.66k|	    xmlElementPtr tmp = (xmlElementPtr) cur;
 4271|  5.66k|	    q = (xmlNodePtr)
 4272|  5.66k|		xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
 4273|  7.33k|	} else if (cur->type == XML_ATTRIBUTE_DECL) {
  ------------------
  |  Branch (4273:13): [True: 6.96k, False: 371]
  ------------------
 4274|  6.96k|	    xmlAttributePtr tmp = (xmlAttributePtr) cur;
 4275|  6.96k|	    q = (xmlNodePtr)
 4276|  6.96k|		xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
 4277|  6.96k|	} else if (cur->type == XML_COMMENT_NODE) {
  ------------------
  |  Branch (4277:13): [True: 160, False: 211]
  ------------------
 4278|    160|	    q = xmlCopyNode(cur, 0);
 4279|    160|            if (q == NULL)
  ------------------
  |  Branch (4279:17): [True: 1, False: 159]
  ------------------
 4280|      1|                goto error;
 4281|    160|	}
 4282|       |
 4283|  16.0k|	if (q == NULL) {
  ------------------
  |  Branch (4283:6): [True: 211, False: 15.8k]
  ------------------
 4284|    211|	    cur = cur->next;
 4285|    211|	    continue;
 4286|    211|	}
 4287|       |
 4288|  15.8k|	if (p == NULL)
  ------------------
  |  Branch (4288:6): [True: 7.04k, False: 8.83k]
  ------------------
 4289|  7.04k|	    ret->children = q;
 4290|  8.83k|	else
 4291|  8.83k|	    p->next = q;
 4292|       |
 4293|  15.8k|	q->prev = p;
 4294|  15.8k|	q->parent = (xmlNodePtr) ret;
 4295|  15.8k|	q->next = NULL;
 4296|  15.8k|	ret->last = q;
 4297|  15.8k|	p = q;
 4298|  15.8k|	cur = cur->next;
 4299|  15.8k|    }
 4300|       |
 4301|  8.34k|    return(ret);
 4302|       |
 4303|    291|error:
 4304|    291|    xmlFreeDtd(ret);
 4305|       |    return(NULL);
 4306|  8.34k|}
xmlGetLineNo:
 4446|  27.8k|{
 4447|  27.8k|    return(xmlGetLineNoInternal(node, 0));
 4448|  27.8k|}
xmlDocGetRootElement:
 4674|   250k|xmlDocGetRootElement(const xmlDoc *doc) {
 4675|   250k|    xmlNodePtr ret;
 4676|       |
 4677|   250k|    if (doc == NULL) return(NULL);
  ------------------
  |  Branch (4677:9): [True: 0, False: 250k]
  ------------------
 4678|   250k|    ret = doc->children;
 4679|   339k|    while (ret != NULL) {
  ------------------
  |  Branch (4679:12): [True: 339k, False: 1]
  ------------------
 4680|   339k|	if (ret->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (4680:6): [True: 250k, False: 89.1k]
  ------------------
 4681|   250k|	    return(ret);
 4682|  89.1k|        ret = ret->next;
 4683|  89.1k|    }
 4684|      1|    return(ret);
 4685|   250k|}
xmlNodeGetLang:
 4771|  6.95k|xmlNodeGetLang(const xmlNode *cur) {
 4772|  6.95k|    xmlChar *lang;
 4773|  6.95k|    int res;
 4774|       |
 4775|  6.95k|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4775:9): [True: 0, False: 6.95k]
  |  Branch (4775:26): [True: 0, False: 6.95k]
  ------------------
 4776|      0|        return(NULL);
 4777|       |
 4778|   130k|    while (cur != NULL) {
  ------------------
  |  Branch (4778:12): [True: 123k, False: 6.32k]
  ------------------
 4779|   123k|        res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|   123k|#define BAD_CAST (xmlChar *)
  ------------------
                      res = xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|   123k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4780|   123k|                                  &lang);
 4781|   123k|        if (res < 0)
  ------------------
  |  Branch (4781:13): [True: 3, False: 123k]
  ------------------
 4782|      3|            return(NULL);
 4783|   123k|	if (lang != NULL)
  ------------------
  |  Branch (4783:6): [True: 620, False: 123k]
  ------------------
 4784|    620|	    return(lang);
 4785|       |
 4786|   123k|	cur = cur->parent;
 4787|   123k|    }
 4788|       |
 4789|  6.32k|    return(NULL);
 4790|  6.95k|}
xmlNodeGetSpacePreserve:
 4837|    822|xmlNodeGetSpacePreserve(const xmlNode *cur) {
 4838|    822|    xmlChar *space;
 4839|    822|        int res;
 4840|       |
 4841|    822|    if ((cur == NULL) || (cur->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (4841:9): [True: 0, False: 822]
  |  Branch (4841:26): [True: 822, False: 0]
  ------------------
 4842|    822|        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.64k|xmlNodeSetBase(xmlNode *cur, const xmlChar* uri) {
 4922|  2.64k|    xmlNsPtr ns;
 4923|  2.64k|    xmlChar* fixed;
 4924|       |
 4925|  2.64k|    if (cur == NULL)
  ------------------
  |  Branch (4925:9): [True: 0, False: 2.64k]
  ------------------
 4926|      0|        return(-1);
 4927|  2.64k|    switch(cur->type) {
 4928|  2.64k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4928:9): [True: 2.64k, False: 0]
  ------------------
 4929|  2.64k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4929:9): [True: 0, False: 2.64k]
  ------------------
 4930|  2.64k|	    break;
 4931|      0|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (4931:9): [True: 0, False: 2.64k]
  ------------------
 4932|      0|        case XML_HTML_DOCUMENT_NODE: {
  ------------------
  |  Branch (4932:9): [True: 0, False: 2.64k]
  ------------------
 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.64k]
  ------------------
 4947|      0|	    return(-1);
 4948|  2.64k|    }
 4949|       |
 4950|  2.64k|    xmlSearchNsByHrefSafe(cur, XML_XML_NAMESPACE, &ns);
  ------------------
  |  |  146|  2.64k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4951|  2.64k|    if (ns == NULL)
  ------------------
  |  Branch (4951:9): [True: 2, False: 2.64k]
  ------------------
 4952|      2|	return(-1);
 4953|  2.64k|    fixed = xmlPathToURI(uri);
 4954|  2.64k|    if (fixed == NULL)
  ------------------
  |  Branch (4954:9): [True: 4, False: 2.63k]
  ------------------
 4955|      4|        return(-1);
 4956|  2.63k|    if (xmlSetNsProp(cur, ns, BAD_CAST "base", fixed) == NULL) {
  ------------------
  |  |   34|  2.63k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (4956:9): [True: 17, False: 2.61k]
  ------------------
 4957|     17|        xmlFree(fixed);
 4958|     17|        return(-1);
 4959|     17|    }
 4960|  2.61k|    xmlFree(fixed);
 4961|       |
 4962|  2.61k|    return(0);
 4963|  2.63k|}
xmlNodeGetBaseSafe:
 4982|  90.1k|xmlNodeGetBaseSafe(const xmlDoc *doc, const xmlNode *cur, xmlChar **baseOut) {
 4983|  90.1k|    xmlChar *ret = NULL;
 4984|  90.1k|    xmlChar *base, *newbase;
 4985|  90.1k|    int res;
 4986|       |
 4987|  90.1k|    if (baseOut == NULL)
  ------------------
  |  Branch (4987:9): [True: 0, False: 90.1k]
  ------------------
 4988|      0|        return(1);
 4989|  90.1k|    *baseOut = NULL;
 4990|  90.1k|    if ((cur == NULL) && (doc == NULL))
  ------------------
  |  Branch (4990:9): [True: 0, False: 90.1k]
  |  Branch (4990:26): [True: 0, False: 0]
  ------------------
 4991|      0|        return(1);
 4992|  90.1k|    if ((cur != NULL) && (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (4992:9): [True: 90.1k, False: 0]
  |  Branch (4992:26): [True: 0, False: 90.1k]
  ------------------
 4993|      0|        return(1);
 4994|  90.1k|    if (doc == NULL)
  ------------------
  |  Branch (4994:9): [True: 47.1k, False: 43.0k]
  ------------------
 4995|  47.1k|        doc = cur->doc;
 4996|       |
 4997|  90.1k|    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (4997:9): [True: 90.1k, False: 0]
  |  Branch (4997:26): [True: 0, False: 90.1k]
  ------------------
 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.1M|    while (cur != NULL) {
  ------------------
  |  Branch (5024:12): [True: 11.0M, False: 76.5k]
  ------------------
 5025|  11.0M|	if (cur->type == XML_ENTITY_DECL) {
  ------------------
  |  Branch (5025:6): [True: 256, False: 11.0M]
  ------------------
 5026|    256|	    xmlEntityPtr ent = (xmlEntityPtr) cur;
 5027|       |
 5028|    256|            if (ent->URI == NULL)
  ------------------
  |  Branch (5028:17): [True: 201, False: 55]
  ------------------
 5029|    201|                break;
 5030|     55|            xmlFree(ret);
 5031|     55|	    ret = xmlStrdup(ent->URI);
 5032|     55|            if (ret == NULL)
  ------------------
  |  Branch (5032:17): [True: 1, False: 54]
  ------------------
 5033|      1|                return(-1);
 5034|     54|            goto found;
 5035|     55|	}
 5036|  11.0M|	if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5036:6): [True: 10.9M, False: 78.9k]
  ------------------
 5037|  10.9M|	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  10.9M|#define BAD_CAST (xmlChar *)
  ------------------
              	    if (xmlNodeGetAttrValue(cur, BAD_CAST "base", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  10.9M|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5037:10): [True: 163, False: 10.9M]
  ------------------
 5038|  10.9M|                                    &base) < 0) {
 5039|    163|                xmlFree(ret);
 5040|    163|                return(-1);
 5041|    163|            }
 5042|  10.9M|	    if (base != NULL) {
  ------------------
  |  Branch (5042:10): [True: 251k, False: 10.7M]
  ------------------
 5043|   251k|		if (ret != NULL) {
  ------------------
  |  Branch (5043:7): [True: 202k, False: 48.7k]
  ------------------
 5044|   202k|		    res = xmlBuildURISafe(ret, base, &newbase);
 5045|   202k|                    xmlFree(ret);
 5046|   202k|                    xmlFree(base);
 5047|   202k|                    if (res != 0)
  ------------------
  |  Branch (5047:25): [True: 9.70k, False: 192k]
  ------------------
 5048|  9.70k|                        return(res);
 5049|   192k|		    ret = newbase;
 5050|   192k|		} else {
 5051|  48.7k|		    ret = base;
 5052|  48.7k|		}
 5053|   241k|		if ((!xmlStrncmp(ret, BAD_CAST "http://", 7)) ||
  ------------------
  |  |   34|   241k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5053:7): [True: 959, False: 240k]
  ------------------
 5054|   240k|		    (!xmlStrncmp(ret, BAD_CAST "ftp://", 6)) ||
  ------------------
  |  |   34|   240k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5054:7): [True: 855, False: 239k]
  ------------------
 5055|   239k|		    (!xmlStrncmp(ret, BAD_CAST "urn:", 4)))
  ------------------
  |  |   34|   239k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (5055:7): [True: 1.61k, False: 237k]
  ------------------
 5056|  3.43k|                    goto found;
 5057|   241k|	    }
 5058|  10.9M|	}
 5059|  11.0M|	cur = cur->parent;
 5060|  11.0M|    }
 5061|       |
 5062|  76.7k|    if ((doc != NULL) && (doc->URL != NULL)) {
  ------------------
  |  Branch (5062:9): [True: 76.7k, False: 0]
  |  Branch (5062:26): [True: 24.6k, False: 52.0k]
  ------------------
 5063|  24.6k|	if (ret == NULL) {
  ------------------
  |  Branch (5063:6): [True: 23.3k, False: 1.30k]
  ------------------
 5064|  23.3k|	    ret = xmlStrdup(doc->URL);
 5065|  23.3k|            if (ret == NULL)
  ------------------
  |  Branch (5065:17): [True: 28, False: 23.3k]
  ------------------
 5066|     28|                return(-1);
 5067|  23.3k|        } else {
 5068|  1.30k|            res = xmlBuildURISafe(ret, doc->URL, &newbase);
 5069|  1.30k|            xmlFree(ret);
 5070|  1.30k|            if (res != 0)
  ------------------
  |  Branch (5070:17): [True: 420, False: 880]
  ------------------
 5071|    420|                return(res);
 5072|    880|            ret = newbase;
 5073|    880|        }
 5074|  24.6k|    }
 5075|       |
 5076|  79.8k|found:
 5077|  79.8k|    *baseOut = ret;
 5078|  79.8k|    return(0);
 5079|  76.7k|}
xmlBufGetNodeContent:
 5205|   155k|{
 5206|   155k|    if ((cur == NULL) || (buf == NULL))
  ------------------
  |  Branch (5206:9): [True: 0, False: 155k]
  |  Branch (5206:26): [True: 0, False: 155k]
  ------------------
 5207|      0|        return(-1);
 5208|       |
 5209|   155k|    switch (cur->type) {
 5210|  79.2k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5210:9): [True: 79.2k, False: 76.5k]
  ------------------
 5211|  79.2k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5211:9): [True: 0, False: 155k]
  ------------------
 5212|  79.2k|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5212:9): [True: 0, False: 155k]
  ------------------
 5213|   153k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5213:9): [True: 74.5k, False: 81.1k]
  ------------------
 5214|   153k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (5214:9): [True: 0, False: 155k]
  ------------------
 5215|   153k|            xmlBufGetChildContent(buf, cur, 0);
 5216|   153k|            break;
 5217|  1.24k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5217:9): [True: 1.24k, False: 154k]
  ------------------
 5218|  1.24k|            xmlBufGetChildContent(buf, cur, 1);
 5219|  1.24k|            break;
 5220|       |
 5221|      0|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5221:9): [True: 0, False: 155k]
  ------------------
 5222|      0|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5222:9): [True: 0, False: 155k]
  ------------------
 5223|      0|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5223:9): [True: 0, False: 155k]
  ------------------
 5224|      0|        case XML_PI_NODE:
  ------------------
  |  Branch (5224:9): [True: 0, False: 155k]
  ------------------
 5225|      0|	    xmlBufCat(buf, cur->content);
 5226|      0|            break;
 5227|       |
 5228|    721|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5228:9): [True: 721, False: 155k]
  ------------------
 5229|    721|            xmlBufGetEntityRefContent(buf, cur, 0);
 5230|    721|            break;
 5231|       |
 5232|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5232:9): [True: 0, False: 155k]
  ------------------
 5233|      0|	    xmlBufCat(buf, ((xmlNsPtr) cur)->href);
 5234|      0|	    break;
 5235|       |
 5236|      0|        default:
  ------------------
  |  Branch (5236:9): [True: 0, False: 155k]
  ------------------
 5237|      0|            break;
 5238|   155k|    }
 5239|       |
 5240|   155k|    return(0);
 5241|   155k|}
xmlNodeGetContent:
 5258|   665k|{
 5259|   665k|    xmlBufPtr buf;
 5260|   665k|    xmlChar *ret;
 5261|       |
 5262|   665k|    if (cur == NULL)
  ------------------
  |  Branch (5262:9): [True: 0, False: 665k]
  ------------------
 5263|      0|        return (NULL);
 5264|       |
 5265|   665k|    switch (cur->type) {
 5266|  79.2k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (5266:9): [True: 79.2k, False: 586k]
  ------------------
 5267|  79.2k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (5267:9): [True: 0, False: 665k]
  ------------------
 5268|  79.2k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5268:9): [True: 0, False: 665k]
  ------------------
 5269|  79.2k|            break;
 5270|       |
 5271|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5271:9): [True: 0, False: 665k]
  ------------------
 5272|   271k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5272:9): [True: 271k, False: 394k]
  ------------------
 5273|   560k|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (5273:9): [True: 289k, False: 376k]
  ------------------
 5274|   560k|        case XML_ENTITY_DECL: {
  ------------------
  |  Branch (5274:9): [True: 0, False: 665k]
  ------------------
 5275|   560k|            xmlNodePtr children = cur->children;
 5276|       |
 5277|   560k|            if (children == NULL)
  ------------------
  |  Branch (5277:17): [True: 195k, False: 365k]
  ------------------
 5278|   195k|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|   195k|#define BAD_CAST (xmlChar *)
  ------------------
 5279|       |
 5280|       |            /* Optimization for single text children */
 5281|   365k|            if (((children->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (5281:18): [True: 321k, False: 43.8k]
  ------------------
 5282|  43.8k|                 (children->type == XML_CDATA_SECTION_NODE)) &&
  ------------------
  |  Branch (5282:18): [True: 4.01k, False: 39.8k]
  ------------------
 5283|   325k|                (children->next == NULL)) {
  ------------------
  |  Branch (5283:17): [True: 290k, False: 35.0k]
  ------------------
 5284|   290k|                if (children->content == NULL)
  ------------------
  |  Branch (5284:21): [True: 0, False: 290k]
  ------------------
 5285|      0|                    return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|      0|#define BAD_CAST (xmlChar *)
  ------------------
 5286|   290k|                return(xmlStrdup(children->content));
 5287|   290k|            }
 5288|       |
 5289|  74.9k|            break;
 5290|   365k|        }
 5291|       |
 5292|  74.9k|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5292:9): [True: 1.67k, False: 664k]
  ------------------
 5293|  24.2k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5293:9): [True: 22.5k, False: 643k]
  ------------------
 5294|  24.5k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5294:9): [True: 289, False: 665k]
  ------------------
 5295|  25.0k|        case XML_PI_NODE:
  ------------------
  |  Branch (5295:9): [True: 530, False: 665k]
  ------------------
 5296|  25.0k|            if (cur->content != NULL)
  ------------------
  |  Branch (5296:17): [True: 24.5k, False: 530]
  ------------------
 5297|  24.5k|                return(xmlStrdup(cur->content));
 5298|    530|            else
 5299|    530|                return(xmlStrdup(BAD_CAST ""));
  ------------------
  |  |   34|    530|#define BAD_CAST (xmlChar *)
  ------------------
 5300|       |
 5301|    623|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (5301:9): [True: 623, False: 665k]
  ------------------
 5302|    623|	    return(xmlStrdup(((xmlNsPtr) cur)->href));
 5303|       |
 5304|      0|        default:
  ------------------
  |  Branch (5304:9): [True: 0, False: 665k]
  ------------------
 5305|      0|            return(NULL);
 5306|   665k|    }
 5307|       |
 5308|   154k|    buf = xmlBufCreate(50);
 5309|   154k|    if (buf == NULL)
  ------------------
  |  Branch (5309:9): [True: 69, False: 154k]
  ------------------
 5310|     69|        return (NULL);
 5311|   154k|    xmlBufGetNodeContent(buf, cur);
 5312|   154k|    ret = xmlBufDetach(buf);
 5313|   154k|    xmlBufFree(buf);
 5314|       |
 5315|   154k|    return(ret);
 5316|   154k|}
xmlNodeAddContentLen:
 5419|     55|xmlNodeAddContentLen(xmlNode *cur, const xmlChar *content, int len) {
 5420|     55|    if (cur == NULL)
  ------------------
  |  Branch (5420:9): [True: 0, False: 55]
  ------------------
 5421|      0|	return(1);
 5422|     55|    if ((content == NULL) || (len <= 0))
  ------------------
  |  Branch (5422:9): [True: 0, False: 55]
  |  Branch (5422:30): [True: 18, False: 37]
  ------------------
 5423|     18|        return(0);
 5424|       |
 5425|     37|    switch (cur->type) {
 5426|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (5426:9): [True: 0, False: 37]
  ------------------
 5427|      0|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (5427:9): [True: 0, False: 37]
  ------------------
 5428|      0|        case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (5428:9): [True: 0, False: 37]
  ------------------
 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|     37|        case XML_TEXT_NODE:
  ------------------
  |  Branch (5442:9): [True: 37, False: 0]
  ------------------
 5443|     37|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5443:9): [True: 0, False: 37]
  ------------------
 5444|     37|        case XML_PI_NODE:
  ------------------
  |  Branch (5444:9): [True: 0, False: 37]
  ------------------
 5445|     37|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (5445:9): [True: 0, False: 37]
  ------------------
 5446|     37|            return(xmlTextAddContent(cur, content, len));
 5447|      0|        default:
  ------------------
  |  Branch (5447:9): [True: 0, False: 37]
  ------------------
 5448|      0|            break;
 5449|     37|    }
 5450|       |
 5451|      0|    return(0);
 5452|     37|}
xmlGetNsListSafe:
 5518|  26.7k|{
 5519|  26.7k|    xmlNsPtr cur;
 5520|  26.7k|    xmlNsPtr *namespaces = NULL;
 5521|  26.7k|    int nbns = 0;
 5522|  26.7k|    int maxns = 0;
 5523|  26.7k|    int i;
 5524|       |
 5525|  26.7k|    if (out == NULL)
  ------------------
  |  Branch (5525:9): [True: 0, False: 26.7k]
  ------------------
 5526|      0|        return(1);
 5527|  26.7k|    *out = NULL;
 5528|  26.7k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5528:9): [True: 0, False: 26.7k]
  |  Branch (5528:27): [True: 0, False: 26.7k]
  ------------------
 5529|      0|        return(1);
 5530|       |
 5531|   213k|    while (node != NULL) {
  ------------------
  |  Branch (5531:12): [True: 187k, False: 26.7k]
  ------------------
 5532|   187k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5532:13): [True: 160k, False: 26.7k]
  ------------------
 5533|   160k|            cur = node->nsDef;
 5534|   197k|            while (cur != NULL) {
  ------------------
  |  Branch (5534:20): [True: 36.7k, False: 160k]
  ------------------
 5535|  48.2k|                for (i = 0; i < nbns; i++) {
  ------------------
  |  Branch (5535:29): [True: 12.5k, False: 35.6k]
  ------------------
 5536|  12.5k|                    if ((cur->prefix == namespaces[i]->prefix) ||
  ------------------
  |  Branch (5536:25): [True: 245, False: 12.3k]
  ------------------
 5537|  12.3k|                        (xmlStrEqual(cur->prefix, namespaces[i]->prefix)))
  ------------------
  |  Branch (5537:25): [True: 895, False: 11.4k]
  ------------------
 5538|  1.14k|                        break;
 5539|  12.5k|                }
 5540|  36.7k|                if (i >= nbns) {
  ------------------
  |  Branch (5540:21): [True: 35.6k, False: 1.14k]
  ------------------
 5541|  35.6k|                    if (nbns >= maxns) {
  ------------------
  |  Branch (5541:25): [True: 25.8k, False: 9.74k]
  ------------------
 5542|  25.8k|                        xmlNsPtr *tmp;
 5543|  25.8k|                        int newSize;
 5544|       |
 5545|  25.8k|                        newSize = xmlGrowCapacity(maxns, sizeof(tmp[0]),
 5546|  25.8k|                                                  10, XML_MAX_ITEMS);
  ------------------
  |  |   13|  25.8k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 5547|  25.8k|                        if (newSize < 0) {
  ------------------
  |  Branch (5547:29): [True: 0, False: 25.8k]
  ------------------
 5548|      0|                            xmlFree(namespaces);
 5549|      0|                            return(-1);
 5550|      0|                        }
 5551|  25.8k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 5552|  25.8k|                        if (newSize < 2)
  ------------------
  |  Branch (5552:29): [True: 25.0k, False: 830]
  ------------------
 5553|  25.0k|                            newSize = 2;
 5554|  25.8k|#endif
 5555|  25.8k|                        tmp = xmlRealloc(namespaces,
 5556|  25.8k|                                         (newSize + 1) * sizeof(tmp[0]));
 5557|  25.8k|                        if (tmp == NULL) {
  ------------------
  |  Branch (5557:29): [True: 7, False: 25.8k]
  ------------------
 5558|      7|                            xmlFree(namespaces);
 5559|      7|                            return(-1);
 5560|      7|                        }
 5561|  25.8k|                        namespaces = tmp;
 5562|  25.8k|                        maxns = newSize;
 5563|  25.8k|                    }
 5564|  35.6k|                    namespaces[nbns++] = cur;
 5565|  35.6k|                    namespaces[nbns] = NULL;
 5566|  35.6k|                }
 5567|       |
 5568|  36.7k|                cur = cur->next;
 5569|  36.7k|            }
 5570|   160k|        }
 5571|   187k|        node = node->parent;
 5572|   187k|    }
 5573|       |
 5574|  26.7k|    *out = namespaces;
 5575|  26.7k|    return((namespaces == NULL) ? 1 : 0);
  ------------------
  |  Branch (5575:12): [True: 1.68k, False: 25.0k]
  ------------------
 5576|  26.7k|}
xmlSearchNsSafe:
 5655|  1.57M|                xmlNs **out) {
 5656|  1.57M|    xmlNsPtr cur;
 5657|  1.57M|    xmlDocPtr doc;
 5658|  1.57M|    xmlNodePtr orig = node;
 5659|  1.57M|    xmlNodePtr parent;
 5660|       |
 5661|  1.57M|    if (out == NULL)
  ------------------
  |  Branch (5661:9): [True: 0, False: 1.57M]
  ------------------
 5662|      0|        return(1);
 5663|  1.57M|    *out = NULL;
 5664|  1.57M|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5664:9): [True: 0, False: 1.57M]
  |  Branch (5664:27): [True: 0, False: 1.57M]
  ------------------
 5665|      0|        return(1);
 5666|       |
 5667|  1.57M|    doc = node->doc;
 5668|       |
 5669|  1.57M|    if ((doc != NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|  1.57M|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 716k, False: 854k]
  |  |  |  Branch (100:43): [True: 393k, False: 322k]
  |  |  ------------------
  |  |  101|  1.57M|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 325k, False: 68.6k]
  |  |  |  Branch (101:22): [True: 323k, False: 1.49k]
  |  |  |  Branch (101:41): [True: 321k, False: 2.17k]
  |  |  ------------------
  ------------------
  |  Branch (5669:9): [True: 1.57M, False: 99]
  ------------------
 5670|   321k|        cur = xmlTreeEnsureXMLDecl(doc);
 5671|   321k|        if (cur == NULL)
  ------------------
  |  Branch (5671:13): [True: 30, False: 321k]
  ------------------
 5672|     30|            return(-1);
 5673|   321k|        *out = cur;
 5674|   321k|        return(0);
 5675|   321k|    }
 5676|       |
 5677|  1.25M|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5677:12): [True: 14.8k, False: 1.23M]
  ------------------
 5678|  14.8k|        node = node->parent;
 5679|  14.8k|        if (node == NULL)
  ------------------
  |  Branch (5679:13): [True: 13.1k, False: 1.69k]
  ------------------
 5680|  13.1k|            return(0);
 5681|  14.8k|    }
 5682|       |
 5683|  1.23M|    parent = node;
 5684|       |
 5685|  44.9M|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5685:12): [True: 44.8M, False: 54.5k]
  |  Branch (5685:30): [True: 44.4M, False: 390k]
  ------------------
 5686|  44.4M|        cur = node->nsDef;
 5687|  48.3M|        while (cur != NULL) {
  ------------------
  |  Branch (5687:16): [True: 4.53M, False: 43.8M]
  ------------------
 5688|  4.53M|            if ((xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5688:17): [True: 811k, False: 3.72M]
  ------------------
 5689|   811k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5689:17): [True: 667k, False: 143k]
  ------------------
 5690|   667k|                *out = cur;
 5691|   667k|                return(0);
 5692|   667k|            }
 5693|  3.86M|            cur = cur->next;
 5694|  3.86M|        }
 5695|  43.8M|        if (orig != node) {
  ------------------
  |  Branch (5695:13): [True: 43.1M, False: 695k]
  ------------------
 5696|  43.1M|            cur = node->ns;
 5697|  43.1M|            if ((cur != NULL) &&
  ------------------
  |  Branch (5697:17): [True: 3.02M, False: 40.0M]
  ------------------
 5698|  3.02M|                (xmlStrEqual(cur->prefix, prefix)) &&
  ------------------
  |  Branch (5698:17): [True: 124k, False: 2.89M]
  ------------------
 5699|   124k|                (cur->href != NULL)) {
  ------------------
  |  Branch (5699:17): [True: 124k, False: 0]
  ------------------
 5700|   124k|                *out = cur;
 5701|   124k|                return(0);
 5702|   124k|            }
 5703|  43.1M|        }
 5704|       |
 5705|  43.6M|	node = node->parent;
 5706|  43.6M|    }
 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|   444k|    if ((doc == NULL) && (IS_STR_XML(prefix))) {
  ------------------
  |  |  100|     93|#define IS_STR_XML(str) ((str != NULL) && (str[0] == 'x') && \
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 93, False: 0]
  |  |  |  Branch (100:43): [True: 93, False: 0]
  |  |  ------------------
  |  |  101|     93|  (str[1] == 'm') && (str[2] == 'l') && (str[3] == 0))
  |  |  ------------------
  |  |  |  Branch (101:3): [True: 93, False: 0]
  |  |  |  Branch (101:22): [True: 93, False: 0]
  |  |  |  Branch (101:41): [True: 93, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (5713:9): [True: 93, False: 444k]
  ------------------
 5714|     93|        cur = xmlNewXmlNs();
 5715|     93|        if (cur == NULL)
  ------------------
  |  Branch (5715:13): [True: 2, False: 91]
  ------------------
 5716|      2|            return(-1);
 5717|     91|        cur->next = parent->nsDef;
 5718|     91|        parent->nsDef = cur;
 5719|     91|        *out = cur;
 5720|     91|    }
 5721|       |
 5722|   444k|    return(0);
 5723|   444k|}
xmlSearchNsByHrefSafe:
 5802|  4.74k|                      xmlNs **out) {
 5803|  4.74k|    xmlNsPtr cur;
 5804|  4.74k|    xmlDocPtr doc;
 5805|  4.74k|    xmlNodePtr orig = node;
 5806|  4.74k|    xmlNodePtr parent;
 5807|  4.74k|    int is_attr;
 5808|       |
 5809|  4.74k|    if (out == NULL)
  ------------------
  |  Branch (5809:9): [True: 0, False: 4.74k]
  ------------------
 5810|      0|        return(1);
 5811|  4.74k|    *out = NULL;
 5812|  4.74k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (5812:9): [True: 0, False: 4.74k]
  |  Branch (5812:27): [True: 0, False: 4.74k]
  ------------------
 5813|      0|        return(1);
 5814|       |
 5815|  4.74k|    doc = node->doc;
 5816|       |
 5817|  4.74k|    if ((doc != NULL) && (xmlStrEqual(href, XML_XML_NAMESPACE))) {
  ------------------
  |  |  146|  4.74k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (5817:9): [True: 4.74k, False: 0]
  |  Branch (5817:26): [True: 2.64k, False: 2.09k]
  ------------------
 5818|  2.64k|        cur = xmlTreeEnsureXMLDecl(doc);
 5819|  2.64k|        if (cur == NULL)
  ------------------
  |  Branch (5819:13): [True: 2, False: 2.64k]
  ------------------
 5820|      2|            return(-1);
 5821|  2.64k|        *out = cur;
 5822|  2.64k|        return(0);
 5823|  2.64k|    }
 5824|       |
 5825|  2.09k|    is_attr = (node->type == XML_ATTRIBUTE_NODE);
 5826|       |
 5827|  2.09k|    while (node->type != XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5827:12): [True: 0, False: 2.09k]
  ------------------
 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.09k|    parent = node;
 5834|       |
 5835|  40.0k|    while ((node != NULL) && (node->type == XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5835:12): [True: 39.3k, False: 689]
  |  Branch (5835:30): [True: 39.3k, False: 0]
  ------------------
 5836|  39.3k|        cur = node->nsDef;
 5837|  62.7k|        while (cur != NULL) {
  ------------------
  |  Branch (5837:16): [True: 24.3k, False: 38.3k]
  ------------------
 5838|  24.3k|            if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5838:17): [True: 6.08k, False: 18.2k]
  ------------------
 5839|  6.08k|                if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5839:22): [True: 6.08k, False: 0]
  |  Branch (5839:36): [True: 0, False: 0]
  ------------------
 5840|  6.08k|                    (xmlNsInScope(doc, orig, node, cur->prefix) == 1)) {
  ------------------
  |  Branch (5840:21): [True: 1.02k, False: 5.05k]
  ------------------
 5841|  1.02k|                    *out = cur;
 5842|  1.02k|                    return(0);
 5843|  1.02k|                }
 5844|  6.08k|            }
 5845|  23.3k|            cur = cur->next;
 5846|  23.3k|        }
 5847|  38.3k|        if (orig != node) {
  ------------------
  |  Branch (5847:13): [True: 36.4k, False: 1.95k]
  ------------------
 5848|  36.4k|            cur = node->ns;
 5849|  36.4k|            if (cur != NULL) {
  ------------------
  |  Branch (5849:17): [True: 33.6k, False: 2.77k]
  ------------------
 5850|  33.6k|                if (xmlStrEqual(cur->href, href)) {
  ------------------
  |  Branch (5850:21): [True: 7.77k, False: 25.8k]
  ------------------
 5851|  7.77k|                    if (((!is_attr) || (cur->prefix != NULL)) &&
  ------------------
  |  Branch (5851:26): [True: 7.77k, False: 0]
  |  Branch (5851:40): [True: 0, False: 0]
  ------------------
 5852|  7.77k|                        (xmlNsInScope(doc, orig, node,
  ------------------
  |  Branch (5852:25): [True: 383, False: 7.39k]
  ------------------
 5853|  7.77k|                                      cur->prefix) == 1)) {
 5854|    383|                        *out = cur;
 5855|    383|                        return(0);
 5856|    383|                    }
 5857|  7.77k|                }
 5858|  33.6k|            }
 5859|  36.4k|        }
 5860|       |
 5861|  37.9k|        node = node->parent;
 5862|  37.9k|    }
 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|    689|    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: 689]
  |  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|    689|    return(0);
 5879|    689|}
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.0M, False: 283k]
  ------------------
 6365|  11.0M|	return(1);
 6366|       |
 6367|   283k|    *out = xmlGetPropNodeValueInternal(prop);
 6368|   283k|    if (*out == NULL)
  ------------------
  |  Branch (6368:9): [True: 229, False: 283k]
  ------------------
 6369|    229|        return(-1);
 6370|   283k|    return(0);
 6371|   283k|}
xmlUnsetProp:
 6473|    152|xmlUnsetProp(xmlNode *node, const xmlChar *name) {
 6474|    152|    xmlAttrPtr prop;
 6475|       |
 6476|    152|    prop = xmlGetPropNodeInternal(node, name, NULL, 0);
 6477|    152|    if (prop == NULL)
  ------------------
  |  Branch (6477:9): [True: 26, False: 126]
  ------------------
 6478|     26|	return(-1);
 6479|    126|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6480|    126|    xmlFreeProp(prop);
 6481|    126|    return(0);
 6482|    152|}
xmlUnsetNsProp:
 6493|  20.7k|xmlUnsetNsProp(xmlNode *node, xmlNs *ns, const xmlChar *name) {
 6494|  20.7k|    xmlAttrPtr prop;
 6495|       |
 6496|  20.7k|    prop = xmlGetPropNodeInternal(node, name,
 6497|  20.7k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6497:35): [True: 20.7k, False: 0]
  ------------------
 6498|  20.7k|    if (prop == NULL)
  ------------------
  |  Branch (6498:9): [True: 19.4k, False: 1.26k]
  ------------------
 6499|  19.4k|	return(-1);
 6500|  1.26k|    xmlUnlinkNodeInternal((xmlNodePtr) prop);
 6501|  1.26k|    xmlFreeProp(prop);
 6502|  1.26k|    return(0);
 6503|  20.7k|}
xmlSetNsProp:
 6558|  2.63k|{
 6559|  2.63k|    xmlAttrPtr prop;
 6560|       |
 6561|  2.63k|    if (ns && (ns->href == NULL))
  ------------------
  |  Branch (6561:9): [True: 2.63k, False: 0]
  |  Branch (6561:15): [True: 0, False: 2.63k]
  ------------------
 6562|      0|	return(NULL);
 6563|  2.63k|    if (name == NULL)
  ------------------
  |  Branch (6563:9): [True: 0, False: 2.63k]
  ------------------
 6564|      0|        return(NULL);
 6565|  2.63k|    prop = xmlGetPropNodeInternal(node, name,
 6566|  2.63k|                                  (ns != NULL) ? ns->href : NULL, 0);
  ------------------
  |  Branch (6566:35): [True: 2.63k, False: 0]
  ------------------
 6567|  2.63k|    if (prop != NULL) {
  ------------------
  |  Branch (6567:9): [True: 1.51k, False: 1.11k]
  ------------------
 6568|  1.51k|        xmlNodePtr children = NULL;
 6569|       |
 6570|       |	/*
 6571|       |	* Modify the attribute's value.
 6572|       |	*/
 6573|  1.51k|        if (value != NULL) {
  ------------------
  |  Branch (6573:13): [True: 1.51k, False: 0]
  ------------------
 6574|  1.51k|	    children = xmlNewDocText(node->doc, value);
 6575|  1.51k|            if (children == NULL)
  ------------------
  |  Branch (6575:17): [True: 6, False: 1.51k]
  ------------------
 6576|      6|                return(NULL);
 6577|  1.51k|        }
 6578|       |
 6579|  1.51k|	if (prop->id != NULL) {
  ------------------
  |  Branch (6579:6): [True: 0, False: 1.51k]
  ------------------
 6580|      0|	    xmlRemoveID(node->doc, prop);
 6581|      0|	    prop->atype = XML_ATTRIBUTE_ID;
 6582|      0|	}
 6583|  1.51k|	if (prop->children != NULL)
  ------------------
  |  Branch (6583:6): [True: 1.49k, False: 21]
  ------------------
 6584|  1.49k|	    xmlFreeNodeList(prop->children);
 6585|  1.51k|	prop->children = NULL;
 6586|  1.51k|	prop->last = NULL;
 6587|  1.51k|	prop->ns = ns;
 6588|  1.51k|	if (value != NULL) {
  ------------------
  |  Branch (6588:6): [True: 1.51k, False: 0]
  ------------------
 6589|  1.51k|	    xmlNodePtr tmp;
 6590|       |
 6591|  1.51k|	    prop->children = children;
 6592|  1.51k|	    prop->last = NULL;
 6593|  1.51k|	    tmp = prop->children;
 6594|  3.02k|	    while (tmp != NULL) {
  ------------------
  |  Branch (6594:13): [True: 1.51k, False: 1.51k]
  ------------------
 6595|  1.51k|		tmp->parent = (xmlNodePtr) prop;
 6596|  1.51k|		if (tmp->next == NULL)
  ------------------
  |  Branch (6596:7): [True: 1.51k, False: 0]
  ------------------
 6597|  1.51k|		    prop->last = tmp;
 6598|  1.51k|		tmp = tmp->next;
 6599|  1.51k|	    }
 6600|  1.51k|	}
 6601|  1.51k|	if ((prop->atype == XML_ATTRIBUTE_ID) &&
  ------------------
  |  Branch (6601:6): [True: 0, False: 1.51k]
  ------------------
 6602|      0|	    (xmlAddIDSafe(prop, value) < 0)) {
  ------------------
  |  Branch (6602:6): [True: 0, False: 0]
  ------------------
 6603|      0|            return(NULL);
 6604|      0|        }
 6605|  1.51k|	return(prop);
 6606|  1.51k|    }
 6607|       |    /*
 6608|       |    * No equal attr found; create a new one.
 6609|       |    */
 6610|  1.11k|    return(xmlNewPropInternal(node, ns, name, value, 0));
 6611|  2.63k|}
xmlNodeIsText:
 6620|  5.94k|xmlNodeIsText(const xmlNode *node) {
 6621|  5.94k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6621:9): [True: 0, False: 5.94k]
  ------------------
 6622|       |
 6623|  5.94k|    if (node->type == XML_TEXT_NODE) return(1);
  ------------------
  |  Branch (6623:9): [True: 1.45k, False: 4.48k]
  ------------------
 6624|  4.48k|    return(0);
 6625|  5.94k|}
xmlIsBlankNode:
 6635|  10.3k|xmlIsBlankNode(const xmlNode *node) {
 6636|  10.3k|    const xmlChar *cur;
 6637|  10.3k|    if (node == NULL) return(0);
  ------------------
  |  Branch (6637:9): [True: 0, False: 10.3k]
  ------------------
 6638|       |
 6639|  10.3k|    if ((node->type != XML_TEXT_NODE) &&
  ------------------
  |  Branch (6639:9): [True: 257, False: 10.0k]
  ------------------
 6640|    257|        (node->type != XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (6640:9): [True: 257, False: 0]
  ------------------
 6641|    257|	return(0);
 6642|  10.0k|    if (node->content == NULL) return(1);
  ------------------
  |  Branch (6642:9): [True: 87, False: 9.99k]
  ------------------
 6643|  9.99k|    cur = node->content;
 6644|  58.8k|    while (*cur != 0) {
  ------------------
  |  Branch (6644:12): [True: 55.9k, False: 2.91k]
  ------------------
 6645|  55.9k|	if (!IS_BLANK_CH(*cur)) return(0);
  ------------------
  |  |  137|  55.9k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  55.9k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 40.0k, False: 15.8k]
  |  |  |  |  ------------------
  |  |  |  |   91|  55.9k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 15.6k, False: 243]
  |  |  |  |  |  Branch (91:23): [True: 8.40k, False: 7.20k]
  |  |  |  |  ------------------
  |  |  |  |   92|  55.9k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 362, False: 7.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6646|  48.8k|	cur++;
 6647|  48.8k|    }
 6648|       |
 6649|  2.91k|    return(1);
 6650|  9.99k|}
xmlIsXHTML:
 8851|  26.3k|xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
 8852|  26.3k|    if ((systemID == NULL) && (publicID == NULL))
  ------------------
  |  Branch (8852:9): [True: 8.92k, False: 17.3k]
  |  Branch (8852:31): [True: 8.92k, False: 0]
  ------------------
 8853|  8.92k|	return(-1);
 8854|  17.3k|    if (publicID != NULL) {
  ------------------
  |  Branch (8854:9): [True: 16.6k, False: 763]
  ------------------
 8855|  16.6k|	if (xmlStrEqual(publicID, XHTML_STRICT_PUBLIC_ID)) return(1);
  ------------------
  |  | 8830|  16.6k|#define XHTML_STRICT_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  16.6k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8831|  16.6k|   "-//W3C//DTD XHTML 1.0 Strict//EN"
  ------------------
  |  Branch (8855:6): [True: 886, False: 15.7k]
  ------------------
 8856|  15.7k|	if (xmlStrEqual(publicID, XHTML_FRAME_PUBLIC_ID)) return(1);
  ------------------
  |  | 8834|  15.7k|#define XHTML_FRAME_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  15.7k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8835|  15.7k|   "-//W3C//DTD XHTML 1.0 Frameset//EN"
  ------------------
  |  Branch (8856:6): [True: 5.52k, False: 10.2k]
  ------------------
 8857|  10.2k|	if (xmlStrEqual(publicID, XHTML_TRANS_PUBLIC_ID)) return(1);
  ------------------
  |  | 8838|  10.2k|#define XHTML_TRANS_PUBLIC_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  10.2k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8839|  10.2k|   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  ------------------
  |  Branch (8857:6): [True: 1.01k, False: 9.18k]
  ------------------
 8858|  10.2k|    }
 8859|  9.94k|    if (systemID != NULL) {
  ------------------
  |  Branch (8859:9): [True: 9.94k, False: 0]
  ------------------
 8860|  9.94k|	if (xmlStrEqual(systemID, XHTML_STRICT_SYSTEM_ID)) return(1);
  ------------------
  |  | 8832|  9.94k|#define XHTML_STRICT_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  9.94k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8833|  9.94k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
  ------------------
  |  Branch (8860:6): [True: 7.77k, False: 2.16k]
  ------------------
 8861|  2.16k|	if (xmlStrEqual(systemID, XHTML_FRAME_SYSTEM_ID)) return(1);
  ------------------
  |  | 8836|  2.16k|#define XHTML_FRAME_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  2.16k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8837|  2.16k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"
  ------------------
  |  Branch (8861:6): [True: 639, False: 1.53k]
  ------------------
 8862|  1.53k|	if (xmlStrEqual(systemID, XHTML_TRANS_SYSTEM_ID)) return(1);
  ------------------
  |  | 8840|  1.53k|#define XHTML_TRANS_SYSTEM_ID BAD_CAST \
  |  |  ------------------
  |  |  |  |   34|  1.53k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  |  | 8841|  1.53k|   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
  ------------------
  |  Branch (8862:6): [True: 492, False: 1.03k]
  ------------------
 8863|  1.53k|    }
 8864|  1.03k|    return(0);
 8865|  9.94k|}
tree.c:xmlNewPropInternal:
 1435|  68.0k|{
 1436|  68.0k|    xmlAttrPtr cur;
 1437|  68.0k|    xmlDocPtr doc = NULL;
 1438|       |
 1439|  68.0k|    if ((node != NULL) && (node->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (1439:9): [True: 68.0k, False: 0]
  |  Branch (1439:27): [True: 0, False: 68.0k]
  ------------------
 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|  68.0k|    cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr));
 1451|  68.0k|    if (cur == NULL) {
  ------------------
  |  Branch (1451:9): [True: 24, False: 68.0k]
  ------------------
 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|  68.0k|    memset(cur, 0, sizeof(xmlAttr));
 1460|  68.0k|    cur->type = XML_ATTRIBUTE_NODE;
 1461|       |
 1462|  68.0k|    cur->parent = node;
 1463|  68.0k|    if (node != NULL) {
  ------------------
  |  Branch (1463:9): [True: 68.0k, False: 0]
  ------------------
 1464|  68.0k|        doc = node->doc;
 1465|  68.0k|        cur->doc = doc;
 1466|  68.0k|    }
 1467|  68.0k|    cur->ns = ns;
 1468|       |
 1469|  68.0k|    if (eatname == 0) {
  ------------------
  |  Branch (1469:9): [True: 68.0k, False: 0]
  ------------------
 1470|  68.0k|        if ((doc != NULL) && (doc->dict != NULL))
  ------------------
  |  Branch (1470:13): [True: 68.0k, False: 0]
  |  Branch (1470:30): [True: 33.1k, False: 34.8k]
  ------------------
 1471|  33.1k|            cur->name = (xmlChar *) xmlDictLookup(doc->dict, name, -1);
 1472|  34.8k|        else
 1473|  34.8k|            cur->name = xmlStrdup(name);
 1474|  68.0k|        if (cur->name == NULL)
  ------------------
  |  Branch (1474:13): [True: 10, False: 68.0k]
  ------------------
 1475|     10|            goto error;
 1476|  68.0k|    } else
 1477|      0|        cur->name = name;
 1478|       |
 1479|  68.0k|    if (value != NULL) {
  ------------------
  |  Branch (1479:9): [True: 1.11k, False: 66.8k]
  ------------------
 1480|  1.11k|        xmlNodePtr tmp;
 1481|       |
 1482|  1.11k|        cur->children = xmlNewDocText(doc, value);
 1483|  1.11k|        if (cur->children == NULL)
  ------------------
  |  Branch (1483:13): [True: 7, False: 1.10k]
  ------------------
 1484|      7|            goto error;
 1485|  1.10k|        cur->last = NULL;
 1486|  1.10k|        tmp = cur->children;
 1487|  2.21k|        while (tmp != NULL) {
  ------------------
  |  Branch (1487:16): [True: 1.10k, False: 1.10k]
  ------------------
 1488|  1.10k|            tmp->parent = (xmlNodePtr) cur;
 1489|  1.10k|            if (tmp->next == NULL)
  ------------------
  |  Branch (1489:17): [True: 1.10k, False: 0]
  ------------------
 1490|  1.10k|                cur->last = tmp;
 1491|  1.10k|            tmp = tmp->next;
 1492|  1.10k|        }
 1493|       |
 1494|  1.10k|        if (doc != NULL) {
  ------------------
  |  Branch (1494:13): [True: 1.10k, False: 0]
  ------------------
 1495|  1.10k|            int res = xmlIsID(doc, node, cur);
 1496|       |
 1497|  1.10k|            if (res < 0)
  ------------------
  |  Branch (1497:17): [True: 2, False: 1.10k]
  ------------------
 1498|      2|                goto error;
 1499|  1.10k|            if ((res == 1) && (xmlAddIDSafe(cur, value) < 0))
  ------------------
  |  Branch (1499:17): [True: 0, False: 1.10k]
  |  Branch (1499:31): [True: 0, False: 0]
  ------------------
 1500|      0|                goto error;
 1501|  1.10k|        }
 1502|  1.10k|    }
 1503|       |
 1504|       |    /*
 1505|       |     * Add it at the end to preserve parsing order ...
 1506|       |     */
 1507|  68.0k|    if (node != NULL) {
  ------------------
  |  Branch (1507:9): [True: 68.0k, False: 0]
  ------------------
 1508|  68.0k|        if (node->properties == NULL) {
  ------------------
  |  Branch (1508:13): [True: 48.9k, False: 19.0k]
  ------------------
 1509|  48.9k|            node->properties = cur;
 1510|  48.9k|        } else {
 1511|  19.0k|            xmlAttrPtr prev = node->properties;
 1512|       |
 1513|   119k|            while (prev->next != NULL)
  ------------------
  |  Branch (1513:20): [True: 100k, False: 19.0k]
  ------------------
 1514|   100k|                prev = prev->next;
 1515|  19.0k|            prev->next = cur;
 1516|  19.0k|            cur->prev = prev;
 1517|  19.0k|        }
 1518|  68.0k|    }
 1519|       |
 1520|  68.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1520:9): [True: 0, False: 68.0k]
  |  Branch (1520:35): [True: 0, False: 0]
  ------------------
 1521|      0|        xmlRegisterNodeDefaultValue((xmlNodePtr) cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1522|  68.0k|    return (cur);
 1523|       |
 1524|     19|error:
 1525|     19|    xmlFreeProp(cur);
 1526|       |    return(NULL);
 1527|  68.0k|}
tree.c:xmlNewElem:
 1842|   890k|           const xmlChar *content) {
 1843|   890k|    xmlNodePtr cur;
 1844|       |
 1845|   890k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 1846|   890k|    if (cur == NULL)
  ------------------
  |  Branch (1846:9): [True: 105, False: 890k]
  ------------------
 1847|    105|	return(NULL);
 1848|   890k|    memset(cur, 0, sizeof(xmlNode));
 1849|       |
 1850|   890k|    cur->type = XML_ELEMENT_NODE;
 1851|   890k|    cur->doc = doc;
 1852|   890k|    cur->name = name;
 1853|   890k|    cur->ns = ns;
 1854|       |
 1855|   890k|    if (content != NULL) {
  ------------------
  |  Branch (1855:9): [True: 0, False: 890k]
  ------------------
 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|   890k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (1868:9): [True: 0, False: 890k]
  |  Branch (1868:35): [True: 0, False: 0]
  ------------------
 1869|      0|	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 1870|       |
 1871|   890k|    return(cur);
 1872|   890k|}
tree.c:xmlNewEntityRef:
 2137|  38.0k|xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) {
 2138|  38.0k|    xmlNodePtr cur;
 2139|       |
 2140|       |    /*
 2141|       |     * Allocate a new node and fill the fields.
 2142|       |     */
 2143|  38.0k|    cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode));
 2144|  38.0k|    if (cur == NULL) {
  ------------------
  |  Branch (2144:9): [True: 7, False: 38.0k]
  ------------------
 2145|      7|        xmlFree(name);
 2146|      7|	return(NULL);
 2147|      7|    }
 2148|  38.0k|    memset(cur, 0, sizeof(xmlNode));
 2149|  38.0k|    cur->type = XML_ENTITY_REF_NODE;
 2150|  38.0k|    cur->doc = doc;
 2151|  38.0k|    cur->name = name;
 2152|       |
 2153|  38.0k|    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
  |  Branch (2153:9): [True: 0, False: 38.0k]
  |  Branch (2153:35): [True: 0, False: 0]
  ------------------
 2154|      0|	xmlRegisterNodeDefaultValue(cur);
  ------------------
  |  |  932|      0|    (*__xmlRegisterNodeDefaultValue())
  ------------------
 2155|       |
 2156|  38.0k|    return(cur);
 2157|  38.0k|}
tree.c:xmlInsertNode:
 2791|   226k|              xmlNodePtr prev, xmlNodePtr next, int coalesce) {
 2792|   226k|    xmlNodePtr oldParent;
 2793|       |
 2794|   226k|    if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (2794:9): [True: 0, False: 226k]
  ------------------
 2795|      0|	return xmlInsertProp(doc, cur, parent, prev, next);
 2796|       |
 2797|       |    /*
 2798|       |     * Coalesce text nodes
 2799|       |     */
 2800|   226k|    if ((coalesce) && (cur->type == XML_TEXT_NODE)) {
  ------------------
  |  Branch (2800:9): [True: 0, False: 226k]
  |  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|   226k|    oldParent = cur->parent;
 2829|   226k|    if (oldParent != NULL) {
  ------------------
  |  Branch (2829:9): [True: 0, False: 226k]
  ------------------
 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|   226k|    if (cur->next != NULL)
  ------------------
  |  Branch (2835:9): [True: 208k, False: 17.7k]
  ------------------
 2836|   208k|        cur->next->prev = cur->prev;
 2837|   226k|    if (cur->prev != NULL)
  ------------------
  |  Branch (2837:9): [True: 0, False: 226k]
  ------------------
 2838|      0|        cur->prev->next = cur->next;
 2839|       |
 2840|   226k|    if (cur->doc != doc) {
  ------------------
  |  Branch (2840:9): [True: 0, False: 226k]
  ------------------
 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|   226k|    cur->parent = parent;
 2857|   226k|    cur->prev = prev;
 2858|   226k|    cur->next = next;
 2859|       |
 2860|   226k|    if (prev == NULL) {
  ------------------
  |  Branch (2860:9): [True: 0, False: 226k]
  ------------------
 2861|      0|        if (parent != NULL)
  ------------------
  |  Branch (2861:13): [True: 0, False: 0]
  ------------------
 2862|      0|            parent->children = cur;
 2863|   226k|    } else {
 2864|   226k|        prev->next = cur;
 2865|   226k|    }
 2866|   226k|    if (next == NULL) {
  ------------------
  |  Branch (2866:9): [True: 1.00k, False: 225k]
  ------------------
 2867|  1.00k|        if (parent != NULL)
  ------------------
  |  Branch (2867:13): [True: 1.00k, False: 0]
  ------------------
 2868|  1.00k|            parent->last = cur;
 2869|   225k|    } else {
 2870|   225k|        next->prev = cur;
 2871|   225k|    }
 2872|       |
 2873|   226k|    return(cur);
 2874|   226k|}
tree.c:xmlTextSetContent:
 2717|     36|xmlTextSetContent(xmlNodePtr text, xmlChar *content) {
 2718|     36|    if ((text->content != NULL) &&
  ------------------
  |  Branch (2718:9): [True: 0, False: 36]
  ------------------
 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|     36|    text->content = content;
 2729|       |    text->properties = NULL;
 2730|     36|}
tree.c:xmlTextAddContent:
 2733|     37|xmlTextAddContent(xmlNodePtr text, const xmlChar *content, int len) {
 2734|     37|    xmlChar *merged;
 2735|       |
 2736|     37|    if (content == NULL)
  ------------------
  |  Branch (2736:9): [True: 0, False: 37]
  ------------------
 2737|      0|        return(0);
 2738|       |
 2739|     37|    merged = xmlStrncatNew(text->content, content, len);
 2740|     37|    if (merged == NULL)
  ------------------
  |  Branch (2740:9): [True: 1, False: 36]
  ------------------
 2741|      1|        return(-1);
 2742|       |
 2743|     36|    xmlTextSetContent(text, merged);
 2744|     36|    return(0);
 2745|     37|}
tree.c:xmlUnlinkNodeInternal:
 3485|   407k|xmlUnlinkNodeInternal(xmlNodePtr cur) {
 3486|   407k|    if (cur->parent != NULL) {
  ------------------
  |  Branch (3486:9): [True: 371k, False: 36.4k]
  ------------------
 3487|   371k|	xmlNodePtr parent;
 3488|   371k|	parent = cur->parent;
 3489|   371k|	if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (3489:6): [True: 1.39k, False: 370k]
  ------------------
 3490|  1.39k|	    if (parent->properties == (xmlAttrPtr) cur)
  ------------------
  |  Branch (3490:10): [True: 1.32k, False: 64]
  ------------------
 3491|  1.32k|		parent->properties = ((xmlAttrPtr) cur)->next;
 3492|   370k|	} else {
 3493|   370k|	    if (parent->children == cur)
  ------------------
  |  Branch (3493:10): [True: 188k, False: 181k]
  ------------------
 3494|   188k|		parent->children = cur->next;
 3495|   370k|	    if (parent->last == cur)
  ------------------
  |  Branch (3495:10): [True: 40.7k, False: 329k]
  ------------------
 3496|  40.7k|		parent->last = cur->prev;
 3497|   370k|	}
 3498|   371k|	cur->parent = NULL;
 3499|   371k|    }
 3500|       |
 3501|   407k|    if (cur->next != NULL)
  ------------------
  |  Branch (3501:9): [True: 329k, False: 78.2k]
  ------------------
 3502|   329k|        cur->next->prev = cur->prev;
 3503|   407k|    if (cur->prev != NULL)
  ------------------
  |  Branch (3503:9): [True: 181k, False: 226k]
  ------------------
 3504|   181k|        cur->prev->next = cur->next;
 3505|   407k|    cur->next = NULL;
 3506|       |    cur->prev = NULL;
 3507|   407k|}
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.35k, False: 1.74M]
  ------------------
 3677|  1.74M|    ret->parent = target;
 3678|       |
 3679|  1.74M|    if ((cur->ns != NULL) && (target != NULL)) {
  ------------------
  |  Branch (3679:9): [True: 297k, False: 1.44M]
  |  Branch (3679:30): [True: 297k, False: 0]
  ------------------
 3680|   297k|      xmlNsPtr ns;
 3681|   297k|      int res;
 3682|       |
 3683|   297k|      res = xmlSearchNsSafe(target, cur->ns->prefix, &ns);
 3684|   297k|      if (res < 0)
  ------------------
  |  Branch (3684:11): [True: 1, False: 297k]
  ------------------
 3685|      1|          goto error;
 3686|   297k|      if (ns == NULL) {
  ------------------
  |  Branch (3686:11): [True: 981, False: 296k]
  ------------------
 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|    981|        res = xmlSearchNsSafe(cur->parent, cur->ns->prefix, &ns);
 3693|    981|        if (res < 0)
  ------------------
  |  Branch (3693:13): [True: 0, False: 981]
  ------------------
 3694|      0|          goto error;
 3695|    981|        if (ns != NULL) {
  ------------------
  |  Branch (3695:13): [True: 981, False: 0]
  ------------------
 3696|    981|          xmlNodePtr root = target;
 3697|    981|          xmlNodePtr pred = NULL;
 3698|       |
 3699|  1.19k|          while (root->parent != NULL) {
  ------------------
  |  Branch (3699:18): [True: 215, False: 981]
  ------------------
 3700|    215|            pred = root;
 3701|    215|            root = root->parent;
 3702|    215|          }
 3703|    981|          if (root == (xmlNodePtr) target->doc) {
  ------------------
  |  Branch (3703:15): [True: 0, False: 981]
  ------------------
 3704|       |            /* correct possibly cycling above the document elt */
 3705|      0|            root = pred;
 3706|      0|          }
 3707|    981|          ret->ns = xmlNewNs(root, ns->href, ns->prefix);
 3708|    981|          if (ret->ns == NULL)
  ------------------
  |  Branch (3708:15): [True: 1, False: 980]
  ------------------
 3709|      1|              goto error;
 3710|    981|        }
 3711|   296k|      } 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|   296k|        if (xmlStrEqual(ns->href, cur->ns->href)) {
  ------------------
  |  Branch (3717:13): [True: 294k, False: 2.09k]
  ------------------
 3718|       |          /* this is the nice case */
 3719|   294k|          ret->ns = ns;
 3720|   294k|        } else {
 3721|       |          /*
 3722|       |           * we are in trouble: we need a new reconciled namespace.
 3723|       |           * This is expensive
 3724|       |           */
 3725|  2.09k|          ret->ns = xmlNewReconciledNs(target, cur->ns);
 3726|  2.09k|          if (ret->ns == NULL)
  ------------------
  |  Branch (3726:15): [True: 1, False: 2.09k]
  ------------------
 3727|      1|              goto error;
 3728|  2.09k|        }
 3729|   296k|      }
 3730|       |
 3731|   297k|    } else
 3732|  1.44M|        ret->ns = NULL;
 3733|       |
 3734|  1.74M|    if (cur->children != NULL) {
  ------------------
  |  Branch (3734:9): [True: 1.73M, False: 9.43k]
  ------------------
 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: 38, False: 1.73M]
  ------------------
 3739|     38|            goto error;
 3740|  1.73M|	ret->last = NULL;
 3741|  1.73M|	tmp = ret->children;
 3742|  3.47M|	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: 244]
  |  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.43k]
  ------------------
 3756|  1.73M|        int res = xmlIsID(cur->doc, cur->parent, cur);
 3757|       |
 3758|  1.73M|        if (res < 0)
  ------------------
  |  Branch (3758:13): [True: 2, False: 1.73M]
  ------------------
 3759|      2|            goto error;
 3760|  1.73M|	if (res != 0) {
  ------------------
  |  Branch (3760:6): [True: 4.28k, False: 1.73M]
  ------------------
 3761|  4.28k|	    xmlChar *id;
 3762|       |
 3763|  4.28k|	    id = xmlNodeGetContent((xmlNodePtr) cur);
 3764|  4.28k|	    if (id == NULL)
  ------------------
  |  Branch (3764:10): [True: 2, False: 4.28k]
  ------------------
 3765|      2|                goto error;
 3766|  4.28k|            res = xmlAddIDSafe(ret, id);
 3767|  4.28k|	    xmlFree(id);
 3768|  4.28k|            if (res < 0)
  ------------------
  |  Branch (3768:17): [True: 10, False: 4.27k]
  ------------------
 3769|     10|                goto error;
 3770|  4.28k|	}
 3771|  1.73M|    }
 3772|  1.74M|    return(ret);
 3773|       |
 3774|     55|error:
 3775|     55|    xmlFreeProp(ret);
 3776|       |    return(NULL);
 3777|  1.74M|}
tree.c:xmlGetEntityFromDtd:
  119|  2.68k|xmlGetEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  120|  2.68k|    xmlEntitiesTablePtr table;
  121|       |
  122|  2.68k|    if((dtd != NULL) && (dtd->entities != NULL)) {
  ------------------
  |  Branch (122:8): [True: 2.68k, False: 0]
  |  Branch (122:25): [True: 2.68k, False: 0]
  ------------------
  123|  2.68k|	table = (xmlEntitiesTablePtr) dtd->entities;
  124|  2.68k|	return((xmlEntityPtr) xmlHashLookup(table, name));
  125|       |	/* return(xmlGetEntityFromTable(table, name)); */
  126|  2.68k|    }
  127|      0|    return(NULL);
  128|  2.68k|}
tree.c:xmlGetParameterEntityFromDtd:
  137|    410|xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) {
  138|    410|    xmlEntitiesTablePtr table;
  139|       |
  140|    410|    if ((dtd != NULL) && (dtd->pentities != NULL)) {
  ------------------
  |  Branch (140:9): [True: 410, False: 0]
  |  Branch (140:26): [True: 410, False: 0]
  ------------------
  141|    410|	table = (xmlEntitiesTablePtr) dtd->pentities;
  142|    410|	return((xmlEntityPtr) xmlHashLookup(table, name));
  143|       |	/* return(xmlGetEntityFromTable(table, name)); */
  144|    410|    }
  145|      0|    return(NULL);
  146|    410|}
tree.c:xmlGetLineNoInternal:
 4398|  58.5k|{
 4399|  58.5k|    long result = -1;
 4400|       |
 4401|  58.5k|    if (depth >= 5)
  ------------------
  |  Branch (4401:9): [True: 5.14k, False: 53.4k]
  ------------------
 4402|  5.14k|        return(-1);
 4403|       |
 4404|  53.4k|    if (!node)
  ------------------
  |  Branch (4404:9): [True: 0, False: 53.4k]
  ------------------
 4405|      0|        return result;
 4406|  53.4k|    if ((node->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4406:9): [True: 43.0k, False: 10.4k]
  ------------------
 4407|  10.4k|        (node->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4407:9): [True: 8.85k, False: 1.55k]
  ------------------
 4408|  1.55k|	(node->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4408:2): [True: 210, False: 1.34k]
  ------------------
 4409|  52.5k|	(node->type == XML_PI_NODE)) {
  ------------------
  |  Branch (4409:2): [True: 493, False: 854]
  ------------------
 4410|  52.5k|	if (node->line == 65535) {
  ------------------
  |  Branch (4410:6): [True: 38.0k, False: 14.5k]
  ------------------
 4411|  38.0k|	    if ((node->type == XML_TEXT_NODE) && (node->psvi != NULL))
  ------------------
  |  Branch (4411:10): [True: 8.85k, False: 29.1k]
  |  Branch (4411:43): [True: 2.85k, False: 5.99k]
  ------------------
 4412|  2.85k|	        result = XML_PTR_TO_INT(node->psvi);
  ------------------
  |  |   58|  2.85k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  ------------------
 4413|  35.1k|	    else if ((node->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (4413:15): [True: 28.4k, False: 6.70k]
  ------------------
 4414|  28.4k|	             (node->children != NULL))
  ------------------
  |  Branch (4414:15): [True: 3.03k, False: 25.4k]
  ------------------
 4415|  3.03k|	        result = xmlGetLineNoInternal(node->children, depth + 1);
 4416|  32.1k|	    else if (node->next != NULL)
  ------------------
  |  Branch (4416:15): [True: 10.1k, False: 22.0k]
  ------------------
 4417|  10.1k|	        result = xmlGetLineNoInternal(node->next, depth + 1);
 4418|  22.0k|	    else if (node->prev != NULL)
  ------------------
  |  Branch (4418:15): [True: 16.6k, False: 5.32k]
  ------------------
 4419|  16.6k|	        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4420|  38.0k|	}
 4421|  52.5k|	if ((result == -1) || (result == 65535))
  ------------------
  |  Branch (4421:6): [True: 25.0k, False: 27.5k]
  |  Branch (4421:24): [True: 21.1k, False: 6.44k]
  ------------------
 4422|  46.1k|	    result = node->line;
 4423|  52.5k|    } else if ((node->prev != NULL) &&
  ------------------
  |  Branch (4423:16): [True: 759, False: 95]
  ------------------
 4424|    759|             ((node->prev->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (4424:15): [True: 229, False: 530]
  ------------------
 4425|    530|	      (node->prev->type == XML_TEXT_NODE) ||
  ------------------
  |  Branch (4425:8): [True: 244, False: 286]
  ------------------
 4426|    286|	      (node->prev->type == XML_COMMENT_NODE) ||
  ------------------
  |  Branch (4426:8): [True: 0, False: 286]
  ------------------
 4427|    286|	      (node->prev->type == XML_PI_NODE)))
  ------------------
  |  Branch (4427:8): [True: 68, False: 218]
  ------------------
 4428|    541|        result = xmlGetLineNoInternal(node->prev, depth + 1);
 4429|    313|    else if ((node->parent != NULL) &&
  ------------------
  |  Branch (4429:14): [True: 313, False: 0]
  ------------------
 4430|    313|             (node->parent->type == XML_ELEMENT_NODE))
  ------------------
  |  Branch (4430:14): [True: 304, False: 9]
  ------------------
 4431|    304|        result = xmlGetLineNoInternal(node->parent, depth + 1);
 4432|       |
 4433|  53.4k|    return result;
 4434|  53.4k|}
tree.c:xmlBufGetChildContent:
 5157|   157k|xmlBufGetChildContent(xmlBufPtr buf, const xmlNode *tree, int normalize) {
 5158|   157k|    const xmlNode *cur = tree->children;
 5159|       |
 5160|  20.7M|    while (cur != NULL) {
  ------------------
  |  Branch (5160:12): [True: 20.7M, False: 1.37k]
  ------------------
 5161|  20.7M|        switch (cur->type) {
 5162|  4.37M|            case XML_TEXT_NODE:
  ------------------
  |  Branch (5162:13): [True: 4.37M, False: 16.3M]
  ------------------
 5163|  4.41M|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (5163:13): [True: 40.5k, False: 20.6M]
  ------------------
 5164|  4.41M|                if (normalize)
  ------------------
  |  Branch (5164:21): [True: 2.32k, False: 4.41M]
  ------------------
 5165|  2.32k|                    xmlBufCat(buf, xmlAttrNormalize(cur->content));
 5166|  4.41M|                else
 5167|  4.41M|                    xmlBufCat(buf, cur->content);
 5168|  4.41M|                break;
 5169|       |
 5170|  2.57k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (5170:13): [True: 2.57k, False: 20.7M]
  ------------------
 5171|  2.57k|                xmlBufGetEntityRefContent(buf, cur, normalize);
 5172|  2.57k|                break;
 5173|       |
 5174|  16.3M|            default:
  ------------------
  |  Branch (5174:13): [True: 16.3M, False: 4.42M]
  ------------------
 5175|  16.3M|                if (cur->children != NULL) {
  ------------------
  |  Branch (5175:21): [True: 14.5M, False: 1.77M]
  ------------------
 5176|  14.5M|                    cur = cur->children;
 5177|  14.5M|                    continue;
 5178|  14.5M|                }
 5179|  1.77M|                break;
 5180|  20.7M|        }
 5181|       |
 5182|  20.7M|        while (cur->next == NULL) {
  ------------------
  |  Branch (5182:16): [True: 14.6M, False: 6.03M]
  ------------------
 5183|  14.6M|            cur = cur->parent;
 5184|  14.6M|            if (cur == tree)
  ------------------
  |  Branch (5184:17): [True: 156k, False: 14.5M]
  ------------------
 5185|   156k|                return;
 5186|  14.6M|        }
 5187|  6.03M|        cur = cur->next;
 5188|  6.03M|    }
 5189|   157k|}
tree.c:xmlBufGetEntityRefContent:
 5126|  3.29k|xmlBufGetEntityRefContent(xmlBufPtr buf, const xmlNode *ref, int normalize) {
 5127|  3.29k|    xmlEntityPtr ent;
 5128|       |
 5129|  3.29k|    if (ref->children != NULL) {
  ------------------
  |  Branch (5129:9): [True: 2.70k, False: 588]
  ------------------
 5130|  2.70k|        ent = (xmlEntityPtr) ref->children;
 5131|  2.70k|    } else {
 5132|       |        /* lookup entity declaration */
 5133|    588|        ent = xmlGetDocEntity(ref->doc, ref->name);
 5134|    588|        if (ent == NULL)
  ------------------
  |  Branch (5134:13): [True: 588, False: 0]
  ------------------
 5135|    588|            return;
 5136|    588|    }
 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.70k|    if (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
  ------------------
  |  Branch (5143:9): [True: 0, False: 2.70k]
  ------------------
 5144|      0|        xmlBufCat(buf, ent->content);
 5145|      0|        return;
 5146|      0|    }
 5147|       |
 5148|  2.70k|    if (ent->flags & XML_ENT_EXPANDING)
  ------------------
  |  |   22|  2.70k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
  |  Branch (5148:9): [True: 0, False: 2.70k]
  ------------------
 5149|      0|        return;
 5150|       |
 5151|  2.70k|    ent->flags |= XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.70k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5152|  2.70k|    xmlBufGetChildContent(buf, (xmlNodePtr) ent, normalize);
 5153|  2.70k|    ent->flags &= ~XML_ENT_EXPANDING;
  ------------------
  |  |   22|  2.70k|#define XML_ENT_EXPANDING   (1u << 3)
  ------------------
 5154|  2.70k|}
tree.c:xmlTreeEnsureXMLDecl:
 5631|   324k|{
 5632|   324k|    xmlNsPtr ns;
 5633|       |
 5634|   324k|    ns = doc->oldNs;
 5635|   324k|    if (ns != NULL)
  ------------------
  |  Branch (5635:9): [True: 318k, False: 5.74k]
  ------------------
 5636|   318k|	return (ns);
 5637|       |
 5638|  5.74k|    ns = xmlNewXmlNs();
 5639|  5.74k|    doc->oldNs = ns;
 5640|       |
 5641|  5.74k|    return(ns);
 5642|   324k|}
tree.c:xmlNewXmlNs:
 5599|  5.83k|xmlNewXmlNs(void) {
 5600|  5.83k|    xmlNsPtr ns;
 5601|       |
 5602|  5.83k|    ns = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 5603|  5.83k|    if (ns == NULL)
  ------------------
  |  Branch (5603:9): [True: 9, False: 5.82k]
  ------------------
 5604|      9|        return(NULL);
 5605|  5.82k|    memset(ns, 0, sizeof(xmlNs));
 5606|  5.82k|    ns->type = XML_LOCAL_NAMESPACE;
  ------------------
  |  |  500|  5.82k|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
 5607|  5.82k|    ns->href = xmlStrdup(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  5.82k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 5608|  5.82k|    if (ns->href == NULL) {
  ------------------
  |  Branch (5608:9): [True: 12, False: 5.81k]
  ------------------
 5609|     12|        xmlFreeNs(ns);
 5610|     12|        return(NULL);
 5611|     12|    }
 5612|  5.81k|    ns->prefix = xmlStrdup(BAD_CAST "xml");
  ------------------
  |  |   34|  5.81k|#define BAD_CAST (xmlChar *)
  ------------------
 5613|  5.81k|    if (ns->prefix == NULL) {
  ------------------
  |  Branch (5613:9): [True: 13, False: 5.80k]
  ------------------
 5614|     13|        xmlFreeNs(ns);
 5615|     13|        return(NULL);
 5616|     13|    }
 5617|       |
 5618|  5.80k|    return(ns);
 5619|  5.81k|}
tree.c:xmlNsInScope:
 5764|  13.8k|{
 5765|  13.8k|    xmlNsPtr tst;
 5766|       |
 5767|  60.0k|    while ((node != NULL) && (node != ancestor)) {
  ------------------
  |  Branch (5767:12): [True: 60.0k, False: 0]
  |  Branch (5767:30): [True: 58.5k, False: 1.41k]
  ------------------
 5768|  58.5k|        if ((node->type == XML_ENTITY_REF_NODE) ||
  ------------------
  |  Branch (5768:13): [True: 0, False: 58.5k]
  ------------------
 5769|  58.5k|            (node->type == XML_ENTITY_DECL))
  ------------------
  |  Branch (5769:13): [True: 0, False: 58.5k]
  ------------------
 5770|      0|            return (-1);
 5771|  58.5k|        if (node->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (5771:13): [True: 58.5k, False: 0]
  ------------------
 5772|  58.5k|            tst = node->nsDef;
 5773|  83.6k|            while (tst != NULL) {
  ------------------
  |  Branch (5773:20): [True: 37.4k, False: 46.1k]
  ------------------
 5774|  37.4k|                if ((tst->prefix == NULL)
  ------------------
  |  Branch (5774:21): [True: 5.45k, False: 32.0k]
  ------------------
 5775|  5.45k|                    && (prefix == NULL))
  ------------------
  |  Branch (5775:24): [True: 2.05k, False: 3.39k]
  ------------------
 5776|  2.05k|                    return (0);
 5777|  35.4k|                if ((tst->prefix != NULL)
  ------------------
  |  Branch (5777:21): [True: 32.0k, False: 3.39k]
  ------------------
 5778|  32.0k|                    && (prefix != NULL)
  ------------------
  |  Branch (5778:24): [True: 22.6k, False: 9.41k]
  ------------------
 5779|  22.6k|                    && (xmlStrEqual(tst->prefix, prefix)))
  ------------------
  |  Branch (5779:24): [True: 10.3k, False: 12.2k]
  ------------------
 5780|  10.3k|                    return (0);
 5781|  25.0k|                tst = tst->next;
 5782|  25.0k|            }
 5783|  58.5k|        }
 5784|  46.1k|        node = node->parent;
 5785|  46.1k|    }
 5786|  1.41k|    if (node != ancestor)
  ------------------
  |  Branch (5786:9): [True: 0, False: 1.41k]
  ------------------
 5787|      0|        return (-1);
 5788|  1.41k|    return (1);
 5789|  1.41k|}
tree.c:xmlNewReconciledNs:
 5914|  2.09k|xmlNewReconciledNs(xmlNodePtr tree, xmlNsPtr ns) {
 5915|  2.09k|    xmlNsPtr def;
 5916|  2.09k|    xmlChar prefix[50];
 5917|  2.09k|    int counter = 1;
 5918|  2.09k|    int res;
 5919|       |
 5920|  2.09k|    if ((tree == NULL) || (tree->type != XML_ELEMENT_NODE)) {
  ------------------
  |  Branch (5920:9): [True: 0, False: 2.09k]
  |  Branch (5920:27): [True: 0, False: 2.09k]
  ------------------
 5921|      0|	return(NULL);
 5922|      0|    }
 5923|  2.09k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (5923:9): [True: 0, False: 2.09k]
  |  Branch (5923:25): [True: 0, False: 2.09k]
  ------------------
 5924|      0|	return(NULL);
 5925|      0|    }
 5926|       |    /*
 5927|       |     * Search an existing namespace definition inherited.
 5928|       |     */
 5929|  2.09k|    res = xmlSearchNsByHrefSafe(tree, ns->href, &def);
 5930|  2.09k|    if (res < 0)
  ------------------
  |  Branch (5930:9): [True: 0, False: 2.09k]
  ------------------
 5931|      0|        return(NULL);
 5932|  2.09k|    if (def != NULL)
  ------------------
  |  Branch (5932:9): [True: 1.41k, False: 689]
  ------------------
 5933|  1.41k|        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|    689|    if (ns->prefix == NULL)
  ------------------
  |  Branch (5939:9): [True: 0, False: 689]
  ------------------
 5940|      0|	snprintf((char *) prefix, sizeof(prefix), "default");
 5941|    689|    else
 5942|    689|	snprintf((char *) prefix, sizeof(prefix), "%.20s", (char *)ns->prefix);
 5943|       |
 5944|    689|    res = xmlSearchNsSafe(tree, prefix, &def);
 5945|    689|    if (res < 0)
  ------------------
  |  Branch (5945:9): [True: 0, False: 689]
  ------------------
 5946|      0|        return(NULL);
 5947|  2.58k|    while (def != NULL) {
  ------------------
  |  Branch (5947:12): [True: 1.89k, False: 689]
  ------------------
 5948|  1.89k|        if (counter > 1000) return(NULL);
  ------------------
  |  Branch (5948:13): [True: 0, False: 1.89k]
  ------------------
 5949|  1.89k|	if (ns->prefix == NULL)
  ------------------
  |  Branch (5949:6): [True: 0, False: 1.89k]
  ------------------
 5950|      0|	    snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
 5951|  1.89k|	else
 5952|  1.89k|	    snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
 5953|  1.89k|		(char *)ns->prefix, counter++);
 5954|  1.89k|	res = xmlSearchNsSafe(tree, prefix, &def);
 5955|  1.89k|        if (res < 0)
  ------------------
  |  Branch (5955:13): [True: 0, False: 1.89k]
  ------------------
 5956|      0|            return(NULL);
 5957|  1.89k|    }
 5958|       |
 5959|       |    /*
 5960|       |     * OK, now we are ready to create a new one.
 5961|       |     */
 5962|    689|    def = xmlNewNs(tree, ns->href, prefix);
 5963|    689|    return(def);
 5964|    689|}
tree.c:xmlGetPropNodeInternal:
 6124|  11.3M|{
 6125|  11.3M|    xmlAttrPtr prop;
 6126|       |
 6127|       |    /* Avoid unused variable warning if features are disabled. */
 6128|  11.3M|    (void) useDTD;
 6129|       |
 6130|  11.3M|    if ((node == NULL) || (node->type != XML_ELEMENT_NODE) || (name == NULL))
  ------------------
  |  Branch (6130:9): [True: 0, False: 11.3M]
  |  Branch (6130:27): [True: 13.1k, False: 11.3M]
  |  Branch (6130:63): [True: 0, False: 11.3M]
  ------------------
 6131|  13.1k|	return(NULL);
 6132|       |
 6133|  11.3M|    if (node->properties != NULL) {
  ------------------
  |  Branch (6133:9): [True: 470k, False: 10.8M]
  ------------------
 6134|   470k|	prop = node->properties;
 6135|   470k|	if (nsName == NULL) {
  ------------------
  |  Branch (6135:6): [True: 63.7k, False: 407k]
  ------------------
 6136|       |	    /*
 6137|       |	    * We want the attr to be in no namespace.
 6138|       |	    */
 6139|   104k|	    do {
 6140|   104k|		if ((prop->ns == NULL) && xmlStrEqual(prop->name, name)) {
  ------------------
  |  Branch (6140:7): [True: 95.3k, False: 9.30k]
  |  Branch (6140:29): [True: 31.7k, False: 63.5k]
  ------------------
 6141|  31.7k|		    return(prop);
 6142|  31.7k|		}
 6143|  72.8k|		prop = prop->next;
 6144|  72.8k|	    } while (prop != NULL);
  ------------------
  |  Branch (6144:15): [True: 40.8k, False: 31.9k]
  ------------------
 6145|   407k|	} else {
 6146|       |	    /*
 6147|       |	    * We want the attr to be in the specified namespace.
 6148|       |	    */
 6149|   508k|	    do {
 6150|   508k|		if ((prop->ns != NULL) && xmlStrEqual(prop->name, name) &&
  ------------------
  |  Branch (6150:7): [True: 271k, False: 236k]
  |  Branch (6150:29): [True: 255k, False: 15.8k]
  ------------------
 6151|   255k|		    ((prop->ns->href == nsName) ||
  ------------------
  |  Branch (6151:8): [True: 1.73k, False: 254k]
  ------------------
 6152|   254k|		     xmlStrEqual(prop->ns->href, nsName)))
  ------------------
  |  Branch (6152:8): [True: 253k, False: 669]
  ------------------
 6153|   255k|		{
 6154|   255k|		    return(prop);
 6155|   255k|		}
 6156|   253k|		prop = prop->next;
 6157|   253k|	    } while (prop != NULL);
  ------------------
  |  Branch (6157:15): [True: 101k, False: 152k]
  ------------------
 6158|   407k|	}
 6159|   470k|    }
 6160|       |
 6161|  11.0M|    if (! useDTD)
  ------------------
  |  Branch (6161:9): [True: 11.0M, False: 0]
  ------------------
 6162|  11.0M|	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|   283k|{
 6254|   283k|    if (prop == NULL)
  ------------------
  |  Branch (6254:9): [True: 0, False: 283k]
  ------------------
 6255|      0|	return(NULL);
 6256|   283k|    if (prop->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6256:9): [True: 283k, False: 0]
  ------------------
 6257|   283k|	return(xmlNodeGetContent((xmlNodePtr) prop));
 6258|   283k|    } 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|   283k|}

xmlParseURISafe:
  962|   383k|xmlParseURISafe(const char *str, xmlURI **uriOut) {
  963|   383k|    xmlURIPtr uri;
  964|   383k|    int ret;
  965|       |
  966|   383k|    if (uriOut == NULL)
  ------------------
  |  Branch (966:9): [True: 0, False: 383k]
  ------------------
  967|      0|        return(1);
  968|   383k|    *uriOut = NULL;
  969|   383k|    if (str == NULL)
  ------------------
  |  Branch (969:9): [True: 0, False: 383k]
  ------------------
  970|      0|	return(1);
  971|       |
  972|   383k|    uri = xmlCreateURI();
  973|   383k|    if (uri == NULL)
  ------------------
  |  Branch (973:9): [True: 182, False: 383k]
  ------------------
  974|    182|        return(-1);
  975|       |
  976|   383k|    ret = xmlParse3986URIReference(uri, str);
  977|   383k|    if (ret) {
  ------------------
  |  Branch (977:9): [True: 26.4k, False: 357k]
  ------------------
  978|  26.4k|        xmlFreeURI(uri);
  979|  26.4k|        return(ret);
  980|  26.4k|    }
  981|       |
  982|   357k|    *uriOut = uri;
  983|   357k|    return(0);
  984|   383k|}
xmlParseURIReference:
 1012|  1.05k|xmlParseURIReference(xmlURI *uri, const char *str) {
 1013|  1.05k|    return(xmlParse3986URIReference(uri, str));
 1014|  1.05k|}
xmlCreateURI:
 1058|   421k|xmlCreateURI(void) {
 1059|   421k|    xmlURIPtr ret;
 1060|       |
 1061|   421k|    ret = (xmlURIPtr) xmlMalloc(sizeof(xmlURI));
 1062|   421k|    if (ret == NULL)
  ------------------
  |  Branch (1062:9): [True: 222, False: 421k]
  ------------------
 1063|    222|	return(NULL);
 1064|   421k|    memset(ret, 0, sizeof(xmlURI));
 1065|   421k|    ret->port = PORT_EMPTY;
  ------------------
  |  |   36|   421k|#define PORT_EMPTY           0
  ------------------
 1066|   421k|    return(ret);
 1067|   421k|}
xmlSaveUri:
 1095|  61.2k|xmlSaveUri(xmlURI *uri) {
 1096|  61.2k|    xmlChar *ret = NULL;
 1097|  61.2k|    xmlChar *temp;
 1098|  61.2k|    const char *p;
 1099|  61.2k|    int len;
 1100|  61.2k|    int max;
 1101|       |
 1102|  61.2k|    if (uri == NULL) return(NULL);
  ------------------
  |  Branch (1102:9): [True: 0, False: 61.2k]
  ------------------
 1103|       |
 1104|       |
 1105|  61.2k|    max = 80;
 1106|  61.2k|    ret = xmlMalloc(max + 1);
 1107|  61.2k|    if (ret == NULL)
  ------------------
  |  Branch (1107:9): [True: 91, False: 61.2k]
  ------------------
 1108|     91|	return(NULL);
 1109|  61.2k|    len = 0;
 1110|       |
 1111|  61.2k|    if (uri->scheme != NULL) {
  ------------------
  |  Branch (1111:9): [True: 14.3k, False: 46.8k]
  ------------------
 1112|  14.3k|	p = uri->scheme;
 1113|   108k|	while (*p != 0) {
  ------------------
  |  Branch (1113:9): [True: 94.5k, False: 14.3k]
  ------------------
 1114|  94.5k|	    if (len >= max) {
  ------------------
  |  Branch (1114:10): [True: 232, False: 94.2k]
  ------------------
 1115|    232|                temp = xmlSaveUriRealloc(ret, &max);
 1116|    232|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1116:21): [True: 2, False: 230]
  ------------------
 1117|    230|		ret = temp;
 1118|    230|	    }
 1119|  94.5k|	    ret[len++] = *p++;
 1120|  94.5k|	}
 1121|  14.3k|	if (len >= max) {
  ------------------
  |  Branch (1121:6): [True: 204, False: 14.1k]
  ------------------
 1122|    204|            temp = xmlSaveUriRealloc(ret, &max);
 1123|    204|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1123:17): [True: 2, False: 202]
  ------------------
 1124|    202|            ret = temp;
 1125|    202|	}
 1126|  14.3k|	ret[len++] = ':';
 1127|  14.3k|    }
 1128|  61.1k|    if (uri->opaque != NULL) {
  ------------------
  |  Branch (1128:9): [True: 0, False: 61.1k]
  ------------------
 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|  61.1k|    } else {
 1147|  61.1k|	if ((uri->server != NULL) || (uri->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  50.1k|#define PORT_EMPTY           0
  ------------------
  |  Branch (1147:6): [True: 11.0k, False: 50.1k]
  |  Branch (1147:31): [True: 2.38k, False: 47.7k]
  ------------------
 1148|  13.4k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1148:10): [True: 221, False: 13.2k]
  ------------------
 1149|    221|                temp = xmlSaveUriRealloc(ret, &max);
 1150|    221|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1150:21): [True: 3, False: 218]
  ------------------
 1151|    218|                ret = temp;
 1152|    218|	    }
 1153|  13.4k|	    ret[len++] = '/';
 1154|  13.4k|	    ret[len++] = '/';
 1155|  13.4k|	    if (uri->user != NULL) {
  ------------------
  |  Branch (1155:10): [True: 5.21k, False: 8.21k]
  ------------------
 1156|  5.21k|		p = uri->user;
 1157|  36.7M|		while (*p != 0) {
  ------------------
  |  Branch (1157:10): [True: 36.7M, False: 5.20k]
  ------------------
 1158|  36.7M|		    if (len + 3 >= max) {
  ------------------
  |  Branch (1158:11): [True: 3.22k, False: 36.6M]
  ------------------
 1159|  3.22k|                        temp = xmlSaveUriRealloc(ret, &max);
 1160|  3.22k|                        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1160:29): [True: 11, False: 3.21k]
  ------------------
 1161|  3.21k|                        ret = temp;
 1162|  3.21k|		    }
 1163|  36.7M|		    if ((IS_UNRESERVED(*(p))) ||
  ------------------
  |  |  103|  36.7M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  73.4M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  73.4M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  73.4M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 23.5k, False: 36.6M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 21.7k, False: 1.79k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  36.6M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 34.8M, False: 1.87M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 34.7M, False: 3.02k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.88M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 78.2k, False: 1.80M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 45.7k, False: 32.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.83M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 1.25k, False: 1.83M]
  |  |  |  |  |  Branch (79:37): [True: 1.17k, False: 1.83M]
  |  |  |  |  |  Branch (79:53): [True: 2.60k, False: 1.83M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.83M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 2.13k, False: 1.82M]
  |  |  |  |  |  Branch (80:21): [True: 1.76k, False: 1.82M]
  |  |  |  |  |  Branch (80:37): [True: 1.31k, False: 1.82M]
  |  |  |  |  |  Branch (80:53): [True: 1.69k, False: 1.82M]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.83M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.50k, False: 1.82M]
  |  |  |  |  |  Branch (81:21): [True: 1.35k, False: 1.82M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1164|  1.82M|			((*(p) == ';')) || ((*(p) == ':')) ||
  ------------------
  |  Branch (1164:4): [True: 8.73k, False: 1.81M]
  |  Branch (1164:23): [True: 4.61k, False: 1.80M]
  ------------------
 1165|  1.80M|			((*(p) == '&')) || ((*(p) == '=')) ||
  ------------------
  |  Branch (1165:4): [True: 319, False: 1.80M]
  |  Branch (1165:23): [True: 1.89k, False: 1.80M]
  ------------------
 1166|  1.80M|			((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1166:4): [True: 1.97k, False: 1.80M]
  |  Branch (1166:23): [True: 2.21k, False: 1.80M]
  ------------------
 1167|  1.80M|			((*(p) == ',')))
  ------------------
  |  Branch (1167:4): [True: 808, False: 1.80M]
  ------------------
 1168|  34.9M|			ret[len++] = *p++;
 1169|  1.80M|		    else {
 1170|  1.80M|			int val = *(unsigned char *)p++;
 1171|  1.80M|			int hi = val / 0x10, lo = val % 0x10;
 1172|  1.80M|			ret[len++] = '%';
 1173|  1.80M|			ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1173:23): [True: 3.89k, False: 1.79M]
  ------------------
 1174|  1.80M|			ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1174:23): [True: 37.5k, False: 1.76M]
  ------------------
 1175|  1.80M|		    }
 1176|  36.7M|		}
 1177|  5.20k|		if (len + 3 >= max) {
  ------------------
  |  Branch (1177:7): [True: 605, False: 4.60k]
  ------------------
 1178|    605|                    temp = xmlSaveUriRealloc(ret, &max);
 1179|    605|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1179:25): [True: 1, False: 604]
  ------------------
 1180|    604|                    ret = temp;
 1181|    604|		}
 1182|  5.20k|		ret[len++] = '@';
 1183|  5.20k|	    }
 1184|  13.4k|	    if (uri->server != NULL) {
  ------------------
  |  Branch (1184:10): [True: 11.0k, False: 2.38k]
  ------------------
 1185|  11.0k|		p = uri->server;
 1186|  6.92M|		while (*p != 0) {
  ------------------
  |  Branch (1186:10): [True: 6.91M, False: 11.0k]
  ------------------
 1187|  6.91M|		    if (len >= max) {
  ------------------
  |  Branch (1187:11): [True: 319, False: 6.91M]
  ------------------
 1188|    319|			temp = xmlSaveUriRealloc(ret, &max);
 1189|    319|			if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1189:8): [True: 8, False: 311]
  ------------------
 1190|    311|			ret = temp;
 1191|    311|		    }
 1192|       |                    /* TODO: escaping? */
 1193|  6.91M|		    ret[len++] = (xmlChar) *p++;
 1194|  6.91M|		}
 1195|  11.0k|	    }
 1196|  13.4k|            if (uri->port > 0) {
  ------------------
  |  Branch (1196:17): [True: 1.71k, False: 11.6k]
  ------------------
 1197|  1.71k|                if (len + 10 >= max) {
  ------------------
  |  Branch (1197:21): [True: 207, False: 1.50k]
  ------------------
 1198|    207|                    temp = xmlSaveUriRealloc(ret, &max);
 1199|    207|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1199:25): [True: 2, False: 205]
  ------------------
 1200|    205|                    ret = temp;
 1201|    205|                }
 1202|  1.71k|                len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
 1203|  1.71k|            }
 1204|  47.7k|	} else if (uri->authority != NULL) {
  ------------------
  |  Branch (1204:13): [True: 0, False: 47.7k]
  ------------------
 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|  47.7k|	} else if (uri->scheme != NULL) {
  ------------------
  |  Branch (1232:13): [True: 1.05k, False: 46.7k]
  ------------------
 1233|  1.05k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1233:10): [True: 227, False: 827]
  ------------------
 1234|    227|                temp = xmlSaveUriRealloc(ret, &max);
 1235|    227|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1235:21): [True: 1, False: 226]
  ------------------
 1236|    226|                ret = temp;
 1237|    226|	    }
 1238|  1.05k|	}
 1239|  61.1k|	if (uri->path != NULL) {
  ------------------
  |  Branch (1239:6): [True: 54.6k, False: 6.49k]
  ------------------
 1240|  54.6k|	    p = uri->path;
 1241|       |	    /*
 1242|       |	     * the colon in file:///d: should not be escaped or
 1243|       |	     * Windows accesses fail later.
 1244|       |	     */
 1245|  54.6k|	    if ((uri->scheme != NULL) &&
  ------------------
  |  Branch (1245:10): [True: 10.0k, False: 44.6k]
  ------------------
 1246|  10.0k|		(p[0] == '/') &&
  ------------------
  |  Branch (1246:3): [True: 9.13k, False: 913]
  ------------------
 1247|  9.13k|		(((p[1] >= 'a') && (p[1] <= 'z')) ||
  ------------------
  |  Branch (1247:5): [True: 1.97k, False: 7.16k]
  |  Branch (1247:22): [True: 1.69k, False: 279]
  ------------------
 1248|  7.44k|		 ((p[1] >= 'A') && (p[1] <= 'Z'))) &&
  ------------------
  |  Branch (1248:5): [True: 960, False: 6.48k]
  |  Branch (1248:22): [True: 547, False: 413]
  ------------------
 1249|  2.24k|		(p[2] == ':') &&
  ------------------
  |  Branch (1249:3): [True: 925, False: 1.31k]
  ------------------
 1250|    925|	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    925|#define BAD_CAST (xmlChar *)
  ------------------
              	        (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
  ------------------
  |  |   34|    925|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1250:10): [True: 410, False: 515]
  ------------------
 1251|    410|		if (len + 3 >= max) {
  ------------------
  |  Branch (1251:7): [True: 206, False: 204]
  ------------------
 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|    408|		ret[len++] = *p++;
 1257|    408|		ret[len++] = *p++;
 1258|    408|		ret[len++] = *p++;
 1259|    408|	    }
 1260|  5.29M|	    while (*p != 0) {
  ------------------
  |  Branch (1260:13): [True: 5.24M, False: 54.6k]
  ------------------
 1261|  5.24M|		if (len + 3 >= max) {
  ------------------
  |  Branch (1261:7): [True: 2.28k, False: 5.24M]
  ------------------
 1262|  2.28k|                    temp = xmlSaveUriRealloc(ret, &max);
 1263|  2.28k|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1263:25): [True: 3, False: 2.28k]
  ------------------
 1264|  2.28k|                    ret = temp;
 1265|  2.28k|		}
 1266|  5.24M|		if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
  ------------------
  |  |  103|  5.24M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  10.4M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  10.4M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  10.4M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 291k, False: 4.95M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 289k, False: 2.62k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  4.95M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 3.75M, False: 1.20M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 3.74M, False: 3.58k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  1.20M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 46.4k, False: 1.15M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 31.7k, False: 14.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  1.17M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 20.4k, False: 1.15M]
  |  |  |  |  |  Branch (79:37): [True: 924, False: 1.15M]
  |  |  |  |  |  Branch (79:53): [True: 70.3k, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  |   80|  1.17M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 3.26k, False: 1.07M]
  |  |  |  |  |  Branch (80:21): [True: 1.56k, False: 1.07M]
  |  |  |  |  |  Branch (80:37): [True: 958k, False: 118k]
  |  |  |  |  |  Branch (80:53): [True: 1.69k, False: 116k]
  |  |  |  |  ------------------
  |  |  |  |   81|  1.17M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 1.81k, False: 115k]
  |  |  |  |  |  Branch (81:21): [True: 2.66k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1266:32): [True: 82.7k, False: 29.6k]
  ------------------
 1267|  29.6k|                    ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
  ------------------
  |  Branch (1267:21): [True: 3.00k, False: 26.6k]
  |  Branch (1267:40): [True: 2.82k, False: 23.7k]
  |  Branch (1267:59): [True: 395, False: 23.3k]
  ------------------
 1268|  23.3k|	            ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||
  ------------------
  |  Branch (1268:14): [True: 710, False: 22.6k]
  |  Branch (1268:33): [True: 2.88k, False: 19.7k]
  |  Branch (1268:52): [True: 2.82k, False: 16.9k]
  ------------------
 1269|  16.9k|	            ((*(p) == ',')))
  ------------------
  |  Branch (1269:14): [True: 2.53k, False: 14.4k]
  ------------------
 1270|  5.22M|		    ret[len++] = *p++;
 1271|  14.4k|		else {
 1272|  14.4k|		    int val = *(unsigned char *)p++;
 1273|  14.4k|		    int hi = val / 0x10, lo = val % 0x10;
 1274|  14.4k|		    ret[len++] = '%';
 1275|  14.4k|		    ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1275:26): [True: 1.41k, False: 13.0k]
  ------------------
 1276|  14.4k|		    ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1276:26): [True: 6.88k, False: 7.55k]
  ------------------
 1277|  14.4k|		}
 1278|  5.24M|	    }
 1279|  54.6k|	}
 1280|  61.1k|	if (uri->query_raw != NULL) {
  ------------------
  |  Branch (1280:6): [True: 4.71k, False: 56.4k]
  ------------------
 1281|  4.71k|	    if (len + 1 >= max) {
  ------------------
  |  Branch (1281:10): [True: 203, False: 4.50k]
  ------------------
 1282|    203|                temp = xmlSaveUriRealloc(ret, &max);
 1283|    203|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1283:21): [True: 1, False: 202]
  ------------------
 1284|    202|                ret = temp;
 1285|    202|	    }
 1286|  4.70k|	    ret[len++] = '?';
 1287|  4.70k|	    p = uri->query_raw;
 1288|  7.53M|	    while (*p != 0) {
  ------------------
  |  Branch (1288:13): [True: 7.53M, False: 4.69k]
  ------------------
 1289|  7.53M|		if (len + 1 >= max) {
  ------------------
  |  Branch (1289:7): [True: 606, False: 7.52M]
  ------------------
 1290|    606|                    temp = xmlSaveUriRealloc(ret, &max);
 1291|    606|                    if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1291:25): [True: 14, False: 592]
  ------------------
 1292|    592|                    ret = temp;
 1293|    592|		}
 1294|  7.53M|		ret[len++] = *p++;
 1295|  7.53M|	    }
 1296|  56.4k|	} else if (uri->query != NULL) {
  ------------------
  |  Branch (1296:13): [True: 0, False: 56.4k]
  ------------------
 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|  61.1k|    }
 1322|  61.1k|    if (uri->fragment != NULL) {
  ------------------
  |  Branch (1322:9): [True: 6.90k, False: 54.2k]
  ------------------
 1323|  6.90k|	if (len + 3 >= max) {
  ------------------
  |  Branch (1323:6): [True: 805, False: 6.10k]
  ------------------
 1324|    805|            temp = xmlSaveUriRealloc(ret, &max);
 1325|    805|            if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1325:17): [True: 3, False: 802]
  ------------------
 1326|    802|            ret = temp;
 1327|    802|	}
 1328|  6.90k|	ret[len++] = '#';
 1329|  6.90k|	p = uri->fragment;
 1330|  41.1k|	while (*p != 0) {
  ------------------
  |  Branch (1330:9): [True: 34.2k, False: 6.90k]
  ------------------
 1331|  34.2k|	    if (len + 3 >= max) {
  ------------------
  |  Branch (1331:10): [True: 311, False: 33.9k]
  ------------------
 1332|    311|                temp = xmlSaveUriRealloc(ret, &max);
 1333|    311|                if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1333:21): [True: 2, False: 309]
  ------------------
 1334|    309|                ret = temp;
 1335|    309|	    }
 1336|  34.2k|	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |  103|  34.2k|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  68.4k|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  68.4k|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  68.4k|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 3.00k, False: 31.2k]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 2.67k, False: 328]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  31.5k|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 12.2k, False: 19.2k]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 10.4k, False: 1.81k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  21.0k|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 8.47k, False: 12.6k]
  |  |  |  |  |  |  |  Branch (68:38): [True: 3.84k, False: 4.62k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  17.2k|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 599, False: 16.6k]
  |  |  |  |  |  Branch (79:37): [True: 381, False: 16.2k]
  |  |  |  |  |  Branch (79:53): [True: 514, False: 15.7k]
  |  |  |  |  ------------------
  |  |  |  |   80|  17.2k|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 793, False: 14.9k]
  |  |  |  |  |  Branch (80:21): [True: 328, False: 14.6k]
  |  |  |  |  |  Branch (80:37): [True: 628, False: 13.9k]
  |  |  |  |  |  Branch (80:53): [True: 761, False: 13.2k]
  |  |  |  |  ------------------
  |  |  |  |   81|  17.2k|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 435, False: 12.8k]
  |  |  |  |  |  Branch (81:21): [True: 320, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              	    if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
  ------------------
  |  |   95|  12.4k|#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
  |  |  ------------------
  |  |  |  Branch (95:25): [True: 844, False: 11.6k]
  |  |  |  Branch (95:41): [True: 668, False: 10.9k]
  |  |  |  Branch (95:57): [True: 762, False: 10.2k]
  |  |  ------------------
  |  |   96|  12.4k|        ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
  |  |  ------------------
  |  |  |  Branch (96:9): [True: 341, False: 9.86k]
  |  |  |  Branch (96:25): [True: 558, False: 9.30k]
  |  |  |  Branch (96:41): [True: 235, False: 9.07k]
  |  |  |  Branch (96:57): [True: 296, False: 8.77k]
  |  |  ------------------
  |  |   97|  12.4k|        ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
  |  |  ------------------
  |  |  |  Branch (97:9): [True: 1.01k, False: 7.76k]
  |  |  |  Branch (97:25): [True: 418, False: 7.34k]
  |  |  |  Branch (97:41): [True: 5.76k, False: 1.58k]
  |  |  |  Branch (97:57): [True: 776, False: 805]
  |  |  ------------------
  |  |   98|  12.4k|        ((x) == ']'))
  |  |  ------------------
  |  |  |  Branch (98:9): [True: 331, False: 474]
  |  |  ------------------
  ------------------
 1337|  33.7k|		ret[len++] = *p++;
 1338|    474|	    else {
 1339|    474|		int val = *(unsigned char *)p++;
 1340|    474|		int hi = val / 0x10, lo = val % 0x10;
 1341|    474|		ret[len++] = '%';
 1342|    474|		ret[len++] = hi + (hi > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1342:22): [True: 392, False: 82]
  ------------------
 1343|    474|		ret[len++] = lo + (lo > 9? 'A'-10 : '0');
  ------------------
  |  Branch (1343:22): [True: 333, False: 141]
  ------------------
 1344|    474|	    }
 1345|  34.2k|	}
 1346|  6.90k|    }
 1347|  61.1k|    if (len >= max) {
  ------------------
  |  Branch (1347:9): [True: 218, False: 60.9k]
  ------------------
 1348|    218|        temp = xmlSaveUriRealloc(ret, &max);
 1349|    218|        if (temp == NULL) goto mem_error;
  ------------------
  |  Branch (1349:13): [True: 1, False: 217]
  ------------------
 1350|    217|        ret = temp;
 1351|    217|    }
 1352|  61.1k|    ret[len] = 0;
 1353|  61.1k|    return(ret);
 1354|       |
 1355|     56|mem_error:
 1356|     56|    xmlFree(ret);
 1357|       |    return(NULL);
 1358|  61.1k|}
xmlFreeURI:
 1412|   444k|xmlFreeURI(xmlURI *uri) {
 1413|   444k|    if (uri == NULL) return;
  ------------------
  |  Branch (1413:9): [True: 23.2k, False: 421k]
  ------------------
 1414|       |
 1415|   421k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1415:9): [True: 44.4k, False: 376k]
  ------------------
 1416|   421k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1416:9): [True: 33.0k, False: 388k]
  ------------------
 1417|   421k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1417:9): [True: 9.87k, False: 411k]
  ------------------
 1418|   421k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1418:9): [True: 213k, False: 207k]
  ------------------
 1419|   421k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1419:9): [True: 173k, False: 247k]
  ------------------
 1420|   421k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1420:9): [True: 0, False: 421k]
  ------------------
 1421|   421k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1421:9): [True: 0, False: 421k]
  ------------------
 1422|   421k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1422:9): [True: 7.96k, False: 413k]
  ------------------
 1423|   421k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1423:9): [True: 11.3k, False: 409k]
  ------------------
 1424|   421k|    xmlFree(uri);
 1425|   421k|}
xmlNormalizeURIPath:
 1555|  8.03k|xmlNormalizeURIPath(char *path) {
 1556|  8.03k|    return(xmlNormalizePath(path, 0));
 1557|  8.03k|}
xmlURIUnescapeString:
 1580|   592k|xmlURIUnescapeString(const char *str, int len, char *target) {
 1581|   592k|    char *ret, *out;
 1582|   592k|    const char *in;
 1583|       |
 1584|   592k|    if (str == NULL)
  ------------------
  |  Branch (1584:9): [True: 0, False: 592k]
  ------------------
 1585|      0|	return(NULL);
 1586|   592k|    if (len <= 0) len = strlen(str);
  ------------------
  |  Branch (1586:9): [True: 184k, False: 407k]
  ------------------
 1587|   592k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1587:9): [True: 0, False: 592k]
  ------------------
 1588|       |
 1589|   592k|    if (target == NULL) {
  ------------------
  |  Branch (1589:9): [True: 592k, False: 0]
  ------------------
 1590|   592k|	ret = xmlMalloc(len + 1);
 1591|   592k|	if (ret == NULL)
  ------------------
  |  Branch (1591:6): [True: 324, False: 592k]
  ------------------
 1592|    324|	    return(NULL);
 1593|   592k|    } else
 1594|      0|	ret = target;
 1595|   592k|    in = str;
 1596|   592k|    out = ret;
 1597|   118M|    while(len > 0) {
  ------------------
  |  Branch (1597:11): [True: 117M, False: 592k]
  ------------------
 1598|   117M|	if ((len > 2) && (*in == '%') && (is_hex(in[1])) && (is_hex(in[2]))) {
  ------------------
  |  Branch (1598:6): [True: 117M, False: 719k]
  |  Branch (1598:19): [True: 1.87M, False: 115M]
  |  Branch (1598:35): [True: 1.87M, False: 2.02k]
  |  Branch (1598:54): [True: 1.87M, False: 1.92k]
  ------------------
 1599|  1.87M|            int c = 0;
 1600|  1.87M|	    in++;
 1601|  1.87M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1601:10): [True: 1.87M, False: 0]
  |  Branch (1601:26): [True: 1.85M, False: 16.3k]
  ------------------
 1602|  1.85M|	        c = (*in - '0');
 1603|  16.3k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1603:15): [True: 6.33k, False: 9.97k]
  |  Branch (1603:31): [True: 6.33k, False: 0]
  ------------------
 1604|  6.33k|	        c = (*in - 'a') + 10;
 1605|  9.97k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1605:15): [True: 9.97k, False: 0]
  |  Branch (1605:31): [True: 9.97k, False: 0]
  ------------------
 1606|  9.97k|	        c = (*in - 'A') + 10;
 1607|  1.87M|	    in++;
 1608|  1.87M|	    if ((*in >= '0') && (*in <= '9'))
  ------------------
  |  Branch (1608:10): [True: 1.87M, False: 0]
  |  Branch (1608:26): [True: 1.85M, False: 15.2k]
  ------------------
 1609|  1.85M|	        c = c * 16 + (*in - '0');
 1610|  15.2k|	    else if ((*in >= 'a') && (*in <= 'f'))
  ------------------
  |  Branch (1610:15): [True: 5.62k, False: 9.65k]
  |  Branch (1610:31): [True: 5.62k, False: 0]
  ------------------
 1611|  5.62k|	        c = c * 16 + (*in - 'a') + 10;
 1612|  9.65k|	    else if ((*in >= 'A') && (*in <= 'F'))
  ------------------
  |  Branch (1612:15): [True: 9.65k, False: 0]
  |  Branch (1612:31): [True: 9.65k, False: 0]
  ------------------
 1613|  9.65k|	        c = c * 16 + (*in - 'A') + 10;
 1614|  1.87M|	    in++;
 1615|  1.87M|	    len -= 3;
 1616|       |            /* Explicit sign change */
 1617|  1.87M|	    *out++ = (char) c;
 1618|   116M|	} else {
 1619|   116M|	    *out++ = *in++;
 1620|   116M|	    len--;
 1621|   116M|	}
 1622|   117M|    }
 1623|   592k|    *out = 0;
 1624|   592k|    return(ret);
 1625|   592k|}
xmlURIEscapeStr:
 1637|  2.16k|xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
 1638|  2.16k|    xmlChar *ret, ch;
 1639|  2.16k|    const xmlChar *in;
 1640|  2.16k|    int len, out;
 1641|       |
 1642|  2.16k|    if (str == NULL)
  ------------------
  |  Branch (1642:9): [True: 0, False: 2.16k]
  ------------------
 1643|      0|	return(NULL);
 1644|  2.16k|    if (str[0] == 0)
  ------------------
  |  Branch (1644:9): [True: 0, False: 2.16k]
  ------------------
 1645|      0|	return(xmlStrdup(str));
 1646|  2.16k|    len = xmlStrlen(str);
 1647|  2.16k|    if (len == 0)
  ------------------
  |  Branch (1647:9): [True: 0, False: 2.16k]
  ------------------
 1648|      0|        return(NULL);
 1649|       |
 1650|  2.16k|    len += 20;
 1651|  2.16k|    ret = xmlMalloc(len);
 1652|  2.16k|    if (ret == NULL)
  ------------------
  |  Branch (1652:9): [True: 6, False: 2.15k]
  ------------------
 1653|      6|	return(NULL);
 1654|  2.15k|    in = (const xmlChar *) str;
 1655|  2.15k|    out = 0;
 1656|  3.52M|    while(*in != 0) {
  ------------------
  |  Branch (1656:11): [True: 3.51M, False: 2.15k]
  ------------------
 1657|  3.51M|	if (len - out <= 3) {
  ------------------
  |  Branch (1657:6): [True: 928, False: 3.51M]
  ------------------
 1658|    928|            xmlChar *temp;
 1659|    928|            int newSize;
 1660|       |
 1661|    928|            newSize = xmlGrowCapacity(len, 1, 1, XML_MAX_ITEMS);
  ------------------
  |  |   13|    928|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1662|    928|            if (newSize < 0) {
  ------------------
  |  Branch (1662:17): [True: 0, False: 928]
  ------------------
 1663|      0|		xmlFree(ret);
 1664|      0|                return(NULL);
 1665|      0|            }
 1666|    928|            temp = xmlRealloc(ret, newSize);
 1667|    928|	    if (temp == NULL) {
  ------------------
  |  Branch (1667:10): [True: 1, False: 927]
  ------------------
 1668|      1|		xmlFree(ret);
 1669|      1|		return(NULL);
 1670|      1|	    }
 1671|    927|	    ret = temp;
 1672|    927|            len = newSize;
 1673|    927|	}
 1674|       |
 1675|  3.51M|	ch = *in;
 1676|       |
 1677|  3.51M|	if ((ch != '@') && (!IS_UNRESERVED(ch)) && (!xmlStrchr(list, ch))) {
  ------------------
  |  |  103|  3.51M|#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   73|  7.03M|#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.03M|#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   53|  7.03M|#define IS_LOWALPHA(x) (((x) >= 'a') && ((x) <= 'z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (53:25): [True: 186k, False: 3.33M]
  |  |  |  |  |  |  |  |  |  Branch (53:41): [True: 169k, False: 17.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   60|  3.34M|#define IS_UPALPHA(x) (((x) >= 'A') && ((x) <= 'Z'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (60:24): [True: 162k, False: 3.18M]
  |  |  |  |  |  |  |  |  |  Branch (60:40): [True: 141k, False: 21.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|  3.20M|#define IS_DIGIT(x) (((x) >= '0') && ((x) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (68:22): [True: 60.1k, False: 3.14M]
  |  |  |  |  |  |  |  Branch (68:38): [True: 27.6k, False: 32.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
  |  |  ------------------
  |  |  |  |   79|  3.18M|#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') ||     \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (79:21): [True: 26.0k, False: 3.15M]
  |  |  |  |  |  Branch (79:37): [True: 1.44k, False: 3.15M]
  |  |  |  |  |  Branch (79:53): [True: 148k, False: 3.00M]
  |  |  |  |  ------------------
  |  |  |  |   80|  3.18M|    ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') ||    \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (80:5): [True: 11.6k, False: 2.99M]
  |  |  |  |  |  Branch (80:21): [True: 827, False: 2.99M]
  |  |  |  |  |  Branch (80:37): [True: 1.12M, False: 1.86M]
  |  |  |  |  |  Branch (80:53): [True: 2.80k, False: 1.86M]
  |  |  |  |  ------------------
  |  |  |  |   81|  3.18M|    ((x) == '(') || ((x) == ')'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (81:5): [True: 4.25k, False: 1.85M]
  |  |  |  |  |  Branch (81:21): [True: 5.63k, False: 1.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1677:6): [True: 3.51M, False: 1.12k]
  |  Branch (1677:45): [True: 1.73M, False: 116k]
  ------------------
 1678|  1.73M|	    unsigned char val;
 1679|  1.73M|	    ret[out++] = '%';
 1680|  1.73M|	    val = ch >> 4;
 1681|  1.73M|	    if (val <= 9)
  ------------------
  |  Branch (1681:10): [True: 1.73M, False: 5.83k]
  ------------------
 1682|  1.73M|		ret[out++] = '0' + val;
 1683|  5.83k|	    else
 1684|  5.83k|		ret[out++] = 'A' + val - 0xA;
 1685|  1.73M|	    val = ch & 0xF;
 1686|  1.73M|	    if (val <= 9)
  ------------------
  |  Branch (1686:10): [True: 1.72M, False: 15.5k]
  ------------------
 1687|  1.72M|		ret[out++] = '0' + val;
 1688|  15.5k|	    else
 1689|  15.5k|		ret[out++] = 'A' + val - 0xA;
 1690|  1.73M|	    in++;
 1691|  1.78M|	} else {
 1692|  1.78M|	    ret[out++] = *in++;
 1693|  1.78M|	}
 1694|       |
 1695|  3.51M|    }
 1696|  2.15k|    ret[out] = 0;
 1697|  2.15k|    return(ret);
 1698|  2.15k|}
xmlBuildURISafe:
 1972|   231k|xmlBuildURISafe(const xmlChar *URI, const xmlChar *base, xmlChar **valPtr) {
 1973|   231k|    xmlChar *val = NULL;
 1974|   231k|    int ret, len, indx, cur, out;
 1975|   231k|    xmlURIPtr ref = NULL;
 1976|   231k|    xmlURIPtr bas = NULL;
 1977|   231k|    xmlURIPtr res = NULL;
 1978|       |
 1979|   231k|    if (valPtr == NULL)
  ------------------
  |  Branch (1979:9): [True: 0, False: 231k]
  ------------------
 1980|      0|        return(1);
 1981|   231k|    *valPtr = NULL;
 1982|       |
 1983|   231k|    if (URI == NULL)
  ------------------
  |  Branch (1983:9): [True: 0, False: 231k]
  ------------------
 1984|      0|        return(1);
 1985|       |
 1986|   231k|    if (base == NULL) {
  ------------------
  |  Branch (1986:9): [True: 19.5k, False: 212k]
  ------------------
 1987|  19.5k|        val = xmlStrdup(URI);
 1988|  19.5k|        if (val == NULL)
  ------------------
  |  Branch (1988:13): [True: 5, False: 19.5k]
  ------------------
 1989|      5|            return(-1);
 1990|  19.5k|        *valPtr = val;
 1991|  19.5k|        return(0);
 1992|  19.5k|    }
 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|   212k|    if (URI[0] != 0)
  ------------------
  |  Branch (2002:9): [True: 208k, False: 3.60k]
  ------------------
 2003|   208k|        ret = xmlParseURISafe((const char *) URI, &ref);
 2004|  3.60k|    else
 2005|  3.60k|        ret = 0;
 2006|   212k|    if (ret != 0)
  ------------------
  |  Branch (2006:9): [True: 8.57k, False: 203k]
  ------------------
 2007|  8.57k|	goto done;
 2008|   203k|    if ((ref != NULL) && (ref->scheme != NULL)) {
  ------------------
  |  Branch (2008:9): [True: 200k, False: 3.60k]
  |  Branch (2008:26): [True: 5.12k, False: 195k]
  ------------------
 2009|       |	/*
 2010|       |	 * The URI is absolute don't modify.
 2011|       |	 */
 2012|  5.12k|	val = xmlStrdup(URI);
 2013|  5.12k|        if (val == NULL)
  ------------------
  |  Branch (2013:13): [True: 30, False: 5.09k]
  ------------------
 2014|     30|            ret = -1;
 2015|  5.12k|	goto done;
 2016|  5.12k|    }
 2017|       |
 2018|       |    /*
 2019|       |     * If base has no scheme or authority, it is assumed to be a
 2020|       |     * filesystem path.
 2021|       |     */
 2022|   198k|    if (xmlStrstr(base, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|   198k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2022:9): [True: 174k, False: 24.5k]
  ------------------
 2023|   174k|        xmlFreeURI(ref);
 2024|   174k|        return(xmlResolvePath(URI, base, valPtr));
 2025|   174k|    }
 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|  24.5k|    ret = xmlParseURISafe((const char *) base, &bas);
 2045|  24.5k|    if (ret < 0)
  ------------------
  |  Branch (2045:9): [True: 171, False: 24.3k]
  ------------------
 2046|    171|        goto done;
 2047|  24.3k|    if (ret != 0) {
  ------------------
  |  Branch (2047:9): [True: 7.39k, False: 17.0k]
  ------------------
 2048|  7.39k|	if (ref) {
  ------------------
  |  Branch (2048:6): [True: 6.49k, False: 898]
  ------------------
 2049|  6.49k|            ret = 0;
 2050|  6.49k|	    val = xmlSaveUri(ref);
 2051|  6.49k|            if (val == NULL)
  ------------------
  |  Branch (2051:17): [True: 20, False: 6.47k]
  ------------------
 2052|     20|                ret = -1;
 2053|  6.49k|        }
 2054|  7.39k|	goto done;
 2055|  7.39k|    }
 2056|  17.0k|    if (ref == NULL) {
  ------------------
  |  Branch (2056:9): [True: 2.03k, False: 14.9k]
  ------------------
 2057|       |	/*
 2058|       |	 * the base fragment must be ignored
 2059|       |	 */
 2060|  2.03k|	if (bas->fragment != NULL) {
  ------------------
  |  Branch (2060:6): [True: 290, False: 1.74k]
  ------------------
 2061|    290|	    xmlFree(bas->fragment);
 2062|    290|	    bas->fragment = NULL;
 2063|    290|	}
 2064|  2.03k|	val = xmlSaveUri(bas);
 2065|  2.03k|        if (val == NULL)
  ------------------
  |  Branch (2065:13): [True: 15, False: 2.01k]
  ------------------
 2066|     15|            ret = -1;
 2067|  2.03k|	goto done;
 2068|  2.03k|    }
 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.9k|    ret = -1;
 2083|  14.9k|    res = xmlCreateURI();
 2084|  14.9k|    if (res == NULL)
  ------------------
  |  Branch (2084:9): [True: 23, False: 14.9k]
  ------------------
 2085|     23|	goto done;
 2086|  14.9k|    if ((ref->scheme == NULL) && (ref->path == NULL) &&
  ------------------
  |  Branch (2086:9): [True: 14.9k, False: 0]
  |  Branch (2086:34): [True: 5.91k, False: 9.04k]
  ------------------
 2087|  5.91k|	((ref->authority == NULL) && (ref->server == NULL) &&
  ------------------
  |  Branch (2087:3): [True: 5.91k, False: 0]
  |  Branch (2087:31): [True: 5.18k, False: 723]
  ------------------
 2088|  5.18k|         (ref->port == PORT_EMPTY))) {
  ------------------
  |  |   36|  5.18k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2088:10): [True: 4.92k, False: 263]
  ------------------
 2089|  4.92k|	if (bas->scheme != NULL) {
  ------------------
  |  Branch (2089:6): [True: 4.57k, False: 350]
  ------------------
 2090|  4.57k|	    res->scheme = xmlMemStrdup(bas->scheme);
 2091|  4.57k|            if (res->scheme == NULL)
  ------------------
  |  Branch (2091:17): [True: 7, False: 4.56k]
  ------------------
 2092|      7|                goto done;
 2093|  4.57k|        }
 2094|  4.91k|	if (bas->authority != NULL) {
  ------------------
  |  Branch (2094:6): [True: 0, False: 4.91k]
  ------------------
 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.91k|        } else {
 2099|  4.91k|	    if (bas->server != NULL) {
  ------------------
  |  Branch (2099:10): [True: 3.62k, False: 1.28k]
  ------------------
 2100|  3.62k|		res->server = xmlMemStrdup(bas->server);
 2101|  3.62k|                if (res->server == NULL)
  ------------------
  |  Branch (2101:21): [True: 5, False: 3.62k]
  ------------------
 2102|      5|                    goto done;
 2103|  3.62k|            }
 2104|  4.91k|	    if (bas->user != NULL) {
  ------------------
  |  Branch (2104:10): [True: 2.56k, False: 2.35k]
  ------------------
 2105|  2.56k|		res->user = xmlMemStrdup(bas->user);
 2106|  2.56k|                if (res->user == NULL)
  ------------------
  |  Branch (2106:21): [True: 4, False: 2.55k]
  ------------------
 2107|      4|                    goto done;
 2108|  2.56k|            }
 2109|  4.90k|	    res->port = bas->port;
 2110|  4.90k|	}
 2111|  4.90k|	if (bas->path != NULL) {
  ------------------
  |  Branch (2111:6): [True: 2.75k, False: 2.15k]
  ------------------
 2112|  2.75k|	    res->path = xmlMemStrdup(bas->path);
 2113|  2.75k|            if (res->path == NULL)
  ------------------
  |  Branch (2113:17): [True: 5, False: 2.75k]
  ------------------
 2114|      5|                goto done;
 2115|  2.75k|        }
 2116|  4.90k|	if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2116:6): [True: 732, False: 4.17k]
  ------------------
 2117|    732|	    res->query_raw = xmlMemStrdup (ref->query_raw);
 2118|    732|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2118:17): [True: 5, False: 727]
  ------------------
 2119|      5|                goto done;
 2120|  4.17k|        } else if (ref->query != NULL) {
  ------------------
  |  Branch (2120:20): [True: 0, False: 4.17k]
  ------------------
 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|  4.17k|        } else if (bas->query_raw != NULL) {
  ------------------
  |  Branch (2124:20): [True: 1.97k, False: 2.19k]
  ------------------
 2125|  1.97k|	    res->query_raw = xmlMemStrdup(bas->query_raw);
 2126|  1.97k|            if (res->query_raw == NULL)
  ------------------
  |  Branch (2126:17): [True: 3, False: 1.97k]
  ------------------
 2127|      3|                goto done;
 2128|  2.19k|        } else if (bas->query != NULL) {
  ------------------
  |  Branch (2128:20): [True: 0, False: 2.19k]
  ------------------
 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.89k|	if (ref->fragment != NULL) {
  ------------------
  |  Branch (2133:6): [True: 4.24k, False: 649]
  ------------------
 2134|  4.24k|	    res->fragment = xmlMemStrdup(ref->fragment);
 2135|  4.24k|            if (res->fragment == NULL)
  ------------------
  |  Branch (2135:17): [True: 8, False: 4.23k]
  ------------------
 2136|      8|                goto done;
 2137|  4.24k|        }
 2138|  4.88k|	goto step_7;
 2139|  4.89k|    }
 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|  10.0k|    if (ref->scheme != NULL) {
  ------------------
  |  Branch (2147:9): [True: 0, False: 10.0k]
  ------------------
 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|  10.0k|    if (bas->scheme != NULL) {
  ------------------
  |  Branch (2153:9): [True: 7.70k, False: 2.32k]
  ------------------
 2154|  7.70k|	res->scheme = xmlMemStrdup(bas->scheme);
 2155|  7.70k|        if (res->scheme == NULL)
  ------------------
  |  Branch (2155:13): [True: 20, False: 7.68k]
  ------------------
 2156|     20|            goto done;
 2157|  7.70k|    }
 2158|       |
 2159|  10.0k|    if (ref->query_raw != NULL) {
  ------------------
  |  Branch (2159:9): [True: 695, False: 9.31k]
  ------------------
 2160|    695|	res->query_raw = xmlMemStrdup(ref->query_raw);
 2161|    695|        if (res->query_raw == NULL)
  ------------------
  |  Branch (2161:13): [True: 2, False: 693]
  ------------------
 2162|      2|            goto done;
 2163|  9.31k|    } else if (ref->query != NULL) {
  ------------------
  |  Branch (2163:16): [True: 0, False: 9.31k]
  ------------------
 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|  10.0k|    if (ref->fragment != NULL) {
  ------------------
  |  Branch (2168:9): [True: 1.03k, False: 8.97k]
  ------------------
 2169|  1.03k|	res->fragment = xmlMemStrdup(ref->fragment);
 2170|  1.03k|        if (res->fragment == NULL)
  ------------------
  |  Branch (2170:13): [True: 7, False: 1.02k]
  ------------------
 2171|      7|            goto done;
 2172|  1.03k|    }
 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|  10.0k|    if ((ref->authority != NULL) || (ref->server != NULL) ||
  ------------------
  |  Branch (2181:9): [True: 0, False: 10.0k]
  |  Branch (2181:37): [True: 937, False: 9.06k]
  ------------------
 2182|  9.06k|         (ref->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  9.06k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2182:10): [True: 263, False: 8.80k]
  ------------------
 2183|  1.20k|	if (ref->authority != NULL) {
  ------------------
  |  Branch (2183:6): [True: 0, False: 1.20k]
  ------------------
 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.20k|        } else {
 2188|  1.20k|            if (ref->server != NULL) {
  ------------------
  |  Branch (2188:17): [True: 937, False: 263]
  ------------------
 2189|    937|                res->server = xmlMemStrdup(ref->server);
 2190|    937|                if (res->server == NULL)
  ------------------
  |  Branch (2190:21): [True: 2, False: 935]
  ------------------
 2191|      2|                    goto done;
 2192|    937|            }
 2193|  1.19k|	    if (ref->user != NULL) {
  ------------------
  |  Branch (2193:10): [True: 232, False: 966]
  ------------------
 2194|    232|		res->user = xmlMemStrdup(ref->user);
 2195|    232|                if (res->user == NULL)
  ------------------
  |  Branch (2195:21): [True: 2, False: 230]
  ------------------
 2196|      2|                    goto done;
 2197|    232|            }
 2198|  1.19k|            res->port = ref->port;
 2199|  1.19k|	}
 2200|  1.19k|	if (ref->path != NULL) {
  ------------------
  |  Branch (2200:6): [True: 215, False: 981]
  ------------------
 2201|    215|	    res->path = xmlMemStrdup(ref->path);
 2202|    215|            if (res->path == NULL)
  ------------------
  |  Branch (2202:17): [True: 2, False: 213]
  ------------------
 2203|      2|                goto done;
 2204|    215|        }
 2205|  1.19k|	goto step_7;
 2206|  1.19k|    }
 2207|  8.80k|    if (bas->authority != NULL) {
  ------------------
  |  Branch (2207:9): [True: 0, False: 8.80k]
  ------------------
 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.80k|    } else if ((bas->server != NULL) || (bas->port != PORT_EMPTY)) {
  ------------------
  |  |   36|  4.10k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2211:16): [True: 4.69k, False: 4.10k]
  |  Branch (2211:41): [True: 1.14k, False: 2.96k]
  ------------------
 2212|  5.83k|	if (bas->server != NULL) {
  ------------------
  |  Branch (2212:6): [True: 4.69k, False: 1.14k]
  ------------------
 2213|  4.69k|	    res->server = xmlMemStrdup(bas->server);
 2214|  4.69k|            if (res->server == NULL)
  ------------------
  |  Branch (2214:17): [True: 9, False: 4.68k]
  ------------------
 2215|      9|                goto done;
 2216|  4.69k|        }
 2217|  5.82k|	if (bas->user != NULL) {
  ------------------
  |  Branch (2217:6): [True: 1.57k, False: 4.25k]
  ------------------
 2218|  1.57k|	    res->user = xmlMemStrdup(bas->user);
 2219|  1.57k|            if (res->user == NULL)
  ------------------
  |  Branch (2219:17): [True: 6, False: 1.56k]
  ------------------
 2220|      6|                goto done;
 2221|  1.57k|        }
 2222|  5.82k|	res->port = bas->port;
 2223|  5.82k|    }
 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.78k|    if ((ref->path != NULL) && (ref->path[0] == '/')) {
  ------------------
  |  Branch (2229:9): [True: 8.78k, False: 0]
  |  Branch (2229:32): [True: 735, False: 8.05k]
  ------------------
 2230|    735|	res->path = xmlMemStrdup(ref->path);
 2231|    735|        if (res->path == NULL)
  ------------------
  |  Branch (2231:13): [True: 3, False: 732]
  ------------------
 2232|      3|            goto done;
 2233|    732|	goto step_7;
 2234|    735|    }
 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|  8.05k|    len = 2; /* extra / and 0 */
 2246|  8.05k|    if (ref->path != NULL)
  ------------------
  |  Branch (2246:9): [True: 8.05k, False: 0]
  ------------------
 2247|  8.05k|	len += strlen(ref->path);
 2248|  8.05k|    if (bas->path != NULL)
  ------------------
  |  Branch (2248:9): [True: 3.99k, False: 4.05k]
  ------------------
 2249|  3.99k|	len += strlen(bas->path);
 2250|  8.05k|    res->path = xmlMalloc(len);
 2251|  8.05k|    if (res->path == NULL)
  ------------------
  |  Branch (2251:9): [True: 21, False: 8.03k]
  ------------------
 2252|     21|	goto done;
 2253|  8.03k|    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|  8.03k|    cur = 0;
 2261|  8.03k|    out = 0;
 2262|  8.03k|    if (bas->path != NULL) {
  ------------------
  |  Branch (2262:9): [True: 3.98k, False: 4.04k]
  ------------------
 2263|  35.6k|	while (bas->path[cur] != 0) {
  ------------------
  |  Branch (2263:9): [True: 33.8k, False: 1.82k]
  ------------------
 2264|  1.09M|	    while ((bas->path[cur] != 0) && (bas->path[cur] != '/'))
  ------------------
  |  Branch (2264:13): [True: 1.09M, False: 2.16k]
  |  Branch (2264:38): [True: 1.06M, False: 31.6k]
  ------------------
 2265|  1.06M|		cur++;
 2266|  33.8k|	    if (bas->path[cur] == 0)
  ------------------
  |  Branch (2266:10): [True: 2.16k, False: 31.6k]
  ------------------
 2267|  2.16k|		break;
 2268|       |
 2269|  31.6k|	    cur++;
 2270|  1.05M|	    while (out < cur) {
  ------------------
  |  Branch (2270:13): [True: 1.02M, False: 31.6k]
  ------------------
 2271|  1.02M|		res->path[out] = bas->path[out];
 2272|  1.02M|		out++;
 2273|  1.02M|	    }
 2274|  31.6k|	}
 2275|  3.98k|    }
 2276|  8.03k|    res->path[out] = 0;
 2277|       |
 2278|       |    /*
 2279|       |     * b) The reference's path component is appended to the buffer
 2280|       |     *    string.
 2281|       |     */
 2282|  8.03k|    if (ref->path != NULL && ref->path[0] != 0) {
  ------------------
  |  Branch (2282:9): [True: 8.03k, False: 0]
  |  Branch (2282:30): [True: 7.83k, False: 199]
  ------------------
 2283|  7.83k|	indx = 0;
 2284|       |	/*
 2285|       |	 * Ensure the path includes a '/'
 2286|       |	 */
 2287|  7.83k|	if ((out == 0) && ((bas->server != NULL) || bas->port != PORT_EMPTY))
  ------------------
  |  |   36|  1.54k|#define PORT_EMPTY           0
  ------------------
  |  Branch (2287:6): [True: 4.30k, False: 3.52k]
  |  Branch (2287:21): [True: 2.76k, False: 1.54k]
  |  Branch (2287:46): [True: 600, False: 945]
  ------------------
 2288|  3.36k|	    res->path[out++] = '/';
 2289|  84.0k|	while (ref->path[indx] != 0) {
  ------------------
  |  Branch (2289:9): [True: 76.1k, False: 7.83k]
  ------------------
 2290|  76.1k|	    res->path[out++] = ref->path[indx++];
 2291|  76.1k|	}
 2292|  7.83k|    }
 2293|  8.03k|    res->path[out] = 0;
 2294|       |
 2295|       |    /*
 2296|       |     * Steps c) to h) are really path normalization steps
 2297|       |     */
 2298|  8.03k|    xmlNormalizeURIPath(res->path);
 2299|       |
 2300|  14.8k|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.8k|    val = xmlSaveUri(res);
 2308|  14.8k|    if (val != NULL)
  ------------------
  |  Branch (2308:9): [True: 14.7k, False: 83]
  ------------------
 2309|  14.7k|        ret = 0;
 2310|       |
 2311|  38.2k|done:
 2312|  38.2k|    if (ref != NULL)
  ------------------
  |  Branch (2312:9): [True: 26.7k, False: 11.5k]
  ------------------
 2313|  26.7k|	xmlFreeURI(ref);
 2314|  38.2k|    if (bas != NULL)
  ------------------
  |  Branch (2314:9): [True: 17.0k, False: 21.2k]
  ------------------
 2315|  17.0k|	xmlFreeURI(bas);
 2316|  38.2k|    if (res != NULL)
  ------------------
  |  Branch (2316:9): [True: 14.9k, False: 23.3k]
  ------------------
 2317|  14.9k|	xmlFreeURI(res);
 2318|  38.2k|    *valPtr = val;
 2319|  38.2k|    return(ret);
 2320|  14.8k|}
xmlBuildRelativeURISafe:
 2493|  20.5k|{
 2494|  20.5k|    xmlChar *val = NULL;
 2495|  20.5k|    int ret = 0;
 2496|  20.5k|    size_t ix = 0;
 2497|  20.5k|    size_t nbslash = 0;
 2498|  20.5k|    size_t len = 0;
 2499|  20.5k|    xmlURIPtr ref = NULL;
 2500|  20.5k|    xmlURIPtr bas = NULL;
 2501|  20.5k|    const xmlChar *bptr, *uptr, *rptr;
 2502|  20.5k|    xmlChar *vptr;
 2503|  20.5k|    int remove_path = 0;
 2504|  20.5k|    int refDrive, baseDrive;
 2505|       |
 2506|  20.5k|    if (valPtr == NULL)
  ------------------
  |  Branch (2506:9): [True: 0, False: 20.5k]
  ------------------
 2507|      0|        return(1);
 2508|  20.5k|    *valPtr = NULL;
 2509|  20.5k|    if ((URI == NULL) || (*URI == 0))
  ------------------
  |  Branch (2509:9): [True: 0, False: 20.5k]
  |  Branch (2509:26): [True: 234, False: 20.2k]
  ------------------
 2510|    234|	return(1);
 2511|       |
 2512|  20.2k|    ret = xmlParseUriOrPath((char *) URI, &ref, &refDrive);
 2513|  20.2k|    if (ret < 0)
  ------------------
  |  Branch (2513:9): [True: 42, False: 20.2k]
  ------------------
 2514|     42|        goto done;
 2515|  20.2k|    if (ret != 0) {
  ------------------
  |  Branch (2515:9): [True: 341, False: 19.8k]
  ------------------
 2516|       |        /* Return URI if URI is invalid */
 2517|    341|        ret = 0;
 2518|    341|        val = xmlStrdup(URI);
 2519|    341|        if (val == NULL)
  ------------------
  |  Branch (2519:13): [True: 1, False: 340]
  ------------------
 2520|      1|            ret = -1;
 2521|    341|        goto done;
 2522|    341|    }
 2523|       |
 2524|       |    /* Return URI if base is empty */
 2525|  19.8k|    if ((base == NULL) || (*base == 0))
  ------------------
  |  Branch (2525:9): [True: 0, False: 19.8k]
  |  Branch (2525:27): [True: 17.6k, False: 2.20k]
  ------------------
 2526|  17.6k|        goto done;
 2527|       |
 2528|  2.20k|    ret = xmlParseUriOrPath((char *) base, &bas, &baseDrive);
 2529|  2.20k|    if (ret < 0)
  ------------------
  |  Branch (2529:9): [True: 8, False: 2.20k]
  ------------------
 2530|      8|        goto done;
 2531|  2.20k|    if (ret != 0) {
  ------------------
  |  Branch (2531:9): [True: 227, False: 1.97k]
  ------------------
 2532|       |        /* Return URI if base is invalid */
 2533|    227|        ret = 0;
 2534|    227|        goto done;
 2535|    227|    }
 2536|       |
 2537|       |    /*
 2538|       |     * If the scheme / server on the URI differs from the base,
 2539|       |     * just return the URI
 2540|       |     */
 2541|  1.97k|    if ((xmlStrcmp ((xmlChar *)bas->scheme, (xmlChar *)ref->scheme)) ||
  ------------------
  |  Branch (2541:9): [True: 346, False: 1.62k]
  ------------------
 2542|  1.62k|	(xmlStrcmp ((xmlChar *)bas->server, (xmlChar *)ref->server)) ||
  ------------------
  |  Branch (2542:2): [True: 10, False: 1.61k]
  ------------------
 2543|  1.61k|        (bas->port != ref->port) ||
  ------------------
  |  Branch (2543:9): [True: 0, False: 1.61k]
  ------------------
 2544|  1.61k|        (baseDrive != refDrive)) {
  ------------------
  |  Branch (2544:9): [True: 0, False: 1.61k]
  ------------------
 2545|    356|	goto done;
 2546|    356|    }
 2547|  1.61k|    if (xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path)) {
  ------------------
  |  Branch (2547:9): [True: 92, False: 1.52k]
  ------------------
 2548|     92|	val = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|     92|#define BAD_CAST (xmlChar *)
  ------------------
 2549|     92|        if (val == NULL)
  ------------------
  |  Branch (2549:13): [True: 2, False: 90]
  ------------------
 2550|      2|            ret = -1;
 2551|     92|	goto done;
 2552|     92|    }
 2553|  1.52k|    if (bas->path == NULL) {
  ------------------
  |  Branch (2553:9): [True: 9, False: 1.51k]
  ------------------
 2554|      9|	val = xmlStrdup((xmlChar *)ref->path);
 2555|      9|        if (val == NULL) {
  ------------------
  |  Branch (2555:13): [True: 1, False: 8]
  ------------------
 2556|      1|            ret = -1;
 2557|      1|            goto done;
 2558|      1|        }
 2559|      8|	goto escape;
 2560|      9|    }
 2561|  1.51k|    if (ref->path == NULL) {
  ------------------
  |  Branch (2561:9): [True: 71, False: 1.44k]
  ------------------
 2562|     71|        ref->path = (char *) "/";
 2563|     71|	remove_path = 1;
 2564|     71|    }
 2565|       |
 2566|  1.51k|    bptr = (xmlChar *) bas->path;
 2567|  1.51k|    rptr = (xmlChar *) ref->path;
 2568|       |
 2569|       |    /*
 2570|       |     * Return URI if URI and base aren't both absolute or relative.
 2571|       |     */
 2572|  1.51k|    if ((bptr[0] == '/') != (rptr[0] == '/'))
  ------------------
  |  Branch (2572:9): [True: 322, False: 1.19k]
  ------------------
 2573|    322|        goto done;
 2574|       |
 2575|       |    /*
 2576|       |     * At this point we can compare the two paths
 2577|       |     */
 2578|  1.19k|    {
 2579|  1.19k|        size_t pos = 0;
 2580|       |
 2581|       |        /*
 2582|       |         * Next we compare the two strings and find where they first differ
 2583|       |         */
 2584|  3.95k|	while ((bptr[pos] == rptr[pos]) && (bptr[pos] != 0))
  ------------------
  |  Branch (2584:9): [True: 2.76k, False: 1.19k]
  |  Branch (2584:37): [True: 2.76k, False: 0]
  ------------------
 2585|  2.76k|	    pos++;
 2586|       |
 2587|  1.19k|	if (bptr[pos] == rptr[pos]) {
  ------------------
  |  Branch (2587:6): [True: 0, False: 1.19k]
  ------------------
 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.19k|	ix = pos;
 2599|  2.13k|	for (; ix > 0; ix--) {
  ------------------
  |  Branch (2599:9): [True: 1.14k, False: 985]
  ------------------
 2600|  1.14k|	    if (rptr[ix - 1] == '/')
  ------------------
  |  Branch (2600:10): [True: 209, False: 937]
  ------------------
 2601|    209|		break;
 2602|  1.14k|	}
 2603|  1.19k|	uptr = (xmlChar *)&rptr[ix];
 2604|       |
 2605|       |	/*
 2606|       |	 * In base, count the number of '/' from the differing point
 2607|       |	 */
 2608|   248k|	for (; bptr[ix] != 0; ix++) {
  ------------------
  |  Branch (2608:9): [True: 247k, False: 1.19k]
  ------------------
 2609|   247k|	    if (bptr[ix] == '/')
  ------------------
  |  Branch (2609:10): [True: 65.0k, False: 182k]
  ------------------
 2610|  65.0k|		nbslash++;
 2611|   247k|	}
 2612|       |
 2613|       |	/*
 2614|       |	 * e.g: URI="foo/" base="foo/bar" -> "./"
 2615|       |	 */
 2616|  1.19k|	if (nbslash == 0 && !uptr[0]) {
  ------------------
  |  Branch (2616:6): [True: 281, False: 913]
  |  Branch (2616:22): [True: 20, False: 261]
  ------------------
 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.17k|	len = (size_t) xmlStrlen (uptr) + 1;
 2624|  1.17k|    }
 2625|       |
 2626|  1.17k|    if (nbslash == 0) {
  ------------------
  |  Branch (2626:9): [True: 261, False: 913]
  ------------------
 2627|    261|	if (uptr != NULL) {
  ------------------
  |  Branch (2627:6): [True: 261, False: 0]
  ------------------
 2628|       |	    /* exception characters from xmlSaveUri */
 2629|    261|	    val = xmlURIEscapeStr(uptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    261|#define BAD_CAST (xmlChar *)
  ------------------
 2630|    261|            if (val == NULL)
  ------------------
  |  Branch (2630:17): [True: 1, False: 260]
  ------------------
 2631|      1|                ret = -1;
 2632|    261|        }
 2633|    261|	goto done;
 2634|    261|    }
 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|    913|    if (len + 3 * nbslash > SIZE_MAX) {
  ------------------
  |  Branch (2641:9): [True: 0, False: 913]
  ------------------
 2642|      0|        ret = -1;
 2643|      0|        goto done;
 2644|      0|    }
 2645|    913|    val = (xmlChar *) xmlMalloc (len + 3 * nbslash);
 2646|    913|    if (val == NULL) {
  ------------------
  |  Branch (2646:9): [True: 1, False: 912]
  ------------------
 2647|      1|        ret = -1;
 2648|      1|	goto done;
 2649|      1|    }
 2650|    912|    vptr = val;
 2651|       |    /*
 2652|       |     * Put in as many "../" as needed
 2653|       |     */
 2654|  65.9k|    for (; nbslash>0; nbslash--) {
  ------------------
  |  Branch (2654:12): [True: 65.0k, False: 912]
  ------------------
 2655|  65.0k|	*vptr++ = '.';
 2656|  65.0k|	*vptr++ = '.';
 2657|  65.0k|	*vptr++ = '/';
 2658|  65.0k|    }
 2659|       |    /*
 2660|       |     * Finish up with the end of the URI
 2661|       |     */
 2662|    912|    if (uptr != NULL) {
  ------------------
  |  Branch (2662:9): [True: 912, False: 0]
  ------------------
 2663|    912|        if ((vptr > val) && (len > 0) &&
  ------------------
  |  Branch (2663:13): [True: 912, False: 0]
  |  Branch (2663:29): [True: 912, False: 0]
  ------------------
 2664|    912|	    (uptr[0] == '/') && (vptr[-1] == '/')) {
  ------------------
  |  Branch (2664:6): [True: 0, False: 912]
  |  Branch (2664:26): [True: 0, False: 0]
  ------------------
 2665|      0|	    memcpy (vptr, uptr + 1, len - 1);
 2666|      0|	    vptr[len - 2] = 0;
 2667|    912|	} else {
 2668|    912|	    memcpy (vptr, uptr, len);
 2669|    912|	    vptr[len - 1] = 0;
 2670|    912|	}
 2671|    912|    } else {
 2672|      0|	vptr[len - 1] = 0;
 2673|      0|    }
 2674|       |
 2675|    920|escape:
 2676|       |    /* escape the freshly-built path */
 2677|    920|    vptr = val;
 2678|       |    /* exception characters from xmlSaveUri */
 2679|    920|    val = xmlURIEscapeStr(vptr, BAD_CAST "/;&=+$,");
  ------------------
  |  |   34|    920|#define BAD_CAST (xmlChar *)
  ------------------
 2680|    920|    if (val == NULL)
  ------------------
  |  Branch (2680:9): [True: 5, False: 915]
  ------------------
 2681|      5|        ret = -1;
 2682|    915|    else
 2683|    915|        ret = 0;
 2684|    920|    xmlFree(vptr);
 2685|       |
 2686|  20.2k|done:
 2687|  20.2k|    if ((ret == 0) && (val == NULL)) {
  ------------------
  |  Branch (2687:9): [True: 20.2k, False: 62]
  |  Branch (2687:23): [True: 18.5k, False: 1.62k]
  ------------------
 2688|  18.5k|        val = xmlSaveUri(ref);
 2689|  18.5k|        if (val == NULL)
  ------------------
  |  Branch (2689:13): [True: 13, False: 18.5k]
  ------------------
 2690|     13|            ret = -1;
 2691|  18.5k|    }
 2692|       |
 2693|       |    /*
 2694|       |     * Free the working variables
 2695|       |     */
 2696|  20.2k|    if (remove_path != 0)
  ------------------
  |  Branch (2696:9): [True: 71, False: 20.1k]
  ------------------
 2697|     71|        ref->path = NULL;
 2698|  20.2k|    if (ref != NULL)
  ------------------
  |  Branch (2698:9): [True: 19.8k, False: 383]
  ------------------
 2699|  19.8k|	xmlFreeURI (ref);
 2700|  20.2k|    if (bas != NULL)
  ------------------
  |  Branch (2700:9): [True: 1.97k, False: 18.2k]
  ------------------
 2701|  1.97k|	xmlFreeURI (bas);
 2702|  20.2k|    if (ret != 0) {
  ------------------
  |  Branch (2702:9): [True: 75, False: 20.1k]
  ------------------
 2703|     75|        xmlFree(val);
 2704|     75|        val = NULL;
 2705|     75|    }
 2706|       |
 2707|  20.2k|    *valPtr = val;
 2708|  20.2k|    return(ret);
 2709|    920|}
xmlCanonicPath:
 2747|  11.1k|{
 2748|  11.1k|    xmlChar *ret;
 2749|       |
 2750|  11.1k|    if (path == NULL)
  ------------------
  |  Branch (2750:9): [True: 0, False: 11.1k]
  ------------------
 2751|      0|	return(NULL);
 2752|       |
 2753|       |    /* Check if this is an "absolute uri" */
 2754|  11.1k|    if (xmlStrstr(path, BAD_CAST "://") != NULL) {
  ------------------
  |  |   34|  11.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2754:9): [True: 980, False: 10.1k]
  ------------------
 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|    980|        ret = xmlURIEscapeStr(path, BAD_CAST ":/?#[]@!$&()*+,;='%");
  ------------------
  |  |   34|    980|#define BAD_CAST (xmlChar *)
  ------------------
 2763|  10.1k|    } else {
 2764|  10.1k|        ret = xmlStrdup((const xmlChar *) path);
 2765|  10.1k|    }
 2766|       |
 2767|  11.1k|    return(ret);
 2768|  11.1k|}
xmlPathToURI:
 2781|  11.1k|{
 2782|  11.1k|    return(xmlCanonicPath(path));
 2783|  11.1k|}
uri.c:xmlParse3986URIReference:
  924|   384k|xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
  925|   384k|    int ret;
  926|       |
  927|   384k|    if (str == NULL)
  ------------------
  |  Branch (927:9): [True: 0, False: 384k]
  ------------------
  928|      0|	return(-1);
  929|   384k|    xmlCleanURI(uri);
  930|       |
  931|       |    /*
  932|       |     * Try first to parse absolute refs, then fallback to relative if
  933|       |     * it fails.
  934|       |     */
  935|   384k|    ret = xmlParse3986URI(uri, str);
  936|   384k|    if (ret < 0)
  ------------------
  |  Branch (936:9): [True: 151, False: 384k]
  ------------------
  937|    151|        return(ret);
  938|   384k|    if (ret != 0) {
  ------------------
  |  Branch (938:9): [True: 352k, False: 32.1k]
  ------------------
  939|   352k|	xmlCleanURI(uri);
  940|   352k|        ret = xmlParse3986RelativeRef(uri, str);
  941|   352k|	if (ret != 0) {
  ------------------
  |  Branch (941:6): [True: 26.8k, False: 325k]
  ------------------
  942|  26.8k|	    xmlCleanURI(uri);
  943|  26.8k|	    return(ret);
  944|  26.8k|	}
  945|   352k|    }
  946|   357k|    return(0);
  947|   384k|}
uri.c:xmlCleanURI:
 1383|   796k|xmlCleanURI(xmlURIPtr uri) {
 1384|   796k|    if (uri == NULL) return;
  ------------------
  |  Branch (1384:9): [True: 0, False: 796k]
  ------------------
 1385|       |
 1386|   796k|    if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (1386:9): [True: 128k, False: 668k]
  ------------------
 1387|   796k|    uri->scheme = NULL;
 1388|   796k|    if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (1388:9): [True: 4.54k, False: 792k]
  ------------------
 1389|   796k|    uri->server = NULL;
 1390|   796k|    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (1390:9): [True: 749, False: 796k]
  ------------------
 1391|   796k|    uri->user = NULL;
 1392|   796k|    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (1392:9): [True: 21.9k, False: 774k]
  ------------------
 1393|   796k|    uri->path = NULL;
 1394|   796k|    if (uri->fragment != NULL) xmlFree(uri->fragment);
  ------------------
  |  Branch (1394:9): [True: 2.07k, False: 794k]
  ------------------
 1395|   796k|    uri->fragment = NULL;
 1396|   796k|    if (uri->opaque != NULL) xmlFree(uri->opaque);
  ------------------
  |  Branch (1396:9): [True: 0, False: 796k]
  ------------------
 1397|   796k|    uri->opaque = NULL;
 1398|   796k|    if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (1398:9): [True: 0, False: 796k]
  ------------------
 1399|   796k|    uri->authority = NULL;
 1400|   796k|    if (uri->query != NULL) xmlFree(uri->query);
  ------------------
  |  Branch (1400:9): [True: 2.07k, False: 794k]
  ------------------
 1401|   796k|    uri->query = NULL;
 1402|   796k|    if (uri->query_raw != NULL) xmlFree(uri->query_raw);
  ------------------
  |  Branch (1402:9): [True: 2.06k, False: 794k]
  ------------------
 1403|       |    uri->query_raw = NULL;
 1404|   796k|}
uri.c:xmlParse3986URI:
  885|   384k|xmlParse3986URI(xmlURIPtr uri, const char *str) {
  886|   384k|    int ret;
  887|       |
  888|   384k|    ret = xmlParse3986Scheme(uri, &str);
  889|   384k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (889:9): [True: 224k, False: 160k]
  ------------------
  890|   160k|    if (*str != ':') {
  ------------------
  |  Branch (890:9): [True: 119k, False: 41.2k]
  ------------------
  891|   119k|	return(1);
  892|   119k|    }
  893|  41.2k|    str++;
  894|  41.2k|    ret = xmlParse3986HierPart(uri, &str);
  895|  41.2k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (895:9): [True: 1.32k, False: 39.8k]
  ------------------
  896|  39.8k|    if (*str == '?') {
  ------------------
  |  Branch (896:9): [True: 4.05k, False: 35.8k]
  ------------------
  897|  4.05k|	str++;
  898|  4.05k|	ret = xmlParse3986Query(uri, &str);
  899|  4.05k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (899:6): [True: 14, False: 4.03k]
  ------------------
  900|  4.05k|    }
  901|  39.8k|    if (*str == '#') {
  ------------------
  |  Branch (901:9): [True: 1.45k, False: 38.4k]
  ------------------
  902|  1.45k|	str++;
  903|  1.45k|	ret = xmlParse3986Fragment(uri, &str);
  904|  1.45k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (904:6): [True: 4, False: 1.45k]
  ------------------
  905|  1.45k|    }
  906|  39.8k|    if (*str != 0) {
  ------------------
  |  Branch (906:9): [True: 7.73k, False: 32.1k]
  ------------------
  907|  7.73k|	xmlCleanURI(uri);
  908|  7.73k|	return(1);
  909|  7.73k|    }
  910|  32.1k|    return(0);
  911|  39.8k|}
uri.c:xmlParse3986Scheme:
  224|   384k|xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
  225|   384k|    const char *cur;
  226|       |
  227|   384k|    cur = *str;
  228|   384k|    if (!ISA_ALPHA(cur))
  ------------------
  |  |  128|   384k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 156k, False: 228k]
  |  |  |  Branch (128:41): [True: 155k, False: 1.56k]
  |  |  ------------------
  |  |  129|   384k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 7.35k, False: 222k]
  |  |  |  Branch (129:41): [True: 5.23k, False: 2.12k]
  |  |  ------------------
  ------------------
  229|   224k|	return(1);
  230|   160k|    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|   339k|    while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  128|   679k|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  ------------------
  |  |  |  Branch (128:24): [True: 100k, False: 239k]
  |  |  |  Branch (128:41): [True: 100k, False: 361]
  |  |  ------------------
  |  |  129|   679k|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  ------------------
  |  |  |  Branch (129:24): [True: 52.1k, False: 187k]
  |  |  |  Branch (129:41): [True: 51.5k, False: 578]
  |  |  ------------------
  ------------------
                  while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
  ------------------
  |  |  127|   527k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 55.3k, False: 132k]
  |  |  |  Branch (127:40): [True: 11.7k, False: 43.6k]
  |  |  ------------------
  ------------------
  241|   179k|           (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
  ------------------
  |  Branch (241:12): [True: 6.74k, False: 169k]
  |  Branch (241:29): [True: 4.07k, False: 165k]
  |  Branch (241:46): [True: 5.16k, False: 160k]
  ------------------
  242|   160k|    if (uri != NULL) {
  ------------------
  |  Branch (242:9): [True: 160k, False: 0]
  ------------------
  243|   160k|	if (uri->scheme != NULL) xmlFree(uri->scheme);
  ------------------
  |  Branch (243:6): [True: 0, False: 160k]
  ------------------
  244|   160k|	uri->scheme = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|   160k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  245|   160k|        if (uri->scheme == NULL)
  ------------------
  |  Branch (245:13): [True: 65, False: 160k]
  ------------------
  246|     65|            return(-1);
  247|   160k|    }
  248|   160k|    *str = cur;
  249|   160k|    return(0);
  250|   160k|}
uri.c:xmlParse3986HierPart:
  782|  41.2k|{
  783|  41.2k|    const char *cur;
  784|  41.2k|    int ret;
  785|       |
  786|  41.2k|    cur = *str;
  787|       |
  788|  41.2k|    if ((*cur == '/') && (*(cur + 1) == '/')) {
  ------------------
  |  Branch (788:9): [True: 31.6k, False: 9.52k]
  |  Branch (788:26): [True: 30.4k, False: 1.20k]
  ------------------
  789|  30.4k|        cur += 2;
  790|  30.4k|	ret = xmlParse3986Authority(uri, &cur);
  791|  30.4k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (791:6): [True: 1.29k, False: 29.1k]
  ------------------
  792|       |        /*
  793|       |         * An empty server is marked with a special URI value.
  794|       |         */
  795|  29.1k|	if ((uri->server == NULL) && (uri->port == PORT_EMPTY))
  ------------------
  |  |   36|  3.38k|#define PORT_EMPTY           0
  ------------------
  |  Branch (795:6): [True: 3.38k, False: 25.7k]
  |  Branch (795:31): [True: 3.09k, False: 294]
  ------------------
  796|  3.09k|	    uri->port = PORT_EMPTY_SERVER;
  ------------------
  |  |   37|  3.09k|#define PORT_EMPTY_SERVER   -1
  ------------------
  797|  29.1k|	ret = xmlParse3986PathAbEmpty(uri, &cur);
  798|  29.1k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (798:6): [True: 9, False: 29.1k]
  ------------------
  799|  29.1k|	*str = cur;
  800|  29.1k|	return(0);
  801|  29.1k|    } else if (*cur == '/') {
  ------------------
  |  Branch (801:16): [True: 1.20k, False: 9.52k]
  ------------------
  802|  1.20k|        ret = xmlParse3986PathAbsolute(uri, &cur);
  803|  1.20k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (803:6): [True: 1, False: 1.20k]
  ------------------
  804|  9.52k|    } else if (ISA_PCHAR(uri, cur)) {
  ------------------
  |  |  174|  9.52k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  19.0k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 2.50k, False: 7.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  16.5k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  2.15k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  4.30k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.83k, False: 314]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 710, False: 1.12k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 817, False: 623]
  |  |  |  |  |  |  |  Branch (131:43): [True: 623, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  2.15k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 495, False: 322]
  |  |  |  |  |  |  |  Branch (132:27): [True: 301, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  1.63k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  3.26k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 1.41k, False: 219]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 208, False: 1.20k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 864, False: 562]
  |  |  |  |  |  |  |  Branch (131:43): [True: 642, False: 222]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  1.63k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 560, False: 224]
  |  |  |  |  |  |  |  Branch (132:27): [True: 329, False: 231]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 2.15k, False: 4.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  15.3k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 225, False: 5.61k]
  |  |  |  |  |  Branch (139:27): [True: 216, False: 5.40k]
  |  |  |  |  |  Branch (139:46): [True: 232, False: 5.16k]
  |  |  |  |  ------------------
  |  |  |  |  140|  5.84k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 237, False: 4.93k]
  |  |  |  |  |  Branch (140:27): [True: 207, False: 4.72k]
  |  |  |  |  |  Branch (140:46): [True: 224, False: 4.50k]
  |  |  |  |  ------------------
  |  |  |  |  141|  5.84k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 376, False: 4.12k]
  |  |  |  |  |  Branch (141:27): [True: 265, False: 3.86k]
  |  |  |  |  |  Branch (141:46): [True: 380, False: 3.48k]
  |  |  |  |  ------------------
  |  |  |  |  142|  5.84k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 229, False: 3.25k]
  |  |  |  |  |  Branch (142:27): [True: 224, False: 3.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  9.52k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 640, False: 2.38k]
  |  |  |  Branch (175:26): [True: 213, False: 2.17k]
  |  |  ------------------
  ------------------
  805|  7.35k|        ret = xmlParse3986PathRootless(uri, &cur);
  806|  7.35k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (806:6): [True: 13, False: 7.34k]
  ------------------
  807|  7.35k|    } else {
  808|       |	/* path-empty is effectively empty */
  809|  2.17k|	if (uri != NULL) {
  ------------------
  |  Branch (809:6): [True: 2.17k, False: 0]
  ------------------
  810|  2.17k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (810:10): [True: 0, False: 2.17k]
  ------------------
  811|  2.17k|	    uri->path = NULL;
  812|  2.17k|	}
  813|  2.17k|    }
  814|  10.7k|    *str = cur;
  815|  10.7k|    return (0);
  816|  41.2k|}
uri.c:xmlParse3986Authority:
  529|  33.3k|{
  530|  33.3k|    const char *cur;
  531|  33.3k|    int ret;
  532|       |
  533|  33.3k|    cur = *str;
  534|       |    /*
  535|       |     * try to parse an userinfo and check for the trailing @
  536|       |     */
  537|  33.3k|    ret = xmlParse3986Userinfo(uri, &cur);
  538|  33.3k|    if (ret < 0)
  ------------------
  |  Branch (538:9): [True: 17, False: 33.3k]
  ------------------
  539|     17|        return(ret);
  540|  33.3k|    if ((ret != 0) || (*cur != '@'))
  ------------------
  |  Branch (540:9): [True: 27.0k, False: 6.27k]
  |  Branch (540:23): [True: 0, False: 6.27k]
  ------------------
  541|  27.0k|        cur = *str;
  542|  6.27k|    else
  543|  6.27k|        cur++;
  544|  33.3k|    ret = xmlParse3986Host(uri, &cur);
  545|  33.3k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (545:9): [True: 306, False: 33.0k]
  ------------------
  546|  33.0k|    if (*cur == ':') {
  ------------------
  |  Branch (546:9): [True: 3.73k, False: 29.2k]
  ------------------
  547|  3.73k|        cur++;
  548|  3.73k|        ret = xmlParse3986Port(uri, &cur);
  549|  3.73k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (549:6): [True: 1.26k, False: 2.47k]
  ------------------
  550|  3.73k|    }
  551|  31.7k|    *str = cur;
  552|  31.7k|    return(0);
  553|  33.0k|}
uri.c:xmlParse3986Userinfo:
  379|  33.3k|{
  380|  33.3k|    const char *cur;
  381|       |
  382|  33.3k|    cur = *str;
  383|  2.08M|    while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  189|  4.17M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 217k, False: 1.87M]
  |  |  ------------------
  ------------------
                  while (ISA_UNRESERVED(uri, cur) || ISA_PCT_ENCODED(cur) ||
  ------------------
  |  |  168|  3.95M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.81M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.63M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.81M, False: 273]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.80M, False: 6.06k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.43k, False: 4.90k]
  |  |  |  |  |  Branch (131:43): [True: 1.19k, False: 241]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.81M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 4.87k, False: 279]
  |  |  |  |  |  Branch (132:27): [True: 4.62k, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  1.81M|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  3.62M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 1.81M, False: 340]
  |  |  |  |  |  |  |  Branch (127:40): [True: 1.81M, False: 2.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.03k, False: 1.45k]
  |  |  |  |  |  Branch (131:43): [True: 708, False: 325]
  |  |  |  |  ------------------
  |  |  |  |  132|  1.81M|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.23k, False: 542]
  |  |  |  |  |  Branch (132:27): [True: 893, False: 341]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 1.81M, False: 54.6k]
  |  |  ------------------
  ------------------
  384|  56.0k|           ISA_SUB_DELIM(cur) || (*cur == ':'))
  ------------------
  |  |  139|  2.14M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 5.76k, False: 50.2k]
  |  |  |  Branch (139:27): [True: 774, False: 49.4k]
  |  |  |  Branch (139:46): [True: 471, False: 49.0k]
  |  |  ------------------
  |  |  140|  56.0k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 462, False: 48.5k]
  |  |  |  Branch (140:27): [True: 2.42k, False: 46.1k]
  |  |  |  Branch (140:46): [True: 1.13k, False: 44.9k]
  |  |  ------------------
  |  |  141|  56.0k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 1.43k, False: 43.5k]
  |  |  |  Branch (141:27): [True: 632, False: 42.9k]
  |  |  |  Branch (141:46): [True: 935, False: 41.9k]
  |  |  ------------------
  |  |  142|  56.0k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.19k, False: 40.7k]
  |  |  |  Branch (142:27): [True: 2.81k, False: 37.9k]
  |  |  ------------------
  ------------------
  |  Branch (384:34): [True: 4.64k, False: 33.3k]
  ------------------
  385|  2.05M|	NEXT(cur);
  ------------------
  |  |  108|  2.05M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 1.81M, False: 240k]
  |  |  ------------------
  ------------------
  386|  33.3k|    if (*cur == '@') {
  ------------------
  |  Branch (386:9): [True: 6.29k, False: 27.0k]
  ------------------
  387|  6.29k|	if (uri != NULL) {
  ------------------
  |  Branch (387:6): [True: 6.29k, False: 0]
  ------------------
  388|  6.29k|	    if (uri->user != NULL) xmlFree(uri->user);
  ------------------
  |  Branch (388:10): [True: 0, False: 6.29k]
  ------------------
  389|  6.29k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  6.29k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (389:10): [True: 0, False: 6.29k]
  ------------------
  390|      0|		uri->user = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  391|  6.29k|	    else
  392|  6.29k|		uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
  393|  6.29k|            if (uri->user == NULL)
  ------------------
  |  Branch (393:17): [True: 17, False: 6.27k]
  ------------------
  394|     17|                return(-1);
  395|  6.29k|	}
  396|  6.27k|	*str = cur;
  397|  6.27k|	return(0);
  398|  6.29k|    }
  399|  27.0k|    return(1);
  400|  33.3k|}
uri.c:xmlParse3986Host:
  452|  33.3k|{
  453|  33.3k|    const char *cur = *str;
  454|  33.3k|    const char *host;
  455|       |
  456|  33.3k|    host = cur;
  457|       |    /*
  458|       |     * IPv6 and future addressing scheme are enclosed between brackets
  459|       |     */
  460|  33.3k|    if (*cur == '[') {
  ------------------
  |  Branch (460:9): [True: 471, False: 32.8k]
  ------------------
  461|    471|        cur++;
  462|  2.98k|	while ((*cur != ']') && (*cur != 0))
  ------------------
  |  Branch (462:9): [True: 2.78k, False: 199]
  |  Branch (462:26): [True: 2.51k, False: 272]
  ------------------
  463|  2.51k|	    cur++;
  464|    471|	if (*cur != ']')
  ------------------
  |  Branch (464:6): [True: 272, False: 199]
  ------------------
  465|    272|	    return(1);
  466|    199|	cur++;
  467|    199|	goto found;
  468|    471|    }
  469|       |    /*
  470|       |     * try to parse an IPv4
  471|       |     */
  472|  32.8k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  32.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 24.9k, False: 7.85k]
  |  |  |  Branch (127:40): [True: 8.37k, False: 16.6k]
  |  |  ------------------
  ------------------
  473|  8.37k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (473:13): [True: 1.30k, False: 7.07k]
  ------------------
  474|  1.30k|	    goto not_ipv4;
  475|  7.07k|	if (*cur != '.')
  ------------------
  |  Branch (475:6): [True: 3.98k, False: 3.08k]
  ------------------
  476|  3.98k|	    goto not_ipv4;
  477|  3.08k|	cur++;
  478|  3.08k|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (478:13): [True: 1.13k, False: 1.95k]
  ------------------
  479|  1.13k|	    goto not_ipv4;
  480|  1.95k|	if (*cur != '.')
  ------------------
  |  Branch (480:6): [True: 1.72k, False: 230]
  ------------------
  481|  1.72k|	    goto not_ipv4;
  482|    230|        if (xmlParse3986DecOctet(&cur) != 0)
  ------------------
  |  Branch (482:13): [True: 230, False: 0]
  ------------------
  483|    230|	    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.37k|not_ipv4:
  490|  8.37k|        cur = *str;
  491|  8.37k|    }
  492|       |    /*
  493|       |     * then this should be a hostname which can be empty
  494|       |     */
  495|  7.73M|    while (ISA_UNRESERVED(uri, cur) ||
  ------------------
  |  |  189|  15.4M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  ------------------
  |  |  |  Branch (189:30): [True: 7.62M, False: 110k]
  |  |  ------------------
  ------------------
  496|   110k|           ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  168|  7.84M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  49.4k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  98.8k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 49.1k, False: 329]
  |  |  |  |  |  |  |  Branch (127:40): [True: 46.3k, False: 2.76k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.58k, False: 1.51k]
  |  |  |  |  |  Branch (131:43): [True: 1.33k, False: 249]
  |  |  |  |  ------------------
  |  |  |  |  132|  49.4k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.42k, False: 335]
  |  |  |  |  |  Branch (132:27): [True: 1.17k, False: 250]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  ------------------
  |  |  |  |  131|  48.8k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  |  127|  97.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (127:23): [True: 48.5k, False: 348]
  |  |  |  |  |  |  |  Branch (127:40): [True: 46.1k, False: 2.34k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (131:26): [True: 1.20k, False: 1.48k]
  |  |  |  |  |  Branch (131:43): [True: 884, False: 325]
  |  |  |  |  ------------------
  |  |  |  |  132|  48.8k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (132:10): [True: 1.25k, False: 554]
  |  |  |  |  |  Branch (132:27): [True: 911, False: 341]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (168:7): [True: 49.4k, False: 61.2k]
  |  |  ------------------
  ------------------
                         ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
  ------------------
  |  |  139|  62.7k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  ------------------
  |  |  |  Branch (139:8): [True: 6.99k, False: 55.7k]
  |  |  |  Branch (139:27): [True: 1.76k, False: 54.0k]
  |  |  |  Branch (139:46): [True: 600, False: 53.4k]
  |  |  ------------------
  |  |  140|  62.7k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  ------------------
  |  |  |  Branch (140:8): [True: 1.89k, False: 51.5k]
  |  |  |  Branch (140:27): [True: 2.82k, False: 48.6k]
  |  |  |  Branch (140:46): [True: 1.20k, False: 47.4k]
  |  |  ------------------
  |  |  141|  62.7k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  ------------------
  |  |  |  Branch (141:8): [True: 2.03k, False: 45.4k]
  |  |  |  Branch (141:27): [True: 659, False: 44.8k]
  |  |  |  Branch (141:46): [True: 7.58k, False: 37.2k]
  |  |  ------------------
  |  |  142|  62.7k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  ------------------
  |  |  |  Branch (142:8): [True: 1.95k, False: 35.2k]
  |  |  |  Branch (142:27): [True: 2.42k, False: 32.8k]
  |  |  ------------------
  ------------------
  497|  7.70M|        NEXT(cur);
  ------------------
  |  |  108|  7.73M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 47.9k, False: 7.65M]
  |  |  ------------------
  ------------------
  498|  33.0k|found:
  499|  33.0k|    if (uri != NULL) {
  ------------------
  |  Branch (499:9): [True: 33.0k, False: 0]
  ------------------
  500|  33.0k|	if (uri->authority != NULL) xmlFree(uri->authority);
  ------------------
  |  Branch (500:6): [True: 0, False: 33.0k]
  ------------------
  501|  33.0k|	uri->authority = NULL;
  502|  33.0k|	if (uri->server != NULL) xmlFree(uri->server);
  ------------------
  |  Branch (502:6): [True: 0, False: 33.0k]
  ------------------
  503|  33.0k|	if (cur != host) {
  ------------------
  |  Branch (503:6): [True: 28.3k, False: 4.68k]
  ------------------
  504|  28.3k|	    if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  28.3k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (504:10): [True: 0, False: 28.3k]
  ------------------
  505|      0|		uri->server = STRNDUP(host, cur - host);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  506|  28.3k|	    else
  507|  28.3k|		uri->server = xmlURIUnescapeString(host, cur - host, NULL);
  508|  28.3k|            if (uri->server == NULL)
  ------------------
  |  Branch (508:17): [True: 34, False: 28.3k]
  ------------------
  509|     34|                return(-1);
  510|  28.3k|	} else
  511|  4.68k|	    uri->server = NULL;
  512|  33.0k|    }
  513|  33.0k|    *str = cur;
  514|  33.0k|    return(0);
  515|  33.0k|}
uri.c:xmlParse3986DecOctet:
  415|  11.6k|xmlParse3986DecOctet(const char **str) {
  416|  11.6k|    const char *cur = *str;
  417|       |
  418|  11.6k|    if (!(ISA_DIGIT(cur)))
  ------------------
  |  |  127|  11.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 10.9k, False: 714]
  |  |  |  Branch (127:40): [True: 10.7k, False: 214]
  |  |  ------------------
  ------------------
  419|    928|        return(1);
  420|  10.7k|    if (!ISA_DIGIT(cur+1))
  ------------------
  |  |  127|  10.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 7.11k, False: 3.64k]
  |  |  |  Branch (127:40): [True: 5.40k, False: 1.71k]
  |  |  ------------------
  ------------------
  421|  5.36k|	cur++;
  422|  5.40k|    else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.70k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 4.70k, False: 0]
  |  |  |  Branch (127:40): [True: 4.70k, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
  ------------------
  |  |  127|  4.70k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.55k, False: 1.14k]
  |  |  |  Branch (127:40): [True: 2.66k, False: 890]
  |  |  ------------------
  ------------------
  |  Branch (422:14): [True: 4.70k, False: 700]
  ------------------
  423|  2.03k|	cur += 2;
  424|  3.36k|    else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    481|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 481, False: 0]
  |  |  |  Branch (127:40): [True: 481, False: 0]
  |  |  ------------------
  ------------------
                  else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    481|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 481, False: 0]
  |  |  |  Branch (127:40): [True: 481, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (424:14): [True: 481, False: 2.88k]
  ------------------
  425|    481|	cur += 3;
  426|  2.88k|    else if ((*cur == '2') && (*(cur + 1) >= '0') &&
  ------------------
  |  Branch (426:14): [True: 1.54k, False: 1.33k]
  |  Branch (426:31): [True: 1.54k, False: 0]
  ------------------
  427|  1.54k|	     (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
  ------------------
  |  |  127|    455|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 455, False: 0]
  |  |  |  Branch (127:40): [True: 455, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (427:7): [True: 455, False: 1.09k]
  ------------------
  428|    455|	cur += 3;
  429|  2.43k|    else if ((*cur == '2') && (*(cur + 1) == '5') &&
  ------------------
  |  Branch (429:14): [True: 1.09k, False: 1.33k]
  |  Branch (429:31): [True: 698, False: 395]
  ------------------
  430|    698|	     (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
  ------------------
  |  Branch (430:7): [True: 698, False: 0]
  |  Branch (430:30): [True: 698, False: 0]
  ------------------
  431|    698|	cur += 3;
  432|  1.73k|    else
  433|  1.73k|        return(1);
  434|  9.02k|    *str = cur;
  435|  9.02k|    return(0);
  436|  10.7k|}
uri.c:xmlParse3986Port:
  342|  3.73k|{
  343|  3.73k|    const char *cur = *str;
  344|  3.73k|    int port = 0;
  345|       |
  346|  3.73k|    if (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  3.73k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 3.38k, False: 349]
  |  |  |  Branch (127:40): [True: 2.89k, False: 489]
  |  |  ------------------
  ------------------
  347|  12.4k|	while (ISA_DIGIT(cur)) {
  ------------------
  |  |  127|  12.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  ------------------
  |  |  |  Branch (127:23): [True: 10.1k, False: 2.25k]
  |  |  |  Branch (127:40): [True: 9.95k, False: 221]
  |  |  ------------------
  ------------------
  348|  9.95k|            int digit = *cur - '0';
  349|       |
  350|  9.95k|            if (port > INT_MAX / 10)
  ------------------
  |  Branch (350:17): [True: 208, False: 9.74k]
  ------------------
  351|    208|                return(1);
  352|  9.74k|            port *= 10;
  353|  9.74k|            if (port > INT_MAX - digit)
  ------------------
  |  Branch (353:17): [True: 215, False: 9.53k]
  ------------------
  354|    215|                return(1);
  355|  9.53k|	    port += digit;
  356|       |
  357|  9.53k|	    cur++;
  358|  9.53k|	}
  359|  2.47k|	if (uri != NULL)
  ------------------
  |  Branch (359:6): [True: 2.47k, False: 0]
  ------------------
  360|  2.47k|	    uri->port = port;
  361|  2.47k|	*str = cur;
  362|  2.47k|	return(0);
  363|  2.89k|    }
  364|    838|    return(1);
  365|  3.73k|}
uri.c:xmlParse3986PathAbEmpty:
  609|  31.7k|{
  610|  31.7k|    const char *cur;
  611|  31.7k|    int ret;
  612|       |
  613|  31.7k|    cur = *str;
  614|       |
  615|   108k|    while (*cur == '/') {
  ------------------
  |  Branch (615:12): [True: 77.0k, False: 31.7k]
  ------------------
  616|  77.0k|        cur++;
  617|  77.0k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  618|  77.0k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (618:6): [True: 0, False: 77.0k]
  ------------------
  619|  77.0k|    }
  620|  31.7k|    if (uri != NULL) {
  ------------------
  |  Branch (620:9): [True: 31.7k, False: 0]
  ------------------
  621|  31.7k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (621:6): [True: 0, False: 31.7k]
  ------------------
  622|  31.7k|        if (*str != cur) {
  ------------------
  |  Branch (622:13): [True: 17.5k, False: 14.1k]
  ------------------
  623|  17.5k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  17.5k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (623:17): [True: 0, False: 17.5k]
  ------------------
  624|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  625|  17.5k|            else
  626|  17.5k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  627|  17.5k|            if (uri->path == NULL)
  ------------------
  |  Branch (627:17): [True: 11, False: 17.5k]
  ------------------
  628|     11|                return (-1);
  629|  17.5k|        } else {
  630|  14.1k|            uri->path = NULL;
  631|  14.1k|        }
  632|  31.7k|    }
  633|  31.7k|    *str = cur;
  634|  31.7k|    return (0);
  635|  31.7k|}
uri.c:xmlParse3986Segment:
  572|   326k|{
  573|   326k|    const char *cur;
  574|       |
  575|   326k|    cur = *str;
  576|   326k|    if (!ISA_PCHAR(uri, cur) || (*cur == forbid)) {
  ------------------
  |  |  174|   653k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   653k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 237k, False: 89.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   416k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  5.81k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  11.6k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 5.59k, False: 216]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.88k, False: 3.70k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 2.17k, False: 1.75k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.86k, False: 309]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  5.81k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.68k, False: 378]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.23k, False: 445]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  4.99k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  9.98k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 4.77k, False: 211]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 1.22k, False: 3.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.41k, False: 2.35k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.21k, False: 195]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  4.99k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.30k, False: 245]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.91k, False: 392]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 5.81k, False: 83.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   412k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.37k, False: 82.9k]
  |  |  |  |  |  Branch (139:27): [True: 3.08k, False: 79.8k]
  |  |  |  |  |  Branch (139:46): [True: 784, False: 79.0k]
  |  |  |  |  ------------------
  |  |  |  |  140|  85.2k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.26k, False: 77.7k]
  |  |  |  |  |  Branch (140:27): [True: 1.21k, False: 76.5k]
  |  |  |  |  |  Branch (140:46): [True: 31.7k, False: 44.7k]
  |  |  |  |  ------------------
  |  |  |  |  141|  85.2k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.75k, False: 42.0k]
  |  |  |  |  |  Branch (141:27): [True: 917, False: 41.1k]
  |  |  |  |  |  Branch (141:46): [True: 3.24k, False: 37.8k]
  |  |  |  |  ------------------
  |  |  |  |  142|  85.2k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 825, False: 37.0k]
  |  |  |  |  |  Branch (142:27): [True: 2.23k, False: 34.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   326k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.93k, False: 30.8k]
  |  |  |  Branch (175:26): [True: 2.01k, False: 28.8k]
  |  |  ------------------
  ------------------
  |  Branch (576:33): [True: 1.33k, False: 296k]
  ------------------
  577|  30.1k|        if (empty)
  ------------------
  |  Branch (577:13): [True: 26.7k, False: 3.38k]
  ------------------
  578|  26.7k|	    return(0);
  579|  3.38k|	return(1);
  580|  30.1k|    }
  581|   296k|    NEXT(cur);
  ------------------
  |  |  108|   296k|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 4.35k, False: 292k]
  |  |  ------------------
  ------------------
  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|  9.41M|    while (ISA_PCHAR(uri, cur) && (*cur != forbid))
  ------------------
  |  |  174|  18.8M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  18.8M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 7.53M, False: 1.87M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  11.2M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  11.2k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  22.4k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 10.7k, False: 523]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.58k, False: 3.13k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.28k, False: 2.37k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.03k, False: 253]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  11.2k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.87k, False: 754]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.40k, False: 469]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  10.0k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  20.0k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 9.71k, False: 304]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 7.15k, False: 2.55k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.01k, False: 1.84k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 743, False: 272]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  10.0k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.77k, False: 342]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.36k, False: 411]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 11.2k, False: 1.86M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  11.2M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 2.91k, False: 1.86M]
  |  |  |  |  |  Branch (139:27): [True: 1.78k, False: 1.86M]
  |  |  |  |  |  Branch (139:46): [True: 440, False: 1.86M]
  |  |  |  |  ------------------
  |  |  |  |  140|  1.87M|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 1.71k, False: 1.86M]
  |  |  |  |  |  Branch (140:27): [True: 2.15k, False: 1.86M]
  |  |  |  |  |  Branch (140:46): [True: 1.54M, False: 315k]
  |  |  |  |  ------------------
  |  |  |  |  141|  1.87M|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 2.59k, False: 312k]
  |  |  |  |  |  Branch (141:27): [True: 2.83k, False: 310k]
  |  |  |  |  |  Branch (141:46): [True: 2.56k, False: 307k]
  |  |  |  |  ------------------
  |  |  |  |  142|  1.87M|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.90k, False: 305k]
  |  |  |  |  |  Branch (142:27): [True: 1.85k, False: 303k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  9.41M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 15.0k, False: 288k]
  |  |  |  Branch (175:26): [True: 2.16k, False: 286k]
  |  |  ------------------
  ------------------
  |  Branch (591:35): [True: 9.11M, False: 10.2k]
  ------------------
  592|  9.11M|        NEXT(cur);
  ------------------
  |  |  108|  9.41M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 9.26k, False: 9.10M]
  |  |  ------------------
  ------------------
  593|   296k|    *str = cur;
  594|   296k|    return (0);
  595|   326k|}
uri.c:xmlParse3986PathAbsolute:
  649|  8.73k|{
  650|  8.73k|    const char *cur;
  651|  8.73k|    int ret;
  652|       |
  653|  8.73k|    cur = *str;
  654|       |
  655|  8.73k|    if (*cur != '/')
  ------------------
  |  Branch (655:9): [True: 0, False: 8.73k]
  ------------------
  656|      0|        return(1);
  657|  8.73k|    cur++;
  658|  8.73k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  659|  8.73k|    if (ret == 0) {
  ------------------
  |  Branch (659:9): [True: 6.68k, False: 2.05k]
  ------------------
  660|  19.6k|	while (*cur == '/') {
  ------------------
  |  Branch (660:9): [True: 12.9k, False: 6.68k]
  ------------------
  661|  12.9k|	    cur++;
  662|  12.9k|	    ret = xmlParse3986Segment(uri, &cur, 0, 1);
  663|  12.9k|	    if (ret != 0) return(ret);
  ------------------
  |  Branch (663:10): [True: 0, False: 12.9k]
  ------------------
  664|  12.9k|	}
  665|  6.68k|    }
  666|  8.73k|    if (uri != NULL) {
  ------------------
  |  Branch (666:9): [True: 8.73k, False: 0]
  ------------------
  667|  8.73k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (667:6): [True: 0, False: 8.73k]
  ------------------
  668|  8.73k|        if (cur != *str) {
  ------------------
  |  Branch (668:13): [True: 8.73k, False: 0]
  ------------------
  669|  8.73k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  8.73k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (669:17): [True: 0, False: 8.73k]
  ------------------
  670|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  671|  8.73k|            else
  672|  8.73k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  673|  8.73k|            if (uri->path == NULL)
  ------------------
  |  Branch (673:17): [True: 13, False: 8.72k]
  ------------------
  674|     13|                return (-1);
  675|  8.73k|        } else {
  676|      0|            uri->path = NULL;
  677|      0|        }
  678|  8.73k|    }
  679|  8.72k|    *str = cur;
  680|  8.72k|    return (0);
  681|  8.73k|}
uri.c:xmlIsUnreserved:
  196|  45.8M|xmlIsUnreserved(xmlURIPtr uri, const char *cur) {
  197|  45.8M|    if (uri == NULL)
  ------------------
  |  Branch (197:9): [True: 0, False: 45.8M]
  ------------------
  198|      0|        return(0);
  199|       |
  200|  45.8M|    if (ISA_STRICTLY_UNRESERVED(cur))
  ------------------
  |  |  161|  45.8M|      ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  128|  45.8M|#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (128:24): [True: 1.98M, False: 43.8M]
  |  |  |  |  |  Branch (128:41): [True: 1.97M, False: 10.7k]
  |  |  |  |  ------------------
  |  |  |  |  129|  45.8M|                      ((*(p) >= 'A') && (*(p) <= 'Z')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (129:24): [True: 38.2M, False: 5.64M]
  |  |  |  |  |  Branch (129:41): [True: 38.2M, False: 20.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                     ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) ||		\
  |  |  ------------------
  |  |  |  |  127|  5.66M|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (127:23): [True: 715k, False: 4.94M]
  |  |  |  |  |  Branch (127:40): [True: 424k, False: 290k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (161:44): [True: 61.7k, False: 5.17M]
  |  |  ------------------
  |  |  162|  45.8M|       ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
  |  |  ------------------
  |  |  |  Branch (162:8): [True: 158k, False: 5.01M]
  |  |  |  Branch (162:27): [True: 4.45k, False: 5.01M]
  |  |  |  Branch (162:46): [True: 10.1k, False: 5.00M]
  |  |  ------------------
  ------------------
  201|  40.8M|        return(1);
  202|       |
  203|  5.00M|    if (uri->cleanup & XML_URI_ALLOW_UNWISE) {
  ------------------
  |  |  191|  5.00M|#define XML_URI_ALLOW_UNWISE    1
  ------------------
  |  Branch (203:9): [True: 0, False: 5.00M]
  ------------------
  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|  5.00M|    } else if (uri->cleanup & XML_URI_ALLOW_UCSCHAR) {
  ------------------
  |  |  193|  5.00M|#define XML_URI_ALLOW_UCSCHAR   4
  ------------------
  |  Branch (206:16): [True: 0, False: 5.00M]
  ------------------
  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|  5.00M|    return(0);
  212|  5.00M|}
uri.c:xmlParse3986PathRootless:
  695|  7.35k|{
  696|  7.35k|    const char *cur;
  697|  7.35k|    int ret;
  698|       |
  699|  7.35k|    cur = *str;
  700|       |
  701|  7.35k|    ret = xmlParse3986Segment(uri, &cur, 0, 0);
  702|  7.35k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (702:9): [True: 0, False: 7.35k]
  ------------------
  703|  11.1k|    while (*cur == '/') {
  ------------------
  |  Branch (703:12): [True: 3.78k, False: 7.35k]
  ------------------
  704|  3.78k|        cur++;
  705|  3.78k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  706|  3.78k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (706:6): [True: 0, False: 3.78k]
  ------------------
  707|  3.78k|    }
  708|  7.35k|    if (uri != NULL) {
  ------------------
  |  Branch (708:9): [True: 7.35k, False: 0]
  ------------------
  709|  7.35k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (709:6): [True: 0, False: 7.35k]
  ------------------
  710|  7.35k|        if (cur != *str) {
  ------------------
  |  Branch (710:13): [True: 7.35k, False: 0]
  ------------------
  711|  7.35k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  7.35k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (711:17): [True: 0, False: 7.35k]
  ------------------
  712|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  713|  7.35k|            else
  714|  7.35k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  715|  7.35k|            if (uri->path == NULL)
  ------------------
  |  Branch (715:17): [True: 13, False: 7.34k]
  ------------------
  716|     13|                return (-1);
  717|  7.35k|        } else {
  718|      0|            uri->path = NULL;
  719|      0|        }
  720|  7.35k|    }
  721|  7.34k|    *str = cur;
  722|  7.34k|    return (0);
  723|  7.35k|}
uri.c:xmlParse3986Query:
  300|  10.0k|{
  301|  10.0k|    const char *cur;
  302|       |
  303|  10.0k|    cur = *str;
  304|       |
  305|  23.7M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?'))
  ------------------
  |  |  174|  23.7M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  47.5M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 23.6M, False: 113k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  23.8M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  19.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  38.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 19.0k, False: 308]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 15.9k, False: 3.08k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.87k, False: 1.51k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.59k, False: 287]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  19.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.46k, False: 341]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.10k, False: 360]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.6k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  37.3k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 18.3k, False: 328]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 15.7k, False: 2.61k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.02k, False: 1.91k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 795, False: 233]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  18.6k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.79k, False: 355]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.42k, False: 373]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 19.3k, False: 94.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  23.8M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.19k, False: 94.2k]
  |  |  |  |  |  Branch (139:27): [True: 1.15k, False: 93.1k]
  |  |  |  |  |  Branch (139:46): [True: 295, False: 92.8k]
  |  |  |  |  ------------------
  |  |  |  |  140|  95.4k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 636, False: 92.2k]
  |  |  |  |  |  Branch (140:27): [True: 1.12k, False: 91.0k]
  |  |  |  |  |  Branch (140:46): [True: 30.4k, False: 60.6k]
  |  |  |  |  ------------------
  |  |  |  |  141|  95.4k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 678, False: 60.0k]
  |  |  |  |  |  Branch (141:27): [True: 494, False: 59.5k]
  |  |  |  |  |  Branch (141:46): [True: 1.31k, False: 58.1k]
  |  |  |  |  ------------------
  |  |  |  |  142|  95.4k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 973, False: 57.2k]
  |  |  |  |  |  Branch (142:27): [True: 1.01k, False: 56.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  23.7M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 3.37k, False: 52.8k]
  |  |  |  Branch (175:26): [True: 3.40k, False: 49.4k]
  |  |  ------------------
  ------------------
  |  Branch (305:37): [True: 22.0k, False: 27.3k]
  |  Branch (305:54): [True: 17.2k, False: 10.0k]
  ------------------
  306|  23.7M|        NEXT(cur);
  ------------------
  |  |  108|  23.7M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 17.9k, False: 23.7M]
  |  |  ------------------
  ------------------
  307|  10.0k|    if (uri != NULL) {
  ------------------
  |  Branch (307:9): [True: 10.0k, False: 0]
  ------------------
  308|  10.0k|        if (uri->query != NULL)
  ------------------
  |  Branch (308:13): [True: 0, False: 10.0k]
  ------------------
  309|      0|            xmlFree(uri->query);
  310|  10.0k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|  10.0k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (310:6): [True: 0, False: 10.0k]
  ------------------
  311|      0|	    uri->query = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  312|  10.0k|	else
  313|  10.0k|	    uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
  314|  10.0k|        if (uri->query == NULL)
  ------------------
  |  Branch (314:13): [True: 26, False: 10.0k]
  ------------------
  315|     26|            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.0k|	if (uri->query_raw != NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 10.0k]
  ------------------
  321|      0|	    xmlFree (uri->query_raw);
  322|  10.0k|	uri->query_raw = STRNDUP (*str, cur - *str);
  ------------------
  |  |  119|  10.0k|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  323|  10.0k|        if (uri->query_raw == NULL)
  ------------------
  |  Branch (323:13): [True: 26, False: 10.0k]
  ------------------
  324|     26|            return (-1);
  325|  10.0k|    }
  326|  10.0k|    *str = cur;
  327|  10.0k|    return (0);
  328|  10.0k|}
uri.c:xmlParse3986Fragment:
  267|   172k|{
  268|   172k|    const char *cur;
  269|       |
  270|   172k|    cur = *str;
  271|       |
  272|  2.13M|    while ((ISA_PCHAR(uri, cur)) || (*cur == '/') || (*cur == '?') ||
  ------------------
  |  |  174|  2.13M|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|  4.27M|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 1.39M, False: 744k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|  2.88M|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  18.3k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  36.7k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 18.0k, False: 299]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 15.6k, False: 2.47k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 985, False: 1.78k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 786, False: 199]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  18.3k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.51k, False: 465]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.22k, False: 299]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  17.6k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  35.2k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 17.3k, False: 239]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 14.4k, False: 2.97k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 953, False: 2.25k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 627, False: 326]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  17.6k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 2.09k, False: 494]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.59k, False: 500]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 18.3k, False: 725k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|  2.86M|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 180k, False: 546k]
  |  |  |  |  |  Branch (139:27): [True: 703, False: 546k]
  |  |  |  |  |  Branch (139:46): [True: 734, False: 545k]
  |  |  |  |  ------------------
  |  |  |  |  140|   727k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 7.22k, False: 538k]
  |  |  |  |  |  Branch (140:27): [True: 8.29k, False: 530k]
  |  |  |  |  |  Branch (140:46): [True: 3.07k, False: 526k]
  |  |  |  |  ------------------
  |  |  |  |  141|   727k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.71k, False: 525k]
  |  |  |  |  |  Branch (141:27): [True: 14.7k, False: 510k]
  |  |  |  |  |  Branch (141:46): [True: 5.43k, False: 505k]
  |  |  |  |  ------------------
  |  |  |  |  142|   727k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 1.23k, False: 503k]
  |  |  |  |  |  Branch (142:27): [True: 1.33k, False: 502k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  2.13M|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 154k, False: 348k]
  |  |  |  Branch (175:26): [True: 3.32k, False: 344k]
  |  |  ------------------
  ------------------
  |  Branch (272:37): [True: 166k, False: 178k]
  |  Branch (272:54): [True: 2.73k, False: 175k]
  ------------------
  273|   175k|           (*cur == '[') || (*cur == ']'))
  ------------------
  |  Branch (273:12): [True: 2.06k, False: 173k]
  |  Branch (273:29): [True: 1.27k, False: 172k]
  ------------------
  274|  1.96M|        NEXT(cur);
  ------------------
  |  |  108|  1.96M|#define NEXT(p) ((*p == '%')? p += 3 : p++)
  |  |  ------------------
  |  |  |  Branch (108:18): [True: 16.6k, False: 1.95M]
  |  |  ------------------
  ------------------
  275|   172k|    if (uri != NULL) {
  ------------------
  |  Branch (275:9): [True: 172k, False: 0]
  ------------------
  276|   172k|        if (uri->fragment != NULL)
  ------------------
  |  Branch (276:13): [True: 0, False: 172k]
  ------------------
  277|      0|            xmlFree(uri->fragment);
  278|   172k|	if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   172k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (278:6): [True: 0, False: 172k]
  ------------------
  279|      0|	    uri->fragment = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  280|   172k|	else
  281|   172k|	    uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
  282|   172k|        if (uri->fragment == NULL)
  ------------------
  |  Branch (282:13): [True: 34, False: 172k]
  ------------------
  283|     34|            return (-1);
  284|   172k|    }
  285|   172k|    *str = cur;
  286|   172k|    return (0);
  287|   172k|}
uri.c:xmlParse3986RelativeRef:
  833|   352k|xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
  834|   352k|    int ret;
  835|       |
  836|   352k|    if ((*str == '/') && (*(str + 1) == '/')) {
  ------------------
  |  Branch (836:9): [True: 10.3k, False: 342k]
  |  Branch (836:26): [True: 2.86k, False: 7.53k]
  ------------------
  837|  2.86k|        str += 2;
  838|  2.86k|	ret = xmlParse3986Authority(uri, &str);
  839|  2.86k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (839:6): [True: 286, False: 2.57k]
  ------------------
  840|  2.57k|	ret = xmlParse3986PathAbEmpty(uri, &str);
  841|  2.57k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (841:6): [True: 2, False: 2.57k]
  ------------------
  842|   349k|    } else if (*str == '/') {
  ------------------
  |  Branch (842:16): [True: 7.53k, False: 342k]
  ------------------
  843|  7.53k|	ret = xmlParse3986PathAbsolute(uri, &str);
  844|  7.53k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (844:6): [True: 12, False: 7.52k]
  ------------------
  845|   342k|    } else if (ISA_PCHAR(uri, str)) {
  ------------------
  |  |  174|   342k|     (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  189|   684k|#define ISA_UNRESERVED(u, p) (xmlIsUnreserved(u, p))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (189:30): [True: 153k, False: 188k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  168|   530k|     ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.87k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  7.75k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 3.51k, False: 363]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 940, False: 2.57k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 1.31k, False: 1.62k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 1.10k, False: 209]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.87k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.43k, False: 396]
  |  |  |  |  |  |  |  Branch (132:27): [True: 1.04k, False: 389]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                    ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
  |  |  |  |  ------------------
  |  |  |  |  |  |  131|  3.09k|       (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) ||		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  127|  6.18k|#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (127:23): [True: 2.80k, False: 288]
  |  |  |  |  |  |  |  |  |  Branch (127:40): [True: 901, False: 1.90k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (131:26): [True: 649, False: 1.54k]
  |  |  |  |  |  |  |  Branch (131:43): [True: 432, False: 217]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  132|  3.09k|        ((*(p) >= 'A') && (*(p) <= 'F')))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (132:10): [True: 1.31k, False: 440]
  |  |  |  |  |  |  |  Branch (132:27): [True: 930, False: 387]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (168:7): [True: 3.87k, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                    (ISA_UNRESERVED(u, p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) ||	\
  |  |  ------------------
  |  |  |  |  139|   528k|      (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (139:8): [True: 1.64k, False: 184k]
  |  |  |  |  |  Branch (139:27): [True: 2.46k, False: 182k]
  |  |  |  |  |  Branch (139:46): [True: 394, False: 181k]
  |  |  |  |  ------------------
  |  |  |  |  140|   186k|       ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (140:8): [True: 786, False: 180k]
  |  |  |  |  |  Branch (140:27): [True: 560, False: 180k]
  |  |  |  |  |  Branch (140:46): [True: 1.24k, False: 179k]
  |  |  |  |  ------------------
  |  |  |  |  141|   186k|       ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) ||		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (141:8): [True: 1.41k, False: 177k]
  |  |  |  |  |  Branch (141:27): [True: 453, False: 177k]
  |  |  |  |  |  Branch (141:46): [True: 1.53k, False: 175k]
  |  |  |  |  ------------------
  |  |  |  |  142|   186k|       ((*(p) == '=')) || ((*(p) == '\'')))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (142:8): [True: 532, False: 175k]
  |  |  |  |  |  Branch (142:27): [True: 1.11k, False: 174k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|   342k|      ((*(p) == ':')) || ((*(p) == '@')))
  |  |  ------------------
  |  |  |  Branch (175:7): [True: 1.33k, False: 172k]
  |  |  |  Branch (175:26): [True: 856, False: 171k]
  |  |  ------------------
  ------------------
  846|   170k|        ret = xmlParse3986PathNoScheme(uri, &str);
  847|   170k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (847:6): [True: 1.46k, False: 168k]
  ------------------
  848|   171k|    } else {
  849|       |	/* path-empty is effectively empty */
  850|   171k|	if (uri != NULL) {
  ------------------
  |  Branch (850:6): [True: 171k, False: 0]
  ------------------
  851|   171k|	    if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (851:10): [True: 0, False: 171k]
  ------------------
  852|   171k|	    uri->path = NULL;
  853|   171k|	}
  854|   171k|    }
  855|       |
  856|   350k|    if (*str == '?') {
  ------------------
  |  Branch (856:9): [True: 6.01k, False: 344k]
  ------------------
  857|  6.01k|	str++;
  858|  6.01k|	ret = xmlParse3986Query(uri, &str);
  859|  6.01k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (859:6): [True: 38, False: 5.97k]
  ------------------
  860|  6.01k|    }
  861|   350k|    if (*str == '#') {
  ------------------
  |  Branch (861:9): [True: 170k, False: 179k]
  ------------------
  862|   170k|	str++;
  863|   170k|	ret = xmlParse3986Fragment(uri, &str);
  864|   170k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (864:6): [True: 30, False: 170k]
  ------------------
  865|   170k|    }
  866|   350k|    if (*str != 0) {
  ------------------
  |  Branch (866:9): [True: 25.0k, False: 325k]
  ------------------
  867|  25.0k|	xmlCleanURI(uri);
  868|  25.0k|	return(1);
  869|  25.0k|    }
  870|   325k|    return(0);
  871|   350k|}
uri.c:xmlParse3986PathNoScheme:
  737|   170k|{
  738|   170k|    const char *cur;
  739|   170k|    int ret;
  740|       |
  741|   170k|    cur = *str;
  742|       |
  743|   170k|    ret = xmlParse3986Segment(uri, &cur, ':', 0);
  744|   170k|    if (ret != 0) return(ret);
  ------------------
  |  Branch (744:9): [True: 1.33k, False: 168k]
  ------------------
  745|   215k|    while (*cur == '/') {
  ------------------
  |  Branch (745:12): [True: 46.8k, False: 168k]
  ------------------
  746|  46.8k|        cur++;
  747|  46.8k|	ret = xmlParse3986Segment(uri, &cur, 0, 1);
  748|  46.8k|	if (ret != 0) return(ret);
  ------------------
  |  Branch (748:6): [True: 0, False: 46.8k]
  ------------------
  749|  46.8k|    }
  750|   168k|    if (uri != NULL) {
  ------------------
  |  Branch (750:9): [True: 168k, False: 0]
  ------------------
  751|   168k|	if (uri->path != NULL) xmlFree(uri->path);
  ------------------
  |  Branch (751:6): [True: 0, False: 168k]
  ------------------
  752|   168k|        if (cur != *str) {
  ------------------
  |  Branch (752:13): [True: 168k, False: 0]
  ------------------
  753|   168k|            if (uri->cleanup & XML_URI_NO_UNESCAPE)
  ------------------
  |  |  192|   168k|#define XML_URI_NO_UNESCAPE     2
  ------------------
  |  Branch (753:17): [True: 0, False: 168k]
  ------------------
  754|      0|                uri->path = STRNDUP(*str, cur - *str);
  ------------------
  |  |  119|      0|#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
  ------------------
  755|   168k|            else
  756|   168k|                uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
  757|   168k|            if (uri->path == NULL)
  ------------------
  |  Branch (757:17): [True: 135, False: 168k]
  ------------------
  758|    135|                return (-1);
  759|   168k|        } else {
  760|      0|            uri->path = NULL;
  761|      0|        }
  762|   168k|    }
  763|   168k|    *str = cur;
  764|   168k|    return (0);
  765|   168k|}
uri.c:xmlSaveUriRealloc:
 1074|  9.88k|xmlSaveUriRealloc(xmlChar *ret, int *max) {
 1075|  9.88k|    xmlChar *temp;
 1076|  9.88k|    int newSize;
 1077|       |
 1078|  9.88k|    newSize = xmlGrowCapacity(*max, 1, 80, MAX_URI_LENGTH);
  ------------------
  |  |   34|  9.88k|#define MAX_URI_LENGTH 1024 * 1024
  ------------------
 1079|  9.88k|    if (newSize < 0)
  ------------------
  |  Branch (1079:9): [True: 26, False: 9.85k]
  ------------------
 1080|     26|        return(NULL);
 1081|  9.85k|    temp = xmlRealloc(ret, newSize + 1);
 1082|  9.85k|    if (temp == NULL)
  ------------------
  |  Branch (1082:9): [True: 30, False: 9.82k]
  ------------------
 1083|     30|        return(NULL);
 1084|  9.82k|    *max = newSize;
 1085|  9.82k|    return(temp);
 1086|  9.85k|}
uri.c:xmlNormalizePath:
 1456|  41.1k|xmlNormalizePath(char *path, int isFile) {
 1457|  41.1k|    char *cur, *out;
 1458|  41.1k|    int numSeg = 0;
 1459|       |
 1460|  41.1k|    if (path == NULL)
  ------------------
  |  Branch (1460:9): [True: 1.69k, False: 39.4k]
  ------------------
 1461|  1.69k|	return(-1);
 1462|       |
 1463|  39.4k|    cur = path;
 1464|  39.4k|    out = path;
 1465|       |
 1466|  39.4k|    if (*cur == 0)
  ------------------
  |  Branch (1466:9): [True: 199, False: 39.2k]
  ------------------
 1467|    199|        return(0);
 1468|       |
 1469|  39.2k|    if (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1469:9): [True: 7.90k, False: 31.3k]
  ------------------
 1470|  7.90k|        cur++;
 1471|  7.90k|        *out++ = '/';
 1472|  7.90k|    }
 1473|       |
 1474|   223k|    while (*cur != 0) {
  ------------------
  |  Branch (1474:12): [True: 185k, False: 38.0k]
  ------------------
 1475|       |        /*
 1476|       |         * At this point, out is either empty or ends with a separator.
 1477|       |         * Collapse multiple separators first.
 1478|       |         */
 1479|   220k|        while (xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1479:16): [True: 35.4k, False: 185k]
  ------------------
 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|  35.4k|            cur++;
 1486|  35.4k|        }
 1487|       |
 1488|   185k|        if (*cur == '.') {
  ------------------
  |  Branch (1488:13): [True: 89.8k, False: 95.6k]
  ------------------
 1489|  89.8k|            if (cur[1] == 0) {
  ------------------
  |  Branch (1489:17): [True: 780, False: 89.0k]
  ------------------
 1490|       |                /* Ignore "." at end of path */
 1491|    780|                break;
 1492|  89.0k|            } else if (xmlIsPathSeparator(cur[1], isFile)) {
  ------------------
  |  Branch (1492:24): [True: 21.1k, False: 67.9k]
  ------------------
 1493|       |                /* Skip "./" */
 1494|  21.1k|                cur += 2;
 1495|  21.1k|                continue;
 1496|  67.9k|            } else if ((cur[1] == '.') &&
  ------------------
  |  Branch (1496:24): [True: 67.0k, False: 920]
  ------------------
 1497|  67.0k|                       ((cur[2] == 0) || xmlIsPathSeparator(cur[2], isFile))) {
  ------------------
  |  Branch (1497:25): [True: 593, False: 66.4k]
  |  Branch (1497:42): [True: 66.1k, False: 315]
  ------------------
 1498|  66.7k|                if (numSeg > 0) {
  ------------------
  |  Branch (1498:21): [True: 4.49k, False: 62.2k]
  ------------------
 1499|       |                    /* Handle ".." by removing last segment */
 1500|  22.8k|                    do {
 1501|  22.8k|                        out--;
 1502|  22.8k|                    } while ((out > path) &&
  ------------------
  |  Branch (1502:30): [True: 22.2k, False: 575]
  ------------------
 1503|  22.2k|                             !xmlIsPathSeparator(out[-1], isFile));
  ------------------
  |  Branch (1503:30): [True: 18.3k, False: 3.92k]
  ------------------
 1504|  4.49k|                    numSeg--;
 1505|       |
 1506|  4.49k|                    if (cur[2] == 0)
  ------------------
  |  Branch (1506:25): [True: 219, False: 4.27k]
  ------------------
 1507|    219|                        break;
 1508|  4.27k|                    cur += 3;
 1509|  4.27k|                    continue;
 1510|  62.2k|                } else if (out[0] == '/') {
  ------------------
  |  Branch (1510:28): [True: 422, False: 61.7k]
  ------------------
 1511|       |                    /* Ignore extraneous ".." in absolute paths */
 1512|    422|                    if (cur[2] == 0)
  ------------------
  |  Branch (1512:25): [True: 199, False: 223]
  ------------------
 1513|    199|                        break;
 1514|    223|                    cur += 3;
 1515|    223|                    continue;
 1516|  61.7k|                } else {
 1517|       |                    /* Keep "../" at start of relative path */
 1518|  61.7k|                    numSeg--;
 1519|  61.7k|                }
 1520|  66.7k|            }
 1521|  89.8k|        }
 1522|       |
 1523|       |        /* Copy segment */
 1524|  1.72M|        while ((*cur != 0) && !xmlIsPathSeparator(*cur, isFile)) {
  ------------------
  |  Branch (1524:16): [True: 1.68M, False: 36.9k]
  |  Branch (1524:31): [True: 1.56M, False: 121k]
  ------------------
 1525|  1.56M|            *out++ = *cur++;
 1526|  1.56M|        }
 1527|       |
 1528|       |        /* Copy separator */
 1529|   158k|        if (*cur != 0) {
  ------------------
  |  Branch (1529:13): [True: 121k, False: 36.9k]
  ------------------
 1530|   121k|            cur++;
 1531|   121k|            *out++ = '/';
 1532|   121k|        }
 1533|       |
 1534|   158k|        numSeg++;
 1535|   158k|    }
 1536|       |
 1537|       |    /* Keep "." if output is empty and it's a file */
 1538|  39.2k|    if ((isFile) && (out <= path))
  ------------------
  |  Branch (1538:9): [True: 31.0k, False: 8.20k]
  |  Branch (1538:21): [True: 637, False: 30.3k]
  ------------------
 1539|    637|        *out++ = '.';
 1540|  39.2k|    *out = 0;
 1541|       |
 1542|  39.2k|    return(0);
 1543|  39.4k|}
uri.c:xmlIsPathSeparator:
 1434|  2.22M|xmlIsPathSeparator(int c, int isFile) {
 1435|  2.22M|    (void) isFile;
 1436|       |
 1437|  2.22M|    if (c == '/')
  ------------------
  |  Branch (1437:9): [True: 269k, False: 1.96M]
  ------------------
 1438|   269k|        return(1);
 1439|       |
 1440|       |#if defined(LIBXML_WINPATH_ENABLED)
 1441|       |    if (isFile && (c == '\\'))
 1442|       |        return(1);
 1443|       |#endif
 1444|       |
 1445|  1.96M|    return(0);
 1446|  2.22M|}
uri.c:is_hex:
 1559|  3.75M|static int is_hex(char c) {
 1560|  3.75M|    if (((c >= '0') && (c <= '9')) ||
  ------------------
  |  Branch (1560:10): [True: 3.74M, False: 1.85k]
  |  Branch (1560:24): [True: 3.71M, False: 35.0k]
  ------------------
 1561|  36.9k|        ((c >= 'a') && (c <= 'f')) ||
  ------------------
  |  Branch (1561:10): [True: 13.8k, False: 23.0k]
  |  Branch (1561:24): [True: 13.1k, False: 718]
  ------------------
 1562|  23.7k|        ((c >= 'A') && (c <= 'F')))
  ------------------
  |  Branch (1562:10): [True: 20.9k, False: 2.87k]
  |  Branch (1562:24): [True: 19.8k, False: 1.07k]
  ------------------
 1563|  3.74M|	return(1);
 1564|  3.95k|    return(0);
 1565|  3.75M|}
uri.c:xmlResolvePath:
 1863|   174k|xmlResolvePath(const xmlChar *escRef, const xmlChar *base, xmlChar **out) {
 1864|   174k|    const xmlChar *fragment;
 1865|   174k|    xmlChar *tmp = NULL;
 1866|   174k|    xmlChar *ref = NULL;
 1867|   174k|    xmlChar *result = NULL;
 1868|   174k|    int ret = -1;
 1869|   174k|    int i;
 1870|       |
 1871|   174k|    if (out == NULL)
  ------------------
  |  Branch (1871:9): [True: 0, False: 174k]
  ------------------
 1872|      0|        return(1);
 1873|   174k|    *out = NULL;
 1874|       |
 1875|   174k|    if ((escRef == NULL) || (escRef[0] == 0)) {
  ------------------
  |  Branch (1875:9): [True: 0, False: 174k]
  |  Branch (1875:29): [True: 635, False: 173k]
  ------------------
 1876|    635|        if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1876:13): [True: 0, False: 635]
  |  Branch (1876:31): [True: 302, False: 333]
  ------------------
 1877|    302|            return(1);
 1878|    333|        ref = xmlStrdup(base);
 1879|    333|        if (ref == NULL)
  ------------------
  |  Branch (1879:13): [True: 3, False: 330]
  ------------------
 1880|      3|            goto err_memory;
 1881|    330|        *out = ref;
 1882|    330|        return(0);
 1883|    333|    }
 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|   173k|    fragment = xmlStrchr(escRef, '#');
 1891|   173k|    if (fragment != NULL) {
  ------------------
  |  Branch (1891:9): [True: 159k, False: 14.0k]
  ------------------
 1892|   159k|        tmp = xmlStrndup(escRef, fragment - escRef);
 1893|   159k|        if (tmp == NULL)
  ------------------
  |  Branch (1893:13): [True: 8, False: 159k]
  ------------------
 1894|      8|            goto err_memory;
 1895|   159k|        escRef = tmp;
 1896|   159k|    }
 1897|       |
 1898|   173k|    ref = (xmlChar *) xmlURIUnescapeString((char *) escRef, -1, NULL);
 1899|   173k|    if (ref == NULL)
  ------------------
  |  Branch (1899:9): [True: 41, False: 173k]
  ------------------
 1900|     41|        goto err_memory;
 1901|       |
 1902|   173k|    if ((base == NULL) || (base[0] == 0))
  ------------------
  |  Branch (1902:9): [True: 0, False: 173k]
  |  Branch (1902:27): [True: 159k, False: 13.6k]
  ------------------
 1903|   159k|        goto done;
 1904|       |
 1905|  13.6k|    if (xmlIsAbsolutePath(ref))
  ------------------
  |  Branch (1905:9): [True: 2.38k, False: 11.2k]
  ------------------
 1906|  2.38k|        goto done;
 1907|       |
 1908|       |    /*
 1909|       |     * Remove last segment from base
 1910|       |     */
 1911|  11.2k|    i = xmlStrlen(base);
 1912|  71.8k|    while ((i > 0) && !xmlIsPathSeparator(base[i-1], 1))
  ------------------
  |  Branch (1912:12): [True: 70.2k, False: 1.57k]
  |  Branch (1912:23): [True: 60.6k, False: 9.64k]
  ------------------
 1913|  60.6k|        i--;
 1914|       |
 1915|       |    /*
 1916|       |     * Concatenate base and ref
 1917|       |     */
 1918|  11.2k|    if (i > 0) {
  ------------------
  |  Branch (1918:9): [True: 9.64k, False: 1.57k]
  ------------------
 1919|  9.64k|        int refLen = xmlStrlen(ref);
 1920|       |
 1921|  9.64k|        result = xmlMalloc(i + refLen + 1);
 1922|  9.64k|        if (result == NULL)
  ------------------
  |  Branch (1922:13): [True: 29, False: 9.61k]
  ------------------
 1923|     29|            goto err_memory;
 1924|       |
 1925|  9.61k|        memcpy(result, base, i);
 1926|  9.61k|        memcpy(result + i, ref, refLen + 1);
 1927|  9.61k|    }
 1928|       |
 1929|       |    /*
 1930|       |     * Normalize
 1931|       |     */
 1932|  11.1k|    xmlNormalizePath((char *) result, 1);
 1933|       |
 1934|   173k|done:
 1935|   173k|    if (result == NULL) {
  ------------------
  |  Branch (1935:9): [True: 163k, False: 9.61k]
  ------------------
 1936|   163k|        result = ref;
 1937|   163k|        ref = NULL;
 1938|   163k|    }
 1939|       |
 1940|   173k|    if (fragment != NULL) {
  ------------------
  |  Branch (1940:9): [True: 159k, False: 14.0k]
  ------------------
 1941|   159k|        result = xmlStrcat(result, fragment);
 1942|   159k|        if (result == NULL)
  ------------------
  |  Branch (1942:13): [True: 7, False: 159k]
  ------------------
 1943|      7|            goto err_memory;
 1944|   159k|    }
 1945|       |
 1946|   173k|    *out = result;
 1947|   173k|    ret = 0;
 1948|       |
 1949|   173k|err_memory:
 1950|   173k|    xmlFree(tmp);
 1951|   173k|    xmlFree(ref);
 1952|   173k|    return(ret);
 1953|   173k|}
uri.c:xmlIsAbsolutePath:
 1837|  35.0k|xmlIsAbsolutePath(const xmlChar *path) {
 1838|  35.0k|    int c = path[0];
 1839|       |
 1840|  35.0k|    if (xmlIsPathSeparator(c, 1))
  ------------------
  |  Branch (1840:9): [True: 3.24k, False: 31.7k]
  ------------------
 1841|  3.24k|        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|  31.7k|    return(0);
 1851|  35.0k|}
uri.c:xmlParseUriOrPath:
 2344|  22.4k|xmlParseUriOrPath(const char *str, xmlURIPtr *out, int *drive) {
 2345|  22.4k|    xmlURIPtr uri;
 2346|  22.4k|    char *buf = NULL;
 2347|  22.4k|    int ret;
 2348|       |
 2349|  22.4k|    *out = NULL;
 2350|  22.4k|    *drive = 0;
 2351|       |
 2352|  22.4k|    uri = xmlCreateURI();
 2353|  22.4k|    if (uri == NULL) {
  ------------------
  |  Branch (2353:9): [True: 17, False: 22.4k]
  ------------------
 2354|     17|        ret = -1;
 2355|     17|	goto done;
 2356|     17|    }
 2357|       |
 2358|  22.4k|    if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  22.4k|#define BAD_CAST (xmlChar *)
  ------------------
                  if (xmlStrstr(BAD_CAST str, BAD_CAST "://") == NULL) {
  ------------------
  |  |   34|  22.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2358:9): [True: 21.4k, False: 1.05k]
  ------------------
 2359|  21.4k|        const char *path;
 2360|  21.4k|        size_t pathSize;
 2361|  21.4k|        int prependSlash = 0;
 2362|       |
 2363|  21.4k|        buf = xmlMemStrdup(str);
 2364|  21.4k|        if (buf == NULL) {
  ------------------
  |  Branch (2364:13): [True: 12, False: 21.3k]
  ------------------
 2365|     12|            ret = -1;
 2366|     12|            goto done;
 2367|     12|        }
 2368|  21.3k|        xmlNormalizePath(buf, /* isFile */ 1);
 2369|       |
 2370|  21.3k|        path = buf;
 2371|       |
 2372|  21.3k|        if (xmlIsAbsolutePath(BAD_CAST buf)) {
  ------------------
  |  |   34|  21.3k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (2372:13): [True: 858, False: 20.5k]
  ------------------
 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|    858|        }
 2426|       |
 2427|  21.3k|        pathSize = strlen(path);
 2428|  21.3k|        uri->path = xmlMalloc(pathSize + prependSlash + 1);
 2429|  21.3k|        if (uri->path == NULL) {
  ------------------
  |  Branch (2429:13): [True: 19, False: 21.3k]
  ------------------
 2430|     19|            ret = -1;
 2431|     19|            goto done;
 2432|     19|        }
 2433|  21.3k|        if (prependSlash) {
  ------------------
  |  Branch (2433:13): [True: 0, False: 21.3k]
  ------------------
 2434|      0|            uri->path[0] = '/';
 2435|      0|            memcpy(uri->path + 1, path, pathSize + 1);
 2436|  21.3k|        } else {
 2437|  21.3k|            memcpy(uri->path, path, pathSize + 1);
 2438|  21.3k|        }
 2439|  21.3k|    } else {
 2440|  1.05k|	ret = xmlParseURIReference(uri, str);
 2441|  1.05k|	if (ret != 0)
  ------------------
  |  Branch (2441:6): [True: 570, False: 486]
  ------------------
 2442|    570|	    goto done;
 2443|       |
 2444|    486|        xmlNormalizePath(uri->path, /* isFile */ 0);
 2445|    486|    }
 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|  21.8k|    *out = uri;
 2456|  21.8k|    uri = NULL;
 2457|  21.8k|    ret = 0;
 2458|       |
 2459|  22.4k|done:
 2460|  22.4k|    xmlFreeURI(uri);
 2461|  22.4k|    xmlFree(buf);
 2462|       |
 2463|  22.4k|    return(ret);
 2464|  21.8k|}

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

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

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

xmlRegNewExecCtxt:
 3615|  15.5k|xmlRegNewExecCtxt(xmlRegexp *comp, xmlRegExecCallbacks callback, void *data) {
 3616|  15.5k|    xmlRegExecCtxtPtr exec;
 3617|       |
 3618|  15.5k|    if (comp == NULL)
  ------------------
  |  Branch (3618:9): [True: 0, False: 15.5k]
  ------------------
 3619|      0|	return(NULL);
 3620|  15.5k|    if ((comp->compact == NULL) && (comp->states == NULL))
  ------------------
  |  Branch (3620:9): [True: 2.17k, False: 13.3k]
  |  Branch (3620:36): [True: 0, False: 2.17k]
  ------------------
 3621|      0|        return(NULL);
 3622|  15.5k|    exec = (xmlRegExecCtxtPtr) xmlMalloc(sizeof(xmlRegExecCtxt));
 3623|  15.5k|    if (exec == NULL)
  ------------------
  |  Branch (3623:9): [True: 25, False: 15.4k]
  ------------------
 3624|     25|	return(NULL);
 3625|  15.4k|    memset(exec, 0, sizeof(xmlRegExecCtxt));
 3626|  15.4k|    exec->inputString = NULL;
 3627|  15.4k|    exec->index = 0;
 3628|  15.4k|    exec->determinist = 1;
 3629|  15.4k|    exec->maxRollbacks = 0;
 3630|  15.4k|    exec->nbRollbacks = 0;
 3631|  15.4k|    exec->rollbacks = NULL;
 3632|  15.4k|    exec->status = XML_REGEXP_OK;
  ------------------
  |  |   11|  15.4k|#define XML_REGEXP_OK               0
  ------------------
 3633|  15.4k|    exec->comp = comp;
 3634|  15.4k|    if (comp->compact == NULL)
  ------------------
  |  Branch (3634:9): [True: 2.17k, False: 13.3k]
  ------------------
 3635|  2.17k|	exec->state = comp->states[0];
 3636|  15.4k|    exec->transno = 0;
 3637|  15.4k|    exec->transcount = 0;
 3638|  15.4k|    exec->callback = callback;
 3639|  15.4k|    exec->data = data;
 3640|  15.4k|    if (comp->nbCounters > 0) {
  ------------------
  |  Branch (3640:9): [True: 0, False: 15.4k]
  ------------------
 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|  15.4k|    } else {
 3654|  15.4k|	exec->counts = NULL;
 3655|  15.4k|	exec->errCounts = NULL;
 3656|  15.4k|    }
 3657|  15.4k|    exec->inputStackMax = 0;
 3658|  15.4k|    exec->inputStackNr = 0;
 3659|  15.4k|    exec->inputStack = NULL;
 3660|  15.4k|    exec->errStateNo = -1;
 3661|       |    exec->errString = NULL;
 3662|  15.4k|    exec->nbPush = 0;
 3663|  15.4k|    return(exec);
 3664|  15.4k|}
xmlRegFreeExecCtxt:
 3674|  16.0k|xmlRegFreeExecCtxt(xmlRegExecCtxt *exec) {
 3675|  16.0k|    if (exec == NULL)
  ------------------
  |  Branch (3675:9): [True: 541, False: 15.4k]
  ------------------
 3676|    541|	return;
 3677|       |
 3678|  15.4k|    if (exec->rollbacks != NULL) {
  ------------------
  |  Branch (3678:9): [True: 699, False: 14.7k]
  ------------------
 3679|    699|	if (exec->counts != NULL) {
  ------------------
  |  Branch (3679:6): [True: 0, False: 699]
  ------------------
 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|    699|	xmlFree(exec->rollbacks);
 3687|    699|    }
 3688|  15.4k|    if (exec->counts != NULL)
  ------------------
  |  Branch (3688:9): [True: 0, False: 15.4k]
  ------------------
 3689|      0|	xmlFree(exec->counts);
 3690|  15.4k|    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (3690:9): [True: 699, False: 14.7k]
  ------------------
 3691|    699|	int i;
 3692|       |
 3693|  60.3k|	for (i = 0;i < exec->inputStackNr;i++) {
  ------------------
  |  Branch (3693:13): [True: 59.6k, False: 699]
  ------------------
 3694|  59.6k|	    if (exec->inputStack[i].value != NULL)
  ------------------
  |  Branch (3694:10): [True: 59.6k, False: 0]
  ------------------
 3695|  59.6k|		xmlFree(exec->inputStack[i].value);
 3696|  59.6k|	}
 3697|    699|	xmlFree(exec->inputStack);
 3698|    699|    }
 3699|  15.4k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3699:9): [True: 6.80k, False: 8.67k]
  ------------------
 3700|  6.80k|        xmlFree(exec->errString);
 3701|  15.4k|    xmlFree(exec);
 3702|  15.4k|}
xmlRegExecPushString:
 4197|  89.6k|	             void *data) {
 4198|  89.6k|    return(xmlRegExecPushStringInternal(exec, value, data, 0));
 4199|  89.6k|}
xmlRegexpIsDeterminist:
 5558|  7.40k|xmlRegexpIsDeterminist(xmlRegexp *comp) {
 5559|  7.40k|    xmlAutomataPtr am;
 5560|  7.40k|    int ret;
 5561|       |
 5562|  7.40k|    if (comp == NULL)
  ------------------
  |  Branch (5562:9): [True: 0, False: 7.40k]
  ------------------
 5563|      0|	return(-1);
 5564|  7.40k|    if (comp->determinist != -1)
  ------------------
  |  Branch (5564:9): [True: 5.95k, False: 1.44k]
  ------------------
 5565|  5.95k|	return(comp->determinist);
 5566|       |
 5567|  1.44k|    am = xmlNewAutomata();
 5568|  1.44k|    if (am == NULL)
  ------------------
  |  Branch (5568:9): [True: 17, False: 1.42k]
  ------------------
 5569|     17|        return(-1);
 5570|  1.42k|    if (am->states != NULL) {
  ------------------
  |  Branch (5570:9): [True: 1.42k, False: 0]
  ------------------
 5571|  1.42k|	int i;
 5572|       |
 5573|  2.85k|	for (i = 0;i < am->nbStates;i++)
  ------------------
  |  Branch (5573:13): [True: 1.42k, False: 1.42k]
  ------------------
 5574|  1.42k|	    xmlRegFreeState(am->states[i]);
 5575|  1.42k|	xmlFree(am->states);
 5576|  1.42k|    }
 5577|  1.42k|    am->nbAtoms = comp->nbAtoms;
 5578|  1.42k|    am->atoms = comp->atoms;
 5579|  1.42k|    am->nbStates = comp->nbStates;
 5580|  1.42k|    am->states = comp->states;
 5581|  1.42k|    am->determinist = -1;
 5582|  1.42k|    am->flags = comp->flags;
 5583|  1.42k|    ret = xmlFAComputesDeterminism(am);
 5584|  1.42k|    am->atoms = NULL;
 5585|       |    am->states = NULL;
 5586|  1.42k|    xmlFreeAutomata(am);
 5587|  1.42k|    comp->determinist = ret;
 5588|  1.42k|    return(ret);
 5589|  1.44k|}
xmlRegFreeRegexp:
 5597|  1.34k|xmlRegFreeRegexp(xmlRegexp *regexp) {
 5598|  1.34k|    int i;
 5599|  1.34k|    if (regexp == NULL)
  ------------------
  |  Branch (5599:9): [True: 0, False: 1.34k]
  ------------------
 5600|      0|	return;
 5601|       |
 5602|  1.34k|    if (regexp->string != NULL)
  ------------------
  |  Branch (5602:9): [True: 0, False: 1.34k]
  ------------------
 5603|      0|	xmlFree(regexp->string);
 5604|  1.34k|    if (regexp->states != NULL) {
  ------------------
  |  Branch (5604:9): [True: 425, False: 922]
  ------------------
 5605|   241k|	for (i = 0;i < regexp->nbStates;i++)
  ------------------
  |  Branch (5605:13): [True: 240k, False: 425]
  ------------------
 5606|   240k|	    xmlRegFreeState(regexp->states[i]);
 5607|    425|	xmlFree(regexp->states);
 5608|    425|    }
 5609|  1.34k|    if (regexp->atoms != NULL) {
  ------------------
  |  Branch (5609:9): [True: 425, False: 922]
  ------------------
 5610|   191k|	for (i = 0;i < regexp->nbAtoms;i++)
  ------------------
  |  Branch (5610:13): [True: 191k, False: 425]
  ------------------
 5611|   191k|	    xmlRegFreeAtom(regexp->atoms[i]);
 5612|    425|	xmlFree(regexp->atoms);
 5613|    425|    }
 5614|  1.34k|    if (regexp->counters != NULL)
  ------------------
  |  Branch (5614:9): [True: 0, False: 1.34k]
  ------------------
 5615|      0|	xmlFree(regexp->counters);
 5616|  1.34k|    if (regexp->compact != NULL)
  ------------------
  |  Branch (5616:9): [True: 922, False: 425]
  ------------------
 5617|    922|	xmlFree(regexp->compact);
 5618|  1.34k|    if (regexp->transdata != NULL)
  ------------------
  |  Branch (5618:9): [True: 0, False: 1.34k]
  ------------------
 5619|      0|	xmlFree(regexp->transdata);
 5620|  1.34k|    if (regexp->stringMap != NULL) {
  ------------------
  |  Branch (5620:9): [True: 922, False: 425]
  ------------------
 5621|  4.61k|	for (i = 0; i < regexp->nbstrings;i++)
  ------------------
  |  Branch (5621:14): [True: 3.69k, False: 922]
  ------------------
 5622|  3.69k|	    xmlFree(regexp->stringMap[i]);
 5623|    922|	xmlFree(regexp->stringMap);
 5624|    922|    }
 5625|       |
 5626|  1.34k|    xmlFree(regexp);
 5627|  1.34k|}
xmlNewAutomata:
 5643|  3.33k|xmlNewAutomata(void) {
 5644|  3.33k|    xmlAutomataPtr ctxt;
 5645|       |
 5646|  3.33k|    ctxt = xmlRegNewParserCtxt(NULL);
 5647|  3.33k|    if (ctxt == NULL)
  ------------------
  |  Branch (5647:9): [True: 9, False: 3.32k]
  ------------------
 5648|      9|	return(NULL);
 5649|       |
 5650|       |    /* initialize the parser */
 5651|  3.32k|    ctxt->state = xmlRegStatePush(ctxt);
 5652|  3.32k|    if (ctxt->state == NULL) {
  ------------------
  |  Branch (5652:9): [True: 24, False: 3.30k]
  ------------------
 5653|     24|	xmlFreeAutomata(ctxt);
 5654|     24|	return(NULL);
 5655|     24|    }
 5656|  3.30k|    ctxt->start = ctxt->state;
 5657|  3.30k|    ctxt->end = NULL;
 5658|       |
 5659|  3.30k|    ctxt->start->type = XML_REGEXP_START_STATE;
 5660|  3.30k|    ctxt->flags = 0;
 5661|       |
 5662|  3.30k|    return(ctxt);
 5663|  3.32k|}
xmlFreeAutomata:
 5673|  3.32k|xmlFreeAutomata(xmlAutomata *am) {
 5674|  3.32k|    if (am == NULL)
  ------------------
  |  Branch (5674:9): [True: 0, False: 3.32k]
  ------------------
 5675|      0|	return;
 5676|  3.32k|    xmlRegFreeParserCtxt(am);
 5677|  3.32k|}
xmlAutomataGetInitState:
 5703|  1.87k|xmlAutomataGetInitState(xmlAutomata *am) {
 5704|  1.87k|    if (am == NULL)
  ------------------
  |  Branch (5704:9): [True: 0, False: 1.87k]
  ------------------
 5705|      0|	return(NULL);
 5706|  1.87k|    return(am->start);
 5707|  1.87k|}
xmlAutomataSetFinalState:
 5719|  1.86k|xmlAutomataSetFinalState(xmlAutomata *am, xmlAutomataState *state) {
 5720|  1.86k|    if ((am == NULL) || (state == NULL))
  ------------------
  |  Branch (5720:9): [True: 0, False: 1.86k]
  |  Branch (5720:25): [True: 79, False: 1.78k]
  ------------------
 5721|     79|	return(-1);
 5722|  1.78k|    state->type = XML_REGEXP_FINAL_STATE;
 5723|  1.78k|    return(0);
 5724|  1.86k|}
xmlAutomataNewTransition:
 5745|   301k|			 void *data) {
 5746|   301k|    xmlRegAtomPtr atom;
 5747|       |
 5748|   301k|    if ((am == NULL) || (from == NULL) || (token == NULL))
  ------------------
  |  Branch (5748:9): [True: 0, False: 301k]
  |  Branch (5748:25): [True: 5.61k, False: 295k]
  |  Branch (5748:43): [True: 0, False: 295k]
  ------------------
 5749|  5.61k|	return(NULL);
 5750|   295k|    atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
 5751|   295k|    if (atom == NULL)
  ------------------
  |  Branch (5751:9): [True: 47, False: 295k]
  ------------------
 5752|     47|        return(NULL);
 5753|   295k|    atom->data = data;
 5754|   295k|    atom->valuep = xmlStrdup(token);
 5755|   295k|    if (atom->valuep == NULL) {
  ------------------
  |  Branch (5755:9): [True: 44, False: 295k]
  ------------------
 5756|     44|        xmlRegFreeAtom(atom);
 5757|     44|        xmlRegexpErrMemory(am);
 5758|     44|        return(NULL);
 5759|     44|    }
 5760|       |
 5761|   295k|    if (xmlFAGenerateTransitions(am, from, to, atom) < 0) {
  ------------------
  |  Branch (5761:9): [True: 63, False: 295k]
  ------------------
 5762|     63|        xmlRegFreeAtom(atom);
 5763|     63|	return(NULL);
 5764|     63|    }
 5765|   295k|    if (to == NULL)
  ------------------
  |  Branch (5765:9): [True: 252k, False: 42.3k]
  ------------------
 5766|   252k|	return(am->state);
 5767|  42.3k|    return(to);
 5768|   295k|}
xmlAutomataNewState:
 6229|  33.6k|xmlAutomataNewState(xmlAutomata *am) {
 6230|  33.6k|    if (am == NULL)
  ------------------
  |  Branch (6230:9): [True: 0, False: 33.6k]
  ------------------
 6231|      0|	return(NULL);
 6232|  33.6k|    return(xmlRegStatePush(am));
 6233|  33.6k|}
xmlAutomataNewEpsilon:
 6249|   303k|		      xmlAutomataState *to) {
 6250|   303k|    if ((am == NULL) || (from == NULL))
  ------------------
  |  Branch (6250:9): [True: 0, False: 303k]
  |  Branch (6250:25): [True: 1.11k, False: 302k]
  ------------------
 6251|  1.11k|	return(NULL);
 6252|   302k|    xmlFAGenerateEpsilonTransition(am, from, to);
 6253|   302k|    if (to == NULL)
  ------------------
  |  Branch (6253:9): [True: 96.5k, False: 205k]
  ------------------
 6254|  96.5k|	return(am->state);
 6255|   205k|    return(to);
 6256|   302k|}
xmlAutomataCompile:
 6366|  1.86k|xmlAutomataCompile(xmlAutomata *am) {
 6367|  1.86k|    xmlRegexpPtr ret;
 6368|       |
 6369|  1.86k|    if ((am == NULL) || (am->error != 0)) return(NULL);
  ------------------
  |  Branch (6369:9): [True: 0, False: 1.86k]
  |  Branch (6369:25): [True: 326, False: 1.53k]
  ------------------
 6370|  1.53k|    xmlFAEliminateEpsilonTransitions(am);
 6371|  1.53k|    if (am->error != 0)
  ------------------
  |  Branch (6371:9): [True: 83, False: 1.45k]
  ------------------
 6372|     83|        return(NULL);
 6373|       |    /* xmlFAComputesDeterminism(am); */
 6374|  1.45k|    ret = xmlRegEpxFromParse(am);
 6375|       |
 6376|  1.45k|    return(ret);
 6377|  1.53k|}
xmlregexp.c:xmlRegExecPushStringInternal:
 3886|  89.6k|	                     void *data, int compound) {
 3887|  89.6k|    xmlRegTransPtr trans;
 3888|  89.6k|    xmlRegAtomPtr atom;
 3889|  89.6k|    int ret;
 3890|  89.6k|    int final = 0;
 3891|  89.6k|    int progress = 1;
 3892|       |
 3893|  89.6k|    if (exec == NULL)
  ------------------
  |  Branch (3893:9): [True: 0, False: 89.6k]
  ------------------
 3894|      0|	return(-1);
 3895|  89.6k|    if (exec->comp == NULL)
  ------------------
  |  Branch (3895:9): [True: 0, False: 89.6k]
  ------------------
 3896|      0|	return(-1);
 3897|  89.6k|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  89.6k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3897:9): [True: 13.5k, False: 76.1k]
  ------------------
 3898|  13.5k|	return(exec->status);
 3899|       |
 3900|  76.1k|    if (exec->comp->compact != NULL)
  ------------------
  |  Branch (3900:9): [True: 14.2k, False: 61.9k]
  ------------------
 3901|  14.2k|	return(xmlRegCompactPushString(exec, exec->comp, value, data));
 3902|       |
 3903|  61.9k|    if (value == NULL) {
  ------------------
  |  Branch (3903:9): [True: 1.13k, False: 60.7k]
  ------------------
 3904|  1.13k|        if (exec->state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (3904:13): [True: 779, False: 355]
  ------------------
 3905|    779|	    return(1);
 3906|    355|	final = 1;
 3907|    355|    }
 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|  61.1k|    if ((value != NULL) && (exec->inputStackNr > 0)) {
  ------------------
  |  Branch (3913:9): [True: 60.7k, False: 355]
  |  Branch (3913:28): [True: 58.9k, False: 1.84k]
  ------------------
 3914|  58.9k|	xmlFARegExecSaveInputString(exec, value, data);
 3915|  58.9k|	value = exec->inputStack[exec->index].value;
 3916|  58.9k|	data = exec->inputStack[exec->index].data;
 3917|  58.9k|    }
 3918|       |
 3919|  75.8M|    while ((exec->status == XML_REGEXP_OK) &&
  ------------------
  |  |   11|  75.8M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3919:12): [True: 75.8M, False: 1.35k]
  ------------------
 3920|  75.8M|	   ((value != NULL) ||
  ------------------
  |  Branch (3920:6): [True: 75.5M, False: 322k]
  ------------------
 3921|   322k|	    ((final == 1) &&
  ------------------
  |  Branch (3921:7): [True: 262k, False: 59.7k]
  ------------------
 3922|  75.8M|	     (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
  ------------------
  |  Branch (3922:7): [True: 262k, False: 39]
  ------------------
 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|  75.8M|	if ((value == NULL) && (exec->counts == NULL))
  ------------------
  |  Branch (3929:6): [True: 262k, False: 75.5M]
  |  Branch (3929:25): [True: 262k, False: 0]
  ------------------
 3930|   262k|	    goto rollback;
 3931|       |
 3932|  75.5M|	exec->transcount = 0;
 3933|   150M|	for (;exec->transno < exec->state->nbTrans;exec->transno++) {
  ------------------
  |  Branch (3933:8): [True: 113M, False: 37.6M]
  ------------------
 3934|   113M|	    trans = &exec->state->trans[exec->transno];
 3935|   113M|	    if (trans->to < 0)
  ------------------
  |  Branch (3935:10): [True: 37.6M, False: 75.6M]
  ------------------
 3936|  37.6M|		continue;
 3937|  75.6M|	    atom = trans->atom;
 3938|  75.6M|	    ret = 0;
 3939|  75.6M|	    if (trans->count == REGEXP_ALL_LAX_COUNTER) {
  ------------------
  |  |  405|  75.6M|#define REGEXP_ALL_LAX_COUNTER	0x123457
  ------------------
  |  Branch (3939:10): [True: 0, False: 75.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|  75.6M|	    } else if (trans->count == REGEXP_ALL_COUNTER) {
  ------------------
  |  |  404|  75.6M|#define REGEXP_ALL_COUNTER	0x123456
  ------------------
  |  Branch (3974:17): [True: 0, False: 75.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|  75.6M|	    } else if (trans->count >= 0) {
  ------------------
  |  Branch (3996:17): [True: 0, False: 75.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|  75.6M|	    } else if (atom == NULL) {
  ------------------
  |  Branch (4007:17): [True: 0, False: 75.6M]
  ------------------
 4008|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4009|      0|		break;
 4010|  75.6M|	    } else if (value != NULL) {
  ------------------
  |  Branch (4010:17): [True: 75.6M, False: 0]
  ------------------
 4011|  75.6M|		ret = xmlRegStrEqualWildcard(atom->valuep, value);
 4012|  75.6M|		if (atom->neg) {
  ------------------
  |  Branch (4012:7): [True: 0, False: 75.6M]
  ------------------
 4013|      0|		    ret = !ret;
 4014|      0|		    if (!compound)
  ------------------
  |  Branch (4014:11): [True: 0, False: 0]
  ------------------
 4015|      0|		        ret = 0;
 4016|      0|		}
 4017|  75.6M|		if ((ret == 1) && (trans->counter >= 0)) {
  ------------------
  |  Branch (4017:7): [True: 37.9M, False: 37.6M]
  |  Branch (4017:21): [True: 0, False: 37.9M]
  ------------------
 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|  75.6M|		if ((ret == 1) && (atom->min > 0) && (atom->max > 0)) {
  ------------------
  |  Branch (4027:7): [True: 37.9M, False: 37.6M]
  |  Branch (4027:21): [True: 0, False: 37.9M]
  |  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|  75.6M|	    }
 4091|  75.6M|	    if (ret == 1) {
  ------------------
  |  Branch (4091:10): [True: 37.9M, False: 37.6M]
  ------------------
 4092|  37.9M|		if ((exec->callback != NULL) && (atom != NULL) &&
  ------------------
  |  Branch (4092:7): [True: 0, False: 37.9M]
  |  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|  37.9M|		if (exec->state->nbTrans > exec->transno + 1) {
  ------------------
  |  Branch (4097:7): [True: 37.8M, False: 49.9k]
  ------------------
 4098|  37.8M|		    if (exec->inputStackNr <= 0) {
  ------------------
  |  Branch (4098:11): [True: 700, False: 37.8M]
  ------------------
 4099|    700|			xmlFARegExecSaveInputString(exec, value, data);
 4100|    700|		    }
 4101|  37.8M|		    xmlFARegExecSave(exec);
 4102|  37.8M|		}
 4103|  37.9M|		if (trans->counter >= 0) {
  ------------------
  |  Branch (4103:7): [True: 0, False: 37.9M]
  ------------------
 4104|      0|		    exec->counts[trans->counter]++;
 4105|      0|		}
 4106|  37.9M|		if ((trans->count >= 0) &&
  ------------------
  |  Branch (4106:7): [True: 0, False: 37.9M]
  ------------------
 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|  37.9M|                if ((exec->comp->states[trans->to] != NULL) &&
  ------------------
  |  Branch (4110:21): [True: 37.9M, False: 0]
  ------------------
 4111|  37.9M|		    (exec->comp->states[trans->to]->type ==
  ------------------
  |  Branch (4111:7): [True: 0, False: 37.9M]
  ------------------
 4112|  37.9M|		     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|  37.9M|		exec->state = exec->comp->states[trans->to];
 4124|  37.9M|		exec->transno = 0;
 4125|  37.9M|		if (trans->atom != NULL) {
  ------------------
  |  Branch (4125:7): [True: 37.9M, False: 0]
  ------------------
 4126|  37.9M|		    if (exec->inputStack != NULL) {
  ------------------
  |  Branch (4126:11): [True: 37.9M, False: 387]
  ------------------
 4127|  37.9M|			exec->index++;
 4128|  37.9M|			if (exec->index < exec->inputStackNr) {
  ------------------
  |  Branch (4128:8): [True: 37.6M, False: 321k]
  ------------------
 4129|  37.6M|			    value = exec->inputStack[exec->index].value;
 4130|  37.6M|			    data = exec->inputStack[exec->index].data;
 4131|  37.6M|			} else {
 4132|   321k|			    value = NULL;
 4133|   321k|			    data = NULL;
 4134|   321k|			}
 4135|  37.9M|		    } else {
 4136|    387|			value = NULL;
 4137|    387|			data = NULL;
 4138|    387|		    }
 4139|  37.9M|		}
 4140|  37.9M|		goto progress;
 4141|  37.9M|	    } else if (ret < 0) {
  ------------------
  |  Branch (4141:17): [True: 0, False: 37.6M]
  ------------------
 4142|      0|		exec->status = XML_REGEXP_INTERNAL_ERROR;
  ------------------
  |  |   13|      0|#define XML_REGEXP_INTERNAL_ERROR   (-4)
  ------------------
 4143|      0|		break;
 4144|      0|	    }
 4145|  75.6M|	}
 4146|  37.6M|	if ((exec->transno != 0) || (exec->state->nbTrans == 0)) {
  ------------------
  |  Branch (4146:6): [True: 37.6M, False: 222]
  |  Branch (4146:30): [True: 222, False: 0]
  ------------------
 4147|  37.8M|rollback:
 4148|       |            /*
 4149|       |	     * if we didn't yet rollback on the current input
 4150|       |	     * store the current state as the error state.
 4151|       |	     */
 4152|  37.8M|	    if ((progress) && (exec->state != NULL) &&
  ------------------
  |  Branch (4152:10): [True: 353k, False: 37.5M]
  |  Branch (4152:24): [True: 353k, False: 0]
  ------------------
 4153|   353k|	        (exec->state->type != XML_REGEXP_SINK_STATE)) {
  ------------------
  |  Branch (4153:10): [True: 353k, False: 0]
  ------------------
 4154|   353k|	        progress = 0;
 4155|   353k|                if (xmlRegExecSetErrString(exec, value) < 0)
  ------------------
  |  Branch (4155:21): [True: 3, False: 353k]
  ------------------
 4156|      3|                    break;
 4157|   353k|		exec->errState = exec->state;
 4158|   353k|                if (exec->comp->nbCounters)
  ------------------
  |  Branch (4158:21): [True: 0, False: 353k]
  ------------------
 4159|      0|                    memcpy(exec->errCounts, exec->counts,
 4160|      0|                           exec->comp->nbCounters * sizeof(int));
 4161|   353k|	    }
 4162|       |
 4163|       |	    /*
 4164|       |	     * Failed to find a way out
 4165|       |	     */
 4166|  37.8M|	    exec->determinist = 0;
 4167|  37.8M|	    xmlFARegExecRollBack(exec);
 4168|  37.8M|	    if ((exec->inputStack != NULL ) &&
  ------------------
  |  Branch (4168:10): [True: 37.8M, False: 916]
  ------------------
 4169|  37.8M|                (exec->status == XML_REGEXP_OK)) {
  ------------------
  |  |   11|  37.8M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4169:17): [True: 37.8M, False: 434]
  ------------------
 4170|  37.8M|		value = exec->inputStack[exec->index].value;
 4171|  37.8M|		data = exec->inputStack[exec->index].data;
 4172|  37.8M|	    }
 4173|  37.8M|	}
 4174|  37.8M|	continue;
 4175|  37.9M|progress:
 4176|  37.9M|        progress = 1;
 4177|  37.9M|    }
 4178|  61.1k|    if (exec->status == XML_REGEXP_OK) {
  ------------------
  |  |   11|  61.1k|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (4178:9): [True: 59.7k, False: 1.35k]
  ------------------
 4179|  59.7k|        return(exec->state->type == XML_REGEXP_FINAL_STATE);
 4180|  59.7k|    }
 4181|  1.35k|    return(exec->status);
 4182|  61.1k|}
xmlregexp.c:xmlFARegExecSaveInputString:
 3722|  59.6k|	                    void *data) {
 3723|  59.6k|    if (exec->inputStackNr + 1 >= exec->inputStackMax) {
  ------------------
  |  Branch (3723:9): [True: 1.96k, False: 57.6k]
  ------------------
 3724|  1.96k|	xmlRegInputTokenPtr tmp;
 3725|  1.96k|        int newSize;
 3726|       |
 3727|  1.96k|        newSize = xmlGrowCapacity(exec->inputStackMax, sizeof(tmp[0]),
 3728|  1.96k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  1.96k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3729|  1.96k|	if (newSize < 0) {
  ------------------
  |  Branch (3729:6): [True: 0, False: 1.96k]
  ------------------
 3730|      0|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      0|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3731|      0|	    return;
 3732|      0|	}
 3733|  1.96k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
 3734|  1.96k|        if (newSize < 2)
  ------------------
  |  Branch (3734:13): [True: 700, False: 1.26k]
  ------------------
 3735|    700|            newSize = 2;
 3736|  1.96k|#endif
 3737|  1.96k|	tmp = xmlRealloc(exec->inputStack, newSize * sizeof(tmp[0]));
 3738|  1.96k|	if (tmp == NULL) {
  ------------------
  |  Branch (3738:6): [True: 1, False: 1.96k]
  ------------------
 3739|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3740|      1|	    return;
 3741|      1|	}
 3742|  1.96k|	exec->inputStack = tmp;
 3743|  1.96k|	exec->inputStackMax = newSize;
 3744|  1.96k|    }
 3745|  59.6k|    if (value == NULL) {
  ------------------
  |  Branch (3745:9): [True: 0, False: 59.6k]
  ------------------
 3746|      0|        exec->inputStack[exec->inputStackNr].value = NULL;
 3747|  59.6k|    } else {
 3748|  59.6k|        exec->inputStack[exec->inputStackNr].value = xmlStrdup(value);
 3749|  59.6k|        if (exec->inputStack[exec->inputStackNr].value == NULL) {
  ------------------
  |  Branch (3749:13): [True: 1, False: 59.6k]
  ------------------
 3750|      1|            exec->status = XML_REGEXP_OUT_OF_MEMORY;
  ------------------
  |  |   14|      1|#define XML_REGEXP_OUT_OF_MEMORY    (-5)
  ------------------
 3751|      1|            return;
 3752|      1|        }
 3753|  59.6k|    }
 3754|  59.6k|    exec->inputStack[exec->inputStackNr].data = data;
 3755|  59.6k|    exec->inputStackNr++;
 3756|  59.6k|    exec->inputStack[exec->inputStackNr].value = NULL;
 3757|       |    exec->inputStack[exec->inputStackNr].data = NULL;
 3758|  59.6k|}
xmlregexp.c:xmlRegStrEqualWildcard:
 3772|   107M|xmlRegStrEqualWildcard(const xmlChar *expStr, const xmlChar *valStr) {
 3773|   107M|    if (expStr == valStr) return(1);
  ------------------
  |  Branch (3773:9): [True: 0, False: 107M]
  ------------------
 3774|   107M|    if (expStr == NULL) return(0);
  ------------------
  |  Branch (3774:9): [True: 0, False: 107M]
  ------------------
 3775|   107M|    if (valStr == NULL) return(0);
  ------------------
  |  Branch (3775:9): [True: 0, False: 107M]
  ------------------
 3776|   128M|    do {
 3777|       |	/*
 3778|       |	* Eval if we have a wildcard for the current item.
 3779|       |	*/
 3780|   128M|        if (*expStr != *valStr) {
  ------------------
  |  Branch (3780:13): [True: 62.2M, False: 65.8M]
  ------------------
 3781|       |	    /* if one of them starts with a wildcard make valStr be it */
 3782|  62.2M|	    if (*valStr == '*') {
  ------------------
  |  Branch (3782:10): [True: 0, False: 62.2M]
  ------------------
 3783|      0|	        const xmlChar *tmp;
 3784|       |
 3785|      0|		tmp = valStr;
 3786|      0|		valStr = expStr;
 3787|      0|		expStr = tmp;
 3788|      0|	    }
 3789|  62.2M|	    if ((*valStr != 0) && (*expStr != 0) && (*expStr++ == '*')) {
  ------------------
  |  Branch (3789:10): [True: 62.2M, False: 0]
  |  Branch (3789:28): [True: 60.8M, False: 1.45M]
  |  Branch (3789:46): [True: 0, False: 60.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|  62.2M|		return(0);
 3798|  62.2M|	}
 3799|  65.8M|	expStr++;
 3800|  65.8M|	valStr++;
 3801|  65.8M|    } while (*valStr != 0);
  ------------------
  |  Branch (3801:14): [True: 20.8M, False: 45.0M]
  ------------------
 3802|  45.0M|    if (*expStr != 0)
  ------------------
  |  Branch (3802:9): [True: 1.41M, False: 43.6M]
  ------------------
 3803|  1.41M|	return (0);
 3804|  43.6M|    else
 3805|  43.6M|	return (1);
 3806|  45.0M|}
xmlregexp.c:xmlFARegExecSave:
 3241|  37.8M|xmlFARegExecSave(xmlRegExecCtxtPtr exec) {
 3242|  37.8M|#ifdef MAX_PUSH
 3243|  37.8M|    if (exec->nbPush > MAX_PUSH) {
  ------------------
  |  |   41|  37.8M|#define MAX_PUSH 10000000
  ------------------
  |  Branch (3243:9): [True: 2, False: 37.8M]
  ------------------
 3244|      2|        exec->status = XML_REGEXP_INTERNAL_LIMIT;
  ------------------
  |  |   15|      2|#define XML_REGEXP_INTERNAL_LIMIT   (-6)
  ------------------
 3245|      2|        return;
 3246|      2|    }
 3247|  37.8M|    exec->nbPush++;
 3248|  37.8M|#endif
 3249|       |
 3250|  37.8M|    if (exec->nbRollbacks >= exec->maxRollbacks) {
  ------------------
  |  Branch (3250:9): [True: 2.02k, False: 37.8M]
  ------------------
 3251|  2.02k|	xmlRegExecRollback *tmp;
 3252|  2.02k|        int newSize;
 3253|  2.02k|	int len = exec->nbRollbacks;
 3254|       |
 3255|  2.02k|        newSize = xmlGrowCapacity(exec->maxRollbacks, sizeof(tmp[0]),
 3256|  2.02k|                                  4, XML_MAX_ITEMS);
  ------------------
  |  |   13|  2.02k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 3257|  2.02k|	if (newSize < 0) {
  ------------------
  |  Branch (3257:6): [True: 0, False: 2.02k]
  ------------------
 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.02k|	tmp = xmlRealloc(exec->rollbacks, newSize * sizeof(tmp[0]));
 3262|  2.02k|	if (tmp == NULL) {
  ------------------
  |  Branch (3262:6): [True: 1, False: 2.02k]
  ------------------
 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.02k|	exec->rollbacks = tmp;
 3267|  2.02k|	exec->maxRollbacks = newSize;
 3268|  2.02k|	tmp = &exec->rollbacks[len];
 3269|  2.02k|	memset(tmp, 0, (exec->maxRollbacks - len) * sizeof(xmlRegExecRollback));
 3270|  2.02k|    }
 3271|  37.8M|    exec->rollbacks[exec->nbRollbacks].state = exec->state;
 3272|  37.8M|    exec->rollbacks[exec->nbRollbacks].index = exec->index;
 3273|  37.8M|    exec->rollbacks[exec->nbRollbacks].nextbranch = exec->transno + 1;
 3274|  37.8M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3274:9): [True: 0, False: 37.8M]
  ------------------
 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|  37.8M|    exec->nbRollbacks++;
 3287|  37.8M|}
xmlregexp.c:xmlRegExecSetErrString:
 3705|   358k|xmlRegExecSetErrString(xmlRegExecCtxtPtr exec, const xmlChar *value) {
 3706|   358k|    if (exec->errString != NULL)
  ------------------
  |  Branch (3706:9): [True: 89.7k, False: 269k]
  ------------------
 3707|  89.7k|        xmlFree(exec->errString);
 3708|   358k|    if (value == NULL) {
  ------------------
  |  Branch (3708:9): [True: 262k, False: 96.5k]
  ------------------
 3709|   262k|        exec->errString = NULL;
 3710|   262k|    } else {
 3711|  96.5k|        exec->errString = xmlStrdup(value);
 3712|  96.5k|        if (exec->errString == NULL) {
  ------------------
  |  Branch (3712:13): [True: 28, False: 96.5k]
  ------------------
 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|  96.5k|    }
 3717|   358k|    return(0);
 3718|   358k|}
xmlregexp.c:xmlFARegExecRollBack:
 3290|  37.8M|xmlFARegExecRollBack(xmlRegExecCtxtPtr exec) {
 3291|  37.8M|    if (exec->status != XML_REGEXP_OK)
  ------------------
  |  |   11|  37.8M|#define XML_REGEXP_OK               0
  ------------------
  |  Branch (3291:9): [True: 0, False: 37.8M]
  ------------------
 3292|      0|        return;
 3293|  37.8M|    if (exec->nbRollbacks <= 0) {
  ------------------
  |  Branch (3293:9): [True: 1.35k, False: 37.8M]
  ------------------
 3294|  1.35k|	exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  1.35k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3295|  1.35k|	return;
 3296|  1.35k|    }
 3297|  37.8M|    exec->nbRollbacks--;
 3298|  37.8M|    exec->state = exec->rollbacks[exec->nbRollbacks].state;
 3299|  37.8M|    exec->index = exec->rollbacks[exec->nbRollbacks].index;
 3300|  37.8M|    exec->transno = exec->rollbacks[exec->nbRollbacks].nextbranch;
 3301|  37.8M|    if (exec->comp->nbCounters > 0) {
  ------------------
  |  Branch (3301:9): [True: 0, False: 37.8M]
  ------------------
 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|  37.8M|}
xmlregexp.c:xmlRegCompactPushString:
 3822|  14.2k|	                void *data) {
 3823|  14.2k|    int state = exec->index;
 3824|  14.2k|    int i, target;
 3825|       |
 3826|  14.2k|    if ((comp == NULL) || (comp->compact == NULL) || (comp->stringMap == NULL))
  ------------------
  |  Branch (3826:9): [True: 0, False: 14.2k]
  |  Branch (3826:27): [True: 0, False: 14.2k]
  |  Branch (3826:54): [True: 0, False: 14.2k]
  ------------------
 3827|      0|	return(-1);
 3828|       |
 3829|  14.2k|    if (value == NULL) {
  ------------------
  |  Branch (3829:9): [True: 6.71k, False: 7.48k]
  ------------------
 3830|       |	/*
 3831|       |	 * are we at a final state ?
 3832|       |	 */
 3833|  6.71k|	if (comp->compact[state * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3833:6): [True: 2.10k, False: 4.61k]
  ------------------
 3834|  6.71k|            XML_REGEXP_FINAL_STATE)
 3835|  2.10k|	    return(1);
 3836|  4.61k|	return(0);
 3837|  6.71k|    }
 3838|       |
 3839|       |    /*
 3840|       |     * Examine all outside transitions from current state
 3841|       |     */
 3842|  25.7k|    for (i = 0;i < comp->nbstrings;i++) {
  ------------------
  |  Branch (3842:16): [True: 19.9k, False: 5.77k]
  ------------------
 3843|  19.9k|	target = comp->compact[state * (comp->nbstrings + 1) + i + 1];
 3844|  19.9k|	if ((target > 0) && (target <= comp->nbstates)) {
  ------------------
  |  Branch (3844:6): [True: 15.0k, False: 4.85k]
  |  Branch (3844:22): [True: 15.0k, False: 0]
  ------------------
 3845|  15.0k|	    target--; /* to avoid 0 */
 3846|  15.0k|	    if (xmlRegStrEqualWildcard(comp->stringMap[i], value)) {
  ------------------
  |  Branch (3846:10): [True: 1.70k, False: 13.3k]
  ------------------
 3847|  1.70k|		exec->index = target;
 3848|  1.70k|		if ((exec->callback != NULL) && (comp->transdata != NULL)) {
  ------------------
  |  Branch (3848:7): [True: 0, False: 1.70k]
  |  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.70k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3852:7): [True: 0, False: 1.70k]
  ------------------
 3853|  1.70k|		    XML_REGEXP_SINK_STATE)
 3854|      0|		    goto error;
 3855|       |
 3856|  1.70k|		if (comp->compact[target * (comp->nbstrings + 1)] ==
  ------------------
  |  Branch (3856:7): [True: 1.45k, False: 248]
  ------------------
 3857|  1.70k|		    XML_REGEXP_FINAL_STATE)
 3858|  1.45k|		    return(1);
 3859|    248|		return(0);
 3860|  1.70k|	    }
 3861|  15.0k|	}
 3862|  19.9k|    }
 3863|       |    /*
 3864|       |     * Failed to find an exit transition out from current state for the
 3865|       |     * current token
 3866|       |     */
 3867|  5.77k|error:
 3868|  5.77k|    exec->errStateNo = state;
 3869|  5.77k|    exec->status = XML_REGEXP_NOT_FOUND;
  ------------------
  |  |   12|  5.77k|#define XML_REGEXP_NOT_FOUND        (-1)
  ------------------
 3870|  5.77k|    xmlRegExecSetErrString(exec, value);
 3871|  5.77k|    return(exec->status);
 3872|  7.48k|}
xmlregexp.c:xmlRegNewParserCtxt:
  731|  3.33k|xmlRegNewParserCtxt(const xmlChar *string) {
  732|  3.33k|    xmlRegParserCtxtPtr ret;
  733|       |
  734|  3.33k|    ret = (xmlRegParserCtxtPtr) xmlMalloc(sizeof(xmlRegParserCtxt));
  735|  3.33k|    if (ret == NULL)
  ------------------
  |  Branch (735:9): [True: 9, False: 3.32k]
  ------------------
  736|      9|	return(NULL);
  737|  3.32k|    memset(ret, 0, sizeof(xmlRegParserCtxt));
  738|  3.32k|    if (string != NULL) {
  ------------------
  |  Branch (738:9): [True: 0, False: 3.32k]
  ------------------
  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.32k|    ret->cur = ret->string;
  747|  3.32k|    ret->neg = 0;
  748|  3.32k|    ret->negs = 0;
  749|  3.32k|    ret->error = 0;
  750|  3.32k|    ret->determinist = -1;
  751|  3.32k|    return(ret);
  752|  3.32k|}
xmlregexp.c:xmlRegStatePush:
 1578|   386k|xmlRegStatePush(xmlRegParserCtxtPtr ctxt) {
 1579|   386k|    xmlRegStatePtr state;
 1580|       |
 1581|   386k|    if (ctxt->nbStates >= ctxt->maxStates) {
  ------------------
  |  Branch (1581:9): [True: 13.4k, False: 373k]
  ------------------
 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.3k]
  ------------------
 1593|     39|	    xmlRegexpErrMemory(ctxt);
 1594|     39|	    return(NULL);
 1595|     39|	}
 1596|  13.3k|	ctxt->states = tmp;
 1597|  13.3k|	ctxt->maxStates = newSize;
 1598|  13.3k|    }
 1599|       |
 1600|   386k|    state = xmlRegNewState(ctxt);
 1601|   386k|    if (state == NULL)
  ------------------
  |  Branch (1601:9): [True: 67, False: 386k]
  ------------------
 1602|     67|        return(NULL);
 1603|       |
 1604|   386k|    state->no = ctxt->nbStates;
 1605|   386k|    ctxt->states[ctxt->nbStates++] = state;
 1606|       |
 1607|   386k|    return(state);
 1608|   386k|}
xmlregexp.c:xmlRegNewState:
  919|   386k|xmlRegNewState(xmlRegParserCtxtPtr ctxt) {
  920|   386k|    xmlRegStatePtr ret;
  921|       |
  922|   386k|    ret = (xmlRegStatePtr) xmlMalloc(sizeof(xmlRegState));
  923|   386k|    if (ret == NULL) {
  ------------------
  |  Branch (923:9): [True: 67, False: 386k]
  ------------------
  924|     67|	xmlRegexpErrMemory(ctxt);
  925|     67|	return(NULL);
  926|     67|    }
  927|   386k|    memset(ret, 0, sizeof(xmlRegState));
  928|   386k|    ret->type = XML_REGEXP_TRANS_STATE;
  929|   386k|    ret->mark = XML_REGEXP_MARK_NORMAL;
  930|   386k|    return(ret);
  931|   386k|}
xmlregexp.c:xmlFAEliminateEpsilonTransitions:
 2076|  1.53k|xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2077|  1.53k|    int statenr, transnr;
 2078|  1.53k|    xmlRegStatePtr state;
 2079|  1.53k|    int has_epsilon;
 2080|       |
 2081|  1.53k|    if (ctxt->states == NULL) return;
  ------------------
  |  Branch (2081:9): [True: 0, False: 1.53k]
  ------------------
 2082|       |
 2083|       |    /*
 2084|       |     * Eliminate simple epsilon transition and the associated unreachable
 2085|       |     * states.
 2086|       |     */
 2087|  1.53k|    xmlFAEliminateSimpleEpsilonTransitions(ctxt);
 2088|   258k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2088:22): [True: 256k, False: 1.53k]
  ------------------
 2089|   256k|	state = ctxt->states[statenr];
 2090|   256k|	if ((state != NULL) && (state->type == XML_REGEXP_UNREACH_STATE)) {
  ------------------
  |  Branch (2090:6): [True: 256k, False: 0]
  |  Branch (2090:25): [True: 87.4k, False: 169k]
  ------------------
 2091|  87.4k|	    xmlRegFreeState(state);
 2092|  87.4k|	    ctxt->states[statenr] = NULL;
 2093|  87.4k|	}
 2094|   256k|    }
 2095|       |
 2096|  1.53k|    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|   258k|    for (statenr = ctxt->nbStates - 1;statenr >= 0;statenr--) {
  ------------------
  |  Branch (2106:39): [True: 256k, False: 1.53k]
  ------------------
 2107|   256k|	state = ctxt->states[statenr];
 2108|   256k|	if (state == NULL)
  ------------------
  |  Branch (2108:6): [True: 87.4k, False: 169k]
  ------------------
 2109|  87.4k|	    continue;
 2110|   169k|	if ((state->nbTrans == 0) &&
  ------------------
  |  Branch (2110:6): [True: 1.34k, False: 168k]
  ------------------
 2111|  1.34k|	    (state->type != XML_REGEXP_FINAL_STATE)) {
  ------------------
  |  Branch (2111:6): [True: 0, False: 1.34k]
  ------------------
 2112|      0|	    state->type = XML_REGEXP_SINK_STATE;
 2113|      0|	}
 2114|  1.66M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2114:19): [True: 1.49M, False: 169k]
  ------------------
 2115|  1.49M|	    if ((state->trans[transnr].atom == NULL) &&
  ------------------
  |  Branch (2115:10): [True: 161k, False: 1.33M]
  ------------------
 2116|   161k|		(state->trans[transnr].to >= 0)) {
  ------------------
  |  Branch (2116:3): [True: 97.8k, False: 64.0k]
  ------------------
 2117|  97.8k|		if (state->trans[transnr].to == statenr) {
  ------------------
  |  Branch (2117:7): [True: 0, False: 97.8k]
  ------------------
 2118|      0|		    state->trans[transnr].to = -1;
 2119|  97.8k|		} else if (state->trans[transnr].count < 0) {
  ------------------
  |  Branch (2119:14): [True: 97.8k, False: 0]
  ------------------
 2120|  97.8k|		    int newto = state->trans[transnr].to;
 2121|       |
 2122|  97.8k|		    has_epsilon = 1;
 2123|  97.8k|		    state->trans[transnr].to = -2;
 2124|  97.8k|		    state->mark = XML_REGEXP_MARK_START;
 2125|  97.8k|		    xmlFAReduceEpsilonTransitions(ctxt, statenr,
 2126|  97.8k|				      newto, state->trans[transnr].counter);
 2127|  97.8k|		    xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
 2128|  97.8k|		    state->mark = XML_REGEXP_MARK_NORMAL;
 2129|  97.8k|	        }
 2130|  97.8k|	    }
 2131|  1.49M|	}
 2132|   169k|    }
 2133|       |    /*
 2134|       |     * Eliminate the epsilon transitions
 2135|       |     */
 2136|  1.53k|    if (has_epsilon) {
  ------------------
  |  Branch (2136:9): [True: 1.19k, False: 335]
  ------------------
 2137|   256k|	for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2137:19): [True: 255k, False: 1.19k]
  ------------------
 2138|   255k|	    state = ctxt->states[statenr];
 2139|   255k|	    if (state == NULL)
  ------------------
  |  Branch (2139:10): [True: 87.3k, False: 168k]
  ------------------
 2140|  87.3k|		continue;
 2141|  1.66M|	    for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2141:23): [True: 1.49M, False: 168k]
  ------------------
 2142|  1.49M|		xmlRegTransPtr trans = &(state->trans[transnr]);
 2143|  1.49M|		if ((trans->atom == NULL) &&
  ------------------
  |  Branch (2143:7): [True: 161k, False: 1.33M]
  ------------------
 2144|   161k|		    (trans->count < 0) &&
  ------------------
  |  Branch (2144:7): [True: 161k, False: 0]
  ------------------
 2145|   161k|		    (trans->to >= 0)) {
  ------------------
  |  Branch (2145:7): [True: 0, False: 161k]
  ------------------
 2146|      0|		    trans->to = -1;
 2147|      0|		}
 2148|  1.49M|	    }
 2149|   168k|	}
 2150|  1.19k|    }
 2151|       |
 2152|       |    /*
 2153|       |     * Use this pass to detect unreachable states too
 2154|       |     */
 2155|   258k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2155:22): [True: 256k, False: 1.53k]
  ------------------
 2156|   256k|	state = ctxt->states[statenr];
 2157|   256k|	if (state != NULL)
  ------------------
  |  Branch (2157:6): [True: 169k, False: 87.4k]
  ------------------
 2158|   169k|	    state->reached = XML_REGEXP_MARK_NORMAL;
 2159|   256k|    }
 2160|  1.53k|    state = ctxt->states[0];
 2161|  1.53k|    if (state != NULL)
  ------------------
  |  Branch (2161:9): [True: 1.53k, False: 0]
  ------------------
 2162|  1.53k|	state->reached = XML_REGEXP_MARK_START;
 2163|   147k|    while (state != NULL) {
  ------------------
  |  Branch (2163:12): [True: 146k, False: 1.53k]
  ------------------
 2164|   146k|	xmlRegStatePtr target = NULL;
 2165|   146k|	state->reached = XML_REGEXP_MARK_VISITED;
 2166|       |	/*
 2167|       |	 * Mark all states reachable from the current reachable state
 2168|       |	 */
 2169|  1.37M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2169:19): [True: 1.22M, False: 146k]
  ------------------
 2170|  1.22M|	    if ((state->trans[transnr].to >= 0) &&
  ------------------
  |  Branch (2170:10): [True: 1.08M, False: 148k]
  ------------------
 2171|  1.08M|		((state->trans[transnr].atom != NULL) ||
  ------------------
  |  Branch (2171:4): [True: 1.08M, False: 0]
  ------------------
 2172|  1.08M|		 (state->trans[transnr].count >= 0))) {
  ------------------
  |  Branch (2172:4): [True: 0, False: 0]
  ------------------
 2173|  1.08M|		int newto = state->trans[transnr].to;
 2174|       |
 2175|  1.08M|		if (ctxt->states[newto] == NULL)
  ------------------
  |  Branch (2175:7): [True: 2, False: 1.08M]
  ------------------
 2176|      2|		    continue;
 2177|  1.08M|		if (ctxt->states[newto]->reached == XML_REGEXP_MARK_NORMAL) {
  ------------------
  |  Branch (2177:7): [True: 144k, False: 935k]
  ------------------
 2178|   144k|		    ctxt->states[newto]->reached = XML_REGEXP_MARK_START;
 2179|   144k|		    target = ctxt->states[newto];
 2180|   144k|		}
 2181|  1.08M|	    }
 2182|  1.22M|	}
 2183|       |
 2184|       |	/*
 2185|       |	 * find the next accessible state not explored
 2186|       |	 */
 2187|   146k|	if (target == NULL) {
  ------------------
  |  Branch (2187:6): [True: 50.4k, False: 95.9k]
  ------------------
 2188|   331M|	    for (statenr = 1;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2188:23): [True: 331M, False: 1.53k]
  ------------------
 2189|   331M|		state = ctxt->states[statenr];
 2190|   331M|		if ((state != NULL) && (state->reached ==
  ------------------
  |  Branch (2190:7): [True: 169M, False: 161M]
  |  Branch (2190:26): [True: 48.8k, False: 169M]
  ------------------
 2191|   169M|			XML_REGEXP_MARK_START)) {
 2192|  48.8k|		    target = state;
 2193|  48.8k|		    break;
 2194|  48.8k|		}
 2195|   331M|	    }
 2196|  50.4k|	}
 2197|   146k|	state = target;
 2198|   146k|    }
 2199|   258k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2199:22): [True: 256k, False: 1.53k]
  ------------------
 2200|   256k|	state = ctxt->states[statenr];
 2201|   256k|	if ((state != NULL) && (state->reached == XML_REGEXP_MARK_NORMAL)) {
  ------------------
  |  Branch (2201:6): [True: 169k, False: 87.4k]
  |  Branch (2201:25): [True: 23.0k, False: 146k]
  ------------------
 2202|  23.0k|	    xmlRegFreeState(state);
 2203|  23.0k|	    ctxt->states[statenr] = NULL;
 2204|  23.0k|	}
 2205|   256k|    }
 2206|       |
 2207|  1.53k|}
xmlregexp.c:xmlFAEliminateSimpleEpsilonTransitions:
 2025|  1.53k|xmlFAEliminateSimpleEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
 2026|  1.53k|    int statenr, i, j, newto;
 2027|  1.53k|    xmlRegStatePtr state, tmp;
 2028|       |
 2029|   258k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2029:22): [True: 256k, False: 1.53k]
  ------------------
 2030|   256k|	state = ctxt->states[statenr];
 2031|   256k|	if (state == NULL)
  ------------------
  |  Branch (2031:6): [True: 0, False: 256k]
  ------------------
 2032|      0|	    continue;
 2033|   256k|	if (state->nbTrans != 1)
  ------------------
  |  Branch (2033:6): [True: 100k, False: 156k]
  ------------------
 2034|   100k|	    continue;
 2035|   156k|       if (state->type == XML_REGEXP_UNREACH_STATE ||
  ------------------
  |  Branch (2035:12): [True: 0, False: 156k]
  ------------------
 2036|   156k|           state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2036:12): [True: 188, False: 156k]
  ------------------
 2037|    188|	    continue;
 2038|       |	/* is the only transition out a basic transition */
 2039|   156k|	if ((state->trans[0].atom == NULL) &&
  ------------------
  |  Branch (2039:6): [True: 88.1k, False: 67.8k]
  ------------------
 2040|  88.1k|	    (state->trans[0].to >= 0) &&
  ------------------
  |  Branch (2040:6): [True: 88.1k, False: 6]
  ------------------
 2041|  88.1k|	    (state->trans[0].to != statenr) &&
  ------------------
  |  Branch (2041:6): [True: 88.1k, False: 0]
  ------------------
 2042|  88.1k|	    (state->trans[0].counter < 0) &&
  ------------------
  |  Branch (2042:6): [True: 88.1k, False: 0]
  ------------------
 2043|  88.1k|	    (state->trans[0].count < 0)) {
  ------------------
  |  Branch (2043:6): [True: 88.1k, False: 0]
  ------------------
 2044|  88.1k|	    newto = state->trans[0].to;
 2045|       |
 2046|  88.1k|            if (state->type == XML_REGEXP_START_STATE) {
  ------------------
  |  Branch (2046:17): [True: 780, False: 87.4k]
  ------------------
 2047|  87.4k|            } else {
 2048|   223k|	        for (i = 0;i < state->nbTransTo;i++) {
  ------------------
  |  Branch (2048:21): [True: 136k, False: 87.4k]
  ------------------
 2049|   136k|		    tmp = ctxt->states[state->transTo[i]];
 2050|  55.4M|		    for (j = 0;j < tmp->nbTrans;j++) {
  ------------------
  |  Branch (2050:18): [True: 55.3M, False: 136k]
  ------------------
 2051|  55.3M|			if (tmp->trans[j].to == statenr) {
  ------------------
  |  Branch (2051:8): [True: 130k, False: 55.2M]
  ------------------
 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|  55.3M|		    }
 2059|   136k|		}
 2060|  87.4k|		if (state->type == XML_REGEXP_FINAL_STATE)
  ------------------
  |  Branch (2060:7): [True: 0, False: 87.4k]
  ------------------
 2061|      0|		    ctxt->states[newto]->type = XML_REGEXP_FINAL_STATE;
 2062|       |		/* eliminate the transition completely */
 2063|  87.4k|		state->nbTrans = 0;
 2064|       |
 2065|  87.4k|                state->type = XML_REGEXP_UNREACH_STATE;
 2066|       |
 2067|  87.4k|	    }
 2068|       |
 2069|  88.1k|	}
 2070|   156k|    }
 2071|  1.53k|}
xmlregexp.c:xmlFAReduceEpsilonTransitions:
 1928|   326k|	                      int tonr, int counter) {
 1929|   326k|    int transnr;
 1930|   326k|    xmlRegStatePtr from;
 1931|   326k|    xmlRegStatePtr to;
 1932|       |
 1933|   326k|    from = ctxt->states[fromnr];
 1934|   326k|    if (from == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 326k]
  ------------------
 1935|      0|	return;
 1936|   326k|    to = ctxt->states[tonr];
 1937|   326k|    if (to == NULL)
  ------------------
  |  Branch (1937:9): [True: 88, False: 326k]
  ------------------
 1938|     88|	return;
 1939|   326k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1939:9): [True: 0, False: 326k]
  ------------------
 1940|   326k|	(to->mark == XML_REGEXP_MARK_VISITED))
  ------------------
  |  Branch (1940:2): [True: 70.0k, False: 255k]
  ------------------
 1941|  70.0k|	return;
 1942|       |
 1943|   255k|    to->mark = XML_REGEXP_MARK_VISITED;
 1944|   255k|    if (to->type == XML_REGEXP_FINAL_STATE) {
  ------------------
  |  Branch (1944:9): [True: 98.0k, False: 157k]
  ------------------
 1945|  98.0k|	from->type = XML_REGEXP_FINAL_STATE;
 1946|  98.0k|    }
 1947|  13.1M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1947:22): [True: 12.9M, False: 255k]
  ------------------
 1948|  12.9M|        xmlRegTransPtr t1 = &to->trans[transnr];
 1949|  12.9M|        int tcounter;
 1950|       |
 1951|  12.9M|        if (t1->to < 0)
  ------------------
  |  Branch (1951:13): [True: 658k, False: 12.2M]
  ------------------
 1952|   658k|	    continue;
 1953|  12.2M|        if (t1->counter >= 0) {
  ------------------
  |  Branch (1953:13): [True: 0, False: 12.2M]
  ------------------
 1954|       |            /* assert(counter < 0); */
 1955|      0|            tcounter = t1->counter;
 1956|  12.2M|        } else {
 1957|  12.2M|            tcounter = counter;
 1958|  12.2M|        }
 1959|  12.2M|	if (t1->atom == NULL) {
  ------------------
  |  Branch (1959:6): [True: 230k, False: 12.0M]
  ------------------
 1960|       |	    /*
 1961|       |	     * Don't remove counted transitions
 1962|       |	     * Don't loop either
 1963|       |	     */
 1964|   230k|	    if (t1->to != fromnr) {
  ------------------
  |  Branch (1964:10): [True: 228k, False: 1.87k]
  ------------------
 1965|   228k|		if (t1->count >= 0) {
  ------------------
  |  Branch (1965:7): [True: 0, False: 228k]
  ------------------
 1966|      0|		    xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
 1967|      0|					-1, t1->count);
 1968|   228k|		} else {
 1969|   228k|                    xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
 1970|   228k|                                                  tcounter);
 1971|   228k|		}
 1972|   228k|	    }
 1973|  12.0M|	} else {
 1974|  12.0M|            xmlRegStateAddTrans(ctxt, from, t1->atom,
 1975|  12.0M|                                ctxt->states[t1->to], tcounter, -1);
 1976|  12.0M|	}
 1977|  12.2M|    }
 1978|   255k|}
xmlregexp.c:xmlFAFinishReduceEpsilonTransitions:
 1985|   328k|xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
 1986|   328k|    int transnr;
 1987|   328k|    xmlRegStatePtr to;
 1988|       |
 1989|   328k|    to = ctxt->states[tonr];
 1990|   328k|    if (to == NULL)
  ------------------
  |  Branch (1990:9): [True: 88, False: 327k]
  ------------------
 1991|     88|	return;
 1992|   327k|    if ((to->mark == XML_REGEXP_MARK_START) ||
  ------------------
  |  Branch (1992:9): [True: 1.87k, False: 326k]
  ------------------
 1993|   326k|	(to->mark == XML_REGEXP_MARK_NORMAL))
  ------------------
  |  Branch (1993:2): [True: 70.0k, False: 255k]
  ------------------
 1994|  71.9k|	return;
 1995|       |
 1996|   255k|    to->mark = XML_REGEXP_MARK_NORMAL;
 1997|  13.1M|    for (transnr = 0;transnr < to->nbTrans;transnr++) {
  ------------------
  |  Branch (1997:22): [True: 12.9M, False: 255k]
  ------------------
 1998|  12.9M|	xmlRegTransPtr t1 = &to->trans[transnr];
 1999|  12.9M|	if ((t1->to >= 0) && (t1->atom == NULL))
  ------------------
  |  Branch (1999:6): [True: 12.2M, False: 658k]
  |  Branch (1999:23): [True: 230k, False: 12.0M]
  ------------------
 2000|   230k|            xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
 2001|  12.9M|    }
 2002|   255k|}
xmlregexp.c:xmlRegEpxFromParse:
  503|  1.45k|xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
  504|  1.45k|    xmlRegexpPtr ret;
  505|       |
  506|  1.45k|    ret = (xmlRegexpPtr) xmlMalloc(sizeof(xmlRegexp));
  507|  1.45k|    if (ret == NULL) {
  ------------------
  |  Branch (507:9): [True: 9, False: 1.44k]
  ------------------
  508|      9|	xmlRegexpErrMemory(ctxt);
  509|      9|	return(NULL);
  510|      9|    }
  511|  1.44k|    memset(ret, 0, sizeof(xmlRegexp));
  512|  1.44k|    ret->string = ctxt->string;
  513|  1.44k|    ret->nbStates = ctxt->nbStates;
  514|  1.44k|    ret->states = ctxt->states;
  515|  1.44k|    ret->nbAtoms = ctxt->nbAtoms;
  516|  1.44k|    ret->atoms = ctxt->atoms;
  517|  1.44k|    ret->nbCounters = ctxt->nbCounters;
  518|  1.44k|    ret->counters = ctxt->counters;
  519|  1.44k|    ret->determinist = ctxt->determinist;
  520|  1.44k|    ret->flags = ctxt->flags;
  521|  1.44k|    if (ret->determinist == -1) {
  ------------------
  |  Branch (521:9): [True: 1.44k, False: 0]
  ------------------
  522|  1.44k|        if (xmlRegexpIsDeterminist(ret) < 0) {
  ------------------
  |  Branch (522:13): [True: 17, False: 1.42k]
  ------------------
  523|     17|            xmlRegexpErrMemory(ctxt);
  524|     17|            xmlFree(ret);
  525|     17|            return(NULL);
  526|     17|        }
  527|  1.44k|    }
  528|       |
  529|  1.42k|    if ((ret->determinist != 0) &&
  ------------------
  |  Branch (529:9): [True: 1.00k, False: 425]
  ------------------
  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: 7, False: 993]
  ------------------
  553|      7|	    xmlRegexpErrMemory(ctxt);
  554|      7|	    xmlFree(ret);
  555|      7|	    return(NULL);
  556|      7|	}
  557|  15.3k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (557:13): [True: 14.3k, False: 993]
  ------------------
  558|  14.3k|	    if (ret->states[i] != NULL) {
  ------------------
  |  Branch (558:10): [True: 9.99k, False: 4.39k]
  ------------------
  559|  9.99k|		stateRemap[i] = nbstates;
  560|  9.99k|		nbstates++;
  561|  9.99k|	    } else {
  562|  4.39k|		stateRemap[i] = -1;
  563|  4.39k|	    }
  564|  14.3k|	}
  565|    993|	stringMap = xmlMalloc(ret->nbAtoms * sizeof(char *));
  566|    993|	if (stringMap == NULL) {
  ------------------
  |  Branch (566:6): [True: 6, False: 987]
  ------------------
  567|      6|	    xmlRegexpErrMemory(ctxt);
  568|      6|	    xmlFree(stateRemap);
  569|      6|	    xmlFree(ret);
  570|      6|	    return(NULL);
  571|      6|	}
  572|    987|	stringRemap = xmlMalloc(ret->nbAtoms * sizeof(int));
  573|    987|	if (stringRemap == NULL) {
  ------------------
  |  Branch (573:6): [True: 9, False: 978]
  ------------------
  574|      9|	    xmlRegexpErrMemory(ctxt);
  575|      9|	    xmlFree(stringMap);
  576|      9|	    xmlFree(stateRemap);
  577|      9|	    xmlFree(ret);
  578|      9|	    return(NULL);
  579|      9|	}
  580|  14.0k|	for (i = 0;i < ret->nbAtoms;i++) {
  ------------------
  |  Branch (580:13): [True: 13.1k, False: 940]
  ------------------
  581|  13.1k|	    if ((ret->atoms[i]->type == XML_REGEXP_STRING) &&
  ------------------
  |  Branch (581:10): [True: 13.1k, False: 0]
  ------------------
  582|  13.1k|		(ret->atoms[i]->quant == XML_REGEXP_QUANT_ONCE)) {
  ------------------
  |  Branch (582:3): [True: 13.1k, False: 0]
  ------------------
  583|  13.1k|		value = ret->atoms[i]->valuep;
  584|   132k|                for (j = 0;j < nbatoms;j++) {
  ------------------
  |  Branch (584:28): [True: 128k, False: 4.02k]
  ------------------
  585|   128k|		    if (xmlStrEqual(stringMap[j], value)) {
  ------------------
  |  Branch (585:11): [True: 9.11k, False: 119k]
  ------------------
  586|  9.11k|			stringRemap[i] = j;
  587|  9.11k|			break;
  588|  9.11k|		    }
  589|   128k|		}
  590|  13.1k|		if (j >= nbatoms) {
  ------------------
  |  Branch (590:7): [True: 4.02k, False: 9.11k]
  ------------------
  591|  4.02k|		    stringRemap[i] = nbatoms;
  592|  4.02k|		    stringMap[nbatoms] = xmlStrdup(value);
  593|  4.02k|		    if (stringMap[nbatoms] == NULL) {
  ------------------
  |  Branch (593:11): [True: 38, False: 3.98k]
  ------------------
  594|    204|			for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (594:15): [True: 166, False: 38]
  ------------------
  595|    166|			    xmlFree(stringMap[i]);
  596|     38|			xmlFree(stringRemap);
  597|     38|			xmlFree(stringMap);
  598|     38|			xmlFree(stateRemap);
  599|     38|			xmlFree(ret);
  600|     38|			return(NULL);
  601|     38|		    }
  602|  3.98k|		    nbatoms++;
  603|  3.98k|		}
  604|  13.1k|	    } 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|  13.1k|	}
  614|    940|	transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
  615|    940|                                            sizeof(int));
  616|    940|	if (transitions == NULL) {
  ------------------
  |  Branch (616:6): [True: 18, False: 922]
  ------------------
  617|     18|	    xmlFree(stateRemap);
  618|     18|	    xmlFree(stringRemap);
  619|    142|            for (i = 0;i < nbatoms;i++)
  ------------------
  |  Branch (619:24): [True: 124, False: 18]
  ------------------
  620|    124|		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|    922|	transdata = NULL;
  631|       |
  632|  14.5k|	for (i = 0;i < ret->nbStates;i++) {
  ------------------
  |  Branch (632:13): [True: 13.6k, False: 922]
  ------------------
  633|  13.6k|	    int stateno, atomno, targetno, prev;
  634|  13.6k|	    xmlRegStatePtr state;
  635|  13.6k|	    xmlRegTransPtr trans;
  636|       |
  637|  13.6k|	    stateno = stateRemap[i];
  638|  13.6k|	    if (stateno == -1)
  ------------------
  |  Branch (638:10): [True: 4.10k, False: 9.49k]
  ------------------
  639|  4.10k|		continue;
  640|  9.49k|	    state = ret->states[i];
  641|       |
  642|  9.49k|	    transitions[stateno * (nbatoms + 1)] = state->type;
  643|       |
  644|  31.8k|	    for (j = 0;j < state->nbTrans;j++) {
  ------------------
  |  Branch (644:17): [True: 22.3k, False: 9.49k]
  ------------------
  645|  22.3k|		trans = &(state->trans[j]);
  646|  22.3k|		if ((trans->to < 0) || (trans->atom == NULL))
  ------------------
  |  Branch (646:7): [True: 7.98k, False: 14.3k]
  |  Branch (646:26): [True: 0, False: 14.3k]
  ------------------
  647|  7.98k|		    continue;
  648|  14.3k|                atomno = stringRemap[trans->atom->no];
  649|  14.3k|		if ((trans->atom->data != NULL) && (transdata == NULL)) {
  ------------------
  |  Branch (649:7): [True: 0, False: 14.3k]
  |  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.3k|		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.3k|		prev = transitions[stateno * (nbatoms + 1) + atomno + 1];
  664|  14.3k|		if (prev != 0) {
  ------------------
  |  Branch (664:7): [True: 0, False: 14.3k]
  ------------------
  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.3k|		} else {
  678|  14.3k|		    transitions[stateno * (nbatoms + 1) + atomno + 1] =
  679|  14.3k|			targetno + 1; /* to avoid 0 */
  680|  14.3k|		    if (transdata != NULL)
  ------------------
  |  Branch (680:11): [True: 0, False: 14.3k]
  ------------------
  681|      0|			transdata[stateno * nbatoms + atomno] =
  682|      0|			    trans->atom->data;
  683|  14.3k|		}
  684|  14.3k|	    }
  685|  9.49k|	}
  686|    922|	ret->determinist = 1;
  687|       |	/*
  688|       |	 * Cleanup of the old data
  689|       |	 */
  690|    922|	if (ret->states != NULL) {
  ------------------
  |  Branch (690:6): [True: 922, False: 0]
  ------------------
  691|  14.5k|	    for (i = 0;i < ret->nbStates;i++)
  ------------------
  |  Branch (691:17): [True: 13.6k, False: 922]
  ------------------
  692|  13.6k|		xmlRegFreeState(ret->states[i]);
  693|    922|	    xmlFree(ret->states);
  694|    922|	}
  695|    922|	ret->states = NULL;
  696|    922|	ret->nbStates = 0;
  697|    922|	if (ret->atoms != NULL) {
  ------------------
  |  Branch (697:6): [True: 922, False: 0]
  ------------------
  698|  13.6k|	    for (i = 0;i < ret->nbAtoms;i++)
  ------------------
  |  Branch (698:17): [True: 12.7k, False: 922]
  ------------------
  699|  12.7k|		xmlRegFreeAtom(ret->atoms[i]);
  700|    922|	    xmlFree(ret->atoms);
  701|    922|	}
  702|    922|	ret->atoms = NULL;
  703|    922|	ret->nbAtoms = 0;
  704|       |
  705|    922|	ret->compact = transitions;
  706|    922|	ret->transdata = transdata;
  707|    922|	ret->stringMap = stringMap;
  708|    922|	ret->nbstrings = nbatoms;
  709|    922|	ret->nbstates = nbstates;
  710|    922|	xmlFree(stateRemap);
  711|    922|	xmlFree(stringRemap);
  712|    922|    }
  713|  1.34k|not_determ:
  714|  1.34k|    ctxt->string = NULL;
  715|  1.34k|    ctxt->nbStates = 0;
  716|  1.34k|    ctxt->states = NULL;
  717|  1.34k|    ctxt->nbAtoms = 0;
  718|  1.34k|    ctxt->atoms = NULL;
  719|  1.34k|    ctxt->nbCounters = 0;
  720|       |    ctxt->counters = NULL;
  721|  1.34k|    return(ret);
  722|  1.42k|}
xmlregexp.c:xmlRegCalloc2:
  478|    940|xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
  479|    940|    size_t numElems, totalSize;
  480|    940|    void *ret;
  481|       |
  482|       |    /* Check for overflow */
  483|    940|    if ((dim2 == 0) || (elemSize == 0) ||
  ------------------
  |  Branch (483:9): [True: 0, False: 940]
  |  Branch (483:24): [True: 0, False: 940]
  ------------------
  484|    940|        (dim1 > SIZE_MAX / dim2 / elemSize))
  ------------------
  |  Branch (484:9): [True: 0, False: 940]
  ------------------
  485|      0|        return (NULL);
  486|    940|    numElems = dim1 * dim2;
  487|    940|    if (numElems > XML_MAX_ITEMS)
  ------------------
  |  |   13|    940|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
  |  Branch (487:9): [True: 0, False: 940]
  ------------------
  488|      0|        return NULL;
  489|    940|    totalSize = numElems * elemSize;
  490|    940|    ret = xmlMalloc(totalSize);
  491|    940|    if (ret != NULL)
  ------------------
  |  Branch (491:9): [True: 922, False: 18]
  ------------------
  492|    922|        memset(ret, 0, totalSize);
  493|    940|    return (ret);
  494|    940|}
xmlregexp.c:xmlRegFreeParserCtxt:
  956|  3.32k|xmlRegFreeParserCtxt(xmlRegParserCtxtPtr ctxt) {
  957|  3.32k|    int i;
  958|  3.32k|    if (ctxt == NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 3.32k]
  ------------------
  959|      0|	return;
  960|       |
  961|  3.32k|    if (ctxt->string != NULL)
  ------------------
  |  Branch (961:9): [True: 0, False: 3.32k]
  ------------------
  962|      0|	xmlFree(ctxt->string);
  963|  3.32k|    if (ctxt->states != NULL) {
  ------------------
  |  Branch (963:9): [True: 543, False: 2.78k]
  ------------------
  964|   131k|	for (i = 0;i < ctxt->nbStates;i++)
  ------------------
  |  Branch (964:13): [True: 130k, False: 543]
  ------------------
  965|   130k|	    xmlRegFreeState(ctxt->states[i]);
  966|    543|	xmlFree(ctxt->states);
  967|    543|    }
  968|  3.32k|    if (ctxt->atoms != NULL) {
  ------------------
  |  Branch (968:9): [True: 507, False: 2.81k]
  ------------------
  969|  91.9k|	for (i = 0;i < ctxt->nbAtoms;i++)
  ------------------
  |  Branch (969:13): [True: 91.4k, False: 507]
  ------------------
  970|  91.4k|	    xmlRegFreeAtom(ctxt->atoms[i]);
  971|    507|	xmlFree(ctxt->atoms);
  972|    507|    }
  973|  3.32k|    if (ctxt->counters != NULL)
  ------------------
  |  Branch (973:9): [True: 0, False: 3.32k]
  ------------------
  974|      0|	xmlFree(ctxt->counters);
  975|  3.32k|    xmlFree(ctxt);
  976|  3.32k|}
xmlregexp.c:xmlRegFreeState:
  939|   496k|xmlRegFreeState(xmlRegStatePtr state) {
  940|   496k|    if (state == NULL)
  ------------------
  |  Branch (940:9): [True: 110k, False: 386k]
  ------------------
  941|   110k|	return;
  942|       |
  943|   386k|    if (state->trans != NULL)
  ------------------
  |  Branch (943:9): [True: 382k, False: 3.96k]
  ------------------
  944|   382k|	xmlFree(state->trans);
  945|   386k|    if (state->transTo != NULL)
  ------------------
  |  Branch (945:9): [True: 382k, False: 3.36k]
  ------------------
  946|   382k|	xmlFree(state->transTo);
  947|   386k|    xmlFree(state);
  948|   386k|}
xmlregexp.c:xmlFAComputesDeterminism:
 2803|  1.42k|xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
 2804|  1.42k|    int statenr, transnr;
 2805|  1.42k|    xmlRegStatePtr state;
 2806|  1.42k|    xmlRegTransPtr t1, t2, last;
 2807|  1.42k|    int i;
 2808|  1.42k|    int ret = 1;
 2809|  1.42k|    int deep = 1;
 2810|       |
 2811|  1.42k|    if (ctxt->determinist != -1)
  ------------------
  |  Branch (2811:9): [True: 0, False: 1.42k]
  ------------------
 2812|      0|	return(ctxt->determinist);
 2813|       |
 2814|  1.42k|    if (ctxt->flags & AM_AUTOMATA_RNG)
  ------------------
  |  |  288|  1.42k|#define AM_AUTOMATA_RNG 1
  ------------------
  |  Branch (2814:9): [True: 0, False: 1.42k]
  ------------------
 2815|      0|        deep = 0;
 2816|       |
 2817|       |    /*
 2818|       |     * First cleanup the automata removing cancelled transitions
 2819|       |     */
 2820|   256k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2820:22): [True: 255k, False: 1.42k]
  ------------------
 2821|   255k|	state = ctxt->states[statenr];
 2822|   255k|	if (state == NULL)
  ------------------
  |  Branch (2822:6): [True: 109k, False: 145k]
  ------------------
 2823|   109k|	    continue;
 2824|   145k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2824:6): [True: 66.6k, False: 78.8k]
  ------------------
 2825|  66.6k|	    continue;
 2826|  1.22M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2826:19): [True: 1.14M, False: 78.8k]
  ------------------
 2827|  1.14M|	    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.14M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2832:10): [True: 125k, False: 1.02M]
  ------------------
 2833|       |		/* t1->nd = 1; */
 2834|   125k|		continue;
 2835|   125k|	    }
 2836|  1.02M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2836:10): [True: 21.3k, False: 1.00M]
  ------------------
 2837|  21.3k|		continue;
 2838|   304M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2838:17): [True: 303M, False: 1.00M]
  ------------------
 2839|   303M|		t2 = &(state->trans[i]);
 2840|   303M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2840:7): [True: 254M, False: 49.3M]
  ------------------
 2841|   254M|		    continue;
 2842|  49.3M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2842:7): [True: 49.3M, False: 0]
  ------------------
 2843|  49.3M|		    if (t1->to == t2->to) {
  ------------------
  |  Branch (2843:11): [True: 10.5M, False: 38.7M]
  ------------------
 2844|       |                        /*
 2845|       |                         * Here we use deep because we want to keep the
 2846|       |                         * transitions which indicate a conflict
 2847|       |                         */
 2848|  10.5M|			if (xmlFAEqualAtoms(t1->atom, t2->atom, deep) &&
  ------------------
  |  Branch (2848:8): [True: 279k, False: 10.2M]
  ------------------
 2849|   279k|                            (t1->counter == t2->counter) &&
  ------------------
  |  Branch (2849:29): [True: 279k, False: 0]
  ------------------
 2850|   279k|                            (t1->count == t2->count))
  ------------------
  |  Branch (2850:29): [True: 279k, False: 0]
  ------------------
 2851|   279k|			    t2->to = -1; /* eliminated */
 2852|  10.5M|		    }
 2853|  49.3M|		}
 2854|  49.3M|	    }
 2855|  1.00M|	}
 2856|  78.8k|    }
 2857|       |
 2858|       |    /*
 2859|       |     * Check for all states that there aren't 2 transitions
 2860|       |     * with the same atom and a different target.
 2861|       |     */
 2862|   256k|    for (statenr = 0;statenr < ctxt->nbStates;statenr++) {
  ------------------
  |  Branch (2862:22): [True: 255k, False: 1.42k]
  ------------------
 2863|   255k|	state = ctxt->states[statenr];
 2864|   255k|	if (state == NULL)
  ------------------
  |  Branch (2864:6): [True: 109k, False: 145k]
  ------------------
 2865|   109k|	    continue;
 2866|   145k|	if (state->nbTrans < 2)
  ------------------
  |  Branch (2866:6): [True: 66.6k, False: 78.8k]
  ------------------
 2867|  66.6k|	    continue;
 2868|  78.8k|	last = NULL;
 2869|  1.22M|	for (transnr = 0;transnr < state->nbTrans;transnr++) {
  ------------------
  |  Branch (2869:19): [True: 1.14M, False: 78.8k]
  ------------------
 2870|  1.14M|	    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.14M|	    if (t1->atom == NULL) {
  ------------------
  |  Branch (2875:10): [True: 125k, False: 1.02M]
  ------------------
 2876|   125k|		continue;
 2877|   125k|	    }
 2878|  1.02M|	    if (t1->to < 0) /* eliminated */
  ------------------
  |  Branch (2878:10): [True: 300k, False: 723k]
  ------------------
 2879|   300k|		continue;
 2880|  47.1M|	    for (i = 0;i < transnr;i++) {
  ------------------
  |  Branch (2880:17): [True: 46.3M, False: 723k]
  ------------------
 2881|  46.3M|		t2 = &(state->trans[i]);
 2882|  46.3M|		if (t2->to < 0) /* eliminated */
  ------------------
  |  Branch (2882:7): [True: 14.7M, False: 31.6M]
  ------------------
 2883|  14.7M|		    continue;
 2884|  31.6M|		if (t2->atom != NULL) {
  ------------------
  |  Branch (2884:7): [True: 31.6M, 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.6M|		    if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
  ------------------
  |  Branch (2889:11): [True: 5.68M, False: 25.9M]
  ------------------
 2890|       |                        /*
 2891|       |                         * Treat equal counter transitions that couldn't be
 2892|       |                         * eliminated as deterministic.
 2893|       |                         */
 2894|  5.68M|                        if ((t1->to != t2->to) ||
  ------------------
  |  Branch (2894:29): [True: 5.68M, 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.68M|                            ret = 0;
 2898|       |			/* mark the transitions as non-deterministic ones */
 2899|  5.68M|			t1->nd = 1;
 2900|  5.68M|			t2->nd = 1;
 2901|  5.68M|			last = t1;
 2902|  5.68M|		    }
 2903|  31.6M|		} 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.6M|	    }
 2926|       |	    /* don't shortcut the computation so all non deterministic
 2927|       |	       transition get marked down
 2928|       |	    if (ret == 0)
 2929|       |		break; */
 2930|   723k|	}
 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|  78.8k|	if (last != NULL) {
  ------------------
  |  Branch (2937:6): [True: 41.1k, False: 37.7k]
  ------------------
 2938|  41.1k|	    last->nd = 2;
 2939|  41.1k|	}
 2940|       |
 2941|       |	/* don't shortcut the computation so all non deterministic
 2942|       |	   transition get marked down
 2943|       |	if (ret == 0)
 2944|       |	    break; */
 2945|  78.8k|    }
 2946|       |
 2947|  1.42k|    ctxt->determinist = ret;
 2948|  1.42k|    return(ret);
 2949|  1.42k|}
xmlregexp.c:xmlFAEqualAtoms:
 2581|  10.5M|xmlFAEqualAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2582|  10.5M|    int ret = 0;
 2583|       |
 2584|  10.5M|    if (atom1 == atom2)
  ------------------
  |  Branch (2584:9): [True: 0, False: 10.5M]
  ------------------
 2585|      0|	return(1);
 2586|  10.5M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2586:9): [True: 0, False: 10.5M]
  |  Branch (2586:28): [True: 0, False: 10.5M]
  ------------------
 2587|      0|	return(0);
 2588|       |
 2589|  10.5M|    if (atom1->type != atom2->type)
  ------------------
  |  Branch (2589:9): [True: 0, False: 10.5M]
  ------------------
 2590|      0|        return(0);
 2591|  10.5M|    switch (atom1->type) {
 2592|      0|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2592:9): [True: 0, False: 10.5M]
  ------------------
 2593|      0|	    ret = 0;
 2594|      0|	    break;
 2595|  10.5M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2595:9): [True: 10.5M, False: 0]
  ------------------
 2596|  10.5M|            if (!deep)
  ------------------
  |  Branch (2596:17): [True: 0, False: 10.5M]
  ------------------
 2597|      0|                ret = (atom1->valuep == atom2->valuep);
 2598|  10.5M|            else
 2599|  10.5M|                ret = xmlStrEqual((xmlChar *)atom1->valuep,
 2600|  10.5M|                                  (xmlChar *)atom2->valuep);
 2601|  10.5M|	    break;
 2602|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2602:9): [True: 0, False: 10.5M]
  ------------------
 2603|      0|	    ret = (atom1->codepoint == atom2->codepoint);
 2604|      0|	    break;
 2605|      0|	case XML_REGEXP_RANGES:
  ------------------
  |  Branch (2605:2): [True: 0, False: 10.5M]
  ------------------
 2606|       |	    /* too hard to do in the general case */
 2607|      0|	    ret = 0;
 2608|      0|	default:
  ------------------
  |  Branch (2608:2): [True: 0, False: 10.5M]
  ------------------
 2609|      0|	    break;
 2610|  10.5M|    }
 2611|  10.5M|    return(ret);
 2612|  10.5M|}
xmlregexp.c:xmlFACompareAtoms:
 2624|  31.6M|xmlFACompareAtoms(xmlRegAtomPtr atom1, xmlRegAtomPtr atom2, int deep) {
 2625|  31.6M|    int ret = 1;
 2626|       |
 2627|  31.6M|    if (atom1 == atom2)
  ------------------
  |  Branch (2627:9): [True: 0, False: 31.6M]
  ------------------
 2628|      0|	return(1);
 2629|  31.6M|    if ((atom1 == NULL) || (atom2 == NULL))
  ------------------
  |  Branch (2629:9): [True: 0, False: 31.6M]
  |  Branch (2629:28): [True: 0, False: 31.6M]
  ------------------
 2630|      0|	return(0);
 2631|       |
 2632|  31.6M|    if ((atom1->type == XML_REGEXP_ANYCHAR) ||
  ------------------
  |  Branch (2632:9): [True: 0, False: 31.6M]
  ------------------
 2633|  31.6M|        (atom2->type == XML_REGEXP_ANYCHAR))
  ------------------
  |  Branch (2633:9): [True: 0, False: 31.6M]
  ------------------
 2634|      0|	return(1);
 2635|       |
 2636|  31.6M|    if (atom1->type > atom2->type) {
  ------------------
  |  Branch (2636:9): [True: 0, False: 31.6M]
  ------------------
 2637|      0|	xmlRegAtomPtr tmp;
 2638|      0|	tmp = atom1;
 2639|      0|	atom1 = atom2;
 2640|      0|	atom2 = tmp;
 2641|      0|    }
 2642|  31.6M|    if (atom1->type != atom2->type) {
  ------------------
  |  Branch (2642:9): [True: 0, False: 31.6M]
  ------------------
 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.6M|    switch (atom1->type) {
 2649|  31.6M|        case XML_REGEXP_STRING:
  ------------------
  |  Branch (2649:9): [True: 31.6M, False: 0]
  ------------------
 2650|  31.6M|            if (!deep)
  ------------------
  |  Branch (2650:17): [True: 0, False: 31.6M]
  ------------------
 2651|      0|                ret = (atom1->valuep != atom2->valuep);
 2652|  31.6M|            else {
 2653|  31.6M|                xmlChar *val1 = (xmlChar *)atom1->valuep;
 2654|  31.6M|                xmlChar *val2 = (xmlChar *)atom2->valuep;
 2655|  31.6M|                int compound1 = (xmlStrchr(val1, '|') != NULL);
 2656|  31.6M|                int compound2 = (xmlStrchr(val2, '|') != NULL);
 2657|       |
 2658|       |                /* Ignore negative match flag for ##other namespaces */
 2659|  31.6M|                if (compound1 != compound2)
  ------------------
  |  Branch (2659:21): [True: 0, False: 31.6M]
  ------------------
 2660|      0|                    return(0);
 2661|       |
 2662|  31.6M|                ret = xmlRegStrEqualWildcard(val1, val2);
 2663|  31.6M|            }
 2664|  31.6M|	    break;
 2665|  31.6M|        case XML_REGEXP_EPSILON:
  ------------------
  |  Branch (2665:9): [True: 0, False: 31.6M]
  ------------------
 2666|      0|	    goto not_determinist;
 2667|      0|        case XML_REGEXP_CHARVAL:
  ------------------
  |  Branch (2667:9): [True: 0, False: 31.6M]
  ------------------
 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.6M]
  ------------------
 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.6M]
  ------------------
 2699|      0|	    goto not_determinist;
 2700|  31.6M|    }
 2701|  31.6M|done:
 2702|  31.6M|    if (atom1->neg != atom2->neg) {
  ------------------
  |  Branch (2702:9): [True: 0, False: 31.6M]
  ------------------
 2703|      0|        ret = !ret;
 2704|      0|    }
 2705|  31.6M|    if (ret == 0)
  ------------------
  |  Branch (2705:9): [True: 25.9M, False: 5.68M]
  ------------------
 2706|  25.9M|        return(0);
 2707|  5.68M|not_determinist:
 2708|  5.68M|    return(1);
 2709|  31.6M|}
xmlregexp.c:xmlRegFreeAtom:
  855|   295k|xmlRegFreeAtom(xmlRegAtomPtr atom) {
  856|   295k|    int i;
  857|       |
  858|   295k|    if (atom == NULL)
  ------------------
  |  Branch (858:9): [True: 0, False: 295k]
  ------------------
  859|      0|	return;
  860|       |
  861|   295k|    for (i = 0;i < atom->nbRanges;i++)
  ------------------
  |  Branch (861:16): [True: 0, False: 295k]
  ------------------
  862|      0|	xmlRegFreeRange(atom->ranges[i]);
  863|   295k|    if (atom->ranges != NULL)
  ------------------
  |  Branch (863:9): [True: 0, False: 295k]
  ------------------
  864|      0|	xmlFree(atom->ranges);
  865|   295k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep != NULL))
  ------------------
  |  Branch (865:9): [True: 295k, False: 0]
  |  Branch (865:46): [True: 295k, False: 44]
  ------------------
  866|   295k|	xmlFree(atom->valuep);
  867|   295k|    if ((atom->type == XML_REGEXP_STRING) && (atom->valuep2 != NULL))
  ------------------
  |  Branch (867:9): [True: 295k, False: 0]
  |  Branch (867:46): [True: 0, False: 295k]
  ------------------
  868|      0|	xmlFree(atom->valuep2);
  869|   295k|    if ((atom->type == XML_REGEXP_BLOCK_NAME) && (atom->valuep != NULL))
  ------------------
  |  Branch (869:9): [True: 0, False: 295k]
  |  Branch (869:50): [True: 0, False: 0]
  ------------------
  870|      0|	xmlFree(atom->valuep);
  871|   295k|    xmlFree(atom);
  872|   295k|}
xmlregexp.c:xmlRegNewAtom:
  833|   295k|xmlRegNewAtom(xmlRegParserCtxtPtr ctxt, xmlRegAtomType type) {
  834|   295k|    xmlRegAtomPtr ret;
  835|       |
  836|   295k|    ret = (xmlRegAtomPtr) xmlMalloc(sizeof(xmlRegAtom));
  837|   295k|    if (ret == NULL) {
  ------------------
  |  Branch (837:9): [True: 47, False: 295k]
  ------------------
  838|     47|	xmlRegexpErrMemory(ctxt);
  839|     47|	return(NULL);
  840|     47|    }
  841|   295k|    memset(ret, 0, sizeof(xmlRegAtom));
  842|   295k|    ret->type = type;
  843|   295k|    ret->quant = XML_REGEXP_QUANT_ONCE;
  844|   295k|    ret->min = 0;
  845|   295k|    ret->max = 0;
  846|   295k|    return(ret);
  847|   295k|}
xmlregexp.c:xmlRegexpErrMemory:
  427|    481|{
  428|    481|    if (ctxt != NULL)
  ------------------
  |  Branch (428:9): [True: 481, False: 0]
  ------------------
  429|    481|        ctxt->error = XML_ERR_NO_MEMORY;
  430|       |
  431|    481|    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_REGEXP, NULL);
  432|    481|}
xmlregexp.c:xmlFAGenerateTransitions:
 1698|   295k|	                 xmlRegStatePtr to, xmlRegAtomPtr atom) {
 1699|   295k|    xmlRegStatePtr end;
 1700|   295k|    int nullable = 0;
 1701|       |
 1702|   295k|    if (atom == NULL) {
  ------------------
  |  Branch (1702:9): [True: 0, False: 295k]
  ------------------
 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|   295k|    if (atom->type == XML_REGEXP_SUBREG) {
  ------------------
  |  Branch (1706:9): [True: 0, False: 295k]
  ------------------
 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|   295k|    if ((atom->min == 0) && (atom->max == 0) &&
  ------------------
  |  Branch (1849:9): [True: 295k, False: 0]
  |  Branch (1849:29): [True: 295k, False: 0]
  ------------------
 1850|   295k|               (atom->quant == XML_REGEXP_QUANT_RANGE)) {
  ------------------
  |  Branch (1850:16): [True: 0, False: 295k]
  ------------------
 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|   295k|    if (to == NULL) {
  ------------------
  |  Branch (1864:9): [True: 252k, False: 42.3k]
  ------------------
 1865|   252k|	to = xmlRegStatePush(ctxt);
 1866|   252k|	if (to == NULL)
  ------------------
  |  Branch (1866:6): [True: 45, False: 252k]
  ------------------
 1867|     45|	    return(-1);
 1868|   252k|    }
 1869|   295k|    end = to;
 1870|   295k|    if ((atom->quant == XML_REGEXP_QUANT_MULT) ||
  ------------------
  |  Branch (1870:9): [True: 0, False: 295k]
  ------------------
 1871|   295k|        (atom->quant == XML_REGEXP_QUANT_PLUS)) {
  ------------------
  |  Branch (1871:9): [True: 0, False: 295k]
  ------------------
 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|   295k|    if ((atom->quant == XML_REGEXP_QUANT_RANGE) &&
  ------------------
  |  Branch (1885:9): [True: 0, False: 295k]
  ------------------
 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|   295k|    xmlRegStateAddTrans(ctxt, from, atom, to, -1, -1);
 1893|   295k|    ctxt->state = end;
 1894|   295k|    switch (atom->quant) {
 1895|      0|	case XML_REGEXP_QUANT_OPT:
  ------------------
  |  Branch (1895:2): [True: 0, False: 295k]
  ------------------
 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: 295k]
  ------------------
 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: 295k]
  ------------------
 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: 295k]
  ------------------
 1909|      0|	    if (nullable)
  ------------------
  |  Branch (1909:10): [True: 0, False: 0]
  ------------------
 1910|      0|		xmlFAGenerateEpsilonTransition(ctxt, from, to);
 1911|      0|	    break;
 1912|   295k|	default:
  ------------------
  |  Branch (1912:2): [True: 295k, False: 0]
  ------------------
 1913|   295k|	    break;
 1914|   295k|    }
 1915|   295k|    if (xmlRegAtomPush(ctxt, atom) < 0)
  ------------------
  |  Branch (1915:9): [True: 18, False: 295k]
  ------------------
 1916|     18|	return(-1);
 1917|   295k|    return(0);
 1918|   295k|}
xmlregexp.c:xmlRegStateAddTrans:
 1521|  12.7M|		    int counter, int count) {
 1522|       |
 1523|  12.7M|    int nrtrans;
 1524|       |
 1525|  12.7M|    if (state == NULL) {
  ------------------
  |  Branch (1525:9): [True: 0, False: 12.7M]
  ------------------
 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|  12.7M|    if (target == NULL) {
  ------------------
  |  Branch (1529:9): [True: 0, False: 12.7M]
  ------------------
 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.38G|    for (nrtrans = state->nbTrans - 1; nrtrans >= 0; nrtrans--) {
  ------------------
  |  Branch (1539:40): [True: 1.38G, False: 1.78M]
  ------------------
 1540|  1.38G|	xmlRegTransPtr trans = &(state->trans[nrtrans]);
 1541|  1.38G|	if ((trans->atom == atom) &&
  ------------------
  |  Branch (1541:6): [True: 11.8M, False: 1.37G]
  ------------------
 1542|  11.8M|	    (trans->to == target->no) &&
  ------------------
  |  Branch (1542:6): [True: 10.9M, False: 858k]
  ------------------
 1543|  10.9M|	    (trans->counter == counter) &&
  ------------------
  |  Branch (1543:6): [True: 10.9M, False: 0]
  ------------------
 1544|  10.9M|	    (trans->count == count)) {
  ------------------
  |  Branch (1544:6): [True: 10.9M, False: 0]
  ------------------
 1545|  10.9M|	    return;
 1546|  10.9M|	}
 1547|  1.38G|    }
 1548|       |
 1549|  1.78M|    if (state->nbTrans >= state->maxTrans) {
  ------------------
  |  Branch (1549:9): [True: 797k, False: 991k]
  ------------------
 1550|   797k|	xmlRegTrans *tmp;
 1551|   797k|        int newSize;
 1552|       |
 1553|   797k|        newSize = xmlGrowCapacity(state->maxTrans, sizeof(tmp[0]),
 1554|   797k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   797k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1555|   797k|	if (newSize < 0) {
  ------------------
  |  Branch (1555:6): [True: 0, False: 797k]
  ------------------
 1556|      0|	    xmlRegexpErrMemory(ctxt);
 1557|      0|	    return;
 1558|      0|	}
 1559|   797k|	tmp = xmlRealloc(state->trans, newSize * sizeof(tmp[0]));
 1560|   797k|	if (tmp == NULL) {
  ------------------
  |  Branch (1560:6): [True: 109, False: 797k]
  ------------------
 1561|    109|	    xmlRegexpErrMemory(ctxt);
 1562|    109|	    return;
 1563|    109|	}
 1564|   797k|	state->trans = tmp;
 1565|   797k|	state->maxTrans = newSize;
 1566|   797k|    }
 1567|       |
 1568|  1.78M|    state->trans[state->nbTrans].atom = atom;
 1569|  1.78M|    state->trans[state->nbTrans].to = target->no;
 1570|  1.78M|    state->trans[state->nbTrans].counter = counter;
 1571|  1.78M|    state->trans[state->nbTrans].count = count;
 1572|  1.78M|    state->trans[state->nbTrans].nd = 0;
 1573|  1.78M|    state->nbTrans++;
 1574|  1.78M|    xmlRegStateAddTransTo(ctxt, target, state->no);
 1575|  1.78M|}
xmlregexp.c:xmlRegStateAddTransTo:
 1495|  1.78M|                      int from) {
 1496|  1.78M|    if (target->nbTransTo >= target->maxTransTo) {
  ------------------
  |  Branch (1496:9): [True: 781k, False: 1.00M]
  ------------------
 1497|   781k|	int *tmp;
 1498|   781k|        int newSize;
 1499|       |
 1500|   781k|        newSize = xmlGrowCapacity(target->maxTransTo, sizeof(tmp[0]),
 1501|   781k|                                  8, XML_MAX_ITEMS);
  ------------------
  |  |   13|   781k|#define XML_MAX_ITEMS 1000000000 /* 1 billion */
  ------------------
 1502|   781k|	if (newSize < 0) {
  ------------------
  |  Branch (1502:6): [True: 0, False: 781k]
  ------------------
 1503|      0|	    xmlRegexpErrMemory(ctxt);
 1504|      0|	    return;
 1505|      0|	}
 1506|   781k|	tmp = xmlRealloc(target->transTo, newSize * sizeof(tmp[0]));
 1507|   781k|	if (tmp == NULL) {
  ------------------
  |  Branch (1507:6): [True: 109, False: 781k]
  ------------------
 1508|    109|	    xmlRegexpErrMemory(ctxt);
 1509|    109|	    return;
 1510|    109|	}
 1511|   781k|	target->transTo = tmp;
 1512|   781k|	target->maxTransTo = newSize;
 1513|   781k|    }
 1514|  1.78M|    target->transTo[target->nbTransTo] = from;
 1515|  1.78M|    target->nbTransTo++;
 1516|  1.78M|}
xmlregexp.c:xmlRegAtomPush:
 1465|   295k|xmlRegAtomPush(xmlRegParserCtxtPtr ctxt, xmlRegAtomPtr atom) {
 1466|   295k|    if (atom == NULL) {
  ------------------
  |  Branch (1466:9): [True: 0, False: 295k]
  ------------------
 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|   295k|    if (ctxt->nbAtoms >= ctxt->maxAtoms) {
  ------------------
  |  Branch (1470:9): [True: 9.94k, False: 285k]
  ------------------
 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: 18, False: 9.92k]
  ------------------
 1482|     18|	    xmlRegexpErrMemory(ctxt);
 1483|     18|	    return(-1);
 1484|     18|	}
 1485|  9.92k|	ctxt->atoms = tmp;
 1486|  9.92k|        ctxt->maxAtoms = newSize;
 1487|  9.92k|    }
 1488|   295k|    atom->no = ctxt->nbAtoms;
 1489|   295k|    ctxt->atoms[ctxt->nbAtoms++] = atom;
 1490|   295k|    return(0);
 1491|   295k|}
xmlregexp.c:xmlFAGenerateEpsilonTransition:
 1640|   302k|			       xmlRegStatePtr from, xmlRegStatePtr to) {
 1641|   302k|    if (to == NULL) {
  ------------------
  |  Branch (1641:9): [True: 96.5k, False: 205k]
  ------------------
 1642|  96.5k|	to = xmlRegStatePush(ctxt);
 1643|  96.5k|        if (to == NULL)
  ------------------
  |  Branch (1643:13): [True: 14, False: 96.5k]
  ------------------
 1644|     14|            return(-1);
 1645|  96.5k|	ctxt->state = to;
 1646|  96.5k|    }
 1647|   302k|    xmlRegStateAddTrans(ctxt, from, NULL, to, -1, -1);
 1648|   302k|    return(0);
 1649|   302k|}

xmlSaveSetIndentString:
  126|  39.0k|xmlSaveSetIndentString(xmlSaveCtxt *ctxt, const char *indent) {
  127|  39.0k|    size_t len;
  128|  39.0k|    int i;
  129|       |
  130|  39.0k|    if ((ctxt == NULL) || (indent == NULL))
  ------------------
  |  Branch (130:9): [True: 0, False: 39.0k]
  |  Branch (130:27): [True: 0, False: 39.0k]
  ------------------
  131|      0|        return(-1);
  132|       |
  133|  39.0k|    len = strlen(indent);
  134|  39.0k|    if ((len <= 0) || (len > MAX_INDENT))
  ------------------
  |  |   20|  39.0k|#define MAX_INDENT 60
  ------------------
  |  Branch (134:9): [True: 0, False: 39.0k]
  |  Branch (134:23): [True: 0, False: 39.0k]
  ------------------
  135|      0|        return(-1);
  136|       |
  137|  39.0k|    ctxt->indent_size = len;
  138|  39.0k|    ctxt->indent_nr = MAX_INDENT / ctxt->indent_size;
  ------------------
  |  |   20|  39.0k|#define MAX_INDENT 60
  ------------------
  139|  1.21M|    for (i = 0; i < ctxt->indent_nr; i++)
  ------------------
  |  Branch (139:17): [True: 1.17M, False: 39.0k]
  ------------------
  140|  1.17M|        memcpy(&ctxt->indent[i * ctxt->indent_size], indent, len);
  141|       |
  142|  39.0k|    return(0);
  143|  39.0k|}
xmlNodeDumpOutput:
 2334|  39.0k|{
 2335|  39.0k|    xmlSaveCtxt ctxt;
 2336|  39.0k|    int options;
 2337|  39.0k|#ifdef LIBXML_HTML_ENABLED
 2338|  39.0k|    xmlDtdPtr dtd;
 2339|  39.0k|    int is_xhtml = 0;
 2340|  39.0k|#endif
 2341|       |
 2342|  39.0k|    (void) doc;
 2343|       |
 2344|  39.0k|    xmlInitParser();
 2345|       |
 2346|  39.0k|    if ((buf == NULL) || (cur == NULL)) return;
  ------------------
  |  Branch (2346:9): [True: 0, False: 39.0k]
  |  Branch (2346:26): [True: 0, False: 39.0k]
  ------------------
 2347|       |
 2348|  39.0k|    if (level < 0)
  ------------------
  |  Branch (2348:9): [True: 0, False: 39.0k]
  ------------------
 2349|      0|        level = 0;
 2350|  39.0k|    else if (level > 100)
  ------------------
  |  Branch (2350:14): [True: 0, False: 39.0k]
  ------------------
 2351|      0|        level = 100;
 2352|       |
 2353|  39.0k|    if (encoding == NULL)
  ------------------
  |  Branch (2353:9): [True: 39.0k, False: 0]
  ------------------
 2354|  39.0k|        encoding = "UTF-8";
 2355|       |
 2356|  39.0k|    memset(&ctxt, 0, sizeof(ctxt));
 2357|  39.0k|    ctxt.buf = buf;
 2358|  39.0k|    ctxt.level = level;
 2359|  39.0k|    ctxt.encoding = (const xmlChar *) encoding;
 2360|       |
 2361|  39.0k|    options = XML_SAVE_AS_XML;
 2362|  39.0k|    if (format)
  ------------------
  |  Branch (2362:9): [True: 0, False: 39.0k]
  ------------------
 2363|      0|        options |= XML_SAVE_FORMAT;
 2364|  39.0k|    xmlSaveCtxtInit(&ctxt, options);
 2365|       |
 2366|  39.0k|#ifdef LIBXML_HTML_ENABLED
 2367|  39.0k|    dtd = xmlGetIntSubset(doc);
 2368|  39.0k|    if (dtd != NULL) {
  ------------------
  |  Branch (2368:9): [True: 25.0k, False: 14.0k]
  ------------------
 2369|  25.0k|	is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 2370|  25.0k|	if (is_xhtml < 0)
  ------------------
  |  Branch (2370:6): [True: 8.02k, False: 17.0k]
  ------------------
 2371|  8.02k|	    is_xhtml = 0;
 2372|  25.0k|    }
 2373|       |
 2374|  39.0k|    if (is_xhtml)
  ------------------
  |  Branch (2374:9): [True: 16.1k, False: 22.9k]
  ------------------
 2375|  16.1k|        xhtmlNodeDumpOutput(&ctxt, cur);
 2376|  22.9k|    else
 2377|  22.9k|#endif
 2378|  22.9k|        xmlNodeDumpOutputInternal(&ctxt, cur);
 2379|  39.0k|}
xmlsave.c:xmlNsDumpOutput:
  762|  1.00M|xmlNsDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur, xmlSaveCtxtPtr ctxt) {
  763|  1.00M|    unsigned escapeFlags = XML_ESCAPE_ATTR;
  ------------------
  |  |   22|  1.00M|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  764|       |
  765|  1.00M|    if ((cur == NULL) || (buf == NULL)) return;
  ------------------
  |  Branch (765:9): [True: 0, False: 1.00M]
  |  Branch (765:26): [True: 0, False: 1.00M]
  ------------------
  766|       |
  767|  1.00M|    if ((ctxt == NULL) || (ctxt->encoding == NULL))
  ------------------
  |  Branch (767:9): [True: 0, False: 1.00M]
  |  Branch (767:27): [True: 0, False: 1.00M]
  ------------------
  768|      0|        escapeFlags |= XML_ESCAPE_NON_ASCII;
  ------------------
  |  |   23|      0|#define XML_ESCAPE_NON_ASCII        (1u << 1)
  ------------------
  769|       |
  770|  1.00M|    if ((cur->type == XML_LOCAL_NAMESPACE) && (cur->href != NULL)) {
  ------------------
  |  |  500|  1.00M|#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
  ------------------
  |  Branch (770:9): [True: 1.00M, False: 0]
  |  Branch (770:47): [True: 1.00M, False: 2.85k]
  ------------------
  771|  1.00M|	if (xmlStrEqual(cur->prefix, BAD_CAST "xml"))
  ------------------
  |  |   34|  1.00M|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (771:6): [True: 280, False: 1.00M]
  ------------------
  772|    280|	    return;
  773|       |
  774|  1.00M|	if (ctxt != NULL && ctxt->format == 2)
  ------------------
  |  Branch (774:6): [True: 1.00M, False: 0]
  |  Branch (774:22): [True: 0, False: 1.00M]
  ------------------
  775|      0|	    xmlOutputBufferWriteWSNonSig(ctxt, 2);
  776|  1.00M|	else
  777|  1.00M|	    xmlOutputBufferWrite(buf, 1, " ");
  778|       |
  779|       |        /* Within the context of an element attributes */
  780|  1.00M|	if (cur->prefix != NULL) {
  ------------------
  |  Branch (780:6): [True: 999k, False: 4.60k]
  ------------------
  781|   999k|	    xmlOutputBufferWrite(buf, 6, "xmlns:");
  782|   999k|	    xmlOutputBufferWriteString(buf, (const char *)cur->prefix);
  783|   999k|	} else
  784|  4.60k|	    xmlOutputBufferWrite(buf, 5, "xmlns");
  785|  1.00M|        xmlOutputBufferWrite(buf, 2, "=\"");
  786|       |        xmlSerializeText(buf, cur->href, SIZE_MAX, escapeFlags);
  787|  1.00M|        xmlOutputBufferWrite(buf, 1, "\"");
  788|  1.00M|    }
  789|  1.00M|}
xmlsave.c:xmlSaveDocInternal:
 1226|  1.33k|                   const xmlChar *encoding) {
 1227|  1.33k|#ifdef LIBXML_HTML_ENABLED
 1228|  1.33k|    xmlDtdPtr dtd;
 1229|  1.33k|    int is_xhtml = 0;
 1230|  1.33k|#endif
 1231|  1.33k|    xmlOutputBufferPtr buf = ctxt->buf;
 1232|  1.33k|    int switched_encoding = 0;
 1233|       |
 1234|  1.33k|    xmlInitParser();
 1235|       |
 1236|  1.33k|    if ((cur->type != XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1236:9): [True: 1.33k, False: 0]
  ------------------
 1237|  1.33k|        (cur->type != XML_DOCUMENT_NODE))
  ------------------
  |  Branch (1237:9): [True: 0, False: 1.33k]
  ------------------
 1238|      0|	 return(-1);
 1239|       |
 1240|  1.33k|    if (encoding == NULL)
  ------------------
  |  Branch (1240:9): [True: 0, False: 1.33k]
  ------------------
 1241|      0|	encoding = cur->encoding;
 1242|       |
 1243|  1.33k|    if (((cur->type == XML_HTML_DOCUMENT_NODE) &&
  ------------------
  |  Branch (1243:10): [True: 0, False: 1.33k]
  ------------------
 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.33k|        (ctxt->options & XML_SAVE_AS_HTML)) {
  ------------------
  |  Branch (1246:9): [True: 0, False: 1.33k]
  ------------------
 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.33k|    } else if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (1267:16): [True: 1.33k, False: 0]
  ------------------
 1268|      0|               (ctxt->options & XML_SAVE_AS_XML) ||
  ------------------
  |  Branch (1268:16): [True: 0, False: 0]
  ------------------
 1269|  1.33k|               (ctxt->options & XML_SAVE_XHTML)) {
  ------------------
  |  Branch (1269:16): [True: 0, False: 0]
  ------------------
 1270|  1.33k|	if ((encoding != NULL) && (ctxt->encoding == NULL)) {
  ------------------
  |  Branch (1270:6): [True: 1.33k, False: 0]
  |  Branch (1270:28): [True: 0, False: 1.33k]
  ------------------
 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.33k|	if ((ctxt->options & XML_SAVE_NO_DECL) == 0) {
  ------------------
  |  Branch (1279:6): [True: 1.33k, False: 0]
  ------------------
 1280|  1.33k|	    xmlOutputBufferWrite(buf, 15, "<?xml version=\"");
 1281|  1.33k|	    if (cur->version != NULL)
  ------------------
  |  Branch (1281:10): [True: 1.33k, False: 0]
  ------------------
 1282|  1.33k|		xmlOutputBufferWriteString(buf, (char *) cur->version);
 1283|      0|	    else
 1284|      0|		xmlOutputBufferWrite(buf, 3, "1.0");
 1285|  1.33k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1286|  1.33k|	    if (encoding != NULL) {
  ------------------
  |  Branch (1286:10): [True: 1.33k, False: 0]
  ------------------
 1287|  1.33k|		xmlOutputBufferWrite(buf, 11, " encoding=\"");
 1288|  1.33k|		xmlOutputBufferWriteString(buf, (char *) encoding);
 1289|  1.33k|	        xmlOutputBufferWrite(buf, 1, "\"");
 1290|  1.33k|	    }
 1291|  1.33k|	    switch (cur->standalone) {
  ------------------
  |  Branch (1291:14): [True: 151, False: 1.18k]
  ------------------
 1292|     85|		case 0:
  ------------------
  |  Branch (1292:3): [True: 85, False: 1.25k]
  ------------------
 1293|     85|		    xmlOutputBufferWrite(buf, 16, " standalone=\"no\"");
 1294|     85|		    break;
 1295|     66|		case 1:
  ------------------
  |  Branch (1295:3): [True: 66, False: 1.27k]
  ------------------
 1296|     66|		    xmlOutputBufferWrite(buf, 17, " standalone=\"yes\"");
 1297|     66|		    break;
 1298|  1.33k|	    }
 1299|  1.33k|	    xmlOutputBufferWrite(buf, 3, "?>\n");
 1300|  1.33k|	}
 1301|       |
 1302|  1.33k|#ifdef LIBXML_HTML_ENABLED
 1303|  1.33k|        if (ctxt->options & XML_SAVE_XHTML)
  ------------------
  |  Branch (1303:13): [True: 196, False: 1.14k]
  ------------------
 1304|    196|            is_xhtml = 1;
 1305|  1.33k|	if ((ctxt->options & XML_SAVE_NO_XHTML) == 0) {
  ------------------
  |  Branch (1305:6): [True: 1.33k, False: 0]
  ------------------
 1306|  1.33k|	    dtd = xmlGetIntSubset(cur);
 1307|  1.33k|	    if (dtd != NULL) {
  ------------------
  |  Branch (1307:10): [True: 1.25k, False: 81]
  ------------------
 1308|  1.25k|		is_xhtml = xmlIsXHTML(dtd->SystemID, dtd->ExternalID);
 1309|  1.25k|		if (is_xhtml < 0) is_xhtml = 0;
  ------------------
  |  Branch (1309:7): [True: 905, False: 350]
  ------------------
 1310|  1.25k|	    }
 1311|  1.33k|	}
 1312|  1.33k|#endif
 1313|  1.33k|	if (cur->children != NULL) {
  ------------------
  |  Branch (1313:6): [True: 1.33k, False: 0]
  ------------------
 1314|  1.33k|	    xmlNodePtr child = cur->children;
 1315|       |
 1316|  3.96k|	    while (child != NULL) {
  ------------------
  |  Branch (1316:13): [True: 2.63k, False: 1.33k]
  ------------------
 1317|  2.63k|		ctxt->level = 0;
 1318|  2.63k|#ifdef LIBXML_HTML_ENABLED
 1319|  2.63k|		if (is_xhtml)
  ------------------
  |  Branch (1319:7): [True: 428, False: 2.20k]
  ------------------
 1320|    428|		    xhtmlNodeDumpOutput(ctxt, child);
 1321|  2.20k|		else
 1322|  2.20k|#endif
 1323|  2.20k|		    xmlNodeDumpOutputInternal(ctxt, child);
 1324|  2.63k|                if ((child->type != XML_XINCLUDE_START) &&
  ------------------
  |  Branch (1324:21): [True: 2.63k, False: 0]
  ------------------
 1325|  2.63k|                    (child->type != XML_XINCLUDE_END))
  ------------------
  |  Branch (1325:21): [True: 2.63k, False: 0]
  ------------------
 1326|  2.63k|                    xmlOutputBufferWrite(buf, 1, "\n");
 1327|  2.63k|		child = child->next;
 1328|  2.63k|	    }
 1329|  1.33k|	}
 1330|  1.33k|    }
 1331|       |
 1332|       |    /*
 1333|       |     * Restore the state of the saving context at the end of the document
 1334|       |     */
 1335|  1.33k|    if (switched_encoding) {
  ------------------
  |  Branch (1335:9): [True: 0, False: 1.33k]
  ------------------
 1336|      0|	xmlSaveClearEncoding(ctxt);
 1337|      0|    }
 1338|       |
 1339|  1.33k|    return(0);
 1340|  1.33k|}
xmlsave.c:xhtmlNodeDumpOutput:
 1489|  16.5k|xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
 1490|  16.5k|    int format = ctxt->format, addmeta, oldoptions;
 1491|  16.5k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
 1492|  16.5k|    xmlChar *start, *end;
 1493|  16.5k|    xmlOutputBufferPtr buf = ctxt->buf;
 1494|       |
 1495|  16.5k|    if (cur == NULL) return;
  ------------------
  |  Branch (1495:9): [True: 0, False: 16.5k]
  ------------------
 1496|       |
 1497|  16.5k|    oldoptions = ctxt->options;
 1498|  16.5k|    ctxt->options |= XML_SAVE_XHTML;
 1499|       |
 1500|  16.5k|    root = cur;
 1501|  16.5k|    parent = cur->parent;
 1502|  56.2k|    while (1) {
  ------------------
  |  Branch (1502:12): [True: 56.2k, Folded]
  ------------------
 1503|  56.2k|        switch (cur->type) {
 1504|    196|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (1504:9): [True: 196, False: 56.0k]
  ------------------
 1505|    196|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (1505:9): [True: 0, False: 56.2k]
  ------------------
 1506|    196|            xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
 1507|    196|	    break;
 1508|       |
 1509|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1509:9): [True: 0, False: 56.2k]
  ------------------
 1510|      0|	    xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1511|      0|	    break;
 1512|       |
 1513|    196|        case XML_DTD_NODE:
  ------------------
  |  Branch (1513:9): [True: 196, False: 56.0k]
  ------------------
 1514|    196|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
 1515|    196|	    break;
 1516|       |
 1517|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (1517:9): [True: 0, False: 56.2k]
  ------------------
 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: 56.2k]
  ------------------
 1527|      0|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
 1528|      0|	    break;
 1529|       |
 1530|      0|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (1530:9): [True: 0, False: 56.2k]
  ------------------
 1531|      0|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
 1532|      0|	    break;
 1533|       |
 1534|      0|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1534:9): [True: 0, False: 56.2k]
  ------------------
 1535|      0|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1536|      0|	    break;
 1537|       |
 1538|  33.4k|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1538:9): [True: 33.4k, False: 22.8k]
  ------------------
 1539|  33.4k|            addmeta = 0;
 1540|       |
 1541|  33.4k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1541:10): [True: 22.9k, False: 10.5k]
  |  Branch (1541:27): [True: 0, False: 22.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|  33.4k|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1549:17): [True: 0, False: 33.4k]
  |  Branch (1549:44): [True: 0, False: 0]
  ------------------
 1550|      0|                xhtmlNodeDumpOutput(ctxt, cur);
 1551|      0|                break;
 1552|      0|            }
 1553|       |
 1554|  33.4k|            xmlOutputBufferWrite(buf, 1, "<");
 1555|  33.4k|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1555:17): [True: 10.8k, False: 22.5k]
  |  Branch (1555:38): [True: 3.88k, False: 6.96k]
  ------------------
 1556|  3.88k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1557|  3.88k|                xmlOutputBufferWrite(buf, 1, ":");
 1558|  3.88k|            }
 1559|       |
 1560|  33.4k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1561|  33.4k|            if (cur->nsDef)
  ------------------
  |  Branch (1561:17): [True: 3.81k, False: 29.6k]
  ------------------
 1562|  3.81k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1563|  33.4k|            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
  ------------------
  |  |   34|  33.4k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1563:18): [True: 1.00k, False: 32.4k]
  ------------------
 1564|  1.00k|                (cur->ns == NULL) && (cur->nsDef == NULL))) {
  ------------------
  |  Branch (1564:17): [True: 608, False: 401]
  |  Branch (1564:38): [True: 497, False: 111]
  ------------------
 1565|       |                /*
 1566|       |                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
 1567|       |                 */
 1568|    497|                xmlOutputBufferWriteString(buf,
 1569|    497|                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
 1570|    497|            }
 1571|  33.4k|            if (cur->properties != NULL)
  ------------------
  |  Branch (1571:17): [True: 9.17k, False: 24.2k]
  ------------------
 1572|  9.17k|                xhtmlAttrListDumpOutput(ctxt, cur->properties);
 1573|       |
 1574|  33.4k|            if ((parent != NULL) &&
  ------------------
  |  Branch (1574:17): [True: 23.1k, False: 10.3k]
  ------------------
 1575|  23.1k|                (parent->parent == (xmlNodePtr) cur->doc) &&
  ------------------
  |  Branch (1575:17): [True: 66, False: 23.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|  33.4k|            if (cur->children == NULL) {
  ------------------
  |  Branch (1604:17): [True: 17.7k, False: 15.6k]
  ------------------
 1605|  17.7k|                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
  ------------------
  |  Branch (1605:22): [True: 14.4k, False: 3.29k]
  |  Branch (1605:43): [True: 1.65k, False: 1.64k]
  ------------------
 1606|  16.1k|                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
  ------------------
  |  Branch (1606:22): [True: 3.11k, False: 13.0k]
  |  Branch (1606:50): [True: 3.11k, False: 0]
  ------------------
 1607|       |                    /*
 1608|       |                     * C.2. Empty Elements
 1609|       |                     */
 1610|  3.11k|                    xmlOutputBufferWrite(buf, 3, " />");
 1611|  14.6k|                } else {
 1612|  14.6k|                    if (addmeta == 1) {
  ------------------
  |  Branch (1612:25): [True: 0, False: 14.6k]
  ------------------
 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|  14.6k|                    } else {
 1631|  14.6k|                        xmlOutputBufferWrite(buf, 1, ">");
 1632|  14.6k|                    }
 1633|       |                    /*
 1634|       |                     * C.3. Element Minimization and Empty Element Content
 1635|       |                     */
 1636|  14.6k|                    xmlOutputBufferWrite(buf, 2, "</");
 1637|  14.6k|                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1637:25): [True: 3.29k, False: 11.3k]
  |  Branch (1637:46): [True: 1.64k, False: 1.65k]
  ------------------
 1638|  1.64k|                        xmlOutputBufferWriteString(buf,
 1639|  1.64k|                                (const char *)cur->ns->prefix);
 1640|  1.64k|                        xmlOutputBufferWrite(buf, 1, ":");
 1641|  1.64k|                    }
 1642|  14.6k|                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1643|  14.6k|                    xmlOutputBufferWrite(buf, 1, ">");
 1644|  14.6k|                }
 1645|  17.7k|            } else {
 1646|  15.6k|                xmlOutputBufferWrite(buf, 1, ">");
 1647|  15.6k|                if (addmeta == 1) {
  ------------------
  |  Branch (1647:21): [True: 0, False: 15.6k]
  ------------------
 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|  15.6k|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1664:21): [True: 0, False: 15.6k]
  ------------------
 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|  15.6k|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1677:21): [True: 0, False: 15.6k]
  ------------------
 1678|  15.6k|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1678:21): [True: 15.6k, False: 0]
  ------------------
 1679|  15.6k|                parent = cur;
 1680|  15.6k|                cur = cur->children;
 1681|  15.6k|                continue;
 1682|  15.6k|            }
 1683|       |
 1684|  17.7k|            break;
 1685|       |
 1686|  19.8k|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1686:9): [True: 19.8k, False: 36.3k]
  ------------------
 1687|  19.8k|	    if (cur->content == NULL)
  ------------------
  |  Branch (1687:10): [True: 0, False: 19.8k]
  ------------------
 1688|      0|                break;
 1689|  19.8k|	    if ((cur->name == xmlStringText) ||
  ------------------
  |  Branch (1689:10): [True: 19.8k, False: 0]
  ------------------
 1690|  19.8k|		(cur->name != xmlStringTextNoenc)) {
  ------------------
  |  Branch (1690:3): [True: 0, False: 0]
  ------------------
 1691|  19.8k|                if (ctxt->escape)
  ------------------
  |  Branch (1691:21): [True: 0, False: 19.8k]
  ------------------
 1692|      0|                    xmlOutputBufferWriteEscape(buf, cur->content,
 1693|      0|                                               ctxt->escape);
 1694|  19.8k|                else
 1695|  19.8k|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1696|  19.8k|	    } else {
 1697|       |		/*
 1698|       |		 * Disable escaping, needed for XSLT
 1699|       |		 */
 1700|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1701|      0|	    }
 1702|  19.8k|	    break;
 1703|       |
 1704|    942|        case XML_PI_NODE:
  ------------------
  |  Branch (1704:9): [True: 942, False: 55.3k]
  ------------------
 1705|    942|            if (cur->content != NULL) {
  ------------------
  |  Branch (1705:17): [True: 470, False: 472]
  ------------------
 1706|    470|                xmlOutputBufferWrite(buf, 2, "<?");
 1707|    470|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1708|    470|                if (cur->content != NULL) {
  ------------------
  |  Branch (1708:21): [True: 470, False: 0]
  ------------------
 1709|    470|                    xmlOutputBufferWrite(buf, 1, " ");
 1710|    470|                    xmlOutputBufferWriteString(buf,
 1711|    470|                            (const char *)cur->content);
 1712|    470|                }
 1713|    470|                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|    942|            break;
 1720|       |
 1721|    681|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1721:9): [True: 681, False: 55.5k]
  ------------------
 1722|    681|            if (cur->content != NULL) {
  ------------------
  |  Branch (1722:17): [True: 681, False: 0]
  ------------------
 1723|    681|                xmlOutputBufferWrite(buf, 4, "<!--");
 1724|    681|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1725|    681|                xmlOutputBufferWrite(buf, 3, "-->");
 1726|    681|            }
 1727|    681|            break;
 1728|       |
 1729|    473|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1729:9): [True: 473, False: 55.7k]
  ------------------
 1730|    473|            xmlOutputBufferWrite(buf, 1, "&");
 1731|    473|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1732|    473|            xmlOutputBufferWrite(buf, 1, ";");
 1733|    473|            break;
 1734|       |
 1735|    350|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1735:9): [True: 350, False: 55.8k]
  ------------------
 1736|    350|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1736:17): [True: 0, False: 350]
  |  Branch (1736:41): [True: 70, False: 280]
  ------------------
 1737|     70|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1738|    280|            } else {
 1739|    280|                start = end = cur->content;
 1740|  5.24k|                while (*end != '\0') {
  ------------------
  |  Branch (1740:24): [True: 4.96k, False: 280]
  ------------------
 1741|  4.96k|                    if (*end == ']' && *(end + 1) == ']' &&
  ------------------
  |  Branch (1741:25): [True: 618, False: 4.34k]
  |  Branch (1741:40): [True: 276, False: 342]
  ------------------
 1742|    276|                        *(end + 2) == '>') {
  ------------------
  |  Branch (1742:25): [True: 0, False: 276]
  ------------------
 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.96k|                    end++;
 1751|  4.96k|                }
 1752|    280|                if (start != end) {
  ------------------
  |  Branch (1752:21): [True: 280, False: 0]
  ------------------
 1753|    280|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1754|    280|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1755|    280|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1756|    280|                }
 1757|    280|            }
 1758|    350|            break;
 1759|       |
 1760|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1760:9): [True: 0, False: 56.2k]
  ------------------
 1761|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1762|      0|	    break;
 1763|       |
 1764|     77|        default:
  ------------------
  |  Branch (1764:9): [True: 77, False: 56.1k]
  ------------------
 1765|     77|            break;
 1766|  56.2k|        }
 1767|       |
 1768|  56.2k|        while (1) {
  ------------------
  |  Branch (1768:16): [True: 56.2k, Folded]
  ------------------
 1769|  56.2k|            if (cur == root)
  ------------------
  |  Branch (1769:17): [True: 16.5k, False: 39.6k]
  ------------------
 1770|  16.5k|                return;
 1771|  39.6k|            if (ctxt->format == 1)
  ------------------
  |  Branch (1771:17): [True: 0, False: 39.6k]
  ------------------
 1772|      0|                xmlOutputBufferWrite(buf, 1, "\n");
 1773|  39.6k|            if (cur->next != NULL) {
  ------------------
  |  Branch (1773:17): [True: 24.0k, False: 15.6k]
  ------------------
 1774|  24.0k|                cur = cur->next;
 1775|  24.0k|                break;
 1776|  24.0k|            }
 1777|       |
 1778|  15.6k|            cur = parent;
 1779|       |            /* cur->parent was validated when descending. */
 1780|  15.6k|            parent = cur->parent;
 1781|       |
 1782|  15.6k|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1782:17): [True: 15.6k, False: 0]
  ------------------
 1783|  15.6k|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1783:21): [True: 15.6k, False: 0]
  ------------------
 1784|  15.6k|                if (ctxt->format == 1)
  ------------------
  |  Branch (1784:21): [True: 0, False: 15.6k]
  ------------------
 1785|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1786|       |
 1787|  15.6k|                xmlOutputBufferWrite(buf, 2, "</");
 1788|  15.6k|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1788:21): [True: 7.55k, False: 8.11k]
  |  Branch (1788:42): [True: 2.24k, False: 5.31k]
  ------------------
 1789|  2.24k|                    xmlOutputBufferWriteString(buf,
 1790|  2.24k|                            (const char *)cur->ns->prefix);
 1791|  2.24k|                    xmlOutputBufferWrite(buf, 1, ":");
 1792|  2.24k|                }
 1793|       |
 1794|  15.6k|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1795|  15.6k|                xmlOutputBufferWrite(buf, 1, ">");
 1796|       |
 1797|  15.6k|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1797:21): [True: 0, False: 15.6k]
  ------------------
 1798|      0|                    ctxt->format = format;
 1799|      0|                    unformattedNode = NULL;
 1800|      0|                }
 1801|  15.6k|            }
 1802|  15.6k|        }
 1803|  40.5k|    }
 1804|       |
 1805|      0|    ctxt->options = oldoptions;
 1806|      0|}
xmlsave.c:xmlDtdDumpOutput:
  827|  9.60k|xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
  828|  9.60k|    xmlOutputBufferPtr buf;
  829|  9.60k|    xmlNodePtr cur;
  830|  9.60k|    int format, level;
  831|       |
  832|  9.60k|    if (dtd == NULL) return;
  ------------------
  |  Branch (832:9): [True: 0, False: 9.60k]
  ------------------
  833|  9.60k|    if ((ctxt == NULL) || (ctxt->buf == NULL))
  ------------------
  |  Branch (833:9): [True: 0, False: 9.60k]
  |  Branch (833:27): [True: 0, False: 9.60k]
  ------------------
  834|      0|        return;
  835|  9.60k|    buf = ctxt->buf;
  836|  9.60k|    xmlOutputBufferWrite(buf, 10, "<!DOCTYPE ");
  837|  9.60k|    xmlOutputBufferWriteString(buf, (const char *)dtd->name);
  838|  9.60k|    if (dtd->ExternalID != NULL) {
  ------------------
  |  Branch (838:9): [True: 544, False: 9.05k]
  ------------------
  839|    544|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  840|    544|	xmlOutputBufferWriteQuotedString(buf, dtd->ExternalID);
  841|    544|	xmlOutputBufferWrite(buf, 1, " ");
  842|    544|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  843|  9.05k|    }  else if (dtd->SystemID != NULL) {
  ------------------
  |  Branch (843:17): [True: 421, False: 8.63k]
  ------------------
  844|    421|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  845|    421|	xmlOutputBufferWriteQuotedString(buf, dtd->SystemID);
  846|    421|    }
  847|  9.60k|    if ((dtd->entities == NULL) && (dtd->elements == NULL) &&
  ------------------
  |  Branch (847:9): [True: 7.44k, False: 2.15k]
  |  Branch (847:36): [True: 1.61k, False: 5.83k]
  ------------------
  848|  1.61k|        (dtd->attributes == NULL) && (dtd->notations == NULL) &&
  ------------------
  |  Branch (848:9): [True: 1.61k, False: 0]
  |  Branch (848:38): [True: 1.25k, False: 357]
  ------------------
  849|  1.25k|	(dtd->pentities == NULL)) {
  ------------------
  |  Branch (849:2): [True: 1.17k, False: 80]
  ------------------
  850|  1.17k|	xmlOutputBufferWrite(buf, 1, ">");
  851|  1.17k|	return;
  852|  1.17k|    }
  853|  8.42k|    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.42k|    if ((dtd->notations != NULL) && ((dtd->doc == NULL) ||
  ------------------
  |  Branch (858:9): [True: 1.46k, False: 6.96k]
  |  Branch (858:38): [True: 1.25k, False: 211]
  ------------------
  859|  1.46k|        (dtd->doc->intSubset == dtd))) {
  ------------------
  |  Branch (859:9): [True: 211, False: 0]
  ------------------
  860|  1.46k|        xmlBufDumpNotationTable(buf, (xmlNotationTablePtr) dtd->notations);
  861|  1.46k|    }
  862|  8.42k|    format = ctxt->format;
  863|  8.42k|    level = ctxt->level;
  864|  8.42k|    ctxt->format = 0;
  865|  8.42k|    ctxt->level = -1;
  866|  26.1k|    for (cur = dtd->children; cur != NULL; cur = cur->next) {
  ------------------
  |  Branch (866:31): [True: 17.7k, False: 8.42k]
  ------------------
  867|  17.7k|        xmlNodeDumpOutputInternal(ctxt, cur);
  868|  17.7k|    }
  869|  8.42k|    ctxt->format = format;
  870|  8.42k|    ctxt->level = level;
  871|  8.42k|    xmlOutputBufferWrite(buf, 2, "]>");
  872|  8.42k|}
xmlsave.c:xmlBufDumpElementDecl:
  417|  6.35k|xmlBufDumpElementDecl(xmlOutputBufferPtr buf, xmlElementPtr elem) {
  418|  6.35k|    xmlOutputBufferWrite(buf, 10, "<!ELEMENT ");
  419|  6.35k|    if (elem->prefix != NULL) {
  ------------------
  |  Branch (419:9): [True: 1.08k, False: 5.26k]
  ------------------
  420|  1.08k|        xmlOutputBufferWriteString(buf, (const char *) elem->prefix);
  421|  1.08k|        xmlOutputBufferWrite(buf, 1, ":");
  422|  1.08k|    }
  423|  6.35k|    xmlOutputBufferWriteString(buf, (const char *) elem->name);
  424|  6.35k|    xmlOutputBufferWrite(buf, 1, " ");
  425|       |
  426|  6.35k|    switch (elem->etype) {
  427|  1.42k|	case XML_ELEMENT_TYPE_EMPTY:
  ------------------
  |  Branch (427:2): [True: 1.42k, False: 4.93k]
  ------------------
  428|  1.42k|	    xmlOutputBufferWrite(buf, 5, "EMPTY");
  429|  1.42k|	    break;
  430|    217|	case XML_ELEMENT_TYPE_ANY:
  ------------------
  |  Branch (430:2): [True: 217, False: 6.13k]
  ------------------
  431|    217|	    xmlOutputBufferWrite(buf, 3, "ANY");
  432|    217|	    break;
  433|    519|	case XML_ELEMENT_TYPE_MIXED:
  ------------------
  |  Branch (433:2): [True: 519, False: 5.83k]
  ------------------
  434|  4.71k|	case XML_ELEMENT_TYPE_ELEMENT:
  ------------------
  |  Branch (434:2): [True: 4.19k, False: 2.15k]
  ------------------
  435|  4.71k|	    xmlBufDumpElementContent(buf, elem->content);
  436|  4.71k|	    break;
  437|      0|        default:
  ------------------
  |  Branch (437:9): [True: 0, False: 6.35k]
  ------------------
  438|       |            /* assert(0); */
  439|      0|            break;
  440|  6.35k|    }
  441|       |
  442|  6.35k|    xmlOutputBufferWrite(buf, 2, ">\n");
  443|  6.35k|}
xmlsave.c:xmlBufDumpElementContent:
  345|  4.71k|                         xmlElementContentPtr content) {
  346|  4.71k|    xmlElementContentPtr cur;
  347|       |
  348|  4.71k|    if (content == NULL) return;
  ------------------
  |  Branch (348:9): [True: 0, False: 4.71k]
  ------------------
  349|       |
  350|  4.71k|    xmlOutputBufferWrite(buf, 1, "(");
  351|  4.71k|    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|    519|            case XML_ELEMENT_CONTENT_PCDATA:
  ------------------
  |  Branch (357:13): [True: 519, False: 111k]
  ------------------
  358|    519|                xmlOutputBufferWrite(buf, 7, "#PCDATA");
  359|    519|                break;
  360|  57.8k|            case XML_ELEMENT_CONTENT_ELEMENT:
  ------------------
  |  Branch (360:13): [True: 57.8k, False: 54.1k]
  ------------------
  361|  57.8k|                if (cur->prefix != NULL) {
  ------------------
  |  Branch (361:21): [True: 6.05k, False: 51.7k]
  ------------------
  362|  6.05k|                    xmlOutputBufferWriteString(buf,
  363|  6.05k|                            (const char *) cur->prefix);
  364|  6.05k|                    xmlOutputBufferWrite(buf, 1, ":");
  365|  6.05k|                }
  366|  57.8k|                xmlOutputBufferWriteString(buf, (const char *) cur->name);
  367|  57.8k|                break;
  368|  21.5k|            case XML_ELEMENT_CONTENT_SEQ:
  ------------------
  |  Branch (368:13): [True: 21.5k, False: 90.4k]
  ------------------
  369|  53.6k|            case XML_ELEMENT_CONTENT_OR:
  ------------------
  |  Branch (369:13): [True: 32.1k, False: 79.8k]
  ------------------
  370|  53.6k|                if ((cur != content) &&
  ------------------
  |  Branch (370:21): [True: 51.6k, False: 1.99k]
  ------------------
  371|  51.6k|                    (cur->parent != NULL) &&
  ------------------
  |  Branch (371:21): [True: 51.6k, False: 0]
  ------------------
  372|  51.6k|                    ((cur->type != cur->parent->type) ||
  ------------------
  |  Branch (372:22): [True: 8.80k, False: 42.8k]
  ------------------
  373|  42.8k|                     (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (373:22): [True: 2.70k, False: 40.1k]
  ------------------
  374|  11.5k|                    xmlOutputBufferWrite(buf, 1, "(");
  375|  53.6k|                cur = cur->c1;
  376|  53.6k|                continue;
  377|   112k|        }
  378|       |
  379|   112k|        while (cur != content) {
  ------------------
  |  Branch (379:16): [True: 107k, False: 4.71k]
  ------------------
  380|   107k|            xmlElementContentPtr parent = cur->parent;
  381|       |
  382|   107k|            if (parent == NULL) return;
  ------------------
  |  Branch (382:17): [True: 0, False: 107k]
  ------------------
  383|       |
  384|   107k|            if (((cur->type == XML_ELEMENT_CONTENT_OR) ||
  ------------------
  |  Branch (384:18): [True: 30.7k, False: 76.5k]
  ------------------
  385|  76.5k|                 (cur->type == XML_ELEMENT_CONTENT_SEQ)) &&
  ------------------
  |  Branch (385:18): [True: 20.9k, False: 55.6k]
  ------------------
  386|  51.6k|                ((cur->type != parent->type) ||
  ------------------
  |  Branch (386:18): [True: 8.80k, False: 42.8k]
  ------------------
  387|  42.8k|                 (cur->ocur != XML_ELEMENT_CONTENT_ONCE)))
  ------------------
  |  Branch (387:18): [True: 2.70k, False: 40.1k]
  ------------------
  388|  11.5k|                xmlOutputBufferWrite(buf, 1, ")");
  389|   107k|            xmlBufDumpElementOccur(buf, cur);
  390|       |
  391|   107k|            if (cur == parent->c1) {
  ------------------
  |  Branch (391:17): [True: 53.6k, False: 53.6k]
  ------------------
  392|  53.6k|                if (parent->type == XML_ELEMENT_CONTENT_SEQ)
  ------------------
  |  Branch (392:21): [True: 21.5k, False: 32.1k]
  ------------------
  393|  21.5k|                    xmlOutputBufferWrite(buf, 3, " , ");
  394|  32.1k|                else if (parent->type == XML_ELEMENT_CONTENT_OR)
  ------------------
  |  Branch (394:26): [True: 32.1k, False: 0]
  ------------------
  395|  32.1k|                    xmlOutputBufferWrite(buf, 3, " | ");
  396|       |
  397|  53.6k|                cur = parent->c2;
  398|  53.6k|                break;
  399|  53.6k|            }
  400|       |
  401|  53.6k|            cur = parent;
  402|  53.6k|        }
  403|   112k|    } while (cur != content);
  ------------------
  |  Branch (403:14): [True: 107k, False: 4.71k]
  ------------------
  404|       |
  405|  4.71k|    xmlOutputBufferWrite(buf, 1, ")");
  406|  4.71k|    xmlBufDumpElementOccur(buf, content);
  407|  4.71k|}
xmlsave.c:xmlBufDumpElementOccur:
  321|   112k|xmlBufDumpElementOccur(xmlOutputBufferPtr buf, xmlElementContentPtr cur) {
  322|   112k|    switch (cur->ocur) {
  ------------------
  |  Branch (322:13): [True: 112k, False: 0]
  ------------------
  323|  87.0k|        case XML_ELEMENT_CONTENT_ONCE:
  ------------------
  |  Branch (323:9): [True: 87.0k, False: 24.9k]
  ------------------
  324|  87.0k|            break;
  325|  10.1k|        case XML_ELEMENT_CONTENT_OPT:
  ------------------
  |  Branch (325:9): [True: 10.1k, False: 101k]
  ------------------
  326|  10.1k|            xmlOutputBufferWrite(buf, 1, "?");
  327|  10.1k|            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.77k|        case XML_ELEMENT_CONTENT_PLUS:
  ------------------
  |  Branch (331:9): [True: 2.77k, False: 109k]
  ------------------
  332|  2.77k|            xmlOutputBufferWrite(buf, 1, "+");
  333|  2.77k|            break;
  334|   112k|    }
  335|   112k|}
xmlsave.c:xmlSaveWriteAttributeDecl:
  471|  7.37k|xmlSaveWriteAttributeDecl(xmlSaveCtxtPtr ctxt, xmlAttributePtr attr) {
  472|  7.37k|    xmlOutputBufferPtr buf = ctxt->buf;
  473|       |
  474|  7.37k|    xmlOutputBufferWrite(buf, 10, "<!ATTLIST ");
  475|  7.37k|    xmlOutputBufferWriteString(buf, (const char *) attr->elem);
  476|  7.37k|    xmlOutputBufferWrite(buf, 1, " ");
  477|  7.37k|    if (attr->prefix != NULL) {
  ------------------
  |  Branch (477:9): [True: 2.60k, False: 4.77k]
  ------------------
  478|  2.60k|	xmlOutputBufferWriteString(buf, (const char *) attr->prefix);
  479|  2.60k|	xmlOutputBufferWrite(buf, 1, ":");
  480|  2.60k|    }
  481|  7.37k|    xmlOutputBufferWriteString(buf, (const char *) attr->name);
  482|       |
  483|  7.37k|    switch (attr->atype) {
  484|  1.05k|	case XML_ATTRIBUTE_CDATA:
  ------------------
  |  Branch (484:2): [True: 1.05k, False: 6.31k]
  ------------------
  485|  1.05k|	    xmlOutputBufferWrite(buf, 6, " CDATA");
  486|  1.05k|	    break;
  487|  1.10k|	case XML_ATTRIBUTE_ID:
  ------------------
  |  Branch (487:2): [True: 1.10k, False: 6.26k]
  ------------------
  488|  1.10k|	    xmlOutputBufferWrite(buf, 3, " ID");
  489|  1.10k|	    break;
  490|    515|	case XML_ATTRIBUTE_IDREF:
  ------------------
  |  Branch (490:2): [True: 515, False: 6.85k]
  ------------------
  491|    515|	    xmlOutputBufferWrite(buf, 6, " IDREF");
  492|    515|	    break;
  493|    403|	case XML_ATTRIBUTE_IDREFS:
  ------------------
  |  Branch (493:2): [True: 403, False: 6.97k]
  ------------------
  494|    403|	    xmlOutputBufferWrite(buf, 7, " IDREFS");
  495|    403|	    break;
  496|    609|	case XML_ATTRIBUTE_ENTITY:
  ------------------
  |  Branch (496:2): [True: 609, False: 6.76k]
  ------------------
  497|    609|	    xmlOutputBufferWrite(buf, 7, " ENTITY");
  498|    609|	    break;
  499|    513|	case XML_ATTRIBUTE_ENTITIES:
  ------------------
  |  Branch (499:2): [True: 513, False: 6.86k]
  ------------------
  500|    513|	    xmlOutputBufferWrite(buf, 9, " ENTITIES");
  501|    513|	    break;
  502|    304|	case XML_ATTRIBUTE_NMTOKEN:
  ------------------
  |  Branch (502:2): [True: 304, False: 7.06k]
  ------------------
  503|    304|	    xmlOutputBufferWrite(buf, 8, " NMTOKEN");
  504|    304|	    break;
  505|    228|	case XML_ATTRIBUTE_NMTOKENS:
  ------------------
  |  Branch (505:2): [True: 228, False: 7.14k]
  ------------------
  506|    228|	    xmlOutputBufferWrite(buf, 9, " NMTOKENS");
  507|    228|	    break;
  508|  2.35k|	case XML_ATTRIBUTE_ENUMERATION:
  ------------------
  |  Branch (508:2): [True: 2.35k, False: 5.02k]
  ------------------
  509|  2.35k|	    xmlOutputBufferWrite(buf, 2, " (");
  510|  2.35k|	    xmlBufDumpEnumeration(buf, attr->tree);
  511|  2.35k|	    break;
  512|    289|	case XML_ATTRIBUTE_NOTATION:
  ------------------
  |  Branch (512:2): [True: 289, False: 7.08k]
  ------------------
  513|    289|	    xmlOutputBufferWrite(buf, 11, " NOTATION (");
  514|    289|	    xmlBufDumpEnumeration(buf, attr->tree);
  515|    289|	    break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 7.37k]
  ------------------
  517|       |            /* assert(0); */
  518|      0|            break;
  519|  7.37k|    }
  520|       |
  521|  7.37k|    switch (attr->def) {
  522|  4.46k|	case XML_ATTRIBUTE_NONE:
  ------------------
  |  Branch (522:2): [True: 4.46k, False: 2.90k]
  ------------------
  523|  4.46k|	    break;
  524|    802|	case XML_ATTRIBUTE_REQUIRED:
  ------------------
  |  Branch (524:2): [True: 802, False: 6.57k]
  ------------------
  525|    802|	    xmlOutputBufferWrite(buf, 10, " #REQUIRED");
  526|    802|	    break;
  527|    688|	case XML_ATTRIBUTE_IMPLIED:
  ------------------
  |  Branch (527:2): [True: 688, False: 6.68k]
  ------------------
  528|    688|	    xmlOutputBufferWrite(buf, 9, " #IMPLIED");
  529|    688|	    break;
  530|  1.41k|	case XML_ATTRIBUTE_FIXED:
  ------------------
  |  Branch (530:2): [True: 1.41k, False: 5.95k]
  ------------------
  531|  1.41k|	    xmlOutputBufferWrite(buf, 7, " #FIXED");
  532|  1.41k|	    break;
  533|      0|	default:
  ------------------
  |  Branch (533:2): [True: 0, False: 7.37k]
  ------------------
  534|       |            /* assert(0); */
  535|      0|            break;
  536|  7.37k|    }
  537|       |
  538|  7.37k|    if (attr->defaultValue != NULL) {
  ------------------
  |  Branch (538:9): [True: 3.16k, False: 4.20k]
  ------------------
  539|  3.16k|        xmlOutputBufferWrite(buf, 2, " \"");
  540|  3.16k|        xmlSaveWriteText(ctxt, attr->defaultValue, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  3.16k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  541|  3.16k|        xmlOutputBufferWrite(buf, 1, "\"");
  542|  3.16k|    }
  543|       |
  544|  7.37k|    xmlOutputBufferWrite(buf, 2, ">\n");
  545|  7.37k|}
xmlsave.c:xmlBufDumpEnumeration:
  452|  2.63k|xmlBufDumpEnumeration(xmlOutputBufferPtr buf, xmlEnumerationPtr cur) {
  453|  6.21k|    while (cur != NULL) {
  ------------------
  |  Branch (453:12): [True: 3.57k, False: 2.63k]
  ------------------
  454|  3.57k|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  455|  3.57k|        if (cur->next != NULL)
  ------------------
  |  Branch (455:13): [True: 933, False: 2.63k]
  ------------------
  456|    933|            xmlOutputBufferWrite(buf, 3, " | ");
  457|       |
  458|  3.57k|        cur = cur->next;
  459|  3.57k|    }
  460|       |
  461|  2.63k|    xmlOutputBufferWrite(buf, 1, ")");
  462|  2.63k|}
xmlsave.c:xmlBufDumpEntityDecl:
  592|  3.87k|xmlBufDumpEntityDecl(xmlOutputBufferPtr buf, xmlEntityPtr ent) {
  593|  3.87k|    if ((ent->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
  ------------------
  |  Branch (593:9): [True: 343, False: 3.53k]
  ------------------
  594|  3.53k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY))
  ------------------
  |  Branch (594:9): [True: 77, False: 3.45k]
  ------------------
  595|    420|        xmlOutputBufferWrite(buf, 11, "<!ENTITY % ");
  596|  3.45k|    else
  597|  3.45k|        xmlOutputBufferWrite(buf, 9, "<!ENTITY ");
  598|  3.87k|    xmlOutputBufferWriteString(buf, (const char *) ent->name);
  599|  3.87k|    xmlOutputBufferWrite(buf, 1, " ");
  600|       |
  601|  3.87k|    if ((ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
  ------------------
  |  Branch (601:9): [True: 1.21k, False: 2.66k]
  ------------------
  602|  2.66k|        (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) ||
  ------------------
  |  Branch (602:9): [True: 486, False: 2.18k]
  ------------------
  603|  2.18k|        (ent->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (603:9): [True: 77, False: 2.10k]
  ------------------
  604|  1.77k|        if (ent->ExternalID != NULL) {
  ------------------
  |  Branch (604:13): [True: 484, False: 1.29k]
  ------------------
  605|    484|             xmlOutputBufferWrite(buf, 7, "PUBLIC ");
  606|    484|             xmlOutputBufferWriteQuotedString(buf, ent->ExternalID);
  607|    484|             xmlOutputBufferWrite(buf, 1, " ");
  608|  1.29k|        } else {
  609|  1.29k|             xmlOutputBufferWrite(buf, 7, "SYSTEM ");
  610|  1.29k|        }
  611|  1.77k|        xmlOutputBufferWriteQuotedString(buf, ent->SystemID);
  612|  1.77k|    }
  613|       |
  614|  3.87k|    if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
  ------------------
  |  Branch (614:9): [True: 486, False: 3.39k]
  ------------------
  615|    486|        if (ent->content != NULL) { /* Should be true ! */
  ------------------
  |  Branch (615:13): [True: 351, False: 135]
  ------------------
  616|    351|            xmlOutputBufferWrite(buf, 7, " NDATA ");
  617|    351|            if (ent->orig != NULL)
  ------------------
  |  Branch (617:17): [True: 106, False: 245]
  ------------------
  618|    106|                xmlOutputBufferWriteString(buf, (const char *) ent->orig);
  619|    245|            else
  620|    245|                xmlOutputBufferWriteString(buf, (const char *) ent->content);
  621|    351|        }
  622|    486|    }
  623|       |
  624|  3.87k|    if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
  ------------------
  |  Branch (624:9): [True: 1.76k, False: 2.11k]
  ------------------
  625|  2.11k|        (ent->etype == XML_INTERNAL_PARAMETER_ENTITY)) {
  ------------------
  |  Branch (625:9): [True: 343, False: 1.77k]
  ------------------
  626|       |        /*
  627|       |         * We could save the original quote character and avoid
  628|       |         * calling xmlOutputBufferWriteQuotedString here.
  629|       |         */
  630|  2.10k|        if (ent->orig != NULL)
  ------------------
  |  Branch (630:13): [True: 2.07k, False: 27]
  ------------------
  631|  2.07k|            xmlOutputBufferWriteQuotedString(buf, ent->orig);
  632|     27|        else
  633|     27|            xmlBufDumpEntityContent(buf, ent->content);
  634|  2.10k|    }
  635|       |
  636|  3.87k|    xmlOutputBufferWrite(buf, 2, ">\n");
  637|  3.87k|}
xmlsave.c:xmlBufDumpEntityContent:
  555|     27|xmlBufDumpEntityContent(xmlOutputBufferPtr buf, const xmlChar *content) {
  556|     27|    const char * base, *cur;
  557|       |
  558|     27|    if (content == NULL)
  ------------------
  |  Branch (558:9): [True: 0, False: 27]
  ------------------
  559|      0|        return;
  560|       |
  561|     27|    xmlOutputBufferWrite(buf, 1, "\"");
  562|     27|    base = cur = (const char *) content;
  563|    323|    while (*cur != 0) {
  ------------------
  |  Branch (563:12): [True: 296, False: 27]
  ------------------
  564|    296|        if (*cur == '"') {
  ------------------
  |  Branch (564:13): [True: 0, False: 296]
  ------------------
  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|    296|        } else if (*cur == '%') {
  ------------------
  |  Branch (570:20): [True: 0, False: 296]
  ------------------
  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|    296|        } else {
  577|    296|            cur++;
  578|    296|        }
  579|    296|    }
  580|     27|    if (base != cur)
  ------------------
  |  Branch (580:9): [True: 27, False: 0]
  ------------------
  581|     27|        xmlOutputBufferWrite(buf, cur - base, base);
  582|     27|    xmlOutputBufferWrite(buf, 1, "\"");
  583|     27|}
xmlsave.c:xmlNsListDumpOutputCtxt:
  799|   998k|xmlNsListDumpOutputCtxt(xmlSaveCtxtPtr ctxt, xmlNsPtr cur) {
  800|  2.00M|    while (cur != NULL) {
  ------------------
  |  Branch (800:12): [True: 1.00M, False: 998k]
  ------------------
  801|  1.00M|        xmlNsDumpOutput(ctxt->buf, cur, ctxt);
  802|  1.00M|	cur = cur->next;
  803|  1.00M|    }
  804|   998k|}
xmlsave.c:xhtmlAttrListDumpOutput:
 1421|  9.17k|xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 1422|  9.17k|    xmlAttrPtr xml_lang = NULL;
 1423|  9.17k|    xmlAttrPtr lang = NULL;
 1424|  9.17k|    xmlAttrPtr name = NULL;
 1425|  9.17k|    xmlAttrPtr id = NULL;
 1426|  9.17k|    xmlNodePtr parent;
 1427|  9.17k|    xmlOutputBufferPtr buf;
 1428|       |
 1429|  9.17k|    if (cur == NULL) return;
  ------------------
  |  Branch (1429:9): [True: 0, False: 9.17k]
  ------------------
 1430|  9.17k|    buf = ctxt->buf;
 1431|  9.17k|    parent = cur->parent;
 1432|  31.9k|    while (cur != NULL) {
  ------------------
  |  Branch (1432:12): [True: 22.7k, False: 9.17k]
  ------------------
 1433|  22.7k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "id")))
  ------------------
  |  |   34|  21.0k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1433:6): [True: 21.0k, False: 1.75k]
  |  Branch (1433:27): [True: 480, False: 20.5k]
  ------------------
 1434|    480|	    id = cur;
 1435|  22.3k|	else
 1436|  22.3k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "name")))
  ------------------
  |  |   34|  20.5k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1436:6): [True: 20.5k, False: 1.75k]
  |  Branch (1436:27): [True: 2.44k, False: 18.1k]
  ------------------
 1437|  2.44k|	    name = cur;
 1438|  19.8k|	else
 1439|  19.8k|	if ((cur->ns == NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")))
  ------------------
  |  |   34|  18.1k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1439:6): [True: 18.1k, False: 1.75k]
  |  Branch (1439:27): [True: 627, False: 17.4k]
  ------------------
 1440|    627|	    lang = cur;
 1441|  19.2k|	else
 1442|  19.2k|	if ((cur->ns != NULL) && (xmlStrEqual(cur->name, BAD_CAST "lang")) &&
  ------------------
  |  |   34|  1.75k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1442:6): [True: 1.75k, False: 17.4k]
  |  Branch (1442:27): [True: 863, False: 887]
  ------------------
 1443|    863|	    (xmlStrEqual(cur->ns->prefix, BAD_CAST "xml")))
  ------------------
  |  |   34|    863|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1443:6): [True: 651, False: 212]
  ------------------
 1444|    651|	    xml_lang = cur;
 1445|  22.7k|        xmlAttrDumpOutput(ctxt, cur);
 1446|  22.7k|	cur = cur->next;
 1447|  22.7k|    }
 1448|       |    /*
 1449|       |     * C.8
 1450|       |     */
 1451|  9.17k|    if ((name != NULL) && (id == NULL)) {
  ------------------
  |  Branch (1451:9): [True: 2.44k, False: 6.73k]
  |  Branch (1451:27): [True: 2.17k, False: 268]
  ------------------
 1452|  2.17k|	if ((parent != NULL) && (parent->name != NULL) &&
  ------------------
  |  Branch (1452:6): [True: 2.17k, False: 0]
  |  Branch (1452:26): [True: 2.17k, False: 0]
  ------------------
 1453|  2.17k|	    ((xmlStrEqual(parent->name, BAD_CAST "a")) ||
  ------------------
  |  |   34|  2.17k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1453:7): [True: 571, False: 1.60k]
  ------------------
 1454|  1.60k|	     (xmlStrEqual(parent->name, BAD_CAST "p")) ||
  ------------------
  |  |   34|  1.60k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1454:7): [True: 73, False: 1.52k]
  ------------------
 1455|  1.52k|	     (xmlStrEqual(parent->name, BAD_CAST "div")) ||
  ------------------
  |  |   34|  1.52k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1455:7): [True: 221, False: 1.30k]
  ------------------
 1456|  1.30k|	     (xmlStrEqual(parent->name, BAD_CAST "img")) ||
  ------------------
  |  |   34|  1.30k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1456:7): [True: 204, False: 1.10k]
  ------------------
 1457|  1.10k|	     (xmlStrEqual(parent->name, BAD_CAST "map")) ||
  ------------------
  |  |   34|  1.10k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1457:7): [True: 66, False: 1.03k]
  ------------------
 1458|  1.03k|	     (xmlStrEqual(parent->name, BAD_CAST "applet")) ||
  ------------------
  |  |   34|  1.03k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1458:7): [True: 201, False: 837]
  ------------------
 1459|    837|	     (xmlStrEqual(parent->name, BAD_CAST "form")) ||
  ------------------
  |  |   34|    837|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1459:7): [True: 217, False: 620]
  ------------------
 1460|    620|	     (xmlStrEqual(parent->name, BAD_CAST "frame")) ||
  ------------------
  |  |   34|    620|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1460:7): [True: 201, False: 419]
  ------------------
 1461|  1.95k|	     (xmlStrEqual(parent->name, BAD_CAST "iframe")))) {
  ------------------
  |  |   34|    419|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1461:7): [True: 197, False: 222]
  ------------------
 1462|  1.95k|	    xmlOutputBufferWrite(buf, 5, " id=\"");
 1463|  1.95k|            xmlSaveWriteAttrContent(ctxt, name);
 1464|  1.95k|	    xmlOutputBufferWrite(buf, 1, "\"");
 1465|  1.95k|	}
 1466|  2.17k|    }
 1467|       |    /*
 1468|       |     * C.7.
 1469|       |     */
 1470|  9.17k|    if ((lang != NULL) && (xml_lang == NULL)) {
  ------------------
  |  Branch (1470:9): [True: 577, False: 8.60k]
  |  Branch (1470:27): [True: 305, False: 272]
  ------------------
 1471|    305|	xmlOutputBufferWrite(buf, 11, " xml:lang=\"");
 1472|    305|        xmlSaveWriteAttrContent(ctxt, lang);
 1473|    305|	xmlOutputBufferWrite(buf, 1, "\"");
 1474|    305|    } else
 1475|  8.87k|    if ((xml_lang != NULL) && (lang == NULL)) {
  ------------------
  |  Branch (1475:9): [True: 531, False: 8.34k]
  |  Branch (1475:31): [True: 259, False: 272]
  ------------------
 1476|    259|	xmlOutputBufferWrite(buf, 7, " lang=\"");
 1477|    259|        xmlSaveWriteAttrContent(ctxt, xml_lang);
 1478|    259|	xmlOutputBufferWrite(buf, 1, "\"");
 1479|    259|    }
 1480|  9.17k|}
xmlsave.c:xmlSaveWriteAttrContent:
  241|  42.0k|{
  242|  42.0k|    xmlNodePtr children;
  243|  42.0k|    xmlOutputBufferPtr buf = ctxt->buf;
  244|       |
  245|  42.0k|    children = attr->children;
  246|  76.2k|    while (children != NULL) {
  ------------------
  |  Branch (246:12): [True: 34.2k, False: 42.0k]
  ------------------
  247|  34.2k|        switch (children->type) {
  248|  33.8k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (248:13): [True: 33.8k, False: 385]
  ------------------
  249|  33.8k|	        xmlSaveWriteText(ctxt, children->content, XML_ESCAPE_ATTR);
  ------------------
  |  |   22|  33.8k|#define XML_ESCAPE_ATTR             (1u << 0)
  ------------------
  250|  33.8k|		break;
  251|    385|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (251:13): [True: 385, False: 33.8k]
  ------------------
  252|    385|                xmlOutputBufferWrite(buf, 1, "&");
  253|    385|                xmlOutputBufferWriteString(buf, (const char *) children->name);
  254|    385|                xmlOutputBufferWrite(buf, 1, ";");
  255|    385|                break;
  256|      0|            default:
  ------------------
  |  Branch (256:13): [True: 0, False: 34.2k]
  ------------------
  257|       |                /* should not happen unless we have a badly built tree */
  258|      0|                break;
  259|  34.2k|        }
  260|  34.2k|        children = children->next;
  261|  34.2k|    }
  262|  42.0k|}
xmlsave.c:xhtmlIsEmpty:
 1356|  16.1k|xhtmlIsEmpty(xmlNodePtr node) {
 1357|  16.1k|    if (node == NULL)
  ------------------
  |  Branch (1357:9): [True: 0, False: 16.1k]
  ------------------
 1358|      0|	return(-1);
 1359|  16.1k|    if (node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (1359:9): [True: 0, False: 16.1k]
  ------------------
 1360|      0|	return(0);
 1361|  16.1k|    if ((node->ns != NULL) && (!xmlStrEqual(node->ns->href, XHTML_NS_NAME)))
  ------------------
  |  |   33|  1.65k|#define XHTML_NS_NAME BAD_CAST "http://www.w3.org/1999/xhtml"
  |  |  ------------------
  |  |  |  |   34|  1.65k|#define BAD_CAST (xmlChar *)
  |  |  ------------------
  ------------------
  |  Branch (1361:9): [True: 1.65k, False: 14.4k]
  |  Branch (1361:31): [True: 1.43k, False: 225]
  ------------------
 1362|  1.43k|	return(0);
 1363|  14.7k|    if (node->children != NULL)
  ------------------
  |  Branch (1363:9): [True: 0, False: 14.7k]
  ------------------
 1364|      0|	return(0);
 1365|  14.7k|    switch (node->name ? node->name[0] : 0) {
  ------------------
  |  Branch (1365:13): [True: 14.7k, False: 0]
  |  Branch (1365:13): [True: 11.2k, False: 3.40k]
  ------------------
 1366|  4.62k|	case 'a':
  ------------------
  |  Branch (1366:2): [True: 4.62k, False: 10.0k]
  ------------------
 1367|  4.62k|	    if (xmlStrEqual(node->name, BAD_CAST "area"))
  ------------------
  |  |   34|  4.62k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1367:10): [True: 208, False: 4.41k]
  ------------------
 1368|    208|		return(1);
 1369|  4.41k|	    return(0);
 1370|    968|	case 'b':
  ------------------
  |  Branch (1370:2): [True: 968, False: 13.7k]
  ------------------
 1371|    968|	    if (xmlStrEqual(node->name, BAD_CAST "br"))
  ------------------
  |  |   34|    968|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1371:10): [True: 84, False: 884]
  ------------------
 1372|     84|		return(1);
 1373|    884|	    if (xmlStrEqual(node->name, BAD_CAST "base"))
  ------------------
  |  |   34|    884|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1373:10): [True: 224, False: 660]
  ------------------
 1374|    224|		return(1);
 1375|    660|	    if (xmlStrEqual(node->name, BAD_CAST "basefont"))
  ------------------
  |  |   34|    660|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1375:10): [True: 216, False: 444]
  ------------------
 1376|    216|		return(1);
 1377|    444|	    return(0);
 1378|    521|	case 'c':
  ------------------
  |  Branch (1378:2): [True: 521, False: 14.1k]
  ------------------
 1379|    521|	    if (xmlStrEqual(node->name, BAD_CAST "col"))
  ------------------
  |  |   34|    521|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1379:10): [True: 196, False: 325]
  ------------------
 1380|    196|		return(1);
 1381|    325|	    return(0);
 1382|    777|	case 'f':
  ------------------
  |  Branch (1382:2): [True: 777, False: 13.9k]
  ------------------
 1383|    777|	    if (xmlStrEqual(node->name, BAD_CAST "frame"))
  ------------------
  |  |   34|    777|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1383:10): [True: 306, False: 471]
  ------------------
 1384|    306|		return(1);
 1385|    471|	    return(0);
 1386|    741|	case 'h':
  ------------------
  |  Branch (1386:2): [True: 741, False: 13.9k]
  ------------------
 1387|    741|	    if (xmlStrEqual(node->name, BAD_CAST "hr"))
  ------------------
  |  |   34|    741|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1387:10): [True: 219, False: 522]
  ------------------
 1388|    219|		return(1);
 1389|    522|	    return(0);
 1390|  1.73k|	case 'i':
  ------------------
  |  Branch (1390:2): [True: 1.73k, False: 12.9k]
  ------------------
 1391|  1.73k|	    if (xmlStrEqual(node->name, BAD_CAST "img"))
  ------------------
  |  |   34|  1.73k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1391:10): [True: 890, False: 840]
  ------------------
 1392|    890|		return(1);
 1393|    840|	    if (xmlStrEqual(node->name, BAD_CAST "input"))
  ------------------
  |  |   34|    840|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1393:10): [True: 195, False: 645]
  ------------------
 1394|    195|		return(1);
 1395|    645|	    if (xmlStrEqual(node->name, BAD_CAST "isindex"))
  ------------------
  |  |   34|    645|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1395:10): [True: 218, False: 427]
  ------------------
 1396|    218|		return(1);
 1397|    427|	    return(0);
 1398|    346|	case 'l':
  ------------------
  |  Branch (1398:2): [True: 346, False: 14.3k]
  ------------------
 1399|    346|	    if (xmlStrEqual(node->name, BAD_CAST "link"))
  ------------------
  |  |   34|    346|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1399:10): [True: 68, False: 278]
  ------------------
 1400|     68|		return(1);
 1401|    278|	    return(0);
 1402|    854|	case 'm':
  ------------------
  |  Branch (1402:2): [True: 854, False: 13.8k]
  ------------------
 1403|    854|	    if (xmlStrEqual(node->name, BAD_CAST "meta"))
  ------------------
  |  |   34|    854|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1403:10): [True: 93, False: 761]
  ------------------
 1404|     93|		return(1);
 1405|    761|	    return(0);
 1406|    738|	case 'p':
  ------------------
  |  Branch (1406:2): [True: 738, False: 13.9k]
  ------------------
 1407|    738|	    if (xmlStrEqual(node->name, BAD_CAST "param"))
  ------------------
  |  |   34|    738|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (1407:10): [True: 198, False: 540]
  ------------------
 1408|    198|		return(1);
 1409|    540|	    return(0);
 1410|  14.7k|    }
 1411|  3.40k|    return(0);
 1412|  14.7k|}
xmlsave.c:xmlSaveWriteText:
  226|  1.06M|xmlSaveWriteText(xmlSaveCtxt *ctxt, const xmlChar *text, unsigned flags) {
  227|  1.06M|    if (ctxt->encoding == NULL)
  ------------------
  |  Branch (227:9): [True: 0, False: 1.06M]
  ------------------
  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|  1.06M|}
xmlsave.c:xmlAttrDumpOutput:
  881|  39.7k|xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
  882|  39.7k|    xmlOutputBufferPtr buf;
  883|       |
  884|  39.7k|    if (cur == NULL) return;
  ------------------
  |  Branch (884:9): [True: 0, False: 39.7k]
  ------------------
  885|  39.7k|    buf = ctxt->buf;
  886|  39.7k|    if (buf == NULL) return;
  ------------------
  |  Branch (886:9): [True: 0, False: 39.7k]
  ------------------
  887|  39.7k|    if (ctxt->format == 2)
  ------------------
  |  Branch (887:9): [True: 0, False: 39.7k]
  ------------------
  888|      0|        xmlOutputBufferWriteWSNonSig(ctxt, 2);
  889|  39.7k|    else
  890|  39.7k|        xmlOutputBufferWrite(buf, 1, " ");
  891|  39.7k|    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (891:9): [True: 7.07k, False: 32.6k]
  |  Branch (891:30): [True: 6.53k, False: 539]
  ------------------
  892|  6.53k|        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
  893|  6.53k|	xmlOutputBufferWrite(buf, 1, ":");
  894|  6.53k|    }
  895|  39.7k|    xmlOutputBufferWriteString(buf, (const char *)cur->name);
  896|  39.7k|    xmlOutputBufferWrite(buf, 2, "=\"");
  897|  39.7k|#ifdef LIBXML_HTML_ENABLED
  898|  39.7k|    if ((ctxt->options & XML_SAVE_XHTML) &&
  ------------------
  |  Branch (898:9): [True: 22.7k, False: 16.9k]
  ------------------
  899|  22.7k|        (cur->ns == NULL) &&
  ------------------
  |  Branch (899:9): [True: 21.0k, False: 1.75k]
  ------------------
  900|  21.0k|        ((cur->children == NULL) ||
  ------------------
  |  Branch (900:10): [True: 7.45k, False: 13.5k]
  ------------------
  901|  13.5k|         (cur->children->content == NULL) ||
  ------------------
  |  Branch (901:10): [True: 0, False: 13.5k]
  ------------------
  902|  13.5k|         (cur->children->content[0] == 0)) &&
  ------------------
  |  Branch (902:10): [True: 9.82k, False: 3.75k]
  ------------------
  903|  17.2k|        (htmlIsBooleanAttr(cur->name))) {
  ------------------
  |  Branch (903:9): [True: 223, False: 17.0k]
  ------------------
  904|    223|        xmlOutputBufferWriteString(buf, (const char *) cur->name);
  905|    223|    } else
  906|  39.5k|#endif
  907|  39.5k|    {
  908|  39.5k|        xmlSaveWriteAttrContent(ctxt, cur);
  909|  39.5k|    }
  910|  39.7k|    xmlOutputBufferWrite(buf, 1, "\"");
  911|  39.7k|}
xmlsave.c:xmlNodeDumpOutputInternal:
  961|  42.8k|xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  962|  42.8k|    int format = ctxt->format;
  963|  42.8k|    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
  964|  42.8k|    xmlAttrPtr attr;
  965|  42.8k|    xmlChar *start, *end;
  966|  42.8k|    xmlOutputBufferPtr buf;
  967|       |
  968|  42.8k|    if (cur == NULL) return;
  ------------------
  |  Branch (968:9): [True: 0, False: 42.8k]
  ------------------
  969|  42.8k|    buf = ctxt->buf;
  970|       |
  971|  42.8k|    root = cur;
  972|  42.8k|    parent = cur->parent;
  973|  4.03M|    while (1) {
  ------------------
  |  Branch (973:12): [True: 4.03M, Folded]
  ------------------
  974|  4.03M|        switch (cur->type) {
  975|  1.14k|        case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (975:9): [True: 1.14k, False: 4.03M]
  ------------------
  976|  1.14k|        case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (976:9): [True: 0, False: 4.03M]
  ------------------
  977|  1.14k|	    xmlSaveDocInternal(ctxt, (xmlDocPtr) cur, ctxt->encoding);
  978|  1.14k|	    break;
  979|       |
  980|  9.40k|        case XML_DTD_NODE:
  ------------------
  |  Branch (980:9): [True: 9.40k, False: 4.02M]
  ------------------
  981|  9.40k|            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
  982|  9.40k|            break;
  983|       |
  984|      0|        case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (984:9): [True: 0, False: 4.03M]
  ------------------
  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.35k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (993:9): [True: 6.35k, False: 4.03M]
  ------------------
  994|  6.35k|            xmlBufDumpElementDecl(buf, (xmlElementPtr) cur);
  995|  6.35k|            break;
  996|       |
  997|  7.37k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (997:9): [True: 7.37k, False: 4.03M]
  ------------------
  998|  7.37k|            xmlSaveWriteAttributeDecl(ctxt, (xmlAttributePtr) cur);
  999|  7.37k|            break;
 1000|       |
 1001|  3.87k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (1001:9): [True: 3.87k, False: 4.03M]
  ------------------
 1002|  3.87k|            xmlBufDumpEntityDecl(buf, (xmlEntityPtr) cur);
 1003|  3.87k|            break;
 1004|       |
 1005|  2.00M|        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (1005:9): [True: 2.00M, False: 2.02M]
  ------------------
 1006|  2.00M|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1006:10): [True: 2.00M, False: 4.71k]
  |  Branch (1006:27): [True: 0, False: 2.00M]
  ------------------
 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|  2.00M|            if ((cur->parent != parent) && (cur->children != NULL)) {
  ------------------
  |  Branch (1014:17): [True: 0, False: 2.00M]
  |  Branch (1014:44): [True: 0, False: 0]
  ------------------
 1015|      0|                xmlNodeDumpOutputInternal(ctxt, cur);
 1016|      0|                break;
 1017|      0|            }
 1018|       |
 1019|  2.00M|            xmlOutputBufferWrite(buf, 1, "<");
 1020|  2.00M|            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1020:17): [True: 13.9k, False: 1.99M]
  |  Branch (1020:38): [True: 7.74k, False: 6.17k]
  ------------------
 1021|  7.74k|                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
 1022|  7.74k|                xmlOutputBufferWrite(buf, 1, ":");
 1023|  7.74k|            }
 1024|  2.00M|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1025|  2.00M|            if (cur->nsDef)
  ------------------
  |  Branch (1025:17): [True: 994k, False: 1.01M]
  ------------------
 1026|   994k|                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
 1027|  2.02M|            for (attr = cur->properties; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (1027:42): [True: 16.9k, False: 2.00M]
  ------------------
 1028|  16.9k|                xmlAttrDumpOutput(ctxt, attr);
 1029|       |
 1030|  2.00M|            if (cur->children == NULL) {
  ------------------
  |  Branch (1030:17): [True: 13.7k, False: 1.99M]
  ------------------
 1031|  13.7k|                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
  ------------------
  |  Branch (1031:21): [True: 13.7k, False: 0]
  ------------------
 1032|  13.7k|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1032:25): [True: 0, False: 13.7k]
  ------------------
 1033|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1034|  13.7k|                    xmlOutputBufferWrite(buf, 2, "/>");
 1035|  13.7k|                } 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.99M|            } else {
 1050|  1.99M|                if (ctxt->format == 1) {
  ------------------
  |  Branch (1050:21): [True: 0, False: 1.99M]
  ------------------
 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.99M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1063:21): [True: 0, False: 1.99M]
  ------------------
 1064|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
 1065|  1.99M|                xmlOutputBufferWrite(buf, 1, ">");
 1066|  1.99M|                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
  ------------------
  |  Branch (1066:21): [True: 0, False: 1.99M]
  ------------------
 1067|  1.99M|                if (ctxt->level >= 0) ctxt->level++;
  ------------------
  |  Branch (1067:21): [True: 1.99M, False: 0]
  ------------------
 1068|  1.99M|                parent = cur;
 1069|  1.99M|                cur = cur->children;
 1070|  1.99M|                continue;
 1071|  1.99M|            }
 1072|       |
 1073|  13.7k|            break;
 1074|       |
 1075|  1.00M|        case XML_TEXT_NODE:
  ------------------
  |  Branch (1075:9): [True: 1.00M, False: 3.03M]
  ------------------
 1076|  1.00M|	    if (cur->content == NULL)
  ------------------
  |  Branch (1076:10): [True: 212, False: 1.00M]
  ------------------
 1077|    212|                break;
 1078|  1.00M|	    if (cur->name != xmlStringTextNoenc) {
  ------------------
  |  Branch (1078:10): [True: 1.00M, False: 0]
  ------------------
 1079|  1.00M|                if (ctxt->escape)
  ------------------
  |  Branch (1079:21): [True: 0, False: 1.00M]
  ------------------
 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|  1.00M|                else
 1087|  1.00M|                    xmlSaveWriteText(ctxt, cur->content, /* flags */ 0);
 1088|  1.00M|	    } else {
 1089|       |		/*
 1090|       |		 * Disable escaping, needed for XSLT
 1091|       |		 */
 1092|      0|		xmlOutputBufferWriteString(buf, (const char *) cur->content);
 1093|      0|	    }
 1094|  1.00M|	    break;
 1095|       |
 1096|  1.37k|        case XML_PI_NODE:
  ------------------
  |  Branch (1096:9): [True: 1.37k, False: 4.03M]
  ------------------
 1097|  1.37k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1097:10): [True: 736, False: 642]
  |  Branch (1097:27): [True: 0, False: 736]
  ------------------
 1098|      0|                xmlSaveWriteIndent(ctxt, 0);
 1099|       |
 1100|  1.37k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1100:17): [True: 408, False: 970]
  ------------------
 1101|    408|                xmlOutputBufferWrite(buf, 2, "<?");
 1102|    408|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1103|    408|                if (cur->content != NULL) {
  ------------------
  |  Branch (1103:21): [True: 408, False: 0]
  ------------------
 1104|    408|                    if (ctxt->format == 2)
  ------------------
  |  Branch (1104:25): [True: 0, False: 408]
  ------------------
 1105|      0|                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1106|    408|                    else
 1107|    408|                        xmlOutputBufferWrite(buf, 1, " ");
 1108|    408|                    xmlOutputBufferWriteString(buf,
 1109|    408|                            (const char *)cur->content);
 1110|    408|                }
 1111|    408|                xmlOutputBufferWrite(buf, 2, "?>");
 1112|    970|            } else {
 1113|    970|                xmlOutputBufferWrite(buf, 2, "<?");
 1114|    970|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1115|    970|                if (ctxt->format == 2)
  ------------------
  |  Branch (1115:21): [True: 0, False: 970]
  ------------------
 1116|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1117|    970|                xmlOutputBufferWrite(buf, 2, "?>");
 1118|    970|            }
 1119|  1.37k|            break;
 1120|       |
 1121|  5.36k|        case XML_COMMENT_NODE:
  ------------------
  |  Branch (1121:9): [True: 5.36k, False: 4.03M]
  ------------------
 1122|  5.36k|	    if ((cur != root) && (ctxt->format == 1))
  ------------------
  |  Branch (1122:10): [True: 1.48k, False: 3.87k]
  |  Branch (1122:27): [True: 0, False: 1.48k]
  ------------------
 1123|      0|                xmlSaveWriteIndent(ctxt, 0);
 1124|       |
 1125|  5.36k|            if (cur->content != NULL) {
  ------------------
  |  Branch (1125:17): [True: 5.36k, False: 0]
  ------------------
 1126|  5.36k|                xmlOutputBufferWrite(buf, 4, "<!--");
 1127|  5.36k|                xmlOutputBufferWriteString(buf, (const char *)cur->content);
 1128|  5.36k|                xmlOutputBufferWrite(buf, 3, "-->");
 1129|  5.36k|            }
 1130|  5.36k|            break;
 1131|       |
 1132|  1.17k|        case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (1132:9): [True: 1.17k, False: 4.03M]
  ------------------
 1133|  1.17k|            xmlOutputBufferWrite(buf, 1, "&");
 1134|  1.17k|            xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1135|  1.17k|            xmlOutputBufferWrite(buf, 1, ";");
 1136|  1.17k|            break;
 1137|       |
 1138|    952|        case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (1138:9): [True: 952, False: 4.03M]
  ------------------
 1139|    952|            if (cur->content == NULL || *cur->content == '\0') {
  ------------------
  |  Branch (1139:17): [True: 0, False: 952]
  |  Branch (1139:41): [True: 204, False: 748]
  ------------------
 1140|    204|                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
 1141|    748|            } else {
 1142|    748|                start = end = cur->content;
 1143|  3.16k|                while (*end != '\0') {
  ------------------
  |  Branch (1143:24): [True: 2.42k, False: 748]
  ------------------
 1144|  2.42k|                    if ((*end == ']') && (*(end + 1) == ']') &&
  ------------------
  |  Branch (1144:25): [True: 632, False: 1.78k]
  |  Branch (1144:42): [True: 341, False: 291]
  ------------------
 1145|    341|                        (*(end + 2) == '>')) {
  ------------------
  |  Branch (1145:25): [True: 0, False: 341]
  ------------------
 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.42k|                    end++;
 1154|  2.42k|                }
 1155|    748|                if (start != end) {
  ------------------
  |  Branch (1155:21): [True: 748, False: 0]
  ------------------
 1156|    748|                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
 1157|    748|                    xmlOutputBufferWriteString(buf, (const char *)start);
 1158|    748|                    xmlOutputBufferWrite(buf, 3, "]]>");
 1159|    748|                }
 1160|    748|            }
 1161|    952|            break;
 1162|       |
 1163|      0|        case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (1163:9): [True: 0, False: 4.03M]
  ------------------
 1164|      0|            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
 1165|      0|            break;
 1166|       |
 1167|      0|        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (1167:9): [True: 0, False: 4.03M]
  ------------------
 1168|      0|            xmlNsDumpOutput(buf, (xmlNsPtr) cur, ctxt);
 1169|      0|            break;
 1170|       |
 1171|   989k|        default:
  ------------------
  |  Branch (1171:9): [True: 989k, False: 3.04M]
  ------------------
 1172|   989k|            break;
 1173|  4.03M|        }
 1174|       |
 1175|  4.03M|        while (1) {
  ------------------
  |  Branch (1175:16): [True: 4.03M, Folded]
  ------------------
 1176|  4.03M|            if (cur == root)
  ------------------
  |  Branch (1176:17): [True: 42.8k, False: 3.99M]
  ------------------
 1177|  42.8k|                return;
 1178|  3.99M|            if ((ctxt->format == 1) &&
  ------------------
  |  Branch (1178:17): [True: 0, False: 3.99M]
  ------------------
 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.99M|            if (cur->next != NULL) {
  ------------------
  |  Branch (1182:17): [True: 2.00M, False: 1.99M]
  ------------------
 1183|  2.00M|                cur = cur->next;
 1184|  2.00M|                break;
 1185|  2.00M|            }
 1186|       |
 1187|  1.99M|            cur = parent;
 1188|       |            /* cur->parent was validated when descending. */
 1189|  1.99M|            parent = cur->parent;
 1190|       |
 1191|  1.99M|            if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (1191:17): [True: 1.99M, False: 0]
  ------------------
 1192|  1.99M|                if (ctxt->level > 0) ctxt->level--;
  ------------------
  |  Branch (1192:21): [True: 1.99M, False: 0]
  ------------------
 1193|  1.99M|                if (ctxt->format == 1)
  ------------------
  |  Branch (1193:21): [True: 0, False: 1.99M]
  ------------------
 1194|      0|                    xmlSaveWriteIndent(ctxt, 0);
 1195|       |
 1196|  1.99M|                xmlOutputBufferWrite(buf, 2, "</");
 1197|  1.99M|                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
  ------------------
  |  Branch (1197:21): [True: 8.43k, False: 1.98M]
  |  Branch (1197:42): [True: 3.91k, False: 4.52k]
  ------------------
 1198|  3.91k|                    xmlOutputBufferWriteString(buf,
 1199|  3.91k|                            (const char *)cur->ns->prefix);
 1200|  3.91k|                    xmlOutputBufferWrite(buf, 1, ":");
 1201|  3.91k|                }
 1202|       |
 1203|  1.99M|                xmlOutputBufferWriteString(buf, (const char *)cur->name);
 1204|  1.99M|                if (ctxt->format == 2)
  ------------------
  |  Branch (1204:21): [True: 0, False: 1.99M]
  ------------------
 1205|      0|                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
 1206|  1.99M|                xmlOutputBufferWrite(buf, 1, ">");
 1207|       |
 1208|  1.99M|                if (cur == unformattedNode) {
  ------------------
  |  Branch (1208:21): [True: 0, False: 1.99M]
  ------------------
 1209|      0|                    ctxt->format = format;
 1210|       |                    unformattedNode = NULL;
 1211|      0|                }
 1212|  1.99M|            }
 1213|  1.99M|        }
 1214|  2.04M|    }
 1215|  42.8k|}
xmlsave.c:xmlBufDumpNotationDecl:
  271|  1.46k|xmlBufDumpNotationDecl(xmlOutputBufferPtr buf, xmlNotationPtr nota) {
  272|  1.46k|    xmlOutputBufferWrite(buf, 11, "<!NOTATION ");
  273|  1.46k|    xmlOutputBufferWriteString(buf, (const char *) nota->name);
  274|       |
  275|  1.46k|    if (nota->PublicID != NULL) {
  ------------------
  |  Branch (275:9): [True: 780, False: 682]
  ------------------
  276|    780|	xmlOutputBufferWrite(buf, 8, " PUBLIC ");
  277|    780|	xmlOutputBufferWriteQuotedString(buf, nota->PublicID);
  278|    780|	if (nota->SystemID != NULL) {
  ------------------
  |  Branch (278:6): [True: 71, False: 709]
  ------------------
  279|     71|	    xmlOutputBufferWrite(buf, 1, " ");
  280|     71|	    xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  281|     71|	}
  282|    780|    } else {
  283|    682|	xmlOutputBufferWrite(buf, 8, " SYSTEM ");
  284|    682|	xmlOutputBufferWriteQuotedString(buf, nota->SystemID);
  285|    682|    }
  286|       |
  287|  1.46k|    xmlOutputBufferWrite(buf, 3, " >\n");
  288|  1.46k|}
xmlsave.c:xmlBufDumpNotationTable:
  310|  1.46k|xmlBufDumpNotationTable(xmlOutputBufferPtr buf, xmlNotationTablePtr table) {
  311|  1.46k|    xmlHashScan(table, xmlBufDumpNotationDeclScan, buf);
  312|  1.46k|}
xmlsave.c:xmlBufDumpNotationDeclScan:
  299|  1.46k|                           const xmlChar *name ATTRIBUTE_UNUSED) {
  300|  1.46k|    xmlBufDumpNotationDecl((xmlOutputBufferPtr) buf, (xmlNotationPtr) nota);
  301|  1.46k|}
xmlsave.c:xmlSaveCtxtInit:
  153|  39.0k|{
  154|  39.0k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (154:9): [True: 0, False: 39.0k]
  ------------------
  155|       |
  156|  39.0k|    xmlSaveSetIndentString(ctxt, xmlTreeIndentString);
  ------------------
  |  | 1364|  39.0k|    #define xmlTreeIndentString (*__xmlTreeIndentString())
  ------------------
  157|       |
  158|  39.0k|    if (options & XML_SAVE_FORMAT)
  ------------------
  |  Branch (158:9): [True: 0, False: 39.0k]
  ------------------
  159|      0|        ctxt->format = 1;
  160|  39.0k|    else if (options & XML_SAVE_WSNONSIG)
  ------------------
  |  Branch (160:14): [True: 0, False: 39.0k]
  ------------------
  161|      0|        ctxt->format = 2;
  162|       |
  163|  39.0k|    if (((options & XML_SAVE_EMPTY) == 0) &&
  ------------------
  |  Branch (163:9): [True: 39.0k, False: 0]
  ------------------
  164|  39.0k|        (xmlSaveNoEmptyTags))
  ------------------
  |  | 1372|  39.0k|    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
  ------------------
  |  Branch (164:9): [True: 0, False: 39.0k]
  ------------------
  165|      0|	options |= XML_SAVE_NO_EMPTY;
  166|       |
  167|  39.0k|    ctxt->options = options;
  168|  39.0k|}

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

xmlStrndup:
   50|  35.9M|xmlStrndup(const xmlChar *cur, int len) {
   51|  35.9M|    xmlChar *ret;
   52|       |
   53|  35.9M|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (53:9): [True: 0, False: 35.9M]
  |  Branch (53:26): [True: 0, False: 35.9M]
  ------------------
   54|  35.9M|    ret = xmlMalloc((size_t) len + 1);
   55|  35.9M|    if (ret == NULL) {
  ------------------
  |  Branch (55:9): [True: 3.03k, False: 35.9M]
  ------------------
   56|  3.03k|        return(NULL);
   57|  3.03k|    }
   58|  35.9M|    memcpy(ret, cur, len);
   59|  35.9M|    ret[len] = 0;
   60|  35.9M|    return(ret);
   61|  35.9M|}
xmlStrdup:
   72|  30.4M|xmlStrdup(const xmlChar *cur) {
   73|  30.4M|    const xmlChar *p = cur;
   74|       |
   75|  30.4M|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (75:9): [True: 22, False: 30.4M]
  ------------------
   76|  1.14G|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (76:12): [True: 1.11G, False: 30.4M]
  ------------------
   77|  30.4M|    return(xmlStrndup(cur, p - cur));
   78|  30.4M|}
xmlCharStrndup:
   89|   807k|xmlCharStrndup(const char *cur, int len) {
   90|   807k|    int i;
   91|   807k|    xmlChar *ret;
   92|       |
   93|   807k|    if ((cur == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (93:9): [True: 0, False: 807k]
  |  Branch (93:26): [True: 0, False: 807k]
  ------------------
   94|   807k|    ret = xmlMalloc((size_t) len + 1);
   95|   807k|    if (ret == NULL) {
  ------------------
  |  Branch (95:9): [True: 159, False: 807k]
  ------------------
   96|    159|        return(NULL);
   97|    159|    }
   98|  81.0M|    for (i = 0;i < len;i++) {
  ------------------
  |  Branch (98:16): [True: 80.2M, False: 807k]
  ------------------
   99|       |        /* Explicit sign change */
  100|  80.2M|        ret[i] = (xmlChar) cur[i];
  101|  80.2M|        if (ret[i] == 0) return(ret);
  ------------------
  |  Branch (101:13): [True: 0, False: 80.2M]
  ------------------
  102|  80.2M|    }
  103|   807k|    ret[len] = 0;
  104|   807k|    return(ret);
  105|   807k|}
xmlCharStrdup:
  115|   807k|xmlCharStrdup(const char *cur) {
  116|   807k|    const char *p = cur;
  117|       |
  118|   807k|    if (cur == NULL) return(NULL);
  ------------------
  |  Branch (118:9): [True: 0, False: 807k]
  ------------------
  119|  81.0M|    while (*p != '\0') p++; /* non input consuming */
  ------------------
  |  Branch (119:12): [True: 80.2M, False: 807k]
  ------------------
  120|   807k|    return(xmlCharStrndup(cur, p - cur));
  121|   807k|}
xmlStrcmp:
  132|  3.60k|xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
  133|  3.60k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (133:9): [True: 3.24k, False: 356]
  ------------------
  134|    356|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (134:9): [True: 356, 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|  27.0M|xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
  158|  27.0M|    if (str1 == str2) return(1);
  ------------------
  |  Branch (158:9): [True: 976k, False: 26.0M]
  ------------------
  159|  26.0M|    if (str1 == NULL) return(0);
  ------------------
  |  Branch (159:9): [True: 2.83M, False: 23.2M]
  ------------------
  160|  23.2M|    if (str2 == NULL) return(0);
  ------------------
  |  Branch (160:9): [True: 3.73M, False: 19.4M]
  ------------------
  161|  19.4M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  162|  19.4M|    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|  23.2M|}
xmlStrQEqual:
  181|  52.8k|xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
  182|  52.8k|    if (pref == NULL) return(xmlStrEqual(name, str));
  ------------------
  |  Branch (182:9): [True: 13.3k, False: 39.4k]
  ------------------
  183|  39.4k|    if (name == NULL) return(0);
  ------------------
  |  Branch (183:9): [True: 0, False: 39.4k]
  ------------------
  184|  39.4k|    if (str == NULL) return(0);
  ------------------
  |  Branch (184:9): [True: 0, False: 39.4k]
  ------------------
  185|       |
  186|   114k|    do {
  187|   114k|        if (*pref++ != *str) return(0);
  ------------------
  |  Branch (187:13): [True: 0, False: 114k]
  ------------------
  188|   114k|    } while ((*str++) && (*pref));
  ------------------
  |  Branch (188:14): [True: 114k, False: 0]
  |  Branch (188:26): [True: 75.4k, False: 39.4k]
  ------------------
  189|  39.4k|    if (*str++ != ':') return(0);
  ------------------
  |  Branch (189:9): [True: 0, False: 39.4k]
  ------------------
  190|   191k|    do {
  191|   191k|        if (*name++ != *str) return(0);
  ------------------
  |  Branch (191:13): [True: 0, False: 191k]
  ------------------
  192|   191k|    } while (*str++);
  ------------------
  |  Branch (192:14): [True: 151k, False: 39.4k]
  ------------------
  193|  39.4k|    return(1);
  194|  39.4k|}
xmlStrncmp:
  206|  19.8M|xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
  207|  19.8M|    if (len <= 0) return(0);
  ------------------
  |  Branch (207:9): [True: 37, False: 19.8M]
  ------------------
  208|  19.8M|    if (str1 == str2) return(0);
  ------------------
  |  Branch (208:9): [True: 0, False: 19.8M]
  ------------------
  209|  19.8M|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (209:9): [True: 2, False: 19.8M]
  ------------------
  210|  19.8M|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (210:9): [True: 0, False: 19.8M]
  ------------------
  211|  19.8M|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  212|  19.8M|    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|  19.8M|}
xmlStrcasecmp:
  266|   110k|xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
  267|   110k|    register int tmp;
  268|       |
  269|   110k|    if (str1 == str2) return(0);
  ------------------
  |  Branch (269:9): [True: 0, False: 110k]
  ------------------
  270|   110k|    if (str1 == NULL) return(-1);
  ------------------
  |  Branch (270:9): [True: 0, False: 110k]
  ------------------
  271|   110k|    if (str2 == NULL) return(1);
  ------------------
  |  Branch (271:9): [True: 0, False: 110k]
  ------------------
  272|   266k|    do {
  273|   266k|        tmp = casemap[*str1++] - casemap[*str2];
  274|   266k|        if (tmp != 0) return(tmp);
  ------------------
  |  Branch (274:13): [True: 105k, False: 161k]
  ------------------
  275|   266k|    } while (*str2++ != 0);
  ------------------
  |  Branch (275:14): [True: 156k, False: 5.25k]
  ------------------
  276|  5.25k|    return 0;
  277|   110k|}
xmlStrchr:
  312|  65.7M|xmlStrchr(const xmlChar *str, xmlChar val) {
  313|  65.7M|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (313:9): [True: 0, False: 65.7M]
  ------------------
  314|   325M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (314:12): [True: 259M, False: 65.4M]
  ------------------
  315|   259M|        if (*str == val) return((xmlChar *) str);
  ------------------
  |  Branch (315:13): [True: 282k, False: 259M]
  ------------------
  316|   259M|        str++;
  317|   259M|    }
  318|  65.4M|    return(NULL);
  319|  65.7M|}
xmlStrstr:
  330|   294k|xmlStrstr(const xmlChar *str, const xmlChar *val) {
  331|   294k|    int n;
  332|       |
  333|   294k|    if (str == NULL) return(NULL);
  ------------------
  |  Branch (333:9): [True: 0, False: 294k]
  ------------------
  334|   294k|    if (val == NULL) return(NULL);
  ------------------
  |  Branch (334:9): [True: 0, False: 294k]
  ------------------
  335|   294k|    n = xmlStrlen(val);
  336|       |
  337|   294k|    if (n == 0) return(str);
  ------------------
  |  Branch (337:9): [True: 286, False: 294k]
  ------------------
  338|  2.31M|    while (*str != 0) { /* non input consuming */
  ------------------
  |  Branch (338:12): [True: 2.04M, False: 265k]
  ------------------
  339|  2.04M|        if (*str == *val) {
  ------------------
  |  Branch (339:13): [True: 35.6k, False: 2.01M]
  ------------------
  340|  35.6k|            if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
  ------------------
  |  Branch (340:17): [True: 28.2k, False: 7.41k]
  ------------------
  341|  35.6k|        }
  342|  2.02M|        str++;
  343|  2.02M|    }
  344|   265k|    return(NULL);
  345|   294k|}
xmlStrlen:
  405|  1.76M|xmlStrlen(const xmlChar *str) {
  406|  1.76M|    size_t len = str ? strlen((const char *)str) : 0;
  ------------------
  |  Branch (406:18): [True: 1.76M, False: 2.10k]
  ------------------
  407|  1.76M|    return(len > INT_MAX ? 0 : len);
  ------------------
  |  Branch (407:12): [True: 0, False: 1.76M]
  ------------------
  408|  1.76M|}
xmlStrncat:
  423|   160k|xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
  424|   160k|    int size;
  425|   160k|    xmlChar *ret;
  426|       |
  427|   160k|    if ((add == NULL) || (len == 0))
  ------------------
  |  Branch (427:9): [True: 0, False: 160k]
  |  Branch (427:26): [True: 264, False: 160k]
  ------------------
  428|    264|        return(cur);
  429|       |
  430|   160k|    if (len < 0) {
  ------------------
  |  Branch (430:9): [True: 0, False: 160k]
  ------------------
  431|      0|        if (cur != NULL)
  ------------------
  |  Branch (431:13): [True: 0, False: 0]
  ------------------
  432|      0|            xmlFree(cur);
  433|      0|        return(NULL);
  434|      0|    }
  435|       |
  436|   160k|    if (cur == NULL)
  ------------------
  |  Branch (436:9): [True: 0, False: 160k]
  ------------------
  437|      0|        return(xmlStrndup(add, len));
  438|       |
  439|   160k|    size = xmlStrlen(cur);
  440|   160k|    if ((size < 0) || (size > INT_MAX - len)) {
  ------------------
  |  Branch (440:9): [True: 0, False: 160k]
  |  Branch (440:23): [True: 0, False: 160k]
  ------------------
  441|      0|        xmlFree(cur);
  442|      0|        return(NULL);
  443|      0|    }
  444|   160k|    ret = (xmlChar *) xmlRealloc(cur, (size_t) size + len + 1);
  445|   160k|    if (ret == NULL) {
  ------------------
  |  Branch (445:9): [True: 11, False: 160k]
  ------------------
  446|     11|        xmlFree(cur);
  447|     11|        return(NULL);
  448|     11|    }
  449|   160k|    memcpy(&ret[size], add, len);
  450|   160k|    ret[size + len] = 0;
  451|   160k|    return(ret);
  452|   160k|}
xmlStrncatNew:
  465|     37|xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
  466|     37|    int size;
  467|     37|    xmlChar *ret;
  468|       |
  469|     37|    if (len < 0) {
  ------------------
  |  Branch (469:9): [True: 0, False: 37]
  ------------------
  470|      0|        len = xmlStrlen(str2);
  471|      0|        if (len < 0)
  ------------------
  |  Branch (471:13): [True: 0, False: 0]
  ------------------
  472|      0|            return(NULL);
  473|      0|    }
  474|     37|    if (str1 == NULL)
  ------------------
  |  Branch (474:9): [True: 37, False: 0]
  ------------------
  475|     37|        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|   160k|xmlStrcat(xmlChar *cur, const xmlChar *add) {
  503|   160k|    const xmlChar *p = add;
  504|       |
  505|   160k|    if (add == NULL) return(cur);
  ------------------
  |  Branch (505:9): [True: 2, False: 160k]
  ------------------
  506|   160k|    if (cur == NULL)
  ------------------
  |  Branch (506:9): [True: 4, False: 160k]
  ------------------
  507|      4|        return(xmlStrdup(add));
  508|       |
  509|  2.10M|    while (*p != 0) p++; /* non input consuming */
  ------------------
  |  Branch (509:12): [True: 1.94M, False: 160k]
  ------------------
  510|   160k|    return(xmlStrncat(cur, add, p - add));
  511|   160k|}
xmlStrVASPrintf:
  573|  1.34M|xmlStrVASPrintf(xmlChar **out, int maxSize, const char *msg, va_list ap) {
  574|  1.34M|    char empty[1];
  575|  1.34M|    va_list copy;
  576|  1.34M|    xmlChar *buf;
  577|  1.34M|    int res, size;
  578|  1.34M|    int truncated = 0;
  579|       |
  580|  1.34M|    if (out == NULL)
  ------------------
  |  Branch (580:9): [True: 0, False: 1.34M]
  ------------------
  581|      0|        return(1);
  582|  1.34M|    *out = NULL;
  583|  1.34M|    if (msg == NULL)
  ------------------
  |  Branch (583:9): [True: 0, False: 1.34M]
  ------------------
  584|      0|        return(1);
  585|  1.34M|    if (maxSize < 32)
  ------------------
  |  Branch (585:9): [True: 0, False: 1.34M]
  ------------------
  586|      0|        maxSize = 32;
  587|       |
  588|  1.34M|    va_copy(copy, ap);
  589|  1.34M|    res = vsnprintf(empty, 1, msg, copy);
  590|  1.34M|    va_end(copy);
  591|       |
  592|  1.34M|    if (res > 0) {
  ------------------
  |  Branch (592:9): [True: 1.34M, False: 0]
  ------------------
  593|       |        /* snprintf seems to work according to C99. */
  594|       |
  595|  1.34M|        if (res < maxSize) {
  ------------------
  |  Branch (595:13): [True: 1.34M, False: 305]
  ------------------
  596|  1.34M|            size = res + 1;
  597|  1.34M|        } else {
  598|    305|            size = maxSize;
  599|    305|            truncated = 1;
  600|    305|        }
  601|  1.34M|        buf = xmlMalloc(size);
  602|  1.34M|        if (buf == NULL)
  ------------------
  |  Branch (602:13): [True: 1.48k, False: 1.34M]
  ------------------
  603|  1.48k|            return(-1);
  604|  1.34M|        if (vsnprintf((char *) buf, size, msg, ap) < 0) {
  ------------------
  |  Branch (604:13): [True: 0, False: 1.34M]
  ------------------
  605|      0|            xmlFree(buf);
  606|      0|            return(1);
  607|      0|        }
  608|  1.34M|    } 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.34M|    if (truncated != 0) {
  ------------------
  |  Branch (658:9): [True: 305, False: 1.34M]
  ------------------
  659|    305|        int i = size - 1;
  660|       |
  661|    485|        while (i > 0) {
  ------------------
  |  Branch (661:16): [True: 485, False: 0]
  ------------------
  662|       |            /* Break after ASCII */
  663|    485|            if (buf[i-1] < 0x80)
  ------------------
  |  Branch (663:17): [True: 149, False: 336]
  ------------------
  664|    149|                break;
  665|    336|            i -= 1;
  666|       |            /* Break before non-ASCII */
  667|    336|            if (buf[i] >= 0xc0)
  ------------------
  |  Branch (667:17): [True: 156, False: 180]
  ------------------
  668|    156|                break;
  669|    336|        }
  670|       |
  671|    305|        buf[i] = 0;
  672|    305|    }
  673|       |
  674|  1.34M|    *out = (xmlChar *) buf;
  675|  1.34M|    return(truncated);
  676|  1.34M|}
xmlUTF8Strlen:
  770|  21.4k|xmlUTF8Strlen(const xmlChar *utf) {
  771|  21.4k|    size_t ret = 0;
  772|       |
  773|  21.4k|    if (utf == NULL)
  ------------------
  |  Branch (773:9): [True: 11, False: 21.4k]
  ------------------
  774|     11|        return(-1);
  775|       |
  776|  1.32M|    while (*utf != 0) {
  ------------------
  |  Branch (776:12): [True: 1.30M, False: 21.4k]
  ------------------
  777|  1.30M|        if (utf[0] & 0x80) {
  ------------------
  |  Branch (777:13): [True: 12.8k, False: 1.28M]
  ------------------
  778|  12.8k|            if ((utf[1] & 0xc0) != 0x80)
  ------------------
  |  Branch (778:17): [True: 0, False: 12.8k]
  ------------------
  779|      0|                return(-1);
  780|  12.8k|            if ((utf[0] & 0xe0) == 0xe0) {
  ------------------
  |  Branch (780:17): [True: 5.06k, False: 7.77k]
  ------------------
  781|  5.06k|                if ((utf[2] & 0xc0) != 0x80)
  ------------------
  |  Branch (781:21): [True: 0, False: 5.06k]
  ------------------
  782|      0|                    return(-1);
  783|  5.06k|                if ((utf[0] & 0xf0) == 0xf0) {
  ------------------
  |  Branch (783:21): [True: 2.89k, False: 2.16k]
  ------------------
  784|  2.89k|                    if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
  ------------------
  |  Branch (784:25): [True: 0, False: 2.89k]
  |  Branch (784:52): [True: 0, False: 2.89k]
  ------------------
  785|      0|                        return(-1);
  786|  2.89k|                    utf += 4;
  787|  2.89k|                } else {
  788|  2.16k|                    utf += 3;
  789|  2.16k|                }
  790|  7.77k|            } else {
  791|  7.77k|                utf += 2;
  792|  7.77k|            }
  793|  1.28M|        } else {
  794|  1.28M|            utf++;
  795|  1.28M|        }
  796|  1.30M|        ret++;
  797|  1.30M|    }
  798|  21.4k|    return(ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (798:12): [True: 0, False: 21.4k]
  ------------------
  799|  21.4k|}
xmlGetUTF8Char:
  812|  24.0M|xmlGetUTF8Char(const unsigned char *utf, int *len) {
  813|  24.0M|    unsigned int c;
  814|       |
  815|  24.0M|    if (utf == NULL)
  ------------------
  |  Branch (815:9): [True: 0, False: 24.0M]
  ------------------
  816|      0|        goto error;
  817|  24.0M|    if (len == NULL)
  ------------------
  |  Branch (817:9): [True: 0, False: 24.0M]
  ------------------
  818|      0|        goto error;
  819|       |
  820|  24.0M|    c = utf[0];
  821|  24.0M|    if (c < 0x80) {
  ------------------
  |  Branch (821:9): [True: 20.0M, False: 3.95M]
  ------------------
  822|  20.0M|        if (*len < 1)
  ------------------
  |  Branch (822:13): [True: 0, False: 20.0M]
  ------------------
  823|      0|            goto error;
  824|       |        /* 1-byte code */
  825|  20.0M|        *len = 1;
  826|  20.0M|    } else {
  827|  3.95M|        if ((*len < 2) || ((utf[1] & 0xc0) != 0x80))
  ------------------
  |  Branch (827:13): [True: 286, False: 3.95M]
  |  Branch (827:27): [True: 86.8k, False: 3.86M]
  ------------------
  828|  87.1k|            goto error;
  829|  3.86M|        if (c < 0xe0) {
  ------------------
  |  Branch (829:13): [True: 161k, False: 3.70M]
  ------------------
  830|   161k|            if (c < 0xc2)
  ------------------
  |  Branch (830:17): [True: 82.3k, False: 78.9k]
  ------------------
  831|  82.3k|                goto error;
  832|       |            /* 2-byte code */
  833|  78.9k|            *len = 2;
  834|  78.9k|            c = (c & 0x1f) << 6;
  835|  78.9k|            c |= utf[1] & 0x3f;
  836|  3.70M|        } else {
  837|  3.70M|            if ((*len < 3) || ((utf[2] & 0xc0) != 0x80))
  ------------------
  |  Branch (837:17): [True: 74, False: 3.70M]
  |  Branch (837:31): [True: 266, False: 3.70M]
  ------------------
  838|    340|                goto error;
  839|  3.70M|            if (c < 0xf0) {
  ------------------
  |  Branch (839:17): [True: 3.70M, False: 2.88k]
  ------------------
  840|       |                /* 3-byte code */
  841|  3.70M|                *len = 3;
  842|  3.70M|                c = (c & 0xf) << 12;
  843|  3.70M|                c |= (utf[1] & 0x3f) << 6;
  844|  3.70M|                c |= utf[2] & 0x3f;
  845|  3.70M|                if ((c < 0x800) || ((c >= 0xd800) && (c < 0xe000)))
  ------------------
  |  Branch (845:21): [True: 1.26k, False: 3.70M]
  |  Branch (845:37): [True: 1.86M, False: 1.83M]
  |  Branch (845:54): [True: 71, False: 1.86M]
  ------------------
  846|  1.33k|                    goto error;
  847|  3.70M|            } else {
  848|  2.88k|                if ((*len < 4) || ((utf[3] & 0xc0) != 0x80))
  ------------------
  |  Branch (848:21): [True: 74, False: 2.80k]
  |  Branch (848:35): [True: 77, False: 2.73k]
  ------------------
  849|    151|                    goto error;
  850|  2.73k|                *len = 4;
  851|       |                /* 4-byte code */
  852|  2.73k|                c = (c & 0x7) << 18;
  853|  2.73k|                c |= (utf[1] & 0x3f) << 12;
  854|  2.73k|                c |= (utf[2] & 0x3f) << 6;
  855|  2.73k|                c |= utf[3] & 0x3f;
  856|  2.73k|                if ((c < 0x10000) || (c >= 0x110000))
  ------------------
  |  Branch (856:21): [True: 235, False: 2.49k]
  |  Branch (856:38): [True: 235, False: 2.26k]
  ------------------
  857|    470|                    goto error;
  858|  2.73k|            }
  859|  3.70M|        }
  860|  3.86M|    }
  861|  23.8M|    return(c);
  862|       |
  863|   171k|error:
  864|   171k|    if (len != NULL)
  ------------------
  |  Branch (864:9): [True: 171k, False: 0]
  ------------------
  865|   171k|	*len = 0;
  866|   171k|    return(-1);
  867|  24.0M|}
xmlUTF8Strsize:
  933|   246k|xmlUTF8Strsize(const xmlChar *utf, int len) {
  934|   246k|    const xmlChar *ptr=utf;
  935|   246k|    int ch;
  936|   246k|    size_t ret;
  937|       |
  938|   246k|    if (utf == NULL)
  ------------------
  |  Branch (938:9): [True: 0, False: 246k]
  ------------------
  939|      0|        return(0);
  940|       |
  941|   246k|    if (len <= 0)
  ------------------
  |  Branch (941:9): [True: 0, False: 246k]
  ------------------
  942|      0|        return(0);
  943|       |
  944|   526k|    while ( len-- > 0) {
  ------------------
  |  Branch (944:13): [True: 283k, False: 242k]
  ------------------
  945|   283k|        if ( !*ptr )
  ------------------
  |  Branch (945:14): [True: 4.45k, False: 279k]
  ------------------
  946|  4.45k|            break;
  947|   279k|        ch = *ptr++;
  948|   279k|        if ((ch & 0x80))
  ------------------
  |  Branch (948:13): [True: 507, False: 278k]
  ------------------
  949|  1.32k|            while ((ch<<=1) & 0x80 ) {
  ------------------
  |  Branch (949:20): [True: 819, False: 507]
  ------------------
  950|    819|		if (*ptr == 0) break;
  ------------------
  |  Branch (950:7): [True: 0, False: 819]
  ------------------
  951|    819|                ptr++;
  952|    819|	    }
  953|   279k|    }
  954|   246k|    ret = ptr - utf;
  955|   246k|    return (ret > INT_MAX ? 0 : ret);
  ------------------
  |  Branch (955:13): [True: 0, False: 246k]
  ------------------
  956|   246k|}
xmlUTF8Strndup:
  967|  6.77k|xmlUTF8Strndup(const xmlChar *utf, int len) {
  968|  6.77k|    xmlChar *ret;
  969|  6.77k|    int i;
  970|       |
  971|  6.77k|    if ((utf == NULL) || (len < 0)) return(NULL);
  ------------------
  |  Branch (971:9): [True: 0, False: 6.77k]
  |  Branch (971:26): [True: 0, False: 6.77k]
  ------------------
  972|  6.77k|    i = xmlUTF8Strsize(utf, len);
  973|  6.77k|    ret = xmlMalloc((size_t) i + 1);
  974|  6.77k|    if (ret == NULL) {
  ------------------
  |  Branch (974:9): [True: 2, False: 6.77k]
  ------------------
  975|      2|        return(NULL);
  976|      2|    }
  977|  6.77k|    memcpy(ret, utf, i);
  978|  6.77k|    ret[i] = 0;
  979|  6.77k|    return(ret);
  980|  6.77k|}
xmlUTF8Strpos:
  991|  37.3k|xmlUTF8Strpos(const xmlChar *utf, int pos) {
  992|  37.3k|    int ch;
  993|       |
  994|  37.3k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (994:9): [True: 0, False: 37.3k]
  ------------------
  995|  37.3k|    if (pos < 0)
  ------------------
  |  Branch (995:9): [True: 0, False: 37.3k]
  ------------------
  996|      0|        return(NULL);
  997|  6.49M|    while (pos--) {
  ------------------
  |  Branch (997:12): [True: 6.45M, False: 37.3k]
  ------------------
  998|  6.45M|        ch = *utf++;
  999|  6.45M|        if (ch == 0)
  ------------------
  |  Branch (999:13): [True: 0, False: 6.45M]
  ------------------
 1000|      0|            return(NULL);
 1001|  6.45M|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (1001:14): [True: 36.4k, False: 6.41M]
  ------------------
 1002|       |            /* if not simple ascii, verify proper format */
 1003|  36.4k|            if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1003:18): [True: 0, False: 36.4k]
  ------------------
 1004|      0|                return(NULL);
 1005|       |            /* then skip over remaining bytes for this char */
 1006|   120k|            while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1006:21): [True: 84.2k, False: 36.4k]
  ------------------
 1007|  84.2k|                if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1007:22): [True: 0, False: 84.2k]
  ------------------
 1008|      0|                    return(NULL);
 1009|  36.4k|        }
 1010|  6.45M|    }
 1011|  37.3k|    return((xmlChar *)utf);
 1012|  37.3k|}
xmlUTF8Strloc:
 1023|   123k|xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
 1024|   123k|    size_t i;
 1025|   123k|    int size;
 1026|   123k|    int ch;
 1027|       |
 1028|   123k|    if (utf==NULL || utfchar==NULL) return -1;
  ------------------
  |  Branch (1028:9): [True: 0, False: 123k]
  |  Branch (1028:22): [True: 0, False: 123k]
  ------------------
 1029|   123k|    size = xmlUTF8Strsize(utfchar, 1);
 1030|  19.2M|        for(i=0; (ch=*utf) != 0; i++) {
  ------------------
  |  Branch (1030:18): [True: 19.1M, False: 79.4k]
  ------------------
 1031|  19.1M|            if (xmlStrncmp(utf, utfchar, size)==0)
  ------------------
  |  Branch (1031:17): [True: 43.7k, False: 19.0M]
  ------------------
 1032|  43.7k|                return(i > INT_MAX ? 0 : i);
  ------------------
  |  Branch (1032:24): [True: 0, False: 43.7k]
  ------------------
 1033|  19.0M|            utf++;
 1034|  19.0M|            if ( ch & 0x80 ) {
  ------------------
  |  Branch (1034:18): [True: 144k, False: 18.9M]
  ------------------
 1035|       |                /* if not simple ascii, verify proper format */
 1036|   144k|                if ( (ch & 0xc0) != 0xc0 )
  ------------------
  |  Branch (1036:22): [True: 0, False: 144k]
  ------------------
 1037|      0|                    return(-1);
 1038|       |                /* then skip over remaining bytes for this char */
 1039|   409k|                while ( (ch <<= 1) & 0x80 )
  ------------------
  |  Branch (1039:25): [True: 264k, False: 144k]
  ------------------
 1040|   264k|                    if ( (*utf++ & 0xc0) != 0x80 )
  ------------------
  |  Branch (1040:26): [True: 0, False: 264k]
  ------------------
 1041|      0|                        return(-1);
 1042|   144k|            }
 1043|  19.0M|        }
 1044|       |
 1045|  79.4k|    return(-1);
 1046|   123k|}
xmlUTF8Strsub:
 1060|  6.77k|xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
 1061|  6.77k|    int i;
 1062|  6.77k|    int ch;
 1063|       |
 1064|  6.77k|    if (utf == NULL) return(NULL);
  ------------------
  |  Branch (1064:9): [True: 0, False: 6.77k]
  ------------------
 1065|  6.77k|    if (start < 0) return(NULL);
  ------------------
  |  Branch (1065:9): [True: 0, False: 6.77k]
  ------------------
 1066|  6.77k|    if (len < 0) return(NULL);
  ------------------
  |  Branch (1066:9): [True: 0, False: 6.77k]
  ------------------
 1067|       |
 1068|       |    /*
 1069|       |     * Skip over any leading chars
 1070|       |     */
 1071|  15.6k|    for (i = 0; i < start; i++) {
  ------------------
  |  Branch (1071:17): [True: 8.90k, False: 6.77k]
  ------------------
 1072|  8.90k|        ch = *utf++;
 1073|  8.90k|        if (ch == 0)
  ------------------
  |  Branch (1073:13): [True: 0, False: 8.90k]
  ------------------
 1074|      0|            return(NULL);
 1075|       |        /* skip over remaining bytes for this char */
 1076|  8.90k|        if (ch & 0x80) {
  ------------------
  |  Branch (1076:13): [True: 0, False: 8.90k]
  ------------------
 1077|      0|            ch <<= 1;
 1078|      0|            while (ch & 0x80) {
  ------------------
  |  Branch (1078:20): [True: 0, False: 0]
  ------------------
 1079|      0|                if (*utf++ == 0)
  ------------------
  |  Branch (1079:21): [True: 0, False: 0]
  ------------------
 1080|      0|                    return(NULL);
 1081|      0|                ch <<= 1;
 1082|      0|            }
 1083|      0|        }
 1084|  8.90k|    }
 1085|       |
 1086|  6.77k|    return(xmlUTF8Strndup(utf, len));
 1087|  6.77k|}

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|   537k|xmlXPathIsNaN(double val) {
  251|   537k|#ifdef isnan
  252|   537k|    return isnan(val);
  253|       |#else
  254|       |    return !(val == val);
  255|       |#endif
  256|   537k|}
xmlXPathIsInf:
  265|   420k|xmlXPathIsInf(double val) {
  266|   420k|#ifdef isinf
  267|   420k|    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
  ------------------
  |  Branch (267:12): [True: 20.4k, False: 400k]
  |  Branch (267:26): [True: 11.2k, False: 9.25k]
  ------------------
  268|       |#else
  269|       |    if (val >= xmlXPathPINF)
  270|       |        return 1;
  271|       |    if (val <= -xmlXPathPINF)
  272|       |        return -1;
  273|       |    return 0;
  274|       |#endif
  275|   420k|}
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.50k|xmlXPathErr(xmlXPathParserContext *ctxt, int code) {
  778|  7.50k|    xmlXPathErrFmt(ctxt, code, "%s\n", xmlXPathErrorMessages[code]);
  779|  7.50k|}
xmlXPathFreeCompExpr:
  971|  11.2k|{
  972|  11.2k|    xmlXPathStepOpPtr op;
  973|  11.2k|    int i;
  974|       |
  975|  11.2k|    if (comp == NULL)
  ------------------
  |  Branch (975:9): [True: 0, False: 11.2k]
  ------------------
  976|      0|        return;
  977|  11.2k|    if (comp->dict == NULL) {
  ------------------
  |  Branch (977:9): [True: 11.2k, False: 0]
  ------------------
  978|  1.38M|	for (i = 0; i < comp->nbStep; i++) {
  ------------------
  |  Branch (978:14): [True: 1.37M, False: 11.2k]
  ------------------
  979|  1.37M|	    op = &comp->steps[i];
  980|  1.37M|	    if (op->value4 != NULL) {
  ------------------
  |  Branch (980:10): [True: 75.6k, False: 1.30M]
  ------------------
  981|  75.6k|		if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (981:7): [True: 63.2k, False: 12.3k]
  ------------------
  982|  63.2k|		    xmlXPathFreeObject(op->value4);
  983|  12.3k|		else
  984|  12.3k|		    xmlFree(op->value4);
  985|  75.6k|	    }
  986|  1.37M|	    if (op->value5 != NULL)
  ------------------
  |  Branch (986:10): [True: 72.7k, False: 1.30M]
  ------------------
  987|  72.7k|		xmlFree(op->value5);
  988|  1.37M|	}
  989|  11.2k|    } 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.2k|    if (comp->steps != NULL) {
  ------------------
  |  Branch (999:9): [True: 11.2k, False: 0]
  ------------------
 1000|  11.2k|        xmlFree(comp->steps);
 1001|  11.2k|    }
 1002|       |#ifdef XPATH_STREAMING
 1003|       |    if (comp->stream != NULL) {
 1004|       |        xmlFreePatternList(comp->stream);
 1005|       |    }
 1006|       |#endif
 1007|  11.2k|    if (comp->expr != NULL) {
  ------------------
  |  Branch (1007:9): [True: 0, False: 11.2k]
  ------------------
 1008|      0|        xmlFree(comp->expr);
 1009|      0|    }
 1010|       |
 1011|  11.2k|    xmlFree(comp);
 1012|  11.2k|}
xmlXPathValuePop:
 1979|  4.22M|{
 1980|  4.22M|    xmlXPathObjectPtr ret;
 1981|       |
 1982|  4.22M|    if ((ctxt == NULL) || (ctxt->valueNr <= 0))
  ------------------
  |  Branch (1982:9): [True: 0, False: 4.22M]
  |  Branch (1982:27): [True: 13.9k, False: 4.20M]
  ------------------
 1983|  13.9k|        return (NULL);
 1984|       |
 1985|  4.20M|    ctxt->valueNr--;
 1986|  4.20M|    if (ctxt->valueNr > 0)
  ------------------
  |  Branch (1986:9): [True: 3.43M, False: 772k]
  ------------------
 1987|  3.43M|        ctxt->value = ctxt->valueTab[ctxt->valueNr - 1];
 1988|   772k|    else
 1989|   772k|        ctxt->value = NULL;
 1990|  4.20M|    ret = ctxt->valueTab[ctxt->valueNr];
 1991|       |    ctxt->valueTab[ctxt->valueNr] = NULL;
 1992|  4.20M|    return (ret);
 1993|  4.22M|}
xmlXPathValuePush:
 2007|  4.21M|{
 2008|  4.21M|    if (ctxt == NULL) return(-1);
  ------------------
  |  Branch (2008:9): [True: 0, False: 4.21M]
  ------------------
 2009|  4.21M|    if (value == NULL) {
  ------------------
  |  Branch (2009:9): [True: 1.03k, False: 4.21M]
  ------------------
 2010|       |        /*
 2011|       |         * A NULL value typically indicates that a memory allocation failed.
 2012|       |         */
 2013|  1.03k|        xmlXPathPErrMemory(ctxt);
 2014|  1.03k|        return(-1);
 2015|  1.03k|    }
 2016|  4.21M|    if (ctxt->valueNr >= ctxt->valueMax) {
  ------------------
  |  Branch (2016:9): [True: 317, False: 4.21M]
  ------------------
 2017|    317|        xmlXPathObjectPtr *tmp;
 2018|    317|        int newSize;
 2019|       |
 2020|    317|        newSize = xmlGrowCapacity(ctxt->valueMax, sizeof(tmp[0]),
 2021|    317|                                  10, XPATH_MAX_STACK_DEPTH);
  ------------------
  |  |   96|    317|#define XPATH_MAX_STACK_DEPTH 1000000
  ------------------
 2022|    317|        if (newSize < 0) {
  ------------------
  |  Branch (2022:13): [True: 0, False: 317]
  ------------------
 2023|      0|            xmlXPathPErrMemory(ctxt);
 2024|      0|            xmlXPathFreeObject(value);
 2025|      0|            return (-1);
 2026|      0|        }
 2027|    317|        tmp = xmlRealloc(ctxt->valueTab, newSize * sizeof(tmp[0]));
 2028|    317|        if (tmp == NULL) {
  ------------------
  |  Branch (2028:13): [True: 3, False: 314]
  ------------------
 2029|      3|            xmlXPathPErrMemory(ctxt);
 2030|      3|            xmlXPathFreeObject(value);
 2031|      3|            return (-1);
 2032|      3|        }
 2033|    314|	ctxt->valueTab = tmp;
 2034|    314|        ctxt->valueMax = newSize;
 2035|    314|    }
 2036|  4.21M|    ctxt->valueTab[ctxt->valueNr] = value;
 2037|  4.21M|    ctxt->value = value;
 2038|  4.21M|    return (ctxt->valueNr++);
 2039|  4.21M|}
xmlXPathNodeSetSort:
 2552|  31.5k|xmlXPathNodeSetSort(xmlNodeSet *set) {
 2553|       |#ifndef WITH_TIM_SORT
 2554|       |    int i, j, incr, len;
 2555|       |    xmlNodePtr tmp;
 2556|       |#endif
 2557|       |
 2558|  31.5k|    if (set == NULL)
  ------------------
  |  Branch (2558:9): [True: 0, False: 31.5k]
  ------------------
 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|  31.5k|    libxml_domnode_tim_sort(set->nodeTab, set->nodeNr);
 2590|  31.5k|#endif /* WITH_TIM_SORT */
 2591|  31.5k|}
xmlXPathNodeSetFreeNs:
 2647|  96.0k|xmlXPathNodeSetFreeNs(xmlNs *ns) {
 2648|  96.0k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2648:9): [True: 0, False: 96.0k]
  |  Branch (2648:25): [True: 0, False: 96.0k]
  ------------------
 2649|      0|	return;
 2650|       |
 2651|  96.0k|    if ((ns->next != NULL) && (ns->next->type != XML_NAMESPACE_DECL)) {
  ------------------
  |  Branch (2651:9): [True: 96.0k, False: 0]
  |  Branch (2651:31): [True: 96.0k, False: 0]
  ------------------
 2652|  96.0k|	if (ns->href != NULL)
  ------------------
  |  Branch (2652:6): [True: 58.9k, False: 37.1k]
  ------------------
 2653|  58.9k|	    xmlFree((xmlChar *)ns->href);
 2654|  96.0k|	if (ns->prefix != NULL)
  ------------------
  |  Branch (2654:6): [True: 81.9k, False: 14.1k]
  ------------------
 2655|  81.9k|	    xmlFree((xmlChar *)ns->prefix);
 2656|  96.0k|	xmlFree(ns);
 2657|  96.0k|    }
 2658|  96.0k|}
xmlXPathNodeSetCreate:
 2667|  2.34M|xmlXPathNodeSetCreate(xmlNode *val) {
 2668|  2.34M|    xmlNodeSetPtr ret;
 2669|       |
 2670|  2.34M|    ret = (xmlNodeSetPtr) xmlMalloc(sizeof(xmlNodeSet));
 2671|  2.34M|    if (ret == NULL)
  ------------------
  |  Branch (2671:9): [True: 302, False: 2.34M]
  ------------------
 2672|    302|	return(NULL);
 2673|  2.34M|    memset(ret, 0 , sizeof(xmlNodeSet));
 2674|  2.34M|    if (val != NULL) {
  ------------------
  |  Branch (2674:9): [True: 1.24M, False: 1.10M]
  ------------------
 2675|  1.24M|        ret->nodeTab = (xmlNodePtr *) xmlMalloc(XML_NODESET_DEFAULT *
  ------------------
  |  | 2593|  1.24M|#define XML_NODESET_DEFAULT	10
  ------------------
 2676|  1.24M|					     sizeof(xmlNodePtr));
 2677|  1.24M|	if (ret->nodeTab == NULL) {
  ------------------
  |  Branch (2677:6): [True: 150, False: 1.24M]
  ------------------
 2678|    150|	    xmlFree(ret);
 2679|    150|	    return(NULL);
 2680|    150|	}
 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: 28.3k, False: 1.21M]
  ------------------
 2685|  28.3k|	    xmlNsPtr ns = (xmlNsPtr) val;
 2686|  28.3k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2687|       |
 2688|  28.3k|            if (nsNode == NULL) {
  ------------------
  |  Branch (2688:17): [True: 5, False: 28.3k]
  ------------------
 2689|      5|                xmlXPathFreeNodeSet(ret);
 2690|      5|                return(NULL);
 2691|      5|            }
 2692|  28.3k|	    ret->nodeTab[ret->nodeNr++] = nsNode;
 2693|  28.3k|	} else
 2694|  1.21M|	    ret->nodeTab[ret->nodeNr++] = val;
 2695|  1.24M|    }
 2696|  2.34M|    return(ret);
 2697|  2.34M|}
xmlXPathNodeSetAddNs:
 2761|  58.8k|xmlXPathNodeSetAddNs(xmlNodeSet *cur, xmlNode *node, xmlNs *ns) {
 2762|  58.8k|    int i;
 2763|  58.8k|    xmlNodePtr nsNode;
 2764|       |
 2765|  58.8k|    if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
  ------------------
  |  Branch (2765:9): [True: 0, False: 58.8k]
  |  Branch (2765:26): [True: 0, False: 58.8k]
  |  Branch (2765:42): [True: 0, False: 58.8k]
  ------------------
 2766|  58.8k|        (ns->type != XML_NAMESPACE_DECL) ||
  ------------------
  |  Branch (2766:9): [True: 0, False: 58.8k]
  ------------------
 2767|  58.8k|	(node->type != XML_ELEMENT_NODE))
  ------------------
  |  Branch (2767:2): [True: 0, False: 58.8k]
  ------------------
 2768|      0|	return(-1);
 2769|       |
 2770|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2771|       |    /*
 2772|       |     * prevent duplicates
 2773|       |     */
 2774|   102k|    for (i = 0;i < cur->nodeNr;i++) {
  ------------------
  |  Branch (2774:16): [True: 43.5k, False: 58.8k]
  ------------------
 2775|  43.5k|        if ((cur->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (2775:13): [True: 43.5k, False: 0]
  ------------------
 2776|  43.5k|	    (cur->nodeTab[i]->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2776:6): [True: 43.5k, False: 0]
  ------------------
 2777|  43.5k|	    (((xmlNsPtr)cur->nodeTab[i])->next == (xmlNsPtr) node) &&
  ------------------
  |  Branch (2777:6): [True: 43.5k, False: 0]
  ------------------
 2778|  43.5k|	    (xmlStrEqual(ns->prefix, ((xmlNsPtr)cur->nodeTab[i])->prefix)))
  ------------------
  |  Branch (2778:6): [True: 0, False: 43.5k]
  ------------------
 2779|      0|	    return(0);
 2780|  43.5k|    }
 2781|       |
 2782|       |    /*
 2783|       |     * grow the nodeTab if needed
 2784|       |     */
 2785|  58.8k|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2785:9): [True: 6.23k, False: 52.6k]
  ------------------
 2786|  6.23k|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2786:13): [True: 8, False: 6.22k]
  ------------------
 2787|      8|            return(-1);
 2788|  6.23k|    }
 2789|  58.8k|    nsNode = xmlXPathNodeSetDupNs(node, ns);
 2790|  58.8k|    if(nsNode == NULL)
  ------------------
  |  Branch (2790:8): [True: 33, False: 58.7k]
  ------------------
 2791|     33|        return(-1);
 2792|  58.7k|    cur->nodeTab[cur->nodeNr++] = nsNode;
 2793|  58.7k|    return(0);
 2794|  58.8k|}
xmlXPathNodeSetAdd:
 2804|  2.06k|xmlXPathNodeSetAdd(xmlNodeSet *cur, xmlNode *val) {
 2805|  2.06k|    int i;
 2806|       |
 2807|  2.06k|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2807:9): [True: 0, False: 2.06k]
  |  Branch (2807:26): [True: 0, False: 2.06k]
  ------------------
 2808|       |
 2809|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2810|       |    /*
 2811|       |     * prevent duplicates
 2812|       |     */
 2813|  2.06k|    for (i = 0;i < cur->nodeNr;i++)
  ------------------
  |  Branch (2813:16): [True: 1.20k, False: 861]
  ------------------
 2814|  1.20k|        if (cur->nodeTab[i] == val) return(0);
  ------------------
  |  Branch (2814:13): [True: 1.20k, False: 0]
  ------------------
 2815|       |
 2816|       |    /*
 2817|       |     * grow the nodeTab if needed
 2818|       |     */
 2819|    861|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2819:9): [True: 861, False: 0]
  ------------------
 2820|    861|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2820:13): [True: 1, False: 860]
  ------------------
 2821|      1|            return(-1);
 2822|    861|    }
 2823|       |
 2824|    860|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2824:9): [True: 0, False: 860]
  ------------------
 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|    860|	cur->nodeTab[cur->nodeNr++] = val;
 2833|    860|    return(0);
 2834|    860|}
xmlXPathNodeSetAddUnique:
 2845|  5.61M|xmlXPathNodeSetAddUnique(xmlNodeSet *cur, xmlNode *val) {
 2846|  5.61M|    if ((cur == NULL) || (val == NULL)) return(-1);
  ------------------
  |  Branch (2846:9): [True: 0, False: 5.61M]
  |  Branch (2846:26): [True: 0, False: 5.61M]
  ------------------
 2847|       |
 2848|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2849|       |    /*
 2850|       |     * grow the nodeTab if needed
 2851|       |     */
 2852|  5.61M|    if (cur->nodeNr >= cur->nodeMax) {
  ------------------
  |  Branch (2852:9): [True: 1.25M, False: 4.35M]
  ------------------
 2853|  1.25M|        if (xmlXPathNodeSetGrow(cur) < 0)
  ------------------
  |  Branch (2853:13): [True: 167, False: 1.25M]
  ------------------
 2854|    167|            return(-1);
 2855|  1.25M|    }
 2856|       |
 2857|  5.61M|    if (val->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2857:9): [True: 5.33k, False: 5.60M]
  ------------------
 2858|  5.33k|	xmlNsPtr ns = (xmlNsPtr) val;
 2859|  5.33k|        xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2860|       |
 2861|  5.33k|        if (nsNode == NULL)
  ------------------
  |  Branch (2861:13): [True: 7, False: 5.32k]
  ------------------
 2862|      7|            return(-1);
 2863|  5.32k|	cur->nodeTab[cur->nodeNr++] = nsNode;
 2864|  5.32k|    } else
 2865|  5.60M|	cur->nodeTab[cur->nodeNr++] = val;
 2866|  5.61M|    return(0);
 2867|  5.61M|}
xmlXPathNodeSetMerge:
 2880|  57.5k|xmlXPathNodeSetMerge(xmlNodeSet *val1, xmlNodeSet *val2) {
 2881|  57.5k|    int i, j, initNr, skip;
 2882|  57.5k|    xmlNodePtr n1, n2;
 2883|       |
 2884|  57.5k|    if (val1 == NULL) {
  ------------------
  |  Branch (2884:9): [True: 5, False: 57.5k]
  ------------------
 2885|      5|	val1 = xmlXPathNodeSetCreate(NULL);
 2886|      5|        if (val1 == NULL)
  ------------------
  |  Branch (2886:13): [True: 0, False: 5]
  ------------------
 2887|      0|            return (NULL);
 2888|      5|    }
 2889|  57.5k|    if (val2 == NULL)
  ------------------
  |  Branch (2889:9): [True: 28, False: 57.5k]
  ------------------
 2890|     28|        return(val1);
 2891|       |
 2892|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 2893|  57.5k|    initNr = val1->nodeNr;
 2894|       |
 2895|   816k|    for (i = 0;i < val2->nodeNr;i++) {
  ------------------
  |  Branch (2895:16): [True: 759k, False: 57.5k]
  ------------------
 2896|   759k|	n2 = val2->nodeTab[i];
 2897|       |	/*
 2898|       |	 * check against duplicates
 2899|       |	 */
 2900|   759k|	skip = 0;
 2901|  10.4M|	for (j = 0; j < initNr; j++) {
  ------------------
  |  Branch (2901:14): [True: 9.80M, False: 675k]
  ------------------
 2902|  9.80M|	    n1 = val1->nodeTab[j];
 2903|  9.80M|	    if (n1 == n2) {
  ------------------
  |  Branch (2903:10): [True: 83.7k, False: 9.72M]
  ------------------
 2904|  83.7k|		skip = 1;
 2905|  83.7k|		break;
 2906|  9.72M|	    } else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2906:17): [True: 260, False: 9.72M]
  ------------------
 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|  9.80M|	}
 2917|   759k|	if (skip)
  ------------------
  |  Branch (2917:6): [True: 83.7k, False: 675k]
  ------------------
 2918|  83.7k|	    continue;
 2919|       |
 2920|       |	/*
 2921|       |	 * grow the nodeTab if needed
 2922|       |	 */
 2923|   675k|        if (val1->nodeNr >= val1->nodeMax) {
  ------------------
  |  Branch (2923:13): [True: 62.5k, False: 612k]
  ------------------
 2924|  62.5k|            if (xmlXPathNodeSetGrow(val1) < 0)
  ------------------
  |  Branch (2924:17): [True: 24, False: 62.5k]
  ------------------
 2925|     24|                goto error;
 2926|  62.5k|        }
 2927|   675k|	if (n2->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (2927:6): [True: 3.64k, False: 671k]
  ------------------
 2928|  3.64k|	    xmlNsPtr ns = (xmlNsPtr) n2;
 2929|  3.64k|            xmlNodePtr nsNode = xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
 2930|       |
 2931|  3.64k|            if (nsNode == NULL)
  ------------------
  |  Branch (2931:17): [True: 26, False: 3.61k]
  ------------------
 2932|     26|                goto error;
 2933|  3.61k|	    val1->nodeTab[val1->nodeNr++] = nsNode;
 2934|  3.61k|	} else
 2935|   671k|	    val1->nodeTab[val1->nodeNr++] = n2;
 2936|   675k|    }
 2937|       |
 2938|  57.5k|    return(val1);
 2939|       |
 2940|     50|error:
 2941|     50|    xmlXPathFreeNodeSet(val1);
 2942|       |    return(NULL);
 2943|  57.5k|}
xmlXPathFreeNodeSet:
 3101|  2.34M|xmlXPathFreeNodeSet(xmlNodeSet *obj) {
 3102|  2.34M|    if (obj == NULL) return;
  ------------------
  |  Branch (3102:9): [True: 28, False: 2.34M]
  ------------------
 3103|  2.34M|    if (obj->nodeTab != NULL) {
  ------------------
  |  Branch (3103:9): [True: 1.62M, False: 723k]
  ------------------
 3104|  1.62M|	int i;
 3105|       |
 3106|       |	/* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3107|  8.60M|	for (i = 0;i < obj->nodeNr;i++)
  ------------------
  |  Branch (3107:13): [True: 6.98M, False: 1.62M]
  ------------------
 3108|  6.98M|	    if ((obj->nodeTab[i] != NULL) &&
  ------------------
  |  Branch (3108:10): [True: 6.98M, False: 0]
  ------------------
 3109|  6.98M|		(obj->nodeTab[i]->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3109:3): [True: 86.3k, False: 6.89M]
  ------------------
 3110|  86.3k|		xmlXPathNodeSetFreeNs((xmlNsPtr) obj->nodeTab[i]);
 3111|  1.62M|	xmlFree(obj->nodeTab);
 3112|  1.62M|    }
 3113|  2.34M|    xmlFree(obj);
 3114|  2.34M|}
xmlXPathNewNodeSet:
 3191|  1.24M|xmlXPathNewNodeSet(xmlNode *val) {
 3192|  1.24M|    xmlXPathObjectPtr ret;
 3193|       |
 3194|  1.24M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3195|  1.24M|    if (ret == NULL)
  ------------------
  |  Branch (3195:9): [True: 165, False: 1.24M]
  ------------------
 3196|    165|	return(NULL);
 3197|  1.24M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3198|  1.24M|    ret->type = XPATH_NODESET;
 3199|  1.24M|    ret->boolval = 0;
 3200|  1.24M|    ret->nodesetval = xmlXPathNodeSetCreate(val);
 3201|  1.24M|    if (ret->nodesetval == NULL) {
  ------------------
  |  Branch (3201:9): [True: 317, False: 1.24M]
  ------------------
 3202|    317|        xmlFree(ret);
 3203|    317|        return(NULL);
 3204|    317|    }
 3205|       |    /* @@ with_ns to check whether namespace nodes should be looked at @@ */
 3206|  1.24M|    return(ret);
 3207|  1.24M|}
xmlXPathWrapNodeSet:
 3267|  1.08M|xmlXPathWrapNodeSet(xmlNodeSet *val) {
 3268|  1.08M|    xmlXPathObjectPtr ret;
 3269|       |
 3270|  1.08M|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 3271|  1.08M|    if (ret == NULL) {
  ------------------
  |  Branch (3271:9): [True: 181, False: 1.08M]
  ------------------
 3272|    181|        xmlXPathFreeNodeSet(val);
 3273|    181|	return(NULL);
 3274|    181|    }
 3275|  1.08M|    memset(ret, 0 , sizeof(xmlXPathObject));
 3276|  1.08M|    ret->type = XPATH_NODESET;
 3277|  1.08M|    ret->nodesetval = val;
 3278|  1.08M|    return(ret);
 3279|  1.08M|}
xmlXPathFunctionLookup:
 3743|  5.32k|xmlXPathFunctionLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3744|       |    return(xmlXPathFunctionLookupNS(ctxt, name, NULL));
 3745|  5.32k|}
xmlXPathFunctionLookupNS:
 3758|  5.33k|			 const xmlChar *ns_uri) {
 3759|  5.33k|    xmlXPathFunction ret;
 3760|  5.33k|    void *payload;
 3761|       |
 3762|  5.33k|    if (ctxt == NULL)
  ------------------
  |  Branch (3762:9): [True: 0, False: 5.33k]
  ------------------
 3763|      0|	return(NULL);
 3764|  5.33k|    if (name == NULL)
  ------------------
  |  Branch (3764:9): [True: 0, False: 5.33k]
  ------------------
 3765|      0|	return(NULL);
 3766|       |
 3767|  5.33k|    if (ns_uri == NULL) {
  ------------------
  |  Branch (3767:9): [True: 5.32k, False: 10]
  ------------------
 3768|  5.32k|        int bucketIndex = xmlXPathSFComputeHash(name) % SF_HASH_SIZE;
  ------------------
  |  |  168|  5.32k|#define SF_HASH_SIZE 64
  ------------------
 3769|       |
 3770|  7.71k|        while (xmlXPathSFHash[bucketIndex] != UCHAR_MAX) {
  ------------------
  |  Branch (3770:16): [True: 7.19k, False: 521]
  ------------------
 3771|  7.19k|            int funcIndex = xmlXPathSFHash[bucketIndex];
 3772|       |
 3773|  7.19k|            if (strcmp(xmlXPathStandardFunctions[funcIndex].name,
  ------------------
  |  Branch (3773:17): [True: 4.80k, False: 2.38k]
  ------------------
 3774|  7.19k|                       (char *) name) == 0)
 3775|  4.80k|                return(xmlXPathStandardFunctions[funcIndex].func);
 3776|       |
 3777|  2.38k|            bucketIndex += 1;
 3778|  2.38k|            if (bucketIndex >= SF_HASH_SIZE)
  ------------------
  |  |  168|  2.38k|#define SF_HASH_SIZE 64
  ------------------
  |  Branch (3778:17): [True: 0, False: 2.38k]
  ------------------
 3779|      0|                bucketIndex = 0;
 3780|  2.38k|        }
 3781|  5.32k|    }
 3782|       |
 3783|    531|    if (ctxt->funcLookupFunc != NULL) {
  ------------------
  |  Branch (3783:9): [True: 0, False: 531]
  ------------------
 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|    531|    if (ctxt->funcHash == NULL)
  ------------------
  |  Branch (3792:9): [True: 531, False: 0]
  ------------------
 3793|    531|	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|    531|}
xmlXPathRegisteredFuncsCleanup:
 3807|  6.92k|xmlXPathRegisteredFuncsCleanup(xmlXPathContext *ctxt) {
 3808|  6.92k|    if (ctxt == NULL)
  ------------------
  |  Branch (3808:9): [True: 0, False: 6.92k]
  ------------------
 3809|      0|	return;
 3810|       |
 3811|  6.92k|    xmlHashFree(ctxt->funcHash, NULL);
 3812|       |    ctxt->funcHash = NULL;
 3813|  6.92k|}
xmlXPathVariableLookup:
 3891|     41|xmlXPathVariableLookup(xmlXPathContext *ctxt, const xmlChar *name) {
 3892|     41|    if (ctxt == NULL)
  ------------------
  |  Branch (3892:9): [True: 0, False: 41]
  ------------------
 3893|      0|	return(NULL);
 3894|       |
 3895|     41|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3895:9): [True: 0, False: 41]
  ------------------
 3896|      0|	xmlXPathObjectPtr ret;
 3897|       |
 3898|      0|	ret = ((xmlXPathVariableLookupFunc)ctxt->varLookupFunc)
 3899|      0|	        (ctxt->varLookupData, name, NULL);
 3900|      0|	return(ret);
 3901|      0|    }
 3902|     41|    return(xmlXPathVariableLookupNS(ctxt, name, NULL));
 3903|     41|}
xmlXPathVariableLookupNS:
 3916|     52|			 const xmlChar *ns_uri) {
 3917|     52|    if (ctxt == NULL)
  ------------------
  |  Branch (3917:9): [True: 0, False: 52]
  ------------------
 3918|      0|	return(NULL);
 3919|       |
 3920|     52|    if (ctxt->varLookupFunc != NULL) {
  ------------------
  |  Branch (3920:9): [True: 0, False: 52]
  ------------------
 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|     52|    if (ctxt->varHash == NULL)
  ------------------
  |  Branch (3928:9): [True: 52, False: 0]
  ------------------
 3929|     52|	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|  6.92k|xmlXPathRegisteredVariablesCleanup(xmlXPathContext *ctxt) {
 3943|  6.92k|    if (ctxt == NULL)
  ------------------
  |  Branch (3943:9): [True: 0, False: 6.92k]
  ------------------
 3944|      0|	return;
 3945|       |
 3946|  6.92k|    xmlHashFree(ctxt->varHash, xmlXPathFreeObjectEntry);
 3947|       |    ctxt->varHash = NULL;
 3948|  6.92k|}
xmlXPathRegisterNs:
 3961|    433|			   const xmlChar *ns_uri) {
 3962|    433|    xmlChar *copy;
 3963|       |
 3964|    433|    if (ctxt == NULL)
  ------------------
  |  Branch (3964:9): [True: 0, False: 433]
  ------------------
 3965|      0|	return(-1);
 3966|    433|    if (prefix == NULL)
  ------------------
  |  Branch (3966:9): [True: 0, False: 433]
  ------------------
 3967|      0|	return(-1);
 3968|    433|    if (prefix[0] == 0)
  ------------------
  |  Branch (3968:9): [True: 0, False: 433]
  ------------------
 3969|      0|	return(-1);
 3970|       |
 3971|    433|    if (ctxt->nsHash == NULL)
  ------------------
  |  Branch (3971:9): [True: 43, False: 390]
  ------------------
 3972|     43|	ctxt->nsHash = xmlHashCreate(10);
 3973|    433|    if (ctxt->nsHash == NULL) {
  ------------------
  |  Branch (3973:9): [True: 2, False: 431]
  ------------------
 3974|      2|        xmlXPathErrMemory(ctxt);
 3975|      2|	return(-1);
 3976|      2|    }
 3977|    431|    if (ns_uri == NULL)
  ------------------
  |  Branch (3977:9): [True: 0, False: 431]
  ------------------
 3978|      0|        return(xmlHashRemoveEntry(ctxt->nsHash, prefix,
 3979|      0|	                          xmlHashDefaultDeallocator));
 3980|       |
 3981|    431|    copy = xmlStrdup(ns_uri);
 3982|    431|    if (copy == NULL) {
  ------------------
  |  Branch (3982:9): [True: 1, False: 430]
  ------------------
 3983|      1|        xmlXPathErrMemory(ctxt);
 3984|      1|        return(-1);
 3985|      1|    }
 3986|    430|    if (xmlHashUpdateEntry(ctxt->nsHash, prefix, copy,
  ------------------
  |  Branch (3986:9): [True: 2, False: 428]
  ------------------
 3987|    430|                           xmlHashDefaultDeallocator) < 0) {
 3988|      2|        xmlXPathErrMemory(ctxt);
 3989|      2|        xmlFree(copy);
 3990|      2|        return(-1);
 3991|      2|    }
 3992|       |
 3993|    428|    return(0);
 3994|    430|}
xmlXPathNsLookup:
 4005|  8.11k|xmlXPathNsLookup(xmlXPathContext *ctxt, const xmlChar *prefix) {
 4006|  8.11k|    if (ctxt == NULL)
  ------------------
  |  Branch (4006:9): [True: 0, False: 8.11k]
  ------------------
 4007|      0|	return(NULL);
 4008|  8.11k|    if (prefix == NULL)
  ------------------
  |  Branch (4008:9): [True: 0, False: 8.11k]
  ------------------
 4009|      0|	return(NULL);
 4010|       |
 4011|  8.11k|    if (xmlStrEqual(prefix, (const xmlChar *) "xml"))
  ------------------
  |  Branch (4011:9): [True: 7.87k, False: 242]
  ------------------
 4012|  7.87k|	return(XML_XML_NAMESPACE);
  ------------------
  |  |  146|  7.87k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
 4013|       |
 4014|    242|    if (ctxt->namespaces != NULL) {
  ------------------
  |  Branch (4014:9): [True: 0, False: 242]
  ------------------
 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|    242|    return((const xmlChar *) xmlHashLookup(ctxt->nsHash, prefix));
 4025|    242|}
xmlXPathRegisteredNsCleanup:
 4033|  6.92k|xmlXPathRegisteredNsCleanup(xmlXPathContext *ctxt) {
 4034|  6.92k|    if (ctxt == NULL)
  ------------------
  |  Branch (4034:9): [True: 0, False: 6.92k]
  ------------------
 4035|      0|	return;
 4036|       |
 4037|  6.92k|    xmlHashFree(ctxt->nsHash, xmlHashDefaultDeallocator);
 4038|       |    ctxt->nsHash = NULL;
 4039|  6.92k|}
xmlXPathNewFloat:
 4056|   468k|xmlXPathNewFloat(double val) {
 4057|   468k|    xmlXPathObjectPtr ret;
 4058|       |
 4059|   468k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4060|   468k|    if (ret == NULL)
  ------------------
  |  Branch (4060:9): [True: 146, False: 467k]
  ------------------
 4061|    146|	return(NULL);
 4062|   467k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4063|   467k|    ret->type = XPATH_NUMBER;
 4064|   467k|    ret->floatval = val;
 4065|   467k|    return(ret);
 4066|   468k|}
xmlXPathNewBoolean:
 4075|   595k|xmlXPathNewBoolean(int val) {
 4076|   595k|    xmlXPathObjectPtr ret;
 4077|       |
 4078|   595k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4079|   595k|    if (ret == NULL)
  ------------------
  |  Branch (4079:9): [True: 93, False: 595k]
  ------------------
 4080|     93|	return(NULL);
 4081|   595k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4082|   595k|    ret->type = XPATH_BOOLEAN;
 4083|   595k|    ret->boolval = (val != 0);
 4084|   595k|    return(ret);
 4085|   595k|}
xmlXPathNewString:
 4094|   140k|xmlXPathNewString(const xmlChar *val) {
 4095|   140k|    xmlXPathObjectPtr ret;
 4096|       |
 4097|   140k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4098|   140k|    if (ret == NULL)
  ------------------
  |  Branch (4098:9): [True: 18, False: 140k]
  ------------------
 4099|     18|	return(NULL);
 4100|   140k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4101|   140k|    ret->type = XPATH_STRING;
 4102|   140k|    if (val == NULL)
  ------------------
  |  Branch (4102:9): [True: 2, False: 140k]
  ------------------
 4103|      2|        val = BAD_CAST "";
  ------------------
  |  |   34|      2|#define BAD_CAST (xmlChar *)
  ------------------
 4104|   140k|    ret->stringval = xmlStrdup(val);
 4105|   140k|    if (ret->stringval == NULL) {
  ------------------
  |  Branch (4105:9): [True: 24, False: 140k]
  ------------------
 4106|     24|        xmlFree(ret);
 4107|     24|        return(NULL);
 4108|     24|    }
 4109|   140k|    return(ret);
 4110|   140k|}
xmlXPathWrapString:
 4121|  70.0k|xmlXPathWrapString (xmlChar *val) {
 4122|  70.0k|    xmlXPathObjectPtr ret;
 4123|       |
 4124|  70.0k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4125|  70.0k|    if (ret == NULL) {
  ------------------
  |  Branch (4125:9): [True: 52, False: 69.9k]
  ------------------
 4126|     52|        xmlFree(val);
 4127|     52|	return(NULL);
 4128|     52|    }
 4129|  69.9k|    memset(ret, 0 , sizeof(xmlXPathObject));
 4130|  69.9k|    ret->type = XPATH_STRING;
 4131|  69.9k|    ret->stringval = val;
 4132|  69.9k|    return(ret);
 4133|  70.0k|}
xmlXPathObjectCopy:
 4183|   398k|xmlXPathObjectCopy(xmlXPathObject *val) {
 4184|   398k|    xmlXPathObjectPtr ret;
 4185|       |
 4186|   398k|    if (val == NULL)
  ------------------
  |  Branch (4186:9): [True: 0, False: 398k]
  ------------------
 4187|      0|	return(NULL);
 4188|       |
 4189|   398k|    ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
 4190|   398k|    if (ret == NULL)
  ------------------
  |  Branch (4190:9): [True: 78, False: 398k]
  ------------------
 4191|     78|	return(NULL);
 4192|   398k|    memcpy(ret, val , sizeof(xmlXPathObject));
 4193|   398k|    switch (val->type) {
 4194|      0|	case XPATH_BOOLEAN:
  ------------------
  |  Branch (4194:2): [True: 0, False: 398k]
  ------------------
 4195|   376k|	case XPATH_NUMBER:
  ------------------
  |  Branch (4195:2): [True: 376k, False: 22.7k]
  ------------------
 4196|   376k|	    break;
 4197|  22.7k|	case XPATH_STRING:
  ------------------
  |  Branch (4197:2): [True: 22.7k, False: 376k]
  ------------------
 4198|  22.7k|	    ret->stringval = xmlStrdup(val->stringval);
 4199|  22.7k|            if (ret->stringval == NULL) {
  ------------------
  |  Branch (4199:17): [True: 13, False: 22.7k]
  ------------------
 4200|     13|                xmlFree(ret);
 4201|     13|                return(NULL);
 4202|     13|            }
 4203|  22.7k|	    break;
 4204|  22.7k|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4204:2): [True: 0, False: 398k]
  ------------------
 4205|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (4205:2): [True: 0, False: 398k]
  ------------------
 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: 398k]
  ------------------
 4215|      0|	    ret->user = val->user;
 4216|      0|	    break;
 4217|      0|        default:
  ------------------
  |  Branch (4217:9): [True: 0, False: 398k]
  ------------------
 4218|      0|            xmlFree(ret);
 4219|      0|            ret = NULL;
 4220|      0|	    break;
 4221|   398k|    }
 4222|   398k|    return(ret);
 4223|   398k|}
xmlXPathFreeObject:
 4231|  3.99M|xmlXPathFreeObject(xmlXPathObject *obj) {
 4232|  3.99M|    if (obj == NULL) return;
  ------------------
  |  Branch (4232:9): [True: 0, False: 3.99M]
  ------------------
 4233|  3.99M|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (4233:9): [True: 2.32M, False: 1.67M]
  |  Branch (4233:41): [True: 0, False: 1.67M]
  ------------------
 4234|  2.32M|        if (obj->nodesetval != NULL)
  ------------------
  |  Branch (4234:13): [True: 2.32M, False: 67]
  ------------------
 4235|  2.32M|            xmlXPathFreeNodeSet(obj->nodesetval);
 4236|  2.32M|    } else if (obj->type == XPATH_STRING) {
  ------------------
  |  Branch (4236:16): [True: 232k, False: 1.43M]
  ------------------
 4237|   232k|	if (obj->stringval != NULL)
  ------------------
  |  Branch (4237:6): [True: 232k, False: 38]
  ------------------
 4238|   232k|	    xmlFree(obj->stringval);
 4239|   232k|    }
 4240|  3.99M|    xmlFree(obj);
 4241|  3.99M|}
xmlXPathCastBooleanToString:
 4354|  10.6k|xmlXPathCastBooleanToString (int val) {
 4355|  10.6k|    xmlChar *ret;
 4356|  10.6k|    if (val)
  ------------------
  |  Branch (4356:9): [True: 1.63k, False: 9.04k]
  ------------------
 4357|  1.63k|	ret = xmlStrdup((const xmlChar *) "true");
 4358|  9.04k|    else
 4359|  9.04k|	ret = xmlStrdup((const xmlChar *) "false");
 4360|  10.6k|    return(ret);
 4361|  10.6k|}
xmlXPathCastNumberToString:
 4370|  23.2k|xmlXPathCastNumberToString (double val) {
 4371|  23.2k|    xmlChar *ret;
 4372|  23.2k|    switch (xmlXPathIsInf(val)) {
 4373|    361|    case 1:
  ------------------
  |  Branch (4373:5): [True: 361, False: 22.9k]
  ------------------
 4374|    361|	ret = xmlStrdup((const xmlChar *) "Infinity");
 4375|    361|	break;
 4376|    311|    case -1:
  ------------------
  |  Branch (4376:5): [True: 311, False: 22.9k]
  ------------------
 4377|    311|	ret = xmlStrdup((const xmlChar *) "-Infinity");
 4378|    311|	break;
 4379|  22.6k|    default:
  ------------------
  |  Branch (4379:5): [True: 22.6k, False: 672]
  ------------------
 4380|  22.6k|	if (xmlXPathIsNaN(val)) {
  ------------------
  |  Branch (4380:6): [True: 2.80k, False: 19.8k]
  ------------------
 4381|  2.80k|	    ret = xmlStrdup((const xmlChar *) "NaN");
 4382|  19.8k|	} else if (val == 0) {
  ------------------
  |  Branch (4382:13): [True: 627, False: 19.1k]
  ------------------
 4383|       |            /* Omit sign for negative zero. */
 4384|    627|	    ret = xmlStrdup((const xmlChar *) "0");
 4385|  19.1k|	} else {
 4386|       |	    /* could be improved */
 4387|  19.1k|	    char buf[100];
 4388|  19.1k|	    xmlXPathFormatNumber(val, buf, 99);
 4389|  19.1k|	    buf[99] = 0;
 4390|  19.1k|	    ret = xmlStrdup((const xmlChar *) buf);
 4391|  19.1k|	}
 4392|  23.2k|    }
 4393|  23.2k|    return(ret);
 4394|  23.2k|}
xmlXPathCastNodeToString:
 4403|   370k|xmlXPathCastNodeToString (xmlNode *node) {
 4404|   370k|    return(xmlNodeGetContent(node));
 4405|   370k|}
xmlXPathCastNodeSetToString:
 4414|   489k|xmlXPathCastNodeSetToString (xmlNodeSet *ns) {
 4415|   489k|    if ((ns == NULL) || (ns->nodeNr == 0) || (ns->nodeTab == NULL))
  ------------------
  |  Branch (4415:9): [True: 0, False: 489k]
  |  Branch (4415:25): [True: 318k, False: 170k]
  |  Branch (4415:46): [True: 0, False: 170k]
  ------------------
 4416|   318k|	return(xmlStrdup((const xmlChar *) ""));
 4417|       |
 4418|   170k|    if (ns->nodeNr > 1)
  ------------------
  |  Branch (4418:9): [True: 24.6k, False: 145k]
  ------------------
 4419|  24.6k|	xmlXPathNodeSetSort(ns);
 4420|   170k|    return(xmlXPathCastNodeToString(ns->nodeTab[0]));
 4421|   489k|}
xmlXPathCastToString:
 4431|  61.0k|xmlXPathCastToString(xmlXPathObject *val) {
 4432|  61.0k|    xmlChar *ret = NULL;
 4433|       |
 4434|  61.0k|    if (val == NULL)
  ------------------
  |  Branch (4434:9): [True: 0, False: 61.0k]
  ------------------
 4435|      0|	return(xmlStrdup((const xmlChar *) ""));
 4436|  61.0k|    switch (val->type) {
  ------------------
  |  Branch (4436:13): [True: 61.0k, False: 0]
  ------------------
 4437|      0|	case XPATH_UNDEFINED:
  ------------------
  |  Branch (4437:2): [True: 0, False: 61.0k]
  ------------------
 4438|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4439|      0|	    break;
 4440|  26.6k|        case XPATH_NODESET:
  ------------------
  |  Branch (4440:9): [True: 26.6k, False: 34.4k]
  ------------------
 4441|  26.6k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4441:9): [True: 0, False: 61.0k]
  ------------------
 4442|  26.6k|	    ret = xmlXPathCastNodeSetToString(val->nodesetval);
 4443|  26.6k|	    break;
 4444|    481|	case XPATH_STRING:
  ------------------
  |  Branch (4444:2): [True: 481, False: 60.5k]
  ------------------
 4445|    481|	    return(xmlStrdup(val->stringval));
 4446|  10.6k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (4446:9): [True: 10.6k, False: 50.3k]
  ------------------
 4447|  10.6k|	    ret = xmlXPathCastBooleanToString(val->boolval);
 4448|  10.6k|	    break;
 4449|  23.2k|	case XPATH_NUMBER: {
  ------------------
  |  Branch (4449:2): [True: 23.2k, False: 37.7k]
  ------------------
 4450|  23.2k|	    ret = xmlXPathCastNumberToString(val->floatval);
 4451|  23.2k|	    break;
 4452|  26.6k|	}
 4453|      0|	case XPATH_USERS:
  ------------------
  |  Branch (4453:2): [True: 0, False: 61.0k]
  ------------------
 4454|       |	    /* TODO */
 4455|      0|	    ret = xmlStrdup((const xmlChar *) "");
 4456|      0|	    break;
 4457|  61.0k|    }
 4458|  60.5k|    return(ret);
 4459|  61.0k|}
xmlXPathCastBooleanToNumber:
 4507|  31.9k|xmlXPathCastBooleanToNumber(int val) {
 4508|  31.9k|    if (val)
  ------------------
  |  Branch (4508:9): [True: 4.20k, False: 27.7k]
  ------------------
 4509|  4.20k|	return(1.0);
 4510|  27.7k|    return(0.0);
 4511|  31.9k|}
xmlXPathCastStringToNumber:
 4520|   686k|xmlXPathCastStringToNumber(const xmlChar * val) {
 4521|   686k|    return(xmlXPathStringEvalNumber(val));
 4522|   686k|}
xmlXPathCastNumberToBoolean:
 4617|  59.5k|xmlXPathCastNumberToBoolean (double val) {
 4618|  59.5k|     if (xmlXPathIsNaN(val) || (val == 0.0))
  ------------------
  |  Branch (4618:10): [True: 47.3k, False: 12.1k]
  |  Branch (4618:32): [True: 1.84k, False: 10.3k]
  ------------------
 4619|  49.1k|	 return(0);
 4620|  10.3k|     return(1);
 4621|  59.5k|}
xmlXPathCastStringToBoolean:
 4630|     55|xmlXPathCastStringToBoolean (const xmlChar *val) {
 4631|     55|    if ((val == NULL) || (xmlStrlen(val) == 0))
  ------------------
  |  Branch (4631:9): [True: 0, False: 55]
  |  Branch (4631:26): [True: 18, False: 37]
  ------------------
 4632|     18|	return(0);
 4633|     37|    return(1);
 4634|     55|}
xmlXPathCastNodeSetToBoolean:
 4643|  10.5k|xmlXPathCastNodeSetToBoolean (xmlNodeSet *ns) {
 4644|  10.5k|    if ((ns == NULL) || (ns->nodeNr == 0))
  ------------------
  |  Branch (4644:9): [True: 0, False: 10.5k]
  |  Branch (4644:25): [True: 9.02k, False: 1.49k]
  ------------------
 4645|  9.02k|	return(0);
 4646|  1.49k|    return(1);
 4647|  10.5k|}
xmlXPathCastToBoolean:
 4656|  13.6k|xmlXPathCastToBoolean (xmlXPathObject *val) {
 4657|  13.6k|    int ret = 0;
 4658|       |
 4659|  13.6k|    if (val == NULL)
  ------------------
  |  Branch (4659:9): [True: 0, False: 13.6k]
  ------------------
 4660|      0|	return(0);
 4661|  13.6k|    switch (val->type) {
  ------------------
  |  Branch (4661:13): [True: 13.6k, False: 0]
  ------------------
 4662|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (4662:5): [True: 0, False: 13.6k]
  ------------------
 4663|      0|	ret = 0;
 4664|      0|	break;
 4665|  10.5k|    case XPATH_NODESET:
  ------------------
  |  Branch (4665:5): [True: 10.5k, False: 3.11k]
  ------------------
 4666|  10.5k|    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (4666:5): [True: 0, False: 13.6k]
  ------------------
 4667|  10.5k|	ret = xmlXPathCastNodeSetToBoolean(val->nodesetval);
 4668|  10.5k|	break;
 4669|     55|    case XPATH_STRING:
  ------------------
  |  Branch (4669:5): [True: 55, False: 13.5k]
  ------------------
 4670|     55|	ret = xmlXPathCastStringToBoolean(val->stringval);
 4671|     55|	break;
 4672|  3.06k|    case XPATH_NUMBER:
  ------------------
  |  Branch (4672:5): [True: 3.06k, False: 10.5k]
  ------------------
 4673|  3.06k|	ret = xmlXPathCastNumberToBoolean(val->floatval);
 4674|  3.06k|	break;
 4675|      0|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (4675:5): [True: 0, False: 13.6k]
  ------------------
 4676|      0|	ret = val->boolval;
 4677|      0|	break;
 4678|      0|    case XPATH_USERS:
  ------------------
  |  Branch (4678:5): [True: 0, False: 13.6k]
  ------------------
 4679|       |	/* TODO */
 4680|      0|	ret = 0;
 4681|      0|	break;
 4682|  13.6k|    }
 4683|  13.6k|    return(ret);
 4684|  13.6k|}
xmlXPathNewContext:
 4720|  6.95k|xmlXPathNewContext(xmlDoc *doc) {
 4721|  6.95k|    xmlXPathContextPtr ret;
 4722|       |
 4723|  6.95k|    ret = (xmlXPathContextPtr) xmlMalloc(sizeof(xmlXPathContext));
 4724|  6.95k|    if (ret == NULL)
  ------------------
  |  Branch (4724:9): [True: 26, False: 6.92k]
  ------------------
 4725|     26|	return(NULL);
 4726|  6.92k|    memset(ret, 0 , sizeof(xmlXPathContext));
 4727|  6.92k|    ret->doc = doc;
 4728|  6.92k|    ret->node = NULL;
 4729|       |
 4730|  6.92k|    ret->varHash = NULL;
 4731|       |
 4732|  6.92k|    ret->nb_types = 0;
 4733|  6.92k|    ret->max_types = 0;
 4734|  6.92k|    ret->types = NULL;
 4735|       |
 4736|  6.92k|    ret->nb_axis = 0;
 4737|  6.92k|    ret->max_axis = 0;
 4738|  6.92k|    ret->axis = NULL;
 4739|       |
 4740|  6.92k|    ret->nsHash = NULL;
 4741|  6.92k|    ret->user = NULL;
 4742|       |
 4743|  6.92k|    ret->contextSize = -1;
 4744|  6.92k|    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|  6.92k|    return(ret);
 4754|  6.95k|}
xmlXPathFreeContext:
 4762|  6.92k|xmlXPathFreeContext(xmlXPathContext *ctxt) {
 4763|  6.92k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (4763:9): [True: 0, False: 6.92k]
  ------------------
 4764|       |
 4765|  6.92k|    if (ctxt->cache != NULL)
  ------------------
  |  Branch (4765:9): [True: 0, False: 6.92k]
  ------------------
 4766|      0|	xmlXPathFreeCache((xmlXPathContextCachePtr) ctxt->cache);
 4767|  6.92k|    xmlXPathRegisteredNsCleanup(ctxt);
 4768|  6.92k|    xmlXPathRegisteredFuncsCleanup(ctxt);
 4769|  6.92k|    xmlXPathRegisteredVariablesCleanup(ctxt);
 4770|  6.92k|    xmlResetError(&ctxt->lastError);
 4771|  6.92k|    xmlFree(ctxt);
 4772|  6.92k|}
xmlXPathSetErrorHandler:
 4785|  6.92k|                        xmlStructuredErrorFunc handler, void *data) {
 4786|  6.92k|    if (ctxt == NULL)
  ------------------
  |  Branch (4786:9): [True: 0, False: 6.92k]
  ------------------
 4787|      0|        return;
 4788|       |
 4789|  6.92k|    ctxt->error = handler;
 4790|  6.92k|    ctxt->userData = data;
 4791|  6.92k|}
xmlXPathNewParserContext:
 4807|  11.2k|xmlXPathNewParserContext(const xmlChar *str, xmlXPathContext *ctxt) {
 4808|  11.2k|    xmlXPathParserContextPtr ret;
 4809|       |
 4810|  11.2k|    ret = (xmlXPathParserContextPtr) xmlMalloc(sizeof(xmlXPathParserContext));
 4811|  11.2k|    if (ret == NULL) {
  ------------------
  |  Branch (4811:9): [True: 40, False: 11.2k]
  ------------------
 4812|     40|        xmlXPathErrMemory(ctxt);
 4813|     40|	return(NULL);
 4814|     40|    }
 4815|  11.2k|    memset(ret, 0 , sizeof(xmlXPathParserContext));
 4816|  11.2k|    ret->cur = ret->base = str;
 4817|  11.2k|    ret->context = ctxt;
 4818|       |
 4819|  11.2k|    ret->comp = xmlXPathNewCompExpr();
 4820|  11.2k|    if (ret->comp == NULL) {
  ------------------
  |  Branch (4820:9): [True: 51, False: 11.2k]
  ------------------
 4821|     51|        xmlXPathErrMemory(ctxt);
 4822|     51|	xmlFree(ret->valueTab);
 4823|     51|	xmlFree(ret);
 4824|     51|	return(NULL);
 4825|     51|    }
 4826|  11.2k|    if ((ctxt != NULL) && (ctxt->dict != NULL)) {
  ------------------
  |  Branch (4826:9): [True: 11.2k, False: 0]
  |  Branch (4826:27): [True: 0, False: 11.2k]
  ------------------
 4827|      0|        ret->comp->dict = ctxt->dict;
 4828|      0|	xmlDictReference(ret->comp->dict);
 4829|      0|    }
 4830|       |
 4831|  11.2k|    return(ret);
 4832|  11.2k|}
xmlXPathFreeParserContext:
 4879|  11.2k|xmlXPathFreeParserContext(xmlXPathParserContext *ctxt) {
 4880|  11.2k|    int i;
 4881|       |
 4882|  11.2k|    if (ctxt == NULL)
  ------------------
  |  Branch (4882:9): [True: 0, False: 11.2k]
  ------------------
 4883|      0|        return;
 4884|       |
 4885|  11.2k|    if (ctxt->valueTab != NULL) {
  ------------------
  |  Branch (4885:9): [True: 11.1k, False: 27]
  ------------------
 4886|  20.3k|        for (i = 0; i < ctxt->valueNr; i++) {
  ------------------
  |  Branch (4886:21): [True: 9.18k, False: 11.1k]
  ------------------
 4887|  9.18k|            if (ctxt->context)
  ------------------
  |  Branch (4887:17): [True: 9.18k, False: 0]
  ------------------
 4888|  9.18k|                xmlXPathReleaseObject(ctxt->context, ctxt->valueTab[i]);
 4889|      0|            else
 4890|      0|                xmlXPathFreeObject(ctxt->valueTab[i]);
 4891|  9.18k|        }
 4892|  11.1k|        xmlFree(ctxt->valueTab);
 4893|  11.1k|    }
 4894|  11.2k|    if (ctxt->comp != NULL) {
  ------------------
  |  Branch (4894:9): [True: 11.2k, 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.2k|	xmlXPathFreeCompExpr(ctxt->comp);
 4902|  11.2k|    }
 4903|  11.2k|    xmlFree(ctxt);
 4904|  11.2k|}
xmlXPathEqualValues:
 5702|   392k|xmlXPathEqualValues(xmlXPathParserContext *ctxt) {
 5703|   392k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5704|   392k|    int ret = 0;
 5705|       |
 5706|   392k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5706:9): [True: 0, False: 392k]
  |  Branch (5706:27): [True: 0, False: 392k]
  ------------------
 5707|   392k|    arg2 = xmlXPathValuePop(ctxt);
 5708|   392k|    arg1 = xmlXPathValuePop(ctxt);
 5709|   392k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5709:9): [True: 0, False: 392k]
  |  Branch (5709:27): [True: 0, False: 392k]
  ------------------
 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|   392k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5717:9): [True: 0, False: 392k]
  ------------------
 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|   392k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5725:9): [True: 133k, False: 258k]
  |  Branch (5725:42): [True: 0, False: 258k]
  ------------------
 5726|   258k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5726:7): [True: 33.2k, False: 225k]
  |  Branch (5726:40): [True: 0, False: 225k]
  ------------------
 5727|       |	/*
 5728|       |	 *Hack it to assure arg1 is the nodeset
 5729|       |	 */
 5730|   166k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5730:6): [True: 102k, False: 64.3k]
  |  Branch (5730:39): [True: 102k, False: 0]
  ------------------
 5731|   102k|		argtmp = arg2;
 5732|   102k|		arg2 = arg1;
 5733|   102k|		arg1 = argtmp;
 5734|   102k|	}
 5735|   166k|	switch (arg2->type) {
  ------------------
  |  Branch (5735:10): [True: 166k, False: 0]
  ------------------
 5736|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5736:6): [True: 0, False: 166k]
  ------------------
 5737|      0|		break;
 5738|  31.1k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5738:6): [True: 31.1k, False: 135k]
  ------------------
 5739|  31.1k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5739:6): [True: 0, False: 166k]
  ------------------
 5740|  31.1k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 0);
 5741|  31.1k|		break;
 5742|  96.4k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5742:6): [True: 96.4k, False: 70.2k]
  ------------------
 5743|  96.4k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5743:7): [True: 0, False: 96.4k]
  ------------------
 5744|  96.4k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5744:5): [True: 53.9k, False: 42.4k]
  ------------------
 5745|  42.4k|		else
 5746|  42.4k|		    ret = 1;
 5747|  96.4k|		ret = (ret == arg2->boolval);
 5748|  96.4k|		break;
 5749|  32.4k|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5749:6): [True: 32.4k, False: 134k]
  ------------------
 5750|  32.4k|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 0);
 5751|  32.4k|		break;
 5752|  6.74k|	    case XPATH_STRING:
  ------------------
  |  Branch (5752:6): [True: 6.74k, False: 159k]
  ------------------
 5753|  6.74k|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5754|  6.74k|                                                 arg2->stringval, 0);
 5755|  6.74k|		break;
 5756|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5756:6): [True: 0, False: 166k]
  ------------------
 5757|       |		/* TODO */
 5758|      0|		break;
 5759|   166k|	}
 5760|   166k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5761|   166k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5762|   166k|	return(ret);
 5763|   166k|    }
 5764|       |
 5765|   225k|    return (xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5766|   392k|}
xmlXPathNotEqualValues:
 5775|  6.44k|xmlXPathNotEqualValues(xmlXPathParserContext *ctxt) {
 5776|  6.44k|    xmlXPathObjectPtr arg1, arg2, argtmp;
 5777|  6.44k|    int ret = 0;
 5778|       |
 5779|  6.44k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5779:9): [True: 0, False: 6.44k]
  |  Branch (5779:27): [True: 0, False: 6.44k]
  ------------------
 5780|  6.44k|    arg2 = xmlXPathValuePop(ctxt);
 5781|  6.44k|    arg1 = xmlXPathValuePop(ctxt);
 5782|  6.44k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5782:9): [True: 0, False: 6.44k]
  |  Branch (5782:27): [True: 0, False: 6.44k]
  ------------------
 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.44k|    if (arg1 == arg2) {
  ------------------
  |  Branch (5790:9): [True: 0, False: 6.44k]
  ------------------
 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.44k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5798:9): [True: 3.37k, False: 3.07k]
  |  Branch (5798:42): [True: 0, False: 3.07k]
  ------------------
 5799|  4.42k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5799:7): [True: 1.04k, False: 2.02k]
  |  Branch (5799:40): [True: 0, False: 2.02k]
  ------------------
 5800|       |	/*
 5801|       |	 *Hack it to assure arg1 is the nodeset
 5802|       |	 */
 5803|  4.42k|	if ((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5803:6): [True: 2.06k, False: 2.36k]
  |  Branch (5803:39): [True: 2.06k, False: 0]
  ------------------
 5804|  2.06k|		argtmp = arg2;
 5805|  2.06k|		arg2 = arg1;
 5806|  2.06k|		arg1 = argtmp;
 5807|  2.06k|	}
 5808|  4.42k|	switch (arg2->type) {
  ------------------
  |  Branch (5808:10): [True: 4.42k, False: 0]
  ------------------
 5809|      0|	    case XPATH_UNDEFINED:
  ------------------
  |  Branch (5809:6): [True: 0, False: 4.42k]
  ------------------
 5810|      0|		break;
 5811|  1.31k|	    case XPATH_NODESET:
  ------------------
  |  Branch (5811:6): [True: 1.31k, False: 3.11k]
  ------------------
 5812|  1.31k|	    case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5812:6): [True: 0, False: 4.42k]
  ------------------
 5813|  1.31k|		ret = xmlXPathEqualNodeSets(ctxt, arg1, arg2, 1);
 5814|  1.31k|		break;
 5815|  1.60k|	    case XPATH_BOOLEAN:
  ------------------
  |  Branch (5815:6): [True: 1.60k, False: 2.82k]
  ------------------
 5816|  1.60k|		if ((arg1->nodesetval == NULL) ||
  ------------------
  |  Branch (5816:7): [True: 0, False: 1.60k]
  ------------------
 5817|  1.60k|		  (arg1->nodesetval->nodeNr == 0)) ret = 0;
  ------------------
  |  Branch (5817:5): [True: 1.45k, False: 144]
  ------------------
 5818|    144|		else
 5819|    144|		    ret = 1;
 5820|  1.60k|		ret = (ret != arg2->boolval);
 5821|  1.60k|		break;
 5822|    737|	    case XPATH_NUMBER:
  ------------------
  |  Branch (5822:6): [True: 737, False: 3.68k]
  ------------------
 5823|    737|		ret = xmlXPathEqualNodeSetFloat(ctxt, arg1, arg2->floatval, 1);
 5824|    737|		break;
 5825|    774|	    case XPATH_STRING:
  ------------------
  |  Branch (5825:6): [True: 774, False: 3.65k]
  ------------------
 5826|    774|		ret = xmlXPathEqualNodeSetString(ctxt, arg1,
 5827|    774|                                                 arg2->stringval, 1);
 5828|    774|		break;
 5829|      0|	    case XPATH_USERS:
  ------------------
  |  Branch (5829:6): [True: 0, False: 4.42k]
  ------------------
 5830|       |		/* TODO */
 5831|      0|		break;
 5832|  4.42k|	}
 5833|  4.42k|	xmlXPathReleaseObject(ctxt->context, arg1);
 5834|  4.42k|	xmlXPathReleaseObject(ctxt->context, arg2);
 5835|  4.42k|	return(ret);
 5836|  4.42k|    }
 5837|       |
 5838|  2.02k|    return (!xmlXPathEqualValuesCommon(ctxt, arg1, arg2));
 5839|  6.44k|}
xmlXPathCompareValues:
 5864|   274k|xmlXPathCompareValues(xmlXPathParserContext *ctxt, int inf, int strict) {
 5865|   274k|    int ret = 0, arg1i = 0, arg2i = 0;
 5866|   274k|    xmlXPathObjectPtr arg1, arg2;
 5867|       |
 5868|   274k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
  ------------------
  |  Branch (5868:9): [True: 0, False: 274k]
  |  Branch (5868:27): [True: 0, False: 274k]
  ------------------
 5869|   274k|    arg2 = xmlXPathValuePop(ctxt);
 5870|   274k|    arg1 = xmlXPathValuePop(ctxt);
 5871|   274k|    if ((arg1 == NULL) || (arg2 == NULL)) {
  ------------------
  |  Branch (5871:9): [True: 8, False: 274k]
  |  Branch (5871:27): [True: 0, False: 274k]
  ------------------
 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|   274k|    if ((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE) ||
  ------------------
  |  Branch (5879:9): [True: 137k, False: 137k]
  |  Branch (5879:42): [True: 0, False: 137k]
  ------------------
 5880|   155k|      (arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5880:7): [True: 18.5k, False: 118k]
  |  Branch (5880:40): [True: 0, False: 118k]
  ------------------
 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|   155k|	if (((arg2->type == XPATH_NODESET) || (arg2->type == XPATH_XSLT_TREE)) &&
  ------------------
  |  Branch (5886:7): [True: 137k, False: 18.5k]
  |  Branch (5886:40): [True: 0, False: 18.5k]
  ------------------
 5887|   137k|	  ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE))){
  ------------------
  |  Branch (5887:5): [True: 85.0k, False: 52.2k]
  |  Branch (5887:38): [True: 0, False: 52.2k]
  ------------------
 5888|  85.0k|	    ret = xmlXPathCompareNodeSets(ctxt, inf, strict, arg1, arg2);
 5889|  85.0k|	} else {
 5890|  70.8k|	    if ((arg1->type == XPATH_NODESET) || (arg1->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (5890:10): [True: 18.5k, False: 52.2k]
  |  Branch (5890:43): [True: 0, False: 52.2k]
  ------------------
 5891|  18.5k|		ret = xmlXPathCompareNodeSetValue(ctxt, inf, strict,
 5892|  18.5k|			                          arg1, arg2);
 5893|  52.2k|	    } else {
 5894|  52.2k|		ret = xmlXPathCompareNodeSetValue(ctxt, !inf, strict,
 5895|  52.2k|			                          arg2, arg1);
 5896|  52.2k|	    }
 5897|  70.8k|	}
 5898|   155k|	return(ret);
 5899|   155k|    }
 5900|       |
 5901|   118k|    if (arg1->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5901:9): [True: 14.9k, False: 103k]
  ------------------
 5902|  14.9k|	xmlXPathValuePush(ctxt, arg1);
 5903|  14.9k|	xmlXPathNumberFunction(ctxt, 1);
 5904|  14.9k|	arg1 = xmlXPathValuePop(ctxt);
 5905|  14.9k|    }
 5906|   118k|    if (arg2->type != XPATH_NUMBER) {
  ------------------
  |  Branch (5906:9): [True: 11.4k, False: 107k]
  ------------------
 5907|  11.4k|	xmlXPathValuePush(ctxt, arg2);
 5908|  11.4k|	xmlXPathNumberFunction(ctxt, 1);
 5909|  11.4k|	arg2 = xmlXPathValuePop(ctxt);
 5910|  11.4k|    }
 5911|   118k|    if (ctxt->error)
  ------------------
  |  Branch (5911:9): [True: 277, False: 118k]
  ------------------
 5912|    277|        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|   118k|    if (xmlXPathIsNaN(arg1->floatval) || xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5918:9): [True: 88.4k, False: 30.2k]
  |  Branch (5918:42): [True: 2.71k, False: 27.5k]
  ------------------
 5919|  91.1k|	ret=0;
 5920|  91.1k|    } else {
 5921|  27.5k|	arg1i=xmlXPathIsInf(arg1->floatval);
 5922|  27.5k|	arg2i=xmlXPathIsInf(arg2->floatval);
 5923|  27.5k|	if (inf && strict) {
  ------------------
  |  Branch (5923:6): [True: 16.7k, False: 10.8k]
  |  Branch (5923:13): [True: 14.2k, False: 2.48k]
  ------------------
 5924|  14.2k|	    if ((arg1i == -1 && arg2i != -1) ||
  ------------------
  |  Branch (5924:11): [True: 618, False: 13.5k]
  |  Branch (5924:26): [True: 364, False: 254]
  ------------------
 5925|  13.8k|		(arg2i == 1 && arg1i != 1)) {
  ------------------
  |  Branch (5925:4): [True: 575, False: 13.2k]
  |  Branch (5925:18): [True: 331, False: 244]
  ------------------
 5926|    695|		ret = 1;
 5927|  13.5k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5927:17): [True: 12.8k, False: 700]
  |  Branch (5927:31): [True: 12.2k, False: 546]
  ------------------
 5928|  12.2k|		ret = (arg1->floatval < arg2->floatval);
 5929|  12.2k|	    } else {
 5930|  1.24k|		ret = 0;
 5931|  1.24k|	    }
 5932|  14.2k|	}
 5933|  13.3k|	else if (inf && !strict) {
  ------------------
  |  Branch (5933:11): [True: 2.48k, False: 10.8k]
  |  Branch (5933:18): [True: 2.48k, False: 0]
  ------------------
 5934|  2.48k|	    if (arg1i == -1 || arg2i == 1) {
  ------------------
  |  Branch (5934:10): [True: 1.09k, False: 1.39k]
  |  Branch (5934:25): [True: 382, False: 1.01k]
  ------------------
 5935|  1.47k|		ret = 1;
 5936|  1.47k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5936:17): [True: 709, False: 303]
  |  Branch (5936:31): [True: 448, False: 261]
  ------------------
 5937|    448|		ret = (arg1->floatval <= arg2->floatval);
 5938|    564|	    } else {
 5939|    564|		ret = 0;
 5940|    564|	    }
 5941|  2.48k|	}
 5942|  10.8k|	else if (!inf && strict) {
  ------------------
  |  Branch (5942:11): [True: 10.8k, False: 0]
  |  Branch (5942:19): [True: 5.29k, False: 5.52k]
  ------------------
 5943|  5.29k|	    if ((arg1i == 1 && arg2i != 1) ||
  ------------------
  |  Branch (5943:11): [True: 1.08k, False: 4.21k]
  |  Branch (5943:25): [True: 533, False: 550]
  ------------------
 5944|  4.76k|		(arg2i == -1 && arg1i != -1)) {
  ------------------
  |  Branch (5944:4): [True: 623, False: 4.13k]
  |  Branch (5944:19): [True: 534, False: 89]
  ------------------
 5945|  1.06k|		ret = 1;
 5946|  4.22k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5946:17): [True: 3.33k, False: 893]
  |  Branch (5946:31): [True: 2.97k, False: 357]
  ------------------
 5947|  2.97k|		ret = (arg1->floatval > arg2->floatval);
 5948|  2.97k|	    } else {
 5949|  1.25k|		ret = 0;
 5950|  1.25k|	    }
 5951|  5.29k|	}
 5952|  5.52k|	else if (!inf && !strict) {
  ------------------
  |  Branch (5952:11): [True: 5.52k, False: 0]
  |  Branch (5952:19): [True: 5.52k, False: 0]
  ------------------
 5953|  5.52k|	    if (arg1i == 1 || arg2i == -1) {
  ------------------
  |  Branch (5953:10): [True: 2.70k, False: 2.82k]
  |  Branch (5953:24): [True: 376, False: 2.44k]
  ------------------
 5954|  3.08k|		ret = 1;
 5955|  3.08k|	    } else if (arg1i == 0 && arg2i == 0) {
  ------------------
  |  Branch (5955:17): [True: 2.19k, False: 250]
  |  Branch (5955:31): [True: 1.93k, False: 258]
  ------------------
 5956|  1.93k|		ret = (arg1->floatval >= arg2->floatval);
 5957|  1.93k|	    } else {
 5958|    508|		ret = 0;
 5959|    508|	    }
 5960|  5.52k|	}
 5961|  27.5k|    }
 5962|   118k|error:
 5963|   118k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5964|   118k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5965|   118k|    return(ret);
 5966|   118k|}
xmlXPathValueFlipSign:
 5976|   107k|xmlXPathValueFlipSign(xmlXPathParserContext *ctxt) {
 5977|   107k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return;
  ------------------
  |  Branch (5977:9): [True: 0, False: 107k]
  |  Branch (5977:27): [True: 0, False: 107k]
  ------------------
 5978|   107k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   107k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 107k, False: 0]
  |  |  |  Branch (297:34): [True: 66.1k, False: 41.0k]
  |  |  ------------------
  |  |  298|   107k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 5979|   107k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   107k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 3, False: 107k]
  |  |  |  Branch (261:34): [True: 14, False: 107k]
  |  |  ------------------
  |  |  262|   107k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|     17|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 5980|   107k|    ctxt->value->floatval = -ctxt->value->floatval;
 5981|   107k|}
xmlXPathAddValues:
 5991|  69.4k|xmlXPathAddValues(xmlXPathParserContext *ctxt) {
 5992|  69.4k|    xmlXPathObjectPtr arg;
 5993|  69.4k|    double val;
 5994|       |
 5995|  69.4k|    arg = xmlXPathValuePop(ctxt);
 5996|  69.4k|    if (arg == NULL)
  ------------------
  |  Branch (5996:9): [True: 0, False: 69.4k]
  ------------------
 5997|  69.4k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 5998|  69.4k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 5999|  69.4k|    xmlXPathReleaseObject(ctxt->context, arg);
 6000|  69.4k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  69.4k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 69.4k, False: 0]
  |  |  |  Branch (297:34): [True: 56.3k, False: 13.0k]
  |  |  ------------------
  |  |  298|  69.4k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6001|  69.4k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  69.4k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 5, False: 69.4k]
  |  |  |  Branch (261:34): [True: 2, False: 69.4k]
  |  |  ------------------
  |  |  262|  69.4k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6002|  69.4k|    ctxt->value->floatval += val;
 6003|  69.4k|}
xmlXPathSubValues:
 6013|  70.6k|xmlXPathSubValues(xmlXPathParserContext *ctxt) {
 6014|  70.6k|    xmlXPathObjectPtr arg;
 6015|  70.6k|    double val;
 6016|       |
 6017|  70.6k|    arg = xmlXPathValuePop(ctxt);
 6018|  70.6k|    if (arg == NULL)
  ------------------
  |  Branch (6018:9): [True: 0, False: 70.6k]
  ------------------
 6019|  70.6k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6020|  70.6k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6021|  70.6k|    xmlXPathReleaseObject(ctxt->context, arg);
 6022|  70.6k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  70.6k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 70.6k, False: 0]
  |  |  |  Branch (297:34): [True: 28.8k, False: 41.8k]
  |  |  ------------------
  |  |  298|  70.6k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6023|  70.6k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  70.6k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 70.6k]
  |  |  |  Branch (261:34): [True: 6, False: 70.6k]
  |  |  ------------------
  |  |  262|  70.6k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      7|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6024|  70.6k|    ctxt->value->floatval -= val;
 6025|  70.6k|}
xmlXPathMultValues:
 6035|   157k|xmlXPathMultValues(xmlXPathParserContext *ctxt) {
 6036|   157k|    xmlXPathObjectPtr arg;
 6037|   157k|    double val;
 6038|       |
 6039|   157k|    arg = xmlXPathValuePop(ctxt);
 6040|   157k|    if (arg == NULL)
  ------------------
  |  Branch (6040:9): [True: 0, False: 157k]
  ------------------
 6041|   157k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6042|   157k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6043|   157k|    xmlXPathReleaseObject(ctxt->context, arg);
 6044|   157k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|   157k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 157k, False: 0]
  |  |  |  Branch (297:34): [True: 76.8k, False: 80.7k]
  |  |  ------------------
  |  |  298|   157k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6045|   157k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|   157k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 4, False: 157k]
  |  |  |  Branch (261:34): [True: 2, False: 157k]
  |  |  ------------------
  |  |  262|   157k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      6|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6046|   157k|    ctxt->value->floatval *= val;
 6047|   157k|}
xmlXPathDivValues:
 6058|  3.56k|xmlXPathDivValues(xmlXPathParserContext *ctxt) {
 6059|  3.56k|    xmlXPathObjectPtr arg;
 6060|  3.56k|    double val;
 6061|       |
 6062|  3.56k|    arg = xmlXPathValuePop(ctxt);
 6063|  3.56k|    if (arg == NULL)
  ------------------
  |  Branch (6063:9): [True: 0, False: 3.56k]
  ------------------
 6064|  3.56k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6065|  3.56k|    val = xmlXPathCastToNumberInternal(ctxt, arg);
 6066|  3.56k|    xmlXPathReleaseObject(ctxt->context, arg);
 6067|  3.56k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  3.56k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 3.56k, False: 0]
  |  |  |  Branch (297:34): [True: 1.91k, False: 1.64k]
  |  |  ------------------
  |  |  298|  3.56k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6068|  3.56k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  3.56k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 3.56k]
  |  |  |  Branch (261:34): [True: 1, False: 3.56k]
  |  |  ------------------
  |  |  262|  3.56k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6069|  3.56k|    ctxt->value->floatval /= val;
 6070|  3.56k|}
xmlXPathModValues:
 6080|  1.43k|xmlXPathModValues(xmlXPathParserContext *ctxt) {
 6081|  1.43k|    xmlXPathObjectPtr arg;
 6082|  1.43k|    double arg1, arg2;
 6083|       |
 6084|  1.43k|    arg = xmlXPathValuePop(ctxt);
 6085|  1.43k|    if (arg == NULL)
  ------------------
  |  Branch (6085:9): [True: 0, False: 1.43k]
  ------------------
 6086|  1.43k|	XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6087|  1.43k|    arg2 = xmlXPathCastToNumberInternal(ctxt, arg);
 6088|  1.43k|    xmlXPathReleaseObject(ctxt->context, arg);
 6089|  1.43k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  1.43k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 1.43k, False: 0]
  |  |  |  Branch (297:34): [True: 717, False: 718]
  |  |  ------------------
  |  |  298|  1.43k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 6090|  1.43k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  1.43k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 1.43k]
  |  |  |  Branch (261:34): [True: 1, False: 1.43k]
  |  |  ------------------
  |  |  262|  1.43k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6091|  1.43k|    arg1 = ctxt->value->floatval;
 6092|  1.43k|    if (arg2 == 0)
  ------------------
  |  Branch (6092:9): [True: 30, False: 1.40k]
  ------------------
 6093|     30|	ctxt->value->floatval = xmlXPathNAN;
 6094|  1.40k|    else {
 6095|  1.40k|	ctxt->value->floatval = fmod(arg1, arg2);
 6096|  1.40k|    }
 6097|  1.43k|}
xmlXPathNextSelf:
 6138|    872|xmlXPathNextSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6139|    872|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6139:9): [True: 0, False: 872]
  |  Branch (6139:27): [True: 0, False: 872]
  ------------------
 6140|    872|    if (cur == NULL)
  ------------------
  |  Branch (6140:9): [True: 436, False: 436]
  ------------------
 6141|    436|        return(ctxt->context->node);
 6142|    436|    return(NULL);
 6143|    872|}
xmlXPathNextChild:
 6154|   225k|xmlXPathNextChild(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6155|   225k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6155:9): [True: 0, False: 225k]
  |  Branch (6155:27): [True: 0, False: 225k]
  ------------------
 6156|   225k|    if (cur == NULL) {
  ------------------
  |  Branch (6156:9): [True: 99.9k, False: 126k]
  ------------------
 6157|  99.9k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6157:6): [True: 0, False: 99.9k]
  ------------------
 6158|  99.9k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6158:10): [True: 99.9k, False: 0]
  ------------------
 6159|  23.7k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6159:13): [True: 23.7k, False: 76.2k]
  ------------------
 6160|  71.2k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6160:13): [True: 47.5k, False: 52.4k]
  ------------------
 6161|  84.4k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6161:13): [True: 13.2k, False: 86.7k]
  ------------------
 6162|  84.4k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6162:13): [True: 0, False: 99.9k]
  ------------------
 6163|  84.4k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6163:13): [True: 0, False: 99.9k]
  ------------------
 6164|  85.8k|            case XML_PI_NODE:
  ------------------
  |  Branch (6164:13): [True: 1.45k, False: 98.4k]
  ------------------
 6165|  99.4k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6165:13): [True: 13.5k, False: 86.4k]
  ------------------
 6166|  99.4k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6166:13): [True: 0, False: 99.9k]
  ------------------
 6167|  99.4k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6167:13): [True: 0, False: 99.9k]
  ------------------
 6168|  99.4k|		return(ctxt->context->node->children);
 6169|    419|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6169:13): [True: 419, False: 99.5k]
  ------------------
 6170|    419|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6170:13): [True: 0, False: 99.9k]
  ------------------
 6171|    419|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6171:13): [True: 0, False: 99.9k]
  ------------------
 6172|    419|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6172:13): [True: 0, False: 99.9k]
  ------------------
 6173|    419|		return(((xmlDocPtr) ctxt->context->node)->children);
 6174|      0|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6174:6): [True: 0, False: 99.9k]
  ------------------
 6175|      0|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6175:6): [True: 0, False: 99.9k]
  ------------------
 6176|      0|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6176:6): [True: 0, False: 99.9k]
  ------------------
 6177|     91|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (6177:13): [True: 91, False: 99.8k]
  ------------------
 6178|     91|	    case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (6178:6): [True: 0, False: 99.9k]
  ------------------
 6179|     91|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6179:6): [True: 0, False: 99.9k]
  ------------------
 6180|     91|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6180:6): [True: 0, False: 99.9k]
  ------------------
 6181|     91|		return(NULL);
 6182|  99.9k|	}
 6183|      0|	return(NULL);
 6184|  99.9k|    }
 6185|   126k|    if ((cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (6185:9): [True: 0, False: 126k]
  ------------------
 6186|   126k|        (cur->type == XML_HTML_DOCUMENT_NODE))
  ------------------
  |  Branch (6186:9): [True: 0, False: 126k]
  ------------------
 6187|      0|	return(NULL);
 6188|   126k|    return(cur->next);
 6189|   126k|}
xmlXPathNextDescendant:
 6271|  5.27M|xmlXPathNextDescendant(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6272|  5.27M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6272:9): [True: 0, False: 5.27M]
  |  Branch (6272:27): [True: 0, False: 5.27M]
  ------------------
 6273|  5.27M|    if (cur == NULL) {
  ------------------
  |  Branch (6273:9): [True: 103k, False: 5.17M]
  ------------------
 6274|   103k|	if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6274:6): [True: 0, False: 103k]
  ------------------
 6275|      0|	    return(NULL);
 6276|   103k|	if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6276:6): [True: 328, False: 103k]
  ------------------
 6277|   103k|	    (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6277:6): [True: 6.16k, False: 96.8k]
  ------------------
 6278|  6.48k|	    return(NULL);
 6279|       |
 6280|  96.8k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6280:13): [True: 46.9k, False: 49.8k]
  ------------------
 6281|  46.9k|	    return(ctxt->context->doc->children);
 6282|  49.8k|        return(ctxt->context->node->children);
 6283|  96.8k|    }
 6284|       |
 6285|  5.17M|    if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (6285:9): [True: 0, False: 5.17M]
  ------------------
 6286|      0|        return(NULL);
 6287|  5.17M|    if (cur->children != NULL) {
  ------------------
  |  Branch (6287:9): [True: 1.30M, False: 3.86M]
  ------------------
 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: 1.97k]
  ------------------
 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.29M, False: 1.06k]
  ------------------
 6297|  1.29M|		return(cur);
 6298|  1.30M|	}
 6299|  1.30M|    }
 6300|       |
 6301|  3.87M|    if (cur == ctxt->context->node) return(NULL);
  ------------------
  |  Branch (6301:9): [True: 17.4k, False: 3.85M]
  ------------------
 6302|       |
 6303|  3.85M|    while (cur->next != NULL) {
  ------------------
  |  Branch (6303:12): [True: 3.30M, False: 548k]
  ------------------
 6304|  3.30M|	cur = cur->next;
 6305|  3.30M|	if ((cur->type != XML_ENTITY_DECL) &&
  ------------------
  |  Branch (6305:6): [True: 3.30M, False: 2.10k]
  ------------------
 6306|  3.30M|	    (cur->type != XML_DTD_NODE))
  ------------------
  |  Branch (6306:6): [True: 3.30M, False: 2.45k]
  ------------------
 6307|  3.30M|	    return(cur);
 6308|  3.30M|    }
 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: 140k, False: 1.19M]
  ------------------
 6314|  1.19M|	if (cur->next != NULL) {
  ------------------
  |  Branch (6314:6): [True: 407k, False: 784k]
  ------------------
 6315|   407k|	    cur = cur->next;
 6316|   407k|	    return(cur);
 6317|   407k|	}
 6318|  1.19M|    } while (cur != NULL);
  ------------------
  |  Branch (6318:14): [True: 784k, False: 0]
  ------------------
 6319|      0|    return(cur);
 6320|   548k|}
xmlXPathNextDescendantOrSelf:
 6334|  4.11M|xmlXPathNextDescendantOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6335|  4.11M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6335:9): [True: 0, False: 4.11M]
  |  Branch (6335:27): [True: 0, False: 4.11M]
  ------------------
 6336|  4.11M|    if (cur == NULL)
  ------------------
  |  Branch (6336:9): [True: 139k, False: 3.97M]
  ------------------
 6337|   139k|        return(ctxt->context->node);
 6338|       |
 6339|  3.97M|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6339:9): [True: 0, False: 3.97M]
  ------------------
 6340|      0|        return(NULL);
 6341|  3.97M|    if ((ctxt->context->node->type == XML_ATTRIBUTE_NODE) ||
  ------------------
  |  Branch (6341:9): [True: 560, False: 3.97M]
  ------------------
 6342|  3.97M|        (ctxt->context->node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6342:9): [True: 5.32k, False: 3.97M]
  ------------------
 6343|  5.88k|        return(NULL);
 6344|       |
 6345|  3.97M|    return(xmlXPathNextDescendant(ctxt, cur));
 6346|  3.97M|}
xmlXPathNextParent:
 6357|   314k|xmlXPathNextParent(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6358|   314k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6358:9): [True: 0, False: 314k]
  |  Branch (6358:27): [True: 0, False: 314k]
  ------------------
 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|   314k|    if (cur == NULL) {
  ------------------
  |  Branch (6364:9): [True: 162k, False: 152k]
  ------------------
 6365|   162k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6365:6): [True: 0, False: 162k]
  ------------------
 6366|   162k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6366:10): [True: 162k, False: 0]
  ------------------
 6367|   112k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6367:13): [True: 112k, False: 49.8k]
  ------------------
 6368|   149k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6368:13): [True: 36.8k, False: 125k]
  ------------------
 6369|   150k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6369:13): [True: 839, False: 161k]
  ------------------
 6370|   150k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6370:13): [True: 0, False: 162k]
  ------------------
 6371|   150k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6371:13): [True: 0, False: 162k]
  ------------------
 6372|   151k|            case XML_PI_NODE:
  ------------------
  |  Branch (6372:13): [True: 916, False: 161k]
  ------------------
 6373|   152k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6373:13): [True: 1.17k, False: 161k]
  ------------------
 6374|   152k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6374:13): [True: 0, False: 162k]
  ------------------
 6375|   152k|            case XML_DTD_NODE:
  ------------------
  |  Branch (6375:13): [True: 0, False: 162k]
  ------------------
 6376|   152k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6376:6): [True: 0, False: 162k]
  ------------------
 6377|   152k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6377:6): [True: 0, False: 162k]
  ------------------
 6378|   152k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6378:6): [True: 0, False: 162k]
  ------------------
 6379|   152k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6379:6): [True: 0, False: 162k]
  ------------------
 6380|   152k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6380:6): [True: 0, False: 162k]
  ------------------
 6381|   152k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6381:7): [True: 0, False: 152k]
  ------------------
 6382|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6383|   152k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6383:7): [True: 146k, False: 5.54k]
  ------------------
 6384|   146k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6384:8): [True: 0, False: 146k]
  ------------------
 6385|   146k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6385:8): [True: 0, False: 146k]
  ------------------
 6386|   146k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|   146k|#define BAD_CAST (xmlChar *)
  ------------------
 6387|      0|		    return(NULL);
 6388|   152k|		return(ctxt->context->node->parent);
 6389|    713|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6389:13): [True: 713, False: 161k]
  ------------------
 6390|    713|		xmlAttrPtr att = (xmlAttrPtr) ctxt->context->node;
 6391|       |
 6392|    713|		return(att->parent);
 6393|   152k|	    }
 6394|  9.09k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6394:13): [True: 9.09k, False: 153k]
  ------------------
 6395|  9.09k|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6395:13): [True: 0, False: 162k]
  ------------------
 6396|  9.09k|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6396:13): [True: 0, False: 162k]
  ------------------
 6397|  9.09k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6397:13): [True: 0, False: 162k]
  ------------------
 6398|  9.09k|                return(NULL);
 6399|    272|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6399:6): [True: 272, False: 162k]
  ------------------
 6400|    272|		xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
 6401|       |
 6402|    272|		if ((ns->next != NULL) &&
  ------------------
  |  Branch (6402:7): [True: 272, False: 0]
  ------------------
 6403|    272|		    (ns->next->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (6403:7): [True: 272, False: 0]
  ------------------
 6404|    272|		    return((xmlNodePtr) ns->next);
 6405|      0|                return(NULL);
 6406|    272|	    }
 6407|   162k|	}
 6408|   162k|    }
 6409|   152k|    return(NULL);
 6410|   314k|}
xmlXPathNextAncestor:
 6425|   128k|xmlXPathNextAncestor(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6426|   128k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6426:9): [True: 0, False: 128k]
  |  Branch (6426:27): [True: 0, False: 128k]
  ------------------
 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|   128k|    if (cur == NULL) {
  ------------------
  |  Branch (6432:9): [True: 21.4k, False: 106k]
  ------------------
 6433|  21.4k|	if (ctxt->context->node == NULL) return(NULL);
  ------------------
  |  Branch (6433:6): [True: 0, False: 21.4k]
  ------------------
 6434|  21.4k|	switch (ctxt->context->node->type) {
  ------------------
  |  Branch (6434:10): [True: 21.4k, False: 0]
  ------------------
 6435|  18.7k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6435:13): [True: 18.7k, False: 2.66k]
  ------------------
 6436|  20.3k|            case XML_TEXT_NODE:
  ------------------
  |  Branch (6436:13): [True: 1.51k, False: 19.9k]
  ------------------
 6437|  20.4k|            case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6437:13): [True: 106, False: 21.3k]
  ------------------
 6438|  20.4k|            case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6438:13): [True: 0, False: 21.4k]
  ------------------
 6439|  20.4k|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6439:13): [True: 0, False: 21.4k]
  ------------------
 6440|  20.7k|            case XML_PI_NODE:
  ------------------
  |  Branch (6440:13): [True: 379, False: 21.0k]
  ------------------
 6441|  21.0k|            case XML_COMMENT_NODE:
  ------------------
  |  Branch (6441:13): [True: 267, False: 21.1k]
  ------------------
 6442|  21.0k|	    case XML_DTD_NODE:
  ------------------
  |  Branch (6442:6): [True: 0, False: 21.4k]
  ------------------
 6443|  21.0k|	    case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6443:6): [True: 0, False: 21.4k]
  ------------------
 6444|  21.0k|	    case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6444:6): [True: 0, False: 21.4k]
  ------------------
 6445|  21.0k|	    case XML_ENTITY_DECL:
  ------------------
  |  Branch (6445:6): [True: 0, False: 21.4k]
  ------------------
 6446|  21.0k|            case XML_NOTATION_NODE:
  ------------------
  |  Branch (6446:13): [True: 0, False: 21.4k]
  ------------------
 6447|  21.0k|	    case XML_XINCLUDE_START:
  ------------------
  |  Branch (6447:6): [True: 0, False: 21.4k]
  ------------------
 6448|  21.0k|	    case XML_XINCLUDE_END:
  ------------------
  |  Branch (6448:6): [True: 0, False: 21.4k]
  ------------------
 6449|  21.0k|		if (ctxt->context->node->parent == NULL)
  ------------------
  |  Branch (6449:7): [True: 0, False: 21.0k]
  ------------------
 6450|      0|		    return((xmlNodePtr) ctxt->context->doc);
 6451|  21.0k|		if ((ctxt->context->node->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6451:7): [True: 20.3k, False: 752]
  ------------------
 6452|  20.3k|		    ((ctxt->context->node->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6452:8): [True: 0, False: 20.3k]
  ------------------
 6453|  20.3k|		     (xmlStrEqual(ctxt->context->node->parent->name,
  ------------------
  |  Branch (6453:8): [True: 0, False: 20.3k]
  ------------------
 6454|  20.3k|				 BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  20.3k|#define BAD_CAST (xmlChar *)
  ------------------
 6455|      0|		    return(NULL);
 6456|  21.0k|		return(ctxt->context->node->parent);
 6457|     10|            case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6457:13): [True: 10, False: 21.4k]
  ------------------
 6458|     10|		xmlAttrPtr tmp = (xmlAttrPtr) ctxt->context->node;
 6459|       |
 6460|     10|		return(tmp->parent);
 6461|  21.0k|	    }
 6462|    385|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6462:13): [True: 385, False: 21.0k]
  ------------------
 6463|    385|            case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6463:13): [True: 0, False: 21.4k]
  ------------------
 6464|    385|            case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6464:13): [True: 0, False: 21.4k]
  ------------------
 6465|    385|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6465:13): [True: 0, False: 21.4k]
  ------------------
 6466|    385|                return(NULL);
 6467|      0|	    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6467:6): [True: 0, False: 21.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|  21.4k|	}
 6477|      0|	return(NULL);
 6478|  21.4k|    }
 6479|   106k|    if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6479:9): [True: 4.26k, False: 102k]
  ------------------
 6480|  4.26k|	return((xmlNodePtr) ctxt->context->doc);
 6481|   102k|    if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6481:9): [True: 25.0k, False: 77.5k]
  ------------------
 6482|  25.0k|	return(NULL);
 6483|  77.5k|    switch (cur->type) {
  ------------------
  |  Branch (6483:13): [True: 77.5k, False: 0]
  ------------------
 6484|  75.4k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6484:2): [True: 75.4k, False: 2.15k]
  ------------------
 6485|  76.9k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6485:2): [True: 1.52k, False: 76.0k]
  ------------------
 6486|  77.1k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6486:2): [True: 211, False: 77.3k]
  ------------------
 6487|  77.1k|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6487:2): [True: 0, False: 77.5k]
  ------------------
 6488|  77.1k|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6488:2): [True: 0, False: 77.5k]
  ------------------
 6489|  77.5k|	case XML_PI_NODE:
  ------------------
  |  Branch (6489:2): [True: 352, False: 77.2k]
  ------------------
 6490|  77.5k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6490:2): [True: 27, False: 77.5k]
  ------------------
 6491|  77.5k|	case XML_NOTATION_NODE:
  ------------------
  |  Branch (6491:2): [True: 0, False: 77.5k]
  ------------------
 6492|  77.5k|	case XML_DTD_NODE:
  ------------------
  |  Branch (6492:2): [True: 0, False: 77.5k]
  ------------------
 6493|  77.5k|        case XML_ELEMENT_DECL:
  ------------------
  |  Branch (6493:9): [True: 0, False: 77.5k]
  ------------------
 6494|  77.5k|        case XML_ATTRIBUTE_DECL:
  ------------------
  |  Branch (6494:9): [True: 0, False: 77.5k]
  ------------------
 6495|  77.5k|        case XML_ENTITY_DECL:
  ------------------
  |  Branch (6495:9): [True: 0, False: 77.5k]
  ------------------
 6496|  77.5k|	case XML_XINCLUDE_START:
  ------------------
  |  Branch (6496:2): [True: 0, False: 77.5k]
  ------------------
 6497|  77.5k|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6497:2): [True: 0, False: 77.5k]
  ------------------
 6498|  77.5k|	    if (cur->parent == NULL)
  ------------------
  |  Branch (6498:10): [True: 0, False: 77.5k]
  ------------------
 6499|      0|		return(NULL);
 6500|  77.5k|	    if ((cur->parent->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (6500:10): [True: 57.8k, False: 19.6k]
  ------------------
 6501|  57.8k|		((cur->parent->name[0] == ' ') ||
  ------------------
  |  Branch (6501:4): [True: 0, False: 57.8k]
  ------------------
 6502|  57.8k|		 (xmlStrEqual(cur->parent->name,
  ------------------
  |  Branch (6502:4): [True: 0, False: 57.8k]
  ------------------
 6503|  57.8k|			      BAD_CAST "fake node libxslt"))))
  ------------------
  |  |   34|  57.8k|#define BAD_CAST (xmlChar *)
  ------------------
 6504|      0|		return(NULL);
 6505|  77.5k|	    return(cur->parent);
 6506|     34|	case XML_ATTRIBUTE_NODE: {
  ------------------
  |  Branch (6506:2): [True: 34, False: 77.5k]
  ------------------
 6507|     34|	    xmlAttrPtr att = (xmlAttrPtr) cur;
 6508|       |
 6509|     34|	    return(att->parent);
 6510|  77.5k|	}
 6511|      0|	case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (6511:2): [True: 0, False: 77.5k]
  ------------------
 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: 77.5k]
  ------------------
 6521|      0|	case XML_DOCUMENT_TYPE_NODE:
  ------------------
  |  Branch (6521:2): [True: 0, False: 77.5k]
  ------------------
 6522|      0|	case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6522:2): [True: 0, False: 77.5k]
  ------------------
 6523|      0|	case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6523:2): [True: 0, False: 77.5k]
  ------------------
 6524|      0|	    return(NULL);
 6525|  77.5k|    }
 6526|      0|    return(NULL);
 6527|  77.5k|}
xmlXPathNextAncestorOrSelf:
 6541|  29.6k|xmlXPathNextAncestorOrSelf(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6542|  29.6k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6542:9): [True: 0, False: 29.6k]
  |  Branch (6542:27): [True: 0, False: 29.6k]
  ------------------
 6543|  29.6k|    if (cur == NULL)
  ------------------
  |  Branch (6543:9): [True: 4.02k, False: 25.6k]
  ------------------
 6544|  4.02k|        return(ctxt->context->node);
 6545|  25.6k|    return(xmlXPathNextAncestor(ctxt, cur));
 6546|  29.6k|}
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|  5.65k|xmlXPathNextFollowing(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6623|  5.65k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6623:9): [True: 0, False: 5.65k]
  |  Branch (6623:27): [True: 0, False: 5.65k]
  ------------------
 6624|  5.65k|    if ((cur != NULL) && (cur->type  != XML_ATTRIBUTE_NODE) &&
  ------------------
  |  Branch (6624:9): [True: 4.90k, False: 753]
  |  Branch (6624:26): [True: 4.90k, False: 0]
  ------------------
 6625|  4.90k|        (cur->type != XML_NAMESPACE_DECL) && (cur->children != NULL))
  ------------------
  |  Branch (6625:9): [True: 4.90k, False: 0]
  |  Branch (6625:46): [True: 216, False: 4.68k]
  ------------------
 6626|    216|        return(cur->children);
 6627|       |
 6628|  5.44k|    if (cur == NULL) {
  ------------------
  |  Branch (6628:9): [True: 753, False: 4.68k]
  ------------------
 6629|    753|        cur = ctxt->context->node;
 6630|    753|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6630:13): [True: 38, False: 715]
  ------------------
 6631|     38|            cur = cur->parent;
 6632|    715|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6632:20): [True: 0, False: 715]
  ------------------
 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|    753|    }
 6641|       |
 6642|       |    /* ERROR */
 6643|  5.44k|    if (cur == NULL)
  ------------------
  |  Branch (6643:9): [True: 0, False: 5.44k]
  ------------------
 6644|      0|        return(NULL);
 6645|       |
 6646|  5.44k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6646:9): [True: 181, False: 5.26k]
  ------------------
 6647|    181|        return(NULL);
 6648|       |
 6649|  5.26k|    if (cur->next != NULL)
  ------------------
  |  Branch (6649:9): [True: 4.47k, False: 788]
  ------------------
 6650|  4.47k|        return(cur->next);
 6651|       |
 6652|  1.30k|    do {
 6653|  1.30k|        cur = cur->parent;
 6654|  1.30k|        if (cur == NULL)
  ------------------
  |  Branch (6654:13): [True: 0, False: 1.30k]
  ------------------
 6655|      0|            break;
 6656|  1.30k|        if (cur == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6656:13): [True: 572, False: 736]
  ------------------
 6657|    572|            return(NULL);
 6658|    736|        if (cur->next != NULL && cur->type != XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6658:13): [True: 216, False: 520]
  |  Branch (6658:34): [True: 216, False: 0]
  ------------------
 6659|    216|            return(cur->next);
 6660|    736|    } while (cur != NULL);
  ------------------
  |  Branch (6660:14): [True: 520, False: 0]
  ------------------
 6661|       |
 6662|      0|    return(cur);
 6663|    788|}
xmlXPathNextNamespace:
 6814|  95.2k|xmlXPathNextNamespace(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6815|  95.2k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6815:9): [True: 0, False: 95.2k]
  |  Branch (6815:27): [True: 0, False: 95.2k]
  ------------------
 6816|  95.2k|    if (ctxt->context->node->type != XML_ELEMENT_NODE) return(NULL);
  ------------------
  |  Branch (6816:9): [True: 7.70k, False: 87.5k]
  ------------------
 6817|  87.5k|    if (cur == NULL) {
  ------------------
  |  Branch (6817:9): [True: 26.7k, False: 60.8k]
  ------------------
 6818|  26.7k|        if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6818:13): [True: 614, False: 26.1k]
  ------------------
 6819|    614|	    xmlFree(ctxt->context->tmpNsList);
 6820|  26.7k|	ctxt->context->tmpNsNr = 0;
 6821|  26.7k|        if (xmlGetNsListSafe(ctxt->context->doc, ctxt->context->node,
  ------------------
  |  Branch (6821:13): [True: 7, False: 26.7k]
  ------------------
 6822|  26.7k|                             &ctxt->context->tmpNsList) < 0) {
 6823|      7|            xmlXPathPErrMemory(ctxt);
 6824|      7|            return(NULL);
 6825|      7|        }
 6826|  26.7k|        if (ctxt->context->tmpNsList != NULL) {
  ------------------
  |  Branch (6826:13): [True: 25.0k, False: 1.68k]
  ------------------
 6827|  60.6k|            while (ctxt->context->tmpNsList[ctxt->context->tmpNsNr] != NULL) {
  ------------------
  |  Branch (6827:20): [True: 35.6k, False: 25.0k]
  ------------------
 6828|  35.6k|                ctxt->context->tmpNsNr++;
 6829|  35.6k|            }
 6830|  25.0k|        }
 6831|  26.7k|	return((xmlNodePtr) xmlXPathXMLNamespace);
 6832|  26.7k|    }
 6833|  60.8k|    if (ctxt->context->tmpNsNr > 0) {
  ------------------
  |  Branch (6833:9): [True: 35.0k, False: 25.7k]
  ------------------
 6834|  35.0k|	return (xmlNodePtr)ctxt->context->tmpNsList[--ctxt->context->tmpNsNr];
 6835|  35.0k|    } else {
 6836|  25.7k|	if (ctxt->context->tmpNsList != NULL)
  ------------------
  |  Branch (6836:6): [True: 24.3k, False: 1.47k]
  ------------------
 6837|  24.3k|	    xmlFree(ctxt->context->tmpNsList);
 6838|  25.7k|	ctxt->context->tmpNsList = NULL;
 6839|       |	return(NULL);
 6840|  25.7k|    }
 6841|  60.8k|}
xmlXPathNextAttribute:
 6852|   301k|xmlXPathNextAttribute(xmlXPathParserContext *ctxt, xmlNode *cur) {
 6853|   301k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6853:9): [True: 0, False: 301k]
  |  Branch (6853:27): [True: 0, False: 301k]
  ------------------
 6854|   301k|    if (ctxt->context->node == NULL)
  ------------------
  |  Branch (6854:9): [True: 0, False: 301k]
  ------------------
 6855|      0|	return(NULL);
 6856|   301k|    if (ctxt->context->node->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (6856:9): [True: 58.3k, False: 243k]
  ------------------
 6857|  58.3k|	return(NULL);
 6858|   243k|    if (cur == NULL) {
  ------------------
  |  Branch (6858:9): [True: 229k, False: 13.9k]
  ------------------
 6859|   229k|        if (ctxt->context->node == (xmlNodePtr) ctxt->context->doc)
  ------------------
  |  Branch (6859:13): [True: 0, False: 229k]
  ------------------
 6860|      0|	    return(NULL);
 6861|   229k|        return((xmlNodePtr)ctxt->context->node->properties);
 6862|   229k|    }
 6863|  13.9k|    return((xmlNodePtr)cur->next);
 6864|   243k|}
xmlXPathRoot:
 6887|   385k|xmlXPathRoot(xmlXPathParserContext *ctxt) {
 6888|   385k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (6888:9): [True: 0, False: 385k]
  |  Branch (6888:27): [True: 0, False: 385k]
  ------------------
 6889|      0|	return;
 6890|   385k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 6891|   385k|                                            (xmlNodePtr) ctxt->context->doc));
 6892|   385k|}
xmlXPathLastFunction:
 6911|    571|xmlXPathLastFunction(xmlXPathParserContext *ctxt, int nargs) {
 6912|  1.71k|    CHECK_ARITY(0);
  ------------------
  |  |  280|    571|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 571]
  |  |  ------------------
  |  |  281|    571|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 570]
  |  |  ------------------
  |  |  282|    571|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    570|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 570]
  |  |  ------------------
  |  |  284|    570|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6913|  1.71k|    if (ctxt->context->contextSize >= 0) {
  ------------------
  |  Branch (6913:9): [True: 570, False: 0]
  ------------------
 6914|    570|	xmlXPathValuePush(ctxt,
 6915|    570|	    xmlXPathCacheNewFloat(ctxt, (double) ctxt->context->contextSize));
 6916|    570|    } else {
 6917|      0|	XP_ERROR(XPATH_INVALID_CTXT_SIZE);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6918|      0|    }
 6919|  1.71k|}
xmlXPathPositionFunction:
 6932|  3.80k|xmlXPathPositionFunction(xmlXPathParserContext *ctxt, int nargs) {
 6933|  11.4k|    CHECK_ARITY(0);
  ------------------
  |  |  280|  3.80k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 3.80k]
  |  |  ------------------
  |  |  281|  3.80k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 3.80k]
  |  |  ------------------
  |  |  282|  3.80k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  3.80k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 3.80k]
  |  |  ------------------
  |  |  284|  3.80k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6934|  11.4k|    if (ctxt->context->proximityPosition >= 0) {
  ------------------
  |  Branch (6934:9): [True: 3.80k, False: 0]
  ------------------
 6935|  3.80k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6936|  3.80k|            (double) ctxt->context->proximityPosition));
 6937|  3.80k|    } else {
 6938|      0|	XP_ERROR(XPATH_INVALID_CTXT_POSITION);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6939|      0|    }
 6940|  11.4k|}
xmlXPathCountFunction:
 6950|     53|xmlXPathCountFunction(xmlXPathParserContext *ctxt, int nargs) {
 6951|     53|    xmlXPathObjectPtr cur;
 6952|       |
 6953|    151|    CHECK_ARITY(1);
  ------------------
  |  |  280|     53|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 53]
  |  |  ------------------
  |  |  281|     53|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 49]
  |  |  ------------------
  |  |  282|     53|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     49|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 49]
  |  |  ------------------
  |  |  284|     49|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 6954|    151|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (6954:9): [True: 0, False: 49]
  ------------------
 6955|     49|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (6955:3): [True: 3, False: 46]
  ------------------
 6956|      3|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (6956:3): [True: 3, False: 0]
  ------------------
 6957|     46|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 6958|     46|    cur = xmlXPathValuePop(ctxt);
 6959|       |
 6960|     46|    if ((cur == NULL) || (cur->nodesetval == NULL))
  ------------------
  |  Branch (6960:9): [True: 0, False: 46]
  |  Branch (6960:26): [True: 0, False: 46]
  ------------------
 6961|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
 6962|     46|    else
 6963|     46|	xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 6964|     46|	    (double) cur->nodesetval->nodeNr));
 6965|     46|    xmlXPathReleaseObject(ctxt->context, cur);
 6966|     46|}
xmlXPathIdFunction:
 7047|  6.33k|xmlXPathIdFunction(xmlXPathParserContext *ctxt, int nargs) {
 7048|  6.33k|    xmlChar *tokens;
 7049|  6.33k|    xmlNodeSetPtr ret;
 7050|  6.33k|    xmlXPathObjectPtr obj;
 7051|       |
 7052|  18.9k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  6.33k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 6.33k]
  |  |  ------------------
  |  |  281|  6.33k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 6.33k]
  |  |  ------------------
  |  |  282|  6.33k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  6.33k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 8, False: 6.32k]
  |  |  ------------------
  |  |  284|  6.33k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7053|  18.9k|    obj = xmlXPathValuePop(ctxt);
 7054|  18.9k|    if (obj == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7054:9): [True: 0, False: 6.32k]
  ------------------
 7055|  6.32k|    if ((obj->type == XPATH_NODESET) || (obj->type == XPATH_XSLT_TREE)) {
  ------------------
  |  Branch (7055:9): [True: 1.60k, False: 4.71k]
  |  Branch (7055:41): [True: 0, False: 4.71k]
  ------------------
 7056|  1.60k|	xmlNodeSetPtr ns;
 7057|  1.60k|	int i;
 7058|       |
 7059|  1.60k|	ret = xmlXPathNodeSetCreate(NULL);
 7060|  1.60k|        if (ret == NULL)
  ------------------
  |  Branch (7060:13): [True: 5, False: 1.60k]
  ------------------
 7061|      5|            xmlXPathPErrMemory(ctxt);
 7062|       |
 7063|  1.60k|	if (obj->nodesetval != NULL) {
  ------------------
  |  Branch (7063:6): [True: 1.60k, False: 0]
  ------------------
 7064|  4.93k|	    for (i = 0; i < obj->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (7064:18): [True: 3.32k, False: 1.60k]
  ------------------
 7065|  3.32k|		tokens =
 7066|  3.32k|		    xmlXPathCastNodeToString(obj->nodesetval->nodeTab[i]);
 7067|  3.32k|                if (tokens == NULL)
  ------------------
  |  Branch (7067:21): [True: 8, False: 3.31k]
  ------------------
 7068|      8|                    xmlXPathPErrMemory(ctxt);
 7069|  3.32k|		ns = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7070|  3.32k|                if (ns == NULL)
  ------------------
  |  Branch (7070:21): [True: 28, False: 3.29k]
  ------------------
 7071|     28|                    xmlXPathPErrMemory(ctxt);
 7072|  3.32k|		ret = xmlXPathNodeSetMerge(ret, ns);
 7073|  3.32k|                if (ret == NULL)
  ------------------
  |  Branch (7073:21): [True: 1, False: 3.32k]
  ------------------
 7074|      1|                    xmlXPathPErrMemory(ctxt);
 7075|  3.32k|		xmlXPathFreeNodeSet(ns);
 7076|  3.32k|		if (tokens != NULL)
  ------------------
  |  Branch (7076:7): [True: 3.31k, False: 8]
  ------------------
 7077|  3.31k|		    xmlFree(tokens);
 7078|  3.32k|	    }
 7079|  1.60k|	}
 7080|  1.60k|	xmlXPathReleaseObject(ctxt->context, obj);
 7081|  1.60k|	xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7082|  1.60k|	return;
 7083|  1.60k|    }
 7084|  4.71k|    tokens = xmlXPathCastToString(obj);
 7085|  4.71k|    if (tokens == NULL)
  ------------------
  |  Branch (7085:9): [True: 5, False: 4.71k]
  ------------------
 7086|      5|        xmlXPathPErrMemory(ctxt);
 7087|  4.71k|    xmlXPathReleaseObject(ctxt->context, obj);
 7088|  4.71k|    ret = xmlXPathGetElementsByIds(ctxt->context->doc, tokens);
 7089|  4.71k|    if (ret == NULL)
  ------------------
  |  Branch (7089:9): [True: 16, False: 4.70k]
  ------------------
 7090|     16|        xmlXPathPErrMemory(ctxt);
 7091|  4.71k|    xmlFree(tokens);
 7092|  4.71k|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, ret));
 7093|  4.71k|}
xmlXPathLocalNameFunction:
 7108|  1.40k|xmlXPathLocalNameFunction(xmlXPathParserContext *ctxt, int nargs) {
 7109|  1.40k|    xmlXPathObjectPtr cur;
 7110|       |
 7111|  1.40k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7111:9): [True: 0, False: 1.40k]
  ------------------
 7112|       |
 7113|  1.40k|    if (nargs == 0) {
  ------------------
  |  Branch (7113:9): [True: 0, False: 1.40k]
  ------------------
 7114|      0|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7115|      0|	nargs = 1;
 7116|      0|    }
 7117|       |
 7118|  4.21k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  1.40k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 1.40k]
  |  |  ------------------
  |  |  281|  1.40k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 1.40k]
  |  |  ------------------
  |  |  282|  1.40k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  1.40k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 2, False: 1.40k]
  |  |  ------------------
  |  |  284|  1.40k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7119|  4.21k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7119:9): [True: 0, False: 1.40k]
  ------------------
 7120|  1.40k|	((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7120:3): [True: 1, False: 1.40k]
  ------------------
 7121|      1|	 (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7121:3): [True: 1, False: 0]
  ------------------
 7122|  1.40k|	XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7123|  1.40k|    cur = xmlXPathValuePop(ctxt);
 7124|       |
 7125|  1.40k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7125:9): [True: 0, False: 1.40k]
  |  Branch (7125:38): [True: 1, False: 1.40k]
  ------------------
 7126|      1|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7127|  1.40k|    } else {
 7128|  1.40k|	int i = 0; /* Should be first in document order !!!!! */
 7129|  1.40k|	switch (cur->nodesetval->nodeTab[i]->type) {
 7130|      1|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7130:2): [True: 1, False: 1.40k]
  ------------------
 7131|      2|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7131:2): [True: 1, False: 1.40k]
  ------------------
 7132|      2|	case XML_PI_NODE:
  ------------------
  |  Branch (7132:2): [True: 0, False: 1.40k]
  ------------------
 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.40k]
  ------------------
 7140|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7141|      0|			((xmlNsPtr)cur->nodesetval->nodeTab[i])->prefix));
 7142|      0|	    break;
 7143|  1.39k|	default:
  ------------------
  |  Branch (7143:2): [True: 1.39k, False: 2]
  ------------------
 7144|  1.39k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7145|  1.40k|	}
 7146|  1.40k|    }
 7147|  1.40k|    xmlXPathReleaseObject(ctxt->context, cur);
 7148|  1.40k|}
xmlXPathStringFunction:
 7312|  56.4k|xmlXPathStringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7313|  56.4k|    xmlXPathObjectPtr cur;
 7314|  56.4k|    xmlChar *stringval;
 7315|       |
 7316|  56.4k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7316:9): [True: 0, False: 56.4k]
  ------------------
 7317|  56.4k|    if (nargs == 0) {
  ------------------
  |  Branch (7317:9): [True: 99, False: 56.3k]
  ------------------
 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|   225k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  56.3k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 56.3k]
  |  |  ------------------
  |  |  281|  56.3k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 5, False: 56.3k]
  |  |  ------------------
  |  |  282|  56.3k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  56.3k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 56.3k]
  |  |  ------------------
  |  |  284|  56.3k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7326|   225k|    cur = xmlXPathValuePop(ctxt);
 7327|   225k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7327:9): [True: 0, False: 56.3k]
  ------------------
 7328|  56.3k|    if (cur->type != XPATH_STRING) {
  ------------------
  |  Branch (7328:9): [True: 56.3k, False: 13]
  ------------------
 7329|  56.3k|        stringval = xmlXPathCastToString(cur);
 7330|  56.3k|        if (stringval == NULL)
  ------------------
  |  Branch (7330:13): [True: 37, False: 56.3k]
  ------------------
 7331|     37|            xmlXPathPErrMemory(ctxt);
 7332|  56.3k|        xmlXPathReleaseObject(ctxt->context, cur);
 7333|  56.3k|        cur = xmlXPathCacheWrapString(ctxt, stringval);
 7334|  56.3k|    }
 7335|  56.3k|    xmlXPathValuePush(ctxt, cur);
 7336|  56.3k|}
xmlXPathStringLengthFunction:
 7350|    112|xmlXPathStringLengthFunction(xmlXPathParserContext *ctxt, int nargs) {
 7351|    112|    xmlXPathObjectPtr cur;
 7352|       |
 7353|    112|    if (nargs == 0) {
  ------------------
  |  Branch (7353:9): [True: 7, False: 105]
  ------------------
 7354|      7|        if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (7354:13): [True: 0, False: 7]
  |  Branch (7354:31): [True: 0, False: 7]
  ------------------
 7355|      0|	    return;
 7356|      7|	if (ctxt->context->node == NULL) {
  ------------------
  |  Branch (7356:6): [True: 0, False: 7]
  ------------------
 7357|      0|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0));
 7358|      7|	} else {
 7359|      7|	    xmlChar *content;
 7360|       |
 7361|      7|	    content = xmlXPathCastNodeToString(ctxt->context->node);
 7362|      7|            if (content == NULL)
  ------------------
  |  Branch (7362:17): [True: 1, False: 6]
  ------------------
 7363|      1|                xmlXPathPErrMemory(ctxt);
 7364|      7|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7365|      7|		xmlUTF8Strlen(content)));
 7366|      7|	    xmlFree(content);
 7367|      7|	}
 7368|      7|	return;
 7369|      7|    }
 7370|    414|    CHECK_ARITY(1);
  ------------------
  |  |  280|    105|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 105]
  |  |  ------------------
  |  |  281|    105|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 102]
  |  |  ------------------
  |  |  282|    105|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    102|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 102]
  |  |  ------------------
  |  |  284|    102|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7371|    414|    CAST_TO_STRING;
  ------------------
  |  |  290|    102|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 102, False: 0]
  |  |  |  Branch (290:34): [True: 92, False: 10]
  |  |  ------------------
  |  |  291|    102|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7372|    414|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    102|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 1, False: 101]
  |  |  |  Branch (261:34): [True: 1, False: 100]
  |  |  ------------------
  |  |  262|    102|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7373|    100|    cur = xmlXPathValuePop(ctxt);
 7374|    100|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt,
 7375|    100|	xmlUTF8Strlen(cur->stringval)));
 7376|    100|    xmlXPathReleaseObject(ctxt->context, cur);
 7377|    100|}
xmlXPathConcatFunction:
 7388|    554|xmlXPathConcatFunction(xmlXPathParserContext *ctxt, int nargs) {
 7389|    554|    xmlXPathObjectPtr cur, newobj;
 7390|    554|    xmlChar *tmp;
 7391|       |
 7392|    554|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7392:9): [True: 0, False: 554]
  ------------------
 7393|    554|    if (nargs < 2) {
  ------------------
  |  Branch (7393:9): [True: 6, False: 548]
  ------------------
 7394|      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; }
  |  |  ------------------
  ------------------
 7395|      6|    }
 7396|       |
 7397|    548|    CAST_TO_STRING;
  ------------------
  |  |  290|    548|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 548, False: 0]
  |  |  |  Branch (290:34): [True: 468, False: 80]
  |  |  ------------------
  |  |  291|    548|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7398|    548|    cur = xmlXPathValuePop(ctxt);
 7399|    548|    if ((cur == NULL) || (cur->type != XPATH_STRING)) {
  ------------------
  |  Branch (7399:9): [True: 0, False: 548]
  |  Branch (7399:26): [True: 2, False: 546]
  ------------------
 7400|      2|	xmlXPathReleaseObject(ctxt->context, cur);
 7401|      2|	return;
 7402|      2|    }
 7403|    546|    nargs--;
 7404|       |
 7405|  1.87k|    while (nargs > 0) {
  ------------------
  |  Branch (7405:12): [True: 1.33k, False: 544]
  ------------------
 7406|  1.33k|	CAST_TO_STRING;
  ------------------
  |  |  290|  1.33k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 1.33k, False: 0]
  |  |  |  Branch (290:34): [True: 1.29k, False: 37]
  |  |  ------------------
  |  |  291|  1.33k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7407|  1.33k|	newobj = xmlXPathValuePop(ctxt);
 7408|  1.33k|	if ((newobj == NULL) || (newobj->type != XPATH_STRING)) {
  ------------------
  |  Branch (7408:6): [True: 1, False: 1.33k]
  |  Branch (7408:26): [True: 1, False: 1.33k]
  ------------------
 7409|      2|	    xmlXPathReleaseObject(ctxt->context, newobj);
 7410|      2|	    xmlXPathReleaseObject(ctxt->context, cur);
 7411|      2|	    XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      2|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7412|      0|	}
 7413|  1.33k|	tmp = xmlStrcat(newobj->stringval, cur->stringval);
 7414|  1.33k|        if (tmp == NULL)
  ------------------
  |  Branch (7414:13): [True: 3, False: 1.32k]
  ------------------
 7415|      3|            xmlXPathPErrMemory(ctxt);
 7416|  1.33k|	newobj->stringval = cur->stringval;
 7417|  1.33k|	cur->stringval = tmp;
 7418|  1.33k|	xmlXPathReleaseObject(ctxt->context, newobj);
 7419|  1.33k|	nargs--;
 7420|  1.33k|    }
 7421|    544|    xmlXPathValuePush(ctxt, cur);
 7422|    544|}
xmlXPathStartsWithFunction:
 7467|    242|xmlXPathStartsWithFunction(xmlXPathParserContext *ctxt, int nargs) {
 7468|    242|    xmlXPathObjectPtr hay, needle;
 7469|    242|    int n;
 7470|       |
 7471|    724|    CHECK_ARITY(2);
  ------------------
  |  |  280|    242|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 242]
  |  |  ------------------
  |  |  281|    242|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 241]
  |  |  ------------------
  |  |  282|    242|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    241|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 241]
  |  |  ------------------
  |  |  284|    241|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7472|    724|    CAST_TO_STRING;
  ------------------
  |  |  290|    241|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 241, False: 0]
  |  |  |  Branch (290:34): [True: 71, False: 170]
  |  |  ------------------
  |  |  291|    241|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7473|    724|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|    241|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 241]
  |  |  |  Branch (261:34): [True: 1, False: 240]
  |  |  ------------------
  |  |  262|    241|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7474|    240|    needle = xmlXPathValuePop(ctxt);
 7475|    240|    CAST_TO_STRING;
  ------------------
  |  |  290|    240|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 240, False: 0]
  |  |  |  Branch (290:34): [True: 240, False: 0]
  |  |  ------------------
  |  |  291|    240|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7476|    240|    hay = xmlXPathValuePop(ctxt);
 7477|       |
 7478|    240|    if ((hay == NULL) || (hay->type != XPATH_STRING)) {
  ------------------
  |  Branch (7478:9): [True: 1, False: 239]
  |  Branch (7478:26): [True: 1, False: 238]
  ------------------
 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|    238|    n = xmlStrlen(needle->stringval);
 7484|    238|    if (xmlStrncmp(hay->stringval, needle->stringval, n))
  ------------------
  |  Branch (7484:9): [True: 201, False: 37]
  ------------------
 7485|    201|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7486|     37|    else
 7487|     37|        xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 1));
 7488|    238|    xmlXPathReleaseObject(ctxt->context, hay);
 7489|    238|    xmlXPathReleaseObject(ctxt->context, needle);
 7490|    238|}
xmlXPathSubstringFunction:
 7520|  10.1k|xmlXPathSubstringFunction(xmlXPathParserContext *ctxt, int nargs) {
 7521|  10.1k|    xmlXPathObjectPtr str, start, len;
 7522|  10.1k|    double le=0, in;
 7523|  10.1k|    int i = 1, j = INT_MAX;
 7524|       |
 7525|  10.1k|    if (nargs < 2) {
  ------------------
  |  Branch (7525:9): [True: 8, False: 10.1k]
  ------------------
 7526|      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; }
  |  |  ------------------
  ------------------
 7527|      8|    }
 7528|  10.1k|    if (nargs > 3) {
  ------------------
  |  Branch (7528:9): [True: 3, False: 10.1k]
  ------------------
 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|  10.1k|    if (nargs == 3) {
  ------------------
  |  Branch (7534:9): [True: 4.91k, False: 5.21k]
  ------------------
 7535|  4.91k|	CAST_TO_NUMBER;
  ------------------
  |  |  297|  4.91k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 4.91k, False: 0]
  |  |  |  Branch (297:34): [True: 859, False: 4.06k]
  |  |  ------------------
  |  |  298|  4.91k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7536|  4.91k|	CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  4.91k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 4.91k]
  |  |  |  Branch (261:34): [True: 1, False: 4.91k]
  |  |  ------------------
  |  |  262|  4.91k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7537|  4.91k|	len = xmlXPathValuePop(ctxt);
 7538|  4.91k|	le = len->floatval;
 7539|  4.91k|	xmlXPathReleaseObject(ctxt->context, len);
 7540|  4.91k|    }
 7541|       |
 7542|  10.1k|    CAST_TO_NUMBER;
  ------------------
  |  |  297|  10.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 10.1k, False: 0]
  |  |  |  Branch (297:34): [True: 3.41k, False: 6.71k]
  |  |  ------------------
  |  |  298|  10.1k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 7543|  10.1k|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|  10.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 10.1k]
  |  |  |  Branch (261:34): [True: 1, False: 10.1k]
  |  |  ------------------
  |  |  262|  10.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7544|  10.1k|    start = xmlXPathValuePop(ctxt);
 7545|  10.1k|    in = start->floatval;
 7546|  10.1k|    xmlXPathReleaseObject(ctxt->context, start);
 7547|  10.1k|    CAST_TO_STRING;
  ------------------
  |  |  290|  10.1k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 10.1k, False: 2]
  |  |  |  Branch (290:34): [True: 10.1k, False: 1]
  |  |  ------------------
  |  |  291|  10.1k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7548|  10.1k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  10.1k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 10.1k]
  |  |  |  Branch (261:34): [True: 6, False: 10.1k]
  |  |  ------------------
  |  |  262|  10.1k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      8|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7549|  10.1k|    str = xmlXPathValuePop(ctxt);
 7550|       |
 7551|  10.1k|    if (!(in < INT_MAX)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7551:9): [True: 917, False: 9.20k]
  ------------------
 7552|    917|        i = INT_MAX;
 7553|  9.20k|    } else if (in >= 1.0) {
  ------------------
  |  Branch (7553:16): [True: 6.82k, False: 2.38k]
  ------------------
 7554|  6.82k|        i = (int)in;
 7555|  6.82k|        if (in - floor(in) >= 0.5)
  ------------------
  |  Branch (7555:13): [True: 635, False: 6.18k]
  ------------------
 7556|    635|            i += 1;
 7557|  6.82k|    }
 7558|       |
 7559|  10.1k|    if (nargs == 3) {
  ------------------
  |  Branch (7559:9): [True: 4.91k, False: 5.20k]
  ------------------
 7560|  4.91k|        double rin, rle, end;
 7561|       |
 7562|  4.91k|        rin = floor(in);
 7563|  4.91k|        if (in - rin >= 0.5)
  ------------------
  |  Branch (7563:13): [True: 609, False: 4.30k]
  ------------------
 7564|    609|            rin += 1.0;
 7565|       |
 7566|  4.91k|        rle = floor(le);
 7567|  4.91k|        if (le - rle >= 0.5)
  ------------------
  |  Branch (7567:13): [True: 919, False: 3.99k]
  ------------------
 7568|    919|            rle += 1.0;
 7569|       |
 7570|  4.91k|        end = rin + rle;
 7571|  4.91k|        if (!(end >= 1.0)) { /* Logical NOT to handle NaNs */
  ------------------
  |  Branch (7571:13): [True: 1.17k, False: 3.74k]
  ------------------
 7572|  1.17k|            j = 1;
 7573|  3.74k|        } else if (end < INT_MAX) {
  ------------------
  |  Branch (7573:20): [True: 3.17k, False: 565]
  ------------------
 7574|  3.17k|            j = (int)end;
 7575|  3.17k|        }
 7576|  4.91k|    }
 7577|       |
 7578|  10.1k|    i -= 1;
 7579|  10.1k|    j -= 1;
 7580|       |
 7581|  10.1k|    if ((i < j) && (i < xmlUTF8Strlen(str->stringval))) {
  ------------------
  |  Branch (7581:9): [True: 8.50k, False: 1.61k]
  |  Branch (7581:20): [True: 6.77k, False: 1.72k]
  ------------------
 7582|  6.77k|        xmlChar *ret = xmlUTF8Strsub(str->stringval, i, j - i);
 7583|  6.77k|        if (ret == NULL)
  ------------------
  |  Branch (7583:13): [True: 2, False: 6.77k]
  ------------------
 7584|      2|            xmlXPathPErrMemory(ctxt);
 7585|  6.77k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, ret));
 7586|  6.77k|	xmlFree(ret);
 7587|  6.77k|    } else {
 7588|  3.34k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7589|  3.34k|    }
 7590|       |
 7591|  10.1k|    xmlXPathReleaseObject(ctxt->context, str);
 7592|  10.1k|}
xmlXPathSubstringBeforeFunction:
 7607|    511|xmlXPathSubstringBeforeFunction(xmlXPathParserContext *ctxt, int nargs) {
 7608|    511|    xmlXPathObjectPtr str = NULL;
 7609|    511|    xmlXPathObjectPtr find = NULL;
 7610|    511|    const xmlChar *point;
 7611|    511|    xmlChar *result;
 7612|       |
 7613|  1.53k|    CHECK_ARITY(2);
  ------------------
  |  |  280|    511|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 511]
  |  |  ------------------
  |  |  281|    511|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 510]
  |  |  ------------------
  |  |  282|    511|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|    510|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 510]
  |  |  ------------------
  |  |  284|    510|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7614|  1.53k|    CAST_TO_STRING;
  ------------------
  |  |  290|    510|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 510, False: 0]
  |  |  |  Branch (290:34): [True: 510, False: 0]
  |  |  ------------------
  |  |  291|    510|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7615|  1.53k|    find = xmlXPathValuePop(ctxt);
 7616|  1.53k|    CAST_TO_STRING;
  ------------------
  |  |  290|    510|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 509, False: 1]
  |  |  |  Branch (290:34): [True: 508, False: 1]
  |  |  ------------------
  |  |  291|    510|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7617|  1.53k|    str = xmlXPathValuePop(ctxt);
 7618|  1.53k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7618:9): [True: 5, False: 505]
  ------------------
 7619|      5|        goto error;
 7620|       |
 7621|    505|    point = xmlStrstr(str->stringval, find->stringval);
 7622|    505|    if (point == NULL) {
  ------------------
  |  Branch (7622:9): [True: 219, False: 286]
  ------------------
 7623|    219|        result = xmlStrdup(BAD_CAST "");
  ------------------
  |  |   34|    219|#define BAD_CAST (xmlChar *)
  ------------------
 7624|    286|    } else {
 7625|    286|        result = xmlStrndup(str->stringval, point - str->stringval);
 7626|    286|    }
 7627|    505|    if (result == NULL) {
  ------------------
  |  Branch (7627:9): [True: 1, False: 504]
  ------------------
 7628|      1|        xmlXPathPErrMemory(ctxt);
 7629|      1|        goto error;
 7630|      1|    }
 7631|    504|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, result));
 7632|       |
 7633|    510|error:
 7634|    510|    xmlXPathReleaseObject(ctxt->context, str);
 7635|    510|    xmlXPathReleaseObject(ctxt->context, find);
 7636|    510|}
xmlXPathTranslateFunction:
 7762|  12.9k|xmlXPathTranslateFunction(xmlXPathParserContext *ctxt, int nargs) {
 7763|  12.9k|    xmlXPathObjectPtr str = NULL;
 7764|  12.9k|    xmlXPathObjectPtr from = NULL;
 7765|  12.9k|    xmlXPathObjectPtr to = NULL;
 7766|  12.9k|    xmlBufPtr target;
 7767|  12.9k|    int offset, max;
 7768|  12.9k|    int ch;
 7769|  12.9k|    const xmlChar *point;
 7770|  12.9k|    xmlChar *cptr, *content;
 7771|       |
 7772|  38.7k|    CHECK_ARITY(3);
  ------------------
  |  |  280|  12.9k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 12.9k]
  |  |  ------------------
  |  |  281|  12.9k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 10, False: 12.9k]
  |  |  ------------------
  |  |  282|  12.9k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|     10|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  12.9k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 12.9k]
  |  |  ------------------
  |  |  284|  12.9k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7773|       |
 7774|  38.7k|    CAST_TO_STRING;
  ------------------
  |  |  290|  12.9k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 12.9k, False: 0]
  |  |  |  Branch (290:34): [True: 12.6k, False: 285]
  |  |  ------------------
  |  |  291|  12.9k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7775|  38.7k|    to = xmlXPathValuePop(ctxt);
 7776|  38.7k|    CAST_TO_STRING;
  ------------------
  |  |  290|  12.9k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 12.9k, False: 0]
  |  |  |  Branch (290:34): [True: 12.2k, False: 647]
  |  |  ------------------
  |  |  291|  12.9k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7777|  38.7k|    from = xmlXPathValuePop(ctxt);
 7778|  38.7k|    CAST_TO_STRING;
  ------------------
  |  |  290|  12.9k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 12.9k, False: 4]
  |  |  |  Branch (290:34): [True: 12.9k, False: 1]
  |  |  ------------------
  |  |  291|  12.9k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7779|  38.7k|    str = xmlXPathValuePop(ctxt);
 7780|  38.7k|    if (ctxt->error != 0)
  ------------------
  |  Branch (7780:9): [True: 32, False: 12.8k]
  ------------------
 7781|     32|        goto error;
 7782|       |
 7783|       |    /*
 7784|       |     * Account for quadratic runtime
 7785|       |     */
 7786|  12.8k|    if (ctxt->context->opLimit != 0) {
  ------------------
  |  Branch (7786:9): [True: 12.8k, False: 0]
  ------------------
 7787|  12.8k|        unsigned long f1 = xmlStrlen(from->stringval);
 7788|  12.8k|        unsigned long f2 = xmlStrlen(str->stringval);
 7789|       |
 7790|  12.8k|        if ((f1 > 0) && (f2 > 0)) {
  ------------------
  |  Branch (7790:13): [True: 11.8k, False: 1.06k]
  |  Branch (7790:25): [True: 11.5k, False: 242]
  ------------------
 7791|  11.5k|            unsigned long p;
 7792|       |
 7793|  11.5k|            f1 = f1 / 10 + 1;
 7794|  11.5k|            f2 = f2 / 10 + 1;
 7795|  11.5k|            p = f1 > ULONG_MAX / f2 ? ULONG_MAX : f1 * f2;
  ------------------
  |  Branch (7795:17): [True: 0, False: 11.5k]
  ------------------
 7796|  11.5k|            if (xmlXPathCheckOpLimit(ctxt, p) < 0)
  ------------------
  |  Branch (7796:17): [True: 5, False: 11.5k]
  ------------------
 7797|      5|                goto error;
 7798|  11.5k|        }
 7799|  12.8k|    }
 7800|       |
 7801|  12.8k|    target = xmlBufCreate(50);
 7802|  12.8k|    if (target == NULL) {
  ------------------
  |  Branch (7802:9): [True: 9, False: 12.8k]
  ------------------
 7803|      9|        xmlXPathPErrMemory(ctxt);
 7804|      9|        goto error;
 7805|      9|    }
 7806|       |
 7807|  12.8k|    max = xmlUTF8Strlen(to->stringval);
 7808|   136k|    for (cptr = str->stringval; (ch=*cptr); ) {
  ------------------
  |  Branch (7808:33): [True: 123k, False: 12.8k]
  ------------------
 7809|   123k|        offset = xmlUTF8Strloc(from->stringval, cptr);
 7810|   123k|        if (offset >= 0) {
  ------------------
  |  Branch (7810:13): [True: 43.7k, False: 79.4k]
  ------------------
 7811|  43.7k|            if (offset < max) {
  ------------------
  |  Branch (7811:17): [True: 37.3k, False: 6.40k]
  ------------------
 7812|  37.3k|                point = xmlUTF8Strpos(to->stringval, offset);
 7813|  37.3k|                if (point)
  ------------------
  |  Branch (7813:21): [True: 37.3k, False: 0]
  ------------------
 7814|  37.3k|                    xmlBufAdd(target, point, xmlUTF8Strsize(point, 1));
 7815|  37.3k|            }
 7816|  43.7k|        } else
 7817|  79.4k|            xmlBufAdd(target, cptr, xmlUTF8Strsize(cptr, 1));
 7818|       |
 7819|       |        /* Step to next character in input */
 7820|   123k|        cptr++;
 7821|   123k|        if ( ch & 0x80 ) {
  ------------------
  |  Branch (7821:14): [True: 0, False: 123k]
  ------------------
 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|   123k|    }
 7837|       |
 7838|  12.8k|    content = xmlBufDetach(target);
 7839|  12.8k|    if (content == NULL)
  ------------------
  |  Branch (7839:9): [True: 0, False: 12.8k]
  ------------------
 7840|      0|        xmlXPathPErrMemory(ctxt);
 7841|  12.8k|    else
 7842|  12.8k|        xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, content));
 7843|  12.8k|    xmlBufFree(target);
 7844|  12.9k|error:
 7845|  12.9k|    xmlXPathReleaseObject(ctxt->context, str);
 7846|  12.9k|    xmlXPathReleaseObject(ctxt->context, from);
 7847|  12.9k|    xmlXPathReleaseObject(ctxt->context, to);
 7848|  12.9k|}
xmlXPathBooleanFunction:
 7863|  17.9k|xmlXPathBooleanFunction(xmlXPathParserContext *ctxt, int nargs) {
 7864|  17.9k|    xmlXPathObjectPtr cur;
 7865|       |
 7866|  53.7k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  17.9k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 17.9k]
  |  |  ------------------
  |  |  281|  17.9k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 17.9k]
  |  |  ------------------
  |  |  282|  17.9k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  17.9k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 17.9k]
  |  |  ------------------
  |  |  284|  17.9k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7867|  53.7k|    cur = xmlXPathValuePop(ctxt);
 7868|  53.7k|    if (cur == NULL) XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  |  Branch (7868:9): [True: 0, False: 17.9k]
  ------------------
 7869|  17.9k|    if (cur->type != XPATH_BOOLEAN) {
  ------------------
  |  Branch (7869:9): [True: 13.6k, False: 4.28k]
  ------------------
 7870|  13.6k|        int boolval = xmlXPathCastToBoolean(cur);
 7871|       |
 7872|  13.6k|        xmlXPathReleaseObject(ctxt->context, cur);
 7873|  13.6k|        cur = xmlXPathCacheNewBoolean(ctxt, boolval);
 7874|  13.6k|    }
 7875|  17.9k|    xmlXPathValuePush(ctxt, cur);
 7876|  17.9k|}
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|     30|xmlXPathFalseFunction(xmlXPathParserContext *ctxt, int nargs) {
 7917|     88|    CHECK_ARITY(0);
  ------------------
  |  |  280|     30|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 30]
  |  |  ------------------
  |  |  281|     30|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 1, False: 29]
  |  |  ------------------
  |  |  282|     30|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     29|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 29]
  |  |  ------------------
  |  |  284|     29|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7918|     88|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, 0));
 7919|     88|}
xmlXPathLangFunction:
 7942|  5.22k|xmlXPathLangFunction(xmlXPathParserContext *ctxt, int nargs) {
 7943|  5.22k|    xmlXPathObjectPtr val;
 7944|  5.22k|    xmlNodePtr cur;
 7945|  5.22k|    xmlChar *theLang = NULL;
 7946|  5.22k|    const xmlChar *lang;
 7947|  5.22k|    int ret = 0;
 7948|  5.22k|    int i;
 7949|       |
 7950|  15.6k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.22k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.22k]
  |  |  ------------------
  |  |  281|  5.22k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 5.22k]
  |  |  ------------------
  |  |  282|  5.22k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.22k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 5.22k]
  |  |  ------------------
  |  |  284|  5.22k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7951|  15.6k|    CAST_TO_STRING;
  ------------------
  |  |  290|  5.22k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING))	\
  |  |  ------------------
  |  |  |  Branch (290:9): [True: 5.22k, False: 0]
  |  |  |  Branch (290:34): [True: 5.21k, False: 6]
  |  |  ------------------
  |  |  291|  5.22k|        xmlXPathStringFunction(ctxt, 1);
  ------------------
 7952|  15.6k|    CHECK_TYPE(XPATH_STRING);
  ------------------
  |  |  261|  5.22k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 2, False: 5.22k]
  |  |  |  Branch (261:34): [True: 1, False: 5.22k]
  |  |  ------------------
  |  |  262|  5.22k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7953|  5.22k|    val = xmlXPathValuePop(ctxt);
 7954|  5.22k|    lang = val->stringval;
 7955|  5.22k|    cur = ctxt->context->node;
 7956|  52.4k|    while (cur != NULL) {
  ------------------
  |  Branch (7956:12): [True: 47.2k, False: 5.22k]
  ------------------
 7957|  47.2k|        if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |   34|  47.2k|#define BAD_CAST (xmlChar *)
  ------------------
                      if (xmlNodeGetAttrValue(cur, BAD_CAST "lang", XML_XML_NAMESPACE,
  ------------------
  |  |  146|  47.2k|    (const xmlChar *) "http://www.w3.org/XML/1998/namespace"
  ------------------
  |  Branch (7957:13): [True: 0, False: 47.2k]
  ------------------
 7958|  47.2k|                                &theLang) < 0)
 7959|      0|            xmlXPathPErrMemory(ctxt);
 7960|  47.2k|        if (theLang != NULL)
  ------------------
  |  Branch (7960:13): [True: 0, False: 47.2k]
  ------------------
 7961|      0|            break;
 7962|  47.2k|        cur = cur->parent;
 7963|  47.2k|    }
 7964|  5.22k|    if ((theLang != NULL) && (lang != NULL)) {
  ------------------
  |  Branch (7964:9): [True: 0, False: 5.22k]
  |  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|  5.22k|not_equal:
 7972|  5.22k|    if (theLang != NULL)
  ------------------
  |  Branch (7972:9): [True: 0, False: 5.22k]
  ------------------
 7973|      0|	xmlFree((void *)theLang);
 7974|       |
 7975|  5.22k|    xmlXPathReleaseObject(ctxt->context, val);
 7976|  5.22k|    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
 7977|  5.22k|}
xmlXPathNumberFunction:
 7987|   401k|xmlXPathNumberFunction(xmlXPathParserContext *ctxt, int nargs) {
 7988|   401k|    xmlXPathObjectPtr cur;
 7989|   401k|    double res;
 7990|       |
 7991|   401k|    if (ctxt == NULL) return;
  ------------------
  |  Branch (7991:9): [True: 0, False: 401k]
  ------------------
 7992|   401k|    if (nargs == 0) {
  ------------------
  |  Branch (7992:9): [True: 0, False: 401k]
  ------------------
 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.60M|    CHECK_ARITY(1);
  ------------------
  |  |  280|   401k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 401k]
  |  |  ------------------
  |  |  281|   401k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 0, False: 401k]
  |  |  ------------------
  |  |  282|   401k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|   401k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 3, False: 401k]
  |  |  ------------------
  |  |  284|   401k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8008|  1.60M|    cur = xmlXPathValuePop(ctxt);
 8009|  1.60M|    if (cur->type != XPATH_NUMBER) {
  ------------------
  |  Branch (8009:9): [True: 401k, False: 1]
  ------------------
 8010|   401k|        double floatval;
 8011|       |
 8012|   401k|        floatval = xmlXPathCastToNumberInternal(ctxt, cur);
 8013|   401k|        xmlXPathReleaseObject(ctxt->context, cur);
 8014|   401k|        cur = xmlXPathCacheNewFloat(ctxt, floatval);
 8015|   401k|    }
 8016|  1.60M|    xmlXPathValuePush(ctxt, cur);
 8017|  1.60M|}
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: 12, False: 23]
  ------------------
 8042|     45|	for (i = 0; i < cur->nodesetval->nodeNr; i++) {
  ------------------
  |  Branch (8042:14): [True: 33, False: 12]
  ------------------
 8043|     33|	    res += xmlXPathNodeToNumberInternal(ctxt,
 8044|     33|                                                cur->nodesetval->nodeTab[i]);
 8045|     33|	}
 8046|     12|    }
 8047|     35|    xmlXPathValuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));
 8048|     35|    xmlXPathReleaseObject(ctxt->context, cur);
 8049|     35|}
xmlXPathFloorFunction:
 8061|     66|xmlXPathFloorFunction(xmlXPathParserContext *ctxt, int nargs) {
 8062|    190|    CHECK_ARITY(1);
  ------------------
  |  |  280|     66|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 66]
  |  |  ------------------
  |  |  281|     66|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 4, False: 62]
  |  |  ------------------
  |  |  282|     66|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|     62|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 0, False: 62]
  |  |  ------------------
  |  |  284|     62|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8063|    190|    CAST_TO_NUMBER;
  ------------------
  |  |  297|     62|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 62, False: 0]
  |  |  |  Branch (297:34): [True: 47, False: 15]
  |  |  ------------------
  |  |  298|     62|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
 8064|    190|    CHECK_TYPE(XPATH_NUMBER);
  ------------------
  |  |  261|     62|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 0, False: 62]
  |  |  |  Branch (261:34): [True: 1, False: 61]
  |  |  ------------------
  |  |  262|     62|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|      1|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 8065|       |
 8066|     61|    ctxt->value->floatval = floor(ctxt->value->floatval);
 8067|     61|}
xmlXPathParseNCName:
 8147|  94.3k|xmlXPathParseNCName(xmlXPathParserContext *ctxt) {
 8148|  94.3k|    const xmlChar *end;
 8149|  94.3k|    xmlChar *ret;
 8150|       |
 8151|  94.3k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8151:9): [True: 0, False: 94.3k]
  |  Branch (8151:27): [True: 0, False: 94.3k]
  ------------------
 8152|       |
 8153|  94.3k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   65|  94.3k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
                  end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, XML_SCAN_NC);
  ------------------
  |  |   69|  94.3k|#define XML_SCAN_NC         1
  ------------------
 8154|  94.3k|    if (end == NULL) {
  ------------------
  |  Branch (8154:9): [True: 3, False: 94.3k]
  ------------------
 8155|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8156|      0|    }
 8157|  94.3k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8157:9): [True: 4.34k, False: 90.0k]
  ------------------
 8158|  4.34k|        return(NULL);
 8159|       |
 8160|  90.0k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8161|  90.0k|    if (ret == NULL)
  ------------------
  |  Branch (8161:9): [True: 66, False: 89.9k]
  ------------------
 8162|     66|        xmlXPathPErrMemory(ctxt);
 8163|  90.0k|    ctxt->cur = end;
 8164|  90.0k|    return(ret);
 8165|  94.3k|}
xmlXPathParseName:
 8199|  19.6k|xmlXPathParseName(xmlXPathParserContext *ctxt) {
 8200|  19.6k|    const xmlChar *end;
 8201|  19.6k|    xmlChar *ret;
 8202|       |
 8203|  19.6k|    if ((ctxt == NULL) || (ctxt->cur == NULL)) return(NULL);
  ------------------
  |  Branch (8203:9): [True: 0, False: 19.6k]
  |  Branch (8203:27): [True: 0, False: 19.6k]
  ------------------
 8204|       |
 8205|  19.6k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  19.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8206|  19.6k|    if (end == NULL) {
  ------------------
  |  Branch (8206:9): [True: 1, False: 19.6k]
  ------------------
 8207|      1|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      1|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8208|      0|    }
 8209|  19.6k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8209:9): [True: 2.91k, False: 16.7k]
  ------------------
 8210|  2.91k|        return(NULL);
 8211|       |
 8212|  16.7k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8213|  16.7k|    if (ret == NULL)
  ------------------
  |  Branch (8213:9): [True: 52, False: 16.7k]
  ------------------
 8214|     52|        xmlXPathPErrMemory(ctxt);
 8215|  16.7k|    ctxt->cur = end;
 8216|  16.7k|    return(ret);
 8217|  19.6k|}
xmlXPathStringEvalNumber:
 8236|   686k|xmlXPathStringEvalNumber(const xmlChar *str) {
 8237|   686k|    const xmlChar *cur = str;
 8238|   686k|    double ret;
 8239|   686k|    int ok = 0;
 8240|   686k|    int isneg = 0;
 8241|   686k|    int exponent = 0;
 8242|   686k|    int is_exponent_negative = 0;
 8243|   686k|#ifdef __GNUC__
 8244|   686k|    unsigned long tmp = 0;
 8245|   686k|    double temp;
 8246|   686k|#endif
 8247|   686k|    if (cur == NULL) return(0);
  ------------------
  |  Branch (8247:9): [True: 0, False: 686k]
  ------------------
 8248|   686k|    while (IS_BLANK_CH(*cur)) cur++;
 8249|   686k|    if (*cur == '-') {
  ------------------
  |  Branch (8249:9): [True: 69.5k, False: 617k]
  ------------------
 8250|  69.5k|	isneg = 1;
 8251|  69.5k|	cur++;
 8252|  69.5k|    }
 8253|   686k|    if ((*cur != '.') && ((*cur < '0') || (*cur > '9'))) {
  ------------------
  |  Branch (8253:9): [True: 612k, False: 73.7k]
  |  Branch (8253:27): [True: 538k, False: 74.2k]
  |  Branch (8253:43): [True: 58.3k, False: 15.8k]
  ------------------
 8254|   596k|        return(xmlXPathNAN);
 8255|   596k|    }
 8256|       |
 8257|  89.6k|#ifdef __GNUC__
 8258|       |    /*
 8259|       |     * tmp/temp is a workaround against a gcc compiler bug
 8260|       |     * http://veillard.com/gcc.bug
 8261|       |     */
 8262|  89.6k|    ret = 0;
 8263|   131k|    while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8263:12): [True: 43.3k, False: 88.0k]
  |  Branch (8263:29): [True: 41.7k, False: 1.57k]
  ------------------
 8264|  41.7k|	ret = ret * 10;
 8265|  41.7k|	tmp = (*cur - '0');
 8266|  41.7k|	ok = 1;
 8267|  41.7k|	cur++;
 8268|  41.7k|	temp = (double) tmp;
 8269|  41.7k|	ret = ret + temp;
 8270|  41.7k|    }
 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|  89.6k|    if (*cur == '.') {
  ------------------
  |  Branch (8280:9): [True: 79.7k, False: 9.83k]
  ------------------
 8281|  79.7k|	int v, frac = 0, max;
 8282|  79.7k|	double fraction = 0;
 8283|       |
 8284|  79.7k|        cur++;
 8285|  79.7k|	if (((*cur < '0') || (*cur > '9')) && (!ok)) {
  ------------------
  |  Branch (8285:7): [True: 11.3k, False: 68.4k]
  |  Branch (8285:23): [True: 11.7k, False: 56.7k]
  |  Branch (8285:40): [True: 22.4k, False: 624]
  ------------------
 8286|  22.4k|	    return(xmlXPathNAN);
 8287|  22.4k|	}
 8288|  84.3k|        while (*cur == '0') {
  ------------------
  |  Branch (8288:16): [True: 26.9k, False: 57.3k]
  ------------------
 8289|  26.9k|	    frac = frac + 1;
 8290|  26.9k|	    cur++;
 8291|  26.9k|        }
 8292|  57.3k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  57.3k|#define MAX_FRAC 20
  ------------------
 8293|   178k|	while (((*cur >= '0') && (*cur <= '9')) && (frac < max)) {
  ------------------
  |  Branch (8293:10): [True: 156k, False: 21.8k]
  |  Branch (8293:27): [True: 121k, False: 35.2k]
  |  Branch (8293:45): [True: 121k, False: 191]
  ------------------
 8294|   121k|	    v = (*cur - '0');
 8295|   121k|	    fraction = fraction * 10 + v;
 8296|   121k|	    frac = frac + 1;
 8297|   121k|	    cur++;
 8298|   121k|	}
 8299|  57.3k|	fraction /= pow(10.0, frac);
 8300|  57.3k|	ret = ret + fraction;
 8301|  63.8k|	while ((*cur >= '0') && (*cur <= '9'))
  ------------------
  |  Branch (8301:9): [True: 42.0k, False: 21.8k]
  |  Branch (8301:26): [True: 6.51k, False: 35.4k]
  ------------------
 8302|  6.51k|	    cur++;
 8303|  57.3k|    }
 8304|  67.2k|    if ((*cur == 'e') || (*cur == 'E')) {
  ------------------
  |  Branch (8304:9): [True: 5.81k, False: 61.4k]
  |  Branch (8304:26): [True: 18.6k, False: 42.7k]
  ------------------
 8305|  24.4k|      cur++;
 8306|  24.4k|      if (*cur == '-') {
  ------------------
  |  Branch (8306:11): [True: 13.1k, False: 11.3k]
  ------------------
 8307|  13.1k|	is_exponent_negative = 1;
 8308|  13.1k|	cur++;
 8309|  13.1k|      } else if (*cur == '+') {
  ------------------
  |  Branch (8309:18): [True: 7.53k, False: 3.77k]
  ------------------
 8310|  7.53k|        cur++;
 8311|  7.53k|      }
 8312|   109k|      while ((*cur >= '0') && (*cur <= '9')) {
  ------------------
  |  Branch (8312:14): [True: 85.4k, False: 24.1k]
  |  Branch (8312:31): [True: 85.1k, False: 288]
  ------------------
 8313|  85.1k|        if (exponent < 1000000)
  ------------------
  |  Branch (8313:13): [True: 83.4k, False: 1.67k]
  ------------------
 8314|  83.4k|	  exponent = exponent * 10 + (*cur - '0');
 8315|  85.1k|	cur++;
 8316|  85.1k|      }
 8317|  24.4k|    }
 8318|  92.4k|    while (IS_BLANK_CH(*cur)) cur++;
 8319|  67.2k|    if (*cur != 0) return(xmlXPathNAN);
  ------------------
  |  Branch (8319:9): [True: 25.9k, False: 41.2k]
  ------------------
 8320|  41.2k|    if (isneg) ret = -ret;
  ------------------
  |  Branch (8320:9): [True: 26.5k, False: 14.6k]
  ------------------
 8321|  41.2k|    if (is_exponent_negative) exponent = -exponent;
  ------------------
  |  Branch (8321:9): [True: 13.0k, False: 28.2k]
  ------------------
 8322|  41.2k|    ret *= pow(10.0, (double)exponent);
 8323|  41.2k|    return(ret);
 8324|  67.2k|}
xmlXPathIsNodeType:
 8548|  9.90k|xmlXPathIsNodeType(const xmlChar *name) {
 8549|  9.90k|    if (name == NULL)
  ------------------
  |  Branch (8549:9): [True: 0, False: 9.90k]
  ------------------
 8550|      0|	return(0);
 8551|       |
 8552|  9.90k|    if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|  9.90k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8552:9): [True: 34, False: 9.87k]
  ------------------
 8553|     34|	return(1);
 8554|  9.87k|    if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|  9.87k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8554:9): [True: 51, False: 9.82k]
  ------------------
 8555|     51|	return(1);
 8556|  9.82k|    if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|  9.82k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8556:9): [True: 22, False: 9.80k]
  ------------------
 8557|     22|	return(1);
 8558|  9.80k|    if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|  9.80k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8558:9): [True: 161, False: 9.64k]
  ------------------
 8559|    161|	return(1);
 8560|  9.64k|    return(0);
 8561|  9.80k|}
xmlXPathEvaluatePredicateResult:
11626|   268k|                                xmlXPathObject *res) {
11627|   268k|    if ((ctxt == NULL) || (res == NULL)) return(0);
  ------------------
  |  Branch (11627:9): [True: 0, False: 268k]
  |  Branch (11627:27): [True: 0, False: 268k]
  ------------------
11628|   268k|    switch (res->type) {
11629|      0|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (11629:9): [True: 0, False: 268k]
  ------------------
11630|      0|	    return(res->boolval);
11631|   109k|        case XPATH_NUMBER:
  ------------------
  |  Branch (11631:9): [True: 109k, False: 159k]
  ------------------
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|   109k|	    return(res->floatval == ctxt->context->proximityPosition);
11637|      0|#endif
11638|   156k|        case XPATH_NODESET:
  ------------------
  |  Branch (11638:9): [True: 156k, False: 112k]
  ------------------
11639|   156k|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (11639:9): [True: 0, False: 268k]
  ------------------
11640|   156k|	    if (res->nodesetval == NULL)
  ------------------
  |  Branch (11640:10): [True: 0, False: 156k]
  ------------------
11641|      0|		return(0);
11642|   156k|	    return(res->nodesetval->nodeNr != 0);
11643|  3.01k|        case XPATH_STRING:
  ------------------
  |  Branch (11643:9): [True: 3.01k, False: 265k]
  ------------------
11644|  3.01k|	    return((res->stringval != NULL) && (res->stringval[0] != 0));
  ------------------
  |  Branch (11644:13): [True: 3.01k, False: 0]
  |  Branch (11644:41): [True: 1.96k, False: 1.05k]
  ------------------
11645|      0|        default:
  ------------------
  |  Branch (11645:9): [True: 0, False: 268k]
  ------------------
11646|      0|	    break;
11647|   268k|    }
11648|      0|    return(0);
11649|   268k|}
xmlXPathEvalExpr:
12002|  13.7k|xmlXPathEvalExpr(xmlXPathParserContext *ctxt) {
12003|       |#ifdef XPATH_STREAMING
12004|       |    xmlXPathCompExprPtr comp;
12005|       |#endif
12006|  13.7k|    int oldDepth = 0;
12007|       |
12008|  13.7k|    if ((ctxt == NULL) || (ctxt->context == NULL))
  ------------------
  |  Branch (12008:9): [True: 0, False: 13.7k]
  |  Branch (12008:27): [True: 0, False: 13.7k]
  ------------------
12009|      0|        return;
12010|  13.7k|    if (ctxt->context->lastError.code != 0)
  ------------------
  |  Branch (12010:9): [True: 200, False: 13.5k]
  ------------------
12011|    200|        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|  13.5k|    {
12027|  13.5k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12027:13): [True: 13.5k, False: 0]
  ------------------
12028|  13.5k|            oldDepth = ctxt->context->depth;
12029|  13.5k|	xmlXPathCompileExpr(ctxt, 1);
12030|  13.5k|        if (ctxt->context != NULL)
  ------------------
  |  Branch (12030:13): [True: 13.5k, False: 0]
  ------------------
12031|  13.5k|            ctxt->context->depth = oldDepth;
12032|  13.5k|        CHECK_ERROR;
  ------------------
  |  |  230|  13.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.83k, False: 11.7k]
  |  |  ------------------
  ------------------
12033|       |
12034|       |        /* Check for trailing characters. */
12035|  11.7k|        if (*ctxt->cur != 0)
  ------------------
  |  Branch (12035:13): [True: 338, False: 11.3k]
  ------------------
12036|  11.3k|            XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    338|    { xmlXPathErr(ctxt, X); return; }
  ------------------
12037|       |
12038|  11.3k|	if ((ctxt->comp->nbStep > 1) && (ctxt->comp->last >= 0)) {
  ------------------
  |  Branch (12038:6): [True: 11.3k, False: 22]
  |  Branch (12038:34): [True: 11.3k, False: 0]
  ------------------
12039|  11.3k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12039:17): [True: 11.3k, False: 0]
  ------------------
12040|  11.3k|                oldDepth = ctxt->context->depth;
12041|  11.3k|	    xmlXPathOptimizeExpression(ctxt,
12042|  11.3k|		&ctxt->comp->steps[ctxt->comp->last]);
12043|  11.3k|            if (ctxt->context != NULL)
  ------------------
  |  Branch (12043:17): [True: 11.3k, False: 0]
  ------------------
12044|  11.3k|                ctxt->context->depth = oldDepth;
12045|  11.3k|        }
12046|  11.3k|    }
12047|       |
12048|      0|    xmlXPathRunEval(ctxt, 0);
12049|  11.3k|}
xpath.c:xmlXPathNameFunction:
 7223|  5.72k|{
 7224|  5.72k|    xmlXPathObjectPtr cur;
 7225|       |
 7226|  5.72k|    if (nargs == 0) {
  ------------------
  |  Branch (7226:9): [True: 3.29k, False: 2.43k]
  ------------------
 7227|  3.29k|	xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt, ctxt->context->node));
 7228|  3.29k|        nargs = 1;
 7229|  3.29k|    }
 7230|       |
 7231|  17.1k|    CHECK_ARITY(1);
  ------------------
  |  |  280|  5.72k|    if (ctxt == NULL) return;						\
  |  |  ------------------
  |  |  |  Branch (280:9): [True: 0, False: 5.72k]
  |  |  ------------------
  |  |  281|  5.72k|    if (nargs != (x))							\
  |  |  ------------------
  |  |  |  Branch (281:9): [True: 3, False: 5.72k]
  |  |  ------------------
  |  |  282|  5.72k|        XP_ERROR(XPATH_INVALID_ARITY);					\
  |  |  ------------------
  |  |  |  |  244|      3|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  |  |  283|  5.72k|    if (ctxt->valueNr < (x))						\
  |  |  ------------------
  |  |  |  Branch (283:9): [True: 5, False: 5.72k]
  |  |  ------------------
  |  |  284|  5.72k|        XP_ERROR(XPATH_STACK_ERROR);
  |  |  ------------------
  |  |  |  |  244|      5|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
 7232|  17.1k|    if ((ctxt->value == NULL) ||
  ------------------
  |  Branch (7232:9): [True: 0, False: 5.72k]
  ------------------
 7233|  5.72k|        ((ctxt->value->type != XPATH_NODESET) &&
  ------------------
  |  Branch (7233:10): [True: 4, False: 5.71k]
  ------------------
 7234|      4|         (ctxt->value->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (7234:10): [True: 4, False: 0]
  ------------------
 7235|  5.71k|        XP_ERROR(XPATH_INVALID_TYPE);
  ------------------
  |  |  244|      4|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 7236|  5.71k|    cur = xmlXPathValuePop(ctxt);
 7237|       |
 7238|  5.71k|    if ((cur->nodesetval == NULL) || (cur->nodesetval->nodeNr == 0)) {
  ------------------
  |  Branch (7238:9): [True: 0, False: 5.71k]
  |  Branch (7238:38): [True: 1.58k, False: 4.13k]
  ------------------
 7239|  1.58k|        xmlXPathValuePush(ctxt, xmlXPathCacheNewCString(ctxt, ""));
 7240|  4.13k|    } else {
 7241|  4.13k|        int i = 0;              /* Should be first in document order !!!!! */
 7242|       |
 7243|  4.13k|        switch (cur->nodesetval->nodeTab[i]->type) {
 7244|  2.72k|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (7244:13): [True: 2.72k, False: 1.40k]
  ------------------
 7245|  2.72k|            case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (7245:13): [True: 0, False: 4.13k]
  ------------------
 7246|  2.72k|		if (cur->nodesetval->nodeTab[i]->name[0] == ' ')
  ------------------
  |  Branch (7246:7): [True: 0, False: 2.72k]
  ------------------
 7247|      0|		    xmlXPathValuePush(ctxt,
 7248|      0|			xmlXPathCacheNewCString(ctxt, ""));
 7249|  2.72k|		else if ((cur->nodesetval->nodeTab[i]->ns == NULL) ||
  ------------------
  |  Branch (7249:12): [True: 2.11k, False: 610]
  ------------------
 7250|  2.49k|                         (cur->nodesetval->nodeTab[i]->ns->prefix == NULL)) {
  ------------------
  |  Branch (7250:26): [True: 379, False: 231]
  ------------------
 7251|  2.49k|		    xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt,
 7252|  2.49k|			    cur->nodesetval->nodeTab[i]->name));
 7253|  2.49k|		} else {
 7254|    231|		    xmlChar *fullname;
 7255|       |
 7256|    231|		    fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
 7257|    231|				     cur->nodesetval->nodeTab[i]->ns->prefix,
 7258|    231|				     NULL, 0);
 7259|    231|		    if (fullname == cur->nodesetval->nodeTab[i]->name)
  ------------------
  |  Branch (7259:11): [True: 0, False: 231]
  ------------------
 7260|      0|			fullname = xmlStrdup(cur->nodesetval->nodeTab[i]->name);
 7261|    231|		    if (fullname == NULL)
  ------------------
  |  Branch (7261:11): [True: 1, False: 230]
  ------------------
 7262|      1|                        xmlXPathPErrMemory(ctxt);
 7263|    231|		    xmlXPathValuePush(ctxt, xmlXPathCacheWrapString(ctxt, fullname));
 7264|    231|                }
 7265|  2.72k|                break;
 7266|  1.40k|            default:
  ------------------
  |  Branch (7266:13): [True: 1.40k, False: 2.72k]
  ------------------
 7267|  1.40k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
 7268|  1.40k|		    cur->nodesetval->nodeTab[i]));
 7269|  1.40k|                xmlXPathLocalNameFunction(ctxt, 1);
 7270|  4.13k|        }
 7271|  4.13k|    }
 7272|  5.71k|    xmlXPathReleaseObject(ctxt->context, cur);
 7273|  5.71k|}
xpath.c:xmlXPathSFComputeHash:
  186|  5.38k|xmlXPathSFComputeHash(const xmlChar *name) {
  187|  5.38k|    unsigned hashValue = 5381;
  188|  5.38k|    const xmlChar *ptr;
  189|       |
  190|  35.9k|    for (ptr = name; *ptr; ptr++)
  ------------------
  |  Branch (190:22): [True: 30.5k, False: 5.38k]
  ------------------
  191|  30.5k|        hashValue = hashValue * 33 + *ptr;
  192|       |
  193|  5.38k|    return(hashValue);
  194|  5.38k|}
xpath.c:wrap_cmp:
  606|  3.87M|    {
  607|  3.87M|        int res = xmlXPathCmpNodesExt(x, y);
  608|  3.87M|        return res == -2 ? res : -res;
  ------------------
  |  Branch (608:16): [True: 0, False: 3.87M]
  ------------------
  609|  3.87M|    }
xpath.c:xmlXPathCmpNodesExt:
  309|  3.87M|xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
  310|  3.87M|    int depth1, depth2;
  311|  3.87M|    int misc = 0, precedence1 = 0, precedence2 = 0;
  312|  3.87M|    xmlNodePtr miscNode1 = NULL, miscNode2 = NULL;
  313|  3.87M|    xmlNodePtr cur, root;
  314|  3.87M|    XML_INTPTR_T l1, l2;
  ------------------
  |  |   52|  3.87M|  #define XML_INTPTR_T intptr_t
  ------------------
  315|       |
  316|  3.87M|    if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (316:9): [True: 0, False: 3.87M]
  |  Branch (316:28): [True: 0, False: 3.87M]
  ------------------
  317|      0|	return(-2);
  318|       |
  319|  3.87M|    if (node1 == node2)
  ------------------
  |  Branch (319:9): [True: 0, False: 3.87M]
  ------------------
  320|      0|	return(0);
  321|       |
  322|       |    /*
  323|       |     * a couple of optimizations which will avoid computations in most cases
  324|       |     */
  325|  3.87M|    switch (node1->type) {
  326|  2.76M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (326:2): [True: 2.76M, False: 1.10M]
  ------------------
  327|  2.76M|	    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (327:10): [True: 2.08M, False: 682k]
  ------------------
  328|  2.08M|		if ((0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  2.08M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  2.08M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (328:7): [True: 0, False: 2.08M]
  ------------------
  329|      0|		    (0 > XML_NODE_SORT_VALUE(node2)) &&
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (329:7): [True: 0, False: 0]
  ------------------
  330|      0|		    (node1->doc == node2->doc))
  ------------------
  |  Branch (330:7): [True: 0, False: 0]
  ------------------
  331|      0|		{
  332|      0|		    l1 = -XML_NODE_SORT_VALUE(node1);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  333|      0|		    l2 = -XML_NODE_SORT_VALUE(node2);
  ------------------
  |  |  295|      0|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|      0|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  334|      0|		    if (l1 < l2)
  ------------------
  |  Branch (334:11): [True: 0, False: 0]
  ------------------
  335|      0|			return(1);
  336|      0|		    if (l1 > l2)
  ------------------
  |  Branch (336:11): [True: 0, False: 0]
  ------------------
  337|      0|			return(-1);
  338|      0|		} else
  339|  2.08M|		    goto turtle_comparison;
  340|  2.08M|	    }
  341|   682k|	    break;
  342|   682k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (342:2): [True: 14.4k, False: 3.86M]
  ------------------
  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|   836k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (348:2): [True: 836k, False: 3.03M]
  ------------------
  349|   909k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (349:2): [True: 72.6k, False: 3.80M]
  ------------------
  350|   917k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (350:2): [True: 7.61k, False: 3.86M]
  ------------------
  351|  1.03M|	case XML_PI_NODE: {
  ------------------
  |  Branch (351:2): [True: 119k, False: 3.75M]
  ------------------
  352|  1.03M|	    miscNode1 = node1;
  353|       |	    /*
  354|       |	    * Find nearest element node.
  355|       |	    */
  356|  1.03M|	    if (node1->prev != NULL) {
  ------------------
  |  Branch (356:10): [True: 561k, False: 475k]
  ------------------
  357|  9.09M|		do {
  358|  9.09M|		    node1 = node1->prev;
  359|  9.09M|		    if (node1->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (359:11): [True: 554k, False: 8.53M]
  ------------------
  360|   554k|			precedence1 = 3; /* element in prev-sibl axis */
  361|   554k|			break;
  362|   554k|		    }
  363|  8.53M|		    if (node1->prev == NULL) {
  ------------------
  |  Branch (363:11): [True: 6.40k, False: 8.53M]
  ------------------
  364|  6.40k|			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|  6.40k|			node1 = node1->parent;
  370|  6.40k|			break;
  371|  6.40k|		    }
  372|  8.53M|		} while (1);
  ------------------
  |  Branch (372:12): [True: 8.53M, Folded]
  ------------------
  373|   561k|	    } else {
  374|   475k|		precedence1 = 2; /* element is parent */
  375|   475k|		node1 = node1->parent;
  376|   475k|	    }
  377|  1.03M|	    if ((node1 == NULL) || (node1->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (377:10): [True: 0, False: 1.03M]
  |  Branch (377:29): [True: 762, False: 1.03M]
  ------------------
  378|  1.03M|		(0 <= XML_NODE_SORT_VALUE(node1))) {
  ------------------
  |  |  295|  1.03M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  1.03M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (378:3): [True: 1.03M, False: 0]
  ------------------
  379|       |		/*
  380|       |		* Fallback for whatever case.
  381|       |		*/
  382|  1.03M|		node1 = miscNode1;
  383|  1.03M|		precedence1 = 0;
  384|  1.03M|	    } else
  385|      0|		misc = 1;
  386|  1.03M|	}
  387|  1.03M|	    break;
  388|  31.8k|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (388:2): [True: 31.8k, False: 3.84M]
  ------------------
  389|       |	    /*
  390|       |	    * TODO: why do we return 1 for namespace nodes?
  391|       |	    */
  392|  31.8k|	    return(1);
  393|  24.6k|	default:
  ------------------
  |  Branch (393:2): [True: 24.6k, False: 3.85M]
  ------------------
  394|  24.6k|	    break;
  395|  3.87M|    }
  396|  1.75M|    switch (node2->type) {
  397|   541k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (397:2): [True: 541k, False: 1.21M]
  ------------------
  398|   541k|	    break;
  399|  13.4k|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (399:2): [True: 13.4k, False: 1.74M]
  ------------------
  400|  13.4k|	    precedence2 = 1; /* element is owner */
  401|  13.4k|	    miscNode2 = node2;
  402|  13.4k|	    node2 = node2->parent;
  403|  13.4k|	    misc = 1;
  404|  13.4k|	    break;
  405|   903k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (405:2): [True: 903k, False: 854k]
  ------------------
  406|   977k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (406:2): [True: 73.5k, False: 1.68M]
  ------------------
  407|   984k|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (407:2): [True: 7.47k, False: 1.75M]
  ------------------
  408|  1.10M|	case XML_PI_NODE: {
  ------------------
  |  Branch (408:2): [True: 119k, False: 1.63M]
  ------------------
  409|  1.10M|	    miscNode2 = node2;
  410|  1.10M|	    if (node2->prev != NULL) {
  ------------------
  |  Branch (410:10): [True: 580k, False: 523k]
  ------------------
  411|  9.11M|		do {
  412|  9.11M|		    node2 = node2->prev;
  413|  9.11M|		    if (node2->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (413:11): [True: 574k, False: 8.53M]
  ------------------
  414|   574k|			precedence2 = 3; /* element in prev-sibl axis */
  415|   574k|			break;
  416|   574k|		    }
  417|  8.53M|		    if (node2->prev == NULL) {
  ------------------
  |  Branch (417:11): [True: 6.24k, False: 8.53M]
  ------------------
  418|  6.24k|			precedence2 = 2; /* element is parent */
  419|  6.24k|			node2 = node2->parent;
  420|  6.24k|			break;
  421|  6.24k|		    }
  422|  8.53M|		} while (1);
  ------------------
  |  Branch (422:12): [True: 8.53M, Folded]
  ------------------
  423|   580k|	    } else {
  424|   523k|		precedence2 = 2; /* element is parent */
  425|   523k|		node2 = node2->parent;
  426|   523k|	    }
  427|  1.10M|	    if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (427:10): [True: 0, False: 1.10M]
  |  Branch (427:29): [True: 623, False: 1.10M]
  ------------------
  428|  1.10M|		(0 <= XML_NODE_SORT_VALUE(node2)))
  ------------------
  |  |  295|  1.10M|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  1.10M|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (428:3): [True: 1.10M, False: 0]
  ------------------
  429|  1.10M|	    {
  430|  1.10M|		node2 = miscNode2;
  431|  1.10M|		precedence2 = 0;
  432|  1.10M|	    } else
  433|      0|		misc = 1;
  434|  1.10M|	}
  435|  1.10M|	    break;
  436|    428|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (436:2): [True: 428, False: 1.75M]
  ------------------
  437|    428|	    return(1);
  438|  98.8k|	default:
  ------------------
  |  Branch (438:2): [True: 98.8k, False: 1.65M]
  ------------------
  439|  98.8k|	    break;
  440|  1.75M|    }
  441|  1.75M|    if (misc) {
  ------------------
  |  Branch (441:9): [True: 19.6k, False: 1.73M]
  ------------------
  442|  19.6k|	if (node1 == node2) {
  ------------------
  |  Branch (442:6): [True: 2.57k, False: 17.0k]
  ------------------
  443|  2.57k|	    if (precedence1 == precedence2) {
  ------------------
  |  Branch (443:10): [True: 1.21k, False: 1.36k]
  ------------------
  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: 656, False: 823]
  ------------------
  450|    656|		    if (cur == miscNode1)
  ------------------
  |  Branch (450:11): [True: 393, False: 263]
  ------------------
  451|    393|			return(1);
  452|    263|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (452:11): [True: 0, False: 263]
  ------------------
  453|      0|			return(-1);
  454|    263|		    cur = cur->prev;
  455|    263|		}
  456|    823|		return (-1);
  457|  1.36k|	    } 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.36k|		if (precedence1 < precedence2)
  ------------------
  |  Branch (463:7): [True: 489, False: 873]
  ------------------
  464|    489|		    return(1);
  465|    873|		else
  466|    873|		    return(-1);
  467|  1.36k|	    }
  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|  17.0k|	if ((precedence2 == 3) && (precedence1 > 1)) {
  ------------------
  |  Branch (478:6): [True: 0, False: 17.0k]
  |  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|  17.0k|	if ((precedence1 == 3) && (precedence2 > 1)) {
  ------------------
  |  Branch (486:6): [True: 0, False: 17.0k]
  |  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|  17.0k|    }
  495|       |
  496|       |    /*
  497|       |     * Speedup using document order if available.
  498|       |     */
  499|  1.75M|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (499:9): [True: 694k, False: 1.06M]
  ------------------
  500|   694k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (500:2): [True: 13.5k, False: 681k]
  ------------------
  501|  13.5k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|  13.5k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|  13.5k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (501:2): [True: 0, False: 13.5k]
  ------------------
  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.84M|turtle_comparison:
  514|       |
  515|  3.84M|    if (node1 == node2->prev)
  ------------------
  |  Branch (515:9): [True: 1.32M, False: 2.51M]
  ------------------
  516|  1.32M|	return(1);
  517|  2.51M|    if (node1 == node2->next)
  ------------------
  |  Branch (517:9): [True: 52.5k, False: 2.46M]
  ------------------
  518|  52.5k|	return(-1);
  519|       |    /*
  520|       |     * compute depth to root
  521|       |     */
  522|  48.4M|    for (depth2 = 0, cur = node2; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (522:35): [True: 46.7M, False: 1.73M]
  ------------------
  523|  46.7M|	if (cur->parent == node1)
  ------------------
  |  Branch (523:6): [True: 727k, False: 45.9M]
  ------------------
  524|   727k|	    return(1);
  525|  45.9M|	depth2++;
  526|  45.9M|    }
  527|  1.73M|    root = cur;
  528|  44.7M|    for (depth1 = 0, cur = node1; cur->parent != NULL; cur = cur->parent) {
  ------------------
  |  Branch (528:35): [True: 43.4M, False: 1.32M]
  ------------------
  529|  43.4M|	if (cur->parent == node2)
  ------------------
  |  Branch (529:6): [True: 406k, False: 43.0M]
  ------------------
  530|   406k|	    return(-1);
  531|  43.0M|	depth1++;
  532|  43.0M|    }
  533|       |    /*
  534|       |     * Distinct document (or distinct entities :-( ) case.
  535|       |     */
  536|  1.32M|    if (root != cur) {
  ------------------
  |  Branch (536:9): [True: 0, False: 1.32M]
  ------------------
  537|      0|	return(-2);
  538|      0|    }
  539|       |    /*
  540|       |     * get the nearest common ancestor.
  541|       |     */
  542|  4.76M|    while (depth1 > depth2) {
  ------------------
  |  Branch (542:12): [True: 3.43M, False: 1.32M]
  ------------------
  543|  3.43M|	depth1--;
  544|  3.43M|	node1 = node1->parent;
  545|  3.43M|    }
  546|  7.66M|    while (depth2 > depth1) {
  ------------------
  |  Branch (546:12): [True: 6.33M, False: 1.32M]
  ------------------
  547|  6.33M|	depth2--;
  548|  6.33M|	node2 = node2->parent;
  549|  6.33M|    }
  550|  2.99M|    while (node1->parent != node2->parent) {
  ------------------
  |  Branch (550:12): [True: 1.66M, False: 1.32M]
  ------------------
  551|  1.66M|	node1 = node1->parent;
  552|  1.66M|	node2 = node2->parent;
  553|       |	/* should not happen but just in case ... */
  554|  1.66M|	if ((node1 == NULL) || (node2 == NULL))
  ------------------
  |  Branch (554:6): [True: 0, False: 1.66M]
  |  Branch (554:25): [True: 0, False: 1.66M]
  ------------------
  555|      0|	    return(-2);
  556|  1.66M|    }
  557|       |    /*
  558|       |     * Find who's first.
  559|       |     */
  560|  1.32M|    if (node1 == node2->prev)
  ------------------
  |  Branch (560:9): [True: 409k, False: 917k]
  ------------------
  561|   409k|	return(1);
  562|   917k|    if (node1 == node2->next)
  ------------------
  |  Branch (562:9): [True: 430k, False: 487k]
  ------------------
  563|   430k|	return(-1);
  564|       |    /*
  565|       |     * Speedup using document order if available.
  566|       |     */
  567|   487k|    if ((node1->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (567:9): [True: 480k, False: 6.26k]
  ------------------
  568|   480k|	(node2->type == XML_ELEMENT_NODE) &&
  ------------------
  |  Branch (568:2): [True: 474k, False: 6.34k]
  ------------------
  569|   474k|	(0 > XML_NODE_SORT_VALUE(node1)) &&
  ------------------
  |  |  295|   474k|#define XML_NODE_SORT_VALUE(n) XML_PTR_TO_INT((n)->content)
  |  |  ------------------
  |  |  |  |   58|   474k|#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
  |  |  ------------------
  ------------------
  |  Branch (569:2): [True: 0, False: 474k]
  ------------------
  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.57M|    for (cur = node1->next;cur != NULL;cur = cur->next)
  ------------------
  |  Branch (581:28): [True: 2.34M, False: 227k]
  ------------------
  582|  2.34M|	if (cur == node2)
  ------------------
  |  Branch (582:6): [True: 259k, False: 2.08M]
  ------------------
  583|   259k|	    return(1);
  584|   227k|    return(-1); /* assume there is no sibling list corruption */
  585|   487k|}
xpath.c:xmlXPathErrFmt:
  707|  8.32k|xmlXPathErrFmt(xmlXPathParserContext *ctxt, int code, const char *fmt, ...) {
  708|  8.32k|    va_list ap;
  709|  8.32k|    xmlStructuredErrorFunc schannel = NULL;
  710|  8.32k|    xmlGenericErrorFunc channel = NULL;
  711|  8.32k|    void *data = NULL;
  712|  8.32k|    xmlNodePtr node = NULL;
  713|  8.32k|    int res;
  714|       |
  715|  8.32k|    if (ctxt == NULL)
  ------------------
  |  Branch (715:9): [True: 0, False: 8.32k]
  ------------------
  716|      0|        return;
  717|  8.32k|    if ((code < 0) || (code > MAXERRNO))
  ------------------
  |  |  668|  8.32k|#define MAXERRNO ((int)(sizeof(xmlXPathErrorMessages) /	\
  |  |  669|  8.32k|		   sizeof(xmlXPathErrorMessages[0])) - 1)
  ------------------
  |  Branch (717:9): [True: 0, False: 8.32k]
  |  Branch (717:23): [True: 0, False: 8.32k]
  ------------------
  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.32k|    if (ctxt->error != 0)
  ------------------
  |  Branch (720:9): [True: 3.39k, False: 4.93k]
  ------------------
  721|  3.39k|        return;
  722|       |
  723|  4.93k|    ctxt->error = code;
  724|       |
  725|  4.93k|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (725:9): [True: 4.93k, False: 0]
  ------------------
  726|  4.93k|        xmlErrorPtr err = &ctxt->context->lastError;
  727|       |
  728|       |        /* Don't overwrite memory error. */
  729|  4.93k|        if (err->code == XML_ERR_NO_MEMORY)
  ------------------
  |  Branch (729:13): [True: 0, False: 4.93k]
  ------------------
  730|      0|            return;
  731|       |
  732|       |        /* cleanup current last error */
  733|  4.93k|        xmlResetError(err);
  734|       |
  735|  4.93k|        err->domain = XML_FROM_XPATH;
  736|  4.93k|        err->code = code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK;
  737|  4.93k|        err->level = XML_ERR_ERROR;
  738|  4.93k|        if (ctxt->base != NULL) {
  ------------------
  |  Branch (738:13): [True: 4.93k, False: 0]
  ------------------
  739|  4.93k|            err->str1 = (char *) xmlStrdup(ctxt->base);
  740|  4.93k|            if (err->str1 == NULL) {
  ------------------
  |  Branch (740:17): [True: 26, False: 4.90k]
  ------------------
  741|     26|                xmlXPathPErrMemory(ctxt);
  742|     26|                return;
  743|     26|            }
  744|  4.93k|        }
  745|  4.90k|        err->int1 = ctxt->cur - ctxt->base;
  746|  4.90k|        err->node = ctxt->context->debugNode;
  747|       |
  748|  4.90k|        schannel = ctxt->context->error;
  749|  4.90k|        data = ctxt->context->userData;
  750|  4.90k|        node = ctxt->context->debugNode;
  751|  4.90k|    }
  752|       |
  753|  4.90k|    if (schannel == NULL) {
  ------------------
  |  Branch (753:9): [True: 0, False: 4.90k]
  ------------------
  754|      0|        channel = xmlGenericError;
  ------------------
  |  |  976|      0|  #define xmlGenericError (*__xmlGenericError())
  ------------------
  755|      0|        data = xmlGenericErrorContext;
  ------------------
  |  |  983|      0|  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
  ------------------
  756|      0|    }
  757|       |
  758|  4.90k|    va_start(ap, fmt);
  759|  4.90k|    res = xmlVRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
  760|  4.90k|                         code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
  761|  4.90k|                         XML_ERR_ERROR, NULL, 0,
  762|  4.90k|                         (const char *) ctxt->base, NULL, NULL,
  763|  4.90k|                         ctxt->cur - ctxt->base, 0,
  764|  4.90k|                         fmt, ap);
  765|  4.90k|    va_end(ap);
  766|  4.90k|    if (res < 0)
  ------------------
  |  Branch (766:9): [True: 43, False: 4.86k]
  ------------------
  767|     43|        xmlXPathPErrMemory(ctxt);
  768|  4.90k|}
xpath.c:xmlXPathCastToNumberInternal:
 1931|   704k|                             xmlXPathObjectPtr val) {
 1932|   704k|    double ret = 0.0;
 1933|       |
 1934|   704k|    if (val == NULL)
  ------------------
  |  Branch (1934:9): [True: 0, False: 704k]
  ------------------
 1935|      0|	return(xmlXPathNAN);
 1936|   704k|    switch (val->type) {
  ------------------
  |  Branch (1936:13): [True: 704k, False: 0]
  ------------------
 1937|      0|    case XPATH_UNDEFINED:
  ------------------
  |  Branch (1937:5): [True: 0, False: 704k]
  ------------------
 1938|      0|	ret = xmlXPathNAN;
 1939|      0|	break;
 1940|   462k|    case XPATH_NODESET:
  ------------------
  |  Branch (1940:5): [True: 462k, False: 241k]
  ------------------
 1941|   462k|    case XPATH_XSLT_TREE: {
  ------------------
  |  Branch (1941:5): [True: 0, False: 704k]
  ------------------
 1942|   462k|        xmlChar *str;
 1943|       |
 1944|   462k|	str = xmlXPathCastNodeSetToString(val->nodesetval);
 1945|   462k|        if (str == NULL) {
  ------------------
  |  Branch (1945:13): [True: 80, False: 462k]
  ------------------
 1946|     80|            xmlXPathPErrMemory(ctxt);
 1947|     80|            ret = xmlXPathNAN;
 1948|   462k|        } else {
 1949|   462k|	    ret = xmlXPathCastStringToNumber(str);
 1950|   462k|            xmlFree(str);
 1951|   462k|        }
 1952|   462k|	break;
 1953|   462k|    }
 1954|   149k|    case XPATH_STRING:
  ------------------
  |  Branch (1954:5): [True: 149k, False: 554k]
  ------------------
 1955|   149k|	ret = xmlXPathCastStringToNumber(val->stringval);
 1956|   149k|	break;
 1957|  59.8k|    case XPATH_NUMBER:
  ------------------
  |  Branch (1957:5): [True: 59.8k, False: 644k]
  ------------------
 1958|  59.8k|	ret = val->floatval;
 1959|  59.8k|	break;
 1960|  31.9k|    case XPATH_BOOLEAN:
  ------------------
  |  Branch (1960:5): [True: 31.9k, False: 672k]
  ------------------
 1961|  31.9k|	ret = xmlXPathCastBooleanToNumber(val->boolval);
 1962|  31.9k|	break;
 1963|      0|    case XPATH_USERS:
  ------------------
  |  Branch (1963:5): [True: 0, False: 704k]
  ------------------
 1964|       |	/* TODO */
 1965|      0|	ret = xmlXPathNAN;
 1966|      0|	break;
 1967|   704k|    }
 1968|   704k|    return(ret);
 1969|   704k|}
xpath.c:xmlXPathNodeSetDupNs:
 2604|  96.1k|xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
 2605|  96.1k|    xmlNsPtr cur;
 2606|       |
 2607|  96.1k|    if ((ns == NULL) || (ns->type != XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2607:9): [True: 0, False: 96.1k]
  |  Branch (2607:25): [True: 0, False: 96.1k]
  ------------------
 2608|      0|	return(NULL);
 2609|  96.1k|    if ((node == NULL) || (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2609:9): [True: 0, False: 96.1k]
  |  Branch (2609:27): [True: 0, False: 96.1k]
  ------------------
 2610|      0|	return((xmlNodePtr) ns);
 2611|       |
 2612|       |    /*
 2613|       |     * Allocate a new Namespace and fill the fields.
 2614|       |     */
 2615|  96.1k|    cur = (xmlNsPtr) xmlMalloc(sizeof(xmlNs));
 2616|  96.1k|    if (cur == NULL)
  ------------------
  |  Branch (2616:9): [True: 25, False: 96.1k]
  ------------------
 2617|     25|	return(NULL);
 2618|  96.1k|    memset(cur, 0, sizeof(xmlNs));
 2619|  96.1k|    cur->type = XML_NAMESPACE_DECL;
 2620|  96.1k|    if (ns->href != NULL) {
  ------------------
  |  Branch (2620:9): [True: 59.0k, False: 37.1k]
  ------------------
 2621|  59.0k|	cur->href = xmlStrdup(ns->href);
 2622|  59.0k|        if (cur->href == NULL) {
  ------------------
  |  Branch (2622:13): [True: 21, False: 58.9k]
  ------------------
 2623|     21|            xmlFree(cur);
 2624|     21|            return(NULL);
 2625|     21|        }
 2626|  59.0k|    }
 2627|  96.1k|    if (ns->prefix != NULL) {
  ------------------
  |  Branch (2627:9): [True: 81.9k, False: 14.1k]
  ------------------
 2628|  81.9k|	cur->prefix = xmlStrdup(ns->prefix);
 2629|  81.9k|        if (cur->prefix == NULL) {
  ------------------
  |  Branch (2629:13): [True: 25, False: 81.9k]
  ------------------
 2630|     25|            xmlFree((xmlChar *) cur->href);
 2631|     25|            xmlFree(cur);
 2632|     25|            return(NULL);
 2633|     25|        }
 2634|  81.9k|    }
 2635|  96.0k|    cur->next = (xmlNsPtr) node;
 2636|  96.0k|    return((xmlNodePtr) cur);
 2637|  96.1k|}
xpath.c:xmlXPathNodeSetGrow:
 2735|  1.38M|xmlXPathNodeSetGrow(xmlNodeSetPtr cur) {
 2736|  1.38M|    xmlNodePtr *temp;
 2737|  1.38M|    int newSize;
 2738|       |
 2739|  1.38M|    newSize = xmlGrowCapacity(cur->nodeMax, sizeof(temp[0]),
 2740|  1.38M|                              XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  | 2593|  1.38M|#define XML_NODESET_DEFAULT	10
  ------------------
                                            XML_NODESET_DEFAULT, XPATH_MAX_NODESET_LENGTH);
  ------------------
  |  |  105|  1.38M|#define XPATH_MAX_NODESET_LENGTH 10000000
  ------------------
 2741|  1.38M|    if (newSize < 0)
  ------------------
  |  Branch (2741:9): [True: 0, False: 1.38M]
  ------------------
 2742|      0|        return(-1);
 2743|  1.38M|    temp = xmlRealloc(cur->nodeTab, newSize * sizeof(temp[0]));
 2744|  1.38M|    if (temp == NULL)
  ------------------
  |  Branch (2744:9): [True: 308, False: 1.38M]
  ------------------
 2745|    308|        return(-1);
 2746|  1.38M|    cur->nodeMax = newSize;
 2747|  1.38M|    cur->nodeTab = temp;
 2748|       |
 2749|  1.38M|    return(0);
 2750|  1.38M|}
xpath.c:xmlXPathReleaseObject:
 4257|  3.75M|{
 4258|  3.75M|    if (obj == NULL)
  ------------------
  |  Branch (4258:9): [True: 23, False: 3.75M]
  ------------------
 4259|     23|	return;
 4260|  3.75M|    if ((ctxt == NULL) || (ctxt->cache == NULL)) {
  ------------------
  |  Branch (4260:9): [True: 0, False: 3.75M]
  |  Branch (4260:27): [True: 3.75M, False: 0]
  ------------------
 4261|  3.75M|	 xmlXPathFreeObject(obj);
 4262|  3.75M|    } 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.75M|}
xpath.c:xmlXPathFormatNumber:
 2229|  19.1k|{
 2230|  19.1k|    switch (xmlXPathIsInf(number)) {
 2231|      0|    case 1:
  ------------------
  |  Branch (2231:5): [True: 0, False: 19.1k]
  ------------------
 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: 19.1k]
  ------------------
 2236|      0|	if (buffersize > (int)sizeof("-Infinity"))
  ------------------
  |  Branch (2236:6): [True: 0, False: 0]
  ------------------
 2237|      0|	    snprintf(buffer, buffersize, "-Infinity");
 2238|      0|	break;
 2239|  19.1k|    default:
  ------------------
  |  Branch (2239:5): [True: 19.1k, False: 0]
  ------------------
 2240|  19.1k|	if (xmlXPathIsNaN(number)) {
  ------------------
  |  Branch (2240:6): [True: 0, False: 19.1k]
  ------------------
 2241|      0|	    if (buffersize > (int)sizeof("NaN"))
  ------------------
  |  Branch (2241:10): [True: 0, False: 0]
  ------------------
 2242|      0|		snprintf(buffer, buffersize, "NaN");
 2243|  19.1k|	} else if (number == 0) {
  ------------------
  |  Branch (2243:13): [True: 0, False: 19.1k]
  ------------------
 2244|       |            /* Omit sign for negative zero. */
 2245|      0|	    snprintf(buffer, buffersize, "0");
 2246|  19.1k|	} else if ((number > INT_MIN) && (number < INT_MAX) &&
  ------------------
  |  Branch (2246:13): [True: 14.5k, False: 4.62k]
  |  Branch (2246:35): [True: 9.97k, False: 4.59k]
  ------------------
 2247|  9.97k|                   (number == (int) number)) {
  ------------------
  |  Branch (2247:20): [True: 3.44k, False: 6.52k]
  ------------------
 2248|  3.44k|	    char work[30];
 2249|  3.44k|	    char *ptr, *cur;
 2250|  3.44k|	    int value = (int) number;
 2251|       |
 2252|  3.44k|            ptr = &buffer[0];
 2253|  3.44k|	    if (value == 0) {
  ------------------
  |  Branch (2253:10): [True: 0, False: 3.44k]
  ------------------
 2254|      0|		*ptr++ = '0';
 2255|  3.44k|	    } else {
 2256|  3.44k|		snprintf(work, 29, "%d", value);
 2257|  3.44k|		cur = &work[0];
 2258|  26.6k|		while ((*cur) && (ptr - buffer < buffersize)) {
  ------------------
  |  Branch (2258:10): [True: 23.1k, False: 3.44k]
  |  Branch (2258:20): [True: 23.1k, False: 0]
  ------------------
 2259|  23.1k|		    *ptr++ = *cur++;
 2260|  23.1k|		}
 2261|  3.44k|	    }
 2262|  3.44k|	    if (ptr - buffer < buffersize) {
  ------------------
  |  Branch (2262:10): [True: 3.44k, False: 0]
  ------------------
 2263|  3.44k|		*ptr = 0;
 2264|  3.44k|	    } else if (buffersize > 0) {
  ------------------
  |  Branch (2264:17): [True: 0, False: 0]
  ------------------
 2265|      0|		ptr--;
 2266|      0|		*ptr = 0;
 2267|      0|	    }
 2268|  15.7k|	} 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|  15.7k|	    char work[DBL_DIG + EXPONENT_DIGITS + 3 + LOWER_DOUBLE_EXP];
 2279|  15.7k|	    int integer_place, fraction_place;
 2280|  15.7k|	    char *ptr;
 2281|  15.7k|	    char *after_fraction;
 2282|  15.7k|	    double absolute_value;
 2283|  15.7k|	    int size;
 2284|       |
 2285|  15.7k|	    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|  15.7k|	    if ( ((absolute_value > UPPER_DOUBLE) ||
  ------------------
  |  | 2212|  15.7k|#define UPPER_DOUBLE 1E9
  ------------------
  |  Branch (2292:12): [True: 9.39k, False: 6.35k]
  ------------------
 2293|  6.35k|		  (absolute_value < LOWER_DOUBLE)) &&
  ------------------
  |  | 2213|  6.35k|#define LOWER_DOUBLE 1E-5
  ------------------
  |  Branch (2293:5): [True: 644, False: 5.70k]
  ------------------
 2294|  10.0k|		 (absolute_value != 0.0) ) {
  ------------------
  |  Branch (2294:4): [True: 10.0k, False: 0]
  ------------------
 2295|       |		/* Use scientific notation */
 2296|  10.0k|		integer_place = DBL_DIG + EXPONENT_DIGITS + 1;
  ------------------
  |  | 2218|  10.0k|#define EXPONENT_DIGITS (3 + 2)
  ------------------
 2297|  10.0k|		fraction_place = DBL_DIG - 1;
 2298|  10.0k|		size = snprintf(work, sizeof(work),"%*.*e",
 2299|  10.0k|			 integer_place, fraction_place, number);
 2300|  52.3k|		while ((size > 0) && (work[size] != 'e')) size--;
  ------------------
  |  Branch (2300:10): [True: 52.3k, False: 0]
  |  Branch (2300:24): [True: 42.2k, False: 10.0k]
  ------------------
 2301|       |
 2302|  10.0k|	    }
 2303|  5.70k|	    else {
 2304|       |		/* Use regular notation */
 2305|  5.70k|		if (absolute_value > 0.0) {
  ------------------
  |  Branch (2305:7): [True: 5.70k, False: 0]
  ------------------
 2306|  5.70k|		    integer_place = (int)log10(absolute_value);
 2307|  5.70k|		    if (integer_place > 0)
  ------------------
  |  Branch (2307:11): [True: 878, False: 4.83k]
  ------------------
 2308|    878|		        fraction_place = DBL_DIG - integer_place - 1;
 2309|  4.83k|		    else
 2310|  4.83k|		        fraction_place = DBL_DIG - integer_place;
 2311|  5.70k|		} else {
 2312|      0|		    fraction_place = 1;
 2313|      0|		}
 2314|  5.70k|		size = snprintf(work, sizeof(work), "%0.*f",
 2315|  5.70k|				fraction_place, number);
 2316|  5.70k|	    }
 2317|       |
 2318|       |	    /* Remove leading spaces sometimes inserted by snprintf */
 2319|  20.4k|	    while (work[0] == ' ') {
  ------------------
  |  Branch (2319:13): [True: 4.72k, False: 15.7k]
  ------------------
 2320|  99.2k|	        for (ptr = &work[0];(ptr[0] = ptr[1]);ptr++);
  ------------------
  |  Branch (2320:30): [True: 94.5k, False: 4.72k]
  ------------------
 2321|  4.72k|		size--;
 2322|  4.72k|	    }
 2323|       |
 2324|       |	    /* Remove fractional trailing zeroes */
 2325|  15.7k|	    after_fraction = work + size;
 2326|  15.7k|	    ptr = after_fraction;
 2327|   103k|	    while (*(--ptr) == '0')
  ------------------
  |  Branch (2327:13): [True: 87.3k, False: 15.7k]
  ------------------
 2328|  87.3k|		;
 2329|  15.7k|	    if (*ptr != '.')
  ------------------
  |  Branch (2329:10): [True: 14.8k, False: 850]
  ------------------
 2330|  14.8k|	        ptr++;
 2331|  58.0k|	    while ((*ptr++ = *after_fraction++) != 0);
  ------------------
  |  Branch (2331:13): [True: 42.2k, False: 15.7k]
  ------------------
 2332|       |
 2333|       |	    /* Finally copy result back to caller */
 2334|  15.7k|	    size = strlen(work) + 1;
 2335|  15.7k|	    if (size > buffersize) {
  ------------------
  |  Branch (2335:10): [True: 0, False: 15.7k]
  ------------------
 2336|      0|		work[buffersize - 1] = 0;
 2337|      0|		size = buffersize;
 2338|      0|	    }
 2339|  15.7k|	    memmove(buffer, work, size);
 2340|  15.7k|	}
 2341|  19.1k|	break;
 2342|  19.1k|    }
 2343|  19.1k|}
xpath.c:xmlXPathNodeToNumberInternal:
 4532|  74.2k|xmlXPathNodeToNumberInternal(xmlXPathParserContextPtr ctxt, xmlNodePtr node) {
 4533|  74.2k|    xmlChar *strval;
 4534|  74.2k|    double ret;
 4535|       |
 4536|  74.2k|    if (node == NULL)
  ------------------
  |  Branch (4536:9): [True: 0, False: 74.2k]
  ------------------
 4537|      0|	return(xmlXPathNAN);
 4538|  74.2k|    strval = xmlXPathCastNodeToString(node);
 4539|  74.2k|    if (strval == NULL) {
  ------------------
  |  Branch (4539:9): [True: 11, False: 74.2k]
  ------------------
 4540|     11|        xmlXPathPErrMemory(ctxt);
 4541|     11|	return(xmlXPathNAN);
 4542|     11|    }
 4543|  74.2k|    ret = xmlXPathCastStringToNumber(strval);
 4544|  74.2k|    xmlFree(strval);
 4545|       |
 4546|  74.2k|    return(ret);
 4547|  74.2k|}
xpath.c:xmlXPathNewCompExpr:
  940|  11.2k|xmlXPathNewCompExpr(void) {
  941|  11.2k|    xmlXPathCompExprPtr cur;
  942|       |
  943|  11.2k|    cur = (xmlXPathCompExprPtr) xmlMalloc(sizeof(xmlXPathCompExpr));
  944|  11.2k|    if (cur == NULL)
  ------------------
  |  Branch (944:9): [True: 31, False: 11.2k]
  ------------------
  945|     31|	return(NULL);
  946|  11.2k|    memset(cur, 0, sizeof(xmlXPathCompExpr));
  947|  11.2k|#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
  948|  11.2k|    cur->maxStep = 1;
  949|       |#else
  950|       |    cur->maxStep = 10;
  951|       |#endif
  952|  11.2k|    cur->nbStep = 0;
  953|  11.2k|    cur->steps = (xmlXPathStepOp *) xmlMalloc(cur->maxStep *
  954|  11.2k|	                                   sizeof(xmlXPathStepOp));
  955|  11.2k|    if (cur->steps == NULL) {
  ------------------
  |  Branch (955:9): [True: 20, False: 11.2k]
  ------------------
  956|     20|	xmlFree(cur);
  957|     20|	return(NULL);
  958|     20|    }
  959|  11.2k|    memset(cur->steps, 0, cur->maxStep * sizeof(xmlXPathStepOp));
  960|  11.2k|    cur->last = -1;
  961|  11.2k|    return(cur);
  962|  11.2k|}
xpath.c:xmlXPathEqualNodeSets:
 5433|  32.4k|                      xmlXPathObjectPtr arg2, int neq) {
 5434|  32.4k|    int i, j;
 5435|  32.4k|    unsigned int *hashs1;
 5436|  32.4k|    unsigned int *hashs2;
 5437|  32.4k|    xmlChar **values1;
 5438|  32.4k|    xmlChar **values2;
 5439|  32.4k|    int ret = 0;
 5440|  32.4k|    xmlNodeSetPtr ns1;
 5441|  32.4k|    xmlNodeSetPtr ns2;
 5442|       |
 5443|  32.4k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5443:9): [True: 0, False: 32.4k]
  ------------------
 5444|  32.4k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5444:3): [True: 0, False: 32.4k]
  |  Branch (5444:36): [True: 0, False: 0]
  ------------------
 5445|      0|        return(0);
 5446|  32.4k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5446:9): [True: 0, False: 32.4k]
  ------------------
 5447|  32.4k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5447:3): [True: 0, False: 32.4k]
  |  Branch (5447:36): [True: 0, False: 0]
  ------------------
 5448|      0|        return(0);
 5449|       |
 5450|  32.4k|    ns1 = arg1->nodesetval;
 5451|  32.4k|    ns2 = arg2->nodesetval;
 5452|       |
 5453|  32.4k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0))
  ------------------
  |  Branch (5453:9): [True: 0, False: 32.4k]
  |  Branch (5453:26): [True: 7.96k, False: 24.4k]
  ------------------
 5454|  7.96k|	return(0);
 5455|  24.4k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0))
  ------------------
  |  Branch (5455:9): [True: 0, False: 24.4k]
  |  Branch (5455:26): [True: 3.45k, False: 21.0k]
  ------------------
 5456|  3.45k|	return(0);
 5457|       |
 5458|       |    /*
 5459|       |     * for equal, check if there is a node pertaining to both sets
 5460|       |     */
 5461|  21.0k|    if (neq == 0)
  ------------------
  |  Branch (5461:9): [True: 20.1k, False: 836]
  ------------------
 5462|  40.7k|	for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5462:13): [True: 22.7k, False: 17.9k]
  ------------------
 5463|  84.4k|	    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5463:17): [True: 63.9k, False: 20.5k]
  ------------------
 5464|  63.9k|		if (ns1->nodeTab[i] == ns2->nodeTab[j])
  ------------------
  |  Branch (5464:7): [True: 2.25k, False: 61.6k]
  ------------------
 5465|  2.25k|		    return(1);
 5466|       |
 5467|  18.7k|    values1 = (xmlChar **) xmlMalloc(ns1->nodeNr * sizeof(xmlChar *));
 5468|  18.7k|    if (values1 == NULL) {
  ------------------
  |  Branch (5468:9): [True: 2, False: 18.7k]
  ------------------
 5469|      2|        xmlXPathPErrMemory(ctxt);
 5470|      2|	return(0);
 5471|      2|    }
 5472|  18.7k|    hashs1 = (unsigned int *) xmlMalloc(ns1->nodeNr * sizeof(unsigned int));
 5473|  18.7k|    if (hashs1 == NULL) {
  ------------------
  |  Branch (5473:9): [True: 1, False: 18.7k]
  ------------------
 5474|      1|        xmlXPathPErrMemory(ctxt);
 5475|      1|	xmlFree(values1);
 5476|      1|	return(0);
 5477|      1|    }
 5478|  18.7k|    memset(values1, 0, ns1->nodeNr * sizeof(xmlChar *));
 5479|  18.7k|    values2 = (xmlChar **) xmlMalloc(ns2->nodeNr * sizeof(xmlChar *));
 5480|  18.7k|    if (values2 == NULL) {
  ------------------
  |  Branch (5480:9): [True: 3, False: 18.7k]
  ------------------
 5481|      3|        xmlXPathPErrMemory(ctxt);
 5482|      3|	xmlFree(hashs1);
 5483|      3|	xmlFree(values1);
 5484|      3|	return(0);
 5485|      3|    }
 5486|  18.7k|    hashs2 = (unsigned int *) xmlMalloc(ns2->nodeNr * sizeof(unsigned int));
 5487|  18.7k|    if (hashs2 == NULL) {
  ------------------
  |  Branch (5487:9): [True: 1, False: 18.7k]
  ------------------
 5488|      1|        xmlXPathPErrMemory(ctxt);
 5489|      1|	xmlFree(hashs1);
 5490|      1|	xmlFree(values1);
 5491|      1|	xmlFree(values2);
 5492|      1|	return(0);
 5493|      1|    }
 5494|  18.7k|    memset(values2, 0, ns2->nodeNr * sizeof(xmlChar *));
 5495|  38.6k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5495:16): [True: 21.5k, False: 17.1k]
  ------------------
 5496|  21.5k|	hashs1[i] = xmlXPathNodeValHash(ns1->nodeTab[i]);
 5497|  64.7k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5497:13): [True: 44.8k, False: 19.9k]
  ------------------
 5498|  44.8k|	    if (i == 0)
  ------------------
  |  Branch (5498:10): [True: 41.5k, False: 3.26k]
  ------------------
 5499|  41.5k|		hashs2[j] = xmlXPathNodeValHash(ns2->nodeTab[j]);
 5500|  44.8k|	    if (hashs1[i] != hashs2[j]) {
  ------------------
  |  Branch (5500:10): [True: 42.0k, False: 2.74k]
  ------------------
 5501|  42.0k|		if (neq) {
  ------------------
  |  Branch (5501:7): [True: 491, False: 41.5k]
  ------------------
 5502|    491|		    ret = 1;
 5503|    491|		    break;
 5504|    491|		}
 5505|  42.0k|	    }
 5506|  2.74k|	    else {
 5507|  2.74k|		if (values1[i] == NULL) {
  ------------------
  |  Branch (5507:7): [True: 2.43k, False: 317]
  ------------------
 5508|  2.43k|		    values1[i] = xmlNodeGetContent(ns1->nodeTab[i]);
 5509|  2.43k|                    if (values1[i] == NULL)
  ------------------
  |  Branch (5509:25): [True: 6, False: 2.42k]
  ------------------
 5510|      6|                        xmlXPathPErrMemory(ctxt);
 5511|  2.43k|                }
 5512|  2.74k|		if (values2[j] == NULL) {
  ------------------
  |  Branch (5512:7): [True: 2.00k, False: 747]
  ------------------
 5513|  2.00k|		    values2[j] = xmlNodeGetContent(ns2->nodeTab[j]);
 5514|  2.00k|                    if (values2[j] == NULL)
  ------------------
  |  Branch (5514:25): [True: 1, False: 1.99k]
  ------------------
 5515|      1|                        xmlXPathPErrMemory(ctxt);
 5516|  2.00k|                }
 5517|  2.74k|		ret = xmlStrEqual(values1[i], values2[j]) ^ neq;
 5518|  2.74k|		if (ret)
  ------------------
  |  Branch (5518:7): [True: 1.08k, False: 1.66k]
  ------------------
 5519|  1.08k|		    break;
 5520|  2.74k|	    }
 5521|  44.8k|	}
 5522|  21.5k|	if (ret)
  ------------------
  |  Branch (5522:6): [True: 1.57k, False: 19.9k]
  ------------------
 5523|  1.57k|	    break;
 5524|  21.5k|    }
 5525|  41.6k|    for (i = 0;i < ns1->nodeNr;i++)
  ------------------
  |  Branch (5525:16): [True: 22.9k, False: 18.7k]
  ------------------
 5526|  22.9k|	if (values1[i] != NULL)
  ------------------
  |  Branch (5526:6): [True: 2.42k, False: 20.4k]
  ------------------
 5527|  2.42k|	    xmlFree(values1[i]);
 5528|  60.3k|    for (j = 0;j < ns2->nodeNr;j++)
  ------------------
  |  Branch (5528:16): [True: 41.5k, False: 18.7k]
  ------------------
 5529|  41.5k|	if (values2[j] != NULL)
  ------------------
  |  Branch (5529:6): [True: 1.99k, False: 39.5k]
  ------------------
 5530|  1.99k|	    xmlFree(values2[j]);
 5531|  18.7k|    xmlFree(values1);
 5532|  18.7k|    xmlFree(values2);
 5533|  18.7k|    xmlFree(hashs1);
 5534|  18.7k|    xmlFree(hashs2);
 5535|  18.7k|    return(ret);
 5536|  18.7k|}
xpath.c:xmlXPathNodeValHash:
 4920|  83.2k|xmlXPathNodeValHash(xmlNodePtr node) {
 4921|  83.2k|    int len = 2;
 4922|  83.2k|    const xmlChar * string = NULL;
 4923|  83.2k|    xmlNodePtr tmp = NULL;
 4924|  83.2k|    unsigned int ret = 0;
 4925|       |
 4926|  83.2k|    if (node == NULL)
  ------------------
  |  Branch (4926:9): [True: 0, False: 83.2k]
  ------------------
 4927|      0|	return(0);
 4928|       |
 4929|  83.2k|    if (node->type == XML_DOCUMENT_NODE) {
  ------------------
  |  Branch (4929:9): [True: 19.1k, False: 64.0k]
  ------------------
 4930|  19.1k|	tmp = xmlDocGetRootElement((xmlDocPtr) node);
 4931|  19.1k|	if (tmp == NULL)
  ------------------
  |  Branch (4931:6): [True: 0, False: 19.1k]
  ------------------
 4932|      0|	    node = node->children;
 4933|  19.1k|	else
 4934|  19.1k|	    node = tmp;
 4935|       |
 4936|  19.1k|	if (node == NULL)
  ------------------
  |  Branch (4936:6): [True: 0, False: 19.1k]
  ------------------
 4937|      0|	    return(0);
 4938|  19.1k|    }
 4939|       |
 4940|  83.2k|    switch (node->type) {
 4941|    758|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (4941:2): [True: 758, False: 82.4k]
  ------------------
 4942|  2.06k|	case XML_PI_NODE:
  ------------------
  |  Branch (4942:2): [True: 1.30k, False: 81.9k]
  ------------------
 4943|  2.27k|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4943:2): [True: 210, False: 83.0k]
  ------------------
 4944|  9.12k|	case XML_TEXT_NODE:
  ------------------
  |  Branch (4944:2): [True: 6.84k, False: 76.3k]
  ------------------
 4945|  9.12k|	    string = node->content;
 4946|  9.12k|	    if (string == NULL)
  ------------------
  |  Branch (4946:10): [True: 1.30k, False: 7.81k]
  ------------------
 4947|  1.30k|		return(0);
 4948|  7.81k|	    if (string[0] == 0)
  ------------------
  |  Branch (4948:10): [True: 122, False: 7.69k]
  ------------------
 4949|    122|		return(0);
 4950|  7.69k|	    return(string[0] + (string[1] << 8));
 4951|    491|	case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (4951:2): [True: 491, False: 82.7k]
  ------------------
 4952|    491|	    string = ((xmlNsPtr)node)->href;
 4953|    491|	    if (string == NULL)
  ------------------
  |  Branch (4953:10): [True: 214, False: 277]
  ------------------
 4954|    214|		return(0);
 4955|    277|	    if (string[0] == 0)
  ------------------
  |  Branch (4955:10): [True: 0, False: 277]
  ------------------
 4956|      0|		return(0);
 4957|    277|	    return(string[0] + (string[1] << 8));
 4958|    929|	case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (4958:2): [True: 929, False: 82.3k]
  ------------------
 4959|    929|	    tmp = ((xmlAttrPtr) node)->children;
 4960|    929|	    break;
 4961|  72.6k|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (4961:2): [True: 72.6k, False: 10.5k]
  ------------------
 4962|  72.6k|	    tmp = node->children;
 4963|  72.6k|	    break;
 4964|      0|	default:
  ------------------
  |  Branch (4964:2): [True: 0, False: 83.2k]
  ------------------
 4965|      0|	    return(0);
 4966|  83.2k|    }
 4967|   409k|    while (tmp != NULL) {
  ------------------
  |  Branch (4967:12): [True: 375k, False: 34.0k]
  ------------------
 4968|   375k|	switch (tmp->type) {
 4969|  14.1k|	    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (4969:6): [True: 14.1k, False: 361k]
  ------------------
 4970|  62.4k|	    case XML_TEXT_NODE:
  ------------------
  |  Branch (4970:6): [True: 48.2k, False: 327k]
  ------------------
 4971|  62.4k|		string = tmp->content;
 4972|  62.4k|		break;
 4973|   313k|	    default:
  ------------------
  |  Branch (4973:6): [True: 313k, False: 62.4k]
  ------------------
 4974|   313k|                string = NULL;
 4975|   313k|		break;
 4976|   375k|	}
 4977|   375k|	if ((string != NULL) && (string[0] != 0)) {
  ------------------
  |  Branch (4977:6): [True: 62.4k, False: 313k]
  |  Branch (4977:26): [True: 62.0k, False: 373]
  ------------------
 4978|  62.0k|	    if (len == 1) {
  ------------------
  |  Branch (4978:10): [True: 19.9k, False: 42.1k]
  ------------------
 4979|  19.9k|		return(ret + (string[0] << 8));
 4980|  19.9k|	    }
 4981|  42.1k|	    if (string[1] == 0) {
  ------------------
  |  Branch (4981:10): [True: 22.4k, False: 19.6k]
  ------------------
 4982|  22.4k|		len = 1;
 4983|  22.4k|		ret = string[0];
 4984|  22.4k|	    } else {
 4985|  19.6k|		return(string[0] + (string[1] << 8));
 4986|  19.6k|	    }
 4987|  42.1k|	}
 4988|       |	/*
 4989|       |	 * Skip to next node
 4990|       |	 */
 4991|   335k|        if ((tmp->children != NULL) &&
  ------------------
  |  Branch (4991:13): [True: 141k, False: 193k]
  ------------------
 4992|   141k|            (tmp->type != XML_DTD_NODE) &&
  ------------------
  |  Branch (4992:13): [True: 141k, False: 0]
  ------------------
 4993|   141k|            (tmp->type != XML_ENTITY_REF_NODE) &&
  ------------------
  |  Branch (4993:13): [True: 141k, False: 0]
  ------------------
 4994|   141k|            (tmp->children->type != XML_ENTITY_DECL)) {
  ------------------
  |  Branch (4994:13): [True: 141k, False: 0]
  ------------------
 4995|   141k|            tmp = tmp->children;
 4996|   141k|            continue;
 4997|   141k|	}
 4998|   193k|	if (tmp == node)
  ------------------
  |  Branch (4998:6): [True: 0, False: 193k]
  ------------------
 4999|      0|	    break;
 5000|       |
 5001|   193k|	if (tmp->next != NULL) {
  ------------------
  |  Branch (5001:6): [True: 188k, False: 5.57k]
  ------------------
 5002|   188k|	    tmp = tmp->next;
 5003|   188k|	    continue;
 5004|   188k|	}
 5005|       |
 5006|  23.5k|	do {
 5007|  23.5k|	    tmp = tmp->parent;
 5008|  23.5k|	    if (tmp == NULL)
  ------------------
  |  Branch (5008:10): [True: 0, False: 23.5k]
  ------------------
 5009|      0|		break;
 5010|  23.5k|	    if (tmp == node) {
  ------------------
  |  Branch (5010:10): [True: 3.36k, False: 20.1k]
  ------------------
 5011|  3.36k|		tmp = NULL;
 5012|  3.36k|		break;
 5013|  3.36k|	    }
 5014|  20.1k|	    if (tmp->next != NULL) {
  ------------------
  |  Branch (5014:10): [True: 2.21k, False: 17.9k]
  ------------------
 5015|  2.21k|		tmp = tmp->next;
 5016|  2.21k|		break;
 5017|  2.21k|	    }
 5018|  20.1k|	} while (tmp != NULL);
  ------------------
  |  Branch (5018:11): [True: 17.9k, False: 0]
  ------------------
 5019|  5.57k|    }
 5020|  34.0k|    return(ret);
 5021|  73.6k|}
xpath.c:xmlXPathEqualNodeSetFloat:
 5370|  33.1k|    xmlXPathObjectPtr arg, double f, int neq) {
 5371|  33.1k|  int i, ret=0;
 5372|  33.1k|  xmlNodeSetPtr ns;
 5373|  33.1k|  xmlChar *str2;
 5374|  33.1k|  xmlXPathObjectPtr val;
 5375|  33.1k|  double v;
 5376|       |
 5377|  33.1k|    if ((arg == NULL) ||
  ------------------
  |  Branch (5377:9): [True: 0, False: 33.1k]
  ------------------
 5378|  33.1k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5378:3): [True: 0, False: 33.1k]
  |  Branch (5378:35): [True: 0, False: 0]
  ------------------
 5379|      0|        return(0);
 5380|       |
 5381|  33.1k|    ns = arg->nodesetval;
 5382|  33.1k|    if (ns != NULL) {
  ------------------
  |  Branch (5382:9): [True: 33.1k, False: 0]
  ------------------
 5383|  68.4k|	for (i=0;i<ns->nodeNr;i++) {
  ------------------
  |  Branch (5383:11): [True: 36.0k, False: 32.4k]
  ------------------
 5384|  36.0k|	    str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5385|  36.0k|	    if (str2 != NULL) {
  ------------------
  |  Branch (5385:10): [True: 36.0k, False: 13]
  ------------------
 5386|  36.0k|		xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5387|  36.0k|		xmlFree(str2);
 5388|  36.0k|		xmlXPathNumberFunction(ctxt, 1);
 5389|  36.0k|                CHECK_ERROR0;
  ------------------
  |  |  236|  36.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 14, False: 35.9k]
  |  |  ------------------
  ------------------
 5390|  35.9k|		val = xmlXPathValuePop(ctxt);
 5391|  35.9k|		v = val->floatval;
 5392|  35.9k|		xmlXPathReleaseObject(ctxt->context, val);
 5393|  35.9k|		if (!xmlXPathIsNaN(v)) {
  ------------------
  |  Branch (5393:7): [True: 3.30k, False: 32.6k]
  ------------------
 5394|  3.30k|		    if ((!neq) && (v==f)) {
  ------------------
  |  Branch (5394:11): [True: 3.14k, False: 158]
  |  Branch (5394:21): [True: 507, False: 2.63k]
  ------------------
 5395|    507|			ret = 1;
 5396|    507|			break;
 5397|  2.79k|		    } else if ((neq) && (v!=f)) {
  ------------------
  |  Branch (5397:18): [True: 158, False: 2.63k]
  |  Branch (5397:27): [True: 139, False: 19]
  ------------------
 5398|    139|			ret = 1;
 5399|    139|			break;
 5400|    139|		    }
 5401|  32.6k|		} else {	/* NaN is unequal to any value */
 5402|  32.6k|		    if (neq)
  ------------------
  |  Branch (5402:11): [True: 1.30k, False: 31.3k]
  ------------------
 5403|  1.30k|			ret = 1;
 5404|  32.6k|		}
 5405|  35.9k|	    } else {
 5406|     13|                xmlXPathPErrMemory(ctxt);
 5407|     13|            }
 5408|  36.0k|	}
 5409|  33.1k|    }
 5410|       |
 5411|  33.1k|    return(ret);
 5412|  33.1k|}
xpath.c:xmlXPathEqualNodeSetString:
 5314|  7.52k|{
 5315|  7.52k|    int i;
 5316|  7.52k|    xmlNodeSetPtr ns;
 5317|  7.52k|    xmlChar *str2;
 5318|  7.52k|    unsigned int hash;
 5319|       |
 5320|  7.52k|    if ((str == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5320:9): [True: 0, False: 7.52k]
  |  Branch (5320:26): [True: 0, False: 7.52k]
  ------------------
 5321|  7.52k|        ((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5321:10): [True: 0, False: 7.52k]
  |  Branch (5321:42): [True: 0, False: 0]
  ------------------
 5322|      0|        return (0);
 5323|  7.52k|    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|  7.52k|    if ((ns == NULL) || (ns->nodeNr <= 0) )
  ------------------
  |  Branch (5328:9): [True: 0, False: 7.52k]
  |  Branch (5328:25): [True: 5.99k, False: 1.52k]
  ------------------
 5329|  5.99k|        return (0);
 5330|  1.52k|    hash = xmlXPathStringHash(str);
 5331|  20.7k|    for (i = 0; i < ns->nodeNr; i++) {
  ------------------
  |  Branch (5331:17): [True: 20.1k, False: 600]
  ------------------
 5332|  20.1k|        if (xmlXPathNodeValHash(ns->nodeTab[i]) == hash) {
  ------------------
  |  Branch (5332:13): [True: 2.39k, False: 17.7k]
  ------------------
 5333|  2.39k|            str2 = xmlNodeGetContent(ns->nodeTab[i]);
 5334|  2.39k|            if (str2 == NULL) {
  ------------------
  |  Branch (5334:17): [True: 4, False: 2.39k]
  ------------------
 5335|      4|                xmlXPathPErrMemory(ctxt);
 5336|      4|                return(0);
 5337|      4|            }
 5338|  2.39k|            if (xmlStrEqual(str, str2)) {
  ------------------
  |  Branch (5338:17): [True: 1.61k, False: 778]
  ------------------
 5339|  1.61k|                xmlFree(str2);
 5340|  1.61k|		if (neq)
  ------------------
  |  Branch (5340:7): [True: 1.35k, False: 266]
  ------------------
 5341|  1.35k|		    continue;
 5342|    266|                return (1);
 5343|  1.61k|            } else if (neq) {
  ------------------
  |  Branch (5343:24): [True: 425, False: 353]
  ------------------
 5344|    425|		xmlFree(str2);
 5345|    425|		return (1);
 5346|    425|	    }
 5347|    353|            xmlFree(str2);
 5348|  17.7k|        } else if (neq)
  ------------------
  |  Branch (5348:20): [True: 234, False: 17.5k]
  ------------------
 5349|    234|	    return (1);
 5350|  20.1k|    }
 5351|    600|    return (0);
 5352|  1.52k|}
xpath.c:xmlXPathStringHash:
 5031|  1.52k|xmlXPathStringHash(const xmlChar * string) {
 5032|  1.52k|    if (string == NULL)
  ------------------
  |  Branch (5032:9): [True: 0, False: 1.52k]
  ------------------
 5033|      0|	return(0);
 5034|  1.52k|    if (string[0] == 0)
  ------------------
  |  Branch (5034:9): [True: 331, False: 1.19k]
  ------------------
 5035|    331|	return(0);
 5036|  1.19k|    return(string[0] + (string[1] << 8));
 5037|  1.52k|}
xpath.c:xmlXPathEqualValuesCommon:
 5540|   227k|  xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5541|   227k|    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|   227k|    switch (arg1->type) {
  ------------------
  |  Branch (5546:13): [True: 227k, False: 0]
  ------------------
 5547|      0|        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5547:9): [True: 0, False: 227k]
  ------------------
 5548|      0|	    break;
 5549|   110k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5549:9): [True: 110k, False: 116k]
  ------------------
 5550|   110k|	    switch (arg2->type) {
  ------------------
  |  Branch (5550:14): [True: 110k, False: 0]
  ------------------
 5551|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5551:10): [True: 0, False: 110k]
  ------------------
 5552|      0|		    break;
 5553|  68.7k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5553:3): [True: 68.7k, False: 41.6k]
  ------------------
 5554|  68.7k|		    ret = (arg1->boolval == arg2->boolval);
 5555|  68.7k|		    break;
 5556|  29.0k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5556:3): [True: 29.0k, False: 81.4k]
  ------------------
 5557|  29.0k|		    ret = (arg1->boolval ==
 5558|  29.0k|			   xmlXPathCastNumberToBoolean(arg2->floatval));
 5559|  29.0k|		    break;
 5560|  12.6k|		case XPATH_STRING:
  ------------------
  |  Branch (5560:3): [True: 12.6k, False: 97.7k]
  ------------------
 5561|  12.6k|		    if ((arg2->stringval == NULL) ||
  ------------------
  |  Branch (5561:11): [True: 0, False: 12.6k]
  ------------------
 5562|  12.6k|			(arg2->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5562:4): [True: 1.93k, False: 10.7k]
  ------------------
 5563|  10.7k|		    else
 5564|  10.7k|			ret = 1;
 5565|  12.6k|		    ret = (arg1->boolval == ret);
 5566|  12.6k|		    break;
 5567|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5567:3): [True: 0, False: 110k]
  ------------------
 5568|       |		    /* TODO */
 5569|      0|		    break;
 5570|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5570:3): [True: 0, False: 110k]
  ------------------
 5571|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5571:3): [True: 0, False: 110k]
  ------------------
 5572|      0|		    break;
 5573|   110k|	    }
 5574|   110k|	    break;
 5575|   115k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5575:9): [True: 115k, False: 111k]
  ------------------
 5576|   115k|	    switch (arg2->type) {
  ------------------
  |  Branch (5576:14): [True: 115k, False: 0]
  ------------------
 5577|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5577:10): [True: 0, False: 115k]
  ------------------
 5578|      0|		    break;
 5579|  27.4k|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5579:3): [True: 27.4k, False: 88.1k]
  ------------------
 5580|  27.4k|		    ret = (arg2->boolval==
 5581|  27.4k|			   xmlXPathCastNumberToBoolean(arg1->floatval));
 5582|  27.4k|		    break;
 5583|    808|		case XPATH_STRING:
  ------------------
  |  Branch (5583:3): [True: 808, False: 114k]
  ------------------
 5584|    808|		    xmlXPathValuePush(ctxt, arg2);
 5585|    808|		    xmlXPathNumberFunction(ctxt, 1);
 5586|    808|		    arg2 = xmlXPathValuePop(ctxt);
 5587|    808|                    if (ctxt->error)
  ------------------
  |  Branch (5587:25): [True: 3, False: 805]
  ------------------
 5588|      3|                        break;
 5589|       |                    /* Falls through. */
 5590|  88.1k|		case XPATH_NUMBER:
  ------------------
  |  Branch (5590:3): [True: 87.3k, False: 28.2k]
  ------------------
 5591|       |		    /* Hand check NaN and Infinity equalities */
 5592|  88.1k|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5592:11): [True: 4.55k, False: 83.5k]
  ------------------
 5593|  83.5k|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5593:8): [True: 1.39k, False: 82.1k]
  ------------------
 5594|  5.94k|		        ret = 0;
 5595|  82.1k|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5595:18): [True: 2.09k, False: 80.0k]
  ------------------
 5596|  2.09k|		        if (xmlXPathIsInf(arg2->floatval) == 1)
  ------------------
  |  Branch (5596:15): [True: 382, False: 1.71k]
  ------------------
 5597|    382|			    ret = 1;
 5598|  1.71k|			else
 5599|  1.71k|			    ret = 0;
 5600|  80.0k|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5600:18): [True: 1.86k, False: 78.2k]
  ------------------
 5601|  1.86k|			if (xmlXPathIsInf(arg2->floatval) == -1)
  ------------------
  |  Branch (5601:8): [True: 309, False: 1.55k]
  ------------------
 5602|    309|			    ret = 1;
 5603|  1.55k|			else
 5604|  1.55k|			    ret = 0;
 5605|  78.2k|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5605:18): [True: 629, False: 77.6k]
  ------------------
 5606|    629|			if (xmlXPathIsInf(arg1->floatval) == 1)
  ------------------
  |  Branch (5606:8): [True: 0, False: 629]
  ------------------
 5607|      0|			    ret = 1;
 5608|    629|			else
 5609|    629|			    ret = 0;
 5610|  77.6k|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5610:18): [True: 260, False: 77.3k]
  ------------------
 5611|    260|			if (xmlXPathIsInf(arg1->floatval) == -1)
  ------------------
  |  Branch (5611:8): [True: 0, False: 260]
  ------------------
 5612|      0|			    ret = 1;
 5613|    260|			else
 5614|    260|			    ret = 0;
 5615|  77.3k|		    } else {
 5616|  77.3k|		        ret = (arg1->floatval == arg2->floatval);
 5617|  77.3k|		    }
 5618|  88.1k|		    break;
 5619|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5619:3): [True: 0, False: 115k]
  ------------------
 5620|       |		    /* TODO */
 5621|      0|		    break;
 5622|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5622:3): [True: 0, False: 115k]
  ------------------
 5623|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5623:3): [True: 0, False: 115k]
  ------------------
 5624|      0|		    break;
 5625|   115k|	    }
 5626|   115k|	    break;
 5627|   115k|        case XPATH_STRING:
  ------------------
  |  Branch (5627:9): [True: 1.31k, False: 226k]
  ------------------
 5628|  1.31k|	    switch (arg2->type) {
  ------------------
  |  Branch (5628:14): [True: 1.31k, False: 0]
  ------------------
 5629|      0|	        case XPATH_UNDEFINED:
  ------------------
  |  Branch (5629:10): [True: 0, False: 1.31k]
  ------------------
 5630|      0|		    break;
 5631|    448|		case XPATH_BOOLEAN:
  ------------------
  |  Branch (5631:3): [True: 448, False: 864]
  ------------------
 5632|    448|		    if ((arg1->stringval == NULL) ||
  ------------------
  |  Branch (5632:11): [True: 0, False: 448]
  ------------------
 5633|    448|			(arg1->stringval[0] == 0)) ret = 0;
  ------------------
  |  Branch (5633:4): [True: 200, False: 248]
  ------------------
 5634|    248|		    else
 5635|    248|			ret = 1;
 5636|    448|		    ret = (arg2->boolval == ret);
 5637|    448|		    break;
 5638|     80|		case XPATH_STRING:
  ------------------
  |  Branch (5638:3): [True: 80, False: 1.23k]
  ------------------
 5639|     80|		    ret = xmlStrEqual(arg1->stringval, arg2->stringval);
 5640|     80|		    break;
 5641|    784|		case XPATH_NUMBER:
  ------------------
  |  Branch (5641:3): [True: 784, False: 528]
  ------------------
 5642|    784|		    xmlXPathValuePush(ctxt, arg1);
 5643|    784|		    xmlXPathNumberFunction(ctxt, 1);
 5644|    784|		    arg1 = xmlXPathValuePop(ctxt);
 5645|    784|                    if (ctxt->error)
  ------------------
  |  Branch (5645:25): [True: 2, False: 782]
  ------------------
 5646|      2|                        break;
 5647|       |		    /* Hand check NaN and Infinity equalities */
 5648|    782|		    if (xmlXPathIsNaN(arg1->floatval) ||
  ------------------
  |  Branch (5648:11): [True: 608, False: 174]
  ------------------
 5649|    691|			    xmlXPathIsNaN(arg2->floatval)) {
  ------------------
  |  Branch (5649:8): [True: 83, False: 91]
  ------------------
 5650|    691|		        ret = 0;
 5651|    691|		    } else if (xmlXPathIsInf(arg1->floatval) == 1) {
  ------------------
  |  Branch (5651:18): [True: 1, False: 90]
  ------------------
 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|     90|		    } else if (xmlXPathIsInf(arg1->floatval) == -1) {
  ------------------
  |  Branch (5656:18): [True: 1, False: 89]
  ------------------
 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|     89|		    } else if (xmlXPathIsInf(arg2->floatval) == 1) {
  ------------------
  |  Branch (5661:18): [True: 10, False: 79]
  ------------------
 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|     79|		    } else if (xmlXPathIsInf(arg2->floatval) == -1) {
  ------------------
  |  Branch (5666:18): [True: 3, False: 76]
  ------------------
 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|     76|		    } else {
 5672|     76|		        ret = (arg1->floatval == arg2->floatval);
 5673|     76|		    }
 5674|    782|		    break;
 5675|      0|		case XPATH_USERS:
  ------------------
  |  Branch (5675:3): [True: 0, False: 1.31k]
  ------------------
 5676|       |		    /* TODO */
 5677|      0|		    break;
 5678|      0|		case XPATH_NODESET:
  ------------------
  |  Branch (5678:3): [True: 0, False: 1.31k]
  ------------------
 5679|      0|		case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5679:3): [True: 0, False: 1.31k]
  ------------------
 5680|      0|		    break;
 5681|  1.31k|	    }
 5682|  1.31k|	    break;
 5683|  1.31k|        case XPATH_USERS:
  ------------------
  |  Branch (5683:9): [True: 0, False: 227k]
  ------------------
 5684|       |	    /* TODO */
 5685|      0|	    break;
 5686|      0|	case XPATH_NODESET:
  ------------------
  |  Branch (5686:2): [True: 0, False: 227k]
  ------------------
 5687|      0|	case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5687:2): [True: 0, False: 227k]
  ------------------
 5688|      0|	    break;
 5689|   227k|    }
 5690|   227k|    xmlXPathReleaseObject(ctxt->context, arg1);
 5691|   227k|    xmlXPathReleaseObject(ctxt->context, arg2);
 5692|   227k|    return(ret);
 5693|   227k|}
xpath.c:xmlXPathCompareNodeSets:
 5178|  85.0k|	                xmlXPathObjectPtr arg1, xmlXPathObjectPtr arg2) {
 5179|  85.0k|    int i, j, init = 0;
 5180|  85.0k|    double val1;
 5181|  85.0k|    double *values2;
 5182|  85.0k|    int ret = 0;
 5183|  85.0k|    xmlNodeSetPtr ns1;
 5184|  85.0k|    xmlNodeSetPtr ns2;
 5185|       |
 5186|  85.0k|    if ((arg1 == NULL) ||
  ------------------
  |  Branch (5186:9): [True: 0, False: 85.0k]
  ------------------
 5187|  85.0k|	((arg1->type != XPATH_NODESET) && (arg1->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5187:3): [True: 0, False: 85.0k]
  |  Branch (5187:36): [True: 0, False: 0]
  ------------------
 5188|      0|	xmlXPathFreeObject(arg2);
 5189|      0|        return(0);
 5190|      0|    }
 5191|  85.0k|    if ((arg2 == NULL) ||
  ------------------
  |  Branch (5191:9): [True: 0, False: 85.0k]
  ------------------
 5192|  85.0k|	((arg2->type != XPATH_NODESET) && (arg2->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5192:3): [True: 0, False: 85.0k]
  |  Branch (5192:36): [True: 0, False: 0]
  ------------------
 5193|      0|	xmlXPathFreeObject(arg1);
 5194|      0|	xmlXPathFreeObject(arg2);
 5195|      0|        return(0);
 5196|      0|    }
 5197|       |
 5198|  85.0k|    ns1 = arg1->nodesetval;
 5199|  85.0k|    ns2 = arg2->nodesetval;
 5200|       |
 5201|  85.0k|    if ((ns1 == NULL) || (ns1->nodeNr <= 0)) {
  ------------------
  |  Branch (5201:9): [True: 0, False: 85.0k]
  |  Branch (5201:26): [True: 55.1k, False: 29.8k]
  ------------------
 5202|  55.1k|	xmlXPathFreeObject(arg1);
 5203|  55.1k|	xmlXPathFreeObject(arg2);
 5204|  55.1k|	return(0);
 5205|  55.1k|    }
 5206|  29.8k|    if ((ns2 == NULL) || (ns2->nodeNr <= 0)) {
  ------------------
  |  Branch (5206:9): [True: 0, False: 29.8k]
  |  Branch (5206:26): [True: 24.8k, False: 4.93k]
  ------------------
 5207|  24.8k|	xmlXPathFreeObject(arg1);
 5208|  24.8k|	xmlXPathFreeObject(arg2);
 5209|  24.8k|	return(0);
 5210|  24.8k|    }
 5211|       |
 5212|  4.93k|    values2 = (double *) xmlMalloc(ns2->nodeNr * sizeof(double));
 5213|  4.93k|    if (values2 == NULL) {
  ------------------
  |  Branch (5213:9): [True: 2, False: 4.93k]
  ------------------
 5214|      2|        xmlXPathPErrMemory(ctxt);
 5215|      2|	xmlXPathFreeObject(arg1);
 5216|      2|	xmlXPathFreeObject(arg2);
 5217|      2|	return(0);
 5218|      2|    }
 5219|  44.9k|    for (i = 0;i < ns1->nodeNr;i++) {
  ------------------
  |  Branch (5219:16): [True: 42.4k, False: 2.51k]
  ------------------
 5220|  42.4k|	val1 = xmlXPathNodeToNumberInternal(ctxt, ns1->nodeTab[i]);
 5221|  42.4k|	if (xmlXPathIsNaN(val1))
  ------------------
  |  Branch (5221:6): [True: 37.5k, False: 4.88k]
  ------------------
 5222|  37.5k|	    continue;
 5223|  38.7k|	for (j = 0;j < ns2->nodeNr;j++) {
  ------------------
  |  Branch (5223:13): [True: 36.2k, False: 2.47k]
  ------------------
 5224|  36.2k|	    if (init == 0) {
  ------------------
  |  Branch (5224:10): [True: 31.7k, False: 4.54k]
  ------------------
 5225|  31.7k|		values2[j] = xmlXPathNodeToNumberInternal(ctxt,
 5226|  31.7k|                                                          ns2->nodeTab[j]);
 5227|  31.7k|	    }
 5228|  36.2k|	    if (xmlXPathIsNaN(values2[j]))
  ------------------
  |  Branch (5228:10): [True: 30.7k, False: 5.57k]
  ------------------
 5229|  30.7k|		continue;
 5230|  5.57k|	    if (inf && strict)
  ------------------
  |  Branch (5230:10): [True: 526, False: 5.05k]
  |  Branch (5230:17): [True: 249, False: 277]
  ------------------
 5231|    249|		ret = (val1 < values2[j]);
 5232|  5.32k|	    else if (inf && !strict)
  ------------------
  |  Branch (5232:15): [True: 277, False: 5.05k]
  |  Branch (5232:22): [True: 277, False: 0]
  ------------------
 5233|    277|		ret = (val1 <= values2[j]);
 5234|  5.05k|	    else if (!inf && strict)
  ------------------
  |  Branch (5234:15): [True: 5.05k, False: 0]
  |  Branch (5234:23): [True: 4.29k, False: 757]
  ------------------
 5235|  4.29k|		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|  5.57k|	    if (ret)
  ------------------
  |  Branch (5238:10): [True: 2.41k, False: 3.15k]
  ------------------
 5239|  2.41k|		break;
 5240|  5.57k|	}
 5241|  4.88k|	if (ret)
  ------------------
  |  Branch (5241:6): [True: 2.41k, False: 2.47k]
  ------------------
 5242|  2.41k|	    break;
 5243|  2.47k|	init = 1;
 5244|  2.47k|    }
 5245|  4.93k|    xmlFree(values2);
 5246|  4.93k|    xmlXPathFreeObject(arg1);
 5247|  4.93k|    xmlXPathFreeObject(arg2);
 5248|  4.93k|    return(ret);
 5249|  4.93k|}
xpath.c:xmlXPathCompareNodeSetValue:
 5272|  70.8k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr val) {
 5273|  70.8k|    if ((val == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5273:9): [True: 0, False: 70.8k]
  |  Branch (5273:26): [True: 0, False: 70.8k]
  ------------------
 5274|  70.8k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE)))
  ------------------
  |  Branch (5274:3): [True: 0, False: 70.8k]
  |  Branch (5274:35): [True: 0, False: 0]
  ------------------
 5275|      0|        return(0);
 5276|       |
 5277|  70.8k|    switch(val->type) {
 5278|  59.2k|        case XPATH_NUMBER:
  ------------------
  |  Branch (5278:9): [True: 59.2k, False: 11.5k]
  ------------------
 5279|  59.2k|	    return(xmlXPathCompareNodeSetFloat(ctxt, inf, strict, arg, val));
 5280|      0|        case XPATH_NODESET:
  ------------------
  |  Branch (5280:9): [True: 0, False: 70.8k]
  ------------------
 5281|      0|        case XPATH_XSLT_TREE:
  ------------------
  |  Branch (5281:9): [True: 0, False: 70.8k]
  ------------------
 5282|      0|	    return(xmlXPathCompareNodeSets(ctxt, inf, strict, arg, val));
 5283|  1.38k|        case XPATH_STRING:
  ------------------
  |  Branch (5283:9): [True: 1.38k, False: 69.4k]
  ------------------
 5284|  1.38k|	    return(xmlXPathCompareNodeSetString(ctxt, inf, strict, arg, val));
 5285|  10.1k|        case XPATH_BOOLEAN:
  ------------------
  |  Branch (5285:9): [True: 10.1k, False: 60.6k]
  ------------------
 5286|  10.1k|	    xmlXPathValuePush(ctxt, arg);
 5287|  10.1k|	    xmlXPathBooleanFunction(ctxt, 1);
 5288|  10.1k|	    xmlXPathValuePush(ctxt, val);
 5289|  10.1k|	    return(xmlXPathCompareValues(ctxt, inf, strict));
 5290|      0|	default:
  ------------------
  |  Branch (5290:2): [True: 0, False: 70.8k]
  ------------------
 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|  70.8k|    }
 5295|      0|    return(0);
 5296|  70.8k|}
xpath.c:xmlXPathCompareNodeSetFloat:
 5061|  59.2k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr f) {
 5062|  59.2k|    int i, ret = 0;
 5063|  59.2k|    xmlNodeSetPtr ns;
 5064|  59.2k|    xmlChar *str2;
 5065|       |
 5066|  59.2k|    if ((f == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5066:9): [True: 0, False: 59.2k]
  |  Branch (5066:24): [True: 0, False: 59.2k]
  ------------------
 5067|  59.2k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5067:3): [True: 0, False: 59.2k]
  |  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|  59.2k|    ns = arg->nodesetval;
 5073|  59.2k|    if (ns != NULL) {
  ------------------
  |  Branch (5073:9): [True: 59.2k, False: 0]
  ------------------
 5074|   143k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5074:13): [True: 85.6k, False: 57.4k]
  ------------------
 5075|  85.6k|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5076|  85.6k|	     if (str2 != NULL) {
  ------------------
  |  Branch (5076:11): [True: 85.6k, False: 6]
  ------------------
 5077|  85.6k|		 xmlXPathValuePush(ctxt, xmlXPathCacheNewString(ctxt, str2));
 5078|  85.6k|		 xmlFree(str2);
 5079|  85.6k|		 xmlXPathNumberFunction(ctxt, 1);
 5080|  85.6k|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, f));
 5081|  85.6k|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5082|  85.6k|		 if (ret)
  ------------------
  |  Branch (5082:8): [True: 1.73k, False: 83.8k]
  ------------------
 5083|  1.73k|		     break;
 5084|  85.6k|	     } else {
 5085|      6|                 xmlXPathPErrMemory(ctxt);
 5086|      6|             }
 5087|  85.6k|	}
 5088|  59.2k|    }
 5089|  59.2k|    xmlXPathReleaseObject(ctxt->context, arg);
 5090|  59.2k|    xmlXPathReleaseObject(ctxt->context, f);
 5091|  59.2k|    return(ret);
 5092|  59.2k|}
xpath.c:xmlXPathCacheObjectCopy:
 1881|   398k|{
 1882|   398k|    xmlXPathObjectPtr ret;
 1883|   398k|    xmlXPathContextPtr ctxt = pctxt->context;
 1884|       |
 1885|   398k|    if (val == NULL)
  ------------------
  |  Branch (1885:9): [True: 0, False: 398k]
  ------------------
 1886|      0|	return(NULL);
 1887|       |
 1888|   398k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1888:9): [True: 398k, False: 0]
  |  Branch (1888:27): [True: 0, False: 398k]
  ------------------
 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|   398k|    ret = xmlXPathObjectCopy(val);
 1911|   398k|    if (ret == NULL)
  ------------------
  |  Branch (1911:9): [True: 91, False: 398k]
  ------------------
 1912|     91|        xmlXPathPErrMemory(pctxt);
 1913|   398k|    return(ret);
 1914|   398k|}
xpath.c:xmlXPathCompareNodeSetString:
 5115|  1.38k|	                    xmlXPathObjectPtr arg, xmlXPathObjectPtr s) {
 5116|  1.38k|    int i, ret = 0;
 5117|  1.38k|    xmlNodeSetPtr ns;
 5118|  1.38k|    xmlChar *str2;
 5119|       |
 5120|  1.38k|    if ((s == NULL) || (arg == NULL) ||
  ------------------
  |  Branch (5120:9): [True: 0, False: 1.38k]
  |  Branch (5120:24): [True: 0, False: 1.38k]
  ------------------
 5121|  1.38k|	((arg->type != XPATH_NODESET) && (arg->type != XPATH_XSLT_TREE))) {
  ------------------
  |  Branch (5121:3): [True: 0, False: 1.38k]
  |  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.38k|    ns = arg->nodesetval;
 5127|  1.38k|    if (ns != NULL) {
  ------------------
  |  Branch (5127:9): [True: 1.38k, False: 0]
  ------------------
 5128|  2.37k|	for (i = 0;i < ns->nodeNr;i++) {
  ------------------
  |  Branch (5128:13): [True: 989, False: 1.38k]
  ------------------
 5129|    989|	     str2 = xmlXPathCastNodeToString(ns->nodeTab[i]);
 5130|    989|	     if (str2 != NULL) {
  ------------------
  |  Branch (5130:11): [True: 988, False: 1]
  ------------------
 5131|    988|		 xmlXPathValuePush(ctxt,
 5132|    988|			   xmlXPathCacheNewString(ctxt, str2));
 5133|    988|		 xmlFree(str2);
 5134|    988|		 xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, s));
 5135|    988|		 ret = xmlXPathCompareValues(ctxt, inf, strict);
 5136|    988|		 if (ret)
  ------------------
  |  Branch (5136:8): [True: 0, False: 988]
  ------------------
 5137|      0|		     break;
 5138|    988|	     } else {
 5139|      1|                 xmlXPathPErrMemory(ctxt);
 5140|      1|             }
 5141|    989|	}
 5142|  1.38k|    }
 5143|  1.38k|    xmlXPathReleaseObject(ctxt->context, arg);
 5144|  1.38k|    xmlXPathReleaseObject(ctxt->context, s);
 5145|  1.38k|    return(ret);
 5146|  1.38k|}
xpath.c:xmlXPathCacheNewNodeSet:
 1689|  1.24M|{
 1690|  1.24M|    xmlXPathObjectPtr ret;
 1691|  1.24M|    xmlXPathContextPtr ctxt = pctxt->context;
 1692|       |
 1693|  1.24M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1693:9): [True: 1.24M, False: 0]
  |  Branch (1693:27): [True: 0, False: 1.24M]
  ------------------
 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.24M|    ret = xmlXPathNewNodeSet(val);
 1741|  1.24M|    if (ret == NULL)
  ------------------
  |  Branch (1741:9): [True: 468, False: 1.24M]
  ------------------
 1742|    468|        xmlXPathPErrMemory(pctxt);
 1743|  1.24M|    return(ret);
 1744|  1.24M|}
xpath.c:xmlXPathCacheNewFloat:
 1847|   468k|{
 1848|   468k|    xmlXPathObjectPtr ret;
 1849|   468k|    xmlXPathContextPtr ctxt = pctxt->context;
 1850|       |
 1851|   468k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1851:9): [True: 468k, False: 0]
  |  Branch (1851:27): [True: 0, False: 468k]
  ------------------
 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|   468k|    ret = xmlXPathNewFloat(val);
 1866|   468k|    if (ret == NULL)
  ------------------
  |  Branch (1866:9): [True: 146, False: 467k]
  ------------------
 1867|    146|        xmlXPathPErrMemory(pctxt);
 1868|   468k|    return(ret);
 1869|   468k|}
xpath.c:xmlXPathGetElementsByIds:
 6976|  8.04k|xmlXPathGetElementsByIds (xmlDocPtr doc, const xmlChar *ids) {
 6977|  8.04k|    xmlNodeSetPtr ret;
 6978|  8.04k|    const xmlChar *cur = ids;
 6979|  8.04k|    xmlChar *ID;
 6980|  8.04k|    xmlAttrPtr attr;
 6981|  8.04k|    xmlNodePtr elem = NULL;
 6982|       |
 6983|  8.04k|    if (ids == NULL) return(NULL);
  ------------------
  |  Branch (6983:9): [True: 13, False: 8.02k]
  ------------------
 6984|       |
 6985|  8.02k|    ret = xmlXPathNodeSetCreate(NULL);
 6986|  8.02k|    if (ret == NULL)
  ------------------
  |  Branch (6986:9): [True: 8, False: 8.02k]
  ------------------
 6987|      8|        return(ret);
 6988|       |
 6989|  8.02k|    while (IS_BLANK_CH(*cur)) cur++;
 6990|  17.7k|    while (*cur != 0) {
  ------------------
  |  Branch (6990:12): [True: 9.70k, False: 7.99k]
  ------------------
 6991|  81.3k|	while ((!IS_BLANK_CH(*cur)) && (*cur != 0))
  ------------------
  |  |  137|  81.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  81.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 3.64k, False: 77.7k]
  |  |  |  |  ------------------
  |  |  |  |   91|  81.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 72.3k, False: 5.43k]
  |  |  |  |  |  Branch (91:23): [True: 346, False: 71.9k]
  |  |  |  |  ------------------
  |  |  |  |   92|  81.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 282, False: 77.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6991:33): [True: 71.6k, False: 5.43k]
  ------------------
 6992|  71.6k|	    cur++;
 6993|       |
 6994|  9.70k|        ID = xmlStrndup(ids, cur - ids);
 6995|  9.70k|	if (ID == NULL) {
  ------------------
  |  Branch (6995:6): [True: 22, False: 9.68k]
  ------------------
 6996|     22|            xmlXPathFreeNodeSet(ret);
 6997|     22|            return(NULL);
 6998|     22|        }
 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|  9.68k|        attr = xmlGetID(doc, ID);
 7007|  9.68k|        xmlFree(ID);
 7008|  9.68k|        if (attr != NULL) {
  ------------------
  |  Branch (7008:13): [True: 2.06k, False: 7.61k]
  ------------------
 7009|  2.06k|            if (attr->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (7009:17): [True: 2.06k, False: 0]
  ------------------
 7010|  2.06k|                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.06k|            if (elem != NULL) {
  ------------------
  |  Branch (7015:17): [True: 2.06k, False: 0]
  ------------------
 7016|  2.06k|                if (xmlXPathNodeSetAdd(ret, elem) < 0) {
  ------------------
  |  Branch (7016:21): [True: 1, False: 2.06k]
  ------------------
 7017|      1|                    xmlXPathFreeNodeSet(ret);
 7018|      1|                    return(NULL);
 7019|      1|                }
 7020|  2.06k|            }
 7021|  2.06k|        }
 7022|       |
 7023|  9.67k|	while (IS_BLANK_CH(*cur)) cur++;
 7024|  9.67k|	ids = cur;
 7025|  9.67k|    }
 7026|  7.99k|    return(ret);
 7027|  8.02k|}
xpath.c:xmlXPathCacheWrapNodeSet:
 1620|  1.08M|{
 1621|  1.08M|    xmlXPathObjectPtr ret;
 1622|  1.08M|    xmlXPathContextPtr ctxt = pctxt->context;
 1623|       |
 1624|  1.08M|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1624:9): [True: 1.08M, False: 0]
  |  Branch (1624:27): [True: 0, False: 1.08M]
  ------------------
 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.08M|    ret = xmlXPathWrapNodeSet(val);
 1640|  1.08M|    if (ret == NULL)
  ------------------
  |  Branch (1640:9): [True: 181, False: 1.08M]
  ------------------
 1641|    181|        xmlXPathPErrMemory(pctxt);
 1642|  1.08M|    return(ret);
 1643|  1.08M|}
xpath.c:xmlXPathCacheNewCString:
 1799|  6.32k|{
 1800|  6.32k|    return xmlXPathCacheNewString(pctxt, BAD_CAST val);
  ------------------
  |  |   34|  6.32k|#define BAD_CAST (xmlChar *)
  ------------------
 1801|  6.32k|}
xpath.c:xmlXPathCacheNewString:
 1756|   139k|{
 1757|   139k|    xmlXPathObjectPtr ret;
 1758|   139k|    xmlXPathContextPtr ctxt = pctxt->context;
 1759|       |
 1760|   139k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1760:9): [True: 139k, False: 0]
  |  Branch (1760:27): [True: 0, False: 139k]
  ------------------
 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|   139k|    ret = xmlXPathNewString(val);
 1784|   139k|    if (ret == NULL)
  ------------------
  |  Branch (1784:9): [True: 34, False: 139k]
  ------------------
 1785|     34|        xmlXPathPErrMemory(pctxt);
 1786|   139k|    return(ret);
 1787|   139k|}
xpath.c:xmlXPathCacheWrapString:
 1655|  70.0k|{
 1656|  70.0k|    xmlXPathObjectPtr ret;
 1657|  70.0k|    xmlXPathContextPtr ctxt = pctxt->context;
 1658|       |
 1659|  70.0k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1659:9): [True: 70.0k, False: 0]
  |  Branch (1659:27): [True: 0, False: 70.0k]
  ------------------
 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|  70.0k|    ret = xmlXPathWrapString(val);
 1673|  70.0k|    if (ret == NULL)
  ------------------
  |  Branch (1673:9): [True: 52, False: 69.9k]
  ------------------
 1674|     52|        xmlXPathPErrMemory(pctxt);
 1675|  70.0k|    return(ret);
 1676|  70.0k|}
xpath.c:xmlXPathCacheNewBoolean:
 1813|   595k|{
 1814|   595k|    xmlXPathObjectPtr ret;
 1815|   595k|    xmlXPathContextPtr ctxt = pctxt->context;
 1816|       |
 1817|   595k|    if ((ctxt != NULL) && (ctxt->cache != NULL)) {
  ------------------
  |  Branch (1817:9): [True: 595k, False: 0]
  |  Branch (1817:27): [True: 0, False: 595k]
  ------------------
 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|   595k|    ret = xmlXPathNewBoolean(val);
 1832|   595k|    if (ret == NULL)
  ------------------
  |  Branch (1832:9): [True: 93, False: 595k]
  ------------------
 1833|     93|        xmlXPathPErrMemory(pctxt);
 1834|   595k|    return(ret);
 1835|   595k|}
xpath.c:xmlXPathCheckOpLimit:
  803|  14.3M|xmlXPathCheckOpLimit(xmlXPathParserContextPtr ctxt, unsigned long opCount) {
  804|  14.3M|    xmlXPathContextPtr xpctxt = ctxt->context;
  805|       |
  806|  14.3M|    if ((opCount > xpctxt->opLimit) ||
  ------------------
  |  Branch (806:9): [True: 1, False: 14.3M]
  ------------------
  807|  14.3M|        (xpctxt->opCount > xpctxt->opLimit - opCount)) {
  ------------------
  |  Branch (807:9): [True: 109, False: 14.3M]
  ------------------
  808|    110|        xpctxt->opCount = xpctxt->opLimit;
  809|    110|        xmlXPathErr(ctxt, XPATH_OP_LIMIT_EXCEEDED);
  810|    110|        return(-1);
  811|    110|    }
  812|       |
  813|  14.3M|    xpctxt->opCount += opCount;
  814|  14.3M|    return(0);
  815|  14.3M|}
xpath.c:xmlXPathCompileExpr:
 9088|  54.7k|xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
 9089|  54.7k|    xmlXPathContextPtr xpctxt = ctxt->context;
 9090|       |
 9091|  54.7k|    if (xpctxt != NULL) {
  ------------------
  |  Branch (9091:9): [True: 54.7k, False: 0]
  ------------------
 9092|  54.7k|        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  54.7k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9092:13): [True: 298, False: 54.4k]
  ------------------
 9093|  54.4k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|    298|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9094|       |        /*
 9095|       |         * Parsing a single '(' pushes about 10 functions on the call stack
 9096|       |         * before recursing!
 9097|       |         */
 9098|  54.4k|        xpctxt->depth += 10;
 9099|  54.4k|    }
 9100|       |
 9101|  54.4k|    xmlXPathCompAndExpr(ctxt);
 9102|  54.4k|    CHECK_ERROR;
  ------------------
  |  |  230|  54.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.40k, False: 49.0k]
  |  |  ------------------
  ------------------
 9103|  49.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  49.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  54.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9104|  53.1k|    while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2193|  53.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'o') && (NXT(1) == 'r')) {
  ------------------
  |  | 2195|  4.20k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9104:12): [True: 4.20k, False: 48.9k]
  |  Branch (9104:28): [True: 4.19k, False: 12]
  ------------------
 9105|  4.19k|	int op1 = ctxt->comp->last;
 9106|  4.19k|        SKIP(2);
  ------------------
  |  | 2194|  4.19k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9107|  4.19k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  5.66k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.66k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.66k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9108|  4.19k|        xmlXPathCompAndExpr(ctxt);
 9109|  4.19k|	CHECK_ERROR;
  ------------------
  |  |  230|  4.19k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 108, False: 4.08k]
  |  |  ------------------
  ------------------
 9110|  4.08k|	PUSH_BINARY_EXPR(XPATH_OP_OR, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  4.08k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  4.08k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  4.08k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9111|  4.08k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  4.08k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.08k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9112|  4.08k|    }
 9113|  48.9k|    if ((sort) && (ctxt->comp->steps[ctxt->comp->last].op != XPATH_OP_VALUE)) {
  ------------------
  |  Branch (9113:9): [True: 41.5k, False: 7.39k]
  |  Branch (9113:19): [True: 27.8k, False: 13.7k]
  ------------------
 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|  27.8k|	PUSH_UNARY_EXPR(XPATH_OP_SORT, ctxt->comp->last , 0, 0);
  ------------------
  |  | 1091|  27.8k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  27.8k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 9121|  27.8k|    }
 9122|       |
 9123|  48.9k|    if (xpctxt != NULL)
  ------------------
  |  Branch (9123:9): [True: 48.9k, False: 0]
  ------------------
 9124|  48.9k|        xpctxt->depth -= 10;
 9125|  48.9k|}
xpath.c:xmlXPathCompAndExpr:
 9062|  58.6k|xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
 9063|  58.6k|    xmlXPathCompEqualityExpr(ctxt);
 9064|  58.6k|    CHECK_ERROR;
  ------------------
  |  |  230|  58.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.46k, False: 53.2k]
  |  |  ------------------
  ------------------
 9065|  53.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  53.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  58.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9066|  54.1k|    while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2193|  54.1k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|  1.00k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                  while ((CUR == 'a') && (NXT(1) == 'n') && (NXT(2) == 'd')) {
  ------------------
  |  | 2195|    972|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9066:12): [True: 1.00k, False: 53.1k]
  |  Branch (9066:28): [True: 972, False: 33]
  |  Branch (9066:47): [True: 968, False: 4]
  ------------------
 9067|    968|	int op1 = ctxt->comp->last;
 9068|    968|        SKIP(3);
  ------------------
  |  | 2194|    968|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9069|    968|	SKIP_BLANKS;
  ------------------
  |  | 2199|  2.59k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.59k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.59k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9070|    968|        xmlXPathCompEqualityExpr(ctxt);
 9071|    968|	CHECK_ERROR;
  ------------------
  |  |  230|    968|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 44, False: 924]
  |  |  ------------------
  ------------------
 9072|    924|	PUSH_BINARY_EXPR(XPATH_OP_AND, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|    924|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|    924|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|    924|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9073|    924|	SKIP_BLANKS;
  ------------------
  |  | 2199|    924|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    924|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9074|    924|    }
 9075|  53.2k|}
xpath.c:xmlXPathCompEqualityExpr:
 9033|  59.6k|xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
 9034|  59.6k|    xmlXPathCompRelationalExpr(ctxt);
 9035|  59.6k|    CHECK_ERROR;
  ------------------
  |  |  230|  59.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.87k, False: 54.7k]
  |  |  ------------------
  ------------------
 9036|  54.7k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  54.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  59.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9037|  97.9k|    while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  97.9k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2193|  56.3k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '=') || ((CUR == '!') && (NXT(1) == '='))) {
  ------------------
  |  | 2195|  2.22k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9037:12): [True: 41.5k, False: 56.3k]
  |  Branch (9037:29): [True: 2.22k, False: 54.1k]
  |  Branch (9037:45): [True: 2.20k, False: 21]
  ------------------
 9038|  43.7k|	int eq;
 9039|  43.7k|	int op1 = ctxt->comp->last;
 9040|       |
 9041|  43.7k|        if (CUR == '=') eq = 1;
  ------------------
  |  | 2193|  43.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9041:13): [True: 41.5k, False: 2.20k]
  ------------------
 9042|  2.20k|	else eq = 0;
 9043|  43.7k|	NEXT;
  ------------------
  |  | 2202|  43.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 43.7k, False: 0]
  |  |  ------------------
  ------------------
 9044|  43.7k|	if (!eq) NEXT;
  ------------------
  |  | 2202|  2.20k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.20k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9044:6): [True: 2.20k, False: 41.5k]
  ------------------
 9045|  43.7k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  51.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  51.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 51.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9046|  43.7k|        xmlXPathCompRelationalExpr(ctxt);
 9047|  43.7k|	CHECK_ERROR;
  ------------------
  |  |  230|  43.7k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 635, False: 43.1k]
  |  |  ------------------
  ------------------
 9048|  43.1k|	PUSH_BINARY_EXPR(XPATH_OP_EQUAL, op1, ctxt->comp->last, eq, 0);
  ------------------
  |  | 1094|  43.1k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  43.1k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  43.1k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9049|  43.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  43.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  43.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9050|  43.1k|    }
 9051|  54.7k|}
xpath.c:xmlXPathCompRelationalExpr:
 8996|   103k|xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
 8997|   103k|    xmlXPathCompAdditiveExpr(ctxt);
 8998|   103k|    CHECK_ERROR;
  ------------------
  |  |  230|   103k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.76k, False: 98.6k]
  |  |  ------------------
  ------------------
 8999|  98.6k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  98.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   103k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9000|   123k|    while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   123k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '<') || (CUR == '>')) {
  ------------------
  |  | 2193|   119k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9000:12): [True: 3.85k, False: 119k]
  |  Branch (9000:28): [True: 21.5k, False: 97.9k]
  ------------------
 9001|  25.4k|	int inf, strict;
 9002|  25.4k|	int op1 = ctxt->comp->last;
 9003|       |
 9004|  25.4k|        if (CUR == '<') inf = 1;
  ------------------
  |  | 2193|  25.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9004:13): [True: 3.85k, False: 21.5k]
  ------------------
 9005|  21.5k|	else inf = 0;
 9006|  25.4k|	if (NXT(1) == '=') strict = 0;
  ------------------
  |  | 2195|  25.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9006:6): [True: 6.76k, False: 18.6k]
  ------------------
 9007|  18.6k|	else strict = 1;
 9008|  25.4k|	NEXT;
  ------------------
  |  | 2202|  25.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.4k, False: 0]
  |  |  ------------------
  ------------------
 9009|  25.4k|	if (!strict) NEXT;
  ------------------
  |  | 2202|  6.76k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 6.76k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (9009:6): [True: 6.76k, False: 18.6k]
  ------------------
 9010|  25.4k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  25.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.57k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.57k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9011|  25.4k|        xmlXPathCompAdditiveExpr(ctxt);
 9012|  25.4k|	CHECK_ERROR;
  ------------------
  |  |  230|  25.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 744, False: 24.6k]
  |  |  ------------------
  ------------------
 9013|  24.6k|	PUSH_BINARY_EXPR(XPATH_OP_CMP, op1, ctxt->comp->last, inf, strict);
  ------------------
  |  | 1094|  24.6k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  24.6k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  24.6k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9014|  24.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  24.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  24.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9015|  24.6k|    }
 9016|  98.6k|}
xpath.c:xmlXPathCompAdditiveExpr:
 8958|   128k|xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
 8959|       |
 8960|   128k|    xmlXPathCompMultiplicativeExpr(ctxt);
 8961|   128k|    CHECK_ERROR;
  ------------------
  |  |  230|   128k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 4.88k, False: 123k]
  |  |  ------------------
  ------------------
 8962|   123k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   123k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   128k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8963|   156k|    while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   156k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR == '+') || (CUR == '-')) {
  ------------------
  |  | 2193|   151k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8963:12): [True: 5.42k, False: 151k]
  |  Branch (8963:28): [True: 28.1k, False: 123k]
  ------------------
 8964|  33.5k|	int plus;
 8965|  33.5k|	int op1 = ctxt->comp->last;
 8966|       |
 8967|  33.5k|        if (CUR == '+') plus = 1;
  ------------------
  |  | 2193|  33.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8967:13): [True: 5.42k, False: 28.1k]
  ------------------
 8968|  28.1k|	else plus = 0;
 8969|  33.5k|	NEXT;
  ------------------
  |  | 2202|  33.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 33.5k, False: 0]
  |  |  ------------------
  ------------------
 8970|  33.5k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  33.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  5.29k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 5.29k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8971|  33.5k|        xmlXPathCompMultiplicativeExpr(ctxt);
 8972|  33.5k|	CHECK_ERROR;
  ------------------
  |  |  230|  33.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 617, False: 32.9k]
  |  |  ------------------
  ------------------
 8973|  32.9k|	PUSH_BINARY_EXPR(XPATH_OP_PLUS, op1, ctxt->comp->last, plus, 0);
  ------------------
  |  | 1094|  32.9k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  32.9k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  32.9k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8974|  32.9k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  32.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  32.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8975|  32.9k|    }
 8976|   123k|}
xpath.c:xmlXPathCompMultiplicativeExpr:
 8919|   162k|xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
 8920|   162k|    xmlXPathCompUnaryExpr(ctxt);
 8921|   162k|    CHECK_ERROR;
  ------------------
  |  |  230|   162k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.08k, False: 157k]
  |  |  ------------------
  ------------------
 8922|   157k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   157k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   162k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8923|   452k|    while ((CUR == '*') ||
  ------------------
  |  | 2193|   452k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8923:12): [True: 294k, False: 157k]
  ------------------
 8924|   157k|           ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2193|   157k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    654|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
  ------------------
  |  | 2195|    628|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8924:13): [True: 654, False: 156k]
  |  Branch (8924:29): [True: 628, False: 26]
  |  Branch (8924:48): [True: 608, False: 20]
  ------------------
 8925|   295k|           ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2193|   157k|#define CUR (*ctxt->cur)
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    173|#define NXT(val) ctxt->cur[(val)]
  ------------------
                         ((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
  ------------------
  |  | 2195|    165|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8925:13): [True: 173, False: 156k]
  |  Branch (8925:29): [True: 165, False: 8]
  |  Branch (8925:48): [True: 160, False: 5]
  ------------------
 8926|   295k|	int op = -1;
 8927|   295k|	int op1 = ctxt->comp->last;
 8928|       |
 8929|   295k|        if (CUR == '*') {
  ------------------
  |  | 2193|   295k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8929:13): [True: 294k, False: 768]
  ------------------
 8930|   294k|	    op = 0;
 8931|   294k|	    NEXT;
  ------------------
  |  | 2202|   294k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 294k, False: 0]
  |  |  ------------------
  ------------------
 8932|   294k|	} else if (CUR == 'd') {
  ------------------
  |  | 2193|    768|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8932:13): [True: 608, False: 160]
  ------------------
 8933|    608|	    op = 1;
 8934|    608|	    SKIP(3);
  ------------------
  |  | 2194|    608|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8935|    608|	} else if (CUR == 'm') {
  ------------------
  |  | 2193|    160|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8935:13): [True: 160, False: 0]
  ------------------
 8936|    160|	    op = 2;
 8937|    160|	    SKIP(3);
  ------------------
  |  | 2194|    160|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8938|    160|	}
 8939|   295k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   295k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.48k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.48k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8940|   295k|        xmlXPathCompUnaryExpr(ctxt);
 8941|   295k|	CHECK_ERROR;
  ------------------
  |  |  230|   295k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 421, False: 294k]
  |  |  ------------------
  ------------------
 8942|   294k|	PUSH_BINARY_EXPR(XPATH_OP_MULT, op1, ctxt->comp->last, op, 0);
  ------------------
  |  | 1094|   294k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|   294k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|   294k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8943|   294k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   294k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   294k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8944|   294k|    }
 8945|   157k|}
xpath.c:xmlXPathCompUnaryExpr:
 8884|   457k|xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
 8885|   457k|    int minus = 0;
 8886|   457k|    int found = 0;
 8887|       |
 8888|   457k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   457k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  13.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 13.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8889|   511k|    while (CUR == '-') {
  ------------------
  |  | 2193|   511k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8889:12): [True: 53.6k, False: 457k]
  ------------------
 8890|  53.6k|        minus = 1 - minus;
 8891|  53.6k|	found = 1;
 8892|  53.6k|	NEXT;
  ------------------
  |  | 2202|  53.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 53.6k, False: 0]
  |  |  ------------------
  ------------------
 8893|  53.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  53.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.81k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.81k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8894|  53.6k|    }
 8895|       |
 8896|   457k|    xmlXPathCompUnionExpr(ctxt);
 8897|   457k|    CHECK_ERROR;
  ------------------
  |  |  230|   457k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.49k, False: 452k]
  |  |  ------------------
  ------------------
 8898|   452k|    if (found) {
  ------------------
  |  Branch (8898:9): [True: 31.4k, False: 420k]
  ------------------
 8899|  31.4k|	if (minus)
  ------------------
  |  Branch (8899:6): [True: 23.9k, False: 7.41k]
  ------------------
 8900|  23.9k|	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 2, 0);
  ------------------
  |  | 1091|  23.9k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  23.9k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8901|  7.41k|	else
 8902|       |	    PUSH_UNARY_EXPR(XPATH_OP_PLUS, ctxt->comp->last, 3, 0);
  ------------------
  |  | 1091|  7.41k|#define PUSH_UNARY_EXPR(op, ch, val, val2)				\
  |  | 1092|  7.41k|xmlXPathCompExprAdd(ctxt, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8903|  31.4k|    }
 8904|   452k|}
xpath.c:xmlXPathCompUnionExpr:
 8856|   457k|xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
 8857|   457k|    xmlXPathCompPathExpr(ctxt);
 8858|   457k|    CHECK_ERROR;
  ------------------
  |  |  230|   457k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 5.31k, False: 452k]
  |  |  ------------------
  ------------------
 8859|   452k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   452k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   457k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8860|   462k|    while (CUR == '|') {
  ------------------
  |  | 2193|   462k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8860:12): [True: 10.0k, False: 452k]
  ------------------
 8861|  10.0k|	int op1 = ctxt->comp->last;
 8862|  10.0k|	PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|  10.0k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  10.0k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8863|       |
 8864|  10.0k|	NEXT;
  ------------------
  |  | 2202|  10.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
 8865|  10.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.0k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  4.15k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 4.15k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8866|  10.0k|	xmlXPathCompPathExpr(ctxt);
 8867|       |
 8868|  10.0k|	PUSH_BINARY_EXPR(XPATH_OP_UNION, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  10.0k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  10.0k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  10.0k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8869|       |
 8870|  10.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8871|  10.0k|    }
 8872|   452k|}
xpath.c:xmlXPathCompPathExpr:
 8734|   467k|xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
 8735|   467k|    int lc = 1;           /* Should we branch to LocationPath ?         */
 8736|   467k|    xmlChar *name = NULL; /* we may have to preparse a name to find out */
 8737|       |
 8738|   467k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   467k|    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|   467k|    if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   467k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '$') || (CUR == '(') ||
  ------------------
  |  | 2193|   466k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8739:9): [True: 1.30k, False: 466k]
  |  Branch (8739:25): [True: 3.54k, False: 462k]
  ------------------
 8740|   462k|	(IS_ASCII_DIGIT(CUR)) ||
  ------------------
  |  |  230|   462k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 124k, False: 338k]
  |  |  |  Branch (230:45): [True: 59.6k, False: 64.8k]
  |  |  ------------------
  ------------------
 8741|   403k|        (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   403k|#define CUR (*ctxt->cur)
  ------------------
                      (CUR == '\'') || (CUR == '"') ||
  ------------------
  |  | 2193|   401k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8741:9): [True: 1.52k, False: 401k]
  |  Branch (8741:26): [True: 92, False: 401k]
  ------------------
 8742|   401k|	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|   401k|#define CUR (*ctxt->cur)
  ------------------
              	(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  9.68k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 5.95k, False: 3.73k]
  |  |  |  Branch (230:45): [True: 2.26k, False: 3.68k]
  |  |  ------------------
  ------------------
  |  Branch (8742:3): [True: 9.68k, False: 392k]
  ------------------
 8743|  68.3k|	lc = 0;
 8744|   399k|    } else if (CUR == '*') {
  ------------------
  |  | 2193|   399k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8744:16): [True: 287k, False: 112k]
  ------------------
 8745|       |	/* relative or absolute location path */
 8746|   287k|	lc = 1;
 8747|   287k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   112k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8747:16): [True: 39.6k, False: 72.6k]
  ------------------
 8748|       |	/* relative or absolute location path */
 8749|  39.6k|	lc = 1;
 8750|  72.6k|    } else if (CUR == '@') {
  ------------------
  |  | 2193|  72.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8750:16): [True: 555, False: 72.1k]
  ------------------
 8751|       |	/* relative abbreviated attribute location path */
 8752|    555|	lc = 1;
 8753|  72.1k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|  72.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8753:16): [True: 7.41k, False: 64.6k]
  ------------------
 8754|       |	/* relative abbreviated attribute location path */
 8755|  7.41k|	lc = 1;
 8756|  64.6k|    } else {
 8757|       |	/*
 8758|       |	 * Problem is finding if we have a name here whether it's:
 8759|       |	 *   - a nodetype
 8760|       |	 *   - a function call in which case it's followed by '('
 8761|       |	 *   - an axis in which case it's followed by ':'
 8762|       |	 *   - a element name
 8763|       |	 * We do an a priori analysis here rather than having to
 8764|       |	 * maintain parsed token content through the recursive function
 8765|       |	 * calls. This looks uglier but makes the code easier to
 8766|       |	 * read/write/debug.
 8767|       |	 */
 8768|  64.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  64.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|      0|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8769|  64.6k|	name = xmlXPathScanName(ctxt);
 8770|  64.6k|	if ((name != NULL) && (xmlStrstr(name, (xmlChar *) "::") != NULL)) {
  ------------------
  |  Branch (8770:6): [True: 61.5k, False: 3.11k]
  |  Branch (8770:24): [True: 1.64k, False: 59.9k]
  ------------------
 8771|  1.64k|	    lc = 1;
 8772|  1.64k|	    xmlFree(name);
 8773|  63.0k|	} else if (name != NULL) {
  ------------------
  |  Branch (8773:13): [True: 59.9k, False: 3.11k]
  ------------------
 8774|  59.9k|	    int len =xmlStrlen(name);
 8775|       |
 8776|       |
 8777|   425k|	    while (NXT(len) != 0) {
  ------------------
  |  | 2195|   425k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8777:13): [True: 424k, False: 996]
  ------------------
 8778|   424k|		if (NXT(len) == '/') {
  ------------------
  |  | 2195|   424k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8778:7): [True: 3.40k, False: 421k]
  ------------------
 8779|       |		    /* element name */
 8780|  3.40k|		    lc = 1;
 8781|  3.40k|		    break;
 8782|   421k|		} else if (IS_BLANK_CH(NXT(len))) {
  ------------------
  |  |  137|   421k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|   421k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 364k, False: 57.3k]
  |  |  |  |  ------------------
  |  |  |  |   91|   421k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 57.3k, False: 3]
  |  |  |  |  |  Branch (91:23): [True: 1.65k, False: 55.6k]
  |  |  |  |  ------------------
  |  |  |  |   92|   421k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 149, False: 55.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8783|       |		    /* ignore blanks */
 8784|   365k|		    ;
 8785|   365k|		} else if (NXT(len) == ':') {
  ------------------
  |  | 2195|  55.5k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8785:14): [True: 553, False: 54.9k]
  ------------------
 8786|    553|		    lc = 1;
 8787|    553|		    break;
 8788|  54.9k|		} else if ((NXT(len) == '(')) {
  ------------------
  |  | 2195|  54.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8788:14): [True: 9.90k, False: 45.0k]
  ------------------
 8789|       |		    /* Node Type or Function */
 8790|  9.90k|		    if (xmlXPathIsNodeType(name)) {
  ------------------
  |  Branch (8790:11): [True: 268, False: 9.64k]
  ------------------
 8791|    268|			lc = 1;
 8792|  9.64k|		    } else {
 8793|  9.64k|			lc = 0;
 8794|  9.64k|		    }
 8795|  9.90k|                    break;
 8796|  45.0k|		} else if ((NXT(len) == '[')) {
  ------------------
  |  | 2195|  45.0k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8796:14): [True: 959, False: 44.1k]
  ------------------
 8797|       |		    /* element name */
 8798|    959|		    lc = 1;
 8799|    959|		    break;
 8800|  44.1k|		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  44.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
              		} else if ((NXT(len) == '<') || (NXT(len) == '>') ||
  ------------------
  |  | 2195|  43.4k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8800:14): [True: 682, False: 43.4k]
  |  Branch (8800:35): [True: 6.71k, False: 36.7k]
  ------------------
 8801|  36.7k|			   (NXT(len) == '=')) {
  ------------------
  |  | 2195|  36.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8801:7): [True: 7.32k, False: 29.3k]
  ------------------
 8802|  14.7k|		    lc = 1;
 8803|  14.7k|		    break;
 8804|  29.3k|		} else {
 8805|  29.3k|		    lc = 1;
 8806|  29.3k|		    break;
 8807|  29.3k|		}
 8808|   365k|		len++;
 8809|   365k|	    }
 8810|  59.9k|	    if (NXT(len) == 0) {
  ------------------
  |  | 2195|  59.9k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8810:10): [True: 996, False: 58.9k]
  ------------------
 8811|       |		/* element name */
 8812|    996|		lc = 1;
 8813|    996|	    }
 8814|  59.9k|	    xmlFree(name);
 8815|  59.9k|	} else {
 8816|       |	    /* make sure all cases are covered explicitly */
 8817|  3.11k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  3.11k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8818|      0|	}
 8819|  64.6k|    }
 8820|       |
 8821|   464k|    if (lc) {
  ------------------
  |  Branch (8821:9): [True: 386k, False: 78.0k]
  ------------------
 8822|   386k|	if (CUR == '/') {
  ------------------
  |  | 2193|   386k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8822:6): [True: 39.6k, False: 347k]
  ------------------
 8823|  39.6k|	    PUSH_LEAVE_EXPR(XPATH_OP_ROOT, 0, 0);
  ------------------
  |  | 1088|  39.6k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|  39.6k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8824|   347k|	} else {
 8825|   347k|	    PUSH_LEAVE_EXPR(XPATH_OP_NODE, 0, 0);
  ------------------
  |  | 1088|   347k|#define PUSH_LEAVE_EXPR(op, val, val2)					\
  |  | 1089|   347k|xmlXPathCompExprAdd(ctxt, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
  ------------------
 8826|   347k|	}
 8827|   386k|	xmlXPathCompLocationPath(ctxt);
 8828|   386k|    } else {
 8829|  78.0k|	xmlXPathCompFilterExpr(ctxt);
 8830|  78.0k|	CHECK_ERROR;
  ------------------
  |  |  230|  78.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.11k, False: 75.9k]
  |  |  ------------------
  ------------------
 8831|  75.9k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  75.9k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  2.01k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (8831:6): [True: 2.01k, False: 73.8k]
  |  Branch (8831:22): [True: 675, False: 1.34k]
  ------------------
 8832|    675|	    SKIP(2);
  ------------------
  |  | 2194|    675|#define SKIP(val) ctxt->cur += (val)
  ------------------
 8833|    675|	    SKIP_BLANKS;
  ------------------
  |  | 2199|    965|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|    965|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 965, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8834|       |
 8835|    675|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|    675|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|    675|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 8836|    675|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 8837|       |
 8838|    675|	    xmlXPathCompRelativeLocationPath(ctxt);
 8839|  75.2k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  75.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8839:13): [True: 1.34k, False: 73.8k]
  ------------------
 8840|  1.34k|	    xmlXPathCompRelativeLocationPath(ctxt);
 8841|  1.34k|	}
 8842|  75.9k|    }
 8843|   462k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   462k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   468k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.75k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8844|   462k|}
xpath.c:xmlXPathScanName:
 8705|  64.6k|xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
 8706|  64.6k|    const xmlChar *end;
 8707|  64.6k|    xmlChar *ret;
 8708|       |
 8709|  64.6k|    end = xmlScanName(ctxt->cur, XML_MAX_NAME_LENGTH, 0);
  ------------------
  |  |   65|  64.6k|#define XML_MAX_NAME_LENGTH 50000
  ------------------
 8710|  64.6k|    if (end == NULL) {
  ------------------
  |  Branch (8710:9): [True: 3, False: 64.6k]
  ------------------
 8711|      3|        XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|      3|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8712|      0|    }
 8713|  64.6k|    if (end == ctxt->cur)
  ------------------
  |  Branch (8713:9): [True: 3.04k, False: 61.6k]
  ------------------
 8714|  3.04k|        return(NULL);
 8715|       |
 8716|  61.6k|    ret = xmlStrndup(ctxt->cur, end - ctxt->cur);
 8717|  61.6k|    if (ret == NULL)
  ------------------
  |  Branch (8717:9): [True: 64, False: 61.5k]
  ------------------
 8718|     64|        xmlXPathPErrMemory(ctxt);
 8719|  61.6k|    return(ret);
 8720|  64.6k|}
xpath.c:xmlXPathCompLocationPath:
 9524|   386k|xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
 9525|   386k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   386k|    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|   386k|    if (CUR != '/') {
  ------------------
  |  | 2193|   386k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9526:9): [True: 347k, False: 39.6k]
  ------------------
 9527|   347k|        xmlXPathCompRelativeLocationPath(ctxt);
 9528|   347k|    } else {
 9529|  81.4k|	while (CUR == '/') {
  ------------------
  |  | 2193|  81.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9529:9): [True: 42.2k, False: 39.2k]
  ------------------
 9530|  42.2k|	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  42.2k|#define CUR (*ctxt->cur)
  ------------------
              	    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  42.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9530:10): [True: 42.2k, False: 0]
  |  Branch (9530:26): [True: 11.5k, False: 30.7k]
  ------------------
 9531|  11.5k|		SKIP(2);
  ------------------
  |  | 2194|  11.5k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9532|  11.5k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  11.5k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.70k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 9.70k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9533|  11.5k|		PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  11.5k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  11.5k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9534|  11.5k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9535|  11.5k|		xmlXPathCompRelativeLocationPath(ctxt);
 9536|  30.7k|	    } else if (CUR == '/') {
  ------------------
  |  | 2193|  30.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9536:17): [True: 30.7k, False: 0]
  ------------------
 9537|  30.7k|		NEXT;
  ------------------
  |  | 2202|  30.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 30.7k, False: 0]
  |  |  ------------------
  ------------------
 9538|  30.7k|		SKIP_BLANKS;
  ------------------
  |  | 2199|  34.9k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  34.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 34.9k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9539|  30.7k|		if ((CUR != 0) &&
  ------------------
  |  | 2193|  30.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9539:7): [True: 30.0k, False: 726]
  ------------------
 9540|  30.0k|		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  |  222|  30.0k|#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
  |  |  ------------------
  |  |  |  Branch (222:29): [True: 8.71k, False: 21.2k]
  |  |  ------------------
  |  |  223|  30.0k|                                 (((c) | 0x20) <= 0x7a))
  |  |  ------------------
  |  |  |  Branch (223:34): [True: 6.92k, False: 1.78k]
  |  |  ------------------
  ------------------
              		    ((IS_ASCII_LETTER(CUR)) || (CUR >= 0x80) ||
  ------------------
  |  | 2193|  23.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9540:34): [True: 464, False: 22.6k]
  ------------------
 9541|  22.6k|                     (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  22.6k|#define CUR (*ctxt->cur)
  ------------------
                                   (CUR == '_') || (CUR == '.') ||
  ------------------
  |  | 2193|  22.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9541:22): [True: 547, False: 22.0k]
  |  Branch (9541:38): [True: 6.44k, False: 15.6k]
  ------------------
 9542|  15.6k|		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  15.6k|#define CUR (*ctxt->cur)
  ------------------
              		     (CUR == '@') || (CUR == '*')))
  ------------------
  |  | 2193|  15.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9542:8): [True: 295, False: 15.3k]
  |  Branch (9542:24): [True: 9.70k, False: 5.63k]
  ------------------
 9543|  24.3k|		    xmlXPathCompRelativeLocationPath(ctxt);
 9544|  30.7k|	    }
 9545|  42.2k|	    CHECK_ERROR;
  ------------------
  |  |  230|  42.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 399, False: 41.8k]
  |  |  ------------------
  ------------------
 9546|  42.2k|	}
 9547|  39.6k|    }
 9548|   386k|}
xpath.c:xmlXPathCompFilterExpr:
 8683|  78.0k|xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
 8684|  78.0k|    xmlXPathCompPrimaryExpr(ctxt);
 8685|  78.0k|    CHECK_ERROR;
  ------------------
  |  |  230|  78.0k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.56k, False: 76.4k]
  |  |  ------------------
  ------------------
 8686|  76.4k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  76.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  78.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8687|       |
 8688|  92.5k|    while (CUR == '[') {
  ------------------
  |  | 2193|  92.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8688:12): [True: 16.0k, False: 76.4k]
  ------------------
 8689|  16.0k|	xmlXPathCompPredicate(ctxt, 1);
 8690|  16.0k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  16.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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8691|  16.0k|    }
 8692|       |
 8693|       |
 8694|  76.4k|}
xpath.c:xmlXPathCompPrimaryExpr:
 8645|  78.0k|xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
 8646|  78.0k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  78.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|  78.0k|    if (CUR == '$') xmlXPathCompVariableReference(ctxt);
  ------------------
  |  | 2193|  78.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8647:9): [True: 1.30k, False: 76.7k]
  ------------------
 8648|  76.7k|    else if (CUR == '(') {
  ------------------
  |  | 2193|  76.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8648:14): [True: 3.54k, False: 73.1k]
  ------------------
 8649|  3.54k|	NEXT;
  ------------------
  |  | 2202|  3.54k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.54k, False: 0]
  |  |  ------------------
  ------------------
 8650|  3.54k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  6.93k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  6.93k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 6.93k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8651|  3.54k|	xmlXPathCompileExpr(ctxt, 1);
 8652|  3.54k|	CHECK_ERROR;
  ------------------
  |  |  230|  3.54k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 388, False: 3.15k]
  |  |  ------------------
  ------------------
 8653|  3.15k|	if (CUR != ')') {
  ------------------
  |  | 2193|  3.15k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8653:6): [True: 48, False: 3.10k]
  ------------------
 8654|     48|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     48|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8655|      0|	}
 8656|  3.10k|	NEXT;
  ------------------
  |  | 2202|  3.10k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.10k, False: 0]
  |  |  ------------------
  ------------------
 8657|  3.10k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  11.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  14.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 11.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8658|  73.1k|    } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|   146k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 69.2k, False: 3.87k]
  |  |  |  Branch (230:45): [True: 59.6k, False: 9.64k]
  |  |  ------------------
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  | 2193|  13.5k|#define CUR (*ctxt->cur)
  ------------------
                  } else if (IS_ASCII_DIGIT(CUR) || (CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
  ------------------
  |  |  230|  2.26k|#define IS_ASCII_DIGIT(c)	((0x30 <= (c)) && ((c) <= 0x39))
  |  |  ------------------
  |  |  |  Branch (230:28): [True: 2.26k, False: 0]
  |  |  |  Branch (230:45): [True: 2.26k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (8658:40): [True: 2.26k, False: 11.2k]
  ------------------
 8659|  61.9k|	xmlXPathCompNumber(ctxt);
 8660|  61.9k|    } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  11.2k|#define CUR (*ctxt->cur)
  ------------------
                  } else if ((CUR == '\'') || (CUR == '"')) {
  ------------------
  |  | 2193|  9.73k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8660:16): [True: 1.52k, False: 9.73k]
  |  Branch (8660:33): [True: 92, False: 9.64k]
  ------------------
 8661|  1.61k|	xmlXPathCompLiteral(ctxt);
 8662|  9.64k|    } else {
 8663|  9.64k|	xmlXPathCompFunctionCall(ctxt);
 8664|  9.64k|    }
 8665|  77.5k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   124k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   202k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 124k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8666|  77.5k|}
xpath.c:xmlXPathCompVariableReference:
 8511|  1.30k|xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
 8512|  1.30k|    xmlChar *name;
 8513|  1.30k|    xmlChar *prefix;
 8514|       |
 8515|  1.30k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  1.30k|    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.30k|    if (CUR != '$') {
  ------------------
  |  | 2193|  1.30k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8516:9): [True: 0, False: 1.30k]
  ------------------
 8517|      0|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8518|      0|    }
 8519|  1.30k|    NEXT;
  ------------------
  |  | 2202|  1.30k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.30k, False: 0]
  |  |  ------------------
  ------------------
 8520|  1.30k|    name = xmlXPathParseQName(ctxt, &prefix);
 8521|  1.30k|    if (name == NULL) {
  ------------------
  |  Branch (8521:9): [True: 47, False: 1.25k]
  ------------------
 8522|     47|        xmlFree(prefix);
 8523|     47|	XP_ERROR(XPATH_VARIABLE_REF_ERROR);
  ------------------
  |  |  244|     47|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8524|      0|    }
 8525|  1.25k|    ctxt->comp->last = -1;
 8526|  1.25k|    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  1.25k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.25k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8526:9): [True: 3, False: 1.25k]
  ------------------
 8527|      3|        xmlFree(prefix);
 8528|      3|        xmlFree(name);
 8529|      3|    }
 8530|  1.25k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.24k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  9.50k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.24k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8531|  1.25k|    if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
  ------------------
  |  |  241|  1.25k|#define XML_XPATH_NOVAR	  (1<<1)
  ------------------
  |  Branch (8531:9): [True: 1.25k, False: 0]
  |  Branch (8531:36): [True: 0, False: 1.25k]
  ------------------
 8532|      0|	XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8533|      0|    }
 8534|  1.25k|}
xpath.c:xmlXPathParseQName:
 8178|  10.9k|xmlXPathParseQName(xmlXPathParserContextPtr ctxt, xmlChar **prefix) {
 8179|  10.9k|    xmlChar *ret = NULL;
 8180|       |
 8181|  10.9k|    *prefix = NULL;
 8182|  10.9k|    ret = xmlXPathParseNCName(ctxt);
 8183|  10.9k|    if (ret && CUR == ':') {
  ------------------
  |  | 2193|  10.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8183:9): [True: 10.8k, False: 60]
  |  Branch (8183:16): [True: 1.08k, False: 9.80k]
  ------------------
 8184|  1.08k|        *prefix = ret;
 8185|  1.08k|	NEXT;
  ------------------
  |  | 2202|  1.08k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.08k, False: 0]
  |  |  ------------------
  ------------------
 8186|  1.08k|	ret = xmlXPathParseNCName(ctxt);
 8187|  1.08k|    }
 8188|  10.9k|    return(ret);
 8189|  10.9k|}
xpath.c:xmlXPathCompNumber:
 8337|  61.9k|{
 8338|  61.9k|    double ret = 0.0;
 8339|  61.9k|    int ok = 0;
 8340|  61.9k|    int exponent = 0;
 8341|  61.9k|    int is_exponent_negative = 0;
 8342|  61.9k|    xmlXPathObjectPtr num;
 8343|  61.9k|#ifdef __GNUC__
 8344|  61.9k|    unsigned long tmp = 0;
 8345|  61.9k|    double temp;
 8346|  61.9k|#endif
 8347|       |
 8348|  61.9k|    CHECK_ERROR;
  ------------------
  |  |  230|  61.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 40, False: 61.8k]
  |  |  ------------------
  ------------------
 8349|  61.8k|    if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  61.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  59.6k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR != '.') && ((CUR < '0') || (CUR > '9'))) {
  ------------------
  |  | 2193|  59.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8349:9): [True: 59.6k, False: 2.26k]
  |  Branch (8349:26): [True: 0, False: 59.6k]
  |  Branch (8349:41): [True: 0, False: 59.6k]
  ------------------
 8350|      0|        XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8351|      0|    }
 8352|  61.8k|#ifdef __GNUC__
 8353|       |    /*
 8354|       |     * tmp/temp is a workaround against a gcc compiler bug
 8355|       |     * http://veillard.com/gcc.bug
 8356|       |     */
 8357|  61.8k|    ret = 0;
 8358|   242k|    while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   242k|#define CUR (*ctxt->cur)
  ------------------
                  while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|   206k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8358:12): [True: 206k, False: 36.3k]
  |  Branch (8358:28): [True: 181k, False: 25.5k]
  ------------------
 8359|   181k|	ret = ret * 10;
 8360|   181k|	tmp = (CUR - '0');
  ------------------
  |  | 2193|   181k|#define CUR (*ctxt->cur)
  ------------------
 8361|   181k|        ok = 1;
 8362|   181k|        NEXT;
  ------------------
  |  | 2202|   181k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 181k, False: 0]
  |  |  ------------------
  ------------------
 8363|   181k|	temp = (double) tmp;
 8364|   181k|	ret = ret + temp;
 8365|   181k|    }
 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|  61.8k|    if (CUR == '.') {
  ------------------
  |  | 2193|  61.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8374:9): [True: 8.65k, False: 53.2k]
  ------------------
 8375|  8.65k|	int v, frac = 0, max;
 8376|  8.65k|	double fraction = 0;
 8377|       |
 8378|  8.65k|        NEXT;
  ------------------
  |  | 2202|  8.65k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.65k, False: 0]
  |  |  ------------------
  ------------------
 8379|  8.65k|        if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  8.65k|#define CUR (*ctxt->cur)
  ------------------
                      if (((CUR < '0') || (CUR > '9')) && (!ok)) {
  ------------------
  |  | 2193|  7.90k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8379:14): [True: 748, False: 7.90k]
  |  Branch (8379:29): [True: 1.45k, False: 6.44k]
  |  Branch (8379:45): [True: 0, False: 2.20k]
  ------------------
 8380|      0|            XP_ERROR(XPATH_NUMBER_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8381|      0|        }
 8382|  12.6k|        while (CUR == '0') {
  ------------------
  |  | 2193|  12.6k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8382:16): [True: 4.01k, False: 8.65k]
  ------------------
 8383|  4.01k|            frac = frac + 1;
 8384|  4.01k|            NEXT;
  ------------------
  |  | 2202|  4.01k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.01k, False: 0]
  |  |  ------------------
  ------------------
 8385|  4.01k|        }
 8386|  8.65k|        max = frac + MAX_FRAC;
  ------------------
  |  | 8219|  8.65k|#define MAX_FRAC 20
  ------------------
 8387|  27.2k|        while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  27.2k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9') && (frac < max)) {
  ------------------
  |  | 2193|  25.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8387:16): [True: 25.1k, False: 2.07k]
  |  Branch (8387:32): [True: 18.6k, False: 6.52k]
  |  Branch (8387:48): [True: 18.6k, False: 62]
  ------------------
 8388|  18.6k|	    v = (CUR - '0');
  ------------------
  |  | 2193|  18.6k|#define CUR (*ctxt->cur)
  ------------------
 8389|  18.6k|	    fraction = fraction * 10 + v;
 8390|  18.6k|	    frac = frac + 1;
 8391|  18.6k|            NEXT;
  ------------------
  |  | 2202|  18.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.6k, False: 0]
  |  |  ------------------
  ------------------
 8392|  18.6k|        }
 8393|  8.65k|        fraction /= pow(10.0, frac);
 8394|  8.65k|        ret = ret + fraction;
 8395|  9.12k|        while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  9.12k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9'))
  ------------------
  |  | 2193|  7.00k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8395:16): [True: 7.00k, False: 2.12k]
  |  Branch (8395:32): [True: 473, False: 6.53k]
  ------------------
 8396|    473|            NEXT;
  ------------------
  |  | 2202|  9.12k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 473, False: 0]
  |  |  ------------------
  ------------------
 8397|  8.65k|    }
 8398|  61.8k|    if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  61.8k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == 'e') || (CUR == 'E')) {
  ------------------
  |  | 2193|  61.0k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8398:9): [True: 854, False: 61.0k]
  |  Branch (8398:25): [True: 8.56k, False: 52.4k]
  ------------------
 8399|  9.42k|        NEXT;
  ------------------
  |  | 2202|  9.42k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.42k, False: 0]
  |  |  ------------------
  ------------------
 8400|  9.42k|        if (CUR == '-') {
  ------------------
  |  | 2193|  9.42k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8400:13): [True: 678, False: 8.74k]
  ------------------
 8401|    678|            is_exponent_negative = 1;
 8402|    678|            NEXT;
  ------------------
  |  | 2202|    678|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 678, False: 0]
  |  |  ------------------
  ------------------
 8403|  8.74k|        } else if (CUR == '+') {
  ------------------
  |  | 2193|  8.74k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8403:20): [True: 813, False: 7.93k]
  ------------------
 8404|    813|	    NEXT;
  ------------------
  |  | 2202|    813|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 813, False: 0]
  |  |  ------------------
  ------------------
 8405|    813|	}
 8406|  66.3k|        while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  66.3k|#define CUR (*ctxt->cur)
  ------------------
                      while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  | 2193|  62.5k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8406:16): [True: 62.5k, False: 3.84k]
  |  Branch (8406:32): [True: 56.9k, False: 5.57k]
  ------------------
 8407|  56.9k|            if (exponent < 1000000)
  ------------------
  |  Branch (8407:17): [True: 45.4k, False: 11.4k]
  ------------------
 8408|  45.4k|                exponent = exponent * 10 + (CUR - '0');
  ------------------
  |  | 2193|  45.4k|#define CUR (*ctxt->cur)
  ------------------
 8409|  56.9k|            NEXT;
  ------------------
  |  | 2202|  56.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 56.9k, False: 0]
  |  |  ------------------
  ------------------
 8410|  56.9k|        }
 8411|  9.42k|        if (is_exponent_negative)
  ------------------
  |  Branch (8411:13): [True: 678, False: 8.74k]
  ------------------
 8412|    678|            exponent = -exponent;
 8413|  9.42k|        ret *= pow(10.0, (double) exponent);
 8414|  9.42k|    }
 8415|  61.8k|    num = xmlXPathCacheNewFloat(ctxt, ret);
 8416|  61.8k|    if (num == NULL) {
  ------------------
  |  Branch (8416:9): [True: 39, False: 61.8k]
  ------------------
 8417|     39|	ctxt->error = XPATH_MEMORY_ERROR;
 8418|  61.8k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
  ------------------
  |  | 1085|  61.8k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  61.8k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8418:16): [True: 13, False: 61.8k]
  ------------------
 8419|  61.8k|                              NULL) == -1) {
 8420|     13|        xmlXPathReleaseObject(ctxt->context, num);
 8421|     13|    }
 8422|  61.8k|}
xpath.c:xmlXPathCompLiteral:
 8478|  1.61k|xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
 8479|  1.61k|    xmlChar *ret = NULL;
 8480|  1.61k|    xmlXPathObjectPtr lit;
 8481|       |
 8482|  1.61k|    ret = xmlXPathParseLiteral(ctxt);
 8483|  1.61k|    if (ret == NULL)
  ------------------
  |  Branch (8483:9): [True: 129, False: 1.48k]
  ------------------
 8484|    129|        return;
 8485|  1.48k|    lit = xmlXPathCacheNewString(ctxt, ret);
 8486|  1.48k|    if (lit == NULL) {
  ------------------
  |  Branch (8486:9): [True: 9, False: 1.47k]
  ------------------
 8487|      9|        ctxt->error = XPATH_MEMORY_ERROR;
 8488|  1.47k|    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
  ------------------
  |  | 1085|  1.47k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  1.47k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8488:16): [True: 5, False: 1.47k]
  ------------------
 8489|  1.47k|                              NULL) == -1) {
 8490|      5|        xmlXPathReleaseObject(ctxt->context, lit);
 8491|      5|    }
 8492|  1.48k|    xmlFree(ret);
 8493|  1.48k|}
xpath.c:xmlXPathParseLiteral:
 8434|  1.72k|xmlXPathParseLiteral(xmlXPathParserContextPtr ctxt) {
 8435|  1.72k|    const xmlChar *q;
 8436|  1.72k|    xmlChar *ret = NULL;
 8437|  1.72k|    int quote;
 8438|       |
 8439|  1.72k|    if (CUR == '"') {
  ------------------
  |  | 2193|  1.72k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8439:9): [True: 92, False: 1.63k]
  ------------------
 8440|     92|        quote = '"';
 8441|  1.63k|    } else if (CUR == '\'') {
  ------------------
  |  | 2193|  1.63k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8441:16): [True: 1.62k, False: 7]
  ------------------
 8442|  1.62k|        quote = '\'';
 8443|  1.62k|    } else {
 8444|      7|	XP_ERRORNULL(XPATH_START_LITERAL_ERROR);
  ------------------
  |  |  633|      7|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8445|      0|    }
 8446|       |
 8447|  1.71k|    NEXT;
  ------------------
  |  | 2202|  1.71k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.71k, False: 0]
  |  |  ------------------
  ------------------
 8448|  1.71k|    q = CUR_PTR;
  ------------------
  |  | 2196|  1.71k|#define CUR_PTR ctxt->cur
  ------------------
 8449|  19.9k|    while (CUR != quote) {
  ------------------
  |  | 2193|  19.9k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8449:12): [True: 18.3k, False: 1.58k]
  ------------------
 8450|  18.3k|        int ch;
 8451|  18.3k|        int len = 4;
 8452|       |
 8453|  18.3k|        if (CUR == 0)
  ------------------
  |  | 2193|  18.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8453:13): [True: 122, False: 18.2k]
  ------------------
 8454|  18.2k|            XP_ERRORNULL(XPATH_UNFINISHED_LITERAL_ERROR);
  ------------------
  |  |  633|    122|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8455|  18.2k|        ch = xmlGetUTF8Char(CUR_PTR, &len);
  ------------------
  |  | 2196|  18.2k|#define CUR_PTR ctxt->cur
  ------------------
 8456|  18.2k|        if ((ch < 0) || (IS_CHAR(ch) == 0))
  ------------------
  |  |  115|  18.2k|#define IS_CHAR(c)   xmlIsCharQ(c)
  |  |  ------------------
  |  |  |  |  117|  18.2k|#define xmlIsCharQ(c)		(((c) < 0x100) ? \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (117:25): [True: 17.7k, False: 483]
  |  |  |  |  ------------------
  |  |  |  |  118|  18.2k|				 xmlIsChar_ch((c)) :\
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|  17.7k|#define xmlIsChar_ch(c)		(((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (108:28): [True: 17.7k, False: 6]
  |  |  |  |  |  |  |  Branch (108:44): [True: 236, False: 17.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  109|  17.7k|				 ((c) == 0xd) || \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (109:6): [True: 122, False: 17.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  110|  17.7k|				  (0x20 <= (c)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (110:7): [True: 17.3k, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  119|  18.2k|				(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (119:7): [True: 483, False: 0]
  |  |  |  |  |  Branch (119:25): [True: 166, False: 317]
  |  |  |  |  ------------------
  |  |  |  |  120|    483|				 ((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (120:7): [True: 317, False: 0]
  |  |  |  |  |  Branch (120:26): [True: 88, False: 229]
  |  |  |  |  ------------------
  |  |  |  |  121|    483|				 ((0x10000 <= (c)) && ((c) <= 0x10ffff))))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (121:7): [True: 229, False: 0]
  |  |  |  |  |  Branch (121:27): [True: 229, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (8456:13): [True: 3, False: 18.2k]
  |  Branch (8456:25): [True: 6, False: 18.2k]
  ------------------
 8457|  18.2k|            XP_ERRORNULL(XPATH_INVALID_CHAR_ERROR);
  ------------------
  |  |  633|      9|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 8458|  18.2k|        CUR_PTR += len;
  ------------------
  |  | 2196|  18.2k|#define CUR_PTR ctxt->cur
  ------------------
 8459|  18.2k|    }
 8460|  1.58k|    ret = xmlStrndup(q, CUR_PTR - q);
  ------------------
  |  | 2196|  1.58k|#define CUR_PTR ctxt->cur
  ------------------
 8461|  1.58k|    if (ret == NULL)
  ------------------
  |  Branch (8461:9): [True: 2, False: 1.58k]
  ------------------
 8462|      2|        xmlXPathPErrMemory(ctxt);
 8463|  1.58k|    NEXT;
  ------------------
  |  | 2202|  1.58k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 1.58k, False: 0]
  |  |  ------------------
  ------------------
 8464|  1.58k|    return(ret);
 8465|  1.71k|}
xpath.c:xmlXPathCompFunctionCall:
 8573|  9.64k|xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
 8574|  9.64k|    xmlChar *name;
 8575|  9.64k|    xmlChar *prefix;
 8576|  9.64k|    int nbargs = 0;
 8577|  9.64k|    int sort = 1;
 8578|       |
 8579|  9.64k|    name = xmlXPathParseQName(ctxt, &prefix);
 8580|  9.64k|    if (name == NULL) {
  ------------------
  |  Branch (8580:9): [True: 15, False: 9.62k]
  ------------------
 8581|     15|	xmlFree(prefix);
 8582|     15|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|     15|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8583|      0|    }
 8584|  9.62k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   209k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   219k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 209k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8585|       |
 8586|  9.62k|    if (CUR != '(') {
  ------------------
  |  | 2193|  9.62k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8586:9): [True: 3, False: 9.62k]
  ------------------
 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.62k|    NEXT;
  ------------------
  |  | 2202|  9.62k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 9.62k, False: 0]
  |  |  ------------------
  ------------------
 8592|  9.62k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  82.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  91.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 82.3k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8593|       |
 8594|       |    /*
 8595|       |    * Optimization for count(): we don't need the node-set to be sorted.
 8596|       |    */
 8597|  9.62k|    if ((prefix == NULL) && (name[0] == 'c') &&
  ------------------
  |  Branch (8597:9): [True: 8.91k, False: 708]
  |  Branch (8597:29): [True: 1.10k, False: 7.80k]
  ------------------
 8598|  1.10k|	xmlStrEqual(name, BAD_CAST "count"))
  ------------------
  |  |   34|  1.10k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (8598:2): [True: 55, False: 1.05k]
  ------------------
 8599|     55|    {
 8600|     55|	sort = 0;
 8601|     55|    }
 8602|  9.62k|    ctxt->comp->last = -1;
 8603|  9.62k|    if (CUR != ')') {
  ------------------
  |  | 2193|  9.62k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8603:9): [True: 8.02k, False: 1.59k]
  ------------------
 8604|  12.4k|	while (CUR != 0) {
  ------------------
  |  | 2193|  12.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8604:9): [True: 12.4k, False: 3]
  ------------------
 8605|  12.4k|	    int op1 = ctxt->comp->last;
 8606|  12.4k|	    ctxt->comp->last = -1;
 8607|  12.4k|	    xmlXPathCompileExpr(ctxt, sort);
 8608|  12.4k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (8608:10): [True: 695, False: 11.7k]
  ------------------
 8609|    695|		xmlFree(name);
 8610|    695|		xmlFree(prefix);
 8611|    695|		return;
 8612|    695|	    }
 8613|  11.7k|	    PUSH_BINARY_EXPR(XPATH_OP_ARG, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  11.7k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  11.7k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  11.7k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 8614|  11.7k|	    nbargs++;
 8615|  11.7k|	    if (CUR == ')') break;
  ------------------
  |  | 2193|  11.7k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8615:10): [True: 7.22k, False: 4.49k]
  ------------------
 8616|  4.49k|	    if (CUR != ',') {
  ------------------
  |  | 2193|  4.49k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (8616:10): [True: 103, False: 4.39k]
  ------------------
 8617|    103|		xmlFree(name);
 8618|    103|		xmlFree(prefix);
 8619|    103|		XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    103|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 8620|      0|	    }
 8621|  4.39k|	    NEXT;
  ------------------
  |  | 2202|  4.39k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 4.39k, False: 0]
  |  |  ------------------
  ------------------
 8622|  4.39k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  4.39k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.29k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 3.90k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8623|  4.39k|	}
 8624|  8.02k|    }
 8625|  8.82k|    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
  ------------------
  |  | 1085|  8.82k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  8.82k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (8625:9): [True: 3, False: 8.82k]
  ------------------
 8626|      3|        xmlFree(prefix);
 8627|      3|        xmlFree(name);
 8628|      3|    }
 8629|  8.82k|    NEXT;
  ------------------
  |  | 2202|  8.82k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 8.82k, False: 3]
  |  |  ------------------
  ------------------
 8630|  8.82k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  76.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  85.0k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 76.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 8631|  8.82k|}
xpath.c:xmlXPathCompPredicate:
 9137|  25.2k|xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
 9138|  25.2k|    int op1 = ctxt->comp->last;
 9139|       |
 9140|  25.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.2k|    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.2k|    if (CUR != '[') {
  ------------------
  |  | 2193|  25.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9141:9): [True: 0, False: 25.2k]
  ------------------
 9142|      0|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9143|      0|    }
 9144|  25.2k|    NEXT;
  ------------------
  |  | 2202|  25.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 25.2k, False: 0]
  |  |  ------------------
  ------------------
 9145|  25.2k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  25.2k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  47.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 22.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9146|       |
 9147|  25.2k|    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.2k|    if (! filter)
  ------------------
  |  Branch (9157:9): [True: 9.18k, False: 16.0k]
  ------------------
 9158|  9.18k|	xmlXPathCompileExpr(ctxt, 0);
 9159|  16.0k|    else
 9160|  16.0k|	xmlXPathCompileExpr(ctxt, 1);
 9161|  25.2k|    CHECK_ERROR;
  ------------------
  |  |  230|  25.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 2.90k, False: 22.3k]
  |  |  ------------------
  ------------------
 9162|       |
 9163|  22.3k|    if (CUR != ']') {
  ------------------
  |  | 2193|  22.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9163:9): [True: 224, False: 22.1k]
  ------------------
 9164|    224|	XP_ERROR(XPATH_INVALID_PREDICATE_ERROR);
  ------------------
  |  |  244|    224|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9165|      0|    }
 9166|       |
 9167|  22.1k|    if (filter)
  ------------------
  |  Branch (9167:9): [True: 14.9k, False: 7.16k]
  ------------------
 9168|  14.9k|	PUSH_BINARY_EXPR(XPATH_OP_FILTER, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  14.9k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  14.9k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  14.9k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9169|  7.16k|    else
 9170|  7.16k|	PUSH_BINARY_EXPR(XPATH_OP_PREDICATE, op1, ctxt->comp->last, 0, 0);
  ------------------
  |  | 1094|  7.16k|#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2)			\
  |  | 1095|  7.16k|xmlXPathCompExprAdd(ctxt, (ch1), (ch2), (op),			\
  |  | 1096|  7.16k|			(val), (val2), 0 ,NULL ,NULL)
  ------------------
 9171|       |
 9172|  22.1k|    NEXT;
  ------------------
  |  | 2202|  22.1k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 22.1k, False: 0]
  |  |  ------------------
  ------------------
 9173|  22.1k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  36.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  58.8k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 36.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9174|  22.1k|}
xpath.c:xmlXPathCompRelativeLocationPath:
 9481|   384k|(xmlXPathParserContextPtr ctxt) {
 9482|   384k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   384k|    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|   384k|    if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|   384k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  7.07k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9483:9): [True: 7.07k, False: 377k]
  |  Branch (9483:25): [True: 3.33k, False: 3.74k]
  ------------------
 9484|  3.33k|	SKIP(2);
  ------------------
  |  | 2194|  3.33k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9485|  3.33k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.7k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  10.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9486|  3.33k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  3.33k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  3.33k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9487|  3.33k|		         NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9488|   381k|    } else if (CUR == '/') {
  ------------------
  |  | 2193|   381k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9488:16): [True: 3.74k, False: 377k]
  ------------------
 9489|  3.74k|	    NEXT;
  ------------------
  |  | 2202|  3.74k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.74k, False: 0]
  |  |  ------------------
  ------------------
 9490|  3.74k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  10.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  10.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.6k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9491|  3.74k|    }
 9492|   384k|    xmlXPathCompStep(ctxt);
 9493|   384k|    CHECK_ERROR;
  ------------------
  |  |  230|   384k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 1.17k, False: 383k]
  |  |  ------------------
  ------------------
 9494|   383k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   383k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   384k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9495|   400k|    while (CUR == '/') {
  ------------------
  |  | 2193|   400k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9495:12): [True: 17.1k, False: 383k]
  ------------------
 9496|  17.1k|	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2193|  17.1k|#define CUR (*ctxt->cur)
  ------------------
              	if ((CUR == '/') && (NXT(1) == '/')) {
  ------------------
  |  | 2195|  17.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9496:6): [True: 17.1k, False: 0]
  |  Branch (9496:22): [True: 5.74k, False: 11.4k]
  ------------------
 9497|  5.74k|	    SKIP(2);
  ------------------
  |  | 2194|  5.74k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9498|  5.74k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  8.88k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  8.88k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 8.88k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9499|  5.74k|	    PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_DESCENDANT_OR_SELF,
  ------------------
  |  | 1085|  5.74k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  5.74k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9500|  5.74k|			     NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9501|  5.74k|	    xmlXPathCompStep(ctxt);
 9502|  11.4k|	} else if (CUR == '/') {
  ------------------
  |  | 2193|  11.4k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9502:13): [True: 11.4k, False: 0]
  ------------------
 9503|  11.4k|	    NEXT;
  ------------------
  |  | 2202|  11.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 11.4k, False: 0]
  |  |  ------------------
  ------------------
 9504|  11.4k|	    SKIP_BLANKS;
  ------------------
  |  | 2199|  11.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  7.71k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 7.71k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9505|  11.4k|	    xmlXPathCompStep(ctxt);
 9506|  11.4k|	}
 9507|  17.1k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  17.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  2.51k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 2.51k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9508|  17.1k|    }
 9509|   383k|}
xpath.c:xmlXPathCompStep:
 9390|   402k|xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
 9391|   402k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   402k|    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|   402k|    if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2193|   402k|#define CUR (*ctxt->cur)
  ------------------
                  if ((CUR == '.') && (NXT(1) == '.')) {
  ------------------
  |  | 2195|  25.8k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9392:9): [True: 25.8k, False: 376k]
  |  Branch (9392:25): [True: 7.14k, False: 18.6k]
  ------------------
 9393|  7.14k|	SKIP(2);
  ------------------
  |  | 2194|  7.14k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9394|  7.14k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  7.14k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.21k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.21k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9395|  7.14k|	PUSH_LONG_EXPR(XPATH_OP_COLLECT, AXIS_PARENT,
  ------------------
  |  | 1085|  7.14k|    xmlXPathCompExprAdd(ctxt, ctxt->comp->last, -1,		\
  |  | 1086|  7.14k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
 9396|  7.14k|		    NODE_TEST_TYPE, NODE_TYPE_NODE, NULL, NULL);
 9397|   394k|    } else if (CUR == '.') {
  ------------------
  |  | 2193|   394k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9397:16): [True: 18.6k, False: 376k]
  ------------------
 9398|  18.6k|	NEXT;
  ------------------
  |  | 2202|  18.6k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 18.6k, False: 0]
  |  |  ------------------
  ------------------
 9399|  18.6k|	SKIP_BLANKS;
  ------------------
  |  | 2199|  18.6k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  12.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.2k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9400|   376k|    } else {
 9401|   376k|	xmlChar *name = NULL;
 9402|   376k|	xmlChar *prefix = NULL;
 9403|   376k|	xmlXPathTestVal test = (xmlXPathTestVal) 0;
 9404|   376k|	xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
 9405|   376k|	xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
 9406|   376k|	int op1;
 9407|       |
 9408|   376k|	if (CUR == '*') {
  ------------------
  |  | 2193|   376k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9408:6): [True: 302k, False: 74.0k]
  ------------------
 9409|   302k|	    axis = AXIS_CHILD;
 9410|   302k|	} else {
 9411|  74.0k|	    if (name == NULL)
  ------------------
  |  Branch (9411:10): [True: 74.0k, False: 0]
  ------------------
 9412|  74.0k|		name = xmlXPathParseNCName(ctxt);
 9413|  74.0k|	    if (name != NULL) {
  ------------------
  |  Branch (9413:10): [True: 70.1k, False: 3.96k]
  ------------------
 9414|  70.1k|		axis = xmlXPathIsAxisName(name);
 9415|  70.1k|		if (axis != 0) {
  ------------------
  |  Branch (9415:7): [True: 4.19k, False: 65.9k]
  ------------------
 9416|  4.19k|		    SKIP_BLANKS;
  ------------------
  |  | 2199|  36.4k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  36.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 36.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9417|  4.19k|		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2193|  4.19k|#define CUR (*ctxt->cur)
  ------------------
              		    if ((CUR == ':') && (NXT(1) == ':')) {
  ------------------
  |  | 2195|  3.05k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (9417:11): [True: 3.05k, False: 1.14k]
  |  Branch (9417:27): [True: 2.97k, False: 73]
  ------------------
 9418|  2.97k|			SKIP(2);
  ------------------
  |  | 2194|  2.97k|#define SKIP(val) ctxt->cur += (val)
  ------------------
 9419|  2.97k|			xmlFree(name);
 9420|  2.97k|			name = NULL;
 9421|  2.97k|		    } else {
 9422|       |			/* an element name can conflict with an axis one :-\ */
 9423|  1.22k|			axis = AXIS_CHILD;
 9424|  1.22k|		    }
 9425|  65.9k|		} else {
 9426|  65.9k|		    axis = AXIS_CHILD;
 9427|  65.9k|		}
 9428|  70.1k|	    } else if (CUR == '@') {
  ------------------
  |  | 2193|  3.96k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9428:17): [True: 3.29k, False: 676]
  ------------------
 9429|  3.29k|		NEXT;
  ------------------
  |  | 2202|  3.29k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 3.29k, False: 0]
  |  |  ------------------
  ------------------
 9430|  3.29k|		axis = AXIS_ATTRIBUTE;
 9431|  3.29k|	    } else {
 9432|    676|		axis = AXIS_CHILD;
 9433|    676|	    }
 9434|  74.0k|	}
 9435|       |
 9436|   376k|        if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (9436:13): [True: 726, False: 375k]
  ------------------
 9437|    726|            xmlFree(name);
 9438|    726|            return;
 9439|    726|        }
 9440|       |
 9441|   375k|	name = xmlXPathCompNodeTest(ctxt, &test, &type, &prefix, name);
 9442|   375k|	if (test == 0)
  ------------------
  |  Branch (9442:6): [True: 388, False: 375k]
  ------------------
 9443|    388|	    return;
 9444|       |
 9445|   375k|        if ((prefix != NULL) && (ctxt->context != NULL) &&
  ------------------
  |  Branch (9445:13): [True: 2.27k, False: 372k]
  |  Branch (9445:33): [True: 2.27k, False: 0]
  ------------------
 9446|  2.27k|	    (ctxt->context->flags & XML_XPATH_CHECKNS)) {
  ------------------
  |  |  237|  2.27k|#define XML_XPATH_CHECKNS (1<<0)
  ------------------
  |  Branch (9446:6): [True: 0, False: 2.27k]
  ------------------
 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|   375k|	op1 = ctxt->comp->last;
 9454|   375k|	ctxt->comp->last = -1;
 9455|       |
 9456|   375k|	SKIP_BLANKS;
  ------------------
  |  | 2199|   375k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   388k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 12.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9457|   384k|	while (CUR == '[') {
  ------------------
  |  | 2193|   384k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9457:9): [True: 9.18k, False: 375k]
  ------------------
 9458|  9.18k|	    xmlXPathCompPredicate(ctxt, 0);
 9459|  9.18k|	}
 9460|       |
 9461|   375k|        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
  ------------------
  |  | 1082|   375k|    xmlXPathCompExprAdd(ctxt, (op1), (op2),			\
  |  | 1083|   375k|	                (op), (val), (val2), (val3), (val4), (val5))
  ------------------
  |  Branch (9461:13): [True: 29, False: 375k]
  ------------------
 9462|   375k|                           test, type, (void *)prefix, (void *)name) == -1) {
 9463|     29|            xmlFree(prefix);
 9464|     29|            xmlFree(name);
 9465|     29|        }
 9466|   375k|    }
 9467|   402k|}
xpath.c:xmlXPathIsAxisName:
 9321|  70.1k|xmlXPathIsAxisName(const xmlChar *name) {
 9322|  70.1k|    xmlXPathAxisVal ret = (xmlXPathAxisVal) 0;
 9323|  70.1k|    switch (name[0]) {
  ------------------
  |  Branch (9323:13): [True: 23.6k, False: 46.4k]
  ------------------
 9324|  8.52k|	case 'a':
  ------------------
  |  Branch (9324:2): [True: 8.52k, False: 61.6k]
  ------------------
 9325|  8.52k|	    if (xmlStrEqual(name, BAD_CAST "ancestor"))
  ------------------
  |  |   34|  8.52k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9325:10): [True: 1.13k, False: 7.39k]
  ------------------
 9326|  1.13k|		ret = AXIS_ANCESTOR;
 9327|  8.52k|	    if (xmlStrEqual(name, BAD_CAST "ancestor-or-self"))
  ------------------
  |  |   34|  8.52k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9327:10): [True: 827, False: 7.70k]
  ------------------
 9328|    827|		ret = AXIS_ANCESTOR_OR_SELF;
 9329|  8.52k|	    if (xmlStrEqual(name, BAD_CAST "attribute"))
  ------------------
  |  |   34|  8.52k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9329:10): [True: 37, False: 8.49k]
  ------------------
 9330|     37|		ret = AXIS_ATTRIBUTE;
 9331|  8.52k|	    break;
 9332|  2.23k|	case 'c':
  ------------------
  |  Branch (9332:2): [True: 2.23k, False: 67.8k]
  ------------------
 9333|  2.23k|	    if (xmlStrEqual(name, BAD_CAST "child"))
  ------------------
  |  |   34|  2.23k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9333:10): [True: 14, False: 2.21k]
  ------------------
 9334|     14|		ret = AXIS_CHILD;
 9335|  2.23k|	    break;
 9336|  1.44k|	case 'd':
  ------------------
  |  Branch (9336:2): [True: 1.44k, False: 68.6k]
  ------------------
 9337|  1.44k|	    if (xmlStrEqual(name, BAD_CAST "descendant"))
  ------------------
  |  |   34|  1.44k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9337:10): [True: 34, False: 1.40k]
  ------------------
 9338|     34|		ret = AXIS_DESCENDANT;
 9339|  1.44k|	    if (xmlStrEqual(name, BAD_CAST "descendant-or-self"))
  ------------------
  |  |   34|  1.44k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9339:10): [True: 10, False: 1.43k]
  ------------------
 9340|     10|		ret = AXIS_DESCENDANT_OR_SELF;
 9341|  1.44k|	    break;
 9342|  1.91k|	case 'f':
  ------------------
  |  Branch (9342:2): [True: 1.91k, False: 68.2k]
  ------------------
 9343|  1.91k|	    if (xmlStrEqual(name, BAD_CAST "following"))
  ------------------
  |  |   34|  1.91k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9343:10): [True: 309, False: 1.60k]
  ------------------
 9344|    309|		ret = AXIS_FOLLOWING;
 9345|  1.91k|	    if (xmlStrEqual(name, BAD_CAST "following-sibling"))
  ------------------
  |  |   34|  1.91k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9345:10): [True: 68, False: 1.84k]
  ------------------
 9346|     68|		ret = AXIS_FOLLOWING_SIBLING;
 9347|  1.91k|	    break;
 9348|  4.84k|	case 'n':
  ------------------
  |  Branch (9348:2): [True: 4.84k, False: 65.2k]
  ------------------
 9349|  4.84k|	    if (xmlStrEqual(name, BAD_CAST "namespace"))
  ------------------
  |  |   34|  4.84k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9349:10): [True: 481, False: 4.36k]
  ------------------
 9350|    481|		ret = AXIS_NAMESPACE;
 9351|  4.84k|	    break;
 9352|  2.00k|	case 'p':
  ------------------
  |  Branch (9352:2): [True: 2.00k, False: 68.1k]
  ------------------
 9353|  2.00k|	    if (xmlStrEqual(name, BAD_CAST "parent"))
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9353:10): [True: 302, False: 1.70k]
  ------------------
 9354|    302|		ret = AXIS_PARENT;
 9355|  2.00k|	    if (xmlStrEqual(name, BAD_CAST "preceding"))
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9355:10): [True: 59, False: 1.95k]
  ------------------
 9356|     59|		ret = AXIS_PRECEDING;
 9357|  2.00k|	    if (xmlStrEqual(name, BAD_CAST "preceding-sibling"))
  ------------------
  |  |   34|  2.00k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9357:10): [True: 7, False: 2.00k]
  ------------------
 9358|      7|		ret = AXIS_PRECEDING_SIBLING;
 9359|  2.00k|	    break;
 9360|  2.71k|	case 's':
  ------------------
  |  Branch (9360:2): [True: 2.71k, False: 67.4k]
  ------------------
 9361|  2.71k|	    if (xmlStrEqual(name, BAD_CAST "self"))
  ------------------
  |  |   34|  2.71k|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9361:10): [True: 917, False: 1.79k]
  ------------------
 9362|    917|		ret = AXIS_SELF;
 9363|  2.71k|	    break;
 9364|  70.1k|    }
 9365|  70.1k|    return(ret);
 9366|  70.1k|}
xpath.c:xmlXPathCompNodeTest:
 9201|   375k|		     xmlChar *name) {
 9202|   375k|    int blanks;
 9203|       |
 9204|   375k|    if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
  ------------------
  |  Branch (9204:9): [True: 0, False: 375k]
  |  Branch (9204:27): [True: 0, False: 375k]
  |  Branch (9204:45): [True: 0, False: 375k]
  ------------------
 9205|      0|	return(NULL);
 9206|      0|    }
 9207|   375k|    *type = (xmlXPathTypeVal) 0;
 9208|   375k|    *test = (xmlXPathTestVal) 0;
 9209|   375k|    *prefix = NULL;
 9210|   375k|    SKIP_BLANKS;
  ------------------
  |  | 2199|   375k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|   527k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 152k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9211|       |
 9212|   375k|    if ((name == NULL) && (CUR == '*')) {
  ------------------
  |  | 2193|   308k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9212:9): [True: 308k, False: 66.7k]
  |  Branch (9212:27): [True: 302k, False: 5.94k]
  ------------------
 9213|       |	/*
 9214|       |	 * All elements
 9215|       |	 */
 9216|   302k|	NEXT;
  ------------------
  |  | 2202|   302k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 302k, False: 0]
  |  |  ------------------
  ------------------
 9217|   302k|	*test = NODE_TEST_ALL;
 9218|   302k|	return(NULL);
 9219|   302k|    }
 9220|       |
 9221|  72.7k|    if (name == NULL)
  ------------------
  |  Branch (9221:9): [True: 5.94k, False: 66.7k]
  ------------------
 9222|  5.94k|	name = xmlXPathParseNCName(ctxt);
 9223|  72.7k|    if (name == NULL) {
  ------------------
  |  Branch (9223:9): [True: 337, False: 72.3k]
  ------------------
 9224|    337|	XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|    337|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9225|      0|    }
 9226|       |
 9227|  72.3k|    blanks = IS_BLANK_CH(CUR);
  ------------------
  |  |  137|  72.3k|#define IS_BLANK_CH(c)  xmlIsBlank_ch(c)
  |  |  ------------------
  |  |  |  |   90|  72.3k|#define xmlIsBlank_ch(c)	(((c) == 0x20) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (90:27): [True: 2.28k, False: 70.1k]
  |  |  |  |  ------------------
  |  |  |  |   91|  72.3k|				 ((0x9 <= (c)) && ((c) <= 0xa)) || \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (91:7): [True: 68.1k, False: 1.91k]
  |  |  |  |  |  Branch (91:23): [True: 17, False: 68.1k]
  |  |  |  |  ------------------
  |  |  |  |   92|  72.3k|				 ((c) == 0xd))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (92:6): [True: 12, False: 70.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9228|  72.3k|    SKIP_BLANKS;
  ------------------
  |  | 2199|  72.3k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  82.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 10.5k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9229|  72.3k|    if (CUR == '(') {
  ------------------
  |  | 2193|  72.3k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9229:9): [True: 844, False: 71.5k]
  ------------------
 9230|    844|	NEXT;
  ------------------
  |  | 2202|    844|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 844, False: 0]
  |  |  ------------------
  ------------------
 9231|       |	/*
 9232|       |	 * NodeType or PI search
 9233|       |	 */
 9234|    844|	if (xmlStrEqual(name, BAD_CAST "comment"))
  ------------------
  |  |   34|    844|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9234:6): [True: 26, False: 818]
  ------------------
 9235|     26|	    *type = NODE_TYPE_COMMENT;
 9236|    818|	else if (xmlStrEqual(name, BAD_CAST "node"))
  ------------------
  |  |   34|    818|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9236:11): [True: 70, False: 748]
  ------------------
 9237|     70|	    *type = NODE_TYPE_NODE;
 9238|    748|	else if (xmlStrEqual(name, BAD_CAST "processing-instruction"))
  ------------------
  |  |   34|    748|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9238:11): [True: 161, False: 587]
  ------------------
 9239|    161|	    *type = NODE_TYPE_PI;
 9240|    587|	else if (xmlStrEqual(name, BAD_CAST "text"))
  ------------------
  |  |   34|    587|#define BAD_CAST (xmlChar *)
  ------------------
  |  Branch (9240:11): [True: 536, False: 51]
  ------------------
 9241|    536|	    *type = NODE_TYPE_TEXT;
 9242|     51|	else {
 9243|     51|	    if (name != NULL)
  ------------------
  |  Branch (9243:10): [True: 51, False: 0]
  ------------------
 9244|     51|		xmlFree(name);
 9245|     51|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     51|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9246|      0|	}
 9247|       |
 9248|    793|	*test = NODE_TEST_TYPE;
 9249|       |
 9250|    793|	SKIP_BLANKS;
  ------------------
  |  | 2199|  1.03k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  | 2202|  1.83k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2202:15): [True: 1.03k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 9251|    793|	if (*type == NODE_TYPE_PI) {
  ------------------
  |  Branch (9251:6): [True: 161, False: 632]
  ------------------
 9252|       |	    /*
 9253|       |	     * Specific case: search a PI by name.
 9254|       |	     */
 9255|    161|	    if (name != NULL)
  ------------------
  |  Branch (9255:10): [True: 161, False: 0]
  ------------------
 9256|    161|		xmlFree(name);
 9257|    161|	    name = NULL;
 9258|    161|	    if (CUR != ')') {
  ------------------
  |  | 2193|    161|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9258:10): [True: 106, False: 55]
  ------------------
 9259|    106|		name = xmlXPathParseLiteral(ctxt);
 9260|    106|		*test = NODE_TEST_PI;
 9261|    106|		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|    106|	    }
 9263|    161|	}
 9264|    793|	if (CUR != ')') {
  ------------------
  |  | 2193|    793|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9264:6): [True: 51, False: 742]
  ------------------
 9265|     51|	    if (name != NULL)
  ------------------
  |  Branch (9265:10): [True: 40, False: 11]
  ------------------
 9266|     40|		xmlFree(name);
 9267|     51|	    XP_ERRORNULL(XPATH_UNCLOSED_ERROR);
  ------------------
  |  |  633|     51|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9268|      0|	}
 9269|    742|	NEXT;
  ------------------
  |  | 2202|    742|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 742, False: 0]
  |  |  ------------------
  ------------------
 9270|    742|	return(name);
 9271|    793|    }
 9272|  71.5k|    *test = NODE_TEST_NAME;
 9273|  71.5k|    if ((!blanks) && (CUR == ':')) {
  ------------------
  |  | 2193|  69.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9273:9): [True: 69.2k, False: 2.30k]
  |  Branch (9273:22): [True: 2.27k, False: 66.9k]
  ------------------
 9274|  2.27k|	NEXT;
  ------------------
  |  | 2202|  2.27k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 2.27k, 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.27k|	*prefix = name;
 9284|       |
 9285|  2.27k|	if (CUR == '*') {
  ------------------
  |  | 2193|  2.27k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (9285:6): [True: 412, False: 1.86k]
  ------------------
 9286|       |	    /*
 9287|       |	     * All elements
 9288|       |	     */
 9289|    412|	    NEXT;
  ------------------
  |  | 2202|    412|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (2202:15): [True: 412, False: 0]
  |  |  ------------------
  ------------------
 9290|    412|	    *test = NODE_TEST_ALL;
 9291|    412|	    return(NULL);
 9292|    412|	}
 9293|       |
 9294|  1.86k|	name = xmlXPathParseNCName(ctxt);
 9295|  1.86k|	if (name == NULL) {
  ------------------
  |  Branch (9295:6): [True: 42, False: 1.82k]
  ------------------
 9296|     42|	    XP_ERRORNULL(XPATH_EXPR_ERROR);
  ------------------
  |  |  633|     42|    { xmlXPathErr(ctxt, X); return(NULL); }
  ------------------
 9297|      0|	}
 9298|  1.86k|    }
 9299|  71.0k|    return(name);
 9300|  71.5k|}
xpath.c:xmlXPathCompExprAdd:
 1031|  1.37M|   int value2, int value3, void *value4, void *value5) {
 1032|  1.37M|    xmlXPathCompExprPtr comp = ctxt->comp;
 1033|  1.37M|    if (comp->nbStep >= comp->maxStep) {
  ------------------
  |  Branch (1033:9): [True: 60.8k, False: 1.31M]
  ------------------
 1034|  60.8k|	xmlXPathStepOp *real;
 1035|  60.8k|        int newSize;
 1036|       |
 1037|  60.8k|        newSize = xmlGrowCapacity(comp->maxStep, sizeof(real[0]),
 1038|  60.8k|                                  10, XPATH_MAX_STEPS);
  ------------------
  |  |   88|  60.8k|#define XPATH_MAX_STEPS 1000000
  ------------------
 1039|  60.8k|        if (newSize < 0) {
  ------------------
  |  Branch (1039:13): [True: 0, False: 60.8k]
  ------------------
 1040|      0|	    xmlXPathPErrMemory(ctxt);
 1041|      0|	    return(-1);
 1042|      0|        }
 1043|  60.8k|	real = xmlRealloc(comp->steps, newSize * sizeof(real[0]));
 1044|  60.8k|	if (real == NULL) {
  ------------------
  |  Branch (1044:6): [True: 136, False: 60.7k]
  ------------------
 1045|    136|	    xmlXPathPErrMemory(ctxt);
 1046|    136|	    return(-1);
 1047|    136|	}
 1048|  60.7k|	comp->steps = real;
 1049|  60.7k|	comp->maxStep = newSize;
 1050|  60.7k|    }
 1051|  1.37M|    comp->last = comp->nbStep;
 1052|  1.37M|    comp->steps[comp->nbStep].ch1 = ch1;
 1053|  1.37M|    comp->steps[comp->nbStep].ch2 = ch2;
 1054|  1.37M|    comp->steps[comp->nbStep].op = op;
 1055|  1.37M|    comp->steps[comp->nbStep].value = value;
 1056|  1.37M|    comp->steps[comp->nbStep].value2 = value2;
 1057|  1.37M|    comp->steps[comp->nbStep].value3 = value3;
 1058|  1.37M|    if ((comp->dict != NULL) &&
  ------------------
  |  Branch (1058:9): [True: 0, False: 1.37M]
  ------------------
 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.37M|    } else {
 1074|  1.37M|	comp->steps[comp->nbStep].value4 = value4;
 1075|  1.37M|	comp->steps[comp->nbStep].value5 = value5;
 1076|  1.37M|    }
 1077|       |    comp->steps[comp->nbStep].cache = NULL;
 1078|  1.37M|    return(comp->nbStep++);
 1079|  1.37M|}
xpath.c:xmlXPathOptimizeExpression:
11740|  1.24M|{
11741|  1.24M|    xmlXPathCompExprPtr comp = pctxt->comp;
11742|  1.24M|    xmlXPathContextPtr ctxt;
11743|       |
11744|       |    /*
11745|       |    * Try to rewrite "descendant-or-self::node()/foo" to an optimized
11746|       |    * internal representation.
11747|       |    */
11748|       |
11749|  1.24M|    if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11749:9): [True: 370k, False: 874k]
  ------------------
11750|   370k|        (op->ch1 != -1) &&
  ------------------
  |  Branch (11750:9): [True: 370k, False: 0]
  ------------------
11751|   370k|        (op->ch2 == -1 /* no predicate */))
  ------------------
  |  Branch (11751:9): [True: 364k, False: 6.37k]
  ------------------
11752|   364k|    {
11753|   364k|        xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
11754|       |
11755|   364k|        if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
  ------------------
  |  Branch (11755:13): [True: 19.1k, False: 344k]
  ------------------
11756|  19.1k|            ((xmlXPathAxisVal) prevop->value ==
  ------------------
  |  Branch (11756:13): [True: 10.1k, False: 9.00k]
  ------------------
11757|  19.1k|                AXIS_DESCENDANT_OR_SELF) &&
11758|  10.1k|            (prevop->ch2 == -1) &&
  ------------------
  |  Branch (11758:13): [True: 10.1k, False: 0]
  ------------------
11759|  10.1k|            ((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
  ------------------
  |  Branch (11759:13): [True: 10.1k, False: 0]
  ------------------
11760|  10.1k|            ((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE))
  ------------------
  |  Branch (11760:13): [True: 10.1k, False: 0]
  ------------------
11761|  10.1k|        {
11762|       |            /*
11763|       |            * This is a "descendant-or-self::node()" without predicates.
11764|       |            * Try to eliminate it.
11765|       |            */
11766|       |
11767|  10.1k|            switch ((xmlXPathAxisVal) op->value) {
11768|  2.40k|                case AXIS_CHILD:
  ------------------
  |  Branch (11768:17): [True: 2.40k, False: 7.74k]
  ------------------
11769|  2.40k|                case AXIS_DESCENDANT:
  ------------------
  |  Branch (11769:17): [True: 0, False: 10.1k]
  ------------------
11770|       |                    /*
11771|       |                    * Convert "descendant-or-self::node()/child::" or
11772|       |                    * "descendant-or-self::node()/descendant::" to
11773|       |                    * "descendant::"
11774|       |                    */
11775|  2.40k|                    op->ch1   = prevop->ch1;
11776|  2.40k|                    op->value = AXIS_DESCENDANT;
11777|  2.40k|                    break;
11778|      0|                case AXIS_SELF:
  ------------------
  |  Branch (11778:17): [True: 0, False: 10.1k]
  ------------------
11779|  2.30k|                case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (11779:17): [True: 2.30k, False: 7.84k]
  ------------------
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.30k|                    op->ch1   = prevop->ch1;
11786|  2.30k|                    op->value = AXIS_DESCENDANT_OR_SELF;
11787|  2.30k|                    break;
11788|  5.44k|                default:
  ------------------
  |  Branch (11788:17): [True: 5.44k, False: 4.70k]
  ------------------
11789|  5.44k|                    break;
11790|  10.1k|            }
11791|  10.1k|	}
11792|   364k|    }
11793|       |
11794|       |    /* OP_VALUE has invalid ch1. */
11795|  1.24M|    if (op->op == XPATH_OP_VALUE)
  ------------------
  |  Branch (11795:9): [True: 49.1k, False: 1.19M]
  ------------------
11796|  49.1k|        return;
11797|       |
11798|       |    /* Recurse */
11799|  1.19M|    ctxt = pctxt->context;
11800|  1.19M|    if (ctxt != NULL) {
  ------------------
  |  Branch (11800:9): [True: 1.19M, False: 0]
  ------------------
11801|  1.19M|        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.19M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (11801:13): [True: 396, False: 1.19M]
  ------------------
11802|    396|            return;
11803|  1.19M|        ctxt->depth += 1;
11804|  1.19M|    }
11805|  1.19M|    if (op->ch1 != -1)
  ------------------
  |  Branch (11805:9): [True: 821k, False: 373k]
  ------------------
11806|   821k|        xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch1]);
11807|  1.19M|    if (op->ch2 != -1)
  ------------------
  |  Branch (11807:9): [True: 411k, False: 783k]
  ------------------
11808|   411k|	xmlXPathOptimizeExpression(pctxt, &comp->steps[op->ch2]);
11809|  1.19M|    if (ctxt != NULL)
  ------------------
  |  Branch (11809:9): [True: 1.19M, False: 0]
  ------------------
11810|  1.19M|        ctxt->depth -= 1;
11811|  1.19M|}
xpath.c:xmlXPathRunEval:
11496|  11.3k|{
11497|  11.3k|    xmlXPathCompExprPtr comp;
11498|  11.3k|    int oldDepth;
11499|       |
11500|  11.3k|    if ((ctxt == NULL) || (ctxt->comp == NULL))
  ------------------
  |  Branch (11500:9): [True: 0, False: 11.3k]
  |  Branch (11500:27): [True: 0, False: 11.3k]
  ------------------
11501|      0|	return(-1);
11502|       |
11503|  11.3k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (11503:9): [True: 0, False: 11.3k]
  ------------------
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|  11.3k|    comp = ctxt->comp;
11553|  11.3k|    if (comp->last < 0) {
  ------------------
  |  Branch (11553:9): [True: 0, False: 11.3k]
  ------------------
11554|      0|        xmlXPathErr(ctxt, XPATH_STACK_ERROR);
11555|      0|	return(-1);
11556|      0|    }
11557|  11.3k|    oldDepth = ctxt->context->depth;
11558|  11.3k|    if (toBool)
  ------------------
  |  Branch (11558:9): [True: 0, False: 11.3k]
  ------------------
11559|      0|	return(xmlXPathCompOpEvalToBoolean(ctxt,
11560|      0|	    &comp->steps[comp->last], 0));
11561|  11.3k|    else
11562|  11.3k|	xmlXPathCompOpEval(ctxt, &comp->steps[comp->last]);
11563|  11.3k|    ctxt->context->depth = oldDepth;
11564|       |
11565|  11.3k|    return(0);
11566|  11.3k|}
xpath.c:xmlXPathCompOpEvalToBoolean:
11177|   508k|{
11178|   508k|    xmlXPathObjectPtr resObj = NULL;
11179|       |
11180|   510k|start:
11181|   510k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|   510k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 510k, False: 0]
  |  |  |  Branch (818:39): [True: 4, False: 510k]
  |  |  ------------------
  ------------------
11182|      4|        return(0);
11183|       |    /* comp = ctxt->comp; */
11184|   510k|    switch (op->op) {
11185|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (11185:9): [True: 0, False: 510k]
  ------------------
11186|      0|            return (0);
11187|  33.6k|	case XPATH_OP_VALUE:
  ------------------
  |  Branch (11187:2): [True: 33.6k, False: 477k]
  ------------------
11188|  33.6k|	    resObj = (xmlXPathObjectPtr) op->value4;
11189|  33.6k|	    if (isPredicate)
  ------------------
  |  Branch (11189:10): [True: 33.6k, False: 0]
  ------------------
11190|  33.6k|		return(xmlXPathEvaluatePredicateResult(ctxt, resObj));
11191|      0|	    return(xmlXPathCastToBoolean(resObj));
11192|  2.64k|	case XPATH_OP_SORT:
  ------------------
  |  Branch (11192:2): [True: 2.64k, False: 508k]
  ------------------
11193|       |	    /*
11194|       |	    * We don't need sorting for boolean results. Skip this one.
11195|       |	    */
11196|  2.64k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11196:17): [True: 2.64k, False: 0]
  ------------------
11197|  2.64k|		op = &ctxt->comp->steps[op->ch1];
11198|  2.64k|		goto start;
11199|  2.64k|	    }
11200|      0|	    return(0);
11201|   129k|	case XPATH_OP_COLLECT:
  ------------------
  |  Branch (11201:2): [True: 129k, False: 381k]
  ------------------
11202|   129k|	    if (op->ch1 == -1)
  ------------------
  |  Branch (11202:10): [True: 0, False: 129k]
  ------------------
11203|      0|		return(0);
11204|       |
11205|   129k|            xmlXPathCompOpEval(ctxt, &ctxt->comp->steps[op->ch1]);
11206|   129k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11206:10): [True: 126, False: 129k]
  ------------------
11207|    126|		return(-1);
11208|       |
11209|   129k|            xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 1);
11210|   129k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11210:10): [True: 323, False: 128k]
  ------------------
11211|    323|		return(-1);
11212|       |
11213|   128k|	    resObj = xmlXPathValuePop(ctxt);
11214|   128k|	    if (resObj == NULL)
  ------------------
  |  Branch (11214:10): [True: 0, False: 128k]
  ------------------
11215|      0|		return(-1);
11216|   128k|	    break;
11217|   345k|	default:
  ------------------
  |  Branch (11217:2): [True: 345k, False: 165k]
  ------------------
11218|       |	    /*
11219|       |	    * Fallback to call xmlXPathCompOpEval().
11220|       |	    */
11221|   345k|	    xmlXPathCompOpEval(ctxt, op);
11222|   345k|	    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (11222:10): [True: 1.40k, False: 343k]
  ------------------
11223|  1.40k|		return(-1);
11224|       |
11225|   343k|	    resObj = xmlXPathValuePop(ctxt);
11226|   343k|	    if (resObj == NULL)
  ------------------
  |  Branch (11226:10): [True: 0, False: 343k]
  ------------------
11227|      0|		return(-1);
11228|   343k|	    break;
11229|   510k|    }
11230|       |
11231|   472k|    if (resObj) {
  ------------------
  |  Branch (11231:9): [True: 472k, False: 0]
  ------------------
11232|   472k|	int res;
11233|       |
11234|   472k|	if (resObj->type == XPATH_BOOLEAN) {
  ------------------
  |  Branch (11234:6): [True: 237k, False: 235k]
  ------------------
11235|   237k|	    res = resObj->boolval;
11236|   237k|	} else if (isPredicate) {
  ------------------
  |  Branch (11236:13): [True: 235k, 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|   235k|	    res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
11246|   235k|	} else {
11247|      0|	    res = xmlXPathCastToBoolean(resObj);
11248|      0|	}
11249|   472k|	xmlXPathReleaseObject(ctxt->context, resObj);
11250|   472k|	return(res);
11251|   472k|    }
11252|       |
11253|      0|    return(0);
11254|   472k|}
xpath.c:xmlXPathNodeCollectAndTest:
 9793|  1.15M|{
 9794|       |
 9795|  1.15M|#define XP_TEST_HIT \
 9796|  1.15M|    if (hasAxisRange != 0) { \
 9797|  1.15M|	if (++pos == maxPos) { \
 9798|  1.15M|	    if (addNode(seq, cur) < 0) \
 9799|  1.15M|	        xmlXPathPErrMemory(ctxt); \
 9800|  1.15M|	    goto axis_range_end; } \
 9801|  1.15M|    } else { \
 9802|  1.15M|	if (addNode(seq, cur) < 0) \
 9803|  1.15M|	    xmlXPathPErrMemory(ctxt); \
 9804|  1.15M|	if (breakOnFirstHit) goto first_hit; }
 9805|       |
 9806|  1.15M|#define XP_TEST_HIT_NS \
 9807|  1.15M|    if (hasAxisRange != 0) { \
 9808|  1.15M|	if (++pos == maxPos) { \
 9809|  1.15M|	    hasNsNodes = 1; \
 9810|  1.15M|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9811|  1.15M|	        xmlXPathPErrMemory(ctxt); \
 9812|  1.15M|	goto axis_range_end; } \
 9813|  1.15M|    } else { \
 9814|  1.15M|	hasNsNodes = 1; \
 9815|  1.15M|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
 9816|  1.15M|	    xmlXPathPErrMemory(ctxt); \
 9817|  1.15M|	if (breakOnFirstHit) goto first_hit; }
 9818|       |
 9819|  1.15M|    xmlXPathAxisVal axis = (xmlXPathAxisVal) op->value;
 9820|  1.15M|    xmlXPathTestVal test = (xmlXPathTestVal) op->value2;
 9821|  1.15M|    xmlXPathTypeVal type = (xmlXPathTypeVal) op->value3;
 9822|  1.15M|    const xmlChar *prefix = op->value4;
 9823|  1.15M|    const xmlChar *name = op->value5;
 9824|  1.15M|    const xmlChar *URI = NULL;
 9825|       |
 9826|  1.15M|    int total = 0, hasNsNodes = 0;
 9827|       |    /* The popped object holding the context nodes */
 9828|  1.15M|    xmlXPathObjectPtr obj;
 9829|       |    /* The set of context nodes for the node tests */
 9830|  1.15M|    xmlNodeSetPtr contextSeq;
 9831|  1.15M|    int contextIdx;
 9832|  1.15M|    xmlNodePtr contextNode;
 9833|       |    /* The final resulting node set wrt to all context nodes */
 9834|  1.15M|    xmlNodeSetPtr outSeq;
 9835|       |    /*
 9836|       |    * The temporary resulting node set wrt 1 context node.
 9837|       |    * Used to feed predicate evaluation.
 9838|       |    */
 9839|  1.15M|    xmlNodeSetPtr seq;
 9840|  1.15M|    xmlNodePtr cur;
 9841|       |    /* First predicate operator */
 9842|  1.15M|    xmlXPathStepOpPtr predOp;
 9843|  1.15M|    int maxPos; /* The requested position() (when a "[n]" predicate) */
 9844|  1.15M|    int hasPredicateRange, hasAxisRange, pos;
 9845|  1.15M|    int breakOnFirstHit;
 9846|       |
 9847|  1.15M|    xmlXPathTraversalFunction next = NULL;
 9848|  1.15M|    int (*addNode) (xmlNodeSetPtr, xmlNodePtr);
 9849|  1.15M|    xmlXPathNodeSetMergeFunction mergeAndClear;
 9850|  1.15M|    xmlNodePtr oldContextNode;
 9851|  1.15M|    xmlXPathContextPtr xpctxt = ctxt->context;
 9852|       |
 9853|       |
 9854|  1.15M|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.15M|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.15M]
  |  |  |  Branch (271:34): [True: 137, False: 1.15M]
  |  |  ------------------
  |  |  272|  1.15M|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|    137|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
 9855|  1.15M|    obj = xmlXPathValuePop(ctxt);
 9856|       |    /*
 9857|       |    * Setup namespaces.
 9858|       |    */
 9859|  1.15M|    if (prefix != NULL) {
  ------------------
  |  Branch (9859:9): [True: 8.02k, False: 1.14M]
  ------------------
 9860|  8.02k|        URI = xmlXPathNsLookup(xpctxt, prefix);
 9861|  8.02k|        if (URI == NULL) {
  ------------------
  |  Branch (9861:13): [True: 168, False: 7.85k]
  ------------------
 9862|    168|	    xmlXPathReleaseObject(xpctxt, obj);
 9863|    168|            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
 9864|    168|                           "Undefined namespace prefix: %s\n", prefix);
 9865|    168|            return 0;
 9866|    168|	}
 9867|  8.02k|    }
 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.15M|    mergeAndClear = xmlXPathNodeSetMergeAndClear;
 9882|  1.15M|    switch (axis) {
  ------------------
  |  Branch (9882:13): [True: 1.15M, False: 0]
  ------------------
 9883|    391|        case AXIS_ANCESTOR:
  ------------------
  |  Branch (9883:9): [True: 391, False: 1.15M]
  ------------------
 9884|    391|            first = NULL;
 9885|    391|            next = xmlXPathNextAncestor;
 9886|    391|            break;
 9887|    414|        case AXIS_ANCESTOR_OR_SELF:
  ------------------
  |  Branch (9887:9): [True: 414, False: 1.15M]
  ------------------
 9888|    414|            first = NULL;
 9889|    414|            next = xmlXPathNextAncestorOrSelf;
 9890|    414|            break;
 9891|  18.3k|        case AXIS_ATTRIBUTE:
  ------------------
  |  Branch (9891:9): [True: 18.3k, False: 1.13M]
  ------------------
 9892|  18.3k|            first = NULL;
 9893|  18.3k|	    last = NULL;
 9894|  18.3k|            next = xmlXPathNextAttribute;
 9895|  18.3k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9896|  18.3k|            break;
 9897|   918k|        case AXIS_CHILD:
  ------------------
  |  Branch (9897:9): [True: 918k, False: 237k]
  ------------------
 9898|   918k|	    last = NULL;
 9899|   918k|	    if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
  ------------------
  |  Branch (9899:11): [True: 725k, False: 193k]
  |  Branch (9899:39): [True: 188k, False: 4.43k]
  ------------------
 9900|   914k|		(type == NODE_TYPE_NODE))
  ------------------
  |  Branch (9900:3): [True: 914k, False: 0]
  ------------------
 9901|   914k|	    {
 9902|       |		/*
 9903|       |		* Optimization if an element node type is 'element'.
 9904|       |		*/
 9905|   914k|		next = xmlXPathNextChildElement;
 9906|   914k|	    } else
 9907|  4.43k|		next = xmlXPathNextChild;
 9908|   918k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9909|   918k|            break;
 9910|  50.3k|        case AXIS_DESCENDANT:
  ------------------
  |  Branch (9910:9): [True: 50.3k, False: 1.10M]
  ------------------
 9911|  50.3k|	    last = NULL;
 9912|  50.3k|            next = xmlXPathNextDescendant;
 9913|  50.3k|            break;
 9914|   134k|        case AXIS_DESCENDANT_OR_SELF:
  ------------------
  |  Branch (9914:9): [True: 134k, False: 1.02M]
  ------------------
 9915|   134k|	    last = NULL;
 9916|   134k|            next = xmlXPathNextDescendantOrSelf;
 9917|   134k|            break;
 9918|    400|        case AXIS_FOLLOWING:
  ------------------
  |  Branch (9918:9): [True: 400, False: 1.15M]
  ------------------
 9919|    400|	    last = NULL;
 9920|    400|            next = xmlXPathNextFollowing;
 9921|    400|            break;
 9922|      0|        case AXIS_FOLLOWING_SIBLING:
  ------------------
  |  Branch (9922:9): [True: 0, False: 1.15M]
  ------------------
 9923|      0|	    last = NULL;
 9924|      0|            next = xmlXPathNextFollowingSibling;
 9925|      0|            break;
 9926|  2.28k|        case AXIS_NAMESPACE:
  ------------------
  |  Branch (9926:9): [True: 2.28k, False: 1.15M]
  ------------------
 9927|  2.28k|            first = NULL;
 9928|  2.28k|	    last = NULL;
 9929|  2.28k|            next = (xmlXPathTraversalFunction) xmlXPathNextNamespace;
 9930|  2.28k|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9931|  2.28k|            break;
 9932|  30.5k|        case AXIS_PARENT:
  ------------------
  |  Branch (9932:9): [True: 30.5k, False: 1.12M]
  ------------------
 9933|  30.5k|            first = NULL;
 9934|  30.5k|            next = xmlXPathNextParent;
 9935|  30.5k|            break;
 9936|     59|        case AXIS_PRECEDING:
  ------------------
  |  Branch (9936:9): [True: 59, False: 1.15M]
  ------------------
 9937|     59|            first = NULL;
 9938|     59|            next = xmlXPathNextPrecedingInternal;
 9939|     59|            break;
 9940|      3|        case AXIS_PRECEDING_SIBLING:
  ------------------
  |  Branch (9940:9): [True: 3, False: 1.15M]
  ------------------
 9941|      3|            first = NULL;
 9942|      3|            next = xmlXPathNextPrecedingSibling;
 9943|      3|            break;
 9944|    436|        case AXIS_SELF:
  ------------------
  |  Branch (9944:9): [True: 436, False: 1.15M]
  ------------------
 9945|    436|            first = NULL;
 9946|    436|	    last = NULL;
 9947|    436|            next = xmlXPathNextSelf;
 9948|    436|	    mergeAndClear = xmlXPathNodeSetMergeAndClearNoDupls;
 9949|    436|            break;
 9950|  1.15M|    }
 9951|       |
 9952|  1.15M|    if (next == NULL) {
  ------------------
  |  Branch (9952:9): [True: 0, False: 1.15M]
  ------------------
 9953|      0|	xmlXPathReleaseObject(xpctxt, obj);
 9954|      0|        return(0);
 9955|      0|    }
 9956|  1.15M|    contextSeq = obj->nodesetval;
 9957|  1.15M|    if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
  ------------------
  |  Branch (9957:9): [True: 0, False: 1.15M]
  |  Branch (9957:33): [True: 80.9k, False: 1.07M]
  ------------------
 9958|  80.9k|        xmlXPathValuePush(ctxt, obj);
 9959|  80.9k|        return(0);
 9960|  80.9k|    }
 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.07M|    maxPos = 0;
 9980|  1.07M|    predOp = NULL;
 9981|  1.07M|    hasPredicateRange = 0;
 9982|  1.07M|    hasAxisRange = 0;
 9983|  1.07M|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9983:9): [True: 126k, False: 949k]
  ------------------
 9984|       |	/*
 9985|       |	* There's at least one predicate. 16 == XPATH_OP_PREDICATE
 9986|       |	*/
 9987|   126k|	predOp = &ctxt->comp->steps[op->ch2];
 9988|   126k|	if (xmlXPathIsPositionalPredicate(ctxt, predOp, &maxPos)) {
  ------------------
  |  Branch (9988:6): [True: 57.7k, False: 68.6k]
  ------------------
 9989|  57.7k|	    if (predOp->ch1 != -1) {
  ------------------
  |  Branch (9989:10): [True: 33.5k, False: 24.2k]
  ------------------
 9990|       |		/*
 9991|       |		* Use the next inner predicate operator.
 9992|       |		*/
 9993|  33.5k|		predOp = &ctxt->comp->steps[predOp->ch1];
 9994|  33.5k|		hasPredicateRange = 1;
 9995|  33.5k|	    } else {
 9996|       |		/*
 9997|       |		* There's no other predicate than the [n] predicate.
 9998|       |		*/
 9999|  24.2k|		predOp = NULL;
10000|  24.2k|		hasAxisRange = 1;
10001|  24.2k|	    }
10002|  57.7k|	}
10003|   126k|    }
10004|  1.07M|    breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
  ------------------
  |  Branch (10004:24): [True: 127k, False: 948k]
  |  Branch (10004:36): [True: 101k, False: 25.1k]
  ------------------
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.07M|    oldContextNode = xpctxt->node;
10019|  1.07M|    addNode = xmlXPathNodeSetAddUnique;
10020|  1.07M|    outSeq = NULL;
10021|  1.07M|    seq = NULL;
10022|  1.07M|    contextNode = NULL;
10023|  1.07M|    contextIdx = 0;
10024|       |
10025|       |
10026|  3.31M|    while (((contextIdx < contextSeq->nodeNr) || (contextNode != NULL)) &&
  ------------------
  |  Branch (10026:13): [True: 2.31M, False: 1.00M]
  |  Branch (10026:50): [True: 0, False: 1.00M]
  ------------------
10027|  2.31M|           (ctxt->error == XPATH_EXPRESSION_OK)) {
  ------------------
  |  Branch (10027:12): [True: 2.31M, False: 103]
  ------------------
10028|  2.31M|	xpctxt->node = contextSeq->nodeTab[contextIdx++];
10029|       |
10030|  2.31M|	if (seq == NULL) {
  ------------------
  |  Branch (10030:6): [True: 1.09M, False: 1.21M]
  ------------------
10031|  1.09M|	    seq = xmlXPathNodeSetCreate(NULL);
10032|  1.09M|	    if (seq == NULL) {
  ------------------
  |  Branch (10032:10): [True: 126, False: 1.09M]
  ------------------
10033|    126|                xmlXPathPErrMemory(ctxt);
10034|    126|		total = 0;
10035|    126|		goto error;
10036|    126|	    }
10037|  1.09M|	}
10038|       |	/*
10039|       |	* Traverse the axis and test the nodes.
10040|       |	*/
10041|  2.31M|	pos = 0;
10042|  2.31M|	cur = NULL;
10043|  2.31M|	hasNsNodes = 0;
10044|  9.49M|        do {
10045|  9.49M|            if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  9.49M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 9.49M, False: 0]
  |  |  |  Branch (818:39): [True: 42, False: 9.49M]
  |  |  ------------------
  ------------------
10046|     42|                goto error;
10047|       |
10048|  9.49M|            cur = next(ctxt, cur);
10049|  9.49M|            if (cur == NULL)
  ------------------
  |  Branch (10049:17): [True: 2.24M, False: 7.25M]
  ------------------
10050|  2.24M|                break;
10051|       |
10052|       |	    /*
10053|       |	    * QUESTION TODO: What does the "first" and "last" stuff do?
10054|       |	    */
10055|  7.25M|            if ((first != NULL) && (*first != NULL)) {
  ------------------
  |  Branch (10055:17): [True: 3.29k, False: 7.25M]
  |  Branch (10055:36): [True: 1.39k, False: 1.89k]
  ------------------
10056|  1.39k|		if (*first == cur)
  ------------------
  |  Branch (10056:7): [True: 257, False: 1.13k]
  ------------------
10057|    257|		    break;
10058|  1.13k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10058:7): [True: 1.03k, False: 102]
  ------------------
10059|  1.03k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10060|  1.03k|		    (xmlXPathCmpNodesExt(*first, cur) >= 0))
  ------------------
  |  Branch (10060:7): [True: 877, False: 155]
  ------------------
10061|       |#else
10062|       |		    (xmlXPathCmpNodes(*first, cur) >= 0))
10063|       |#endif
10064|    877|		{
10065|    877|		    break;
10066|    877|		}
10067|  1.13k|	    }
10068|  7.25M|	    if ((last != NULL) && (*last != NULL)) {
  ------------------
  |  Branch (10068:10): [True: 2.47k, False: 7.25M]
  |  Branch (10068:28): [True: 1.79k, False: 682]
  ------------------
10069|  1.79k|		if (*last == cur)
  ------------------
  |  Branch (10069:7): [True: 160, False: 1.63k]
  ------------------
10070|    160|		    break;
10071|  1.63k|		if (((total % 256) == 0) &&
  ------------------
  |  Branch (10071:7): [True: 1.08k, False: 552]
  ------------------
10072|  1.08k|#ifdef XP_OPTIMIZED_NON_ELEM_COMPARISON
10073|  1.08k|		    (xmlXPathCmpNodesExt(cur, *last) >= 0))
  ------------------
  |  Branch (10073:7): [True: 964, False: 121]
  ------------------
10074|       |#else
10075|       |		    (xmlXPathCmpNodes(cur, *last) >= 0))
10076|       |#endif
10077|    964|		{
10078|    964|		    break;
10079|    964|		}
10080|  1.63k|	    }
10081|       |
10082|  7.25M|            total++;
10083|       |
10084|  7.25M|	    switch (test) {
  ------------------
  |  Branch (10084:14): [True: 7.25M, False: 0]
  ------------------
10085|      0|                case NODE_TEST_NONE:
  ------------------
  |  Branch (10085:17): [True: 0, False: 7.25M]
  ------------------
10086|      0|		    total = 0;
10087|      0|		    goto error;
10088|  4.26M|                case NODE_TEST_TYPE:
  ------------------
  |  Branch (10088:17): [True: 4.26M, False: 2.98M]
  ------------------
10089|  4.26M|		    if (type == NODE_TYPE_NODE) {
  ------------------
  |  Branch (10089:11): [True: 4.14M, False: 125k]
  ------------------
10090|  4.14M|			switch (cur->type) {
10091|   117k|			    case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (10091:8): [True: 117k, False: 4.02M]
  ------------------
10092|   117k|			    case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (10092:8): [True: 0, False: 4.14M]
  ------------------
10093|  2.76M|			    case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10093:8): [True: 2.64M, False: 1.49M]
  ------------------
10094|  2.76M|			    case XML_ATTRIBUTE_NODE:
  ------------------
  |  Branch (10094:8): [True: 560, False: 4.13M]
  ------------------
10095|  2.92M|			    case XML_PI_NODE:
  ------------------
  |  Branch (10095:8): [True: 157k, False: 3.98M]
  ------------------
10096|  2.94M|			    case XML_COMMENT_NODE:
  ------------------
  |  Branch (10096:8): [True: 24.5k, False: 4.11M]
  ------------------
10097|  3.06M|			    case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (10097:8): [True: 113k, False: 4.02M]
  ------------------
10098|  4.13M|			    case XML_TEXT_NODE:
  ------------------
  |  Branch (10098:8): [True: 1.07M, False: 3.06M]
  ------------------
10099|  4.13M|				XP_TEST_HIT
  ------------------
  |  | 9796|  4.13M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 537, False: 4.13M]
  |  |  ------------------
  |  | 9797|    537|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 269, False: 268]
  |  |  ------------------
  |  | 9798|    269|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 268]
  |  |  ------------------
  |  | 9799|    269|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    269|	    goto axis_range_end; } \
  |  | 9801|  4.13M|    } else { \
  |  | 9802|  4.13M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 92, False: 4.13M]
  |  |  ------------------
  |  | 9803|  4.13M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  4.13M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 8.01k, False: 4.12M]
  |  |  ------------------
  ------------------
10100|  4.12M|				break;
10101|  4.12M|			    case XML_NAMESPACE_DECL: {
  ------------------
  |  Branch (10101:8): [True: 5.33k, False: 4.13M]
  ------------------
10102|  5.33k|				if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10102:9): [True: 0, False: 5.33k]
  ------------------
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.33k|				} else {
10105|  5.33k|	                            hasNsNodes = 1;
10106|  5.33k|				    XP_TEST_HIT
  ------------------
  |  | 9796|  5.33k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 5.33k]
  |  |  ------------------
  |  | 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.33k|    } else { \
  |  | 9802|  5.33k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 7, False: 5.32k]
  |  |  ------------------
  |  | 9803|  5.33k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  5.33k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 5.33k]
  |  |  ------------------
  ------------------
10107|  5.33k|				}
10108|  5.33k|				break;
10109|  5.33k|                            }
10110|  5.33k|			    default:
  ------------------
  |  Branch (10110:8): [True: 1.02k, False: 4.13M]
  ------------------
10111|  1.02k|				break;
10112|  4.14M|			}
10113|  4.14M|		    } else if (cur->type == (xmlElementType) type) {
  ------------------
  |  Branch (10113:18): [True: 62.6k, False: 63.3k]
  ------------------
10114|  62.6k|			if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10114:8): [True: 0, False: 62.6k]
  ------------------
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|  62.6k|			else
10117|  62.6k|			    XP_TEST_HIT
  ------------------
  |  | 9796|  62.6k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.41k, False: 61.2k]
  |  |  ------------------
  |  | 9797|  1.41k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 219, False: 1.20k]
  |  |  ------------------
  |  | 9798|    219|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 218]
  |  |  ------------------
  |  | 9799|    219|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    219|	    goto axis_range_end; } \
  |  | 9801|  61.2k|    } else { \
  |  | 9802|  61.2k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 61.2k]
  |  |  ------------------
  |  | 9803|  61.2k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  61.2k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 205, False: 61.0k]
  |  |  ------------------
  ------------------
10118|  63.3k|		    } else if ((type == NODE_TYPE_TEXT) &&
  ------------------
  |  Branch (10118:18): [True: 63.2k, False: 37]
  ------------------
10119|  63.2k|			 (cur->type == XML_CDATA_SECTION_NODE))
  ------------------
  |  Branch (10119:5): [True: 18.4k, False: 44.8k]
  ------------------
10120|  18.4k|		    {
10121|  18.4k|			XP_TEST_HIT
  ------------------
  |  | 9796|  18.4k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 464, False: 17.9k]
  |  |  ------------------
  |  | 9797|    464|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 35, False: 429]
  |  |  ------------------
  |  | 9798|     35|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 34]
  |  |  ------------------
  |  | 9799|     35|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     35|	    goto axis_range_end; } \
  |  | 9801|  17.9k|    } else { \
  |  | 9802|  17.9k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 17.9k]
  |  |  ------------------
  |  | 9803|  17.9k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  17.9k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 197, False: 17.7k]
  |  |  ------------------
  ------------------
10122|  18.4k|		    }
10123|  4.25M|		    break;
10124|  4.25M|                case NODE_TEST_PI:
  ------------------
  |  Branch (10124:17): [True: 240, False: 7.25M]
  ------------------
10125|    240|                    if ((cur->type == XML_PI_NODE) &&
  ------------------
  |  Branch (10125:25): [True: 68, False: 172]
  ------------------
10126|     68|                        ((name == NULL) || xmlStrEqual(name, cur->name)))
  ------------------
  |  Branch (10126:26): [True: 0, False: 68]
  |  Branch (10126:44): [True: 34, False: 34]
  ------------------
10127|     34|		    {
10128|     34|			XP_TEST_HIT
  ------------------
  |  | 9796|     34|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 0, False: 34]
  |  |  ------------------
  |  | 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|     34|    } else { \
  |  | 9802|     34|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 33]
  |  |  ------------------
  |  | 9803|     34|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|     34|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 0, False: 34]
  |  |  ------------------
  ------------------
10129|     34|                    }
10130|    240|                    break;
10131|  1.27M|                case NODE_TEST_ALL:
  ------------------
  |  Branch (10131:17): [True: 1.27M, False: 5.97M]
  ------------------
10132|  1.27M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10132:25): [True: 22.2k, False: 1.25M]
  ------------------
10133|  22.2k|                        if (cur->type == XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10133:29): [True: 22.2k, False: 0]
  ------------------
10134|  22.2k|			{
10135|  22.2k|                            if (prefix == NULL)
  ------------------
  |  Branch (10135:33): [True: 21.3k, False: 946]
  ------------------
10136|  21.3k|			    {
10137|  21.3k|				XP_TEST_HIT
  ------------------
  |  | 9796|  21.3k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 10.9k, False: 10.3k]
  |  |  ------------------
  |  | 9797|  10.9k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 5.58k, False: 5.33k]
  |  |  ------------------
  |  | 9798|  5.58k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 5.58k]
  |  |  ------------------
  |  | 9799|  5.58k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  5.58k|	    goto axis_range_end; } \
  |  | 9801|  10.9k|    } else { \
  |  | 9802|  10.3k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 3, False: 10.3k]
  |  |  ------------------
  |  | 9803|  10.3k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  10.3k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 5.63k, False: 4.75k]
  |  |  ------------------
  ------------------
10138|  21.3k|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10138:40): [True: 747, False: 199]
  ------------------
10139|    747|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10139:5): [True: 747, False: 0]
  ------------------
10140|    747|			    {
10141|    747|				XP_TEST_HIT
  ------------------
  |  | 9796|    747|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 442, False: 305]
  |  |  ------------------
  |  | 9797|    442|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 245, False: 197]
  |  |  ------------------
  |  | 9798|    245|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 244]
  |  |  ------------------
  |  | 9799|    245|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    245|	    goto axis_range_end; } \
  |  | 9801|    442|    } else { \
  |  | 9802|    305|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 304]
  |  |  ------------------
  |  | 9803|    305|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    305|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 90, False: 215]
  |  |  ------------------
  ------------------
10142|    747|                            }
10143|  22.2k|                        }
10144|  1.25M|                    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10144:32): [True: 58.5k, False: 1.19M]
  ------------------
10145|  58.5k|                        if (cur->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10145:29): [True: 58.5k, False: 0]
  ------------------
10146|  58.5k|			{
10147|  58.5k|			    XP_TEST_HIT_NS
  ------------------
  |  | 9807|  58.5k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 1.24k, False: 57.3k]
  |  |  ------------------
  |  | 9808|  1.24k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 845, False: 399]
  |  |  ------------------
  |  | 9809|    845|	    hasNsNodes = 1; \
  |  | 9810|    845|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 6, False: 839]
  |  |  ------------------
  |  | 9811|    845|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|    845|	goto axis_range_end; } \
  |  | 9813|  57.3k|    } else { \
  |  | 9814|  57.3k|	hasNsNodes = 1; \
  |  | 9815|  57.3k|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 26, False: 57.3k]
  |  |  ------------------
  |  | 9816|  57.3k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|  57.3k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 57.3k]
  |  |  ------------------
  ------------------
10148|  58.5k|                        }
10149|  1.19M|                    } else {
10150|  1.19M|                        if (cur->type == XML_ELEMENT_NODE) {
  ------------------
  |  Branch (10150:29): [True: 1.08M, False: 104k]
  ------------------
10151|  1.08M|                            if (prefix == NULL)
  ------------------
  |  Branch (10151:33): [True: 1.08M, False: 9.40k]
  ------------------
10152|  1.08M|			    {
10153|  1.08M|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.08M|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 23.5k, False: 1.05M]
  |  |  ------------------
  |  | 9797|  23.5k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 6.00k, False: 17.5k]
  |  |  ------------------
  |  | 9798|  6.00k|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 6.00k]
  |  |  ------------------
  |  | 9799|  6.00k|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|  6.00k|	    goto axis_range_end; } \
  |  | 9801|  1.05M|    } else { \
  |  | 9802|  1.05M|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 41, False: 1.05M]
  |  |  ------------------
  |  | 9803|  1.05M|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|  1.05M|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 30.7k, False: 1.02M]
  |  |  ------------------
  ------------------
10154|       |
10155|  1.08M|                            } else if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10155:40): [True: 1.66k, False: 7.74k]
  ------------------
10156|  1.66k|				(xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10156:5): [True: 1.01k, False: 651]
  ------------------
10157|  1.01k|			    {
10158|  1.01k|				XP_TEST_HIT
  ------------------
  |  | 9796|  1.01k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 384, False: 628]
  |  |  ------------------
  |  | 9797|    384|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 76, False: 308]
  |  |  ------------------
  |  | 9798|     76|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 2, False: 74]
  |  |  ------------------
  |  | 9799|     76|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|     76|	    goto axis_range_end; } \
  |  | 9801|    628|    } else { \
  |  | 9802|    628|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 2, False: 626]
  |  |  ------------------
  |  | 9803|    628|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    628|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 384, False: 244]
  |  |  ------------------
  ------------------
10159|  1.01k|                            }
10160|  1.08M|                        }
10161|  1.19M|                    }
10162|  1.22M|                    break;
10163|  1.22M|                case NODE_TEST_NS:{
  ------------------
  |  Branch (10163:17): [True: 0, False: 7.25M]
  ------------------
10164|       |                        /* TODO */
10165|      0|                        break;
10166|  1.27M|                    }
10167|  1.70M|                case NODE_TEST_NAME:
  ------------------
  |  Branch (10167:17): [True: 1.70M, False: 5.54M]
  ------------------
10168|  1.70M|                    if (axis == AXIS_ATTRIBUTE) {
  ------------------
  |  Branch (10168:25): [True: 4.06k, False: 1.70M]
  ------------------
10169|  4.06k|                        if (cur->type != XML_ATTRIBUTE_NODE)
  ------------------
  |  Branch (10169:29): [True: 0, False: 4.06k]
  ------------------
10170|      0|			    break;
10171|  1.70M|		    } else if (axis == AXIS_NAMESPACE) {
  ------------------
  |  Branch (10171:18): [True: 3.22k, False: 1.70M]
  ------------------
10172|  3.22k|                        if (cur->type != XML_NAMESPACE_DECL)
  ------------------
  |  Branch (10172:29): [True: 0, False: 3.22k]
  ------------------
10173|      0|			    break;
10174|  1.70M|		    } else {
10175|  1.70M|		        if (cur->type != XML_ELEMENT_NODE)
  ------------------
  |  Branch (10175:15): [True: 213k, False: 1.48M]
  ------------------
10176|   213k|			    break;
10177|  1.70M|		    }
10178|  1.49M|                    switch (cur->type) {
10179|  1.48M|                        case XML_ELEMENT_NODE:
  ------------------
  |  Branch (10179:25): [True: 1.48M, False: 7.28k]
  ------------------
10180|  1.48M|                            if (xmlStrEqual(name, cur->name)) {
  ------------------
  |  Branch (10180:33): [True: 348k, False: 1.14M]
  ------------------
10181|   348k|                                if (prefix == NULL) {
  ------------------
  |  Branch (10181:37): [True: 344k, False: 3.41k]
  ------------------
10182|   344k|                                    if (cur->ns == NULL)
  ------------------
  |  Branch (10182:41): [True: 344k, False: 511]
  ------------------
10183|   344k|				    {
10184|   344k|					XP_TEST_HIT
  ------------------
  |  | 9796|   344k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 37.1k, False: 307k]
  |  |  ------------------
  |  | 9797|  37.1k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 7.73k, False: 29.3k]
  |  |  ------------------
  |  | 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|   307k|    } else { \
  |  | 9802|   307k|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 11, False: 307k]
  |  |  ------------------
  |  | 9803|   307k|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|   307k|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 234, False: 307k]
  |  |  ------------------
  ------------------
10185|   344k|                                    }
10186|   344k|                                } else {
10187|  3.41k|                                    if ((cur->ns != NULL) &&
  ------------------
  |  Branch (10187:41): [True: 331, False: 3.08k]
  ------------------
10188|    331|                                        (xmlStrEqual(URI, cur->ns->href)))
  ------------------
  |  Branch (10188:41): [True: 77, False: 254]
  ------------------
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|   348k|                            }
10194|  1.48M|                            break;
10195|  1.48M|                        case XML_ATTRIBUTE_NODE:{
  ------------------
  |  Branch (10195:25): [True: 4.06k, False: 1.49M]
  ------------------
10196|  4.06k|                                xmlAttrPtr attr = (xmlAttrPtr) cur;
10197|       |
10198|  4.06k|                                if (xmlStrEqual(name, attr->name)) {
  ------------------
  |  Branch (10198:37): [True: 2.82k, False: 1.23k]
  ------------------
10199|  2.82k|                                    if (prefix == NULL) {
  ------------------
  |  Branch (10199:41): [True: 2.60k, False: 224]
  ------------------
10200|  2.60k|                                        if ((attr->ns == NULL) ||
  ------------------
  |  Branch (10200:45): [True: 2.53k, False: 70]
  ------------------
10201|     70|                                            (attr->ns->prefix == NULL))
  ------------------
  |  Branch (10201:45): [True: 0, False: 70]
  ------------------
10202|  2.53k|					{
10203|  2.53k|					    XP_TEST_HIT
  ------------------
  |  | 9796|  2.53k|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9796:9): [True: 1.85k, False: 684]
  |  |  ------------------
  |  | 9797|  1.85k|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9797:6): [True: 756, False: 1.09k]
  |  |  ------------------
  |  | 9798|    756|	    if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9798:10): [True: 1, False: 755]
  |  |  ------------------
  |  | 9799|    756|	        xmlXPathPErrMemory(ctxt); \
  |  | 9800|    756|	    goto axis_range_end; } \
  |  | 9801|  1.85k|    } else { \
  |  | 9802|    684|	if (addNode(seq, cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9802:6): [True: 1, False: 683]
  |  |  ------------------
  |  | 9803|    684|	    xmlXPathPErrMemory(ctxt); \
  |  | 9804|    684|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9804:6): [True: 74, False: 610]
  |  |  ------------------
  ------------------
10204|  2.53k|                                        }
10205|  2.60k|                                    } 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|  2.82k|                                }
10214|  3.23k|                                break;
10215|  4.06k|                            }
10216|  3.23k|                        case XML_NAMESPACE_DECL:
  ------------------
  |  Branch (10216:25): [True: 3.22k, False: 1.49M]
  ------------------
10217|  3.22k|                            if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (10217:33): [True: 3.22k, False: 0]
  ------------------
10218|  3.22k|                                xmlNsPtr ns = (xmlNsPtr) cur;
10219|       |
10220|  3.22k|                                if ((ns->prefix != NULL) && (name != NULL)
  ------------------
  |  Branch (10220:37): [True: 2.31k, False: 909]
  |  Branch (10220:61): [True: 2.31k, False: 0]
  ------------------
10221|  2.31k|                                    && (xmlStrEqual(ns->prefix, name)))
  ------------------
  |  Branch (10221:40): [True: 731, False: 1.58k]
  ------------------
10222|    731|				{
10223|    731|				    XP_TEST_HIT_NS
  ------------------
  |  | 9807|    731|    if (hasAxisRange != 0) { \
  |  |  ------------------
  |  |  |  Branch (9807:9): [True: 159, False: 572]
  |  |  ------------------
  |  | 9808|    159|	if (++pos == maxPos) { \
  |  |  ------------------
  |  |  |  Branch (9808:6): [True: 89, False: 70]
  |  |  ------------------
  |  | 9809|     89|	    hasNsNodes = 1; \
  |  | 9810|     89|	    if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9810:10): [True: 2, False: 87]
  |  |  ------------------
  |  | 9811|     89|	        xmlXPathPErrMemory(ctxt); \
  |  | 9812|     89|	goto axis_range_end; } \
  |  | 9813|    572|    } else { \
  |  | 9814|    572|	hasNsNodes = 1; \
  |  | 9815|    572|	if (xmlXPathNodeSetAddNs(seq, xpctxt->node, (xmlNsPtr) cur) < 0) \
  |  |  ------------------
  |  |  |  Branch (9815:6): [True: 7, False: 565]
  |  |  ------------------
  |  | 9816|    572|	    xmlXPathPErrMemory(ctxt); \
  |  | 9817|    572|	if (breakOnFirstHit) goto first_hit; }
  |  |  ------------------
  |  |  |  Branch (9817:6): [True: 0, False: 572]
  |  |  ------------------
  ------------------
10224|    731|                                }
10225|  3.22k|                            }
10226|  3.13k|                            break;
10227|  3.13k|                        default:
  ------------------
  |  Branch (10227:25): [True: 0, False: 1.49M]
  ------------------
10228|      0|                            break;
10229|  1.49M|                    }
10230|  1.48M|                    break;
10231|  7.25M|	    } /* switch(test) */
10232|  7.25M|        } while ((cur != NULL) && (ctxt->error == XPATH_EXPRESSION_OK));
  ------------------
  |  Branch (10232:18): [True: 7.18M, False: 0]
  |  Branch (10232:35): [True: 7.18M, False: 194]
  ------------------
10233|       |
10234|  2.24M|	goto apply_predicates;
10235|       |
10236|  2.24M|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.8k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10243:6): [True: 14.5k, False: 7.35k]
  ------------------
10244|  14.5k|	    outSeq = seq;
10245|  14.5k|	    seq = NULL;
10246|  14.5k|	} else {
10247|  7.35k|	    outSeq = mergeAndClear(outSeq, seq);
10248|  7.35k|            if (outSeq == NULL)
  ------------------
  |  Branch (10248:17): [True: 4, False: 7.34k]
  ------------------
10249|      4|                xmlXPathPErrMemory(ctxt);
10250|  7.35k|        }
10251|       |	/*
10252|       |	* Break if only a true/false result was requested.
10253|       |	*/
10254|  21.8k|	if (toBool)
  ------------------
  |  Branch (10254:6): [True: 13.6k, False: 8.22k]
  ------------------
10255|  13.6k|	    break;
10256|  8.22k|	continue;
10257|       |
10258|  45.5k|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|  45.5k|	if (outSeq == NULL) {
  ------------------
  |  Branch (10263:6): [True: 45.5k, False: 0]
  ------------------
10264|  45.5k|	    outSeq = seq;
10265|  45.5k|	    seq = NULL;
10266|  45.5k|	} 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|  45.5k|	break;
10272|       |
10273|  2.24M|apply_predicates: /* --------------------------------------------------- */
10274|  2.24M|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10274:13): [True: 201, False: 2.24M]
  ------------------
10275|    201|	    goto error;
10276|       |
10277|       |        /*
10278|       |	* Apply predicates.
10279|       |	*/
10280|  2.24M|        if ((predOp != NULL) && (seq->nodeNr > 0)) {
  ------------------
  |  Branch (10280:13): [True: 667k, False: 1.57M]
  |  Branch (10280:33): [True: 154k, False: 512k]
  ------------------
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|   154k|	    if (hasPredicateRange != 0)
  ------------------
  |  Branch (10309:10): [True: 10.4k, False: 144k]
  ------------------
10310|  10.4k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, maxPos, maxPos,
10311|  10.4k|					    hasNsNodes);
10312|   144k|	    else
10313|   144k|		xmlXPathCompOpEvalPredicate(ctxt, predOp, seq, 1, seq->nodeNr,
10314|   144k|					    hasNsNodes);
10315|       |
10316|   154k|	    if (ctxt->error != XPATH_EXPRESSION_OK) {
  ------------------
  |  Branch (10316:10): [True: 1.82k, False: 153k]
  ------------------
10317|  1.82k|		total = 0;
10318|  1.82k|		goto error;
10319|  1.82k|	    }
10320|   154k|        }
10321|       |
10322|  2.24M|        if (seq->nodeNr > 0) {
  ------------------
  |  Branch (10322:13): [True: 558k, False: 1.68M]
  ------------------
10323|       |	    /*
10324|       |	    * Add to result set.
10325|       |	    */
10326|   558k|	    if (outSeq == NULL) {
  ------------------
  |  Branch (10326:10): [True: 248k, False: 309k]
  ------------------
10327|   248k|		outSeq = seq;
10328|   248k|		seq = NULL;
10329|   309k|	    } else {
10330|   309k|		outSeq = mergeAndClear(outSeq, seq);
10331|   309k|                if (outSeq == NULL)
  ------------------
  |  Branch (10331:21): [True: 104, False: 309k]
  ------------------
10332|    104|                    xmlXPathPErrMemory(ctxt);
10333|   309k|	    }
10334|       |
10335|   558k|            if (toBool)
  ------------------
  |  Branch (10335:17): [True: 10.9k, False: 547k]
  ------------------
10336|  10.9k|                break;
10337|   558k|	}
10338|  2.24M|    }
10339|       |
10340|  1.07M|error:
10341|  1.07M|    if ((obj->boolval) && (obj->user != NULL)) {
  ------------------
  |  Branch (10341:9): [True: 0, False: 1.07M]
  |  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.07M|    xmlXPathReleaseObject(xpctxt, obj);
10353|       |
10354|       |    /*
10355|       |    * Ensure we return at least an empty set.
10356|       |    */
10357|  1.07M|    if (outSeq == NULL) {
  ------------------
  |  Branch (10357:9): [True: 767k, False: 308k]
  ------------------
10358|   767k|	if ((seq != NULL) && (seq->nodeNr == 0)) {
  ------------------
  |  Branch (10358:6): [True: 767k, False: 122]
  |  Branch (10358:23): [True: 766k, False: 128]
  ------------------
10359|   766k|	    outSeq = seq;
10360|   766k|        } else {
10361|    250|	    outSeq = xmlXPathNodeSetCreate(NULL);
10362|    250|            if (outSeq == NULL)
  ------------------
  |  Branch (10362:17): [True: 1, False: 249]
  ------------------
10363|      1|                xmlXPathPErrMemory(ctxt);
10364|    250|        }
10365|   767k|    }
10366|  1.07M|    if ((seq != NULL) && (seq != outSeq)) {
  ------------------
  |  Branch (10366:9): [True: 784k, False: 290k]
  |  Branch (10366:26): [True: 17.9k, False: 766k]
  ------------------
10367|  17.9k|	 xmlXPathFreeNodeSet(seq);
10368|  17.9k|    }
10369|       |    /*
10370|       |    * Hand over the result. Better to push the set also in
10371|       |    * case of errors.
10372|       |    */
10373|  1.07M|    xmlXPathValuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt, outSeq));
10374|       |    /*
10375|       |    * Reset the context node.
10376|       |    */
10377|  1.07M|    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.07M|    if (xpctxt->tmpNsList != NULL) {
  ------------------
  |  Branch (10382:9): [True: 140, False: 1.07M]
  ------------------
10383|    140|        xmlFree(xpctxt->tmpNsList);
10384|    140|        xpctxt->tmpNsList = NULL;
10385|    140|    }
10386|       |
10387|  1.07M|    return(total);
10388|  1.07M|}
xpath.c:xmlXPathNodeSetMergeAndClear:
 2958|   183k|{
 2959|   183k|    {
 2960|   183k|	int i, j, initNbSet1;
 2961|   183k|	xmlNodePtr n1, n2;
 2962|       |
 2963|   183k|	initNbSet1 = set1->nodeNr;
 2964|   505k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (2964:13): [True: 321k, False: 183k]
  ------------------
 2965|   321k|	    n2 = set2->nodeTab[i];
 2966|       |	    /*
 2967|       |	    * Skip duplicates.
 2968|       |	    */
 2969|  74.6M|	    for (j = 0; j < initNbSet1; j++) {
  ------------------
  |  Branch (2969:18): [True: 74.5M, False: 96.8k]
  ------------------
 2970|  74.5M|		n1 = set1->nodeTab[j];
 2971|  74.5M|		if (n1 == n2) {
  ------------------
  |  Branch (2971:7): [True: 225k, False: 74.3M]
  ------------------
 2972|   225k|		    goto skip_node;
 2973|  74.3M|		} else if ((n1->type == XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (2973:14): [True: 154k, False: 74.1M]
  ------------------
 2974|   154k|		    (n2->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (2974:7): [True: 154k, False: 0]
  ------------------
 2975|   154k|		{
 2976|   154k|		    if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
  ------------------
  |  Branch (2976:11): [True: 3.70k, False: 150k]
  ------------------
 2977|  3.70k|			(xmlStrEqual(((xmlNsPtr) n1)->prefix,
  ------------------
  |  Branch (2977:4): [True: 0, False: 3.70k]
  ------------------
 2978|  3.70k|			((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|   154k|		}
 2987|  74.5M|	    }
 2988|       |	    /*
 2989|       |	    * grow the nodeTab if needed
 2990|       |	    */
 2991|  96.8k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (2991:17): [True: 14.9k, False: 81.8k]
  ------------------
 2992|  14.9k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (2992:21): [True: 43, False: 14.9k]
  ------------------
 2993|     43|                    goto error;
 2994|  14.9k|            }
 2995|  96.7k|	    set1->nodeTab[set1->nodeNr++] = n2;
 2996|   321k|skip_node:
 2997|   321k|            set2->nodeTab[i] = NULL;
 2998|   321k|	}
 2999|   183k|    }
 3000|   183k|    set2->nodeNr = 0;
 3001|   183k|    return(set1);
 3002|       |
 3003|     43|error:
 3004|     43|    xmlXPathFreeNodeSet(set1);
 3005|     43|    xmlXPathNodeSetClear(set2, 1);
 3006|       |    return(NULL);
 3007|   183k|}
xpath.c:xmlXPathNodeSetClear:
 3154|  2.23k|{
 3155|  2.23k|    xmlXPathNodeSetClearFromPos(set, 0, hasNsNodes);
 3156|  2.23k|}
xpath.c:xmlXPathNodeSetClearFromPos:
 3127|  2.36k|{
 3128|  2.36k|    if ((set == NULL) || (pos >= set->nodeNr))
  ------------------
  |  Branch (3128:9): [True: 0, False: 2.36k]
  |  Branch (3128:26): [True: 0, False: 2.36k]
  ------------------
 3129|      0|	return;
 3130|  2.36k|    else if ((hasNsNodes)) {
  ------------------
  |  Branch (3130:14): [True: 245, False: 2.12k]
  ------------------
 3131|    245|	int i;
 3132|    245|	xmlNodePtr node;
 3133|       |
 3134|  2.69k|	for (i = pos; i < set->nodeNr; i++) {
  ------------------
  |  Branch (3134:16): [True: 2.44k, False: 245]
  ------------------
 3135|  2.44k|	    node = set->nodeTab[i];
 3136|  2.44k|	    if ((node != NULL) &&
  ------------------
  |  Branch (3136:10): [True: 1.75k, False: 694]
  ------------------
 3137|  1.75k|		(node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3137:3): [True: 63, False: 1.69k]
  ------------------
 3138|     63|		xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3139|  2.44k|	}
 3140|    245|    }
 3141|  2.36k|    set->nodeNr = pos;
 3142|  2.36k|}
xpath.c:xmlXPathNodeSetMergeAndClearNoDupls:
 3021|   133k|{
 3022|   133k|    {
 3023|   133k|	int i;
 3024|   133k|	xmlNodePtr n2;
 3025|       |
 3026|   409k|	for (i = 0;i < set2->nodeNr;i++) {
  ------------------
  |  Branch (3026:13): [True: 276k, False: 133k]
  ------------------
 3027|   276k|	    n2 = set2->nodeTab[i];
 3028|   276k|            if (set1->nodeNr >= set1->nodeMax) {
  ------------------
  |  Branch (3028:17): [True: 43.1k, False: 232k]
  ------------------
 3029|  43.1k|                if (xmlXPathNodeSetGrow(set1) < 0)
  ------------------
  |  Branch (3029:21): [True: 65, False: 43.1k]
  ------------------
 3030|     65|                    goto error;
 3031|  43.1k|            }
 3032|   276k|	    set1->nodeTab[set1->nodeNr++] = n2;
 3033|   276k|            set2->nodeTab[i] = NULL;
 3034|   276k|	}
 3035|   133k|    }
 3036|   133k|    set2->nodeNr = 0;
 3037|   133k|    return(set1);
 3038|       |
 3039|     65|error:
 3040|     65|    xmlXPathFreeNodeSet(set1);
 3041|     65|    xmlXPathNodeSetClear(set2, 1);
 3042|       |    return(NULL);
 3043|   133k|}
xpath.c:xmlXPathNextChildElement:
 6200|  2.93M|xmlXPathNextChildElement(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
 6201|  2.93M|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6201:9): [True: 0, False: 2.93M]
  |  Branch (6201:27): [True: 0, False: 2.93M]
  ------------------
 6202|  2.93M|    if (cur == NULL) {
  ------------------
  |  Branch (6202:9): [True: 1.45M, False: 1.47M]
  ------------------
 6203|  1.45M|	cur = ctxt->context->node;
 6204|  1.45M|	if (cur == NULL) return(NULL);
  ------------------
  |  Branch (6204:6): [True: 0, False: 1.45M]
  ------------------
 6205|       |	/*
 6206|       |	* Get the first element child.
 6207|       |	*/
 6208|  1.45M|	switch (cur->type) {
 6209|  1.12M|            case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6209:13): [True: 1.12M, False: 332k]
  ------------------
 6210|  1.12M|	    case XML_DOCUMENT_FRAG_NODE:
  ------------------
  |  Branch (6210:6): [True: 0, False: 1.45M]
  ------------------
 6211|  1.12M|	    case XML_ENTITY_REF_NODE: /* URGENT TODO: entify-refs as well? */
  ------------------
  |  Branch (6211:6): [True: 0, False: 1.45M]
  ------------------
 6212|  1.12M|            case XML_ENTITY_NODE:
  ------------------
  |  Branch (6212:13): [True: 0, False: 1.45M]
  ------------------
 6213|  1.12M|		cur = cur->children;
 6214|  1.12M|		if (cur != NULL) {
  ------------------
  |  Branch (6214:7): [True: 419k, False: 703k]
  ------------------
 6215|   419k|		    if (cur->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6215:11): [True: 216k, False: 202k]
  ------------------
 6216|   216k|			return(cur);
 6217|   212k|		    do {
 6218|   212k|			cur = cur->next;
 6219|   212k|		    } while ((cur != NULL) &&
  ------------------
  |  Branch (6219:16): [True: 126k, False: 85.8k]
  ------------------
 6220|   126k|			(cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6220:4): [True: 9.44k, False: 116k]
  ------------------
 6221|   202k|		    return(cur);
 6222|   419k|		}
 6223|   703k|		return(NULL);
 6224|   212k|            case XML_DOCUMENT_NODE:
  ------------------
  |  Branch (6224:13): [True: 212k, False: 1.24M]
  ------------------
 6225|   212k|            case XML_HTML_DOCUMENT_NODE:
  ------------------
  |  Branch (6225:13): [True: 0, False: 1.45M]
  ------------------
 6226|   212k|		return(xmlDocGetRootElement((xmlDocPtr) cur));
 6227|   120k|	    default:
  ------------------
  |  Branch (6227:6): [True: 120k, False: 1.33M]
  ------------------
 6228|   120k|		return(NULL);
 6229|  1.45M|	}
 6230|      0|	return(NULL);
 6231|  1.45M|    }
 6232|       |    /*
 6233|       |    * Get the next sibling element node.
 6234|       |    */
 6235|  1.47M|    switch (cur->type) {
 6236|  1.47M|	case XML_ELEMENT_NODE:
  ------------------
  |  Branch (6236:2): [True: 1.47M, False: 0]
  ------------------
 6237|  1.47M|	case XML_TEXT_NODE:
  ------------------
  |  Branch (6237:2): [True: 0, False: 1.47M]
  ------------------
 6238|  1.47M|	case XML_ENTITY_REF_NODE:
  ------------------
  |  Branch (6238:2): [True: 0, False: 1.47M]
  ------------------
 6239|  1.47M|	case XML_ENTITY_NODE:
  ------------------
  |  Branch (6239:2): [True: 0, False: 1.47M]
  ------------------
 6240|  1.47M|	case XML_CDATA_SECTION_NODE:
  ------------------
  |  Branch (6240:2): [True: 0, False: 1.47M]
  ------------------
 6241|  1.47M|	case XML_PI_NODE:
  ------------------
  |  Branch (6241:2): [True: 0, False: 1.47M]
  ------------------
 6242|  1.47M|	case XML_COMMENT_NODE:
  ------------------
  |  Branch (6242:2): [True: 0, False: 1.47M]
  ------------------
 6243|  1.47M|	case XML_XINCLUDE_END:
  ------------------
  |  Branch (6243:2): [True: 0, False: 1.47M]
  ------------------
 6244|  1.47M|	    break;
 6245|       |	/* case XML_DTD_NODE: */ /* URGENT TODO: DTD-node as well? */
 6246|      0|	default:
  ------------------
  |  Branch (6246:2): [True: 0, False: 1.47M]
  ------------------
 6247|      0|	    return(NULL);
 6248|  1.47M|    }
 6249|  1.47M|    if (cur->next != NULL) {
  ------------------
  |  Branch (6249:9): [True: 1.04M, False: 435k]
  ------------------
 6250|  1.04M|	if (cur->next->type == XML_ELEMENT_NODE)
  ------------------
  |  Branch (6250:6): [True: 890k, False: 151k]
  ------------------
 6251|   890k|	    return(cur->next);
 6252|   151k|	cur = cur->next;
 6253|   158k|	do {
 6254|   158k|	    cur = cur->next;
 6255|   158k|	} while ((cur != NULL) && (cur->type != XML_ELEMENT_NODE));
  ------------------
  |  Branch (6255:11): [True: 63.5k, False: 94.9k]
  |  Branch (6255:28): [True: 6.55k, False: 56.9k]
  ------------------
 6256|   151k|	return(cur);
 6257|  1.04M|    }
 6258|   435k|    return(NULL);
 6259|  1.47M|}
xpath.c:xmlXPathNextPrecedingInternal:
 6756|  67.4k|{
 6757|  67.4k|    if ((ctxt == NULL) || (ctxt->context == NULL)) return(NULL);
  ------------------
  |  Branch (6757:9): [True: 0, False: 67.4k]
  |  Branch (6757:27): [True: 0, False: 67.4k]
  ------------------
 6758|  67.4k|    if (cur == NULL) {
  ------------------
  |  Branch (6758:9): [True: 2.34k, False: 65.0k]
  ------------------
 6759|  2.34k|        cur = ctxt->context->node;
 6760|  2.34k|        if (cur == NULL)
  ------------------
  |  Branch (6760:13): [True: 0, False: 2.34k]
  ------------------
 6761|      0|            return (NULL);
 6762|  2.34k|        if (cur->type == XML_ATTRIBUTE_NODE) {
  ------------------
  |  Branch (6762:13): [True: 0, False: 2.34k]
  ------------------
 6763|      0|            cur = cur->parent;
 6764|  2.34k|        } else if (cur->type == XML_NAMESPACE_DECL) {
  ------------------
  |  Branch (6764:20): [True: 0, False: 2.34k]
  ------------------
 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|  2.34k|        ctxt->ancestor = cur->parent;
 6773|  2.34k|    }
 6774|       |
 6775|  67.4k|    if (cur->type == XML_NAMESPACE_DECL || cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6775:9): [True: 0, False: 67.4k]
  |  Branch (6775:44): [True: 59, False: 67.3k]
  ------------------
 6776|     59|        return(NULL);
 6777|       |
 6778|  67.3k|    if ((cur->prev != NULL) && (cur->prev->type == XML_DTD_NODE))
  ------------------
  |  Branch (6778:9): [True: 25.0k, False: 42.3k]
  |  Branch (6778:32): [True: 959, False: 24.0k]
  ------------------
 6779|    959|	cur = cur->prev;
 6780|       |
 6781|   172k|    while (cur->prev == NULL) {
  ------------------
  |  Branch (6781:12): [True: 142k, False: 29.4k]
  ------------------
 6782|   142k|        cur = cur->parent;
 6783|   142k|        if (cur == NULL)
  ------------------
  |  Branch (6783:13): [True: 1.21k, False: 141k]
  ------------------
 6784|  1.21k|            return (NULL);
 6785|   141k|        if (cur == ctxt->context->doc->children)
  ------------------
  |  Branch (6785:13): [True: 1.07k, False: 140k]
  ------------------
 6786|  1.07k|            return (NULL);
 6787|   140k|        if (cur != ctxt->ancestor)
  ------------------
  |  Branch (6787:13): [True: 35.5k, False: 104k]
  ------------------
 6788|  35.5k|            return (cur);
 6789|   104k|        ctxt->ancestor = cur->parent;
 6790|   104k|    }
 6791|       |
 6792|  29.4k|    if (cur->type == XML_DOCUMENT_NODE)
  ------------------
  |  Branch (6792:9): [True: 0, False: 29.4k]
  ------------------
 6793|      0|        return(NULL);
 6794|       |
 6795|  29.4k|    cur = cur->prev;
 6796|  65.0k|    while (cur->last != NULL)
  ------------------
  |  Branch (6796:12): [True: 35.5k, False: 29.4k]
  ------------------
 6797|  35.5k|        cur = cur->last;
 6798|  29.4k|    return (cur);
 6799|  29.4k|}
xpath.c:xmlXPathIsPositionalPredicate:
 9736|   126k|{
 9737|       |
 9738|   126k|    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|   126k|    if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
  ------------------
  |  Branch (9753:9): [True: 0, False: 126k]
  |  Branch (9753:43): [True: 0, False: 0]
  ------------------
 9754|      0|	return(0);
 9755|       |
 9756|   126k|    if (op->ch2 != -1) {
  ------------------
  |  Branch (9756:9): [True: 126k, False: 0]
  ------------------
 9757|   126k|	exprOp = &ctxt->comp->steps[op->ch2];
 9758|   126k|    } else
 9759|      0|	return(0);
 9760|       |
 9761|   126k|    if ((exprOp != NULL) &&
  ------------------
  |  Branch (9761:9): [True: 126k, False: 0]
  ------------------
 9762|   126k|	(exprOp->op == XPATH_OP_VALUE) &&
  ------------------
  |  Branch (9762:2): [True: 63.1k, False: 63.3k]
  ------------------
 9763|  63.1k|	(exprOp->value4 != NULL) &&
  ------------------
  |  Branch (9763:2): [True: 63.1k, False: 0]
  ------------------
 9764|  63.1k|	(((xmlXPathObjectPtr) exprOp->value4)->type == XPATH_NUMBER))
  ------------------
  |  Branch (9764:2): [True: 62.6k, False: 529]
  ------------------
 9765|  62.6k|    {
 9766|  62.6k|        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|  62.6k|        if ((floatval > INT_MIN) && (floatval < INT_MAX)) {
  ------------------
  |  Branch (9779:13): [True: 62.3k, False: 238]
  |  Branch (9779:37): [True: 60.2k, False: 2.17k]
  ------------------
 9780|  60.2k|	    *maxPos = (int) floatval;
 9781|  60.2k|            if (floatval == (double) *maxPos)
  ------------------
  |  Branch (9781:17): [True: 57.7k, False: 2.42k]
  ------------------
 9782|  57.7k|                return(1);
 9783|  60.2k|        }
 9784|  62.6k|    }
 9785|  68.6k|    return(0);
 9786|   126k|}
xpath.c:xmlXPathCompOpEvalPredicate:
 9710|   156k|{
 9711|   156k|    if (op->ch1 != -1) {
  ------------------
  |  Branch (9711:9): [True: 1.34k, False: 154k]
  ------------------
 9712|  1.34k|	xmlXPathCompExprPtr comp = ctxt->comp;
 9713|       |	/*
 9714|       |	* Process inner predicates first.
 9715|       |	*/
 9716|  1.34k|	if (comp->steps[op->ch1].op != XPATH_OP_PREDICATE) {
  ------------------
  |  Branch (9716:6): [True: 0, False: 1.34k]
  ------------------
 9717|      0|            XP_ERROR(XPATH_INVALID_OPERAND);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9718|      0|	}
 9719|  1.34k|        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  1.34k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (9719:13): [True: 0, False: 1.34k]
  ------------------
 9720|  1.34k|            XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
 9721|  1.34k|        ctxt->context->depth += 1;
 9722|  1.34k|	xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
 9723|  1.34k|                                    1, set->nodeNr, hasNsNodes);
 9724|  1.34k|        ctxt->context->depth -= 1;
 9725|  1.34k|	CHECK_ERROR;
  ------------------
  |  |  230|  1.34k|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 214, False: 1.12k]
  |  |  ------------------
  ------------------
 9726|  1.34k|    }
 9727|       |
 9728|   156k|    if (op->ch2 != -1)
  ------------------
  |  Branch (9728:9): [True: 156k, False: 0]
  ------------------
 9729|   156k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, minPos, maxPos, hasNsNodes);
 9730|   156k|}
xpath.c:xmlXPathNodeSetFilter:
 9577|   161k|{
 9578|   161k|    xmlXPathContextPtr xpctxt;
 9579|   161k|    xmlNodePtr oldnode;
 9580|   161k|    xmlDocPtr olddoc;
 9581|   161k|    xmlXPathStepOpPtr filterOp;
 9582|   161k|    int oldcs, oldpp;
 9583|   161k|    int i, j, pos;
 9584|       |
 9585|   161k|    if ((set == NULL) || (set->nodeNr == 0))
  ------------------
  |  Branch (9585:9): [True: 0, False: 161k]
  |  Branch (9585:26): [True: 2.64k, False: 159k]
  ------------------
 9586|  2.64k|        return;
 9587|       |
 9588|       |    /*
 9589|       |    * Check if the node set contains a sufficient number of nodes for
 9590|       |    * the requested range.
 9591|       |    */
 9592|   159k|    if (set->nodeNr < minPos) {
  ------------------
  |  Branch (9592:9): [True: 2.12k, False: 156k]
  ------------------
 9593|  2.12k|        xmlXPathNodeSetClear(set, hasNsNodes);
 9594|  2.12k|        return;
 9595|  2.12k|    }
 9596|       |
 9597|   156k|    xpctxt = ctxt->context;
 9598|   156k|    oldnode = xpctxt->node;
 9599|   156k|    olddoc = xpctxt->doc;
 9600|   156k|    oldcs = xpctxt->contextSize;
 9601|   156k|    oldpp = xpctxt->proximityPosition;
 9602|   156k|    filterOp = &ctxt->comp->steps[filterOpIndex];
 9603|       |
 9604|   156k|    xpctxt->contextSize = set->nodeNr;
 9605|       |
 9606|   595k|    for (i = 0, j = 0, pos = 1; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9606:33): [True: 508k, False: 86.9k]
  ------------------
 9607|   508k|        xmlNodePtr node = set->nodeTab[i];
 9608|   508k|        int res;
 9609|       |
 9610|   508k|        xpctxt->node = node;
 9611|   508k|        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|   508k|        if ((node->type != XML_NAMESPACE_DECL) &&
  ------------------
  |  Branch (9619:13): [True: 478k, False: 29.5k]
  ------------------
 9620|   478k|            (node->doc != NULL))
  ------------------
  |  Branch (9620:13): [True: 478k, False: 0]
  ------------------
 9621|   478k|            xpctxt->doc = node->doc;
 9622|       |
 9623|   508k|        res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 9624|       |
 9625|   508k|        if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (9625:13): [True: 1.85k, False: 506k]
  ------------------
 9626|  1.85k|            break;
 9627|   506k|        if (res < 0) {
  ------------------
  |  Branch (9627:13): [True: 0, False: 506k]
  ------------------
 9628|       |            /* Shouldn't happen */
 9629|      0|            xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
 9630|      0|            break;
 9631|      0|        }
 9632|       |
 9633|   506k|        if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
  ------------------
  |  Branch (9633:13): [True: 202k, False: 303k]
  |  Branch (9633:28): [True: 181k, False: 20.9k]
  |  Branch (9633:47): [True: 173k, False: 8.22k]
  ------------------
 9634|   173k|            if (i != j) {
  ------------------
  |  Branch (9634:17): [True: 6.01k, False: 167k]
  ------------------
 9635|  6.01k|                set->nodeTab[j] = node;
 9636|  6.01k|                set->nodeTab[i] = NULL;
 9637|  6.01k|            }
 9638|       |
 9639|   173k|            j += 1;
 9640|   332k|        } else {
 9641|       |            /* Remove the entry from the initial node set. */
 9642|   332k|            set->nodeTab[i] = NULL;
 9643|   332k|            if (node->type == XML_NAMESPACE_DECL)
  ------------------
  |  Branch (9643:17): [True: 9.62k, False: 323k]
  ------------------
 9644|  9.62k|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9645|   332k|        }
 9646|       |
 9647|   506k|        if (res != 0) {
  ------------------
  |  Branch (9647:13): [True: 202k, False: 303k]
  ------------------
 9648|   202k|            if (pos == maxPos) {
  ------------------
  |  Branch (9648:17): [True: 68.1k, False: 134k]
  ------------------
 9649|  68.1k|                i += 1;
 9650|  68.1k|                break;
 9651|  68.1k|            }
 9652|       |
 9653|   134k|            pos += 1;
 9654|   134k|        }
 9655|   506k|    }
 9656|       |
 9657|       |    /* Free remaining nodes. */
 9658|   156k|    if (hasNsNodes) {
  ------------------
  |  Branch (9658:9): [True: 16.7k, False: 140k]
  ------------------
 9659|  17.3k|        for (; i < set->nodeNr; i++) {
  ------------------
  |  Branch (9659:16): [True: 671, False: 16.7k]
  ------------------
 9660|    671|            xmlNodePtr node = set->nodeTab[i];
 9661|    671|            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (9661:17): [True: 671, False: 0]
  |  Branch (9661:35): [True: 32, False: 639]
  ------------------
 9662|     32|                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 9663|    671|        }
 9664|  16.7k|    }
 9665|       |
 9666|   156k|    set->nodeNr = j;
 9667|       |
 9668|       |    /* If too many elements were removed, shrink table to preserve memory. */
 9669|   156k|    if ((set->nodeMax > XML_NODESET_DEFAULT) &&
  ------------------
  |  | 2593|   156k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9669:9): [True: 14.5k, False: 142k]
  ------------------
 9670|  14.5k|        (set->nodeNr < set->nodeMax / 2)) {
  ------------------
  |  Branch (9670:9): [True: 9.63k, False: 4.89k]
  ------------------
 9671|  9.63k|        xmlNodePtr *tmp;
 9672|  9.63k|        int nodeMax = set->nodeNr;
 9673|       |
 9674|  9.63k|        if (nodeMax < XML_NODESET_DEFAULT)
  ------------------
  |  | 2593|  9.63k|#define XML_NODESET_DEFAULT	10
  ------------------
  |  Branch (9674:13): [True: 9.46k, False: 175]
  ------------------
 9675|  9.46k|            nodeMax = XML_NODESET_DEFAULT;
  ------------------
  |  | 2593|  9.46k|#define XML_NODESET_DEFAULT	10
  ------------------
 9676|  9.63k|        tmp = (xmlNodePtr *) xmlRealloc(set->nodeTab,
 9677|  9.63k|                nodeMax * sizeof(xmlNodePtr));
 9678|  9.63k|        if (tmp == NULL) {
  ------------------
  |  Branch (9678:13): [True: 1, False: 9.63k]
  ------------------
 9679|      1|            xmlXPathPErrMemory(ctxt);
 9680|  9.63k|        } else {
 9681|  9.63k|            set->nodeTab = tmp;
 9682|  9.63k|            set->nodeMax = nodeMax;
 9683|  9.63k|        }
 9684|  9.63k|    }
 9685|       |
 9686|   156k|    xpctxt->node = oldnode;
 9687|   156k|    xpctxt->doc = olddoc;
 9688|   156k|    xpctxt->contextSize = oldcs;
 9689|   156k|    xpctxt->proximityPosition = oldpp;
 9690|   156k|}
xpath.c:xmlXPathCompOpEval:
10750|  3.96M|{
10751|  3.96M|    int total = 0;
10752|  3.96M|    int equal, ret;
10753|  3.96M|    xmlXPathCompExprPtr comp;
10754|  3.96M|    xmlXPathObjectPtr arg1, arg2;
10755|       |
10756|  3.96M|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.96M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1, False: 3.96M]
  |  |  ------------------
  ------------------
10757|  3.96M|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  3.96M|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 3.96M, False: 0]
  |  |  |  Branch (818:39): [True: 45, False: 3.96M]
  |  |  ------------------
  ------------------
10758|     45|        return(0);
10759|  3.96M|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  3.96M|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10759:9): [True: 19, False: 3.96M]
  ------------------
10760|  3.96M|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|     19|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10761|  3.96M|    ctxt->context->depth += 1;
10762|  3.96M|    comp = ctxt->comp;
10763|  3.96M|    switch (op->op) {
10764|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10764:9): [True: 0, False: 3.96M]
  ------------------
10765|      0|            break;
10766|  2.09k|        case XPATH_OP_AND:
  ------------------
  |  Branch (10766:9): [True: 2.09k, False: 3.96M]
  ------------------
10767|  2.09k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10768|  2.09k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.09k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 275, False: 1.81k]
  |  |  ------------------
  ------------------
10769|  1.81k|            xmlXPathBooleanFunction(ctxt, 1);
10770|  1.81k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 0))
  ------------------
  |  Branch (10770:17): [True: 2, False: 1.81k]
  |  Branch (10770:42): [True: 1.11k, False: 704]
  ------------------
10771|  1.11k|                break;
10772|    704|            arg2 = xmlXPathValuePop(ctxt);
10773|    704|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10774|    704|	    if (ctxt->error) {
  ------------------
  |  Branch (10774:10): [True: 35, False: 669]
  ------------------
10775|     35|		xmlXPathFreeObject(arg2);
10776|     35|		break;
10777|     35|	    }
10778|    669|            xmlXPathBooleanFunction(ctxt, 1);
10779|    669|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10779:17): [True: 667, False: 2]
  ------------------
10780|    667|                ctxt->value->boolval &= arg2->boolval;
10781|    669|	    xmlXPathReleaseObject(ctxt->context, arg2);
10782|    669|            break;
10783|  3.66k|        case XPATH_OP_OR:
  ------------------
  |  Branch (10783:9): [True: 3.66k, False: 3.96M]
  ------------------
10784|  3.66k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10785|  3.66k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.66k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 647, False: 3.01k]
  |  |  ------------------
  ------------------
10786|  3.01k|            xmlXPathBooleanFunction(ctxt, 1);
10787|  3.01k|            if ((ctxt->value == NULL) || (ctxt->value->boolval == 1))
  ------------------
  |  Branch (10787:17): [True: 3, False: 3.01k]
  |  Branch (10787:42): [True: 677, False: 2.33k]
  ------------------
10788|    680|                break;
10789|  2.33k|            arg2 = xmlXPathValuePop(ctxt);
10790|  2.33k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10791|  2.33k|	    if (ctxt->error) {
  ------------------
  |  Branch (10791:10): [True: 111, False: 2.22k]
  ------------------
10792|    111|		xmlXPathFreeObject(arg2);
10793|    111|		break;
10794|    111|	    }
10795|  2.22k|            xmlXPathBooleanFunction(ctxt, 1);
10796|  2.22k|            if (ctxt->value != NULL)
  ------------------
  |  Branch (10796:17): [True: 2.22k, False: 1]
  ------------------
10797|  2.22k|                ctxt->value->boolval |= arg2->boolval;
10798|  2.22k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10799|  2.22k|            break;
10800|   408k|        case XPATH_OP_EQUAL:
  ------------------
  |  Branch (10800:9): [True: 408k, False: 3.56M]
  ------------------
10801|   408k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10802|   408k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   408k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 8.17k, False: 400k]
  |  |  ------------------
  ------------------
10803|   400k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10804|   400k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   400k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.64k, False: 398k]
  |  |  ------------------
  ------------------
10805|   398k|	    if (op->value)
  ------------------
  |  Branch (10805:10): [True: 392k, False: 6.44k]
  ------------------
10806|   392k|		equal = xmlXPathEqualValues(ctxt);
10807|  6.44k|	    else
10808|  6.44k|		equal = xmlXPathNotEqualValues(ctxt);
10809|   398k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, equal));
10810|   398k|            break;
10811|   180k|        case XPATH_OP_CMP:
  ------------------
  |  Branch (10811:9): [True: 180k, False: 3.78M]
  ------------------
10812|   180k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10813|   180k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   180k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.17k, False: 178k]
  |  |  ------------------
  ------------------
10814|   178k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10815|   178k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   178k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 943, False: 177k]
  |  |  ------------------
  ------------------
10816|   177k|            ret = xmlXPathCompareValues(ctxt, op->value, op->value2);
10817|   177k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewBoolean(ctxt, ret));
10818|   177k|            break;
10819|   272k|        case XPATH_OP_PLUS:
  ------------------
  |  Branch (10819:9): [True: 272k, False: 3.69M]
  ------------------
10820|   272k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10821|   272k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   272k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.69k, False: 267k]
  |  |  ------------------
  ------------------
10822|   267k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (10822:17): [True: 141k, False: 126k]
  ------------------
10823|   141k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10824|   141k|	    }
10825|   267k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   267k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.09k, False: 266k]
  |  |  ------------------
  ------------------
10826|   266k|            if (op->value == 0)
  ------------------
  |  Branch (10826:17): [True: 70.6k, False: 195k]
  ------------------
10827|  70.6k|                xmlXPathSubValues(ctxt);
10828|   195k|            else if (op->value == 1)
  ------------------
  |  Branch (10828:22): [True: 69.4k, False: 126k]
  ------------------
10829|  69.4k|                xmlXPathAddValues(ctxt);
10830|   126k|            else if (op->value == 2)
  ------------------
  |  Branch (10830:22): [True: 107k, False: 19.3k]
  ------------------
10831|   107k|                xmlXPathValueFlipSign(ctxt);
10832|  19.3k|            else if (op->value == 3) {
  ------------------
  |  Branch (10832:22): [True: 19.3k, False: 0]
  ------------------
10833|  19.3k|                CAST_TO_NUMBER;
  ------------------
  |  |  297|  19.3k|    if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER))	\
  |  |  ------------------
  |  |  |  Branch (297:9): [True: 19.3k, False: 0]
  |  |  |  Branch (297:34): [True: 16.9k, False: 2.35k]
  |  |  ------------------
  |  |  298|  19.3k|        xmlXPathNumberFunction(ctxt, 1);
  ------------------
10834|  19.3k|                CHECK_TYPE0(XPATH_NUMBER);
  ------------------
  |  |  271|  19.3k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 6, False: 19.3k]
  |  |  |  Branch (271:34): [True: 3, False: 19.3k]
  |  |  ------------------
  |  |  272|  19.3k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|      9|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10835|  19.3k|            }
10836|   266k|            break;
10837|   266k|        case XPATH_OP_MULT:
  ------------------
  |  Branch (10837:9): [True: 171k, False: 3.79M]
  ------------------
10838|   171k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10839|   171k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   171k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 8.12k, False: 162k]
  |  |  ------------------
  ------------------
10840|   162k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10841|   162k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   162k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 409, False: 162k]
  |  |  ------------------
  ------------------
10842|   162k|            if (op->value == 0)
  ------------------
  |  Branch (10842:17): [True: 157k, False: 4.99k]
  ------------------
10843|   157k|                xmlXPathMultValues(ctxt);
10844|  4.99k|            else if (op->value == 1)
  ------------------
  |  Branch (10844:22): [True: 3.56k, False: 1.43k]
  ------------------
10845|  3.56k|                xmlXPathDivValues(ctxt);
10846|  1.43k|            else if (op->value == 2)
  ------------------
  |  Branch (10846:22): [True: 1.43k, False: 0]
  ------------------
10847|  1.43k|                xmlXPathModValues(ctxt);
10848|   162k|            break;
10849|   127k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10849:9): [True: 127k, False: 3.84M]
  ------------------
10850|   127k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10851|   127k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   127k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 548, False: 127k]
  |  |  ------------------
  ------------------
10852|   127k|            total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10853|   127k|	    CHECK_ERROR0;
  ------------------
  |  |  236|   127k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 332, False: 127k]
  |  |  ------------------
  ------------------
10854|       |
10855|   127k|            arg2 = xmlXPathValuePop(ctxt);
10856|   127k|            arg1 = xmlXPathValuePop(ctxt);
10857|   127k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10857:17): [True: 0, False: 127k]
  |  Branch (10857:35): [True: 41, False: 126k]
  ------------------
10858|   126k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10858:17): [True: 0, False: 126k]
  |  Branch (10858:35): [True: 14, False: 126k]
  ------------------
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|   126k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10863:17): [True: 126k, False: 0]
  ------------------
10864|   126k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10864:19): [True: 126k, False: 0]
  ------------------
10865|   126k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10865:19): [True: 10, False: 126k]
  ------------------
10866|   126k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10867|   126k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10867:19): [True: 126k, False: 0]
  ------------------
10868|   126k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10868:19): [True: 2, False: 126k]
  ------------------
10869|   126k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10870|     12|	        xmlXPathReleaseObject(ctxt->context, arg1);
10871|     12|	        xmlXPathReleaseObject(ctxt->context, arg2);
10872|     12|                break;
10873|     12|            }
10874|       |
10875|   126k|	    if (((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10875:11): [True: 126k, False: 0]
  ------------------
10876|   126k|		 (arg2->nodesetval->nodeNr != 0)))
  ------------------
  |  Branch (10876:4): [True: 50.8k, False: 76.0k]
  ------------------
10877|  50.8k|	    {
10878|  50.8k|		arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10879|  50.8k|							arg2->nodesetval);
10880|  50.8k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10880:21): [True: 46, False: 50.8k]
  ------------------
10881|     46|                    xmlXPathPErrMemory(ctxt);
10882|  50.8k|	    }
10883|       |
10884|   126k|            xmlXPathValuePush(ctxt, arg1);
10885|   126k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10886|   126k|            break;
10887|   384k|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10887:9): [True: 384k, False: 3.58M]
  ------------------
10888|   384k|            xmlXPathRoot(ctxt);
10889|   384k|            break;
10890|   849k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10890:9): [True: 849k, False: 3.11M]
  ------------------
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.01M|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10900:9): [True: 1.01M, False: 2.95M]
  ------------------
10901|  1.01M|                if (op->ch1 == -1)
  ------------------
  |  Branch (10901:21): [True: 0, False: 1.01M]
  ------------------
10902|      0|                    break;
10903|       |
10904|  1.01M|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10905|  1.01M|		CHECK_ERROR0;
  ------------------
  |  |  236|  1.01M|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.48k, False: 1.01M]
  |  |  ------------------
  ------------------
10906|       |
10907|  1.01M|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, NULL, 0);
10908|  1.01M|                break;
10909|  1.01M|            }
10910|   312k|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10910:9): [True: 312k, False: 3.65M]
  ------------------
10911|   312k|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10912|   312k|            break;
10913|     58|        case XPATH_OP_VARIABLE:{
  ------------------
  |  Branch (10913:9): [True: 58, False: 3.96M]
  ------------------
10914|     58|		xmlXPathObjectPtr val;
10915|       |
10916|     58|                if (op->ch1 != -1)
  ------------------
  |  Branch (10916:21): [True: 0, False: 58]
  ------------------
10917|      0|                    total +=
10918|      0|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10919|     58|                if (op->value5 == NULL) {
  ------------------
  |  Branch (10919:21): [True: 41, False: 17]
  ------------------
10920|     41|		    val = xmlXPathVariableLookup(ctxt->context, op->value4);
10921|     41|		    if (val == NULL) {
  ------------------
  |  Branch (10921:11): [True: 41, False: 0]
  ------------------
10922|     41|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_VARIABLE_ERROR,
10923|     41|                                       "Undefined variable: %s\n", op->value4);
10924|     41|                        return 0;
10925|     41|                    }
10926|      0|                    xmlXPathValuePush(ctxt, val);
10927|     17|		} else {
10928|     17|                    const xmlChar *URI;
10929|       |
10930|     17|                    URI = xmlXPathNsLookup(ctxt->context, op->value5);
10931|     17|                    if (URI == NULL) {
  ------------------
  |  Branch (10931:25): [True: 6, False: 11]
  ------------------
10932|      6|                        xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10933|      6|                                       "Undefined namespace prefix: %s\n",
10934|      6|                                       op->value5);
10935|      6|                        return 0;
10936|      6|                    }
10937|     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|     58|            }
10949|  47.6k|        case XPATH_OP_FUNCTION:{
  ------------------
  |  Branch (10949:9): [True: 47.6k, False: 3.92M]
  ------------------
10950|  47.6k|                xmlXPathFunction func;
10951|  47.6k|                const xmlChar *oldFunc, *oldFuncURI;
10952|  47.6k|		int i;
10953|  47.6k|                int frame;
10954|       |
10955|  47.6k|                frame = ctxt->valueNr;
10956|  47.6k|                if (op->ch1 != -1) {
  ------------------
  |  Branch (10956:21): [True: 39.7k, False: 7.87k]
  ------------------
10957|  39.7k|                    total +=
10958|  39.7k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10959|  39.7k|                    if (ctxt->error != XPATH_EXPRESSION_OK)
  ------------------
  |  Branch (10959:25): [True: 1.04k, False: 38.7k]
  ------------------
10960|  1.04k|                        break;
10961|  39.7k|                }
10962|  46.5k|		if (ctxt->valueNr < frame + op->value)
  ------------------
  |  Branch (10962:7): [True: 0, False: 46.5k]
  ------------------
10963|  46.5k|		    XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10964|   128k|		for (i = 0; i < op->value; i++) {
  ------------------
  |  Branch (10964:15): [True: 82.1k, False: 46.5k]
  ------------------
10965|  82.1k|		    if (ctxt->valueTab[(ctxt->valueNr - 1) - i] == NULL)
  ------------------
  |  Branch (10965:11): [True: 0, False: 82.1k]
  ------------------
10966|  82.1k|			XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10967|  82.1k|                }
10968|  46.5k|                if (op->cache != NULL)
  ------------------
  |  Branch (10968:21): [True: 41.1k, False: 5.40k]
  ------------------
10969|  41.1k|                    func = op->cache;
10970|  5.40k|                else {
10971|  5.40k|                    const xmlChar *URI = NULL;
10972|       |
10973|  5.40k|                    if (op->value5 == NULL) {
  ------------------
  |  Branch (10973:25): [True: 5.32k, False: 78]
  ------------------
10974|  5.32k|                        func = xmlXPathFunctionLookup(ctxt->context,
10975|  5.32k|                                                      op->value4);
10976|  5.32k|                        if (func == NULL) {
  ------------------
  |  Branch (10976:29): [True: 521, False: 4.80k]
  ------------------
10977|    521|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10978|    521|                                           "Unregistered function: %s\n",
10979|    521|                                           op->value4);
10980|    521|                            return 0;
10981|    521|                        }
10982|  5.32k|                    } else {
10983|     78|                        URI = xmlXPathNsLookup(ctxt->context, op->value5);
10984|     78|                        if (URI == NULL) {
  ------------------
  |  Branch (10984:29): [True: 68, False: 10]
  ------------------
10985|     68|                            xmlXPathErrFmt(ctxt, XPATH_UNDEF_PREFIX_ERROR,
10986|     68|                                           "Undefined namespace prefix: %s\n",
10987|     68|                                           op->value5);
10988|     68|                            return 0;
10989|     68|                        }
10990|     10|                        func = xmlXPathFunctionLookupNS(ctxt->context,
10991|     10|                                                        op->value4, URI);
10992|     10|                        if (func == NULL) {
  ------------------
  |  Branch (10992:29): [True: 10, False: 0]
  ------------------
10993|     10|                            xmlXPathErrFmt(ctxt, XPATH_UNKNOWN_FUNC_ERROR,
10994|     10|                                           "Unregistered function: %s:%s\n",
10995|     10|                                           op->value5, op->value4);
10996|     10|                            return 0;
10997|     10|                        }
10998|     10|                    }
10999|  4.80k|                    op->cache = func;
11000|  4.80k|                    op->cacheURI = (void *) URI;
11001|  4.80k|                }
11002|  46.0k|                oldFunc = ctxt->context->function;
11003|  46.0k|                oldFuncURI = ctxt->context->functionURI;
11004|  46.0k|                ctxt->context->function = op->value4;
11005|  46.0k|                ctxt->context->functionURI = op->cacheURI;
11006|  46.0k|                func(ctxt, op->value);
11007|  46.0k|                ctxt->context->function = oldFunc;
11008|  46.0k|                ctxt->context->functionURI = oldFuncURI;
11009|  46.0k|                if ((ctxt->error == XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (11009:21): [True: 45.7k, False: 272]
  ------------------
11010|  45.7k|                    (ctxt->valueNr != frame + 1))
  ------------------
  |  Branch (11010:21): [True: 0, False: 45.7k]
  ------------------
11011|  46.0k|                    XP_ERROR0(XPATH_STACK_ERROR);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11012|  46.0k|                break;
11013|  46.0k|            }
11014|  84.1k|        case XPATH_OP_ARG:
  ------------------
  |  Branch (11014:9): [True: 84.1k, False: 3.88M]
  ------------------
11015|  84.1k|            if (op->ch1 != -1) {
  ------------------
  |  Branch (11015:17): [True: 44.4k, False: 39.7k]
  ------------------
11016|  44.4k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11017|  44.4k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  44.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 513, False: 43.9k]
  |  |  ------------------
  ------------------
11018|  44.4k|            }
11019|  83.6k|            if (op->ch2 != -1) {
  ------------------
  |  Branch (11019:17): [True: 83.6k, False: 0]
  ------------------
11020|  83.6k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
11021|  83.6k|	        CHECK_ERROR0;
  ------------------
  |  |  236|  83.6k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.04k, False: 82.6k]
  |  |  ------------------
  ------------------
11022|  83.6k|	    }
11023|  82.6k|            break;
11024|  82.6k|        case XPATH_OP_PREDICATE:
  ------------------
  |  Branch (11024:9): [True: 0, False: 3.96M]
  ------------------
11025|  13.6k|        case XPATH_OP_FILTER:{
  ------------------
  |  Branch (11025:9): [True: 13.6k, False: 3.95M]
  ------------------
11026|  13.6k|                xmlXPathObjectPtr obj;
11027|  13.6k|                xmlNodeSetPtr set;
11028|       |
11029|       |                /*
11030|       |                 * Optimization for ()[1] selection i.e. the first elem
11031|       |                 */
11032|  13.6k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11032:21): [True: 13.6k, False: 0]
  |  Branch (11032:40): [True: 13.6k, False: 0]
  ------------------
11033|  13.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|  13.6k|                    ((comp->steps[op->ch1].op == XPATH_OP_SORT) || /* 18 */
  ------------------
  |  Branch (11043:22): [True: 7.47k, False: 6.13k]
  ------------------
11044|  6.13k|		     (comp->steps[op->ch1].op == XPATH_OP_FILTER)) && /* 17 */
  ------------------
  |  Branch (11044:8): [True: 6.05k, False: 73]
  ------------------
11045|       |#else
11046|       |		    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
11047|       |#endif
11048|  13.5k|                    (comp->steps[op->ch2].op == XPATH_OP_VALUE)) { /* 12 */
  ------------------
  |  Branch (11048:21): [True: 8.75k, False: 4.77k]
  ------------------
11049|  8.75k|                    xmlXPathObjectPtr val;
11050|       |
11051|  8.75k|                    val = comp->steps[op->ch2].value4;
11052|  8.75k|                    if ((val != NULL) && (val->type == XPATH_NUMBER) &&
  ------------------
  |  Branch (11052:25): [True: 8.75k, False: 0]
  |  Branch (11052:42): [True: 8.75k, False: 7]
  ------------------
11053|  8.75k|                        (val->floatval == 1.0)) {
  ------------------
  |  Branch (11053:25): [True: 7.36k, False: 1.38k]
  ------------------
11054|  7.36k|                        xmlNodePtr first = NULL;
11055|       |
11056|  7.36k|                        total +=
11057|  7.36k|                            xmlXPathCompOpEvalFirst(ctxt,
11058|  7.36k|                                                    &comp->steps[op->ch1],
11059|  7.36k|                                                    &first);
11060|  7.36k|			CHECK_ERROR0;
  ------------------
  |  |  236|  7.36k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.31k, False: 6.04k]
  |  |  ------------------
  ------------------
11061|       |                        /*
11062|       |                         * The nodeset should be in document order,
11063|       |                         * Keep only the first value
11064|       |                         */
11065|  6.04k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11065:29): [True: 6.04k, False: 0]
  ------------------
11066|  6.04k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11066:29): [True: 5.87k, False: 175]
  ------------------
11067|  5.87k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11067:29): [True: 5.87k, False: 0]
  ------------------
11068|  5.87k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11068:29): [True: 137, False: 5.73k]
  ------------------
11069|    137|                            xmlXPathNodeSetClearFromPos(ctxt->value->nodesetval,
11070|    137|                                                        1, 1);
11071|  6.04k|                        break;
11072|  7.36k|                    }
11073|  8.75k|                }
11074|       |                /*
11075|       |                 * Optimization for ()[last()] selection i.e. the last elem
11076|       |                 */
11077|  6.23k|                if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (11077:21): [True: 6.23k, False: 0]
  |  Branch (11077:40): [True: 6.23k, False: 0]
  ------------------
11078|  6.23k|                    (comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (11078:21): [True: 4.88k, False: 1.35k]
  ------------------
11079|  4.88k|                    (comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (11079:21): [True: 4.41k, False: 468]
  ------------------
11080|  4.41k|                    int f = comp->steps[op->ch2].ch1;
11081|       |
11082|  4.41k|                    if ((f != -1) &&
  ------------------
  |  Branch (11082:25): [True: 4.41k, False: 0]
  ------------------
11083|  4.41k|                        (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (11083:25): [True: 2.54k, False: 1.87k]
  ------------------
11084|  2.54k|                        (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (11084:25): [True: 2.32k, False: 219]
  ------------------
11085|  2.32k|                        (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (11085:25): [True: 2.05k, False: 265]
  ------------------
11086|  2.05k|                        (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (11086:25): [True: 2.05k, False: 0]
  ------------------
11087|  2.05k|                        (xmlStrEqual
  ------------------
  |  Branch (11087:25): [True: 1.98k, False: 78]
  ------------------
11088|  2.05k|                         (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  2.05k|#define BAD_CAST (xmlChar *)
  ------------------
11089|  1.98k|                        xmlNodePtr last = NULL;
11090|       |
11091|  1.98k|                        total +=
11092|  1.98k|                            xmlXPathCompOpEvalLast(ctxt,
11093|  1.98k|                                                   &comp->steps[op->ch1],
11094|  1.98k|                                                   &last);
11095|  1.98k|			CHECK_ERROR0;
  ------------------
  |  |  236|  1.98k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 35, False: 1.94k]
  |  |  ------------------
  ------------------
11096|       |                        /*
11097|       |                         * The nodeset should be in document order,
11098|       |                         * Keep only the last value
11099|       |                         */
11100|  1.94k|                        if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11100:29): [True: 1.94k, False: 0]
  ------------------
11101|  1.94k|                            (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11101:29): [True: 1.91k, False: 36]
  ------------------
11102|  1.91k|                            (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11102:29): [True: 1.91k, False: 0]
  ------------------
11103|  1.91k|                            (ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (11103:29): [True: 1.82k, False: 81]
  ------------------
11104|  1.82k|                            (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11104:29): [True: 406, False: 1.42k]
  ------------------
11105|    406|                            xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
11106|  1.94k|                        break;
11107|  1.98k|                    }
11108|  4.41k|                }
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|  4.25k|                if (op->ch1 != -1)
  ------------------
  |  Branch (11120:21): [True: 4.25k, False: 0]
  ------------------
11121|  4.25k|                    total +=
11122|  4.25k|                        xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11123|  4.25k|		CHECK_ERROR0;
  ------------------
  |  |  236|  4.25k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 503, False: 3.75k]
  |  |  ------------------
  ------------------
11124|  3.75k|                if (op->ch2 == -1)
  ------------------
  |  Branch (11124:21): [True: 0, False: 3.75k]
  ------------------
11125|      0|                    break;
11126|  3.75k|                if (ctxt->value == NULL)
  ------------------
  |  Branch (11126:21): [True: 0, False: 3.75k]
  ------------------
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|  3.75k|                CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  3.75k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 3.75k]
  |  |  |  Branch (271:34): [True: 36, False: 3.71k]
  |  |  ------------------
  |  |  272|  3.75k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     36|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
11136|  3.71k|                obj = xmlXPathValuePop(ctxt);
11137|  3.71k|                set = obj->nodesetval;
11138|  3.71k|                if (set != NULL)
  ------------------
  |  Branch (11138:21): [True: 3.71k, False: 0]
  ------------------
11139|  3.71k|                    xmlXPathNodeSetFilter(ctxt, set, op->ch2,
11140|  3.71k|                                          1, set->nodeNr, 1);
11141|  3.71k|                xmlXPathValuePush(ctxt, obj);
11142|  3.71k|                break;
11143|  3.75k|            }
11144|  99.8k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (11144:9): [True: 99.8k, False: 3.87M]
  ------------------
11145|  99.8k|            if (op->ch1 != -1)
  ------------------
  |  Branch (11145:17): [True: 99.8k, False: 0]
  ------------------
11146|  99.8k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
11147|  99.8k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  99.8k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 4.45k, False: 95.3k]
  |  |  ------------------
  ------------------
11148|  95.3k|            if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (11148:17): [True: 95.3k, False: 0]
  ------------------
11149|  95.3k|                (ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (11149:17): [True: 56.5k, False: 38.8k]
  ------------------
11150|  56.5k|                (ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (11150:17): [True: 56.5k, False: 0]
  ------------------
11151|  56.5k|		(ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (11151:3): [True: 3.54k, False: 52.9k]
  ------------------
11152|  3.54k|	    {
11153|  3.54k|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
11154|  3.54k|	    }
11155|  95.3k|            break;
11156|      0|        default:
  ------------------
  |  Branch (11156:9): [True: 0, False: 3.96M]
  ------------------
11157|      0|            XP_ERROR0(XPATH_INVALID_OPERAND);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
11158|      0|            break;
11159|  3.96M|    }
11160|       |
11161|  3.93M|    ctxt->context->depth -= 1;
11162|  3.93M|    return (total);
11163|  3.96M|}
xpath.c:xmlXPathCompOpEvalFirst:
10406|  14.9k|{
10407|  14.9k|    int total = 0, cur;
10408|  14.9k|    xmlXPathCompExprPtr comp;
10409|  14.9k|    xmlXPathObjectPtr arg1, arg2;
10410|       |
10411|  14.9k|    CHECK_ERROR0;
  ------------------
  |  |  236|  14.9k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 14.9k]
  |  |  ------------------
  ------------------
10412|  14.9k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  14.9k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 14.9k, False: 0]
  |  |  |  Branch (818:39): [True: 0, False: 14.9k]
  |  |  ------------------
  ------------------
10413|      0|        return(0);
10414|  14.9k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  14.9k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10414:9): [True: 3, False: 14.9k]
  ------------------
10415|  14.9k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      3|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10416|  14.9k|    ctxt->context->depth += 1;
10417|  14.9k|    comp = ctxt->comp;
10418|  14.9k|    switch (op->op) {
10419|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10419:9): [True: 0, False: 14.9k]
  ------------------
10420|      0|            break;
10421|  2.62k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10421:9): [True: 2.62k, False: 12.3k]
  ------------------
10422|  2.62k|            total =
10423|  2.62k|                xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10424|  2.62k|                                        first);
10425|  2.62k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.62k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 234, 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.63k, False: 748]
  ------------------
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.63k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10440:7): [True: 830, False: 805]
  ------------------
10441|    830|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10442|  1.63k|                *first = ctxt->value->nodesetval->nodeTab[0];
10443|  1.63k|            }
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: 18, 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: 5, False: 2.36k]
  ------------------
10453|      8|	        xmlXPathReleaseObject(ctxt->context, arg1);
10454|      8|	        xmlXPathReleaseObject(ctxt->context, arg2);
10455|      8|                XP_ERROR0(XPATH_INVALID_TYPE);
  ------------------
  |  |  252|      8|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10456|      0|            }
10457|  2.36k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10457:17): [True: 2.36k, False: 0]
  ------------------
10458|  2.36k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10458:19): [True: 2.36k, False: 0]
  ------------------
10459|  2.36k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10459:19): [True: 0, False: 2.36k]
  ------------------
10460|  2.36k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10461|  2.36k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10461:19): [True: 2.36k, False: 0]
  ------------------
10462|  2.36k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10462:19): [True: 0, False: 2.36k]
  ------------------
10463|  2.36k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10464|      0|	        xmlXPathReleaseObject(ctxt->context, arg1);
10465|      0|	        xmlXPathReleaseObject(ctxt->context, arg2);
10466|      0|                break;
10467|      0|            }
10468|       |
10469|  2.36k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10469:17): [True: 2.36k, False: 0]
  ------------------
10470|  2.36k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10470:17): [True: 252, False: 2.10k]
  ------------------
10471|    252|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10472|    252|                                                        arg2->nodesetval);
10473|    252|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10473:21): [True: 1, False: 251]
  ------------------
10474|      1|                    xmlXPathPErrMemory(ctxt);
10475|    252|            }
10476|  2.36k|            xmlXPathValuePush(ctxt, arg1);
10477|  2.36k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10478|  2.36k|            total += cur;
10479|  2.36k|            break;
10480|    400|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10480:9): [True: 400, False: 14.5k]
  ------------------
10481|    400|            xmlXPathRoot(ctxt);
10482|    400|            break;
10483|  1.00k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10483:9): [True: 1.00k, False: 13.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|  3.37k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10493:9): [True: 3.37k, False: 11.6k]
  ------------------
10494|  3.37k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10494:21): [True: 0, False: 3.37k]
  ------------------
10495|      0|                    break;
10496|       |
10497|  3.37k|                total = xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10498|  3.37k|		CHECK_ERROR0;
  ------------------
  |  |  236|  3.37k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 7, False: 3.36k]
  |  |  ------------------
  ------------------
10499|       |
10500|  3.36k|                total += xmlXPathNodeCollectAndTest(ctxt, op, first, NULL, 0);
10501|  3.36k|                break;
10502|  3.37k|            }
10503|      5|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10503:9): [True: 5, False: 14.9k]
  ------------------
10504|      5|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10505|      5|            break;
10506|  2.62k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10506:9): [True: 2.62k, False: 12.3k]
  ------------------
10507|  2.62k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10507:17): [True: 2.62k, False: 0]
  ------------------
10508|  2.62k|                total +=
10509|  2.62k|                    xmlXPathCompOpEvalFirst(ctxt, &comp->steps[op->ch1],
10510|  2.62k|                                            first);
10511|  2.62k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  2.62k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 43, False: 2.58k]
  |  |  ------------------
  ------------------
10512|  2.58k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10512:17): [True: 2.58k, False: 0]
  ------------------
10513|  2.58k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10513:20): [True: 2.47k, False: 105]
  ------------------
10514|  2.47k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10514:20): [True: 2.47k, False: 0]
  ------------------
10515|  2.47k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10515:6): [True: 150, False: 2.32k]
  ------------------
10516|    150|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10517|  2.58k|            break;
10518|      0|#ifdef XP_OPTIMIZED_FILTER_FIRST
10519|  4.85k|	case XPATH_OP_FILTER:
  ------------------
  |  Branch (10519:2): [True: 4.85k, False: 10.1k]
  ------------------
10520|  4.85k|                total += xmlXPathCompOpEvalFilterFirst(ctxt, op, first);
10521|  4.85k|            break;
10522|      0|#endif
10523|    111|        default:
  ------------------
  |  Branch (10523:9): [True: 111, False: 14.8k]
  ------------------
10524|    111|            total += xmlXPathCompOpEval(ctxt, op);
10525|    111|            break;
10526|  14.9k|    }
10527|       |
10528|  14.6k|    ctxt->context->depth -= 1;
10529|  14.6k|    return(total);
10530|  14.9k|}
xpath.c:xmlXPathCompOpEvalFilterFirst:
10668|  4.85k|{
10669|  4.85k|    int total = 0;
10670|  4.85k|    xmlXPathCompExprPtr comp;
10671|  4.85k|    xmlXPathObjectPtr obj;
10672|  4.85k|    xmlNodeSetPtr set;
10673|       |
10674|  4.85k|    CHECK_ERROR0;
  ------------------
  |  |  236|  4.85k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 4.85k]
  |  |  ------------------
  ------------------
10675|  4.85k|    comp = ctxt->comp;
10676|       |    /*
10677|       |    * Optimization for ()[last()] selection i.e. the last elem
10678|       |    */
10679|  4.85k|    if ((op->ch1 != -1) && (op->ch2 != -1) &&
  ------------------
  |  Branch (10679:9): [True: 4.85k, False: 0]
  |  Branch (10679:28): [True: 4.85k, False: 0]
  ------------------
10680|  4.85k|	(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
  ------------------
  |  Branch (10680:2): [True: 3.50k, False: 1.34k]
  ------------------
10681|  3.50k|	(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
  ------------------
  |  Branch (10681:2): [True: 2.40k, False: 1.10k]
  ------------------
10682|  2.40k|	int f = comp->steps[op->ch2].ch1;
10683|       |
10684|  2.40k|	if ((f != -1) &&
  ------------------
  |  Branch (10684:6): [True: 2.40k, False: 0]
  ------------------
10685|  2.40k|	    (comp->steps[f].op == XPATH_OP_FUNCTION) &&
  ------------------
  |  Branch (10685:6): [True: 2.05k, False: 349]
  ------------------
10686|  2.05k|	    (comp->steps[f].value5 == NULL) &&
  ------------------
  |  Branch (10686:6): [True: 1.97k, False: 81]
  ------------------
10687|  1.97k|	    (comp->steps[f].value == 0) &&
  ------------------
  |  Branch (10687:6): [True: 1.76k, False: 205]
  ------------------
10688|  1.76k|	    (comp->steps[f].value4 != NULL) &&
  ------------------
  |  Branch (10688:6): [True: 1.76k, False: 0]
  ------------------
10689|  1.76k|	    (xmlStrEqual
  ------------------
  |  Branch (10689:6): [True: 1.68k, False: 83]
  ------------------
10690|  1.76k|	    (comp->steps[f].value4, BAD_CAST "last"))) {
  ------------------
  |  |   34|  1.76k|#define BAD_CAST (xmlChar *)
  ------------------
10691|  1.68k|	    xmlNodePtr last = NULL;
10692|       |
10693|  1.68k|	    total +=
10694|  1.68k|		xmlXPathCompOpEvalLast(ctxt,
10695|  1.68k|		    &comp->steps[op->ch1],
10696|  1.68k|		    &last);
10697|  1.68k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.68k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 13, False: 1.67k]
  |  |  ------------------
  ------------------
10698|       |	    /*
10699|       |	    * The nodeset should be in document order,
10700|       |	    * Keep only the last value
10701|       |	    */
10702|  1.67k|	    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (10702:10): [True: 1.67k, False: 0]
  ------------------
10703|  1.67k|		(ctxt->value->type == XPATH_NODESET) &&
  ------------------
  |  Branch (10703:3): [True: 1.59k, False: 74]
  ------------------
10704|  1.59k|		(ctxt->value->nodesetval != NULL) &&
  ------------------
  |  Branch (10704:3): [True: 1.59k, False: 0]
  ------------------
10705|  1.59k|		(ctxt->value->nodesetval->nodeTab != NULL) &&
  ------------------
  |  Branch (10705:3): [True: 1.32k, False: 269]
  ------------------
10706|  1.32k|		(ctxt->value->nodesetval->nodeNr > 1)) {
  ------------------
  |  Branch (10706:3): [True: 260, False: 1.06k]
  ------------------
10707|    260|                xmlXPathNodeSetKeepLast(ctxt->value->nodesetval);
10708|    260|		*first = *(ctxt->value->nodesetval->nodeTab);
10709|    260|	    }
10710|  1.67k|	    return (total);
10711|  1.68k|	}
10712|  2.40k|    }
10713|       |
10714|  3.16k|    if (op->ch1 != -1)
  ------------------
  |  Branch (10714:9): [True: 3.16k, False: 0]
  ------------------
10715|  3.16k|	total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10716|  3.16k|    CHECK_ERROR0;
  ------------------
  |  |  236|  3.16k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 1.25k, False: 1.91k]
  |  |  ------------------
  ------------------
10717|  1.91k|    if (op->ch2 == -1)
  ------------------
  |  Branch (10717:9): [True: 0, False: 1.91k]
  ------------------
10718|      0|	return (total);
10719|  1.91k|    if (ctxt->value == NULL)
  ------------------
  |  Branch (10719:9): [True: 0, False: 1.91k]
  ------------------
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.91k|    CHECK_TYPE0(XPATH_NODESET);
  ------------------
  |  |  271|  1.91k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (271:9): [True: 0, False: 1.91k]
  |  |  |  Branch (271:34): [True: 11, False: 1.90k]
  |  |  ------------------
  |  |  272|  1.91k|        XP_ERROR0(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  252|     11|    { xmlXPathErr(ctxt, X); return(0); }
  |  |  ------------------
  ------------------
10728|  1.90k|    obj = xmlXPathValuePop(ctxt);
10729|  1.90k|    set = obj->nodesetval;
10730|  1.90k|    if (set != NULL) {
  ------------------
  |  Branch (10730:9): [True: 1.90k, False: 0]
  ------------------
10731|  1.90k|        xmlXPathNodeSetFilter(ctxt, set, op->ch2, 1, 1, 1);
10732|  1.90k|        if (set->nodeNr > 0)
  ------------------
  |  Branch (10732:13): [True: 382, False: 1.52k]
  ------------------
10733|    382|            *first = set->nodeTab[0];
10734|  1.90k|    }
10735|  1.90k|    xmlXPathValuePush(ctxt, obj);
10736|       |
10737|  1.90k|    return (total);
10738|  1.91k|}
xpath.c:xmlXPathCompOpEvalLast:
10544|  32.3k|{
10545|  32.3k|    int total = 0, cur;
10546|  32.3k|    xmlXPathCompExprPtr comp;
10547|  32.3k|    xmlXPathObjectPtr arg1, arg2;
10548|       |
10549|  32.3k|    CHECK_ERROR0;
  ------------------
  |  |  236|  32.3k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 32.3k]
  |  |  ------------------
  ------------------
10550|  32.3k|    if (OP_LIMIT_EXCEEDED(ctxt, 1))
  ------------------
  |  |  818|  32.3k|    ((ctxt->context->opLimit != 0) && (xmlXPathCheckOpLimit(ctxt, n) < 0))
  |  |  ------------------
  |  |  |  Branch (818:6): [True: 32.3k, False: 0]
  |  |  |  Branch (818:39): [True: 1, False: 32.3k]
  |  |  ------------------
  ------------------
10551|      1|        return(0);
10552|  32.3k|    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
  ------------------
  |  |  112|  32.3k|#define XPATH_MAX_RECURSION_DEPTH 500
  ------------------
  |  Branch (10552:9): [True: 0, False: 32.3k]
  ------------------
10553|  32.3k|        XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
  ------------------
  |  |  252|      0|    { xmlXPathErr(ctxt, X); return(0); }
  ------------------
10554|  32.3k|    ctxt->context->depth += 1;
10555|  32.3k|    comp = ctxt->comp;
10556|  32.3k|    switch (op->op) {
10557|      0|        case XPATH_OP_END:
  ------------------
  |  Branch (10557:9): [True: 0, False: 32.3k]
  ------------------
10558|      0|            break;
10559|  12.5k|        case XPATH_OP_UNION:
  ------------------
  |  Branch (10559:9): [True: 12.5k, False: 19.7k]
  ------------------
10560|  12.5k|            total =
10561|  12.5k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1], last);
10562|  12.5k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  12.5k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 91, False: 12.4k]
  |  |  ------------------
  ------------------
10563|  12.4k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10563:17): [True: 12.4k, False: 0]
  ------------------
10564|  12.4k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10564:20): [True: 12.4k, False: 1]
  ------------------
10565|  12.4k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10565:20): [True: 12.4k, False: 0]
  ------------------
10566|  12.4k|                && (ctxt->value->nodesetval->nodeNr >= 1)) {
  ------------------
  |  Branch (10566:20): [True: 8.67k, False: 3.78k]
  ------------------
10567|       |                /*
10568|       |                 * limit tree traversing to first node in the result
10569|       |                 */
10570|  8.67k|		if (ctxt->value->nodesetval->nodeNr > 1)
  ------------------
  |  Branch (10570:7): [True: 1.71k, False: 6.96k]
  ------------------
10571|  1.71k|		    xmlXPathNodeSetSort(ctxt->value->nodesetval);
10572|  8.67k|                *last =
10573|  8.67k|                    ctxt->value->nodesetval->nodeTab[ctxt->value->
10574|  8.67k|                                                     nodesetval->nodeNr -
10575|  8.67k|                                                     1];
10576|  8.67k|            }
10577|  12.4k|            cur =
10578|  12.4k|                xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch2], last);
10579|  12.4k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  12.4k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 27, False: 12.4k]
  |  |  ------------------
  ------------------
10580|  12.4k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10580:17): [True: 12.4k, False: 0]
  ------------------
10581|  12.4k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10581:20): [True: 12.4k, False: 1]
  ------------------
10582|  12.4k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10582:20): [True: 12.4k, False: 0]
  ------------------
10583|  12.4k|                && (ctxt->value->nodesetval->nodeNr >= 1)) { /* TODO: NOP ? */
  ------------------
  |  Branch (10583:20): [True: 3.12k, False: 9.30k]
  ------------------
10584|  3.12k|            }
10585|       |
10586|  12.4k|            arg2 = xmlXPathValuePop(ctxt);
10587|  12.4k|            arg1 = xmlXPathValuePop(ctxt);
10588|  12.4k|            if ((arg1 == NULL) || (arg1->type != XPATH_NODESET) ||
  ------------------
  |  Branch (10588:17): [True: 0, False: 12.4k]
  |  Branch (10588:35): [True: 1, False: 12.4k]
  ------------------
10589|  12.4k|                (arg2 == NULL) || (arg2->type != XPATH_NODESET)) {
  ------------------
  |  Branch (10589:17): [True: 0, False: 12.4k]
  |  Branch (10589:35): [True: 1, False: 12.4k]
  ------------------
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|  12.4k|            if ((ctxt->context->opLimit != 0) &&
  ------------------
  |  Branch (10594:17): [True: 12.4k, False: 0]
  ------------------
10595|  12.4k|                (((arg1->nodesetval != NULL) &&
  ------------------
  |  Branch (10595:19): [True: 12.4k, False: 0]
  ------------------
10596|  12.4k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10596:19): [True: 1, False: 12.4k]
  ------------------
10597|  12.4k|                                        arg1->nodesetval->nodeNr) < 0)) ||
10598|  12.4k|                 ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10598:19): [True: 12.4k, False: 0]
  ------------------
10599|  12.4k|                  (xmlXPathCheckOpLimit(ctxt,
  ------------------
  |  Branch (10599:19): [True: 0, False: 12.4k]
  ------------------
10600|  12.4k|                                        arg2->nodesetval->nodeNr) < 0)))) {
10601|      1|	        xmlXPathReleaseObject(ctxt->context, arg1);
10602|      1|	        xmlXPathReleaseObject(ctxt->context, arg2);
10603|      1|                break;
10604|      1|            }
10605|       |
10606|  12.4k|            if ((arg2->nodesetval != NULL) &&
  ------------------
  |  Branch (10606:17): [True: 12.4k, False: 0]
  ------------------
10607|  12.4k|                (arg2->nodesetval->nodeNr != 0)) {
  ------------------
  |  Branch (10607:17): [True: 3.12k, False: 9.30k]
  ------------------
10608|  3.12k|                arg1->nodesetval = xmlXPathNodeSetMerge(arg1->nodesetval,
10609|  3.12k|                                                        arg2->nodesetval);
10610|  3.12k|                if (arg1->nodesetval == NULL)
  ------------------
  |  Branch (10610:21): [True: 2, False: 3.12k]
  ------------------
10611|      2|                    xmlXPathPErrMemory(ctxt);
10612|  3.12k|            }
10613|  12.4k|            xmlXPathValuePush(ctxt, arg1);
10614|  12.4k|	    xmlXPathReleaseObject(ctxt->context, arg2);
10615|  12.4k|            total += cur;
10616|  12.4k|            break;
10617|    436|        case XPATH_OP_ROOT:
  ------------------
  |  Branch (10617:9): [True: 436, False: 31.8k]
  ------------------
10618|    436|            xmlXPathRoot(ctxt);
10619|    436|            break;
10620|  1.34k|        case XPATH_OP_NODE:
  ------------------
  |  Branch (10620:9): [True: 1.34k, False: 30.9k]
  ------------------
10621|  1.34k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10621:17): [True: 0, False: 1.34k]
  ------------------
10622|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10623|  1.34k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.34k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.34k]
  |  |  ------------------
  ------------------
10624|  1.34k|            if (op->ch2 != -1)
  ------------------
  |  Branch (10624:17): [True: 0, False: 1.34k]
  ------------------
10625|      0|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
10626|  1.34k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  1.34k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 0, False: 1.34k]
  |  |  ------------------
  ------------------
10627|  1.34k|	    xmlXPathValuePush(ctxt, xmlXPathCacheNewNodeSet(ctxt,
10628|  1.34k|		ctxt->context->node));
10629|  1.34k|            break;
10630|  14.2k|        case XPATH_OP_COLLECT:{
  ------------------
  |  Branch (10630:9): [True: 14.2k, False: 18.1k]
  ------------------
10631|  14.2k|                if (op->ch1 == -1)
  ------------------
  |  Branch (10631:21): [True: 0, False: 14.2k]
  ------------------
10632|      0|                    break;
10633|       |
10634|  14.2k|                total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
10635|  14.2k|		CHECK_ERROR0;
  ------------------
  |  |  236|  14.2k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 19, False: 14.1k]
  |  |  ------------------
  ------------------
10636|       |
10637|  14.1k|                total += xmlXPathNodeCollectAndTest(ctxt, op, NULL, last, 0);
10638|  14.1k|                break;
10639|  14.2k|            }
10640|      2|        case XPATH_OP_VALUE:
  ------------------
  |  Branch (10640:9): [True: 2, False: 32.3k]
  ------------------
10641|      2|            xmlXPathValuePush(ctxt, xmlXPathCacheObjectCopy(ctxt, op->value4));
10642|      2|            break;
10643|  3.66k|        case XPATH_OP_SORT:
  ------------------
  |  Branch (10643:9): [True: 3.66k, False: 28.6k]
  ------------------
10644|  3.66k|            if (op->ch1 != -1)
  ------------------
  |  Branch (10644:17): [True: 3.66k, False: 0]
  ------------------
10645|  3.66k|                total +=
10646|  3.66k|                    xmlXPathCompOpEvalLast(ctxt, &comp->steps[op->ch1],
10647|  3.66k|                                           last);
10648|  3.66k|	    CHECK_ERROR0;
  ------------------
  |  |  236|  3.66k|    if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
  |  |  ------------------
  |  |  |  Branch (236:9): [True: 48, False: 3.61k]
  |  |  ------------------
  ------------------
10649|  3.61k|            if ((ctxt->value != NULL)
  ------------------
  |  Branch (10649:17): [True: 3.61k, False: 0]
  ------------------
10650|  3.61k|                && (ctxt->value->type == XPATH_NODESET)
  ------------------
  |  Branch (10650:20): [True: 3.50k, False: 110]
  ------------------
10651|  3.50k|                && (ctxt->value->nodesetval != NULL)
  ------------------
  |  Branch (10651:20): [True: 3.50k, False: 0]
  ------------------
10652|  3.50k|		&& (ctxt->value->nodesetval->nodeNr > 1))
  ------------------
  |  Branch (10652:6): [True: 666, False: 2.84k]
  ------------------
10653|    666|                xmlXPathNodeSetSort(ctxt->value->nodesetval);
10654|  3.61k|            break;
10655|    118|        default:
  ------------------
  |  Branch (10655:9): [True: 118, False: 32.2k]
  ------------------
10656|    118|            total += xmlXPathCompOpEval(ctxt, op);
10657|    118|            break;
10658|  32.3k|    }
10659|       |
10660|  32.1k|    ctxt->context->depth -= 1;
10661|  32.1k|    return (total);
10662|  32.3k|}
xpath.c:xmlXPathNodeSetKeepLast:
 3167|    666|{
 3168|    666|    int i;
 3169|    666|    xmlNodePtr node;
 3170|       |
 3171|    666|    if ((set == NULL) || (set->nodeNr <= 1))
  ------------------
  |  Branch (3171:9): [True: 0, False: 666]
  |  Branch (3171:26): [True: 0, False: 666]
  ------------------
 3172|      0|	return;
 3173|  4.18k|    for (i = 0; i < set->nodeNr - 1; i++) {
  ------------------
  |  Branch (3173:17): [True: 3.51k, False: 666]
  ------------------
 3174|  3.51k|        node = set->nodeTab[i];
 3175|  3.51k|        if ((node != NULL) &&
  ------------------
  |  Branch (3175:13): [True: 3.51k, False: 0]
  ------------------
 3176|  3.51k|            (node->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (3176:13): [True: 0, False: 3.51k]
  ------------------
 3177|      0|            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
 3178|  3.51k|    }
 3179|    666|    set->nodeTab[0] = set->nodeTab[set->nodeNr-1];
 3180|    666|    set->nodeNr = 1;
 3181|    666|}

xmlXPtrEval:
  607|  11.2k|xmlXPtrEval(const xmlChar *str, xmlXPathContext *ctx) {
  608|  11.2k|    xmlXPathParserContextPtr ctxt;
  609|  11.2k|    xmlXPathObjectPtr res = NULL, tmp;
  610|  11.2k|    xmlXPathObjectPtr init = NULL;
  611|  11.2k|    int stack = 0;
  612|       |
  613|  11.2k|    xmlInitParser();
  614|       |
  615|  11.2k|    if ((ctx == NULL) || (str == NULL))
  ------------------
  |  Branch (615:9): [True: 0, False: 11.2k]
  |  Branch (615:26): [True: 0, False: 11.2k]
  ------------------
  616|      0|	return(NULL);
  617|       |
  618|  11.2k|    xmlResetError(&ctx->lastError);
  619|       |
  620|  11.2k|    ctxt = xmlXPathNewParserContext(str, ctx);
  621|  11.2k|    if (ctxt == NULL) {
  ------------------
  |  Branch (621:9): [True: 91, False: 11.2k]
  ------------------
  622|     91|        xmlXPathErrMemory(ctx);
  623|     91|	return(NULL);
  624|     91|    }
  625|  11.2k|    xmlXPtrEvalXPointer(ctxt);
  626|  11.2k|    if (ctx->lastError.code != XML_ERR_OK)
  ------------------
  |  Branch (626:9): [True: 7.41k, False: 3.78k]
  ------------------
  627|  7.41k|        goto error;
  628|       |
  629|  3.78k|    if ((ctxt->value != NULL) &&
  ------------------
  |  Branch (629:9): [True: 1.17k, False: 2.61k]
  ------------------
  630|  1.17k|	(ctxt->value->type != XPATH_NODESET)) {
  ------------------
  |  Branch (630:2): [True: 0, False: 1.17k]
  ------------------
  631|      0|        xmlXPtrErr(ctxt, XML_XPTR_EVAL_FAILED,
  632|      0|		"xmlXPtrEval: evaluation failed to return a node set\n",
  633|      0|		   NULL);
  634|  3.78k|    } else {
  635|  3.78k|	res = xmlXPathValuePop(ctxt);
  636|  3.78k|    }
  637|       |
  638|  3.78k|    do {
  639|  3.78k|        tmp = xmlXPathValuePop(ctxt);
  640|  3.78k|	if (tmp != NULL) {
  ------------------
  |  Branch (640:6): [True: 0, False: 3.78k]
  ------------------
  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.78k|    } while (tmp != NULL);
  ------------------
  |  Branch (656:14): [True: 0, False: 3.78k]
  ------------------
  657|  3.78k|    if (stack != 0) {
  ------------------
  |  Branch (657:9): [True: 0, False: 3.78k]
  ------------------
  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.78k|    if (ctx->lastError.code != XML_ERR_OK) {
  ------------------
  |  Branch (662:9): [True: 0, False: 3.78k]
  ------------------
  663|      0|	xmlXPathFreeObject(res);
  664|      0|	res = NULL;
  665|      0|    }
  666|       |
  667|  11.2k|error:
  668|  11.2k|    xmlXPathFreeParserContext(ctxt);
  669|  11.2k|    return(res);
  670|  3.78k|}
xpointer.c:xmlXPtrEvalXPointer:
  528|  11.2k|xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
  529|  11.2k|    if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (529:9): [True: 11.2k, False: 0]
  ------------------
  530|       |	/* Allocate the value stack */
  531|  11.2k|	ctxt->valueTab = (xmlXPathObjectPtr *)
  532|  11.2k|			 xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
  533|  11.2k|	if (ctxt->valueTab == NULL) {
  ------------------
  |  Branch (533:6): [True: 27, False: 11.1k]
  ------------------
  534|     27|	    xmlXPathPErrMemory(ctxt);
  535|     27|	    return;
  536|     27|	}
  537|  11.1k|	ctxt->valueNr = 0;
  538|  11.1k|	ctxt->valueMax = 10;
  539|  11.1k|	ctxt->value = NULL;
  540|  11.1k|    }
  541|  11.1k|    SKIP_BLANKS;
  ------------------
  |  |  178|  11.1k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  13.5k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.35k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  542|  11.1k|    if (CUR == '/') {
  ------------------
  |  |  173|  11.1k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (542:9): [True: 171, False: 11.0k]
  ------------------
  543|    171|	xmlXPathRoot(ctxt);
  544|    171|        xmlXPtrEvalChildSeq(ctxt, NULL);
  545|  11.0k|    } else {
  546|  11.0k|	xmlChar *name;
  547|       |
  548|  11.0k|	name = xmlXPathParseName(ctxt);
  549|  11.0k|	if (name == NULL)
  ------------------
  |  Branch (549:6): [True: 126, False: 10.8k]
  ------------------
  550|  10.8k|	    XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    126|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  551|  10.8k|	if (CUR == '(') {
  ------------------
  |  |  173|  10.8k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (551:6): [True: 10.4k, False: 454]
  ------------------
  552|  10.4k|	    xmlXPtrEvalFullXPtr(ctxt, name);
  553|       |	    /* Short evaluation */
  554|  10.4k|	    return;
  555|  10.4k|	} else {
  556|       |	    /* this handle both Bare Names and Child Sequences */
  557|    454|	    xmlXPtrEvalChildSeq(ctxt, name);
  558|    454|	}
  559|  10.8k|    }
  560|    625|    SKIP_BLANKS;
  ------------------
  |  |  178|  2.09k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  13.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 2.09k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  561|    625|    if (CUR != 0)
  ------------------
  |  |  173|    625|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (561:9): [True: 345, False: 280]
  ------------------
  562|    345|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|    345|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  563|    280|}
xpointer.c:xmlXPtrEvalChildSeq:
  478|    663|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|    663|    if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  173|    174|#define CUR (*ctxt->cur)
  ------------------
                  if ((name == NULL) && (CUR == '/') && (NXT(1) != '1')) {
  ------------------
  |  |  175|    174|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (483:9): [True: 174, False: 489]
  |  Branch (483:27): [True: 174, False: 0]
  |  Branch (483:43): [True: 72, False: 102]
  ------------------
  484|     72|        xmlXPtrErr(ctxt, XML_XPTR_CHILDSEQ_START,
  485|     72|		   "warning: ChildSeq not starting by /1\n", NULL);
  486|     72|    }
  487|       |
  488|    663|    if (name != NULL) {
  ------------------
  |  Branch (488:9): [True: 489, False: 174]
  ------------------
  489|    489|	xmlXPathValuePush(ctxt, xmlXPathNewString(name));
  490|    489|	xmlFree(name);
  491|    489|	xmlXPathIdFunction(ctxt, 1);
  492|    489|	CHECK_ERROR;
  ------------------
  |  |  230|    489|    if (ctxt->error != XPATH_EXPRESSION_OK) return
  |  |  ------------------
  |  |  |  Branch (230:9): [True: 26, False: 463]
  |  |  ------------------
  ------------------
  493|    489|    }
  494|       |
  495|  1.84k|    while (CUR == '/') {
  ------------------
  |  |  173|  1.84k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (495:12): [True: 1.20k, False: 637]
  ------------------
  496|  1.20k|	int child = 0, overflow = 0;
  497|  1.20k|	NEXT;
  ------------------
  |  |  181|  1.20k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 1.20k, False: 0]
  |  |  ------------------
  ------------------
  498|       |
  499|  3.57k|	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  3.57k|#define CUR (*ctxt->cur)
  ------------------
              	while ((CUR >= '0') && (CUR <= '9')) {
  ------------------
  |  |  173|  2.56k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (499:9): [True: 2.56k, False: 1.01k]
  |  Branch (499:25): [True: 2.37k, False: 190]
  ------------------
  500|  2.37k|            int d = CUR - '0';
  ------------------
  |  |  173|  2.37k|#define CUR (*ctxt->cur)
  ------------------
  501|  2.37k|            if (child > INT_MAX / 10)
  ------------------
  |  Branch (501:17): [True: 606, False: 1.76k]
  ------------------
  502|    606|                overflow = 1;
  503|  1.76k|            else
  504|  1.76k|                child *= 10;
  505|  2.37k|            if (child > INT_MAX - d)
  ------------------
  |  Branch (505:17): [True: 120, False: 2.25k]
  ------------------
  506|    120|                overflow = 1;
  507|  2.25k|            else
  508|  2.25k|                child += d;
  509|  2.37k|	    NEXT;
  ------------------
  |  |  181|  2.37k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 2.37k, False: 0]
  |  |  ------------------
  ------------------
  510|  2.37k|	}
  511|  1.20k|        if (overflow)
  ------------------
  |  Branch (511:13): [True: 57, False: 1.14k]
  ------------------
  512|     57|            child = 0;
  513|  1.20k|	xmlXPtrGetChildNo(ctxt, child);
  514|  1.20k|    }
  515|    637|}
xpointer.c:xmlXPtrGetChildNo:
  191|  1.20k|xmlXPtrGetChildNo(xmlXPathParserContextPtr ctxt, int indx) {
  192|  1.20k|    xmlNodePtr cur = NULL;
  193|  1.20k|    xmlXPathObjectPtr obj;
  194|  1.20k|    xmlNodeSetPtr oldset;
  195|       |
  196|  1.20k|    CHECK_TYPE(XPATH_NODESET);
  ------------------
  |  |  261|  1.20k|    if ((ctxt->value == NULL) || (ctxt->value->type != typeval))	\
  |  |  ------------------
  |  |  |  Branch (261:9): [True: 211, False: 994]
  |  |  |  Branch (261:34): [True: 0, False: 994]
  |  |  ------------------
  |  |  262|  1.20k|        XP_ERROR(XPATH_INVALID_TYPE)
  |  |  ------------------
  |  |  |  |  244|    211|    { xmlXPathErr(ctxt, X); return; }
  |  |  ------------------
  ------------------
  197|    994|    obj = xmlXPathValuePop(ctxt);
  198|    994|    oldset = obj->nodesetval;
  199|    994|    if ((indx <= 0) || (oldset == NULL) || (oldset->nodeNr != 1)) {
  ------------------
  |  Branch (199:9): [True: 734, False: 260]
  |  Branch (199:24): [True: 0, False: 260]
  |  Branch (199:44): [True: 64, False: 196]
  ------------------
  200|    798|	xmlXPathFreeObject(obj);
  201|    798|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  202|    798|	return;
  203|    798|    }
  204|    196|    cur = xmlXPtrGetNthChild(oldset->nodeTab[0], indx);
  205|    196|    if (cur == NULL) {
  ------------------
  |  Branch (205:9): [True: 111, False: 85]
  ------------------
  206|    111|	xmlXPathFreeObject(obj);
  207|    111|	xmlXPathValuePush(ctxt, xmlXPathNewNodeSet(NULL));
  208|    111|	return;
  209|    111|    }
  210|     85|    oldset->nodeTab[0] = cur;
  211|     85|    xmlXPathValuePush(ctxt, obj);
  212|     85|}
xpointer.c:xmlXPtrGetNthChild:
  124|    196|xmlXPtrGetNthChild(xmlNodePtr cur, int no) {
  125|    196|    int i;
  126|    196|    if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
  ------------------
  |  Branch (126:9): [True: 0, False: 196]
  |  Branch (126:26): [True: 0, False: 196]
  ------------------
  127|      0|	return(cur);
  128|    196|    cur = cur->children;
  129|  1.10k|    for (i = 0;i <= no;cur = cur->next) {
  ------------------
  |  Branch (129:16): [True: 1.10k, False: 0]
  ------------------
  130|  1.10k|	if (cur == NULL)
  ------------------
  |  Branch (130:6): [True: 111, False: 994]
  ------------------
  131|    111|	    return(cur);
  132|    994|	if ((cur->type == XML_ELEMENT_NODE) ||
  ------------------
  |  Branch (132:6): [True: 737, False: 257]
  ------------------
  133|    257|	    (cur->type == XML_DOCUMENT_NODE) ||
  ------------------
  |  Branch (133:6): [True: 0, False: 257]
  ------------------
  134|    737|	    (cur->type == XML_HTML_DOCUMENT_NODE)) {
  ------------------
  |  Branch (134:6): [True: 0, False: 257]
  ------------------
  135|    737|	    i++;
  136|    737|	    if (i == no)
  ------------------
  |  Branch (136:10): [True: 85, False: 652]
  ------------------
  137|     85|		break;
  138|    737|	}
  139|    994|    }
  140|     85|    return(cur);
  141|    196|}
xpointer.c:xmlXPtrEvalFullXPtr:
  415|  10.4k|xmlXPtrEvalFullXPtr(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  416|  10.4k|    if (name == NULL)
  ------------------
  |  Branch (416:9): [True: 0, False: 10.4k]
  ------------------
  417|      0|    name = xmlXPathParseName(ctxt);
  418|  10.4k|    if (name == NULL)
  ------------------
  |  Branch (418:9): [True: 0, False: 10.4k]
  ------------------
  419|  10.4k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  420|  19.0k|    while (name != NULL) {
  ------------------
  |  Branch (420:12): [True: 16.2k, False: 2.84k]
  ------------------
  421|  16.2k|	ctxt->error = XPATH_EXPRESSION_OK;
  422|  16.2k|	xmlXPtrEvalXPtrPart(ctxt, name);
  423|       |
  424|       |	/* in case of syntax error, break here */
  425|  16.2k|	if ((ctxt->error != XPATH_EXPRESSION_OK) &&
  ------------------
  |  Branch (425:6): [True: 7.17k, False: 9.03k]
  ------------------
  426|  7.17k|            (ctxt->error != XML_XPTR_UNKNOWN_SCHEME))
  ------------------
  |  Branch (426:13): [True: 6.67k, False: 500]
  ------------------
  427|  6.67k|	    return;
  428|       |
  429|       |	/*
  430|       |	 * If the returned value is a non-empty nodeset
  431|       |	 * or location set, return here.
  432|       |	 */
  433|  9.53k|	if (ctxt->value != NULL) {
  ------------------
  |  Branch (433:6): [True: 8.40k, False: 1.12k]
  ------------------
  434|  8.40k|	    xmlXPathObjectPtr obj = ctxt->value;
  435|       |
  436|  8.40k|	    switch (obj->type) {
  437|  1.83k|		case XPATH_NODESET: {
  ------------------
  |  Branch (437:3): [True: 1.83k, False: 6.57k]
  ------------------
  438|  1.83k|		    xmlNodeSetPtr loc = ctxt->value->nodesetval;
  439|  1.83k|		    if ((loc != NULL) && (loc->nodeNr > 0))
  ------------------
  |  Branch (439:11): [True: 1.83k, False: 0]
  |  Branch (439:28): [True: 911, False: 920]
  ------------------
  440|    911|			return;
  441|    920|		    break;
  442|  1.83k|		}
  443|  6.57k|		default:
  ------------------
  |  Branch (443:3): [True: 6.57k, False: 1.83k]
  ------------------
  444|  6.57k|		    break;
  445|  8.40k|	    }
  446|       |
  447|       |	    /*
  448|       |	     * Evaluating to improper values is equivalent to
  449|       |	     * a sub-resource error, clean-up the stack
  450|       |	     */
  451|  14.9k|	    do {
  452|  14.9k|		obj = xmlXPathValuePop(ctxt);
  453|  14.9k|		if (obj != NULL) {
  ------------------
  |  Branch (453:7): [True: 7.49k, False: 7.49k]
  ------------------
  454|  7.49k|		    xmlXPathFreeObject(obj);
  455|  7.49k|		}
  456|  14.9k|	    } while (obj != NULL);
  ------------------
  |  Branch (456:15): [True: 7.49k, False: 7.49k]
  ------------------
  457|  7.49k|	}
  458|       |
  459|       |	/*
  460|       |	 * Is there another XPointer part.
  461|       |	 */
  462|  8.62k|	SKIP_BLANKS;
  ------------------
  |  |  178|  8.62k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  17.4k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 7.94k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  8.62k|	name = xmlXPathParseName(ctxt);
  464|  8.62k|    }
  465|  10.4k|}
xpointer.c:xmlXPtrEvalXPtrPart:
  248|  16.2k|xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
  249|  16.2k|    xmlChar *buffer, *cur;
  250|  16.2k|    int len;
  251|  16.2k|    int level;
  252|       |
  253|  16.2k|    if (name == NULL)
  ------------------
  |  Branch (253:9): [True: 0, False: 16.2k]
  ------------------
  254|      0|    name = xmlXPathParseName(ctxt);
  255|  16.2k|    if (name == NULL)
  ------------------
  |  Branch (255:9): [True: 0, False: 16.2k]
  ------------------
  256|  16.2k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|      0|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  257|       |
  258|  16.2k|    if (CUR != '(') {
  ------------------
  |  |  173|  16.2k|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (258:9): [True: 1.21k, False: 14.9k]
  ------------------
  259|  1.21k|        xmlFree(name);
  260|  1.21k|	XP_ERROR(XPATH_EXPR_ERROR);
  ------------------
  |  |  244|  1.21k|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  261|      0|    }
  262|  14.9k|    NEXT;
  ------------------
  |  |  181|  14.9k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 14.9k, False: 0]
  |  |  ------------------
  ------------------
  263|  14.9k|    level = 1;
  264|       |
  265|  14.9k|    len = xmlStrlen(ctxt->cur);
  266|       |    /* Overflow in xmlStrlen */
  267|  14.9k|    if (len == 0 && ctxt->cur != NULL && *ctxt->cur != 0) {
  ------------------
  |  Branch (267:9): [True: 34, False: 14.9k]
  |  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|  14.9k|    len++;
  274|  14.9k|    buffer = xmlMalloc(len);
  275|  14.9k|    if (buffer == NULL) {
  ------------------
  |  Branch (275:9): [True: 29, False: 14.9k]
  ------------------
  276|     29|        xmlXPathPErrMemory(ctxt);
  277|     29|        xmlFree(name);
  278|     29|	return;
  279|     29|    }
  280|       |
  281|  14.9k|    cur = buffer;
  282|  3.95M|    while (CUR != 0) {
  ------------------
  |  |  173|  3.95M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (282:12): [True: 3.95M, False: 210]
  ------------------
  283|  3.95M|	if (CUR == ')') {
  ------------------
  |  |  173|  3.95M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (283:6): [True: 29.7k, False: 3.92M]
  ------------------
  284|  29.7k|	    level--;
  285|  29.7k|	    if (level == 0) {
  ------------------
  |  Branch (285:10): [True: 14.7k, False: 14.9k]
  ------------------
  286|  14.7k|		NEXT;
  ------------------
  |  |  181|  14.7k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 14.7k, False: 0]
  |  |  ------------------
  ------------------
  287|  14.7k|		break;
  288|  14.7k|	    }
  289|  3.92M|	} else if (CUR == '(') {
  ------------------
  |  |  173|  3.92M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (289:13): [True: 15.5k, False: 3.90M]
  ------------------
  290|  15.5k|	    level++;
  291|  3.90M|	} else if (CUR == '^') {
  ------------------
  |  |  173|  3.90M|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (291:13): [True: 19.1k, False: 3.88M]
  ------------------
  292|  19.1k|            if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  19.1k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  18.7k|#define NXT(val) ctxt->cur[(val)]
  ------------------
                          if ((NXT(1) == ')') || (NXT(1) == '(') || (NXT(1) == '^')) {
  ------------------
  |  |  175|  18.2k|#define NXT(val) ctxt->cur[(val)]
  ------------------
  |  Branch (292:17): [True: 374, False: 18.7k]
  |  Branch (292:36): [True: 483, False: 18.2k]
  |  Branch (292:55): [True: 17.3k, False: 866]
  ------------------
  293|  18.2k|                NEXT;
  ------------------
  |  |  181|  18.2k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 18.2k, False: 0]
  |  |  ------------------
  ------------------
  294|  18.2k|            }
  295|  19.1k|	}
  296|  3.93M|        *cur++ = CUR;
  ------------------
  |  |  173|  3.93M|#define CUR (*ctxt->cur)
  ------------------
  297|  3.93M|	NEXT;
  ------------------
  |  |  181|  3.93M|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 3.93M, False: 0]
  |  |  ------------------
  ------------------
  298|  3.93M|    }
  299|  14.9k|    *cur = 0;
  300|       |
  301|  14.9k|    if ((level != 0) && (CUR == 0)) {
  ------------------
  |  |  173|    210|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (301:9): [True: 210, False: 14.7k]
  |  Branch (301:25): [True: 210, False: 0]
  ------------------
  302|    210|        xmlFree(name);
  303|    210|	xmlFree(buffer);
  304|    210|	XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|    210|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  305|      0|    }
  306|       |
  307|  14.7k|    if (xmlStrEqual(name, (xmlChar *) "xpointer") ||
  ------------------
  |  Branch (307:9): [True: 13.7k, False: 1.01k]
  ------------------
  308|  13.7k|        xmlStrEqual(name, (xmlChar *) "xpath1")) {
  ------------------
  |  Branch (308:9): [True: 24, False: 994]
  ------------------
  309|  13.7k|	const xmlChar *oldBase = ctxt->base;
  310|  13.7k|	const xmlChar *oldCur = ctxt->cur;
  311|       |
  312|  13.7k|	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|  13.7k|	ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
  320|  13.7k|	ctxt->context->proximityPosition = 1;
  321|  13.7k|	ctxt->context->contextSize = 1;
  322|  13.7k|	xmlXPathEvalExpr(ctxt);
  323|  13.7k|	ctxt->base = oldBase;
  324|  13.7k|        ctxt->cur = oldCur;
  325|  13.7k|    } else if (xmlStrEqual(name, (xmlChar *) "element")) {
  ------------------
  |  Branch (325:16): [True: 41, False: 953]
  ------------------
  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|    953|    } else if (xmlStrEqual(name, (xmlChar *) "xmlns")) {
  ------------------
  |  Branch (348:16): [True: 451, False: 502]
  ------------------
  349|    451|	const xmlChar *oldBase = ctxt->base;
  350|    451|	const xmlChar *oldCur = ctxt->cur;
  351|    451|	xmlChar *prefix;
  352|       |
  353|    451|	ctxt->cur = ctxt->base = buffer;
  354|    451|        prefix = xmlXPathParseNCName(ctxt);
  355|    451|	if (prefix == NULL) {
  ------------------
  |  Branch (355:6): [True: 4, False: 447]
  ------------------
  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|    447|	SKIP_BLANKS;
  ------------------
  |  |  178|  6.01k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  6.46k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 6.01k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|    447|	if (CUR != '=') {
  ------------------
  |  |  173|    447|#define CUR (*ctxt->cur)
  ------------------
  |  Branch (363:6): [True: 14, False: 433]
  ------------------
  364|     14|            ctxt->base = oldBase;
  365|     14|            ctxt->cur = oldCur;
  366|     14|	    xmlFree(prefix);
  367|     14|	    xmlFree(buffer);
  368|     14|	    xmlFree(name);
  369|     14|	    XP_ERROR(XPTR_SYNTAX_ERROR);
  ------------------
  |  |  244|     14|    { xmlXPathErr(ctxt, X); return; }
  ------------------
  370|      0|	}
  371|    433|	NEXT;
  ------------------
  |  |  181|    433|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  ------------------
  |  |  |  Branch (181:15): [True: 433, False: 0]
  |  |  ------------------
  ------------------
  372|    433|	SKIP_BLANKS;
  ------------------
  |  |  178|  1.73k|    while (IS_BLANK_CH(*(ctxt->cur))) NEXT
  |  |  ------------------
  |  |  |  |  181|  2.16k|#define NEXT ((*ctxt->cur) ?  ctxt->cur++: ctxt->cur)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (181:15): [True: 1.73k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  373|       |
  374|    433|	if (xmlXPathRegisterNs(ctxt->context, prefix, ctxt->cur) < 0)
  ------------------
  |  Branch (374:6): [True: 5, False: 428]
  ------------------
  375|      5|            xmlXPathPErrMemory(ctxt);
  376|    433|        ctxt->base = oldBase;
  377|    433|        ctxt->cur = oldCur;
  378|    433|	xmlFree(prefix);
  379|    433|#endif /* XPTR_XMLNS_SCHEME */
  380|    502|    } else {
  381|    502|        xmlXPtrErr(ctxt, XML_XPTR_UNKNOWN_SCHEME,
  382|    502|		   "unsupported scheme '%s'\n", name);
  383|    502|    }
  384|  14.7k|    xmlFree(buffer);
  385|  14.7k|    xmlFree(name);
  386|  14.7k|}
xpointer.c:xmlXPtrErr:
   67|    574|{
   68|    574|    xmlStructuredErrorFunc serror = NULL;
   69|    574|    void *data = NULL;
   70|    574|    xmlNodePtr node = NULL;
   71|    574|    int res;
   72|       |
   73|    574|    if (ctxt == NULL)
  ------------------
  |  Branch (73:9): [True: 0, False: 574]
  ------------------
   74|      0|        return;
   75|       |    /* Only report the first error */
   76|    574|    if (ctxt->error != 0)
  ------------------
  |  Branch (76:9): [True: 3, False: 571]
  ------------------
   77|      3|        return;
   78|       |
   79|    571|    ctxt->error = code;
   80|       |
   81|    571|    if (ctxt->context != NULL) {
  ------------------
  |  Branch (81:9): [True: 571, False: 0]
  ------------------
   82|    571|        xmlErrorPtr err = &ctxt->context->lastError;
   83|       |
   84|       |        /* cleanup current last error */
   85|    571|        xmlResetError(err);
   86|       |
   87|    571|        err->domain = XML_FROM_XPOINTER;
   88|    571|        err->code = code;
   89|    571|        err->level = XML_ERR_ERROR;
   90|    571|        err->str1 = (char *) xmlStrdup(ctxt->base);
   91|    571|        if (err->str1 == NULL) {
  ------------------
  |  Branch (91:13): [True: 1, False: 570]
  ------------------
   92|      1|            xmlXPathPErrMemory(ctxt);
   93|      1|            return;
   94|      1|        }
   95|    570|        err->int1 = ctxt->cur - ctxt->base;
   96|    570|        err->node = ctxt->context->debugNode;
   97|       |
   98|    570|        serror = ctxt->context->error;
   99|    570|        data = ctxt->context->userData;
  100|    570|        node = ctxt->context->debugNode;
  101|    570|    }
  102|       |
  103|    570|    res = xmlRaiseError(serror, NULL, data, NULL, node,
  104|    570|                        XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0,
  105|    570|                        (const char *) extra, (const char *) ctxt->base,
  106|    570|                        NULL, ctxt->cur - ctxt->base, 0,
  107|    570|                        msg, extra);
  108|    570|    if (res < 0)
  ------------------
  |  Branch (108:9): [True: 3, False: 567]
  ------------------
  109|      3|        xmlXPathPErrMemory(ctxt);
  110|    570|}

